@code0-tech/pictor 0.0.0-mvp.2 → 0.0.0-mvp.20
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/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/alert/Alert.style.css +1 -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/button/Button.style.css +1 -0
- package/dist/assets/components/card/Card.style.css +1 -0
- package/dist/assets/components/command/Command.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/validation/DFlowValidation.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/form/Input.style.css +1 -0
- package/dist/assets/components/menu/Menu.style.css +1 -0
- package/dist/assets/{ScrollArea.css → components/scroll-area/ScrollArea.style.css} +1 -1
- 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/toast/Toast.style.css +1 -0
- package/dist/assets/components/tooltip/Tooltip.style.css +1 -0
- package/dist/assets/{DFlow.css → node_modules/@xyflow/react/dist/style.css} +1 -1
- package/dist/components/alert/Alert.d.ts +7 -0
- package/dist/components/alert/Alert.js +38 -0
- package/dist/components/avatar/Avatar.js +2 -2
- package/dist/components/badge/Badge.js +2 -2
- package/dist/components/breadcrumb/Breadcrumb.js +16 -28
- package/dist/components/button/Button.d.ts +2 -1
- package/dist/components/button/Button.js +23 -20
- package/dist/components/button-group/ButtonGroup.js +6 -5
- package/dist/components/card/Card.d.ts +2 -1
- package/dist/components/card/Card.js +25 -22
- package/dist/components/card/CardSection.d.ts +1 -0
- package/dist/components/card/CardSection.js +18 -12
- package/dist/components/col/Col.js +9 -8
- package/dist/components/command/Command.js +19 -18
- package/dist/components/container/Container.js +12 -11
- package/dist/components/d-flow/DFlow.edges.hook.js +9 -10
- package/dist/components/d-flow/DFlow.js +6 -4
- package/dist/components/d-flow/DFlow.nodes.hook.js +18 -19
- package/dist/components/d-flow/control/DFlowControl.js +50 -46
- package/dist/components/d-flow/data-type/DFlowDataType.service.js +89 -5
- package/dist/components/d-flow/data-type/DFlowDataType.validation.value.js +18 -4
- package/dist/components/d-flow/data-type/index.js +1 -1
- package/dist/components/d-flow/data-type/rules/DFlowDataTypeContainsKeyRule.js +220 -4
- package/dist/components/d-flow/data-type/rules/DFlowDataTypeContainsTypeRule.js +227 -4
- package/dist/components/d-flow/data-type/rules/DFlowDataTypeParentRule.js +1 -1
- package/dist/components/d-flow/data-type/rules/DFlowDataTypeReturnTypeRule.js +241 -5
- package/dist/components/d-flow/data-type/rules/DFlowDataTypeRules.js +8 -6
- package/dist/components/d-flow/edge/DFlowEdge.js +1 -1
- package/dist/components/d-flow/folder/DFlowFolder.js +16 -15
- package/dist/components/d-flow/function/DFlowFunction.return.hook.js +1 -1
- package/dist/components/d-flow/function/DFlowFunction.vaildation.hook.js +19 -20
- package/dist/components/d-flow/function/DFlowFunctionDefaultCard.js +56 -56
- package/dist/components/d-flow/function/DFlowFunctionGroupCard.js +1 -1
- package/dist/components/d-flow/function/DFlowFunctionSuggestionCard.js +1 -1
- package/dist/components/d-flow/function/DFlowFunctionTriggerCard.js +72 -76
- package/dist/components/d-flow/index.js +8 -8
- package/dist/components/d-flow/input/DFlowInputDataType.js +201 -201
- package/dist/components/d-flow/minimap/DFlowMiniMap.js +6 -5
- package/dist/components/d-flow/suggestion/DFlowSuggestion.hook.js +61 -62
- package/dist/components/d-flow/suggestion/DFlowSuggestionMenu.js +1 -1
- package/dist/components/d-flow/suggestion/DFlowSuggestionMenuFooter.js +1 -1
- package/dist/components/d-flow/suggestion/DFlowSuggestionMenuSearchBar.js +1 -1
- package/dist/components/d-flow/suggestion/DFlowSuggestionSearchInput.js +9 -8
- package/dist/components/d-flow/tab/DFlowTabs.js +1 -1
- package/dist/components/d-flow/validation/DFlowValidation.js +15 -14
- package/dist/components/d-fullscreen/DFullScreen.d.ts +1 -2
- package/dist/components/d-fullscreen/DFullScreen.js +24 -18
- package/dist/components/d-layout/DLayout.js +27 -26
- package/dist/components/d-license/DNamespaceLicense.service.d.ts +11 -0
- package/dist/components/d-license/DNamespaceLicense.service.js +12 -0
- package/dist/components/d-license/index.d.ts +2 -0
- package/dist/components/d-license/index.js +6 -0
- package/dist/components/d-member/DNamespaceMember.service.d.ts +13 -0
- package/dist/components/d-member/DNamespaceMember.service.js +15 -0
- package/dist/components/{d-namespace/member → d-member}/DNamespaceMember.view.d.ts +4 -1
- package/dist/components/{d-namespace/member → d-member}/DNamespaceMember.view.js +4 -1
- package/dist/components/d-member/index.d.ts +2 -0
- package/dist/components/d-member/index.js +6 -0
- package/dist/components/d-namespace/DNamespace.service.d.ts +1 -1
- package/dist/components/d-namespace/DNamespace.service.js +5 -4
- package/dist/components/d-namespace/index.d.ts +0 -10
- package/dist/components/d-namespace/index.js +4 -33
- package/dist/components/d-organization/DOrganization.service.d.ts +3 -3
- package/dist/components/d-organization/DOrganization.service.js +5 -4
- package/dist/components/d-organization/DOrganization.view.d.ts +4 -1
- package/dist/components/d-organization/DOrganization.view.js +21 -18
- package/dist/components/d-organization/DOrganizationCard.d.ts +3 -3
- package/dist/components/d-organization/DOrganizationCard.js +13 -60
- package/dist/components/d-organization/DOrganizationList.d.ts +11 -0
- package/dist/components/d-organization/DOrganizationList.js +23 -0
- package/dist/components/d-organization/DOrganizatonContent.d.ts +9 -0
- package/dist/components/d-organization/DOrganizatonContent.js +86 -0
- package/dist/components/d-organization/index.d.ts +1 -0
- package/dist/components/d-organization/index.js +15 -10
- package/dist/components/d-project/DNamespaceProject.service.d.ts +12 -0
- package/dist/components/d-project/DNamespaceProject.service.js +12 -0
- package/dist/components/{d-namespace/project → d-project}/DNamespaceProject.view.d.ts +4 -1
- package/dist/components/{d-namespace/project → d-project}/DNamespaceProject.view.js +13 -10
- package/dist/components/{d-namespace/project → d-project}/DNamespaceProjectCard.d.ts +1 -1
- package/dist/components/d-project/DNamespaceProjectCard.js +15 -0
- package/dist/components/d-project/DNamespaceProjectContent.d.ts +8 -0
- package/dist/components/d-project/DNamespaceProjectContent.js +70 -0
- package/dist/components/d-project/DNamespaceProjectList.d.ts +11 -0
- package/dist/components/d-project/DNamespaceProjectList.js +25 -0
- package/dist/components/{d-namespace/project → d-project}/DNamespaceProjectMenu.d.ts +1 -1
- package/dist/components/{d-namespace/project → d-project}/DNamespaceProjectMenu.js +3 -3
- package/dist/components/d-project/index.d.ts +5 -0
- package/dist/components/d-project/index.js +24 -0
- package/dist/components/d-resizable/DResizable.js +17 -16
- package/dist/components/d-role/DNamespaceRole.service.d.ts +13 -0
- package/dist/components/d-role/DNamespaceRole.service.js +12 -0
- package/dist/components/d-role/index.d.ts +2 -0
- package/dist/components/d-role/index.js +6 -0
- package/dist/components/d-runtime/DRuntime.service.d.ts +5 -2
- package/dist/components/d-runtime/DRuntime.service.js +0 -2
- package/dist/components/d-runtime/DRuntime.view.d.ts +4 -1
- package/dist/components/d-runtime/DRuntime.view.js +6 -3
- package/dist/components/d-runtime/DRuntimeCard.d.ts +7 -0
- package/dist/components/d-runtime/DRuntimeCard.js +17 -0
- package/dist/components/d-runtime/DRuntimeContent.d.ts +7 -0
- package/dist/components/d-runtime/DRuntimeContent.js +40 -0
- package/dist/components/d-runtime/DRuntimeList.d.ts +10 -0
- package/dist/components/d-runtime/DRuntimeList.js +22 -0
- package/dist/components/d-runtime/index.d.ts +2 -0
- package/dist/components/d-runtime/index.js +6 -2
- package/dist/components/d-user/DUser.service.d.ts +1 -3
- package/dist/components/d-user/DUser.service.js +3 -9
- package/dist/components/d-user/DUser.session.hook.d.ts +3 -0
- package/dist/components/d-user/DUser.session.hook.js +16 -0
- package/dist/components/d-user/DUser.view.d.ts +4 -1
- package/dist/components/d-user/DUser.view.js +13 -10
- package/dist/components/d-user/DUserCard.d.ts +7 -0
- package/dist/components/d-user/DUserCard.js +15 -0
- package/dist/components/d-user/DUserContent.d.ts +7 -0
- package/dist/components/d-user/DUserContent.js +84 -0
- package/dist/components/d-user/DUserList.d.ts +10 -0
- package/dist/components/d-user/DUserList.js +22 -0
- package/dist/components/d-user/DUserMenu.js +19 -19
- package/dist/components/d-user/index.d.ts +3 -0
- package/dist/components/d-user/index.js +15 -8
- package/dist/components/dialog/Dialog.js +18 -17
- package/dist/components/file-tabs/FileTabs.js +41 -40
- package/dist/components/flex/Flex.js +2 -2
- package/dist/components/form/CheckboxInput.js +2 -2
- package/dist/components/form/Input.js +1 -1
- package/dist/components/form/InputDescription.js +1 -1
- package/dist/components/form/InputLabel.js +1 -1
- package/dist/components/form/InputMessage.js +1 -1
- package/dist/components/form/InputSuggestion.js +1 -1
- package/dist/components/form/PinInput.js +2 -2
- package/dist/components/form/RadioGroup.js +2 -2
- package/dist/components/form/RadioInput.js +2 -2
- package/dist/components/form/useForm.d.ts +2 -1
- package/dist/components/form/useForm.js +27 -18
- package/dist/components/menu/Menu.js +2 -2
- package/dist/components/quote/Quote.js +32 -36
- package/dist/components/row/Row.js +10 -9
- package/dist/components/scroll-area/ScrollArea.js +18 -17
- package/dist/components/segmented-control/SegmentedControl.js +12 -11
- 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.js +2 -2
- package/dist/components/toast/Toast.d.ts +13 -0
- package/dist/components/toast/Toast.js +62 -0
- package/dist/components/tooltip/Tooltip.js +10 -9
- package/dist/index.d.ts +8 -0
- package/dist/index.js +238 -210
- 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 +2 -2
- package/dist/utils/contextStore.js +1 -1
- package/dist/utils/generics.js +88 -89
- package/dist/utils/reactiveArrayService.d.ts +3 -3
- package/dist/utils/reactiveArrayService.js +52 -42
- package/dist/utils/types.d.ts +2 -2
- package/package.json +31 -30
- package/dist/DFlowDataType.service-Dz8pQUeO.js +0 -793
- package/dist/assets/Avatar.css +0 -1
- package/dist/assets/Badge.css +0 -1
- package/dist/assets/Button.css +0 -1
- package/dist/assets/Card.css +0 -1
- package/dist/assets/Command.css +0 -1
- package/dist/assets/DFlowFolder.css +0 -1
- package/dist/assets/DFlowFunctionDefaultCard.css +0 -1
- package/dist/assets/DFlowInputDataType.css +0 -1
- package/dist/assets/DFlowMiniMap.css +0 -1
- package/dist/assets/DFlowValidation.css +0 -1
- package/dist/assets/DLayout.css +0 -1
- package/dist/assets/DResizable.css +0 -1
- package/dist/assets/Dialog.css +0 -1
- package/dist/assets/FileTabs.css +0 -1
- package/dist/assets/Input.css +0 -1
- package/dist/assets/Menu.css +0 -1
- package/dist/assets/SegmentedControl.css +0 -1
- package/dist/assets/Text.css +0 -1
- package/dist/assets/Tooltip.css +0 -1
- package/dist/compiler-runtime-BNHg76kC.js +0 -36
- package/dist/components/d-namespace/license/DNamespaceLicense.service.d.ts +0 -8
- package/dist/components/d-namespace/license/DNamespaceLicense.service.js +0 -11
- package/dist/components/d-namespace/member/DNamespaceMember.service.d.ts +0 -9
- package/dist/components/d-namespace/member/DNamespaceMember.service.js +0 -11
- package/dist/components/d-namespace/project/DNamespaceProject.service.d.ts +0 -9
- package/dist/components/d-namespace/project/DNamespaceProject.service.js +0 -11
- package/dist/components/d-namespace/project/DNamespaceProjectCard.js +0 -57
- package/dist/components/d-namespace/role/DNamespaceRole.service.d.ts +0 -10
- package/dist/components/d-namespace/role/DNamespaceRole.service.js +0 -11
- /package/dist/assets/{Breadcrumb.css → components/breadcrumb/Breadcrumb.style.css} +0 -0
- /package/dist/assets/{ButtonGroup.css → components/button-group/ButtonGroup.style.css} +0 -0
- /package/dist/assets/{Col.css → components/col/Col.style.css} +0 -0
- /package/dist/assets/{Container.css → components/container/Container.style.css} +0 -0
- /package/dist/assets/{DFlowSuggestionSearchInput.css → components/d-flow/suggestion/DFlowSuggestionSearchInput.style.css} +0 -0
- /package/dist/assets/{DFullScreen.css → components/d-fullscreen/DFullScreen.style.css} +0 -0
- /package/dist/assets/{Flex.css → components/flex/Flex.style.css} +0 -0
- /package/dist/assets/{Quote.css → components/quote/Quote.style.css} +0 -0
- /package/dist/assets/{Row.css → components/row/Row.style.css} +0 -0
- /package/dist/components/{d-namespace/license → d-license}/DNamespaceLicense.view.d.ts +0 -0
- /package/dist/components/{d-namespace/license → d-license}/DNamespaceLicense.view.js +0 -0
- /package/dist/components/{d-namespace/role → d-role}/DNamespaceRole.view.d.ts +0 -0
- /package/dist/components/{d-namespace/role → d-role}/DNamespaceRole.view.js +0 -0
package/dist/utils/generics.js
CHANGED
|
@@ -1,34 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
const O = "GENERIC", y = (e) => typeof e == "object" && e !== null && !Array.isArray(e), l = (e) => y(e) ? "genericKey" in e || "genericType" in e || "dataType" in e : !1, K = (e) => y(e) && "target" in e && Array.isArray(e.sourceDataTypeIdentifiers), z = (e) => y(e) && "variant" in e && "identifier" in e, G = (e) => y(e) && "variant" in e && "config" in e, S = (e) => {
|
|
1
|
+
const C = "GENERIC", y = (e) => typeof e == "object" && e !== null && !Array.isArray(e), T = (e) => y(e) ? "genericKey" in e || "genericType" in e || "dataType" in e : !1, A = (e) => y(e) && "target" in e && Array.isArray(e.sourceDataTypeIdentifiers), E = (e) => y(e) && "variant" in e && "identifier" in e, b = (e) => y(e) && "variant" in e && "config" in e, O = (e) => {
|
|
3
2
|
if (e)
|
|
4
3
|
return typeof e == "string" ? e : e?.dataType?.identifier ?? e?.genericType?.dataType?.identifier ?? void 0;
|
|
5
|
-
},
|
|
4
|
+
}, j = (e, n) => {
|
|
6
5
|
if (e)
|
|
7
6
|
return typeof e == "string" ? n && n.has(e) ? e : void 0 : e.genericKey ?? void 0;
|
|
8
|
-
},
|
|
7
|
+
}, _ = (e) => !e || typeof e == "string" ? [] : e.genericType?.genericMappers ?? [], G = (e, n) => ({
|
|
9
8
|
...e,
|
|
10
9
|
sourceDataTypeIdentifiers: n
|
|
11
|
-
}),
|
|
10
|
+
}), R = (e) => {
|
|
12
11
|
const n = e.genericCombinationStrategies ?? [];
|
|
13
12
|
return new Set(n.map((i) => i.type));
|
|
14
|
-
},
|
|
13
|
+
}, m = (e) => {
|
|
15
14
|
if (Array.isArray(e))
|
|
16
|
-
return e.map(
|
|
15
|
+
return e.map(m);
|
|
17
16
|
if (y(e)) {
|
|
18
17
|
const n = {};
|
|
19
18
|
return Object.entries(e).forEach(([i, t]) => {
|
|
20
|
-
i === "__typename" || i === "id" || i === "createdAt" || i === "updatedAt" || (n[i] =
|
|
19
|
+
i === "__typename" || i === "id" || i === "createdAt" || i === "updatedAt" || (n[i] = m(t));
|
|
21
20
|
}), n;
|
|
22
21
|
}
|
|
23
22
|
return e;
|
|
24
|
-
},
|
|
23
|
+
}, S = (e, n) => {
|
|
25
24
|
if (!n) return !e;
|
|
26
25
|
if (typeof n == "string")
|
|
27
|
-
return n ===
|
|
26
|
+
return n === C ? !0 : O(e) === n;
|
|
28
27
|
if (n.genericKey) return !0;
|
|
29
|
-
const t =
|
|
28
|
+
const t = O(n), a = O(e);
|
|
30
29
|
return !!t && t === a;
|
|
31
|
-
},
|
|
30
|
+
}, z = (e, n) => {
|
|
32
31
|
switch (e.__typename) {
|
|
33
32
|
case "DataTypeRulesContainsKeyConfig":
|
|
34
33
|
case "DataTypeRulesContainsTypeConfig":
|
|
@@ -36,13 +35,13 @@ const O = "GENERIC", y = (e) => typeof e == "object" && e !== null && !Array.isA
|
|
|
36
35
|
const i = e.dataTypeIdentifier;
|
|
37
36
|
return i ? {
|
|
38
37
|
...e,
|
|
39
|
-
dataTypeIdentifier:
|
|
38
|
+
dataTypeIdentifier: M(i, n)
|
|
40
39
|
} : e;
|
|
41
40
|
}
|
|
42
41
|
case "DataTypeRulesInputTypesConfig": {
|
|
43
42
|
const i = e, t = i.inputTypes?.map((a) => ({
|
|
44
43
|
...a,
|
|
45
|
-
dataTypeIdentifier:
|
|
44
|
+
dataTypeIdentifier: M(a.dataTypeIdentifier, n)
|
|
46
45
|
}));
|
|
47
46
|
return {
|
|
48
47
|
...i,
|
|
@@ -52,41 +51,41 @@ const O = "GENERIC", y = (e) => typeof e == "object" && e !== null && !Array.isA
|
|
|
52
51
|
default:
|
|
53
52
|
return e;
|
|
54
53
|
}
|
|
55
|
-
},
|
|
54
|
+
}, w = (e, n, i) => {
|
|
56
55
|
const t = {}, a = new Set(i), c = (s, r) => {
|
|
57
56
|
if (!s || !r) return;
|
|
58
|
-
const f =
|
|
57
|
+
const f = j(s, a);
|
|
59
58
|
if (f && a.has(f)) {
|
|
60
|
-
|
|
59
|
+
T(r) && (t[f] = r);
|
|
61
60
|
return;
|
|
62
61
|
}
|
|
63
|
-
const o =
|
|
62
|
+
const o = _(s);
|
|
64
63
|
if (o.length === 0) return;
|
|
65
|
-
const u =
|
|
64
|
+
const u = _(r);
|
|
66
65
|
for (const p of o) {
|
|
67
|
-
const
|
|
68
|
-
if (!
|
|
69
|
-
const d = (p.sourceDataTypeIdentifiers ?? []).map((g) =>
|
|
70
|
-
if ((I.has(
|
|
66
|
+
const l = u.find((g) => g.target === p.target);
|
|
67
|
+
if (!l) continue;
|
|
68
|
+
const d = (p.sourceDataTypeIdentifiers ?? []).map((g) => j(g, a)).filter((g) => !!g && a.has(g)), I = R(p), D = l.sourceDataTypeIdentifiers ?? [];
|
|
69
|
+
if ((I.has("AND") || I.has("OR")) && D.length === 1 && d.length === (p.sourceDataTypeIdentifiers?.length ?? 0))
|
|
71
70
|
for (const g of d)
|
|
72
|
-
t[g] =
|
|
71
|
+
t[g] = D[0];
|
|
73
72
|
else {
|
|
74
|
-
const g = Math.min(p.sourceDataTypeIdentifiers?.length ?? 0,
|
|
75
|
-
for (let
|
|
76
|
-
c(p.sourceDataTypeIdentifiers[
|
|
73
|
+
const g = Math.min(p.sourceDataTypeIdentifiers?.length ?? 0, D.length);
|
|
74
|
+
for (let K = 0; K < g; K++)
|
|
75
|
+
c(p.sourceDataTypeIdentifiers[K], D[K]);
|
|
77
76
|
}
|
|
78
77
|
}
|
|
79
78
|
};
|
|
80
79
|
return c(e, n), t;
|
|
81
|
-
},
|
|
82
|
-
if (!
|
|
80
|
+
}, M = (e, n) => {
|
|
81
|
+
if (!T(e)) return e;
|
|
83
82
|
const {
|
|
84
83
|
genericKey: i,
|
|
85
84
|
genericType: t
|
|
86
85
|
} = e;
|
|
87
86
|
if (i && n.has(i)) {
|
|
88
87
|
const c = n.get(i);
|
|
89
|
-
return c &&
|
|
88
|
+
return c && T(c) ? c : e;
|
|
90
89
|
}
|
|
91
90
|
if (!t) return e;
|
|
92
91
|
const a = (t.genericMappers ?? []).map((c) => {
|
|
@@ -96,10 +95,10 @@ const O = "GENERIC", y = (e) => typeof e == "object" && e !== null && !Array.isA
|
|
|
96
95
|
const f = r.genericKey;
|
|
97
96
|
if (f && n.has(f)) {
|
|
98
97
|
const o = n.get(f);
|
|
99
|
-
o &&
|
|
100
|
-
} else
|
|
98
|
+
o && A(o) ? s.push(...o.sourceDataTypeIdentifiers) : o && T(o) ? s.push(o) : s.push(r);
|
|
99
|
+
} else T(r) ? s.push(M(r, n)) : s.push(r);
|
|
101
100
|
}
|
|
102
|
-
return
|
|
101
|
+
return G(c, s);
|
|
103
102
|
});
|
|
104
103
|
return {
|
|
105
104
|
...e,
|
|
@@ -108,30 +107,30 @@ const O = "GENERIC", y = (e) => typeof e == "object" && e !== null && !Array.isA
|
|
|
108
107
|
genericMappers: a
|
|
109
108
|
}
|
|
110
109
|
};
|
|
111
|
-
},
|
|
110
|
+
}, J = (e, n, i) => {
|
|
112
111
|
const t = {}, a = new Set(i), c = (s, r, f) => {
|
|
113
112
|
if (!(!s || !r || a.size === 0)) {
|
|
114
|
-
if (
|
|
113
|
+
if (T(s)) {
|
|
115
114
|
const o = s.genericKey;
|
|
116
|
-
if (o && a.has(o) && (f ? t[o] = f : (
|
|
115
|
+
if (o && a.has(o) && (f ? t[o] = f : (A(r) || T(r)) && (t[o] = r), a.delete(o), a.size === 0))
|
|
117
116
|
return;
|
|
118
117
|
}
|
|
119
|
-
if (
|
|
118
|
+
if (A(s) && A(r)) {
|
|
120
119
|
const o = Math.min(s.sourceDataTypeIdentifiers?.length, r.sourceDataTypeIdentifiers?.length);
|
|
121
120
|
for (let u = 0; u < o; u++)
|
|
122
121
|
if (c(s.sourceDataTypeIdentifiers[u], r.sourceDataTypeIdentifiers[u], r), a.size === 0) return;
|
|
123
122
|
return;
|
|
124
123
|
}
|
|
125
|
-
if (
|
|
124
|
+
if (E(s) && E(r)) {
|
|
126
125
|
const o = s.rules?.nodes ?? [], u = r.rules?.nodes ?? [], p = Math.min(o.length, u.length);
|
|
127
|
-
for (let
|
|
128
|
-
const d = o[
|
|
126
|
+
for (let l = 0; l < p; l++) {
|
|
127
|
+
const d = o[l], I = u[l];
|
|
129
128
|
if (!(!d || !I) && (c(d, I), a.size === 0))
|
|
130
129
|
return;
|
|
131
130
|
}
|
|
132
131
|
return;
|
|
133
132
|
}
|
|
134
|
-
if (
|
|
133
|
+
if (b(s) && b(r)) {
|
|
135
134
|
c(s.config, r.config);
|
|
136
135
|
return;
|
|
137
136
|
}
|
|
@@ -149,82 +148,82 @@ const O = "GENERIC", y = (e) => typeof e == "object" && e !== null && !Array.isA
|
|
|
149
148
|
}
|
|
150
149
|
};
|
|
151
150
|
return c(e, n), t;
|
|
152
|
-
},
|
|
151
|
+
}, Y = (e, n) => {
|
|
153
152
|
const i = e.rules ? {
|
|
154
153
|
...e.rules,
|
|
155
154
|
nodes: e.rules.nodes?.map((t) => t && {
|
|
156
155
|
...t,
|
|
157
|
-
config:
|
|
156
|
+
config: z(t.config, n)
|
|
158
157
|
})
|
|
159
158
|
} : void 0;
|
|
160
159
|
return {
|
|
161
160
|
...e,
|
|
162
161
|
rules: i
|
|
163
162
|
};
|
|
164
|
-
},
|
|
163
|
+
}, k = (e, n, i, t) => {
|
|
165
164
|
const a = /* @__PURE__ */ new Map(), c = e.genericKeys ?? [];
|
|
166
165
|
if (!e.parameterDefinitions || c.length <= 0) return a;
|
|
167
166
|
const s = new Set(c);
|
|
168
167
|
return e.parameterDefinitions.forEach((r, f) => {
|
|
169
168
|
const o = r.dataTypeIdentifier, u = n[f], p = i.getTypeFromValue(u, t);
|
|
170
169
|
if (!o || !p) return;
|
|
171
|
-
const
|
|
172
|
-
for (const [d, I] of Object.entries(
|
|
170
|
+
const l = w(o, p, c);
|
|
171
|
+
for (const [d, I] of Object.entries(l))
|
|
173
172
|
s.has(d) && (a.has(d) || a.set(d, I));
|
|
174
173
|
}), a;
|
|
175
174
|
};
|
|
176
|
-
function
|
|
175
|
+
function L(e, n) {
|
|
177
176
|
if (e.variant !== n.variant) return !1;
|
|
178
177
|
const i = n.rules?.nodes ?? [];
|
|
179
178
|
if (i.length === 0) return !0;
|
|
180
179
|
const t = e.rules?.nodes ?? [];
|
|
181
180
|
for (const a of i) {
|
|
182
181
|
if (!a) continue;
|
|
183
|
-
if (!t.some((s) => s ?
|
|
182
|
+
if (!t.some((s) => s ? x(s, a) : !1)) return !1;
|
|
184
183
|
}
|
|
185
184
|
return !0;
|
|
186
185
|
}
|
|
187
|
-
function
|
|
186
|
+
function x(e, n) {
|
|
188
187
|
if (e.variant !== n.variant) return !1;
|
|
189
188
|
switch (n.variant) {
|
|
190
|
-
case
|
|
191
|
-
case
|
|
192
|
-
return
|
|
193
|
-
case
|
|
189
|
+
case "CONTAINS_TYPE":
|
|
190
|
+
case "RETURN_TYPE":
|
|
191
|
+
return S(e.config.dataTypeIdentifier, n.config.dataTypeIdentifier);
|
|
192
|
+
case "CONTAINS_KEY": {
|
|
194
193
|
const i = e.config, t = n.config;
|
|
195
|
-
return i.key !== t.key ? !1 :
|
|
194
|
+
return i.key !== t.key ? !1 : S(i.dataTypeIdentifier, t.dataTypeIdentifier);
|
|
196
195
|
}
|
|
197
|
-
case
|
|
196
|
+
case "INPUT_TYPE": {
|
|
198
197
|
const i = e.config, a = n.config.inputTypes ?? [], c = i.inputTypes ?? [];
|
|
199
|
-
return a.every((s) => c.some((r) =>
|
|
198
|
+
return a.every((s) => c.some((r) => S(r.dataTypeIdentifier, s.dataTypeIdentifier)));
|
|
200
199
|
}
|
|
201
|
-
case
|
|
200
|
+
case "ITEM_OF_COLLECTION": {
|
|
202
201
|
const i = e.config.items ?? [], t = n.config.items ?? [];
|
|
203
202
|
return i.length !== t.length ? !1 : i.every((a, c) => a === t[c]);
|
|
204
203
|
}
|
|
205
|
-
case
|
|
204
|
+
case "NUMBER_RANGE": {
|
|
206
205
|
const i = e.config, t = n.config;
|
|
207
206
|
return i.from === t.from && i.to === t.to && i.steps === t.steps;
|
|
208
207
|
}
|
|
209
|
-
case
|
|
208
|
+
case "REGEX": {
|
|
210
209
|
const i = e.config.pattern, t = n.config.pattern;
|
|
211
210
|
return i === t;
|
|
212
211
|
}
|
|
213
212
|
default:
|
|
214
|
-
return JSON.stringify(
|
|
213
|
+
return JSON.stringify(m(e.config)) === JSON.stringify(m(n.config));
|
|
215
214
|
}
|
|
216
215
|
}
|
|
217
|
-
function
|
|
218
|
-
const i = (s) => !!(s ===
|
|
216
|
+
function V(e, n) {
|
|
217
|
+
const i = (s) => !!(s === C || T(s) && s.genericKey), t = (s, r) => i(s) || i(r) ? !0 : s == null || r == null ? s === r : Array.isArray(r) ? !Array.isArray(s) || s.length !== r.length ? !1 : s.every((f, o) => t(f, r[o])) : y(r) ? y(s) ? Object.keys(r).every((o) => t(s[o], r[o])) : !1 : s === r, a = m(e), c = m(n);
|
|
219
218
|
return t(a, c);
|
|
220
219
|
}
|
|
221
|
-
const
|
|
220
|
+
const P = (e, n) => {
|
|
222
221
|
if (typeof e == "string") {
|
|
223
222
|
const t = n.getDataType(e);
|
|
224
223
|
if (!t) return e;
|
|
225
224
|
const a = t.genericKeys ?? [];
|
|
226
|
-
if (t.variant ===
|
|
227
|
-
const s = t.rules?.nodes?.find((r) => r?.variant ===
|
|
225
|
+
if (t.variant === "ARRAY" && a.length > 0) {
|
|
226
|
+
const s = t.rules?.nodes?.find((r) => r?.variant === "CONTAINS_TYPE")?.config?.dataTypeIdentifier;
|
|
228
227
|
if (s) {
|
|
229
228
|
const [r] = a;
|
|
230
229
|
return r ? {
|
|
@@ -233,7 +232,7 @@ const E = (e, n) => {
|
|
|
233
232
|
dataType: t.json,
|
|
234
233
|
genericMappers: [{
|
|
235
234
|
target: r,
|
|
236
|
-
sourceDataTypeIdentifiers: [
|
|
235
|
+
sourceDataTypeIdentifiers: [P(s, n)]
|
|
237
236
|
}]
|
|
238
237
|
}
|
|
239
238
|
} : e;
|
|
@@ -241,10 +240,10 @@ const E = (e, n) => {
|
|
|
241
240
|
}
|
|
242
241
|
return e;
|
|
243
242
|
}
|
|
244
|
-
if (!
|
|
243
|
+
if (!T(e) || !e.genericType) return e;
|
|
245
244
|
const i = e.genericType.genericMappers?.map((t) => ({
|
|
246
245
|
...t,
|
|
247
|
-
sourceDataTypeIdentifiers: t?.sourceDataTypeIdentifiers?.map((a) =>
|
|
246
|
+
sourceDataTypeIdentifiers: t?.sourceDataTypeIdentifiers?.map((a) => P(a, n))
|
|
248
247
|
})) ?? [];
|
|
249
248
|
return {
|
|
250
249
|
...e,
|
|
@@ -253,59 +252,59 @@ const E = (e, n) => {
|
|
|
253
252
|
genericMappers: i
|
|
254
253
|
}
|
|
255
254
|
};
|
|
256
|
-
},
|
|
255
|
+
}, h = (e) => {
|
|
257
256
|
if (Array.isArray(e)) {
|
|
258
|
-
const n = e.map(
|
|
257
|
+
const n = e.map(h);
|
|
259
258
|
return n.length <= 1 ? n : n.every(y) ? [...n].sort((a, c) => JSON.stringify(a).localeCompare(JSON.stringify(c))) : n.every((a) => !Array.isArray(a) && !y(a)) ? [...n].sort((a, c) => JSON.stringify(a).localeCompare(JSON.stringify(c))) : n;
|
|
260
259
|
}
|
|
261
260
|
if (y(e)) {
|
|
262
261
|
const n = e;
|
|
263
|
-
return Object.keys(n).sort().reduce((i, t) => (i[t] =
|
|
262
|
+
return Object.keys(n).sort().reduce((i, t) => (i[t] = h(n[t]), i), {});
|
|
264
263
|
}
|
|
265
264
|
return e;
|
|
266
|
-
},
|
|
265
|
+
}, F = (e, n = []) => {
|
|
267
266
|
const i = new Set(n), t = (r) => r ? i.size === 0 ? !0 : i.has(r) : !1, a = (r) => {
|
|
268
|
-
const o = t(r.target) ?
|
|
269
|
-
return
|
|
267
|
+
const o = t(r.target) ? C : r.target, u = (r.sourceDataTypeIdentifiers ?? []).map((p) => s(p));
|
|
268
|
+
return h({
|
|
270
269
|
...r,
|
|
271
270
|
target: o,
|
|
272
271
|
sourceDataTypeIdentifiers: u
|
|
273
272
|
});
|
|
274
273
|
}, c = (r) => {
|
|
275
|
-
const o = t(r.genericKey) ?
|
|
274
|
+
const o = t(r.genericKey) ? C : r.genericKey, u = {
|
|
276
275
|
...r,
|
|
277
276
|
genericKey: o,
|
|
278
277
|
dataType: r.dataType ? s(r.dataType) : r.dataType,
|
|
279
278
|
genericType: r.genericType ? s(r.genericType) : r.genericType
|
|
280
279
|
};
|
|
281
|
-
return
|
|
280
|
+
return h(u);
|
|
282
281
|
};
|
|
283
282
|
function s(r) {
|
|
284
283
|
if (r == null) return r;
|
|
285
284
|
if (Array.isArray(r)) {
|
|
286
285
|
const f = r.map((o) => s(o));
|
|
287
|
-
return
|
|
286
|
+
return h(f);
|
|
288
287
|
}
|
|
289
|
-
if (
|
|
288
|
+
if (T(r))
|
|
290
289
|
return c(r);
|
|
291
|
-
if (
|
|
290
|
+
if (A(r))
|
|
292
291
|
return a(r);
|
|
293
292
|
if (y(r)) {
|
|
294
293
|
const f = Object.entries(r).reduce((o, [u, p]) => (o[u] = s(p), o), {});
|
|
295
|
-
return
|
|
294
|
+
return h(f);
|
|
296
295
|
}
|
|
297
296
|
return r;
|
|
298
297
|
}
|
|
299
298
|
return s(e);
|
|
300
299
|
};
|
|
301
300
|
export {
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
301
|
+
L as isMatchingDataTypeObject,
|
|
302
|
+
V as isMatchingType,
|
|
303
|
+
Y as replaceGenericKeysInDataTypeObject,
|
|
304
|
+
M as replaceGenericKeysInType,
|
|
305
|
+
F as replaceGenericsAndSortType,
|
|
306
|
+
J as resolveAllGenericKeysInDataTypeObject,
|
|
307
|
+
w as resolveGenericKeyMappings,
|
|
308
|
+
k as resolveGenericKeys,
|
|
309
|
+
P as resolveType
|
|
311
310
|
};
|
|
@@ -4,7 +4,7 @@ export type ReactiveArrayStore<T> = {
|
|
|
4
4
|
getState: () => T[];
|
|
5
5
|
setState: React.Dispatch<React.SetStateAction<T[]>>;
|
|
6
6
|
};
|
|
7
|
-
export declare class ReactiveArrayService<T
|
|
7
|
+
export declare class ReactiveArrayService<T, D = Record<string, any>> implements ArrayService<T, D> {
|
|
8
8
|
protected readonly access: ReactiveArrayStore<T>;
|
|
9
9
|
constructor(access: ReactiveArrayStore<T>);
|
|
10
10
|
delete(index: number): void;
|
|
@@ -12,11 +12,11 @@ export declare class ReactiveArrayService<T> implements ArrayService<T> {
|
|
|
12
12
|
set(index: number, value: T): void;
|
|
13
13
|
has(index: number): boolean;
|
|
14
14
|
get(index: number): T;
|
|
15
|
-
values(): T[];
|
|
15
|
+
values(_dependencies?: D): T[];
|
|
16
16
|
update(): void;
|
|
17
17
|
clear(): void;
|
|
18
18
|
}
|
|
19
19
|
type ArrayServiceCtor<K, S extends ArrayService<K>> = new (access: ReactiveArrayStore<K>) => S;
|
|
20
20
|
type InitialArg<K, S extends ArrayService<K>> = K[] | ((svc: S) => K[]);
|
|
21
|
-
export declare function useReactiveArrayService<K, S extends ArrayService<K>>(Ctor: ArrayServiceCtor<K, S
|
|
21
|
+
export declare function useReactiveArrayService<K, S extends ArrayService<K>>(Ctor: ArrayServiceCtor<K, S> | ((store: ReactiveArrayStore<K>) => S), initial?: InitialArg<K, S>): [K[], S];
|
|
22
22
|
export {};
|
|
@@ -1,81 +1,91 @@
|
|
|
1
|
-
import
|
|
2
|
-
function
|
|
3
|
-
return (e =
|
|
1
|
+
import n, { startTransition as a } from "react";
|
|
2
|
+
function v(t, e, r) {
|
|
3
|
+
return (e = y(e)) in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
|
|
4
4
|
}
|
|
5
|
-
function
|
|
6
|
-
var e =
|
|
5
|
+
function y(t) {
|
|
6
|
+
var e = h(t, "string");
|
|
7
7
|
return typeof e == "symbol" ? e : e + "";
|
|
8
8
|
}
|
|
9
|
-
function
|
|
10
|
-
if (typeof
|
|
11
|
-
var
|
|
12
|
-
if (
|
|
13
|
-
var s =
|
|
9
|
+
function h(t, e) {
|
|
10
|
+
if (typeof t != "object" || !t) return t;
|
|
11
|
+
var r = t[Symbol.toPrimitive];
|
|
12
|
+
if (r !== void 0) {
|
|
13
|
+
var s = r.call(t, e);
|
|
14
14
|
if (typeof s != "object") return s;
|
|
15
15
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
16
16
|
}
|
|
17
|
-
return (e === "string" ? String : Number)(
|
|
17
|
+
return (e === "string" ? String : Number)(t);
|
|
18
18
|
}
|
|
19
|
-
class
|
|
19
|
+
class b {
|
|
20
20
|
constructor(e) {
|
|
21
|
-
|
|
21
|
+
v(this, "access", void 0), this.access = e;
|
|
22
22
|
}
|
|
23
23
|
delete(e) {
|
|
24
|
-
|
|
25
|
-
this.access.setState((
|
|
24
|
+
a(() => {
|
|
25
|
+
this.access.setState((r) => r.filter((s, c) => c !== e));
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
28
|
add(e) {
|
|
29
|
-
|
|
30
|
-
this.access.setState((
|
|
29
|
+
a(() => {
|
|
30
|
+
this.access.setState((r) => [...r, e]);
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
|
-
set(e,
|
|
34
|
-
|
|
33
|
+
set(e, r) {
|
|
34
|
+
a(() => {
|
|
35
35
|
this.access.setState((s) => {
|
|
36
36
|
const c = s.slice();
|
|
37
|
-
return c[e] =
|
|
37
|
+
return c[e] = r, c;
|
|
38
38
|
});
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
41
|
has(e) {
|
|
42
|
-
const
|
|
43
|
-
return e >= 0 && e <
|
|
42
|
+
const r = this.access.getState();
|
|
43
|
+
return e >= 0 && e < r.length;
|
|
44
44
|
}
|
|
45
45
|
get(e) {
|
|
46
46
|
return this.access.getState()[e];
|
|
47
47
|
}
|
|
48
|
-
values() {
|
|
48
|
+
values(e) {
|
|
49
49
|
return this.access.getState();
|
|
50
50
|
}
|
|
51
51
|
update() {
|
|
52
|
-
|
|
52
|
+
a(() => {
|
|
53
53
|
this.access.setState((e) => e.slice());
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
56
|
clear() {
|
|
57
|
-
|
|
57
|
+
a(() => {
|
|
58
58
|
this.access.setState(() => []);
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
function
|
|
63
|
-
const [
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
62
|
+
function d(t, e = []) {
|
|
63
|
+
const [r, s] = n.useState(Array.isArray(e) ? e : []), c = n.useRef(r);
|
|
64
|
+
n.useEffect(() => {
|
|
65
|
+
c.current = r;
|
|
66
|
+
}, [r]);
|
|
67
|
+
const u = n.useCallback(() => c.current, []), o = n.useMemo(() => {
|
|
68
|
+
const i = {
|
|
69
|
+
getState: u,
|
|
70
|
+
setState: s
|
|
71
|
+
}, f = {
|
|
72
|
+
construct() {
|
|
73
|
+
return f;
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
return ((l) => {
|
|
77
|
+
try {
|
|
78
|
+
return !!new new Proxy(l, f)();
|
|
79
|
+
} catch {
|
|
80
|
+
return !1;
|
|
81
|
+
}
|
|
82
|
+
})(t) ? new t(i) : t(i);
|
|
83
|
+
}, [t, u, s]);
|
|
84
|
+
return n.useEffect(() => {
|
|
85
|
+
typeof e == "function" && s(e(o));
|
|
86
|
+
}, [o, e]), [r, o];
|
|
77
87
|
}
|
|
78
88
|
export {
|
|
79
|
-
|
|
80
|
-
|
|
89
|
+
b as ReactiveArrayService,
|
|
90
|
+
d as useReactiveArrayService
|
|
81
91
|
};
|
package/dist/utils/types.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { default as React, HTMLProps } from 'react';
|
|
2
2
|
export type Color = "primary" | "secondary" | "info" | "success" | "warning" | "error";
|
|
3
3
|
export declare const Colors: Color[];
|
|
4
|
-
export type Code0Sizes = "xs" | "sm" | "md" | "lg" | "xl";
|
|
5
|
-
export type Code0FontSizes = "0.
|
|
4
|
+
export type Code0Sizes = "xxs" | "xs" | "sm" | "md" | "lg" | "xl";
|
|
5
|
+
export type Code0FontSizes = "0.35" | "0.7" | "0.8" | "1" | "1.2" | "1.3";
|
|
6
6
|
export type StyleProp<Value> = Value;
|
|
7
7
|
export interface Code0ComponentProps {
|
|
8
8
|
m?: StyleProp<number | `${number}`>;
|