@code0-tech/pictor 0.0.0-mvp.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +29 -0
- package/README.md +0 -0
- package/dist/_virtual/compiler-runtime.js +5 -0
- package/dist/_virtual/compiler-runtime2.js +4 -0
- package/dist/_virtual/react-compiler-runtime.development.js +4 -0
- package/dist/_virtual/react-compiler-runtime.production.js +4 -0
- package/dist/assets/components/avatar/Avatar.style.css +1 -0
- package/dist/assets/components/badge/Badge.style.css +1 -0
- package/dist/assets/components/breadcrumb/Breadcrumb.style.css +1 -0
- package/dist/assets/components/button/Button.style.css +1 -0
- package/dist/assets/components/button-group/ButtonGroup.style.css +1 -0
- package/dist/assets/components/card/Card.style.css +1 -0
- package/dist/assets/components/col/Col.style.css +1 -0
- package/dist/assets/components/command/Command.style.css +1 -0
- package/dist/assets/components/container/Container.style.css +1 -0
- package/dist/assets/components/d-flow/DFlow.style.css +1 -0
- package/dist/assets/components/d-flow/folder/DFlowFolder.style.css +1 -0
- package/dist/assets/components/d-flow/function/DFlowFunctionDefaultCard.style.css +1 -0
- package/dist/assets/components/d-flow/input/DFlowInputDataType.style.css +1 -0
- package/dist/assets/components/d-flow/minimap/DFlowMiniMap.style.css +1 -0
- package/dist/assets/components/d-flow/suggestion/DFlowSuggestionSearchInput.style.css +1 -0
- package/dist/assets/components/d-flow/validation/DFlowValidation.style.css +1 -0
- package/dist/assets/components/d-fullscreen/DFullScreen.style.css +1 -0
- package/dist/assets/components/d-layout/DLayout.style.css +1 -0
- package/dist/assets/components/d-resizable/DResizable.style.css +1 -0
- package/dist/assets/components/dialog/Dialog.style.css +1 -0
- package/dist/assets/components/file-tabs/FileTabs.style.css +1 -0
- package/dist/assets/components/flex/Flex.style.css +1 -0
- package/dist/assets/components/form/Input.style.css +1 -0
- package/dist/assets/components/menu/Menu.style.css +1 -0
- package/dist/assets/components/quote/Quote.style.css +1 -0
- package/dist/assets/components/row/Row.style.css +1 -0
- package/dist/assets/components/scroll-area/ScrollArea.style.css +1 -0
- package/dist/assets/components/segmented-control/SegmentedControl.style.css +1 -0
- package/dist/assets/components/spacing/Spacing.style.css +1 -0
- package/dist/assets/components/tab/Tab.style.css +1 -0
- package/dist/assets/components/text/Text.style.css +1 -0
- package/dist/assets/components/tooltip/Tooltip.style.css +1 -0
- package/dist/assets/node_modules/@xyflow/react/dist/style.css +1 -0
- package/dist/components/avatar/Avatar.d.ts +8 -0
- package/dist/components/avatar/Avatar.js +55 -0
- package/dist/components/badge/Badge.d.ts +7 -0
- package/dist/components/badge/Badge.js +22 -0
- package/dist/components/breadcrumb/Breadcrumb.d.ts +7 -0
- package/dist/components/breadcrumb/Breadcrumb.js +32 -0
- package/dist/components/button/Button.d.ts +10 -0
- package/dist/components/button/Button.js +29 -0
- package/dist/components/button-group/ButtonGroup.d.ts +7 -0
- package/dist/components/button-group/ButtonGroup.js +27 -0
- package/dist/components/card/Card.d.ts +14 -0
- package/dist/components/card/Card.js +39 -0
- package/dist/components/card/CardSection.d.ts +9 -0
- package/dist/components/card/CardSection.js +22 -0
- package/dist/components/col/Col.d.ts +13 -0
- package/dist/components/col/Col.js +27 -0
- package/dist/components/command/Command.d.ts +30 -0
- package/dist/components/command/Command.js +103 -0
- package/dist/components/container/Container.d.ts +6 -0
- package/dist/components/container/Container.js +21 -0
- package/dist/components/d-flow/DFlow.d.ts +5 -0
- package/dist/components/d-flow/DFlow.edges.hook.d.ts +4 -0
- package/dist/components/d-flow/DFlow.edges.hook.js +144 -0
- package/dist/components/d-flow/DFlow.js +375 -0
- package/dist/components/d-flow/DFlow.nodes.hook.d.ts +3 -0
- package/dist/components/d-flow/DFlow.nodes.hook.js +139 -0
- package/dist/components/d-flow/DFlow.service.d.ts +10 -0
- package/dist/components/d-flow/DFlow.service.js +11 -0
- package/dist/components/d-flow/DFlow.view.d.ts +109 -0
- package/dist/components/d-flow/DFlow.view.js +213 -0
- package/dist/components/d-flow/control/DFlowControl.d.ts +2 -0
- package/dist/components/d-flow/control/DFlowControl.js +77 -0
- package/dist/components/d-flow/control/index.d.ts +1 -0
- package/dist/components/d-flow/control/index.js +4 -0
- package/dist/components/d-flow/data-type/DFlowDataType.service.d.ts +10 -0
- package/dist/components/d-flow/data-type/DFlowDataType.service.js +91 -0
- package/dist/components/d-flow/data-type/DFlowDataType.validation.type.d.ts +2 -0
- package/dist/components/d-flow/data-type/DFlowDataType.validation.type.js +18 -0
- package/dist/components/d-flow/data-type/DFlowDataType.validation.value.d.ts +4 -0
- package/dist/components/d-flow/data-type/DFlowDataType.validation.value.js +20 -0
- package/dist/components/d-flow/data-type/DFlowDataType.view.d.ts +32 -0
- package/dist/components/d-flow/data-type/DFlowDataType.view.js +65 -0
- package/dist/components/d-flow/data-type/index.d.ts +2 -0
- package/dist/components/d-flow/data-type/index.js +6 -0
- package/dist/components/d-flow/data-type/rules/DFlowDataTypeContainsKeyRule.d.ts +6 -0
- package/dist/components/d-flow/data-type/rules/DFlowDataTypeContainsKeyRule.js +222 -0
- package/dist/components/d-flow/data-type/rules/DFlowDataTypeContainsTypeRule.d.ts +6 -0
- package/dist/components/d-flow/data-type/rules/DFlowDataTypeContainsTypeRule.js +229 -0
- package/dist/components/d-flow/data-type/rules/DFlowDataTypeItemOfCollectionRule.d.ts +7 -0
- package/dist/components/d-flow/data-type/rules/DFlowDataTypeItemOfCollectionRule.js +214 -0
- package/dist/components/d-flow/data-type/rules/DFlowDataTypeNumberRangeRule.d.ts +4 -0
- package/dist/components/d-flow/data-type/rules/DFlowDataTypeNumberRangeRule.js +214 -0
- package/dist/components/d-flow/data-type/rules/DFlowDataTypeParentRule.d.ts +9 -0
- package/dist/components/d-flow/data-type/rules/DFlowDataTypeParentRule.js +217 -0
- package/dist/components/d-flow/data-type/rules/DFlowDataTypeRegexRule.d.ts +4 -0
- package/dist/components/d-flow/data-type/rules/DFlowDataTypeRegexRule.js +214 -0
- package/dist/components/d-flow/data-type/rules/DFlowDataTypeReturnTypeRule.d.ts +6 -0
- package/dist/components/d-flow/data-type/rules/DFlowDataTypeReturnTypeRule.js +243 -0
- package/dist/components/d-flow/data-type/rules/DFlowDataTypeRule.d.ts +8 -0
- package/dist/components/d-flow/data-type/rules/DFlowDataTypeRule.js +10 -0
- package/dist/components/d-flow/data-type/rules/DFlowDataTypeRules.d.ts +3 -0
- package/dist/components/d-flow/data-type/rules/DFlowDataTypeRules.js +10 -0
- package/dist/components/d-flow/edge/DFlowEdge.d.ts +10 -0
- package/dist/components/d-flow/edge/DFlowEdge.js +48 -0
- package/dist/components/d-flow/folder/DFlowFolder.d.ts +19 -0
- package/dist/components/d-flow/folder/DFlowFolder.js +119 -0
- package/dist/components/d-flow/folder/index.d.ts +1 -0
- package/dist/components/d-flow/folder/index.js +6 -0
- package/dist/components/d-flow/function/DFlowFunction.input.hook.d.ts +4 -0
- package/dist/components/d-flow/function/DFlowFunction.input.hook.js +9 -0
- package/dist/components/d-flow/function/DFlowFunction.return.hook.d.ts +4 -0
- package/dist/components/d-flow/function/DFlowFunction.return.hook.js +11 -0
- package/dist/components/d-flow/function/DFlowFunction.service.d.ts +6 -0
- package/dist/components/d-flow/function/DFlowFunction.service.js +9 -0
- package/dist/components/d-flow/function/DFlowFunction.vaildation.hook.d.ts +10 -0
- package/dist/components/d-flow/function/DFlowFunction.vaildation.hook.js +74 -0
- package/dist/components/d-flow/function/DFlowFunction.view.d.ts +66 -0
- package/dist/components/d-flow/function/DFlowFunction.view.js +117 -0
- package/dist/components/d-flow/function/DFlowFunctionDefaultCard.d.ts +15 -0
- package/dist/components/d-flow/function/DFlowFunctionDefaultCard.js +158 -0
- package/dist/components/d-flow/function/DFlowFunctionGroupCard.d.ts +5 -0
- package/dist/components/d-flow/function/DFlowFunctionGroupCard.js +55 -0
- package/dist/components/d-flow/function/DFlowFunctionSuggestionCard.d.ts +11 -0
- package/dist/components/d-flow/function/DFlowFunctionSuggestionCard.js +26 -0
- package/dist/components/d-flow/function/DFlowFunctionTriggerCard.d.ts +9 -0
- package/dist/components/d-flow/function/DFlowFunctionTriggerCard.js +97 -0
- package/dist/components/d-flow/function/index.d.ts +2 -0
- package/dist/components/d-flow/function/index.js +7 -0
- package/dist/components/d-flow/index.d.ts +13 -0
- package/dist/components/d-flow/index.js +46 -0
- package/dist/components/d-flow/input/DFlowInputDataType.d.ts +8 -0
- package/dist/components/d-flow/input/DFlowInputDataType.js +422 -0
- package/dist/components/d-flow/minimap/DFlowMiniMap.d.ts +2 -0
- package/dist/components/d-flow/minimap/DFlowMiniMap.js +22 -0
- package/dist/components/d-flow/minimap/index.d.ts +1 -0
- package/dist/components/d-flow/minimap/index.js +4 -0
- package/dist/components/d-flow/suggestion/DFlowSuggestion.hook.d.ts +33 -0
- package/dist/components/d-flow/suggestion/DFlowSuggestion.hook.js +150 -0
- package/dist/components/d-flow/suggestion/DFlowSuggestion.service.d.ts +5 -0
- package/dist/components/d-flow/suggestion/DFlowSuggestion.service.js +18 -0
- package/dist/components/d-flow/suggestion/DFlowSuggestion.view.d.ts +21 -0
- package/dist/components/d-flow/suggestion/DFlowSuggestion.view.js +25 -0
- package/dist/components/d-flow/suggestion/DFlowSuggestionMenu.d.ts +8 -0
- package/dist/components/d-flow/suggestion/DFlowSuggestionMenu.js +67 -0
- package/dist/components/d-flow/suggestion/DFlowSuggestionMenu.util.d.ts +3 -0
- package/dist/components/d-flow/suggestion/DFlowSuggestionMenu.util.js +42 -0
- package/dist/components/d-flow/suggestion/DFlowSuggestionMenuFooter.d.ts +2 -0
- package/dist/components/d-flow/suggestion/DFlowSuggestionMenuFooter.js +69 -0
- package/dist/components/d-flow/suggestion/DFlowSuggestionMenuSearchBar.d.ts +6 -0
- package/dist/components/d-flow/suggestion/DFlowSuggestionMenuSearchBar.js +21 -0
- package/dist/components/d-flow/suggestion/DFlowSuggestionSearchInput.d.ts +7 -0
- package/dist/components/d-flow/suggestion/DFlowSuggestionSearchInput.js +22 -0
- package/dist/components/d-flow/suggestion/index.d.ts +2 -0
- package/dist/components/d-flow/suggestion/index.js +7 -0
- package/dist/components/d-flow/tab/DFlowTabDefault.d.ts +11 -0
- package/dist/components/d-flow/tab/DFlowTabDefault.js +97 -0
- package/dist/components/d-flow/tab/DFlowTabTrigger.d.ts +6 -0
- package/dist/components/d-flow/tab/DFlowTabTrigger.js +51 -0
- package/dist/components/d-flow/tab/DFlowTabs.d.ts +2 -0
- package/dist/components/d-flow/tab/DFlowTabs.js +105 -0
- package/dist/components/d-flow/type/DFlowType.service.d.ts +6 -0
- package/dist/components/d-flow/type/DFlowType.service.js +9 -0
- package/dist/components/d-flow/type/DFlowType.view.d.ts +35 -0
- package/dist/components/d-flow/type/DFlowType.view.js +69 -0
- package/dist/components/d-flow/type/index.d.ts +2 -0
- package/dist/components/d-flow/type/index.js +6 -0
- package/dist/components/d-flow/validation/DFlowValidation.d.ts +6 -0
- package/dist/components/d-flow/validation/DFlowValidation.hook.d.ts +3 -0
- package/dist/components/d-flow/validation/DFlowValidation.hook.js +10 -0
- package/dist/components/d-flow/validation/DFlowValidation.js +60 -0
- package/dist/components/d-flow/validation/index.d.ts +2 -0
- package/dist/components/d-flow/validation/index.js +6 -0
- package/dist/components/d-fullscreen/DFullScreen.d.ts +6 -0
- package/dist/components/d-fullscreen/DFullScreen.js +26 -0
- package/dist/components/d-layout/DLayout.d.ts +10 -0
- package/dist/components/d-layout/DLayout.js +52 -0
- package/dist/components/d-namespace/DNamespace.service.d.ts +6 -0
- package/dist/components/d-namespace/DNamespace.service.js +11 -0
- package/dist/components/d-namespace/DNamespace.view.d.ts +32 -0
- package/dist/components/d-namespace/DNamespace.view.js +65 -0
- package/dist/components/d-namespace/index.d.ts +12 -0
- package/dist/components/d-namespace/index.js +35 -0
- package/dist/components/d-namespace/license/DNamespaceLicense.service.d.ts +8 -0
- package/dist/components/d-namespace/license/DNamespaceLicense.service.js +11 -0
- package/dist/components/d-namespace/license/DNamespaceLicense.view.d.ts +26 -0
- package/dist/components/d-namespace/license/DNamespaceLicense.view.js +57 -0
- package/dist/components/d-namespace/member/DNamespaceMember.service.d.ts +9 -0
- package/dist/components/d-namespace/member/DNamespaceMember.service.js +11 -0
- package/dist/components/d-namespace/member/DNamespaceMember.view.d.ts +26 -0
- package/dist/components/d-namespace/member/DNamespaceMember.view.js +57 -0
- package/dist/components/d-namespace/project/DNamespaceProject.service.d.ts +9 -0
- package/dist/components/d-namespace/project/DNamespaceProject.service.js +11 -0
- package/dist/components/d-namespace/project/DNamespaceProject.view.d.ts +35 -0
- package/dist/components/d-namespace/project/DNamespaceProject.view.js +69 -0
- package/dist/components/d-namespace/project/DNamespaceProjectCard.d.ts +9 -0
- package/dist/components/d-namespace/project/DNamespaceProjectCard.js +57 -0
- package/dist/components/d-namespace/project/DNamespaceProjectMenu.d.ts +9 -0
- package/dist/components/d-namespace/project/DNamespaceProjectMenu.js +18 -0
- package/dist/components/d-namespace/role/DNamespaceRole.service.d.ts +10 -0
- package/dist/components/d-namespace/role/DNamespaceRole.service.js +11 -0
- package/dist/components/d-namespace/role/DNamespaceRole.view.d.ts +26 -0
- package/dist/components/d-namespace/role/DNamespaceRole.view.js +57 -0
- package/dist/components/d-organization/DOrganization.service.d.ts +8 -0
- package/dist/components/d-organization/DOrganization.service.js +11 -0
- package/dist/components/d-organization/DOrganization.view.d.ts +20 -0
- package/dist/components/d-organization/DOrganization.view.js +52 -0
- package/dist/components/d-organization/DOrganizationCard.d.ts +10 -0
- package/dist/components/d-organization/DOrganizationCard.js +63 -0
- package/dist/components/d-organization/DOrganizationMenu.d.ts +9 -0
- package/dist/components/d-organization/DOrganizationMenu.js +18 -0
- package/dist/components/d-organization/index.d.ts +4 -0
- package/dist/components/d-organization/index.js +19 -0
- package/dist/components/d-resizable/DResizable.d.ts +10 -0
- package/dist/components/d-resizable/DResizable.js +32 -0
- package/dist/components/d-runtime/DRuntime.service.d.ts +9 -0
- package/dist/components/d-runtime/DRuntime.service.js +11 -0
- package/dist/components/d-runtime/DRuntime.view.d.ts +38 -0
- package/dist/components/d-runtime/DRuntime.view.js +73 -0
- package/dist/components/d-runtime/index.d.ts +2 -0
- package/dist/components/d-runtime/index.js +6 -0
- package/dist/components/d-user/DUser.service.d.ts +21 -0
- package/dist/components/d-user/DUser.service.js +17 -0
- package/dist/components/d-user/DUser.view.d.ts +52 -0
- package/dist/components/d-user/DUser.view.js +100 -0
- package/dist/components/d-user/DUserMenu.d.ts +8 -0
- package/dist/components/d-user/DUserMenu.js +28 -0
- package/dist/components/d-user/index.d.ts +3 -0
- package/dist/components/d-user/index.js +17 -0
- package/dist/components/dialog/Dialog.d.ts +28 -0
- package/dist/components/dialog/Dialog.js +99 -0
- package/dist/components/file-tabs/FileTabs.d.ts +17 -0
- package/dist/components/file-tabs/FileTabs.js +71 -0
- package/dist/components/file-tabs/FileTabs.service.d.ts +13 -0
- package/dist/components/file-tabs/FileTabs.service.js +47 -0
- package/dist/components/file-tabs/FileTabs.view.d.ts +9 -0
- package/dist/components/file-tabs/FileTabs.view.js +1 -0
- package/dist/components/flex/Flex.d.ts +7 -0
- package/dist/components/flex/Flex.js +21 -0
- package/dist/components/form/CheckboxInput.d.ts +5 -0
- package/dist/components/form/CheckboxInput.js +67 -0
- package/dist/components/form/EmailInput.d.ts +8 -0
- package/dist/components/form/EmailInput.js +20 -0
- package/dist/components/form/Input.d.ts +22 -0
- package/dist/components/form/Input.js +153 -0
- package/dist/components/form/InputDescription.d.ts +5 -0
- package/dist/components/form/InputDescription.js +12 -0
- package/dist/components/form/InputLabel.d.ts +5 -0
- package/dist/components/form/InputLabel.js +12 -0
- package/dist/components/form/InputMessage.d.ts +5 -0
- package/dist/components/form/InputMessage.js +18 -0
- package/dist/components/form/InputSuggestion.d.ts +19 -0
- package/dist/components/form/InputSuggestion.js +102 -0
- package/dist/components/form/NumberInput.d.ts +6 -0
- package/dist/components/form/NumberInput.js +20 -0
- package/dist/components/form/PasswordInput.d.ts +8 -0
- package/dist/components/form/PasswordInput.js +18 -0
- package/dist/components/form/PinInput.d.ts +11 -0
- package/dist/components/form/PinInput.js +66 -0
- package/dist/components/form/RadioGroup.d.ts +5 -0
- package/dist/components/form/RadioGroup.js +48 -0
- package/dist/components/form/RadioInput.d.ts +7 -0
- package/dist/components/form/RadioInput.js +27 -0
- package/dist/components/form/SwitchInput.d.ts +6 -0
- package/dist/components/form/SwitchInput.js +19 -0
- package/dist/components/form/TextInput.d.ts +7 -0
- package/dist/components/form/TextInput.js +19 -0
- package/dist/components/form/index.d.ts +15 -0
- package/dist/components/form/index.js +37 -0
- package/dist/components/form/useForm.d.ts +25 -0
- package/dist/components/form/useForm.js +57 -0
- package/dist/components/menu/Menu.d.ts +27 -0
- package/dist/components/menu/Menu.js +104 -0
- package/dist/components/quote/Quote.d.ts +10 -0
- package/dist/components/quote/Quote.js +49 -0
- package/dist/components/row/Row.d.ts +6 -0
- package/dist/components/row/Row.js +21 -0
- package/dist/components/scroll-area/ScrollArea.d.ts +13 -0
- package/dist/components/scroll-area/ScrollArea.js +43 -0
- package/dist/components/segmented-control/SegmentedControl.d.ts +8 -0
- package/dist/components/segmented-control/SegmentedControl.js +24 -0
- package/dist/components/spacing/Spacing.d.ts +6 -0
- package/dist/components/spacing/Spacing.js +23 -0
- package/dist/components/tab/Tab.d.ts +11 -0
- package/dist/components/tab/Tab.js +40 -0
- package/dist/components/text/Text.d.ts +8 -0
- package/dist/components/text/Text.js +23 -0
- package/dist/components/tooltip/Tooltip.d.ts +13 -0
- package/dist/components/tooltip/Tooltip.js +48 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.js +226 -0
- package/dist/node_modules/react/cjs/react-compiler-runtime.development.js +21 -0
- package/dist/node_modules/react/cjs/react-compiler-runtime.production.js +14 -0
- package/dist/node_modules/react/compiler-runtime.js +10 -0
- package/dist/utils/arrayService.d.ts +10 -0
- package/dist/utils/arrayService.js +1 -0
- package/dist/utils/contextStore.d.ts +62 -0
- package/dist/utils/contextStore.js +60 -0
- package/dist/utils/generics.d.ts +17 -0
- package/dist/utils/generics.js +310 -0
- package/dist/utils/index.d.ts +8 -0
- package/dist/utils/index.js +28 -0
- package/dist/utils/inspection.d.ts +13 -0
- package/dist/utils/inspection.js +4 -0
- package/dist/utils/nonReactiveArrayService.d.ts +19 -0
- package/dist/utils/nonReactiveArrayService.js +54 -0
- package/dist/utils/objectStore.d.ts +12 -0
- package/dist/utils/objectStore.js +34 -0
- package/dist/utils/reactiveArrayService.d.ts +22 -0
- package/dist/utils/reactiveArrayService.js +91 -0
- package/dist/utils/types.d.ts +57 -0
- package/dist/utils/types.js +4 -0
- package/dist/utils/utils.d.ts +68 -0
- package/dist/utils/utils.js +216 -0
- package/package.json +119 -0
|
@@ -0,0 +1,422 @@
|
|
|
1
|
+
import { jsxs as S, jsx as c, Fragment as j } from "react/jsx-runtime";
|
|
2
|
+
import { c as be } from "../../../_virtual/compiler-runtime.js";
|
|
3
|
+
import y from "react";
|
|
4
|
+
import { InputMessage as Me } from "../../form/InputMessage.js";
|
|
5
|
+
import '../../../assets/components/d-flow/input/DFlowInputDataType.style.css';/* empty css */
|
|
6
|
+
import { TextInput as F } from "../../form/TextInput.js";
|
|
7
|
+
import { Button as re } from "../../button/Button.js";
|
|
8
|
+
import { IconSettings as le, IconTrash as Oe } from "@tabler/icons-react";
|
|
9
|
+
import { Text as A } from "../../text/Text.js";
|
|
10
|
+
import { Flex as X } from "../../flex/Flex.js";
|
|
11
|
+
import { Badge as ve } from "../../badge/Badge.js";
|
|
12
|
+
import { InputLabel as De } from "../../form/InputLabel.js";
|
|
13
|
+
import { useSuggestions as ke } from "../suggestion/DFlowSuggestion.hook.js";
|
|
14
|
+
import { DFlowSuggestionMenuFooter as me } from "../suggestion/DFlowSuggestionMenuFooter.js";
|
|
15
|
+
import { toInputSuggestions as Be } from "../suggestion/DFlowSuggestionMenu.util.js";
|
|
16
|
+
import { DFlowSuggestionType as Ve } from "../suggestion/DFlowSuggestion.view.js";
|
|
17
|
+
import { Menu as Ae, MenuTrigger as _e, MenuPortal as Ke } from "../../menu/Menu.js";
|
|
18
|
+
import { InputSuggestionMenuContent as we, InputSuggestionMenuContentItems as Ge } from "../../form/InputSuggestion.js";
|
|
19
|
+
const Te = /* @__PURE__ */ new Set(["ITEM_OF_COLLECTION", "REGEX", "NUMBER_RANGE"]), he = "__blockingSignature", Fe = ["CONTAINS_KEY", "CONTAINS_TYPE", "ITEM_OF_COLLECTION", "NUMBER_RANGE", "REGEX"], de = (n) => {
|
|
20
|
+
const {
|
|
21
|
+
formValidation: e,
|
|
22
|
+
initialValue: t,
|
|
23
|
+
onDataTypeChange: p = () => {
|
|
24
|
+
},
|
|
25
|
+
blockingDataType: s
|
|
26
|
+
} = n, m = y.useMemo(() => Ie(t, s), [t, s]), [a, u] = y.useState(m), T = y.useMemo(() => Y(a), [a]), l = y.useMemo(() => Y(s), [s]), B = y.useMemo(() => new Map((J(a) ? a.genericMappers ?? [] : []).map((r) => [r.target ?? "", r])), [a]), I = y.useMemo(() => l?.rules?.nodes?.filter(Boolean), [l]), E = y.useCallback((r) => {
|
|
27
|
+
u((o) => {
|
|
28
|
+
if (!o) return o;
|
|
29
|
+
const i = q(o);
|
|
30
|
+
return r(i), p(i), Le(o, i), i;
|
|
31
|
+
});
|
|
32
|
+
}, []), b = y.useCallback((r, o, i) => {
|
|
33
|
+
E((N) => {
|
|
34
|
+
const h = Y(N);
|
|
35
|
+
if (!h) return;
|
|
36
|
+
const M = oe(h), R = M[r];
|
|
37
|
+
if (!R) return;
|
|
38
|
+
const f = Ce(R, l);
|
|
39
|
+
if (f && !i?.allowBlocked) return;
|
|
40
|
+
const g = o(q(R));
|
|
41
|
+
g !== void 0 && (f && (ae(g, f), se(g, f)), M[r] = g);
|
|
42
|
+
});
|
|
43
|
+
}, [l, E]), V = y.useCallback((r) => {
|
|
44
|
+
E((o) => {
|
|
45
|
+
const i = Y(o);
|
|
46
|
+
if (!i) return;
|
|
47
|
+
const N = oe(i), h = N[r];
|
|
48
|
+
h && (Pe(h, l) || N.splice(r, 1));
|
|
49
|
+
});
|
|
50
|
+
}, [l, E]), d = y.useCallback((r, o) => {
|
|
51
|
+
b(r, (i) => (!("dataTypeIdentifier" in i?.config) || !i?.config?.dataTypeIdentifier || (L(o) ? (i.config.dataTypeIdentifier.dataType = o, delete i.config.dataTypeIdentifier.genericType) : J(o) && (i.config.dataTypeIdentifier.genericType = o, delete i.config.dataTypeIdentifier.dataType)), i), {
|
|
52
|
+
allowBlocked: !0
|
|
53
|
+
});
|
|
54
|
+
}, [b]), D = y.useCallback((r, o, i) => {
|
|
55
|
+
E((N) => {
|
|
56
|
+
if (!J(N)) return;
|
|
57
|
+
const h = N.genericMappers ?? [], M = h.findIndex((g) => g.target === r);
|
|
58
|
+
if (M === -1) return;
|
|
59
|
+
const R = h[M], f = R?.sourceDataTypeIdentifiers ?? [];
|
|
60
|
+
f[o] && (L(i) ? (f[o].dataType = i, delete f[o].genericType) : J(i) && (f[o].genericType = i, delete f[o].dataType), R.sourceDataTypeIdentifiers = f, N.genericMappers = [...h], N.genericMappers[M] = R);
|
|
61
|
+
});
|
|
62
|
+
}, [E]);
|
|
63
|
+
return /* @__PURE__ */ S("div", { children: [
|
|
64
|
+
/* @__PURE__ */ S("div", { className: "d-flow-viewport-data-type-input", children: [
|
|
65
|
+
T?.rules?.nodes?.map((r, o) => {
|
|
66
|
+
if (!r) return null;
|
|
67
|
+
const i = I?.find((f) => ce(r, f)), N = r?.variant === "PARENT_TYPE", h = r?.config, M = (h?.dataTypeIdentifier?.dataType?.rules?.nodes?.length ?? 0) > 0 || (h?.dataTypeIdentifier?.genericType?.dataType?.rules?.nodes?.length ?? 0) > 0;
|
|
68
|
+
return !N || M ? /* @__PURE__ */ c(Ye, { rule: r, blockingRule: i, genericMap: B, onRemove: () => V(o), onConfigChange: (f) => b(o, (g) => (g.config = f, g)), onHeaderKeyChange: (f) => b(o, (g) => (g.config || (g.config = {}), g.config.key = f || null, g)), onHeaderDataTypeChange: (f) => b(o, (g) => {
|
|
69
|
+
g.config || (g.config = {}), "dataTypeIdentifier" in g.config || (g.config.dataTypeIdentifier = {});
|
|
70
|
+
const O = g.config.dataTypeIdentifier;
|
|
71
|
+
return f ? (L(f) ? (O.dataType = f, delete O.genericType) : J(f) && (O.genericType = f, delete O.dataType), g) : (delete O?.dataType, delete O?.genericType, g);
|
|
72
|
+
}), onNestedChange: (f) => d(o, f), onGenericMapperChange: D }, `${r.variant}-${o}`) : null;
|
|
73
|
+
}),
|
|
74
|
+
/* @__PURE__ */ S(Ae, { children: [
|
|
75
|
+
/* @__PURE__ */ c(_e, { asChild: !0, children: /* @__PURE__ */ S(re, { color: "primary", children: [
|
|
76
|
+
/* @__PURE__ */ c(le, { size: 16 }),
|
|
77
|
+
" Add new rule"
|
|
78
|
+
] }) }),
|
|
79
|
+
/* @__PURE__ */ c(Ke, { children: /* @__PURE__ */ S(we, { children: [
|
|
80
|
+
/* @__PURE__ */ c(Ge, { onSuggestionSelect: (r) => {
|
|
81
|
+
E((o) => {
|
|
82
|
+
"rules" in o ? o?.rules?.nodes?.push(r.value) : "dataType" in o?.genericType && o?.genericType?.dataType?.rules?.nodes?.push(r.value);
|
|
83
|
+
});
|
|
84
|
+
}, suggestions: Fe.filter((r) => T?.variant == "OBJECT" ? r == "CONTAINS_KEY" : T?.variant == "ARRAY" ? r == "CONTAINS_TYPE" : !(r == "CONTAINS_TYPE" || r == "CONTAINS_KEY")).map((r) => ({
|
|
85
|
+
children: /* @__PURE__ */ S(j, { children: [
|
|
86
|
+
/* @__PURE__ */ c(le, { size: 16 }),
|
|
87
|
+
/* @__PURE__ */ c(A, { children: r })
|
|
88
|
+
] }),
|
|
89
|
+
value: {
|
|
90
|
+
variant: r,
|
|
91
|
+
config: {
|
|
92
|
+
__typename: `DataTypeRules${r[0]}Config`,
|
|
93
|
+
...r === "NUMBER_RANGE" ? {
|
|
94
|
+
from: void 0,
|
|
95
|
+
to: void 0,
|
|
96
|
+
steps: void 0
|
|
97
|
+
} : {},
|
|
98
|
+
...r === "REGEX" ? {
|
|
99
|
+
pattern: void 0
|
|
100
|
+
} : {},
|
|
101
|
+
...r === "ITEM_OF_COLLECTION" ? {
|
|
102
|
+
items: void 0
|
|
103
|
+
} : {}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
})) }),
|
|
107
|
+
/* @__PURE__ */ c(me, {})
|
|
108
|
+
] }) })
|
|
109
|
+
] })
|
|
110
|
+
] }),
|
|
111
|
+
!e?.valid && e?.notValidMessage && /* @__PURE__ */ c(Me, { children: e.notValidMessage })
|
|
112
|
+
] });
|
|
113
|
+
}, Ye = (n) => {
|
|
114
|
+
const e = be.c(56), {
|
|
115
|
+
rule: t,
|
|
116
|
+
blockingRule: p,
|
|
117
|
+
genericMap: s,
|
|
118
|
+
onRemove: m,
|
|
119
|
+
onConfigChange: a,
|
|
120
|
+
onHeaderKeyChange: u,
|
|
121
|
+
onHeaderDataTypeChange: T,
|
|
122
|
+
onNestedChange: l,
|
|
123
|
+
onGenericMapperChange: B
|
|
124
|
+
} = n, I = t?.config?.dataTypeIdentifier ?? void 0, E = !!I?.genericKey, [b, V] = y.useState(!1), d = !!p, D = t.variant, r = D ? !Te.has(D) : !1;
|
|
125
|
+
let o;
|
|
126
|
+
e[0] !== t.config ? (o = () => ue(t?.config), e[0] = t.config, e[1] = o) : o = e[1];
|
|
127
|
+
const [i, N] = y.useState(o);
|
|
128
|
+
let h;
|
|
129
|
+
e[2] !== t.config ? (h = () => {
|
|
130
|
+
N(ue(t?.config));
|
|
131
|
+
}, e[2] = t.config, e[3] = h) : h = e[3];
|
|
132
|
+
let M;
|
|
133
|
+
e[4] !== t ? (M = [t], e[4] = t, e[5] = M) : M = e[5], y.useEffect(h, M);
|
|
134
|
+
let R;
|
|
135
|
+
e: {
|
|
136
|
+
if (!r) {
|
|
137
|
+
R = void 0;
|
|
138
|
+
break e;
|
|
139
|
+
}
|
|
140
|
+
if (!I) {
|
|
141
|
+
R = void 0;
|
|
142
|
+
break e;
|
|
143
|
+
}
|
|
144
|
+
if (I.genericKey) {
|
|
145
|
+
let C;
|
|
146
|
+
e[6] !== s || e[7] !== I.genericKey ? (C = s.get(I.genericKey), e[6] = s, e[7] = I.genericKey, e[8] = C) : C = e[8];
|
|
147
|
+
const k = C?.sourceDataTypeIdentifiers?.[0];
|
|
148
|
+
R = k?.dataType?.name?.nodes?.[0]?.content ?? k?.genericType?.dataType?.name?.nodes?.[0]?.content;
|
|
149
|
+
break e;
|
|
150
|
+
}
|
|
151
|
+
R = I.dataType?.name?.nodes?.[0]?.content ?? I.genericType?.dataType?.name?.nodes?.[0]?.content;
|
|
152
|
+
}
|
|
153
|
+
const f = R;
|
|
154
|
+
let g;
|
|
155
|
+
e[9] === Symbol.for("react.memo_cache_sentinel") ? (g = (C) => {
|
|
156
|
+
const v = C.target.value;
|
|
157
|
+
N(v);
|
|
158
|
+
}, e[9] = g) : g = e[9];
|
|
159
|
+
const O = g;
|
|
160
|
+
let P;
|
|
161
|
+
e[10] !== i || e[11] !== d || e[12] !== a || e[13] !== t.config || e[14] !== D ? (P = (C) => {
|
|
162
|
+
if (d)
|
|
163
|
+
return;
|
|
164
|
+
const v = C?.target?.name, k = Je(i, t.config, {
|
|
165
|
+
variant: D,
|
|
166
|
+
numberRangeKey: v
|
|
167
|
+
});
|
|
168
|
+
k && a(k);
|
|
169
|
+
}, e[10] = i, e[11] = d, e[12] = a, e[13] = t.config, e[14] = D, e[15] = P) : P = e[15];
|
|
170
|
+
const _ = P;
|
|
171
|
+
let z;
|
|
172
|
+
e[16] !== t ? (z = ye(t), e[16] = t, e[17] = z) : z = e[17];
|
|
173
|
+
const K = z;
|
|
174
|
+
let U;
|
|
175
|
+
e[18] !== p ? (U = ye(p), e[18] = p, e[19] = U) : U = e[19];
|
|
176
|
+
const W = U;
|
|
177
|
+
let $;
|
|
178
|
+
e[20] !== f || e[21] !== s || e[22] !== E || e[23] !== I || e[24] !== d || e[25] !== b || e[26] !== W || e[27] !== K || e[28] !== B || e[29] !== T || e[30] !== u || e[31] !== l || e[32] !== m || e[33] !== t ? ($ = () => {
|
|
179
|
+
if (!K && !E)
|
|
180
|
+
return null;
|
|
181
|
+
const C = /* @__PURE__ */ c(ge, { rule: t, genericMap: s, isBlocked: d, dataTypeLabel: f, onClick: () => V(ze), onRemove: d ? void 0 : m, onKeyChange: d ? void 0 : u, onDataTypeChange: d ? void 0 : T });
|
|
182
|
+
if (K)
|
|
183
|
+
return /* @__PURE__ */ S(j, { children: [
|
|
184
|
+
C,
|
|
185
|
+
b ? /* @__PURE__ */ c(de, { initialValue: K, blockingDataType: W, onDataTypeChange: l }) : null
|
|
186
|
+
] });
|
|
187
|
+
if (I?.genericKey) {
|
|
188
|
+
const v = s.get(I.genericKey);
|
|
189
|
+
return /* @__PURE__ */ S(j, { children: [
|
|
190
|
+
C,
|
|
191
|
+
b ? v?.sourceDataTypeIdentifiers?.map((k, fe) => {
|
|
192
|
+
const te = k?.dataType ?? k?.genericType;
|
|
193
|
+
if (!te)
|
|
194
|
+
return null;
|
|
195
|
+
const Se = d ? te : void 0, ie = I.genericKey;
|
|
196
|
+
return ie ? /* @__PURE__ */ c(de, { initialValue: te, blockingDataType: Se, onDataTypeChange: (Re) => B(ie, fe, Re) }, `${ie}-${fe}`) : null;
|
|
197
|
+
}) : null
|
|
198
|
+
] });
|
|
199
|
+
}
|
|
200
|
+
return null;
|
|
201
|
+
}, e[20] = f, e[21] = s, e[22] = E, e[23] = I, e[24] = d, e[25] = b, e[26] = W, e[27] = K, e[28] = B, e[29] = T, e[30] = u, e[31] = l, e[32] = m, e[33] = t, e[34] = $) : $ = e[34];
|
|
202
|
+
const Q = $;
|
|
203
|
+
if (r && (K || E)) {
|
|
204
|
+
let C;
|
|
205
|
+
e[35] !== Q ? (C = Q(), e[35] = Q, e[36] = C) : C = e[36];
|
|
206
|
+
let v;
|
|
207
|
+
return e[37] !== C ? (v = /* @__PURE__ */ c("div", { className: "d-flow-viewport-data-type-input__rule", children: C }), e[37] = C, e[38] = v) : v = e[38], v;
|
|
208
|
+
}
|
|
209
|
+
let x;
|
|
210
|
+
e[39] === Symbol.for("react.memo_cache_sentinel") ? (x = {
|
|
211
|
+
flex: 1
|
|
212
|
+
}, e[39] = x) : x = e[39];
|
|
213
|
+
const Z = d ? void 0 : m, ee = d ? void 0 : u, ne = d ? void 0 : T;
|
|
214
|
+
let w;
|
|
215
|
+
e[40] !== f || e[41] !== s || e[42] !== d || e[43] !== t || e[44] !== Z || e[45] !== ee || e[46] !== ne ? (w = /* @__PURE__ */ c(ge, { rule: t, genericMap: s, isBlocked: d, dataTypeLabel: f, onRemove: Z, onKeyChange: ee, onDataTypeChange: ne }), e[40] = f, e[41] = s, e[42] = d, e[43] = t, e[44] = Z, e[45] = ee, e[46] = ne, e[47] = w) : w = e[47];
|
|
216
|
+
let G;
|
|
217
|
+
e[48] !== i || e[49] !== _ || e[50] !== d || e[51] !== t.variant ? (G = t.variant === "REGEX" || t.variant === "ITEM_OF_COLLECTION" ? /* @__PURE__ */ c(F, { clearable: !0, left: /* @__PURE__ */ c(A, { size: "sm", children: t.variant === "REGEX" ? "Pattern" : "Items" }), leftType: "icon", defaultValue: i, onChange: O, onBlur: _, w: "100%", disabled: d }) : t.variant === "NUMBER_RANGE" ? /* @__PURE__ */ S(j, { children: [
|
|
218
|
+
/* @__PURE__ */ c(F, { clearable: !0, defaultValue: i?.from?.toString() ?? "", onChange: O, onBlur: _, w: "100%", left: /* @__PURE__ */ c(A, { size: "sm", children: "From" }), leftType: "icon", disabled: d, name: "from" }),
|
|
219
|
+
/* @__PURE__ */ c(F, { clearable: !0, defaultValue: i?.steps?.toString() ?? "", onChange: O, onBlur: _, left: /* @__PURE__ */ c(A, { size: "sm", children: "Steps" }), leftType: "icon", w: "100%", disabled: d, name: "steps" }),
|
|
220
|
+
/* @__PURE__ */ c(F, { clearable: !0, left: /* @__PURE__ */ c(A, { size: "sm", children: "To" }), leftType: "icon", defaultValue: i?.to?.toString() ?? "", onChange: O, onBlur: _, w: "100%", disabled: d, name: "to" })
|
|
221
|
+
] }) : null, e[48] = i, e[49] = _, e[50] = d, e[51] = t.variant, e[52] = G) : G = e[52];
|
|
222
|
+
let H;
|
|
223
|
+
return e[53] !== w || e[54] !== G ? (H = /* @__PURE__ */ c("div", { className: "d-flow-viewport-data-type-input__rule", children: /* @__PURE__ */ S("div", { style: x, children: [
|
|
224
|
+
w,
|
|
225
|
+
G
|
|
226
|
+
] }) }), e[53] = w, e[54] = G, e[55] = H) : H = e[55], H;
|
|
227
|
+
}, ge = ({
|
|
228
|
+
rule: n,
|
|
229
|
+
dataTypeLabel: e,
|
|
230
|
+
onClick: t,
|
|
231
|
+
onRemove: p,
|
|
232
|
+
isBlocked: s,
|
|
233
|
+
onKeyChange: m,
|
|
234
|
+
onDataTypeChange: a,
|
|
235
|
+
genericMap: u
|
|
236
|
+
}) => {
|
|
237
|
+
const T = n.variant, l = T ? !Te.has(T) : !1, B = l ? ke({
|
|
238
|
+
dataType: {
|
|
239
|
+
id: "gid://sagittarius/DataType/878634678"
|
|
240
|
+
}
|
|
241
|
+
}, [], "", 0, [0], 1, [Ve.DATA_TYPE]) : [], I = n?.config?.dataTypeIdentifier?.dataType?.rules?.nodes?.length ?? n?.config?.dataTypeIdentifier?.genericType?.dataType?.rules?.nodes?.length ?? u.get(n?.config?.dataTypeIdentifier?.genericKey)?.sourceDataTypeIdentifiers?.map((i) => i?.dataType?.rules?.nodes?.length ?? i.genericType?.dataType?.rules?.nodes?.length) ?? 0, [E, b] = y.useState(() => "key" in (n?.config ?? {}) ? n?.config?.key ?? "" : ""), [V, d] = y.useState(() => e ?? "");
|
|
242
|
+
y.useEffect(() => {
|
|
243
|
+
b("key" in (n?.config ?? {}) ? n?.config?.key ?? "" : "");
|
|
244
|
+
}, [n]), y.useEffect(() => {
|
|
245
|
+
d(e ?? "");
|
|
246
|
+
}, [e]);
|
|
247
|
+
const D = y.useCallback(() => {
|
|
248
|
+
!m || s || m(E);
|
|
249
|
+
}, [s, E, m]), r = y.useCallback(() => {
|
|
250
|
+
!a || s || V.trim() === "" && a(void 0);
|
|
251
|
+
}, [V, s, a]), o = y.useCallback((i) => {
|
|
252
|
+
if (!a || s) return;
|
|
253
|
+
const N = i.value;
|
|
254
|
+
if (!N) return;
|
|
255
|
+
a(N);
|
|
256
|
+
const h = i?.ref?.displayText?.join(" ") ?? e ?? "";
|
|
257
|
+
d(h);
|
|
258
|
+
}, [e, s, a]);
|
|
259
|
+
return /* @__PURE__ */ S("div", { children: [
|
|
260
|
+
/* @__PURE__ */ S(X, { justify: "space-between", children: [
|
|
261
|
+
/* @__PURE__ */ c(ve, { color: "info", children: n?.variant }),
|
|
262
|
+
p ? /* @__PURE__ */ c(re, { color: "error", onClick: p, children: /* @__PURE__ */ c(Oe, { size: 16 }) }) : null
|
|
263
|
+
] }),
|
|
264
|
+
/* @__PURE__ */ S(X, { mt: 0.7, style: {
|
|
265
|
+
flexDirection: "column",
|
|
266
|
+
gap: ".7rem"
|
|
267
|
+
}, children: [
|
|
268
|
+
l ? /* @__PURE__ */ S(X, { align: "center", style: {
|
|
269
|
+
gap: ".7rem"
|
|
270
|
+
}, children: [
|
|
271
|
+
n.variant === "CONTAINS_KEY" ? /* @__PURE__ */ c(F, { left: /* @__PURE__ */ c(A, { size: "sm", children: "Key" }), leftType: "icon", disabled: s, defaultValue: E, onChange: (i) => "value" in i.target && b(i.target.value), onBlur: D }) : null,
|
|
272
|
+
/* @__PURE__ */ c(F, { left: /* @__PURE__ */ c(A, { size: "sm", children: "DataType" }), leftType: "icon", disabled: s, suggestionsFooter: /* @__PURE__ */ c(me, {}), suggestions: Be(B), value: V, onChange: (i) => "value" in i.target && d(i.target.value), onBlur: r, onSuggestionSelect: o })
|
|
273
|
+
] }) : null,
|
|
274
|
+
n.variant != "REGEX" && n.variant != "ITEM_OF_COLLECTION" && n.variant != "NUMBER_RANGE" ? /* @__PURE__ */ c(De, { children: /* @__PURE__ */ S(X, { align: "center", style: {
|
|
275
|
+
gap: ".7rem"
|
|
276
|
+
}, children: [
|
|
277
|
+
"+",
|
|
278
|
+
I,
|
|
279
|
+
" rules included",
|
|
280
|
+
/* @__PURE__ */ c(re, { color: "primary", onClick: t, children: "Show/Hide Rules" })
|
|
281
|
+
] }) }) : null
|
|
282
|
+
] })
|
|
283
|
+
] });
|
|
284
|
+
}, ue = (n) => n ? "pattern" in n || n?.__typename === "DataTypeRulesRegexConfig" ? n?.pattern ?? "" : "items" in n || n?.__typename === "DataTypeRulesItemOfCollectionConfig" ? JSON.stringify(n.items) : n : "", Je = (n, e, t) => {
|
|
285
|
+
const {
|
|
286
|
+
variant: p,
|
|
287
|
+
numberRangeKey: s
|
|
288
|
+
} = t ?? {}, m = p === "NUMBER_RANGE", a = e ?? void 0;
|
|
289
|
+
if (m) {
|
|
290
|
+
const u = {
|
|
291
|
+
__typename: "DataTypeRulesNumberRangeConfig",
|
|
292
|
+
...a
|
|
293
|
+
};
|
|
294
|
+
if (typeof n != "string")
|
|
295
|
+
return {
|
|
296
|
+
...u,
|
|
297
|
+
...n
|
|
298
|
+
};
|
|
299
|
+
if (!s)
|
|
300
|
+
return u;
|
|
301
|
+
const T = {
|
|
302
|
+
...u
|
|
303
|
+
};
|
|
304
|
+
switch (s) {
|
|
305
|
+
case "from":
|
|
306
|
+
T.from = (() => {
|
|
307
|
+
if (n.trim() === "") return;
|
|
308
|
+
const l = Number(n);
|
|
309
|
+
return Number.isFinite(l) ? l : u.from;
|
|
310
|
+
})();
|
|
311
|
+
break;
|
|
312
|
+
case "steps":
|
|
313
|
+
T.steps = (() => {
|
|
314
|
+
if (n.trim() === "") return;
|
|
315
|
+
const l = Number(n);
|
|
316
|
+
return Number.isFinite(l) ? l : u.steps;
|
|
317
|
+
})();
|
|
318
|
+
break;
|
|
319
|
+
case "to":
|
|
320
|
+
T.to = (() => {
|
|
321
|
+
if (n.trim() === "") return;
|
|
322
|
+
const l = Number(n);
|
|
323
|
+
return Number.isFinite(l) ? l : u.to;
|
|
324
|
+
})();
|
|
325
|
+
break;
|
|
326
|
+
}
|
|
327
|
+
return T;
|
|
328
|
+
}
|
|
329
|
+
if (!a) {
|
|
330
|
+
if (typeof n != "string")
|
|
331
|
+
return n;
|
|
332
|
+
try {
|
|
333
|
+
return JSON.parse(n);
|
|
334
|
+
} catch {
|
|
335
|
+
return;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
if (typeof n != "string")
|
|
339
|
+
return n;
|
|
340
|
+
if (a.__typename === "DataTypeRulesRegexConfig" || "pattern" in a)
|
|
341
|
+
return {
|
|
342
|
+
...a,
|
|
343
|
+
pattern: n
|
|
344
|
+
};
|
|
345
|
+
if (a.__typename === "DataTypeRulesItemOfCollectionConfig" || "items" in a)
|
|
346
|
+
try {
|
|
347
|
+
return {
|
|
348
|
+
...a,
|
|
349
|
+
items: JSON.parse(n)
|
|
350
|
+
};
|
|
351
|
+
} catch {
|
|
352
|
+
return a;
|
|
353
|
+
}
|
|
354
|
+
try {
|
|
355
|
+
return JSON.parse(n);
|
|
356
|
+
} catch {
|
|
357
|
+
return a;
|
|
358
|
+
}
|
|
359
|
+
}, q = (n) => n == null ? n : JSON.parse(JSON.stringify(n)), pe = (n) => {
|
|
360
|
+
if (n)
|
|
361
|
+
return JSON.stringify(n);
|
|
362
|
+
}, ye = (n) => {
|
|
363
|
+
if (n?.config?.dataTypeIdentifier)
|
|
364
|
+
return n?.config?.dataTypeIdentifier?.dataType ?? n?.config?.dataTypeIdentifier?.genericType ?? void 0;
|
|
365
|
+
}, Le = (n, e) => pe(n) === pe(e), Pe = (n, e) => !n || !e?.rules?.nodes || !Ne(n) ? !1 : !!Ce(n, e), Ce = (n, e) => !n || !e?.rules?.nodes ? void 0 : e.rules.nodes?.filter(Boolean).find((p) => ce(n, p)), L = (n) => n != null && n.rules !== void 0, J = (n) => n != null && typeof n == "object" && "genericMappers" in n, Y = (n) => {
|
|
366
|
+
if (n)
|
|
367
|
+
return L(n) ? n : n.dataType ?? void 0;
|
|
368
|
+
}, oe = (n) => (n.rules ? n.rules.nodes || (n.rules.nodes = []) : n.rules = {
|
|
369
|
+
nodes: []
|
|
370
|
+
}, n.rules.nodes), Ie = (n, e) => {
|
|
371
|
+
if (!n && !e) return;
|
|
372
|
+
const t = q(n ?? e), p = Y(t), s = Y(e);
|
|
373
|
+
if (!p || !s)
|
|
374
|
+
return t;
|
|
375
|
+
const m = oe(p);
|
|
376
|
+
return s.rules?.nodes?.filter(Boolean)?.forEach((u) => {
|
|
377
|
+
if (!u) return;
|
|
378
|
+
const T = m.findIndex((l) => ce(l, u));
|
|
379
|
+
if (T === -1) {
|
|
380
|
+
const l = q(u);
|
|
381
|
+
ae(l, u), m.push(l), se(l, u);
|
|
382
|
+
} else {
|
|
383
|
+
const l = m[T];
|
|
384
|
+
ae(l, u), se(l, u);
|
|
385
|
+
}
|
|
386
|
+
}), t;
|
|
387
|
+
}, se = (n, e) => {
|
|
388
|
+
const t = n?.config?.dataTypeIdentifier, p = e?.config?.dataTypeIdentifier;
|
|
389
|
+
if (!t || !p) return;
|
|
390
|
+
const s = t.dataType ?? t.genericType, m = p.dataType ?? p.genericType;
|
|
391
|
+
if (!s || !m) return;
|
|
392
|
+
const a = Ie(s, m);
|
|
393
|
+
a && (L(a) ? t.dataType = a : t.genericType = a);
|
|
394
|
+
}, ce = (n, e) => {
|
|
395
|
+
if (!n || !e) return !1;
|
|
396
|
+
const t = Ne(n), p = Ee(e);
|
|
397
|
+
return t && p ? t === p : n.id && e.id ? n.id === e.id : JSON.stringify({
|
|
398
|
+
variant: n.variant,
|
|
399
|
+
config: n.config
|
|
400
|
+
}) === JSON.stringify({
|
|
401
|
+
variant: e.variant,
|
|
402
|
+
config: e.config
|
|
403
|
+
});
|
|
404
|
+
}, Ne = (n) => {
|
|
405
|
+
if (n)
|
|
406
|
+
return n?.[he];
|
|
407
|
+
}, Ee = (n) => {
|
|
408
|
+
if (n)
|
|
409
|
+
return n.id ? `id:${n.id}` : `config:${JSON.stringify({
|
|
410
|
+
variant: n.variant,
|
|
411
|
+
config: n.config
|
|
412
|
+
})}`;
|
|
413
|
+
}, ae = (n, e) => {
|
|
414
|
+
const t = Ee(e);
|
|
415
|
+
t && (n[he] = t);
|
|
416
|
+
};
|
|
417
|
+
function ze(n) {
|
|
418
|
+
return !n;
|
|
419
|
+
}
|
|
420
|
+
export {
|
|
421
|
+
de as DFlowInputDataType
|
|
422
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { c as d } from "../../../_virtual/compiler-runtime.js";
|
|
3
|
+
import { useNodes as h, MiniMap as s } from "@xyflow/react";
|
|
4
|
+
import { FLOW_EDGE_RAINBOW as m } from "../DFlow.edges.hook.js";
|
|
5
|
+
import '../../../assets/components/d-flow/minimap/DFlowMiniMap.style.css';/* empty css */
|
|
6
|
+
const w = (c) => {
|
|
7
|
+
const e = d.c(2), o = h();
|
|
8
|
+
let i;
|
|
9
|
+
return e[0] !== o ? (i = /* @__PURE__ */ l(s, { offsetScale: 0, pannable: !0, zoomable: !0, className: "d-flow-viewport-mini-map", nodeComponent: (t) => {
|
|
10
|
+
const r = o.find((n) => n.id === t.id);
|
|
11
|
+
if (!r || r.type == "suggestion")
|
|
12
|
+
return null;
|
|
13
|
+
if (r.type == "group") {
|
|
14
|
+
const n = r.data?.depth ?? 0, a = m[n % m.length];
|
|
15
|
+
return /* @__PURE__ */ l("rect", { width: t.width, height: t.height, rx: 50, ry: 50, fill: a, fillOpacity: 0.05, stroke: a, strokeWidth: 2, "stroke-dasharray": "20", className: "d-flow-viewport-mini-map__group", x: t.x, y: t.y });
|
|
16
|
+
}
|
|
17
|
+
return /* @__PURE__ */ l("rect", { width: t.width, height: t.height, x: t.x, rx: 25, ry: 25, fill: "rgb(28.2, 25.5, 43.5)", y: t.y });
|
|
18
|
+
} }), e[0] = o, e[1] = i) : i = e[1], i;
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
w as DFlowMiniMap
|
|
22
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './DFlowMiniMap';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { DFlowSuggestion, DFlowSuggestionType } from './DFlowSuggestion.view';
|
|
2
|
+
import { DataTypeIdentifier, Flow, ReferenceValue } from '@code0-tech/sagittarius-graphql-types';
|
|
3
|
+
export declare const useSuggestions: (type: DataTypeIdentifier | undefined, genericKeys: string[] | undefined, flowId: Flow["id"], depth?: number, scope?: number[], node?: number, suggestionTypes?: DFlowSuggestionType[]) => DFlowSuggestion[];
|
|
4
|
+
/**
|
|
5
|
+
* React hook that produces a stable MD5 hash for a given Type, deeply resolving:
|
|
6
|
+
* - All type aliases (via DFlowDataTypeReactiveService) at any level of nesting
|
|
7
|
+
* - All occurrences of any provided generic_keys (can be any string) as "GENERIC"
|
|
8
|
+
* - All generic_mapper/type fields, rules/config.type fields, and parent fields, recursively
|
|
9
|
+
* - All object keys sorted for stable, order-independent hashing
|
|
10
|
+
*
|
|
11
|
+
* This ensures semantically equivalent types—regardless of alias, generic key naming, or structural nesting—
|
|
12
|
+
* always produce the same hash, making this suitable for caching, deduplication, and fast comparison.
|
|
13
|
+
*
|
|
14
|
+
* @param type The Type to hash (either a string or a GenericType object)
|
|
15
|
+
* @param generic_keys (optional) Array of string keys that should be normalized as generics (can be any string)
|
|
16
|
+
* @returns MD5 hash string if type/service available, otherwise undefined
|
|
17
|
+
*/
|
|
18
|
+
export declare const useTypeHash: (type: DataTypeIdentifier, generic_keys?: string[]) => string | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Walks the flow starting at its startingNode (depth-first, left-to-right) and collects
|
|
21
|
+
* all RefObjects (variables/outputs) with contextual metadata:
|
|
22
|
+
* - depth: nesting level (root 0; +1 per NODE-parameter sub-block)
|
|
23
|
+
* - scope: PATH of scope ids as number[], e.g. [0], [0,1], [0,2], [0,2,3] ...
|
|
24
|
+
* (root is [0]; each NODE-parameter group appends a new unique id)
|
|
25
|
+
* - node: GLOBAL visit index across the entire flow (1-based, strictly increasing)
|
|
26
|
+
*
|
|
27
|
+
* Notes:
|
|
28
|
+
* - A NODE-typed parameter opens a new group/lane: depth+1 and scopePath+[newId].
|
|
29
|
+
* - Functions passed as non-NODE parameters are traversed in the SAME depth/scopePath.
|
|
30
|
+
* - The `node` id is incremented globally for every visited node and shared by all
|
|
31
|
+
* RefObjects (inputs from rules and the return value) produced by that node.
|
|
32
|
+
*/
|
|
33
|
+
export declare const useRefObjects: (flowId: Flow["id"]) => Array<ReferenceValue>;
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { c as x } from "../../../_virtual/compiler-runtime.js";
|
|
2
|
+
import { useService as y } from "../../../utils/contextStore.js";
|
|
3
|
+
import { DFlowReactiveSuggestionService as M } from "./DFlowSuggestion.service.js";
|
|
4
|
+
import { DFlowDataTypeReactiveService as B } from "../data-type/DFlowDataType.service.js";
|
|
5
|
+
import { md5 as P } from "js-md5";
|
|
6
|
+
import { DFlowSuggestionType as f, DFlowSuggestion as S } from "./DFlowSuggestion.view.js";
|
|
7
|
+
import { DFlowFunctionReactiveService as j } from "../function/DFlowFunction.service.js";
|
|
8
|
+
import { replaceGenericsAndSortType as O, resolveType as A, isMatchingType as b } from "../../../utils/generics.js";
|
|
9
|
+
import { NodeFunctionView as D } from "../DFlow.view.js";
|
|
10
|
+
import { DFlowReactiveService as L } from "../DFlow.service.js";
|
|
11
|
+
import { useReturnType as Y } from "../function/DFlowFunction.return.hook.js";
|
|
12
|
+
import { useInputType as $ } from "../function/DFlowFunction.input.hook.js";
|
|
13
|
+
const ie = (i, p, s, g = 0, u = [0], T = 1, v = [f.REF_OBJECT, f.VALUE, f.FUNCTION, f.FUNCTION_COMBINATION, f.DATA_TYPE]) => {
|
|
14
|
+
const m = y(M), I = y(B), R = y(L), E = y(j), N = R.getById(s), l = i ? I?.getDataType(i) : void 0;
|
|
15
|
+
if (!m || !I) return [];
|
|
16
|
+
const o = i ? G(i) : void 0, r = i ? O(A(i, I), p) : void 0, a = [];
|
|
17
|
+
return m.getSuggestionsByHash(o || "").length <= 0 && (o && l && v.includes(f.VALUE) && l.rules?.nodes?.forEach((n) => {
|
|
18
|
+
if (n?.variant === "ITEM_OF_COLLECTION")
|
|
19
|
+
n.config.items?.forEach((e) => {
|
|
20
|
+
const t = new S(o, [], {
|
|
21
|
+
__typename: "LiteralValue",
|
|
22
|
+
value: e
|
|
23
|
+
}, f.VALUE, [e.toString()]);
|
|
24
|
+
m.add(t), a.push(t);
|
|
25
|
+
});
|
|
26
|
+
else if (n?.variant === "NUMBER_RANGE") {
|
|
27
|
+
const e = n.config, t = new S(o, [], {
|
|
28
|
+
__typename: "LiteralValue",
|
|
29
|
+
value: e.from
|
|
30
|
+
}, f.VALUE, [e.from?.toString() ?? ""]);
|
|
31
|
+
m.add(t), a.push(t);
|
|
32
|
+
}
|
|
33
|
+
}), o && l && l.variant === "DATA_TYPE" && v.includes(f.DATA_TYPE) && I.values().forEach((n) => {
|
|
34
|
+
const e = new S(o, [], n.json, f.DATA_TYPE, [n.name?.nodes[0]?.content]);
|
|
35
|
+
m.add(e), a.push(e);
|
|
36
|
+
}), v.includes(f.FUNCTION_COMBINATION) && E.values().filter((e) => {
|
|
37
|
+
if (!i || !r || !o) return !0;
|
|
38
|
+
if (e.runtimeFunctionDefinition?.identifier == "RETURN" && i) return !1;
|
|
39
|
+
if (l?.variant === "NODE") return !0;
|
|
40
|
+
if (!e.returnType || !e.genericKeys) return !1;
|
|
41
|
+
const t = O(A(e.returnType, I), e.genericKeys);
|
|
42
|
+
return b(r, t);
|
|
43
|
+
}).sort((e, t) => {
|
|
44
|
+
const [c, d, _] = e.runtimeFunctionDefinition.identifier.split("::"), [F, C, h] = t.runtimeFunctionDefinition.identifier.split("::"), U = c.localeCompare(F);
|
|
45
|
+
if (U !== 0) return U;
|
|
46
|
+
const V = d.localeCompare(C);
|
|
47
|
+
return V !== 0 ? V : _.localeCompare(h);
|
|
48
|
+
}).forEach((e) => {
|
|
49
|
+
const t = {
|
|
50
|
+
__typename: "NodeFunction",
|
|
51
|
+
//TODO: generate unique id
|
|
52
|
+
id: `gid://sagittarius/NodeFunction/${(N?.nodes?.length ?? 0) + 1}`,
|
|
53
|
+
functionDefinition: {
|
|
54
|
+
id: e.id,
|
|
55
|
+
runtimeFunctionDefinition: e.runtimeFunctionDefinition
|
|
56
|
+
},
|
|
57
|
+
parameters: {
|
|
58
|
+
nodes: e.parameterDefinitions?.map((d) => ({
|
|
59
|
+
id: d.id,
|
|
60
|
+
runtimeParameter: {
|
|
61
|
+
id: d.id
|
|
62
|
+
}
|
|
63
|
+
})) ?? []
|
|
64
|
+
}
|
|
65
|
+
}, c = new S(o || "", [], t, f.FUNCTION, [e.names?.nodes[0]?.content]);
|
|
66
|
+
a.push(c);
|
|
67
|
+
})), v.includes(f.REF_OBJECT) && (i ? J(s) : []).forEach((e) => {
|
|
68
|
+
if ((e?.node ?? 0) >= T || (e?.depth ?? 0) > g || (e?.scope ?? []).some((d) => !u.includes(d)) || !r) return;
|
|
69
|
+
const t = O(A(e.dataTypeIdentifier, I), []);
|
|
70
|
+
if (!b(r, t)) return;
|
|
71
|
+
const c = new S(o || "", [], e, f.REF_OBJECT, [`${e.depth}-${e.scope}-${e.node || ""}`]);
|
|
72
|
+
a.push(c);
|
|
73
|
+
}), [...a, ...m.getSuggestionsByHash(o || "")].sort();
|
|
74
|
+
}, G = (i, p) => {
|
|
75
|
+
const s = x.c(4), g = y(B);
|
|
76
|
+
if (!i || !g)
|
|
77
|
+
return;
|
|
78
|
+
let u;
|
|
79
|
+
if (s[0] !== g || s[1] !== p || s[2] !== i) {
|
|
80
|
+
const T = A(i, g), v = O(T, p), m = JSON.stringify(v);
|
|
81
|
+
u = P(m), s[0] = g, s[1] = p, s[2] = i, s[3] = u;
|
|
82
|
+
} else
|
|
83
|
+
u = s[3];
|
|
84
|
+
return u;
|
|
85
|
+
}, J = (i) => {
|
|
86
|
+
const p = y(B), s = y(L), g = y(j), u = [];
|
|
87
|
+
if (!p || !s || !g) return u;
|
|
88
|
+
const T = s.values().find((N) => N.id === i);
|
|
89
|
+
if (!T?.startingNodeId) return u;
|
|
90
|
+
let v = 0;
|
|
91
|
+
const m = () => ++v;
|
|
92
|
+
let I = 0;
|
|
93
|
+
const R = () => ++I, E = (N, l, o) => {
|
|
94
|
+
if (!N) return;
|
|
95
|
+
let r = N;
|
|
96
|
+
for (; r; ) {
|
|
97
|
+
const a = g.getById(r.functionDefinition?.id);
|
|
98
|
+
if (!a) break;
|
|
99
|
+
const w = R();
|
|
100
|
+
if (r.parameters && a.parameterDefinitions)
|
|
101
|
+
for (const n of a.parameterDefinitions) {
|
|
102
|
+
const e = p.getDataType(n.dataTypeIdentifier);
|
|
103
|
+
if (!e || e.variant === "NODE") continue;
|
|
104
|
+
const t = e.rules?.nodes?.filter((c) => c?.variant === "INPUT_TYPE") ?? [];
|
|
105
|
+
if (t.length) {
|
|
106
|
+
const d = r.parameters.find((F) => F.id === n.id)?.value, _ = d !== void 0 ? d instanceof D ? [d.json()] : [d] : [];
|
|
107
|
+
for (const F of t) {
|
|
108
|
+
const C = F?.config, h = $(C.dataTypeIdentifier, a, _, p);
|
|
109
|
+
h && u.push({
|
|
110
|
+
__typename: "ReferenceValue",
|
|
111
|
+
dataTypeIdentifier: h,
|
|
112
|
+
depth: l,
|
|
113
|
+
scope: o,
|
|
114
|
+
node: w
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
{
|
|
120
|
+
const n = r.parameters?.map((t) => t.value).filter((t) => t !== void 0) ?? [], e = Y(a, n.map((t) => t instanceof D ? t.json() : t), p);
|
|
121
|
+
e && u.push({
|
|
122
|
+
__typename: "ReferenceValue",
|
|
123
|
+
dataTypeIdentifier: e,
|
|
124
|
+
depth: l,
|
|
125
|
+
scope: o,
|
|
126
|
+
node: w
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
if (r.parameters && a.parameterDefinitions)
|
|
130
|
+
for (const n of a.parameterDefinitions)
|
|
131
|
+
if (p.getDataType(n.dataTypeIdentifier)?.variant === "NODE") {
|
|
132
|
+
const t = r.parameters.find((c) => c.id === n.id);
|
|
133
|
+
if (t?.value && t.value instanceof D) {
|
|
134
|
+
const c = t.value, d = [...o, m()];
|
|
135
|
+
E(c, l + 1, d);
|
|
136
|
+
}
|
|
137
|
+
} else {
|
|
138
|
+
const t = r.parameters.find((c) => c.id === n.id);
|
|
139
|
+
t?.value && t.value instanceof D && E(t.value, l, o);
|
|
140
|
+
}
|
|
141
|
+
r = T.getNodeById(r.nextNodeId);
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
return E(T.getNodeById(T.startingNodeId), 0, [0]), u;
|
|
145
|
+
};
|
|
146
|
+
export {
|
|
147
|
+
J as useRefObjects,
|
|
148
|
+
ie as useSuggestions,
|
|
149
|
+
G as useTypeHash
|
|
150
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ReactiveArrayService } from '../../../utils/reactiveArrayService';
|
|
2
|
+
import { DFlowSuggestion } from './DFlowSuggestion.view';
|
|
3
|
+
export declare abstract class DFlowReactiveSuggestionService extends ReactiveArrayService<DFlowSuggestion> {
|
|
4
|
+
getSuggestionsByHash(hash: string): DFlowSuggestion[];
|
|
5
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ReactiveArrayService as s } from "../../../utils/reactiveArrayService.js";
|
|
2
|
+
class l extends s {
|
|
3
|
+
//get all suggestions with matching hash
|
|
4
|
+
getSuggestionsByHash(a) {
|
|
5
|
+
const t = /* @__PURE__ */ new Set();
|
|
6
|
+
return this.values().filter((e) => e.hash === a).filter((e) => {
|
|
7
|
+
const r = JSON.stringify({
|
|
8
|
+
path: e.path,
|
|
9
|
+
value: e.value,
|
|
10
|
+
type: e.type
|
|
11
|
+
});
|
|
12
|
+
return t.has(r) ? !1 : (t.add(r), !0);
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
l as DFlowReactiveSuggestionService
|
|
18
|
+
};
|