@code0-tech/pictor 0.0.0-mvp.2
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/DFlowDataType.service-Dz8pQUeO.js +793 -0
- package/dist/assets/Avatar.css +1 -0
- package/dist/assets/Badge.css +1 -0
- package/dist/assets/Breadcrumb.css +1 -0
- package/dist/assets/Button.css +1 -0
- package/dist/assets/ButtonGroup.css +1 -0
- package/dist/assets/Card.css +1 -0
- package/dist/assets/Col.css +1 -0
- package/dist/assets/Command.css +1 -0
- package/dist/assets/Container.css +1 -0
- package/dist/assets/DFlow.css +1 -0
- package/dist/assets/DFlowFolder.css +1 -0
- package/dist/assets/DFlowFunctionDefaultCard.css +1 -0
- package/dist/assets/DFlowInputDataType.css +1 -0
- package/dist/assets/DFlowMiniMap.css +1 -0
- package/dist/assets/DFlowSuggestionSearchInput.css +1 -0
- package/dist/assets/DFlowValidation.css +1 -0
- package/dist/assets/DFullScreen.css +1 -0
- package/dist/assets/DLayout.css +1 -0
- package/dist/assets/DResizable.css +1 -0
- package/dist/assets/Dialog.css +1 -0
- package/dist/assets/FileTabs.css +1 -0
- package/dist/assets/Flex.css +1 -0
- package/dist/assets/Input.css +1 -0
- package/dist/assets/Menu.css +1 -0
- package/dist/assets/Quote.css +1 -0
- package/dist/assets/Row.css +1 -0
- package/dist/assets/ScrollArea.css +1 -0
- package/dist/assets/SegmentedControl.css +1 -0
- package/dist/assets/Text.css +1 -0
- package/dist/assets/Tooltip.css +1 -0
- package/dist/compiler-runtime-BNHg76kC.js +36 -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 +31 -0
- package/dist/components/button/Button.d.ts +10 -0
- package/dist/components/button/Button.js +28 -0
- package/dist/components/button-group/ButtonGroup.d.ts +7 -0
- package/dist/components/button-group/ButtonGroup.js +26 -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 +26 -0
- package/dist/components/command/Command.d.ts +30 -0
- package/dist/components/command/Command.js +102 -0
- package/dist/components/container/Container.d.ts +6 -0
- package/dist/components/container/Container.js +20 -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 +145 -0
- package/dist/components/d-flow/DFlow.js +373 -0
- package/dist/components/d-flow/DFlow.nodes.hook.d.ts +3 -0
- package/dist/components/d-flow/DFlow.nodes.hook.js +140 -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 +7 -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 +6 -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 +6 -0
- package/dist/components/d-flow/data-type/rules/DFlowDataTypeContainsTypeRule.d.ts +6 -0
- package/dist/components/d-flow/data-type/rules/DFlowDataTypeContainsTypeRule.js +6 -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 +7 -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 +8 -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 +118 -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 +75 -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 +21 -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 +151 -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 +21 -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 +59 -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 +7 -0
- package/dist/components/d-fullscreen/DFullScreen.js +20 -0
- package/dist/components/d-layout/DLayout.d.ts +10 -0
- package/dist/components/d-layout/DLayout.js +51 -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 +31 -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 +98 -0
- package/dist/components/file-tabs/FileTabs.d.ts +17 -0
- package/dist/components/file-tabs/FileTabs.js +70 -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 +48 -0
- package/dist/components/row/Row.d.ts +6 -0
- package/dist/components/row/Row.js +20 -0
- package/dist/components/scroll-area/ScrollArea.d.ts +13 -0
- package/dist/components/scroll-area/ScrollArea.js +42 -0
- package/dist/components/segmented-control/SegmentedControl.d.ts +8 -0
- package/dist/components/segmented-control/SegmentedControl.js +23 -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 +47 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.js +223 -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 +311 -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 +81 -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 +121 -0
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { jsxs as g, Fragment as O, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { c as N } from "../../../compiler-runtime-BNHg76kC.js";
|
|
3
|
+
import S from "react";
|
|
4
|
+
import { mergeCode0Props as D } from "../../../utils/utils.js";
|
|
5
|
+
import { IconChevronDown as $, IconChevronRight as x, IconFolder as A } from "@tabler/icons-react";
|
|
6
|
+
import { useService as I, useStore as k } from "../../../utils/contextStore.js";
|
|
7
|
+
import { DFlowReactiveService as b } from "../DFlow.service.js";
|
|
8
|
+
import { ScrollArea as z, ScrollAreaViewport as R, ScrollAreaScrollbar as j, ScrollAreaThumb as M } from "../../scroll-area/ScrollArea.js";
|
|
9
|
+
import '../../../assets/DFlowFolder.css';const Q = (f) => {
|
|
10
|
+
const {
|
|
11
|
+
flowId: e
|
|
12
|
+
} = f, a = I(b), m = k(b), h = (n) => n.replace(/^\/+|\/+$/g, "").split("/").filter(Boolean), d = S.useMemo(() => (a.values?.() ?? []).filter((l) => !!l?.name), [m]), u = S.useMemo(() => {
|
|
13
|
+
const n = d.find((l) => l.id === e);
|
|
14
|
+
return n?.name ? h(n.name) : [];
|
|
15
|
+
}, [d, e]), p = S.useMemo(() => {
|
|
16
|
+
const n = {
|
|
17
|
+
name: "",
|
|
18
|
+
path: "",
|
|
19
|
+
children: {}
|
|
20
|
+
};
|
|
21
|
+
for (const l of d) {
|
|
22
|
+
const i = h(l.name);
|
|
23
|
+
if (i.length === 0) continue;
|
|
24
|
+
let o = n, t = "";
|
|
25
|
+
for (let c = 0; c < i.length; c++) {
|
|
26
|
+
const r = i[c];
|
|
27
|
+
t = t ? `${t}/${r}` : r, c === i.length - 1 ? o.children[r] ? o.children[r].flow = l : o.children[r] = {
|
|
28
|
+
name: r,
|
|
29
|
+
path: t,
|
|
30
|
+
children: {},
|
|
31
|
+
flow: l
|
|
32
|
+
} : (o.children[r] || (o.children[r] = {
|
|
33
|
+
name: r,
|
|
34
|
+
path: t,
|
|
35
|
+
children: {}
|
|
36
|
+
}), o = o.children[r]);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return n;
|
|
40
|
+
}, [d]), v = S.useCallback((n) => n ? n.split("/").filter(Boolean).every((i, o) => u[o] === i) : !1, [u]), _ = S.useCallback((n) => {
|
|
41
|
+
const l = Object.values(n), i = l.filter((t) => !t.flow), o = l.filter((t) => !!t.flow);
|
|
42
|
+
return i.sort((t, c) => t.name.localeCompare(c.name)), o.sort((t, c) => t.name.localeCompare(c.name)), /* @__PURE__ */ g(O, { children: [
|
|
43
|
+
i.map((t) => /* @__PURE__ */ s(P, { name: t.name, defaultOpen: v(t.path), children: _(t.children) }, t.path)),
|
|
44
|
+
o.map((t) => /* @__PURE__ */ s(y, { name: t.name, active: t.flow.id === e, "data-flow-id": t.flow.id ?? void 0, title: t.flow.name ?? void 0 }, t.flow.id ?? t.path))
|
|
45
|
+
] });
|
|
46
|
+
}, [e, v]);
|
|
47
|
+
return /* @__PURE__ */ g(z, { h: "100%", children: [
|
|
48
|
+
/* @__PURE__ */ s(R, { children: /* @__PURE__ */ s("div", { className: "d-folder__root", children: _(p.children) }) }),
|
|
49
|
+
/* @__PURE__ */ s(j, { orientation: "vertical", children: /* @__PURE__ */ s(M, {}) })
|
|
50
|
+
] });
|
|
51
|
+
}, P = (f) => {
|
|
52
|
+
const e = N.c(22), {
|
|
53
|
+
name: a,
|
|
54
|
+
defaultOpen: m,
|
|
55
|
+
children: h,
|
|
56
|
+
...d
|
|
57
|
+
} = f, u = m === void 0 ? !1 : m, [p, v] = S.useState(u);
|
|
58
|
+
let _;
|
|
59
|
+
e[0] !== v ? (_ = () => v(B), e[0] = v, e[1] = _) : _ = e[1];
|
|
60
|
+
const n = D("d-folder", d);
|
|
61
|
+
let l;
|
|
62
|
+
e[2] !== v ? (l = () => v(E), e[2] = v, e[3] = l) : l = e[3];
|
|
63
|
+
let i;
|
|
64
|
+
e[4] !== p ? (i = p ? /* @__PURE__ */ s($, { size: 12 }) : /* @__PURE__ */ s(x, { size: 12 }), e[4] = p, e[5] = i) : i = e[5];
|
|
65
|
+
let o;
|
|
66
|
+
e[6] !== l || e[7] !== i ? (o = /* @__PURE__ */ s("span", { onClick: l, className: "d-folder__status", children: i }), e[6] = l, e[7] = i, e[8] = o) : o = e[8];
|
|
67
|
+
let t;
|
|
68
|
+
e[9] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ s("span", { className: "d-folder__icon", children: /* @__PURE__ */ s(A, { size: 12 }) }), e[9] = t) : t = e[9];
|
|
69
|
+
let c;
|
|
70
|
+
e[10] !== a ? (c = /* @__PURE__ */ s("span", { className: "d-folder__name", children: a }), e[10] = a, e[11] = c) : c = e[11];
|
|
71
|
+
let r;
|
|
72
|
+
e[12] !== _ || e[13] !== n || e[14] !== o || e[15] !== c ? (r = /* @__PURE__ */ g("div", { onDoubleClick: _, ...n, children: [
|
|
73
|
+
o,
|
|
74
|
+
t,
|
|
75
|
+
c
|
|
76
|
+
] }), e[12] = _, e[13] = n, e[14] = o, e[15] = c, e[16] = r) : r = e[16];
|
|
77
|
+
const F = p ? h : null;
|
|
78
|
+
let w;
|
|
79
|
+
e[17] !== F ? (w = /* @__PURE__ */ s("div", { className: "d-folder__content", children: F }), e[17] = F, e[18] = w) : w = e[18];
|
|
80
|
+
let C;
|
|
81
|
+
return e[19] !== w || e[20] !== r ? (C = /* @__PURE__ */ g("div", { children: [
|
|
82
|
+
r,
|
|
83
|
+
w
|
|
84
|
+
] }), e[19] = w, e[20] = r, e[21] = C) : C = e[21], C;
|
|
85
|
+
}, y = (f) => {
|
|
86
|
+
const e = N.c(12);
|
|
87
|
+
let a, m, h;
|
|
88
|
+
if (e[0] !== f) {
|
|
89
|
+
const {
|
|
90
|
+
name: v,
|
|
91
|
+
icon: _,
|
|
92
|
+
active: n,
|
|
93
|
+
...l
|
|
94
|
+
} = f;
|
|
95
|
+
m = v, a = _, h = D(`d-folder__item ${n ? "d-folder__item--active" : ""}`, l), e[0] = f, e[1] = a, e[2] = m, e[3] = h;
|
|
96
|
+
} else
|
|
97
|
+
a = e[1], m = e[2], h = e[3];
|
|
98
|
+
let d;
|
|
99
|
+
e[4] !== a ? (d = a ? /* @__PURE__ */ s("span", { className: "d-folder__item-icon", children: a }) : null, e[4] = a, e[5] = d) : d = e[5];
|
|
100
|
+
let u;
|
|
101
|
+
e[6] !== m ? (u = /* @__PURE__ */ s("span", { className: "d-folder__item-name", children: m }), e[6] = m, e[7] = u) : u = e[7];
|
|
102
|
+
let p;
|
|
103
|
+
return e[8] !== h || e[9] !== d || e[10] !== u ? (p = /* @__PURE__ */ g("div", { ...h, children: [
|
|
104
|
+
d,
|
|
105
|
+
u
|
|
106
|
+
] }), e[8] = h, e[9] = d, e[10] = u, e[11] = p) : p = e[11], p;
|
|
107
|
+
};
|
|
108
|
+
function B(f) {
|
|
109
|
+
return !f;
|
|
110
|
+
}
|
|
111
|
+
function E(f) {
|
|
112
|
+
return !f;
|
|
113
|
+
}
|
|
114
|
+
export {
|
|
115
|
+
Q as DFlowFolder,
|
|
116
|
+
P as DFlowFolderGroup,
|
|
117
|
+
y as DFlowFolderItem
|
|
118
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './DFlowFolder';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { FunctionDefinitionView } from './DFlowFunction.view';
|
|
2
|
+
import { DFlowDataTypeReactiveService } from '../data-type/DFlowDataType.service';
|
|
3
|
+
import { DataTypeIdentifier, NodeParameterValue } from '@code0-tech/sagittarius-graphql-types';
|
|
4
|
+
export declare const useInputType: (type: DataTypeIdentifier, func: FunctionDefinitionView, values: NodeParameterValue[], dataTypeService: DFlowDataTypeReactiveService) => DataTypeIdentifier | null;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { FunctionDefinitionView } from './DFlowFunction.view';
|
|
2
|
+
import { DFlowDataTypeReactiveService } from '../data-type/DFlowDataType.service';
|
|
3
|
+
import { DataTypeIdentifier, NodeParameterValue } from '@code0-tech/sagittarius-graphql-types';
|
|
4
|
+
export declare const useReturnType: (func: FunctionDefinitionView, values: NodeParameterValue[], dataTypeService?: DFlowDataTypeReactiveService) => DataTypeIdentifier | null;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { D as n } from "../../../DFlowDataType.service-Dz8pQUeO.js";
|
|
2
|
+
import { resolveGenericKeys as p, replaceGenericKeysInType as i } from "../../../utils/generics.js";
|
|
3
|
+
import { useService as s } from "../../../utils/contextStore.js";
|
|
4
|
+
const c = (e, o, r) => {
|
|
5
|
+
if (r = r ?? s(n), !e.returnType) return null;
|
|
6
|
+
const t = p(e, o, r);
|
|
7
|
+
return i(e.returnType, t);
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
c as useReturnType
|
|
11
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ReactiveArrayService } from '../../../utils/reactiveArrayService';
|
|
2
|
+
import { FunctionDefinitionView } from './DFlowFunction.view';
|
|
3
|
+
import { FunctionDefinition } from '@code0-tech/sagittarius-graphql-types';
|
|
4
|
+
export declare abstract class DFlowFunctionReactiveService extends ReactiveArrayService<FunctionDefinitionView> {
|
|
5
|
+
getById(id: FunctionDefinition['id']): FunctionDefinitionView | undefined;
|
|
6
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FunctionDefinitionView } from './DFlowFunction.view';
|
|
2
|
+
import { DFlowDataTypeReactiveService } from '../data-type/DFlowDataType.service';
|
|
3
|
+
import { ValidationResult } from '../../../utils/inspection';
|
|
4
|
+
import { NodeParameterValue, Scalars } from '@code0-tech/sagittarius-graphql-types';
|
|
5
|
+
/**
|
|
6
|
+
* Validates function parameter values against a function definition, resolving all generics.
|
|
7
|
+
* For each parameter, determines if the provided value is a valid match for the parameter's (possibly generic) type.
|
|
8
|
+
* Returns an array of ValidationResults (errors for each parameter, null entry for valid).
|
|
9
|
+
*/
|
|
10
|
+
export declare const useFunctionValidation: (func: FunctionDefinitionView, values: NodeParameterValue[], dataTypeService: DFlowDataTypeReactiveService, flowId: Scalars["FlowID"]["output"]) => ValidationResult[] | null;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { DataTypeView as m } from "../data-type/DFlowDataType.view.js";
|
|
2
|
+
import { InspectionSeverity as N } from "../../../utils/inspection.js";
|
|
3
|
+
import { resolveGenericKeys as I, replaceGenericKeysInDataTypeObject as g, replaceGenericKeysInType as D } from "../../../utils/generics.js";
|
|
4
|
+
import { useReturnType as M } from "./DFlowFunction.return.hook.js";
|
|
5
|
+
import { useService as v } from "../../../utils/contextStore.js";
|
|
6
|
+
import { DFlowFunctionReactiveService as P } from "./DFlowFunction.service.js";
|
|
7
|
+
import { DataTypeVariant as h } from "@code0-tech/sagittarius-graphql-types";
|
|
8
|
+
import { useValidateDataType as T } from "../data-type/DFlowDataType.validation.type.js";
|
|
9
|
+
import { u as l } from "../../../DFlowDataType.service-Dz8pQUeO.js";
|
|
10
|
+
import { DFlowReactiveService as S } from "../DFlow.service.js";
|
|
11
|
+
const C = (f, d, a, R) => {
|
|
12
|
+
const w = v(P), y = v(S).getById(R), u = I(f, d, a, y), F = f.parameterDefinitions ?? [], V = f.genericKeys ?? [], r = [];
|
|
13
|
+
return F.forEach((s, K) => {
|
|
14
|
+
const n = d[K];
|
|
15
|
+
if (!n) return;
|
|
16
|
+
const p = s.dataTypeIdentifier, e = a.getDataType(p), _ = n.__typename === "NodeFunction" && e?.variant != h.Node ? M(w.getById(n.functionDefinition?.id), n.parameters?.nodes?.map((o) => o?.value)) : a.getTypeFromValue(n, y), t = a.getDataType(_), j = e && p?.genericType || p?.genericKey && V.includes(p.genericKey);
|
|
17
|
+
let i = !0;
|
|
18
|
+
if (j) {
|
|
19
|
+
if (_?.genericType && e) {
|
|
20
|
+
if (n.__typename === "ReferenceValue" || n.__typename === "NodeFunction") {
|
|
21
|
+
const o = new m(g(e.json, u)), G = new m(g(t?.json, u));
|
|
22
|
+
i = T(o, G), i || r.push(c(s.id, e, t));
|
|
23
|
+
} else {
|
|
24
|
+
const o = D(p, u);
|
|
25
|
+
i = l(n, e, y, o?.genericType?.genericMappers), i || r.push(c(s.id, e, t));
|
|
26
|
+
}
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
if (p?.genericKey && V.includes(p?.genericKey)) {
|
|
30
|
+
if (n.__typename != "ReferenceValue") {
|
|
31
|
+
const o = D(p, u);
|
|
32
|
+
i = l(n, a.getDataType(o), y, o.genericType?.genericMappers), i || r.push(c(s.id, e, t));
|
|
33
|
+
}
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
if (t && e && t.json && e.json) {
|
|
37
|
+
if (n.__typename === "ReferenceValue" || n.__typename === "NodeFunction") {
|
|
38
|
+
const o = new m(g(e.json, u));
|
|
39
|
+
i = T(o, t), i || r.push(c(s.id, e, t));
|
|
40
|
+
} else {
|
|
41
|
+
const o = D(p, u);
|
|
42
|
+
i = l(n, a.getDataType(o), y, o.genericType?.genericMappers), i || r.push(c(s.id, e, t));
|
|
43
|
+
}
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
if (e) {
|
|
48
|
+
if (_?.genericType && e) {
|
|
49
|
+
if (n.__typename === "ReferenceValue" || n.__typename === "NodeFunction") {
|
|
50
|
+
const o = new m(g(t?.json, u));
|
|
51
|
+
i = T(e, o), i || r.push(c(s.id, e, t));
|
|
52
|
+
} else
|
|
53
|
+
i = l(n, e), i || r.push(c(s.id, e, t));
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
if (t) {
|
|
57
|
+
(n.__typename === "ReferenceValue" || n.__typename === "NodeFunction") && e.variant !== h.Node ? (i = T(e, t), i || r.push(c(s.id, e, t))) : (i = l(n, e), i || r.push(c(s.id, e, t)));
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
r.push(c(s.id, e, t));
|
|
62
|
+
}), r.length > 0 ? r : null;
|
|
63
|
+
}, c = (f, d, a) => ({
|
|
64
|
+
parameterId: f,
|
|
65
|
+
type: N.ERROR,
|
|
66
|
+
message: {
|
|
67
|
+
nodes: [{
|
|
68
|
+
code: "en-US",
|
|
69
|
+
content: `Argument of type ${a?.name?.nodes[0]?.content} is not assignable to parameter of type ${d?.name?.nodes[0]?.content}`
|
|
70
|
+
}]
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
export {
|
|
74
|
+
C as useFunctionValidation
|
|
75
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { DataTypeIdentifier, FunctionDefinition, Maybe, ParameterDefinition, RuntimeFunctionDefinition, Scalars, TranslationConnection } from '@code0-tech/sagittarius-graphql-types';
|
|
2
|
+
export declare class FunctionDefinitionView {
|
|
3
|
+
/** Time when this FunctionDefinition was created */
|
|
4
|
+
private readonly _createdAt?;
|
|
5
|
+
/** Deprecation message of the function */
|
|
6
|
+
private readonly _deprecationMessages?;
|
|
7
|
+
/** Description of the function */
|
|
8
|
+
private readonly _descriptions?;
|
|
9
|
+
/** Documentation of the function */
|
|
10
|
+
private readonly _documentations?;
|
|
11
|
+
/** Generic keys of the function */
|
|
12
|
+
private readonly _genericKeys?;
|
|
13
|
+
/** Global ID of this FunctionDefinition */
|
|
14
|
+
private readonly _id?;
|
|
15
|
+
/** Name of the function */
|
|
16
|
+
private readonly _names?;
|
|
17
|
+
/** Parameters of the function */
|
|
18
|
+
private readonly _parameterDefinitions?;
|
|
19
|
+
/** Return type of the function */
|
|
20
|
+
private readonly _returnType?;
|
|
21
|
+
/** Runtime function definition */
|
|
22
|
+
private readonly _runtimeFunctionDefinition?;
|
|
23
|
+
/** Indicates if the function can throw an error */
|
|
24
|
+
private readonly _throwsError?;
|
|
25
|
+
/** Time when this FunctionDefinition was last updated */
|
|
26
|
+
private readonly _updatedAt?;
|
|
27
|
+
constructor(object: FunctionDefinition);
|
|
28
|
+
get createdAt(): Maybe<Scalars["Time"]["output"]> | undefined;
|
|
29
|
+
get deprecationMessages(): Maybe<TranslationConnection> | undefined;
|
|
30
|
+
get descriptions(): Maybe<TranslationConnection> | undefined;
|
|
31
|
+
get documentations(): Maybe<TranslationConnection> | undefined;
|
|
32
|
+
get genericKeys(): Maybe<Array<Scalars["String"]["output"]>> | undefined;
|
|
33
|
+
get id(): Maybe<Scalars["FunctionDefinitionID"]["output"]> | undefined;
|
|
34
|
+
get names(): Maybe<TranslationConnection> | undefined;
|
|
35
|
+
get parameterDefinitions(): Maybe<ParameterDefinitionView[]> | undefined;
|
|
36
|
+
get returnType(): Maybe<DataTypeIdentifier> | undefined;
|
|
37
|
+
get runtimeFunctionDefinition(): Maybe<RuntimeFunctionDefinition> | undefined;
|
|
38
|
+
get throwsError(): Maybe<Scalars["Boolean"]["output"]> | undefined;
|
|
39
|
+
get updatedAt(): Maybe<Scalars["Time"]["output"]> | undefined;
|
|
40
|
+
json(): FunctionDefinition;
|
|
41
|
+
}
|
|
42
|
+
export declare class ParameterDefinitionView {
|
|
43
|
+
/** Time when this ParameterDefinition was created */
|
|
44
|
+
private readonly _createdAt?;
|
|
45
|
+
/** Data type of the parameter */
|
|
46
|
+
private readonly _dataTypeIdentifier?;
|
|
47
|
+
/** Description of the parameter */
|
|
48
|
+
private readonly _descriptions?;
|
|
49
|
+
/** Documentation of the parameter */
|
|
50
|
+
private readonly _documentations?;
|
|
51
|
+
/** Global ID of this ParameterDefinition */
|
|
52
|
+
private readonly _id?;
|
|
53
|
+
/** Name of the parameter */
|
|
54
|
+
private readonly _names?;
|
|
55
|
+
/** Time when this ParameterDefinition was last updated */
|
|
56
|
+
private readonly _updatedAt?;
|
|
57
|
+
constructor(object: ParameterDefinition);
|
|
58
|
+
get createdAt(): Maybe<Scalars["Time"]["output"]> | undefined;
|
|
59
|
+
get dataTypeIdentifier(): Maybe<DataTypeIdentifier> | undefined;
|
|
60
|
+
get descriptions(): Maybe<TranslationConnection> | undefined;
|
|
61
|
+
get documentations(): Maybe<TranslationConnection> | undefined;
|
|
62
|
+
get id(): Maybe<Scalars["ParameterDefinitionID"]["output"]> | undefined;
|
|
63
|
+
get names(): Maybe<TranslationConnection> | undefined;
|
|
64
|
+
get updatedAt(): Maybe<Scalars["Time"]["output"]> | undefined;
|
|
65
|
+
json(): ParameterDefinition;
|
|
66
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
function i(e, t, r) {
|
|
2
|
+
return (t = s(t)) in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
|
|
3
|
+
}
|
|
4
|
+
function s(e) {
|
|
5
|
+
var t = d(e, "string");
|
|
6
|
+
return typeof t == "symbol" ? t : t + "";
|
|
7
|
+
}
|
|
8
|
+
function d(e, t) {
|
|
9
|
+
if (typeof e != "object" || !e) return e;
|
|
10
|
+
var r = e[Symbol.toPrimitive];
|
|
11
|
+
if (r !== void 0) {
|
|
12
|
+
var n = r.call(e, t);
|
|
13
|
+
if (typeof n != "object") return n;
|
|
14
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
15
|
+
}
|
|
16
|
+
return (t === "string" ? String : Number)(e);
|
|
17
|
+
}
|
|
18
|
+
class a {
|
|
19
|
+
constructor(t) {
|
|
20
|
+
i(this, "_createdAt", void 0), i(this, "_deprecationMessages", void 0), i(this, "_descriptions", void 0), i(this, "_documentations", void 0), i(this, "_genericKeys", void 0), i(this, "_id", void 0), i(this, "_names", void 0), i(this, "_parameterDefinitions", void 0), i(this, "_returnType", void 0), i(this, "_runtimeFunctionDefinition", void 0), i(this, "_throwsError", void 0), i(this, "_updatedAt", void 0), this._createdAt = t.createdAt, this._deprecationMessages = t.deprecationMessages, this._descriptions = t.descriptions, this._documentations = t.documentations, this._genericKeys = t.genericKeys, this._id = t.id, this._names = t.names, this._parameterDefinitions = t.parameterDefinitions?.nodes?.map((r) => new o(r)) ?? void 0, this._returnType = t.returnType, this._runtimeFunctionDefinition = t.runtimeFunctionDefinition, this._throwsError = t.throwsError, this._updatedAt = t.updatedAt;
|
|
21
|
+
}
|
|
22
|
+
get createdAt() {
|
|
23
|
+
return this._createdAt;
|
|
24
|
+
}
|
|
25
|
+
get deprecationMessages() {
|
|
26
|
+
return this._deprecationMessages;
|
|
27
|
+
}
|
|
28
|
+
get descriptions() {
|
|
29
|
+
return this._descriptions;
|
|
30
|
+
}
|
|
31
|
+
get documentations() {
|
|
32
|
+
return this._documentations;
|
|
33
|
+
}
|
|
34
|
+
get genericKeys() {
|
|
35
|
+
return this._genericKeys;
|
|
36
|
+
}
|
|
37
|
+
get id() {
|
|
38
|
+
return this._id;
|
|
39
|
+
}
|
|
40
|
+
get names() {
|
|
41
|
+
return this._names;
|
|
42
|
+
}
|
|
43
|
+
get parameterDefinitions() {
|
|
44
|
+
return this._parameterDefinitions;
|
|
45
|
+
}
|
|
46
|
+
get returnType() {
|
|
47
|
+
return this._returnType;
|
|
48
|
+
}
|
|
49
|
+
get runtimeFunctionDefinition() {
|
|
50
|
+
return this._runtimeFunctionDefinition;
|
|
51
|
+
}
|
|
52
|
+
get throwsError() {
|
|
53
|
+
return this._throwsError;
|
|
54
|
+
}
|
|
55
|
+
get updatedAt() {
|
|
56
|
+
return this._updatedAt;
|
|
57
|
+
}
|
|
58
|
+
json() {
|
|
59
|
+
return {
|
|
60
|
+
createdAt: this._createdAt,
|
|
61
|
+
deprecationMessages: this._deprecationMessages,
|
|
62
|
+
descriptions: this._descriptions,
|
|
63
|
+
documentations: this._documentations,
|
|
64
|
+
genericKeys: this._genericKeys,
|
|
65
|
+
id: this._id,
|
|
66
|
+
names: this._names,
|
|
67
|
+
parameterDefinitions: this._parameterDefinitions ? {
|
|
68
|
+
nodes: this._parameterDefinitions.map((t) => t.json())
|
|
69
|
+
} : void 0,
|
|
70
|
+
returnType: this._returnType,
|
|
71
|
+
runtimeFunctionDefinition: this._runtimeFunctionDefinition,
|
|
72
|
+
throwsError: this._throwsError,
|
|
73
|
+
updatedAt: this._updatedAt
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
class o {
|
|
78
|
+
constructor(t) {
|
|
79
|
+
i(this, "_createdAt", void 0), i(this, "_dataTypeIdentifier", void 0), i(this, "_descriptions", void 0), i(this, "_documentations", void 0), i(this, "_id", void 0), i(this, "_names", void 0), i(this, "_updatedAt", void 0), this._createdAt = t.createdAt, this._dataTypeIdentifier = t.dataTypeIdentifier, this._descriptions = t.descriptions, this._documentations = t.documentations, this._id = t.id, this._names = t.names, this._updatedAt = t.updatedAt;
|
|
80
|
+
}
|
|
81
|
+
get createdAt() {
|
|
82
|
+
return this._createdAt;
|
|
83
|
+
}
|
|
84
|
+
get dataTypeIdentifier() {
|
|
85
|
+
return this._dataTypeIdentifier;
|
|
86
|
+
}
|
|
87
|
+
get descriptions() {
|
|
88
|
+
return this._descriptions;
|
|
89
|
+
}
|
|
90
|
+
get documentations() {
|
|
91
|
+
return this._documentations;
|
|
92
|
+
}
|
|
93
|
+
get id() {
|
|
94
|
+
return this._id;
|
|
95
|
+
}
|
|
96
|
+
get names() {
|
|
97
|
+
return this._names;
|
|
98
|
+
}
|
|
99
|
+
get updatedAt() {
|
|
100
|
+
return this._updatedAt;
|
|
101
|
+
}
|
|
102
|
+
json() {
|
|
103
|
+
return {
|
|
104
|
+
createdAt: this._createdAt,
|
|
105
|
+
dataTypeIdentifier: this._dataTypeIdentifier,
|
|
106
|
+
descriptions: this._descriptions,
|
|
107
|
+
documentations: this._documentations,
|
|
108
|
+
id: this._id,
|
|
109
|
+
names: this._names,
|
|
110
|
+
updatedAt: this._updatedAt
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
export {
|
|
115
|
+
a as FunctionDefinitionView,
|
|
116
|
+
o as ParameterDefinitionView
|
|
117
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Code0Component } from '../../../utils/types';
|
|
2
|
+
import { Node, NodeProps } from '@xyflow/react';
|
|
3
|
+
import { NodeFunctionView } from '../DFlow.view';
|
|
4
|
+
import { default as React } from 'react';
|
|
5
|
+
import { Scalars } from '@code0-tech/sagittarius-graphql-types';
|
|
6
|
+
export interface DFlowFunctionDefaultCardDataProps extends Omit<Code0Component<HTMLDivElement>, "scope"> {
|
|
7
|
+
instance: NodeFunctionView;
|
|
8
|
+
flowId: Scalars["FlowID"]["output"];
|
|
9
|
+
isParameter: boolean;
|
|
10
|
+
depth: number;
|
|
11
|
+
scope: number[];
|
|
12
|
+
index: number;
|
|
13
|
+
}
|
|
14
|
+
export type DFlowFunctionDefaultCardProps = NodeProps<Node<DFlowFunctionDefaultCardDataProps>>;
|
|
15
|
+
export declare const DFlowFunctionDefaultCard: React.FC<DFlowFunctionDefaultCardProps>;
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { jsxs as o, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useStore as h, useReactFlow as G, useStoreApi as O, Handle as I, Position as u } from "@xyflow/react";
|
|
3
|
+
import { NodeFunctionView as b } from "../DFlow.view.js";
|
|
4
|
+
import { memo as V } from "react";
|
|
5
|
+
import { Card as H } from "../../card/Card.js";
|
|
6
|
+
import C from "../../card/CardSection.js";
|
|
7
|
+
import { Flex as s } from "../../flex/Flex.js";
|
|
8
|
+
import { IconFileLambdaFilled as W, IconDots as k, IconTrash as $, IconCopy as X, IconLayoutNavbarCollapseFilled as Y, IconExclamationCircle as q, IconAlertTriangle as J, IconMessageExclamation as K, IconArrowRightCircle as Q } from "@tabler/icons-react";
|
|
9
|
+
import { Text as S } from "../../text/Text.js";
|
|
10
|
+
import { Button as D } from "../../button/Button.js";
|
|
11
|
+
import { Menu as U, MenuTrigger as Z, MenuPortal as ee, MenuContent as te, MenuLabel as ie, MenuItem as x } from "../../menu/Menu.js";
|
|
12
|
+
import { Badge as R } from "../../badge/Badge.js";
|
|
13
|
+
import { useService as g } from "../../../utils/contextStore.js";
|
|
14
|
+
import { DFlowFunctionReactiveService as ne } from "./DFlowFunction.service.js";
|
|
15
|
+
import { useFunctionValidation as oe } from "./DFlowFunction.vaildation.hook.js";
|
|
16
|
+
import { D as re } from "../../../DFlowDataType.service-Dz8pQUeO.js";
|
|
17
|
+
import { InspectionSeverity as c } from "../../../utils/inspection.js";
|
|
18
|
+
import { DFlowReactiveService as ae } from "../DFlow.service.js";
|
|
19
|
+
import { DFlowSuggestionMenu as le } from "../suggestion/DFlowSuggestionMenu.js";
|
|
20
|
+
import { useSuggestions as de } from "../suggestion/DFlowSuggestion.hook.js";
|
|
21
|
+
import { FileTabsService as se } from "../../file-tabs/FileTabs.service.js";
|
|
22
|
+
import { DFlowTabDefault as ce } from "../tab/DFlowTabDefault.js";
|
|
23
|
+
import { DataTypeVariant as N } from "@code0-tech/sagittarius-graphql-types";
|
|
24
|
+
import '../../../assets/DFlowFunctionDefaultCard.css';const Ee = V((d) => {
|
|
25
|
+
const {
|
|
26
|
+
data: i,
|
|
27
|
+
id: m
|
|
28
|
+
} = d, F = h((e) => e.width), A = h((e) => e.height), _ = G(), z = O(), v = g(se), T = g(ae), M = g(ne), y = g(re), f = M.getById(i.instance.functionDefinition?.id), r = oe(f, i.instance.parameters.map((e) => e.value instanceof b ? e.value.json() : e.value), y, d.data.flowId), E = h((e) => e.edges), L = d.width ?? 0, P = d.height ?? 0;
|
|
29
|
+
i.instance.parameters?.forEach((e) => {
|
|
30
|
+
const a = f?.parameterDefinitions.find((n) => n.id == e?.id);
|
|
31
|
+
e.validationResults = r ? r.filter((n) => n.parameterId === a?.id) : [];
|
|
32
|
+
});
|
|
33
|
+
function j(e) {
|
|
34
|
+
return E.some((a) => a.target === m && a.targetHandle === `param-${e}`);
|
|
35
|
+
}
|
|
36
|
+
const B = h((e) => {
|
|
37
|
+
const a = e.nodes.filter((l) => l.parentId === d.parentId);
|
|
38
|
+
let n;
|
|
39
|
+
return a.forEach((l) => {
|
|
40
|
+
const w = l.data?.index ?? 1 / 0, p = n?.data?.index ?? 1 / 0;
|
|
41
|
+
(!n || w < p) && (n = l);
|
|
42
|
+
}), n;
|
|
43
|
+
});
|
|
44
|
+
return /* @__PURE__ */ o(H, { outline: B.id === m, borderColor: v.getActiveTab()?.id == m ? "info" : void 0, className: v.getActiveTab()?.id == m ? "d-flow-viewport-default-card--active" : void 0, color: (r?.filter((e) => e.type === c.ERROR)?.length ?? 0) > 0 ? "error" : "secondary", onClick: () => {
|
|
45
|
+
_.setViewport({
|
|
46
|
+
x: F / 2 + d.positionAbsoluteX * -1 - L / 2,
|
|
47
|
+
y: A / 2 + d.positionAbsoluteY * -1 - P / 2,
|
|
48
|
+
zoom: 1
|
|
49
|
+
}, {
|
|
50
|
+
duration: 250
|
|
51
|
+
}), v.add({
|
|
52
|
+
id: m,
|
|
53
|
+
active: !0,
|
|
54
|
+
closeable: !0,
|
|
55
|
+
children: /* @__PURE__ */ t(S, { size: "md", children: f?.names?.nodes[0]?.content }),
|
|
56
|
+
content: /* @__PURE__ */ t(ce, { flowId: d.data.flowId, depthLevel: i.depth, scopeLevel: i.scope, nodeLevel: i.index, functionInstance: i.instance })
|
|
57
|
+
});
|
|
58
|
+
}, style: {
|
|
59
|
+
position: "relative"
|
|
60
|
+
}, children: [
|
|
61
|
+
/* @__PURE__ */ t(C, { border: !0, children: /* @__PURE__ */ o(s, { align: "center", justify: "space-between", style: {
|
|
62
|
+
gap: "0.7rem"
|
|
63
|
+
}, children: [
|
|
64
|
+
/* @__PURE__ */ o(s, { align: "center", style: {
|
|
65
|
+
gap: "0.7rem"
|
|
66
|
+
}, children: [
|
|
67
|
+
/* @__PURE__ */ t(W, { size: 16 }),
|
|
68
|
+
/* @__PURE__ */ t(S, { size: "md", children: f?.names?.nodes[0]?.content })
|
|
69
|
+
] }),
|
|
70
|
+
/* @__PURE__ */ o(s, { align: "center", style: {
|
|
71
|
+
gap: "0.7rem"
|
|
72
|
+
}, children: [
|
|
73
|
+
/* @__PURE__ */ o(U, { onOpenChange: (e) => {
|
|
74
|
+
setTimeout(() => {
|
|
75
|
+
z.setState({
|
|
76
|
+
nodesDraggable: !e,
|
|
77
|
+
nodesConnectable: !e,
|
|
78
|
+
elementsSelectable: !e
|
|
79
|
+
});
|
|
80
|
+
}, 250);
|
|
81
|
+
}, children: [
|
|
82
|
+
/* @__PURE__ */ t(Z, { asChild: !0, children: /* @__PURE__ */ t(D, { variant: "none", children: /* @__PURE__ */ t(k, { size: 16 }) }) }),
|
|
83
|
+
/* @__PURE__ */ t(ee, { children: /* @__PURE__ */ o(te, { children: [
|
|
84
|
+
/* @__PURE__ */ t(ie, { children: "Actions" }),
|
|
85
|
+
/* @__PURE__ */ o(x, { onClick: () => {
|
|
86
|
+
i.instance.deleteNextNode(), T.update();
|
|
87
|
+
}, children: [
|
|
88
|
+
/* @__PURE__ */ t($, { size: 16 }),
|
|
89
|
+
" Delete node"
|
|
90
|
+
] }),
|
|
91
|
+
/* @__PURE__ */ o(x, { disabled: !0, children: [
|
|
92
|
+
/* @__PURE__ */ t(X, { size: 16 }),
|
|
93
|
+
" Copy node"
|
|
94
|
+
] })
|
|
95
|
+
] }) })
|
|
96
|
+
] }),
|
|
97
|
+
/* @__PURE__ */ t(D, { disabled: !0, children: /* @__PURE__ */ t(Y, { size: 16 }) })
|
|
98
|
+
] })
|
|
99
|
+
] }) }),
|
|
100
|
+
/* @__PURE__ */ t(I, { isConnectable: !1, draggable: !1, type: "target", className: "d-flow-viewport-default-card__handle d-flow-viewport-default-card__handle--target", style: {
|
|
101
|
+
...i.isParameter ? {
|
|
102
|
+
right: "2px"
|
|
103
|
+
} : {
|
|
104
|
+
top: "2px"
|
|
105
|
+
}
|
|
106
|
+
}, position: i.isParameter ? u.Right : u.Top }),
|
|
107
|
+
(r?.length ?? 0) > 0 ? /* @__PURE__ */ t("div", { className: "d-flow-viewport-default-card__inspection", children: /* @__PURE__ */ o(s, { style: {
|
|
108
|
+
gap: "0.35rem"
|
|
109
|
+
}, children: [
|
|
110
|
+
(r?.filter((e) => e.type === c.ERROR)?.length ?? 0) > 0 ? /* @__PURE__ */ t(R, { color: "error", children: /* @__PURE__ */ o(s, { align: "center", style: {
|
|
111
|
+
gap: "0.35rem"
|
|
112
|
+
}, children: [
|
|
113
|
+
/* @__PURE__ */ t(q, { size: 12 }),
|
|
114
|
+
r?.filter((e) => e.type === c.ERROR)?.length
|
|
115
|
+
] }) }) : null,
|
|
116
|
+
(r?.filter((e) => e.type === c.WARNING)?.length ?? 0) > 0 ? /* @__PURE__ */ t(R, { color: "warning", children: /* @__PURE__ */ o(s, { align: "center", style: {
|
|
117
|
+
gap: "0.35rem"
|
|
118
|
+
}, children: [
|
|
119
|
+
/* @__PURE__ */ t(J, { size: 12 }),
|
|
120
|
+
r?.filter((e) => e.type === c.WARNING)?.length
|
|
121
|
+
] }) }) : null,
|
|
122
|
+
(r?.filter((e) => e.type === c.GRAMMAR)?.length ?? 0) > 0 ? /* @__PURE__ */ t(R, { children: /* @__PURE__ */ o(s, { align: "center", style: {
|
|
123
|
+
gap: "0.35rem"
|
|
124
|
+
}, children: [
|
|
125
|
+
/* @__PURE__ */ t(K, { size: 12 }),
|
|
126
|
+
r?.filter((e) => e.type === c.GRAMMAR)?.length
|
|
127
|
+
] }) }) : null
|
|
128
|
+
] }) }) : null,
|
|
129
|
+
i.instance.parameters?.some((e) => {
|
|
130
|
+
const a = f?.parameterDefinitions.find((l) => l.id == e.id), n = y.getDataType(a?.dataTypeIdentifier)?.variant === N.Node;
|
|
131
|
+
return e.value instanceof b && !n || !e.value;
|
|
132
|
+
}) ? /* @__PURE__ */ t(C, { children: i.instance.parameters?.map((e, a) => {
|
|
133
|
+
const n = f?.parameterDefinitions.find((p) => p.id == e.id), l = y.getDataType(n?.dataTypeIdentifier)?.variant === N.Node, w = de(n?.dataTypeIdentifier ?? void 0, [], d.data.flowId, i.depth, i.scope, i.index);
|
|
134
|
+
return e.value instanceof b && !l || !e.value ? /* @__PURE__ */ o(s, { pos: "relative", justify: "space-between", align: "center", children: [
|
|
135
|
+
n?.names?.nodes[0]?.content ?? e.id,
|
|
136
|
+
e.value ? null : /* @__PURE__ */ t(le, { onSuggestionSelect: (p) => {
|
|
137
|
+
e.value = p.value, T.update();
|
|
138
|
+
}, suggestions: w, triggerContent: /* @__PURE__ */ t(D, { variant: "none", children: /* @__PURE__ */ t(Q, { size: 12 }) }) }),
|
|
139
|
+
/* @__PURE__ */ t(I, { type: "target", position: u.Right, style: {
|
|
140
|
+
position: "absolute",
|
|
141
|
+
transform: l ? "translate(-50%, -50%)" : "translate(50%, -50%)",
|
|
142
|
+
top: "50%",
|
|
143
|
+
right: l ? "50%" : "0"
|
|
144
|
+
}, id: `param-${e.id}`, isConnectable: !1, hidden: !j(e.id), className: "d-flow-viewport-default-card__handle d-flow-viewport-default-card__handle--target" }, e.id)
|
|
145
|
+
] }, a) : null;
|
|
146
|
+
}) }) : null,
|
|
147
|
+
/* @__PURE__ */ t(I, { isConnectable: !1, type: "source", style: {
|
|
148
|
+
...i.isParameter ? {
|
|
149
|
+
left: "2px"
|
|
150
|
+
} : {
|
|
151
|
+
bottom: "2px"
|
|
152
|
+
}
|
|
153
|
+
}, className: "d-flow-viewport-default-card__handle d-flow-viewport-default-card__handle--source", position: i.isParameter ? u.Left : u.Bottom })
|
|
154
|
+
] });
|
|
155
|
+
});
|
|
156
|
+
export {
|
|
157
|
+
Ee as DFlowFunctionDefaultCard
|
|
158
|
+
};
|