remove some constants from utils to constants
This commit is contained in:
parent
1c769e54f9
commit
2aabf54b9d
6 changed files with 23 additions and 21 deletions
|
|
@ -1,12 +1,11 @@
|
|||
import { useContext, useEffect, useState } from "react";
|
||||
import { PopUpContext } from "../../contexts/popUpContext";
|
||||
import GenericModal from "../../modals/genericModal";
|
||||
import { TextAreaComponentType } from "../../types/components";
|
||||
import { TypeModal } from "../../utils";
|
||||
|
||||
import { ExternalLink } from "lucide-react";
|
||||
import { useContext, useEffect, useState } from "react";
|
||||
import { TypeModal } from "../../constants";
|
||||
import { PopUpContext } from "../../contexts/popUpContext";
|
||||
import { typesContext } from "../../contexts/typesContext";
|
||||
import { postValidatePrompt } from "../../controllers/API";
|
||||
import GenericModal from "../../modals/genericModal";
|
||||
import { TextAreaComponentType } from "../../types/components";
|
||||
|
||||
export default function PromptAreaComponent({
|
||||
field_name,
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@ import { useContext, useEffect, useState } from "react";
|
|||
import { PopUpContext } from "../../contexts/popUpContext";
|
||||
import GenericModal from "../../modals/genericModal";
|
||||
import { TextAreaComponentType } from "../../types/components";
|
||||
import { TypeModal } from "../../utils";
|
||||
|
||||
import { ExternalLink } from "lucide-react";
|
||||
import { TypeModal } from "../../constants";
|
||||
import { TabsContext } from "../../contexts/tabsContext";
|
||||
|
||||
export default function TextAreaComponent({
|
||||
|
|
|
|||
|
|
@ -5,6 +5,14 @@ import { FlowType } from "./types/flow";
|
|||
import { TabsState } from "./types/tabs";
|
||||
import { buildInputs, buildTweaks } from "./utils";
|
||||
|
||||
/**
|
||||
* enum for the different types of nodes
|
||||
* @enum
|
||||
*/
|
||||
export enum TypeModal {
|
||||
TEXT = 1,
|
||||
PROMPT = 2,
|
||||
}
|
||||
/**
|
||||
* Number maximum of components to scroll on tooltips
|
||||
* @constant
|
||||
|
|
@ -17,6 +25,12 @@ export const MAX_LENGTH_TO_SCROLL_TOOLTIP = 200;
|
|||
*/
|
||||
export const MAX_WORDS_HIGHLIGHT = 79;
|
||||
|
||||
/**
|
||||
* Limit of items before show scroll on fields modal
|
||||
* @constant
|
||||
*/
|
||||
export const limitScrollFieldsModal = 10;
|
||||
|
||||
/**
|
||||
* The base text for subtitle of Export Dialog (Toolbar)
|
||||
* @constant
|
||||
|
|
@ -1,15 +1,11 @@
|
|||
import { Dialog, Transition } from "@headlessui/react";
|
||||
import { X } from "lucide-react";
|
||||
import { Fragment, useContext, useRef, useState } from "react";
|
||||
import { limitScrollFieldsModal } from "../../constants";
|
||||
import { PopUpContext } from "../../contexts/popUpContext";
|
||||
import { typesContext } from "../../contexts/typesContext";
|
||||
import { NodeDataType } from "../../types/flow";
|
||||
import {
|
||||
classNames,
|
||||
limitScrollFieldsModal,
|
||||
nodeIconsLucide,
|
||||
toTitleCase,
|
||||
} from "../../utils";
|
||||
import { classNames, nodeIconsLucide, toTitleCase } from "../../utils";
|
||||
import { nodeColors } from "../../utils/styleUtils";
|
||||
import ModalField from "./components/ModalField";
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import {
|
|||
MAX_WORDS_HIGHLIGHT,
|
||||
PROMPT_DIALOG_SUBTITLE,
|
||||
TEXT_DIALOG_SUBTITLE,
|
||||
TypeModal,
|
||||
} from "../../constants";
|
||||
import { alertContext } from "../../contexts/alertContext";
|
||||
import { darkContext } from "../../contexts/darkContext";
|
||||
|
|
@ -18,7 +19,6 @@ import { postValidatePrompt } from "../../controllers/API";
|
|||
import { APIClassType } from "../../types/api";
|
||||
import {
|
||||
INVALID_CHARACTERS,
|
||||
TypeModal,
|
||||
classNames,
|
||||
getRandomKeyByssmm,
|
||||
regexHighlight,
|
||||
|
|
|
|||
|
|
@ -55,13 +55,6 @@ export function classNames(...classes: Array<string>) {
|
|||
return classes.filter(Boolean).join(" ");
|
||||
}
|
||||
|
||||
export const limitScrollFieldsModal = 10;
|
||||
|
||||
export enum TypeModal {
|
||||
TEXT = 1,
|
||||
PROMPT = 2,
|
||||
}
|
||||
|
||||
export const nodeIconsLucide: {
|
||||
[char: string]: React.ForwardRefExoticComponent<
|
||||
ComponentType<SVGProps<SVGSVGElement>>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue