@code0-tech/pictor 0.0.0-mvp.rc.1
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-B7xAjgiJ.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-Cu50tn6L.js +54 -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 +209 -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 +125 -0
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
import { DataTypeVariant as P, DataTypeRulesVariant as h, GenericCombinationStrategyType as j } from "@code0-tech/sagittarius-graphql-types";
|
|
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) => {
|
|
3
|
+
if (e)
|
|
4
|
+
return typeof e == "string" ? e : e?.dataType?.identifier ?? e?.genericType?.dataType?.identifier ?? void 0;
|
|
5
|
+
}, w = (e, n) => {
|
|
6
|
+
if (e)
|
|
7
|
+
return typeof e == "string" ? n && n.has(e) ? e : void 0 : e.genericKey ?? void 0;
|
|
8
|
+
}, x = (e) => !e || typeof e == "string" ? [] : e.genericType?.genericMappers ?? [], R = (e, n) => ({
|
|
9
|
+
...e,
|
|
10
|
+
sourceDataTypeIdentifiers: n
|
|
11
|
+
}), _ = (e) => {
|
|
12
|
+
const n = e.genericCombinationStrategies ?? [];
|
|
13
|
+
return new Set(n.map((i) => i.type));
|
|
14
|
+
}, D = (e) => {
|
|
15
|
+
if (Array.isArray(e))
|
|
16
|
+
return e.map(D);
|
|
17
|
+
if (y(e)) {
|
|
18
|
+
const n = {};
|
|
19
|
+
return Object.entries(e).forEach(([i, t]) => {
|
|
20
|
+
i === "__typename" || i === "id" || i === "createdAt" || i === "updatedAt" || (n[i] = D(t));
|
|
21
|
+
}), n;
|
|
22
|
+
}
|
|
23
|
+
return e;
|
|
24
|
+
}, M = (e, n) => {
|
|
25
|
+
if (!n) return !e;
|
|
26
|
+
if (typeof n == "string")
|
|
27
|
+
return n === O ? !0 : S(e) === n;
|
|
28
|
+
if (n.genericKey) return !0;
|
|
29
|
+
const t = S(n), a = S(e);
|
|
30
|
+
return !!t && t === a;
|
|
31
|
+
}, J = (e, n) => {
|
|
32
|
+
switch (e.__typename) {
|
|
33
|
+
case "DataTypeRulesContainsKeyConfig":
|
|
34
|
+
case "DataTypeRulesContainsTypeConfig":
|
|
35
|
+
case "DataTypeRulesReturnTypeConfig": {
|
|
36
|
+
const i = e.dataTypeIdentifier;
|
|
37
|
+
return i ? {
|
|
38
|
+
...e,
|
|
39
|
+
dataTypeIdentifier: b(i, n)
|
|
40
|
+
} : e;
|
|
41
|
+
}
|
|
42
|
+
case "DataTypeRulesInputTypesConfig": {
|
|
43
|
+
const i = e, t = i.inputTypes?.map((a) => ({
|
|
44
|
+
...a,
|
|
45
|
+
dataTypeIdentifier: b(a.dataTypeIdentifier, n)
|
|
46
|
+
}));
|
|
47
|
+
return {
|
|
48
|
+
...i,
|
|
49
|
+
inputTypes: t
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
default:
|
|
53
|
+
return e;
|
|
54
|
+
}
|
|
55
|
+
}, V = (e, n, i) => {
|
|
56
|
+
const t = {}, a = new Set(i), c = (s, r) => {
|
|
57
|
+
if (!s || !r) return;
|
|
58
|
+
const f = w(s, a);
|
|
59
|
+
if (f && a.has(f)) {
|
|
60
|
+
l(r) && (t[f] = r);
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
const o = x(s);
|
|
64
|
+
if (o.length === 0) return;
|
|
65
|
+
const u = x(r);
|
|
66
|
+
for (const p of o) {
|
|
67
|
+
const T = u.find((g) => g.target === p.target);
|
|
68
|
+
if (!T) continue;
|
|
69
|
+
const d = (p.sourceDataTypeIdentifiers ?? []).map((g) => w(g, a)).filter((g) => !!g && a.has(g)), I = _(p), C = T.sourceDataTypeIdentifiers ?? [];
|
|
70
|
+
if ((I.has(j.And) || I.has(j.Or)) && C.length === 1 && d.length === (p.sourceDataTypeIdentifiers?.length ?? 0))
|
|
71
|
+
for (const g of d)
|
|
72
|
+
t[g] = C[0];
|
|
73
|
+
else {
|
|
74
|
+
const g = Math.min(p.sourceDataTypeIdentifiers?.length ?? 0, C.length);
|
|
75
|
+
for (let A = 0; A < g; A++)
|
|
76
|
+
c(p.sourceDataTypeIdentifiers[A], C[A]);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
return c(e, n), t;
|
|
81
|
+
}, b = (e, n) => {
|
|
82
|
+
if (!l(e)) return e;
|
|
83
|
+
const {
|
|
84
|
+
genericKey: i,
|
|
85
|
+
genericType: t
|
|
86
|
+
} = e;
|
|
87
|
+
if (i && n.has(i)) {
|
|
88
|
+
const c = n.get(i);
|
|
89
|
+
return c && l(c) ? c : e;
|
|
90
|
+
}
|
|
91
|
+
if (!t) return e;
|
|
92
|
+
const a = (t.genericMappers ?? []).map((c) => {
|
|
93
|
+
const s = [];
|
|
94
|
+
for (const r of c.sourceDataTypeIdentifiers ?? []) {
|
|
95
|
+
if (!r) continue;
|
|
96
|
+
const f = r.genericKey;
|
|
97
|
+
if (f && n.has(f)) {
|
|
98
|
+
const o = n.get(f);
|
|
99
|
+
o && K(o) ? s.push(...o.sourceDataTypeIdentifiers) : o && l(o) ? s.push(o) : s.push(r);
|
|
100
|
+
} else l(r) ? s.push(b(r, n)) : s.push(r);
|
|
101
|
+
}
|
|
102
|
+
return R(c, s);
|
|
103
|
+
});
|
|
104
|
+
return {
|
|
105
|
+
...e,
|
|
106
|
+
genericType: {
|
|
107
|
+
...t,
|
|
108
|
+
genericMappers: a
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
}, F = (e, n, i) => {
|
|
112
|
+
const t = {}, a = new Set(i), c = (s, r, f) => {
|
|
113
|
+
if (!(!s || !r || a.size === 0)) {
|
|
114
|
+
if (l(s)) {
|
|
115
|
+
const o = s.genericKey;
|
|
116
|
+
if (o && a.has(o) && (f ? t[o] = f : (K(r) || l(r)) && (t[o] = r), a.delete(o), a.size === 0))
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
if (K(s) && K(r)) {
|
|
120
|
+
const o = Math.min(s.sourceDataTypeIdentifiers?.length, r.sourceDataTypeIdentifiers?.length);
|
|
121
|
+
for (let u = 0; u < o; u++)
|
|
122
|
+
if (c(s.sourceDataTypeIdentifiers[u], r.sourceDataTypeIdentifiers[u], r), a.size === 0) return;
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
if (z(s) && z(r)) {
|
|
126
|
+
const o = s.rules?.nodes ?? [], u = r.rules?.nodes ?? [], p = Math.min(o.length, u.length);
|
|
127
|
+
for (let T = 0; T < p; T++) {
|
|
128
|
+
const d = o[T], I = u[T];
|
|
129
|
+
if (!(!d || !I) && (c(d, I), a.size === 0))
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
if (G(s) && G(r)) {
|
|
135
|
+
c(s.config, r.config);
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
if (Array.isArray(s) && Array.isArray(r)) {
|
|
139
|
+
const o = Math.min(s.length, r.length);
|
|
140
|
+
for (let u = 0; u < o; u++)
|
|
141
|
+
if (c(s[u], r[u], f), a.size === 0) return;
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
if (y(s) && y(r)) {
|
|
145
|
+
for (const o of Object.keys(s))
|
|
146
|
+
if (o in r && o !== "__typename" && (c(s[o], r[o], f), a.size === 0))
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
return c(e, n), t;
|
|
152
|
+
}, L = (e, n) => {
|
|
153
|
+
const i = e.rules ? {
|
|
154
|
+
...e.rules,
|
|
155
|
+
nodes: e.rules.nodes?.map((t) => t && {
|
|
156
|
+
...t,
|
|
157
|
+
config: J(t.config, n)
|
|
158
|
+
})
|
|
159
|
+
} : void 0;
|
|
160
|
+
return {
|
|
161
|
+
...e,
|
|
162
|
+
rules: i
|
|
163
|
+
};
|
|
164
|
+
}, H = (e, n, i, t) => {
|
|
165
|
+
const a = /* @__PURE__ */ new Map(), c = e.genericKeys ?? [];
|
|
166
|
+
if (!e.parameterDefinitions || c.length <= 0) return a;
|
|
167
|
+
const s = new Set(c);
|
|
168
|
+
return e.parameterDefinitions.forEach((r, f) => {
|
|
169
|
+
const o = r.dataTypeIdentifier, u = n[f], p = i.getTypeFromValue(u, t);
|
|
170
|
+
if (!o || !p) return;
|
|
171
|
+
const T = V(o, p, c);
|
|
172
|
+
for (const [d, I] of Object.entries(T))
|
|
173
|
+
s.has(d) && (a.has(d) || a.set(d, I));
|
|
174
|
+
}), a;
|
|
175
|
+
};
|
|
176
|
+
function W(e, n) {
|
|
177
|
+
if (e.variant !== n.variant) return !1;
|
|
178
|
+
const i = n.rules?.nodes ?? [];
|
|
179
|
+
if (i.length === 0) return !0;
|
|
180
|
+
const t = e.rules?.nodes ?? [];
|
|
181
|
+
for (const a of i) {
|
|
182
|
+
if (!a) continue;
|
|
183
|
+
if (!t.some((s) => s ? k(s, a) : !1)) return !1;
|
|
184
|
+
}
|
|
185
|
+
return !0;
|
|
186
|
+
}
|
|
187
|
+
function k(e, n) {
|
|
188
|
+
if (e.variant !== n.variant) return !1;
|
|
189
|
+
switch (n.variant) {
|
|
190
|
+
case h.ContainsType:
|
|
191
|
+
case h.ReturnType:
|
|
192
|
+
return M(e.config.dataTypeIdentifier, n.config.dataTypeIdentifier);
|
|
193
|
+
case h.ContainsKey: {
|
|
194
|
+
const i = e.config, t = n.config;
|
|
195
|
+
return i.key !== t.key ? !1 : M(i.dataTypeIdentifier, t.dataTypeIdentifier);
|
|
196
|
+
}
|
|
197
|
+
case h.InputType: {
|
|
198
|
+
const i = e.config, a = n.config.inputTypes ?? [], c = i.inputTypes ?? [];
|
|
199
|
+
return a.every((s) => c.some((r) => M(r.dataTypeIdentifier, s.dataTypeIdentifier)));
|
|
200
|
+
}
|
|
201
|
+
case h.ItemOfCollection: {
|
|
202
|
+
const i = e.config.items ?? [], t = n.config.items ?? [];
|
|
203
|
+
return i.length !== t.length ? !1 : i.every((a, c) => a === t[c]);
|
|
204
|
+
}
|
|
205
|
+
case h.NumberRange: {
|
|
206
|
+
const i = e.config, t = n.config;
|
|
207
|
+
return i.from === t.from && i.to === t.to && i.steps === t.steps;
|
|
208
|
+
}
|
|
209
|
+
case h.Regex: {
|
|
210
|
+
const i = e.config.pattern, t = n.config.pattern;
|
|
211
|
+
return i === t;
|
|
212
|
+
}
|
|
213
|
+
default:
|
|
214
|
+
return JSON.stringify(D(e.config)) === JSON.stringify(D(n.config));
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
function q(e, n) {
|
|
218
|
+
const i = (s) => !!(s === O || l(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 = D(e), c = D(n);
|
|
219
|
+
return t(a, c);
|
|
220
|
+
}
|
|
221
|
+
const E = (e, n) => {
|
|
222
|
+
if (typeof e == "string") {
|
|
223
|
+
const t = n.getDataType(e);
|
|
224
|
+
if (!t) return e;
|
|
225
|
+
const a = t.genericKeys ?? [];
|
|
226
|
+
if (t.variant === P.Array && a.length > 0) {
|
|
227
|
+
const s = t.rules?.nodes?.find((r) => r?.variant === h.ContainsType)?.config?.dataTypeIdentifier;
|
|
228
|
+
if (s) {
|
|
229
|
+
const [r] = a;
|
|
230
|
+
return r ? {
|
|
231
|
+
dataType: t.json,
|
|
232
|
+
genericType: {
|
|
233
|
+
dataType: t.json,
|
|
234
|
+
genericMappers: [{
|
|
235
|
+
target: r,
|
|
236
|
+
sourceDataTypeIdentifiers: [E(s, n)]
|
|
237
|
+
}]
|
|
238
|
+
}
|
|
239
|
+
} : e;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
return e;
|
|
243
|
+
}
|
|
244
|
+
if (!l(e) || !e.genericType) return e;
|
|
245
|
+
const i = e.genericType.genericMappers?.map((t) => ({
|
|
246
|
+
...t,
|
|
247
|
+
sourceDataTypeIdentifiers: t?.sourceDataTypeIdentifiers?.map((a) => E(a, n))
|
|
248
|
+
})) ?? [];
|
|
249
|
+
return {
|
|
250
|
+
...e,
|
|
251
|
+
genericType: {
|
|
252
|
+
...e.genericType,
|
|
253
|
+
genericMappers: i
|
|
254
|
+
}
|
|
255
|
+
};
|
|
256
|
+
}, m = (e) => {
|
|
257
|
+
if (Array.isArray(e)) {
|
|
258
|
+
const n = e.map(m);
|
|
259
|
+
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
|
+
}
|
|
261
|
+
if (y(e)) {
|
|
262
|
+
const n = e;
|
|
263
|
+
return Object.keys(n).sort().reduce((i, t) => (i[t] = m(n[t]), i), {});
|
|
264
|
+
}
|
|
265
|
+
return e;
|
|
266
|
+
}, B = (e, n = []) => {
|
|
267
|
+
const i = new Set(n), t = (r) => r ? i.size === 0 ? !0 : i.has(r) : !1, a = (r) => {
|
|
268
|
+
const o = t(r.target) ? O : r.target, u = (r.sourceDataTypeIdentifiers ?? []).map((p) => s(p));
|
|
269
|
+
return m({
|
|
270
|
+
...r,
|
|
271
|
+
target: o,
|
|
272
|
+
sourceDataTypeIdentifiers: u
|
|
273
|
+
});
|
|
274
|
+
}, c = (r) => {
|
|
275
|
+
const o = t(r.genericKey) ? O : r.genericKey, u = {
|
|
276
|
+
...r,
|
|
277
|
+
genericKey: o,
|
|
278
|
+
dataType: r.dataType ? s(r.dataType) : r.dataType,
|
|
279
|
+
genericType: r.genericType ? s(r.genericType) : r.genericType
|
|
280
|
+
};
|
|
281
|
+
return m(u);
|
|
282
|
+
};
|
|
283
|
+
function s(r) {
|
|
284
|
+
if (r == null) return r;
|
|
285
|
+
if (Array.isArray(r)) {
|
|
286
|
+
const f = r.map((o) => s(o));
|
|
287
|
+
return m(f);
|
|
288
|
+
}
|
|
289
|
+
if (l(r))
|
|
290
|
+
return c(r);
|
|
291
|
+
if (K(r))
|
|
292
|
+
return a(r);
|
|
293
|
+
if (y(r)) {
|
|
294
|
+
const f = Object.entries(r).reduce((o, [u, p]) => (o[u] = s(p), o), {});
|
|
295
|
+
return m(f);
|
|
296
|
+
}
|
|
297
|
+
return r;
|
|
298
|
+
}
|
|
299
|
+
return s(e);
|
|
300
|
+
};
|
|
301
|
+
export {
|
|
302
|
+
W as isMatchingDataTypeObject,
|
|
303
|
+
q as isMatchingType,
|
|
304
|
+
L as replaceGenericKeysInDataTypeObject,
|
|
305
|
+
b as replaceGenericKeysInType,
|
|
306
|
+
B as replaceGenericsAndSortType,
|
|
307
|
+
F as resolveAllGenericKeysInDataTypeObject,
|
|
308
|
+
V as resolveGenericKeyMappings,
|
|
309
|
+
H as resolveGenericKeys,
|
|
310
|
+
E as resolveType
|
|
311
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './arrayService';
|
|
2
|
+
export * from './contextStore';
|
|
3
|
+
export * from './inspection';
|
|
4
|
+
export * from './nonReactiveArrayService';
|
|
5
|
+
export * from './objectStore';
|
|
6
|
+
export * from './reactiveArrayService';
|
|
7
|
+
export * from './types';
|
|
8
|
+
export * from './utils';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ContextStore as o, ContextStoreProvider as t, useService as i, useStore as c } from "./contextStore.js";
|
|
2
|
+
import { InspectionSeverity as v } from "./inspection.js";
|
|
3
|
+
import { NonReactiveArrayService as S, createNonReactiveArrayService as p } from "./nonReactiveArrayService.js";
|
|
4
|
+
import { ObjectService as g, createObjectService as x } from "./objectStore.js";
|
|
5
|
+
import { ReactiveArrayService as f, useReactiveArrayService as C } from "./reactiveArrayService.js";
|
|
6
|
+
import { Colors as y } from "./types.js";
|
|
7
|
+
import { getChild as P, getContent as u, getPositionAroundTarget as R, getPositioning as b, getWindowPositioning as j, mergeCode0Props as l, parseUnit as N } from "./utils.js";
|
|
8
|
+
export {
|
|
9
|
+
y as Colors,
|
|
10
|
+
o as ContextStore,
|
|
11
|
+
t as ContextStoreProvider,
|
|
12
|
+
v as InspectionSeverity,
|
|
13
|
+
S as NonReactiveArrayService,
|
|
14
|
+
g as ObjectService,
|
|
15
|
+
f as ReactiveArrayService,
|
|
16
|
+
p as createNonReactiveArrayService,
|
|
17
|
+
x as createObjectService,
|
|
18
|
+
P as getChild,
|
|
19
|
+
u as getContent,
|
|
20
|
+
R as getPositionAroundTarget,
|
|
21
|
+
b as getPositioning,
|
|
22
|
+
j as getWindowPositioning,
|
|
23
|
+
l as mergeCode0Props,
|
|
24
|
+
N as parseUnit,
|
|
25
|
+
C as useReactiveArrayService,
|
|
26
|
+
i as useService,
|
|
27
|
+
c as useStore
|
|
28
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Maybe, Scalars, TranslationConnection } from '@code0-tech/sagittarius-graphql-types';
|
|
2
|
+
export declare enum InspectionSeverity {
|
|
3
|
+
TYPO = 0,
|
|
4
|
+
GRAMMAR = 1,
|
|
5
|
+
WEAK = 2,
|
|
6
|
+
WARNING = 3,
|
|
7
|
+
ERROR = 4
|
|
8
|
+
}
|
|
9
|
+
export interface ValidationResult {
|
|
10
|
+
parameterId: Maybe<Scalars["ParameterDefinitionID"]["output"]>;
|
|
11
|
+
type: InspectionSeverity;
|
|
12
|
+
message: TranslationConnection;
|
|
13
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ArrayService } from './arrayService';
|
|
2
|
+
/**
|
|
3
|
+
* using a React ref as a store in combination with a map
|
|
4
|
+
* to be able to access and modify the store easily
|
|
5
|
+
*/
|
|
6
|
+
export type NonReactiveArrayStore<K> = K[];
|
|
7
|
+
export declare class NonReactiveArrayService<T> implements ArrayService<T> {
|
|
8
|
+
protected store: NonReactiveArrayStore<T>;
|
|
9
|
+
constructor(store: NonReactiveArrayStore<T>);
|
|
10
|
+
delete(index: number): void;
|
|
11
|
+
add(value: T): void;
|
|
12
|
+
set(index: number, value: T): void;
|
|
13
|
+
has(index: number): boolean;
|
|
14
|
+
get(index: number): T;
|
|
15
|
+
values(): NonReactiveArrayStore<T>;
|
|
16
|
+
update(): void;
|
|
17
|
+
clear(): void;
|
|
18
|
+
}
|
|
19
|
+
export declare const createNonReactiveArrayService: <K, T extends ArrayService<K>>(service: typeof T, callback?: (store: NonReactiveArrayStore<K>) => T) => [K[] | undefined, T];
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
function o(t, e, r) {
|
|
2
|
+
return (e = s(e)) in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
|
|
3
|
+
}
|
|
4
|
+
function s(t) {
|
|
5
|
+
var e = n(t, "string");
|
|
6
|
+
return typeof e == "symbol" ? e : e + "";
|
|
7
|
+
}
|
|
8
|
+
function n(t, e) {
|
|
9
|
+
if (typeof t != "object" || !t) return t;
|
|
10
|
+
var r = t[Symbol.toPrimitive];
|
|
11
|
+
if (r !== void 0) {
|
|
12
|
+
var i = r.call(t, e);
|
|
13
|
+
if (typeof i != "object") return i;
|
|
14
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
15
|
+
}
|
|
16
|
+
return (e === "string" ? String : Number)(t);
|
|
17
|
+
}
|
|
18
|
+
class u {
|
|
19
|
+
constructor(e) {
|
|
20
|
+
o(this, "store", void 0), this.store = e;
|
|
21
|
+
}
|
|
22
|
+
delete(e) {
|
|
23
|
+
delete this.store[e];
|
|
24
|
+
}
|
|
25
|
+
add(e) {
|
|
26
|
+
this.store.push(e);
|
|
27
|
+
}
|
|
28
|
+
set(e, r) {
|
|
29
|
+
this.store[e] = r;
|
|
30
|
+
}
|
|
31
|
+
has(e) {
|
|
32
|
+
return !!this.store[e];
|
|
33
|
+
}
|
|
34
|
+
get(e) {
|
|
35
|
+
return this.store[e];
|
|
36
|
+
}
|
|
37
|
+
values() {
|
|
38
|
+
return this.store;
|
|
39
|
+
}
|
|
40
|
+
update() {
|
|
41
|
+
this.store = [...this.store];
|
|
42
|
+
}
|
|
43
|
+
clear() {
|
|
44
|
+
this.store = [];
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
const a = (t, e) => {
|
|
48
|
+
const r = [];
|
|
49
|
+
return [r, e ? e(r) : new t(r)];
|
|
50
|
+
};
|
|
51
|
+
export {
|
|
52
|
+
u as NonReactiveArrayService,
|
|
53
|
+
a as createNonReactiveArrayService
|
|
54
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* using a React ref as a store in combination with a map
|
|
4
|
+
* to be able to access and modify the store easily
|
|
5
|
+
*/
|
|
6
|
+
export type ObjectStore<K> = [K | undefined, React.Dispatch<React.SetStateAction<K>>];
|
|
7
|
+
export declare class ObjectService<K> {
|
|
8
|
+
protected readonly store: ObjectStore<K>;
|
|
9
|
+
constructor(store: ObjectStore<K>);
|
|
10
|
+
object(): K | undefined;
|
|
11
|
+
}
|
|
12
|
+
export declare const createObjectService: <K, T extends ObjectService<K>>(service: typeof T, callback?: (store: ObjectStore<K>) => T, initial?: K) => [K | undefined, T];
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import o from "react";
|
|
2
|
+
function n(e, r, t) {
|
|
3
|
+
return (r = u(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e;
|
|
4
|
+
}
|
|
5
|
+
function u(e) {
|
|
6
|
+
var r = c(e, "string");
|
|
7
|
+
return typeof r == "symbol" ? r : r + "";
|
|
8
|
+
}
|
|
9
|
+
function c(e, r) {
|
|
10
|
+
if (typeof e != "object" || !e) return e;
|
|
11
|
+
var t = e[Symbol.toPrimitive];
|
|
12
|
+
if (t !== void 0) {
|
|
13
|
+
var i = t.call(e, r);
|
|
14
|
+
if (typeof i != "object") return i;
|
|
15
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
16
|
+
}
|
|
17
|
+
return (r === "string" ? String : Number)(e);
|
|
18
|
+
}
|
|
19
|
+
class f {
|
|
20
|
+
constructor(r) {
|
|
21
|
+
n(this, "store", void 0), this.store = r;
|
|
22
|
+
}
|
|
23
|
+
object() {
|
|
24
|
+
return this.store[0];
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
const v = (e, r, t) => {
|
|
28
|
+
const i = o.useState(t);
|
|
29
|
+
return [i[0], r ? r(i) : new e(i)];
|
|
30
|
+
};
|
|
31
|
+
export {
|
|
32
|
+
f as ObjectService,
|
|
33
|
+
v as createObjectService
|
|
34
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ArrayService } from './arrayService';
|
|
3
|
+
export type ReactiveArrayStore<T> = {
|
|
4
|
+
getState: () => T[];
|
|
5
|
+
setState: React.Dispatch<React.SetStateAction<T[]>>;
|
|
6
|
+
};
|
|
7
|
+
export declare class ReactiveArrayService<T> implements ArrayService<T> {
|
|
8
|
+
protected readonly access: ReactiveArrayStore<T>;
|
|
9
|
+
constructor(access: ReactiveArrayStore<T>);
|
|
10
|
+
delete(index: number): void;
|
|
11
|
+
add(value: T): void;
|
|
12
|
+
set(index: number, value: T): void;
|
|
13
|
+
has(index: number): boolean;
|
|
14
|
+
get(index: number): T;
|
|
15
|
+
values(): T[];
|
|
16
|
+
update(): void;
|
|
17
|
+
clear(): void;
|
|
18
|
+
}
|
|
19
|
+
type ArrayServiceCtor<K, S extends ArrayService<K>> = new (access: ReactiveArrayStore<K>) => S;
|
|
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>, initial?: InitialArg<K, S>): [K[], S];
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import a, { startTransition as i } from "react";
|
|
2
|
+
function u(r, e, t) {
|
|
3
|
+
return (e = f(e)) in r ? Object.defineProperty(r, e, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : r[e] = t, r;
|
|
4
|
+
}
|
|
5
|
+
function f(r) {
|
|
6
|
+
var e = v(r, "string");
|
|
7
|
+
return typeof e == "symbol" ? e : e + "";
|
|
8
|
+
}
|
|
9
|
+
function v(r, e) {
|
|
10
|
+
if (typeof r != "object" || !r) return r;
|
|
11
|
+
var t = r[Symbol.toPrimitive];
|
|
12
|
+
if (t !== void 0) {
|
|
13
|
+
var s = t.call(r, e);
|
|
14
|
+
if (typeof s != "object") return s;
|
|
15
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
16
|
+
}
|
|
17
|
+
return (e === "string" ? String : Number)(r);
|
|
18
|
+
}
|
|
19
|
+
class y {
|
|
20
|
+
constructor(e) {
|
|
21
|
+
u(this, "access", void 0), this.access = e;
|
|
22
|
+
}
|
|
23
|
+
delete(e) {
|
|
24
|
+
i(() => {
|
|
25
|
+
this.access.setState((t) => t.filter((s, c) => c !== e));
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
add(e) {
|
|
29
|
+
i(() => {
|
|
30
|
+
this.access.setState((t) => [...t, e]);
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
set(e, t) {
|
|
34
|
+
i(() => {
|
|
35
|
+
this.access.setState((s) => {
|
|
36
|
+
const c = s.slice();
|
|
37
|
+
return c[e] = t, c;
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
has(e) {
|
|
42
|
+
const t = this.access.getState();
|
|
43
|
+
return e >= 0 && e < t.length;
|
|
44
|
+
}
|
|
45
|
+
get(e) {
|
|
46
|
+
return this.access.getState()[e];
|
|
47
|
+
}
|
|
48
|
+
values() {
|
|
49
|
+
return this.access.getState();
|
|
50
|
+
}
|
|
51
|
+
update() {
|
|
52
|
+
i(() => {
|
|
53
|
+
this.access.setState((e) => e.slice());
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
clear() {
|
|
57
|
+
i(() => {
|
|
58
|
+
this.access.setState(() => []);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
function S(r, e = []) {
|
|
63
|
+
const [t, s] = a.useState(
|
|
64
|
+
Array.isArray(e) ? e : []
|
|
65
|
+
// Platzhalter; Callback folgt in Effect
|
|
66
|
+
), c = a.useRef(t);
|
|
67
|
+
a.useEffect(() => {
|
|
68
|
+
c.current = t;
|
|
69
|
+
}, [t]);
|
|
70
|
+
const o = a.useCallback(() => c.current, []), n = a.useMemo(() => new r({
|
|
71
|
+
getState: o,
|
|
72
|
+
setState: s
|
|
73
|
+
}), [r, o, s]);
|
|
74
|
+
return a.useEffect(() => {
|
|
75
|
+
typeof e == "function" && s(e(n));
|
|
76
|
+
}, [n]), [t, n];
|
|
77
|
+
}
|
|
78
|
+
export {
|
|
79
|
+
y as ReactiveArrayService,
|
|
80
|
+
S as useReactiveArrayService
|
|
81
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { default as React, HTMLProps } from 'react';
|
|
2
|
+
export type Color = "primary" | "secondary" | "info" | "success" | "warning" | "error";
|
|
3
|
+
export declare const Colors: Color[];
|
|
4
|
+
export type Code0Sizes = "xs" | "sm" | "md" | "lg" | "xl";
|
|
5
|
+
export type Code0FontSizes = "0.75" | "0.8" | "1" | "1.2" | "1.25";
|
|
6
|
+
export type StyleProp<Value> = Value;
|
|
7
|
+
export interface Code0ComponentProps {
|
|
8
|
+
m?: StyleProp<number | `${number}`>;
|
|
9
|
+
my?: StyleProp<number | `${number}`>;
|
|
10
|
+
mx?: StyleProp<number | `${number}`>;
|
|
11
|
+
mt?: StyleProp<number | `${number}`>;
|
|
12
|
+
mb?: StyleProp<number | `${number}`>;
|
|
13
|
+
ml?: StyleProp<number | `${number}`>;
|
|
14
|
+
mr?: StyleProp<number | `${number}`>;
|
|
15
|
+
p?: StyleProp<number | `${number}`>;
|
|
16
|
+
py?: StyleProp<number | `${number}`>;
|
|
17
|
+
px?: StyleProp<number | `${number}`>;
|
|
18
|
+
pt?: StyleProp<number | `${number}`>;
|
|
19
|
+
pb?: StyleProp<number | `${number}`>;
|
|
20
|
+
pl?: StyleProp<number | `${number}`>;
|
|
21
|
+
pr?: StyleProp<number | `${number}`>;
|
|
22
|
+
bg?: React.CSSProperties['backgroundColor'];
|
|
23
|
+
c?: React.CSSProperties['color'];
|
|
24
|
+
opacity?: React.CSSProperties['opacity'];
|
|
25
|
+
ff?: StyleProp<'mono' | 'text' | 'heading' | (string & {})>;
|
|
26
|
+
fz?: StyleProp<Code0FontSizes | number | `${number}`>;
|
|
27
|
+
fw?: StyleProp<React.CSSProperties['fontWeight']>;
|
|
28
|
+
lts?: StyleProp<React.CSSProperties['letterSpacing']>;
|
|
29
|
+
ta?: StyleProp<React.CSSProperties['textAlign']>;
|
|
30
|
+
lh?: StyleProp<number | (string & {})>;
|
|
31
|
+
fs?: StyleProp<React.CSSProperties['fontStyle']>;
|
|
32
|
+
tt?: StyleProp<React.CSSProperties['textTransform']>;
|
|
33
|
+
td?: StyleProp<React.CSSProperties['textDecoration']>;
|
|
34
|
+
w?: StyleProp<React.CSSProperties['width']>;
|
|
35
|
+
miw?: StyleProp<React.CSSProperties['minWidth']>;
|
|
36
|
+
maw?: StyleProp<React.CSSProperties['maxWidth']>;
|
|
37
|
+
h?: StyleProp<React.CSSProperties['height']>;
|
|
38
|
+
mih?: StyleProp<React.CSSProperties['minHeight']>;
|
|
39
|
+
mah?: StyleProp<React.CSSProperties['maxHeight']>;
|
|
40
|
+
bgsz?: StyleProp<React.CSSProperties['backgroundSize']>;
|
|
41
|
+
bgp?: StyleProp<React.CSSProperties['backgroundPosition']>;
|
|
42
|
+
bgr?: StyleProp<React.CSSProperties['backgroundRepeat']>;
|
|
43
|
+
bga?: StyleProp<React.CSSProperties['backgroundAttachment']>;
|
|
44
|
+
pos?: StyleProp<React.CSSProperties['position']>;
|
|
45
|
+
top?: StyleProp<React.CSSProperties['top']>;
|
|
46
|
+
left?: StyleProp<React.CSSProperties['left']>;
|
|
47
|
+
bottom?: StyleProp<React.CSSProperties['bottom']>;
|
|
48
|
+
right?: StyleProp<React.CSSProperties['right']>;
|
|
49
|
+
inset?: StyleProp<React.CSSProperties['inset']>;
|
|
50
|
+
display?: StyleProp<React.CSSProperties['display']>;
|
|
51
|
+
flex?: StyleProp<React.CSSProperties['flex']>;
|
|
52
|
+
align?: StyleProp<React.CSSProperties['alignItems']>;
|
|
53
|
+
justify?: StyleProp<React.CSSProperties['justifyContent']>;
|
|
54
|
+
tf?: StyleProp<React.CSSProperties['transform']>;
|
|
55
|
+
}
|
|
56
|
+
export interface Code0Component<T> extends Code0ComponentProps, HTMLProps<T> {
|
|
57
|
+
}
|