@code0-tech/pictor 0.0.0-mvp.29 → 0.0.0-mvp.30
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/_commonjsHelpers.js +6 -0
- package/dist/_virtual/index.js +4 -0
- package/dist/_virtual/index2.js +4 -0
- package/dist/_virtual/react-contenteditable.js +7 -0
- package/dist/_virtual/react-contenteditable2.js +4 -0
- package/dist/_virtual/react-dom-server-legacy.browser.development.js +4 -0
- package/dist/_virtual/react-dom-server-legacy.browser.production.js +4 -0
- package/dist/_virtual/react-dom-server.browser.development.js +4 -0
- package/dist/_virtual/react-dom-server.browser.production.js +4 -0
- package/dist/_virtual/react-is.development.js +4 -0
- package/dist/_virtual/react-is.production.min.js +4 -0
- package/dist/_virtual/server.browser.js +5 -0
- package/dist/_virtual/server.browser2.js +4 -0
- package/dist/assets/components/d-resizable/DResizable.style.css +1 -1
- package/dist/assets/components/form/Input.style.css +1 -1
- package/dist/components/breadcrumb/Breadcrumb.js +12 -12
- package/dist/components/button-group/ButtonGroup.js +12 -12
- package/dist/components/d-flow/DFlow.edges.hook.js +57 -54
- package/dist/components/d-flow/DFlow.js +304 -268
- package/dist/components/d-flow/DFlow.nodes.hook.js +60 -59
- package/dist/components/d-flow/DFlow.service.d.ts +3 -2
- package/dist/components/d-flow/DFlow.service.js +62 -47
- package/dist/components/d-flow/DFlow.util.d.ts +4 -0
- package/dist/components/d-flow/DFlow.util.js +63 -0
- package/dist/components/d-flow/DFlowEdge.js +34 -34
- package/dist/components/d-flow-data-type/DFlowDataType.service.js +17 -14
- package/dist/components/d-flow-data-type/DFlowDataType.view.d.ts +7 -4
- package/dist/components/d-flow-data-type/DFlowDataType.view.js +11 -6
- package/dist/components/d-flow-file/DFlowTabDefault.d.ts +0 -3
- package/dist/components/d-flow-file/DFlowTabDefault.js +77 -112
- package/dist/components/d-flow-file/DFlowTabTrigger.js +38 -49
- package/dist/components/d-flow-file/DFlowTabs.js +26 -27
- package/dist/components/d-flow-folder/DFlowFolder.js +170 -143
- package/dist/components/d-flow-folder/DFlowFolderContextMenu.js +18 -11
- package/dist/components/d-flow-folder/DFlowFolderItemPathInput.js +1 -0
- package/dist/components/d-flow-function/DFlowFunction.input.hook.js +4 -5
- package/dist/components/d-flow-function/DFlowFunction.return.hook.js +1 -1
- package/dist/components/d-flow-function/DFlowFunction.view.d.ts +14 -11
- package/dist/components/d-flow-function/DFlowFunction.view.js +19 -12
- package/dist/components/d-flow-function/DFlowFunctionDefaultCard.js +72 -75
- package/dist/components/d-flow-function/DFlowFunctionSuggestionCard.js +27 -32
- package/dist/components/d-flow-function/DFlowFunctionTriggerCard.js +17 -10
- package/dist/components/d-flow-input/DFlowInputDataType.js +38 -33
- package/dist/components/d-flow-input/DFlowInputDefault.d.ts +10 -0
- package/dist/components/d-flow-input/DFlowInputDefault.js +128 -0
- package/dist/components/d-flow-input/DFlowInputLiteralBadge.d.ts +7 -0
- package/dist/components/d-flow-input/DFlowInputLiteralBadge.js +24 -0
- package/dist/components/d-flow-input/DFlowInputNodeBadge.d.ts +11 -0
- package/dist/components/d-flow-input/DFlowInputNodeBadge.js +44 -0
- package/dist/components/d-flow-input/DFlowInputReferenceBadge.d.ts +11 -0
- package/dist/components/d-flow-input/DFlowInputReferenceBadge.js +33 -0
- package/dist/components/d-flow-panel/DFlowExport.js +1 -1
- package/dist/components/d-flow-panel/DFlowMiniMap.js +1 -1
- package/dist/components/d-flow-panel/DFlowPanelControl.js +34 -32
- package/dist/components/d-flow-suggestion/DFlowDataTypeSuggestions.hook.d.ts +3 -0
- package/dist/components/d-flow-suggestion/DFlowDataTypeSuggestions.hook.js +34 -0
- package/dist/components/d-flow-suggestion/DFlowFunctionSuggestions.hook.d.ts +3 -0
- package/dist/components/d-flow-suggestion/DFlowFunctionSuggestions.hook.js +50 -0
- package/dist/components/d-flow-suggestion/DFlowReferenceSuggestions.hook.d.ts +3 -0
- package/dist/components/d-flow-suggestion/DFlowReferenceSuggestions.hook.js +133 -0
- package/dist/components/d-flow-suggestion/DFlowSuggestion.hook.d.ts +3 -18
- package/dist/components/d-flow-suggestion/DFlowSuggestion.hook.js +19 -156
- package/dist/components/d-flow-suggestion/DFlowSuggestionMenu.js +47 -58
- package/dist/components/d-flow-suggestion/DFlowSuggestionMenu.util.js +5 -4
- package/dist/components/d-flow-suggestion/DFlowSuggestionSearchInput.js +6 -6
- package/dist/components/d-flow-suggestion/DFlowValueSuggestions.hook.d.ts +3 -0
- package/dist/components/d-flow-suggestion/DFlowValueSuggestions.hook.js +44 -0
- package/dist/components/d-flow-type/DFlowType.view.d.ts +5 -5
- package/dist/components/d-flow-type/DFlowType.view.js +22 -12
- package/dist/components/d-flow-validation/DFlowValidation.hook.js +1 -1
- package/dist/components/d-flow-validation/DNodeValidation.hook.js +39 -43
- package/dist/components/d-resizable/DResizable.d.ts +4 -4
- package/dist/components/d-resizable/DResizable.js +22 -21
- package/dist/components/d-user/DUserInput.js +23 -21
- package/dist/components/file-tabs/FileTabs.service.d.ts +0 -1
- package/dist/components/file-tabs/FileTabs.service.js +49 -53
- package/dist/components/form/EmailInput.js +9 -9
- package/dist/components/form/Input.d.ts +2 -1
- package/dist/components/form/Input.js +294 -397
- package/dist/components/form/Input.syntax.hook.d.ts +1 -18
- package/dist/components/form/Input.syntax.hook.js +7 -73
- package/dist/components/form/Input.utils.d.ts +1 -2
- package/dist/components/form/Input.utils.js +26 -21
- package/dist/components/form/InputContentEditable.hook.d.ts +40 -0
- package/dist/components/form/InputContentEditable.hook.js +471 -0
- package/dist/components/form/InputSuggestion.d.ts +2 -2
- package/dist/components/form/InputSuggestion.js +169 -107
- package/dist/components/form/PasswordInput.js +8 -8
- package/dist/components/form/TextInput.js +11 -11
- package/dist/components/form/useForm.d.ts +1 -0
- package/dist/components/form/useForm.js +45 -60
- package/dist/components/menu/Menu.js +4 -4
- package/dist/index.js +155 -154
- package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +30 -30
- package/dist/node_modules/@radix-ui/react-portal/dist/index.js +8 -8
- package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +8 -8
- package/dist/node_modules/fast-deep-equal/index.js +31 -0
- package/dist/node_modules/object-assign/index.js +49 -0
- package/dist/node_modules/prop-types/checkPropTypes.js +54 -0
- package/dist/node_modules/prop-types/factoryWithThrowingShims.js +52 -0
- package/dist/node_modules/prop-types/factoryWithTypeCheckers.js +329 -0
- package/dist/node_modules/prop-types/index.js +17 -0
- package/dist/node_modules/prop-types/lib/ReactPropTypesSecret.js +10 -0
- package/dist/node_modules/prop-types/lib/has.js +7 -0
- package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js +87 -0
- package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js +70 -0
- package/dist/node_modules/prop-types/node_modules/react-is/index.js +10 -0
- package/dist/node_modules/react-contenteditable/lib/react-contenteditable.js +132 -0
- package/dist/node_modules/react-dom/cjs/react-dom-server-legacy.browser.development.js +6235 -0
- package/dist/node_modules/react-dom/cjs/react-dom-server-legacy.browser.production.js +4096 -0
- package/dist/node_modules/react-dom/cjs/react-dom-server.browser.development.js +6753 -0
- package/dist/node_modules/react-dom/cjs/react-dom-server.browser.production.js +4645 -0
- package/dist/node_modules/react-dom/server.browser.js +15 -0
- package/dist/utils/generics.d.ts +2 -0
- package/dist/utils/generics.js +93 -80
- package/dist/utils/index.js +22 -21
- package/dist/utils/inspection.d.ts +4 -2
- package/dist/utils/inspection.js +27 -2
- package/package.json +10 -8
- package/dist/components/form/Input.selection.hook.d.ts +0 -17
- package/dist/components/form/Input.selection.hook.js +0 -78
- package/dist/components/form/InputSyntax.d.ts +0 -19
- package/dist/components/form/InputSyntax.js +0 -52
- package/dist/components/form/inputSyntaxMapping.d.ts +0 -3
- package/dist/components/form/inputSyntaxMapping.js +0 -42
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { __exports as r } from "../../_virtual/server.browser2.js";
|
|
2
|
+
import { __require as t } from "./cjs/react-dom-server-legacy.browser.production.js";
|
|
3
|
+
import { __require as a } from "./cjs/react-dom-server.browser.production.js";
|
|
4
|
+
import { __require as s } from "./cjs/react-dom-server-legacy.browser.development.js";
|
|
5
|
+
import { __require as _ } from "./cjs/react-dom-server.browser.development.js";
|
|
6
|
+
var i;
|
|
7
|
+
function v() {
|
|
8
|
+
if (i) return r;
|
|
9
|
+
i = 1;
|
|
10
|
+
var e, o;
|
|
11
|
+
return process.env.NODE_ENV === "production" ? (e = t(), o = a()) : (e = s(), o = _()), r.version = e.version, r.renderToString = e.renderToString, r.renderToStaticMarkup = e.renderToStaticMarkup, r.renderToReadableStream = o.renderToReadableStream, r.resume = o.resume, r;
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
v as __require
|
|
15
|
+
};
|
package/dist/utils/generics.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { DataType, DataTypeIdentifier, Flow, GenericMapper, NodeParameterValue }
|
|
|
4
4
|
type GenericMappingResult = Record<string, DataTypeIdentifier>;
|
|
5
5
|
type GenericReplacement = DataTypeIdentifier | GenericMapper;
|
|
6
6
|
export type GenericMap = Map<string, GenericReplacement>;
|
|
7
|
+
export type GenericTargetMap = Map<string, string>;
|
|
7
8
|
export declare const resolveGenericKeyMappings: (parameterType: DataTypeIdentifier, valueType: DataTypeIdentifier, genericKeys: string[]) => GenericMappingResult;
|
|
8
9
|
export declare const replaceGenericKeysInType: (type: DataTypeIdentifier, genericMap: GenericMap) => DataTypeIdentifier;
|
|
9
10
|
export declare const resolveAllGenericKeysInDataTypeObject: (genericObj: DataType, concreteObj: DataType, genericKeys: string[]) => Record<string, GenericReplacement | undefined>;
|
|
@@ -12,5 +13,6 @@ export declare const resolveGenericKeys: (func: FunctionDefinitionView, values:
|
|
|
12
13
|
export declare function isMatchingDataTypeObject(source: DataType, target: DataType): boolean;
|
|
13
14
|
export declare function isMatchingType(source: DataTypeIdentifier, target: DataTypeIdentifier): boolean;
|
|
14
15
|
export declare const resolveType: (type: DataTypeIdentifier, service: DFlowDataTypeReactiveService) => DataTypeIdentifier;
|
|
16
|
+
export declare const targetForGenericKey: (func: FunctionDefinitionView, target: DataTypeIdentifier) => GenericTargetMap;
|
|
15
17
|
export declare const replaceGenericsAndSortType: (type: DataTypeIdentifier, genericKeys?: string[]) => DataTypeIdentifier;
|
|
16
18
|
export {};
|
package/dist/utils/generics.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
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,
|
|
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, K = (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) => {
|
|
2
2
|
if (e)
|
|
3
3
|
return typeof e == "string" ? e : e?.dataType?.identifier ?? e?.genericType?.dataType?.identifier ?? void 0;
|
|
4
4
|
}, j = (e, n) => {
|
|
5
5
|
if (e)
|
|
6
6
|
return typeof e == "string" ? n && n.has(e) ? e : void 0 : e.genericKey ?? void 0;
|
|
7
|
-
}, _ = (e) => !e || typeof e == "string" ? [] : e.genericType?.genericMappers ?? [],
|
|
7
|
+
}, _ = (e) => !e || typeof e == "string" ? [] : e.genericType?.genericMappers ?? [], P = (e, n) => ({
|
|
8
8
|
...e,
|
|
9
9
|
sourceDataTypeIdentifiers: n
|
|
10
|
-
}),
|
|
10
|
+
}), w = (e) => {
|
|
11
11
|
const n = e.genericCombinationStrategies ?? [];
|
|
12
12
|
return new Set(n.map((i) => i.type));
|
|
13
13
|
}, m = (e) => {
|
|
@@ -27,7 +27,7 @@ const C = "GENERIC", y = (e) => typeof e == "object" && e !== null && !Array.isA
|
|
|
27
27
|
if (n.genericKey) return !0;
|
|
28
28
|
const t = O(n), a = O(e);
|
|
29
29
|
return !!t && t === a;
|
|
30
|
-
},
|
|
30
|
+
}, R = (e, n) => {
|
|
31
31
|
switch (e.__typename) {
|
|
32
32
|
case "DataTypeRulesContainsKeyConfig":
|
|
33
33
|
case "DataTypeRulesContainsTypeConfig":
|
|
@@ -51,32 +51,32 @@ const C = "GENERIC", y = (e) => typeof e == "object" && e !== null && !Array.isA
|
|
|
51
51
|
default:
|
|
52
52
|
return e;
|
|
53
53
|
}
|
|
54
|
-
},
|
|
55
|
-
const t = {}, a = new Set(i),
|
|
54
|
+
}, z = (e, n, i) => {
|
|
55
|
+
const t = {}, a = new Set(i), o = (s, r) => {
|
|
56
56
|
if (!s || !r) return;
|
|
57
57
|
const f = j(s, a);
|
|
58
58
|
if (f && a.has(f)) {
|
|
59
59
|
T(r) && (t[f] = r);
|
|
60
60
|
return;
|
|
61
61
|
}
|
|
62
|
-
const
|
|
63
|
-
if (
|
|
62
|
+
const c = _(s);
|
|
63
|
+
if (c.length === 0) return;
|
|
64
64
|
const u = _(r);
|
|
65
|
-
for (const p of
|
|
65
|
+
for (const p of c) {
|
|
66
66
|
const l = u.find((g) => g.target === p.target);
|
|
67
67
|
if (!l) continue;
|
|
68
|
-
const d = (p.sourceDataTypeIdentifiers ?? []).map((g) => j(g, a)).filter((g) => !!g && a.has(g)),
|
|
69
|
-
if ((
|
|
68
|
+
const d = (p.sourceDataTypeIdentifiers ?? []).map((g) => j(g, a)).filter((g) => !!g && a.has(g)), h = w(p), D = l.sourceDataTypeIdentifiers ?? [];
|
|
69
|
+
if ((h.has("AND") || h.has("OR")) && D.length === 1 && d.length === (p.sourceDataTypeIdentifiers?.length ?? 0))
|
|
70
70
|
for (const g of d)
|
|
71
71
|
t[g] = D[0];
|
|
72
72
|
else {
|
|
73
73
|
const g = Math.min(p.sourceDataTypeIdentifiers?.length ?? 0, D.length);
|
|
74
|
-
for (let
|
|
75
|
-
|
|
74
|
+
for (let A = 0; A < g; A++)
|
|
75
|
+
o(p.sourceDataTypeIdentifiers[A], D[A]);
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
};
|
|
79
|
-
return
|
|
79
|
+
return o(e, n), t;
|
|
80
80
|
}, M = (e, n) => {
|
|
81
81
|
if (!T(e)) return e;
|
|
82
82
|
const {
|
|
@@ -84,21 +84,21 @@ const C = "GENERIC", y = (e) => typeof e == "object" && e !== null && !Array.isA
|
|
|
84
84
|
genericType: t
|
|
85
85
|
} = e;
|
|
86
86
|
if (i && n.has(i)) {
|
|
87
|
-
const
|
|
88
|
-
return
|
|
87
|
+
const o = n.get(i);
|
|
88
|
+
return o && T(o) ? o : e;
|
|
89
89
|
}
|
|
90
90
|
if (!t) return e;
|
|
91
|
-
const a = (t.genericMappers ?? []).map((
|
|
91
|
+
const a = (t.genericMappers ?? []).map((o) => {
|
|
92
92
|
const s = [];
|
|
93
|
-
for (const r of
|
|
93
|
+
for (const r of o.sourceDataTypeIdentifiers ?? []) {
|
|
94
94
|
if (!r) continue;
|
|
95
95
|
const f = r.genericKey;
|
|
96
96
|
if (f && n.has(f)) {
|
|
97
|
-
const
|
|
98
|
-
|
|
97
|
+
const c = n.get(f);
|
|
98
|
+
c && K(c) ? s.push(...c.sourceDataTypeIdentifiers) : c && T(c) ? s.push(c) : s.push(r);
|
|
99
99
|
} else T(r) ? s.push(M(r, n)) : s.push(r);
|
|
100
100
|
}
|
|
101
|
-
return
|
|
101
|
+
return P(o, s);
|
|
102
102
|
});
|
|
103
103
|
return {
|
|
104
104
|
...e,
|
|
@@ -108,52 +108,52 @@ const C = "GENERIC", y = (e) => typeof e == "object" && e !== null && !Array.isA
|
|
|
108
108
|
}
|
|
109
109
|
};
|
|
110
110
|
}, J = (e, n, i) => {
|
|
111
|
-
const t = {}, a = new Set(i),
|
|
111
|
+
const t = {}, a = new Set(i), o = (s, r, f) => {
|
|
112
112
|
if (!(!s || !r || a.size === 0)) {
|
|
113
113
|
if (T(s)) {
|
|
114
|
-
const
|
|
115
|
-
if (
|
|
114
|
+
const c = s.genericKey;
|
|
115
|
+
if (c && a.has(c) && (f ? t[c] = f : (K(r) || T(r)) && (t[c] = r), a.delete(c), a.size === 0))
|
|
116
116
|
return;
|
|
117
117
|
}
|
|
118
|
-
if (
|
|
119
|
-
const
|
|
120
|
-
for (let u = 0; u <
|
|
121
|
-
if (
|
|
118
|
+
if (K(s) && K(r)) {
|
|
119
|
+
const c = Math.min(s.sourceDataTypeIdentifiers?.length, r.sourceDataTypeIdentifiers?.length);
|
|
120
|
+
for (let u = 0; u < c; u++)
|
|
121
|
+
if (o(s.sourceDataTypeIdentifiers[u], r.sourceDataTypeIdentifiers[u], r), a.size === 0) return;
|
|
122
122
|
return;
|
|
123
123
|
}
|
|
124
124
|
if (E(s) && E(r)) {
|
|
125
|
-
const
|
|
125
|
+
const c = s.rules?.nodes ?? [], u = r.rules?.nodes ?? [], p = Math.min(c.length, u.length);
|
|
126
126
|
for (let l = 0; l < p; l++) {
|
|
127
|
-
const d =
|
|
128
|
-
if (!(!d || !
|
|
127
|
+
const d = c[l], h = u[l];
|
|
128
|
+
if (!(!d || !h) && (o(d, h), a.size === 0))
|
|
129
129
|
return;
|
|
130
130
|
}
|
|
131
131
|
return;
|
|
132
132
|
}
|
|
133
133
|
if (b(s) && b(r)) {
|
|
134
|
-
|
|
134
|
+
o(s.config, r.config);
|
|
135
135
|
return;
|
|
136
136
|
}
|
|
137
137
|
if (Array.isArray(s) && Array.isArray(r)) {
|
|
138
|
-
const
|
|
139
|
-
for (let u = 0; u <
|
|
140
|
-
if (
|
|
138
|
+
const c = Math.min(s.length, r.length);
|
|
139
|
+
for (let u = 0; u < c; u++)
|
|
140
|
+
if (o(s[u], r[u], f), a.size === 0) return;
|
|
141
141
|
return;
|
|
142
142
|
}
|
|
143
143
|
if (y(s) && y(r)) {
|
|
144
|
-
for (const
|
|
145
|
-
if (
|
|
144
|
+
for (const c of Object.keys(s))
|
|
145
|
+
if (c in r && c !== "__typename" && (o(s[c], r[c], f), a.size === 0))
|
|
146
146
|
return;
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
149
|
};
|
|
150
|
-
return
|
|
150
|
+
return o(e, n), t;
|
|
151
151
|
}, Y = (e, n) => {
|
|
152
152
|
const i = e.rules ? {
|
|
153
153
|
...e.rules,
|
|
154
154
|
nodes: e.rules.nodes?.map((t) => t && {
|
|
155
155
|
...t,
|
|
156
|
-
config:
|
|
156
|
+
config: R(t.config, n)
|
|
157
157
|
})
|
|
158
158
|
} : void 0;
|
|
159
159
|
return {
|
|
@@ -161,18 +161,18 @@ const C = "GENERIC", y = (e) => typeof e == "object" && e !== null && !Array.isA
|
|
|
161
161
|
rules: i
|
|
162
162
|
};
|
|
163
163
|
}, k = (e, n, i, t) => {
|
|
164
|
-
const a = /* @__PURE__ */ new Map(),
|
|
165
|
-
if (!e?.parameterDefinitions ||
|
|
166
|
-
const s = new Set(
|
|
164
|
+
const a = /* @__PURE__ */ new Map(), o = e?.genericKeys ?? [];
|
|
165
|
+
if (!e?.parameterDefinitions || o.length <= 0) return a;
|
|
166
|
+
const s = new Set(o);
|
|
167
167
|
return e.parameterDefinitions.forEach((r, f) => {
|
|
168
|
-
const
|
|
169
|
-
if (!
|
|
170
|
-
const l =
|
|
171
|
-
for (const [d,
|
|
172
|
-
s.has(d) && (a.has(d) || a.set(d,
|
|
168
|
+
const c = r.dataTypeIdentifier, u = n[f], p = i.getTypeFromValue(u, t);
|
|
169
|
+
if (!c || !p) return;
|
|
170
|
+
const l = z(c, p, o);
|
|
171
|
+
for (const [d, h] of Object.entries(l))
|
|
172
|
+
s.has(d) && (a.has(d) || a.set(d, h));
|
|
173
173
|
}), a;
|
|
174
174
|
};
|
|
175
|
-
function
|
|
175
|
+
function F(e, n) {
|
|
176
176
|
if (e.variant !== n.variant) return !1;
|
|
177
177
|
const i = n.rules?.nodes ?? [];
|
|
178
178
|
if (i.length === 0) return !0;
|
|
@@ -194,12 +194,12 @@ function x(e, n) {
|
|
|
194
194
|
return i.key !== t.key ? !1 : S(i.dataTypeIdentifier, t.dataTypeIdentifier);
|
|
195
195
|
}
|
|
196
196
|
case "INPUT_TYPES": {
|
|
197
|
-
const i = e.config, a = n.config.inputTypes ?? [],
|
|
198
|
-
return a.every((s) =>
|
|
197
|
+
const i = e.config, a = n.config.inputTypes ?? [], o = i.inputTypes ?? [];
|
|
198
|
+
return a.every((s) => o.some((r) => S(r.dataTypeIdentifier, s.dataTypeIdentifier)));
|
|
199
199
|
}
|
|
200
200
|
case "ITEM_OF_COLLECTION": {
|
|
201
201
|
const i = e.config.items ?? [], t = n.config.items ?? [];
|
|
202
|
-
return i.length !== t.length ? !1 : i.every((a,
|
|
202
|
+
return i.length !== t.length ? !1 : i.every((a, o) => a === t[o]);
|
|
203
203
|
}
|
|
204
204
|
case "NUMBER_RANGE": {
|
|
205
205
|
const i = e.config, t = n.config;
|
|
@@ -213,11 +213,11 @@ function x(e, n) {
|
|
|
213
213
|
return JSON.stringify(m(e.config)) === JSON.stringify(m(n.config));
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
|
-
function
|
|
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,
|
|
218
|
-
return t(a,
|
|
216
|
+
function L(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, c) => t(f, r[c])) : y(r) ? y(s) ? Object.keys(r).every((c) => t(s[c], r[c])) : !1 : s === r, a = m(e), o = m(n);
|
|
218
|
+
return t(a, o);
|
|
219
219
|
}
|
|
220
|
-
const
|
|
220
|
+
const G = (e, n) => {
|
|
221
221
|
if (typeof e == "string") {
|
|
222
222
|
const t = n.getDataType(e);
|
|
223
223
|
if (!t) return e;
|
|
@@ -232,7 +232,7 @@ const P = (e, n) => {
|
|
|
232
232
|
dataType: t.json,
|
|
233
233
|
genericMappers: [{
|
|
234
234
|
target: r,
|
|
235
|
-
sourceDataTypeIdentifiers: [
|
|
235
|
+
sourceDataTypeIdentifiers: [G(s, n)]
|
|
236
236
|
}]
|
|
237
237
|
}
|
|
238
238
|
} : e;
|
|
@@ -243,7 +243,7 @@ const P = (e, n) => {
|
|
|
243
243
|
if (!T(e) || !e.genericType) return e;
|
|
244
244
|
const i = e.genericType.genericMappers?.map((t) => ({
|
|
245
245
|
...t,
|
|
246
|
-
sourceDataTypeIdentifiers: t?.sourceDataTypeIdentifiers?.map((a) =>
|
|
246
|
+
sourceDataTypeIdentifiers: t?.sourceDataTypeIdentifiers?.map((a) => G(a, n))
|
|
247
247
|
})) ?? [];
|
|
248
248
|
return {
|
|
249
249
|
...e,
|
|
@@ -252,59 +252,72 @@ const P = (e, n) => {
|
|
|
252
252
|
genericMappers: i
|
|
253
253
|
}
|
|
254
254
|
};
|
|
255
|
-
},
|
|
255
|
+
}, I = (e) => {
|
|
256
256
|
if (Array.isArray(e)) {
|
|
257
|
-
const n = e.map(
|
|
258
|
-
return n.length <= 1 ? n : n.every(y) ? [...n].sort((a,
|
|
257
|
+
const n = e.map(I);
|
|
258
|
+
return n.length <= 1 ? n : n.every(y) ? [...n].sort((a, o) => JSON.stringify(a).localeCompare(JSON.stringify(o))) : n.every((a) => !Array.isArray(a) && !y(a)) ? [...n].sort((a, o) => JSON.stringify(a).localeCompare(JSON.stringify(o))) : n;
|
|
259
259
|
}
|
|
260
260
|
if (y(e)) {
|
|
261
261
|
const n = e;
|
|
262
|
-
return Object.keys(n).sort().reduce((i, t) => (i[t] =
|
|
262
|
+
return Object.keys(n).sort().reduce((i, t) => (i[t] = I(n[t]), i), {});
|
|
263
263
|
}
|
|
264
264
|
return e;
|
|
265
|
-
},
|
|
265
|
+
}, V = (e, n) => {
|
|
266
|
+
if (!n.genericType) return /* @__PURE__ */ new Map();
|
|
267
|
+
const i = new Set(e.genericKeys ?? []), t = /* @__PURE__ */ new Map();
|
|
268
|
+
for (const a of n.genericType.genericMappers ?? []) {
|
|
269
|
+
const o = a.target;
|
|
270
|
+
if (!i.has(o))
|
|
271
|
+
for (const s of a.sourceDataTypeIdentifiers ?? []) {
|
|
272
|
+
const r = s.genericKey;
|
|
273
|
+
r && i.has(r) && t.set(r, o);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
return t;
|
|
277
|
+
}, U = (e, n = []) => {
|
|
266
278
|
const i = new Set(n), t = (r) => r ? i.size === 0 ? !0 : i.has(r) : !1, a = (r) => {
|
|
267
|
-
const
|
|
268
|
-
return
|
|
279
|
+
const c = t(r.target) ? C : r.target, u = (r.sourceDataTypeIdentifiers ?? []).map((p) => s(p));
|
|
280
|
+
return I({
|
|
269
281
|
...r,
|
|
270
|
-
target:
|
|
282
|
+
target: c,
|
|
271
283
|
sourceDataTypeIdentifiers: u
|
|
272
284
|
});
|
|
273
|
-
},
|
|
274
|
-
const
|
|
285
|
+
}, o = (r) => {
|
|
286
|
+
const c = t(r.genericKey) ? C : r.genericKey, u = {
|
|
275
287
|
...r,
|
|
276
|
-
genericKey:
|
|
288
|
+
genericKey: c,
|
|
277
289
|
dataType: r.dataType ? s(r.dataType) : r.dataType,
|
|
278
290
|
genericType: r.genericType ? s(r.genericType) : r.genericType
|
|
279
291
|
};
|
|
280
|
-
return
|
|
292
|
+
return I(u);
|
|
281
293
|
};
|
|
282
294
|
function s(r) {
|
|
283
295
|
if (r == null) return r;
|
|
284
296
|
if (Array.isArray(r)) {
|
|
285
|
-
const f = r.map((
|
|
286
|
-
return
|
|
297
|
+
const f = r.map((c) => s(c));
|
|
298
|
+
return I(f);
|
|
287
299
|
}
|
|
288
300
|
if (T(r))
|
|
289
|
-
return
|
|
290
|
-
if (
|
|
301
|
+
return o(r);
|
|
302
|
+
if (K(r))
|
|
291
303
|
return a(r);
|
|
292
304
|
if (y(r)) {
|
|
293
|
-
const f = Object.entries(r).reduce((
|
|
294
|
-
return
|
|
305
|
+
const f = Object.entries(r).reduce((c, [u, p]) => (c[u] = s(p), c), {});
|
|
306
|
+
return I(f);
|
|
295
307
|
}
|
|
296
308
|
return r;
|
|
297
309
|
}
|
|
298
310
|
return s(e);
|
|
299
311
|
};
|
|
300
312
|
export {
|
|
301
|
-
|
|
302
|
-
|
|
313
|
+
F as isMatchingDataTypeObject,
|
|
314
|
+
L as isMatchingType,
|
|
303
315
|
Y as replaceGenericKeysInDataTypeObject,
|
|
304
316
|
M as replaceGenericKeysInType,
|
|
305
|
-
|
|
317
|
+
U as replaceGenericsAndSortType,
|
|
306
318
|
J as resolveAllGenericKeysInDataTypeObject,
|
|
307
|
-
|
|
319
|
+
z as resolveGenericKeyMappings,
|
|
308
320
|
k as resolveGenericKeys,
|
|
309
|
-
|
|
321
|
+
G as resolveType,
|
|
322
|
+
V as targetForGenericKey
|
|
310
323
|
};
|
package/dist/utils/index.js
CHANGED
|
@@ -1,28 +1,29 @@
|
|
|
1
|
-
import { ContextStore as
|
|
2
|
-
import { InspectionSeverity as v } from "./inspection.js";
|
|
3
|
-
import { NonReactiveArrayService as
|
|
4
|
-
import { ObjectService as
|
|
5
|
-
import { ReactiveArrayService as
|
|
6
|
-
import { Colors as
|
|
7
|
-
import { getChild as P, getContent as
|
|
1
|
+
import { ContextStore as t, ContextStoreProvider as o, useService as i, useStore as n } from "./contextStore.js";
|
|
2
|
+
import { InspectionSeverity as v, underlineBySeverity as a } from "./inspection.js";
|
|
3
|
+
import { NonReactiveArrayService as p, createNonReactiveArrayService as s } from "./nonReactiveArrayService.js";
|
|
4
|
+
import { ObjectService as x, createObjectService as m } from "./objectStore.js";
|
|
5
|
+
import { ReactiveArrayService as y, useReactiveArrayService as d } from "./reactiveArrayService.js";
|
|
6
|
+
import { Colors as u } from "./types.js";
|
|
7
|
+
import { getChild as P, getContent as R, getPositionAroundTarget as l, getPositioning as b, getWindowPositioning as j, mergeCode0Props as N, parseUnit as O } from "./utils.js";
|
|
8
8
|
export {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
u as Colors,
|
|
10
|
+
t as ContextStore,
|
|
11
|
+
o as ContextStoreProvider,
|
|
12
12
|
v as InspectionSeverity,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
p as NonReactiveArrayService,
|
|
14
|
+
x as ObjectService,
|
|
15
|
+
y as ReactiveArrayService,
|
|
16
|
+
s as createNonReactiveArrayService,
|
|
17
|
+
m as createObjectService,
|
|
18
18
|
P as getChild,
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
R as getContent,
|
|
20
|
+
l as getPositionAroundTarget,
|
|
21
21
|
b as getPositioning,
|
|
22
22
|
j as getWindowPositioning,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
N as mergeCode0Props,
|
|
24
|
+
O as parseUnit,
|
|
25
|
+
a as underlineBySeverity,
|
|
26
|
+
d as useReactiveArrayService,
|
|
26
27
|
i as useService,
|
|
27
|
-
|
|
28
|
+
n as useStore
|
|
28
29
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Maybe, Scalars,
|
|
1
|
+
import { Maybe, Scalars, Translation } from '@code0-tech/sagittarius-graphql-types';
|
|
2
|
+
import { CSSProperties } from 'react';
|
|
2
3
|
export declare enum InspectionSeverity {
|
|
3
4
|
TYPO = 0,
|
|
4
5
|
GRAMMAR = 1,
|
|
@@ -9,5 +10,6 @@ export declare enum InspectionSeverity {
|
|
|
9
10
|
export interface ValidationResult {
|
|
10
11
|
parameterId: Maybe<Scalars["ParameterDefinitionID"]["output"]>;
|
|
11
12
|
type: InspectionSeverity;
|
|
12
|
-
message:
|
|
13
|
+
message: Array<Translation>;
|
|
13
14
|
}
|
|
15
|
+
export declare const underlineBySeverity: Record<InspectionSeverity, CSSProperties>;
|
package/dist/utils/inspection.js
CHANGED
|
@@ -1,4 +1,29 @@
|
|
|
1
|
-
var
|
|
1
|
+
var r = /* @__PURE__ */ ((d) => (d[d.TYPO = 0] = "TYPO", d[d.GRAMMAR = 1] = "GRAMMAR", d[d.WEAK = 2] = "WEAK", d[d.WARNING = 3] = "WARNING", d[d.ERROR = 4] = "ERROR", d))(r || {});
|
|
2
|
+
const o = (d, a = "5px 4px") => ({
|
|
3
|
+
paddingBottom: "0.2rem",
|
|
4
|
+
backgroundRepeat: "repeat-x",
|
|
5
|
+
backgroundPosition: "left bottom",
|
|
6
|
+
backgroundSize: a,
|
|
7
|
+
backgroundImage: `url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='6' viewBox='0 0 12 6'> <path d='M0 3 Q3 0 6 3 T12 3' fill='none' stroke='${d}' stroke-width='2'/></svg>")`
|
|
8
|
+
}), g = {
|
|
9
|
+
0: {
|
|
10
|
+
borderBottom: "1px dotted #3b82f6"
|
|
11
|
+
// blue
|
|
12
|
+
},
|
|
13
|
+
1: {
|
|
14
|
+
borderBottom: "1px dashed #8b5cf6"
|
|
15
|
+
// violet
|
|
16
|
+
},
|
|
17
|
+
2: {
|
|
18
|
+
borderBottom: "3px double #9ca3af"
|
|
19
|
+
// gray
|
|
20
|
+
},
|
|
21
|
+
3: o("orange"),
|
|
22
|
+
// amber
|
|
23
|
+
4: o("red")
|
|
24
|
+
// already yours
|
|
25
|
+
};
|
|
2
26
|
export {
|
|
3
|
-
|
|
27
|
+
r as InspectionSeverity,
|
|
28
|
+
g as underlineBySeverity
|
|
4
29
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@code0-tech/pictor",
|
|
3
|
-
"version": "0.0.0-mvp.
|
|
3
|
+
"version": "0.0.0-mvp.30",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A simple template for a custom React component library",
|
|
6
6
|
"scripts": {
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"@ariakit/react": "^0.4.17",
|
|
21
21
|
"@babel/plugin-proposal-decorators": "^7.28.0",
|
|
22
22
|
"@babel/plugin-transform-class-properties": "^7.27.1",
|
|
23
|
-
"@code0-tech/sagittarius-graphql-types": "^0.0.0-
|
|
23
|
+
"@code0-tech/sagittarius-graphql-types": "^0.0.0-a2b1f5e9adf8f52b5a0f235ca9906ac5a699b4fc",
|
|
24
24
|
"@dagrejs/dagre": "^2.0.0",
|
|
25
25
|
"@mdx-js/react": "^3.1.1",
|
|
26
26
|
"@radix-ui/react-checkbox": "^1.3.3",
|
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
"@tabler/icons-react": "3.35.0",
|
|
48
48
|
"@types/jest-image-snapshot": "^6.4.0",
|
|
49
49
|
"@types/react": "^19.2.7",
|
|
50
|
+
"@types/react-dom": "^19.2.3",
|
|
50
51
|
"@vitejs/plugin-react": "^5.1.1",
|
|
51
52
|
"@vitest/browser-playwright": "^4.0.14",
|
|
52
53
|
"@vitest/coverage-v8": "^4.0.14",
|
|
@@ -64,9 +65,9 @@
|
|
|
64
65
|
"merge-props": "^6.0.0",
|
|
65
66
|
"overlap-area": "^1.1.0",
|
|
66
67
|
"playwright": "1.57.0",
|
|
67
|
-
"react": "^19.2.
|
|
68
|
-
"react-dom": "^19.2.
|
|
69
|
-
"react-resizable-panels": "^3.
|
|
68
|
+
"react": "^19.2.3",
|
|
69
|
+
"react-dom": "^19.2.3",
|
|
70
|
+
"react-resizable-panels": "^4.3.1",
|
|
70
71
|
"react-zoom-pan-pinch": "^3.7.0",
|
|
71
72
|
"rimraf": "^6.1.2",
|
|
72
73
|
"sass": "^1.94.2",
|
|
@@ -93,7 +94,7 @@
|
|
|
93
94
|
"types": "dist/index.d.ts",
|
|
94
95
|
"peerDependencies": {
|
|
95
96
|
"@ariakit/react": "^0.4.5",
|
|
96
|
-
"@code0-tech/sagittarius-graphql-types": "^0.0.0-
|
|
97
|
+
"@code0-tech/sagittarius-graphql-types": "^0.0.0-a2b1f5e9adf8f52b5a0f235ca9906ac5a699b4fc",
|
|
97
98
|
"@radix-ui/react-checkbox": "^1.3.2",
|
|
98
99
|
"@radix-ui/react-dialog": "^1.1.14",
|
|
99
100
|
"@radix-ui/react-dropdown-menu": "^2.1.15",
|
|
@@ -111,7 +112,7 @@
|
|
|
111
112
|
"overlap-area": "^1.1.0",
|
|
112
113
|
"react": "^18.0.0 || ^19.0.0",
|
|
113
114
|
"react-dom": "^18.0.0 || ^19.0.0",
|
|
114
|
-
"react-resizable-panels": "^3.0.3",
|
|
115
|
+
"react-resizable-panels": "^3.0.3 || ^4.0.0",
|
|
115
116
|
"react-zoom-pan-pinch": "^3.6.1",
|
|
116
117
|
"sonner": "^2.0.7"
|
|
117
118
|
},
|
|
@@ -119,6 +120,7 @@
|
|
|
119
120
|
"access": "public"
|
|
120
121
|
},
|
|
121
122
|
"dependencies": {
|
|
122
|
-
"@radix-ui/react-context-menu": "^2.2.16"
|
|
123
|
+
"@radix-ui/react-context-menu": "^2.2.16",
|
|
124
|
+
"react-contenteditable": "^3.3.7"
|
|
123
125
|
}
|
|
124
126
|
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { RefObject } from 'react';
|
|
2
|
-
import { ResolvedVisualSelectionRange } from './InputSyntax';
|
|
3
|
-
import { VisualizedInputSyntaxSegment } from './Input.syntax.hook';
|
|
4
|
-
import { InputSuggestion } from './InputSuggestion';
|
|
5
|
-
export declare const useSelectionVisibility: (inputRef: RefObject<HTMLInputElement | null>, syntaxRef: RefObject<HTMLDivElement | null>) => {
|
|
6
|
-
ensureVisualIndexVisible: (visualIndex: number | null) => void;
|
|
7
|
-
syncSyntaxScroll: () => void;
|
|
8
|
-
};
|
|
9
|
-
export declare const useSelectionNormalization: (transformSyntax: ((value: any, appliedSyntaxParts?: (InputSuggestion | any)[]) => any) | undefined, expandSelectionRangeToBlockBoundaries: (rawStart: number, rawEnd: number) => {
|
|
10
|
-
start: number;
|
|
11
|
-
end: number;
|
|
12
|
-
hasBlockOverlap: boolean;
|
|
13
|
-
}) => (target: HTMLInputElement) => void;
|
|
14
|
-
export declare const useSelectionResolution: (transformSyntax: ((value: any, appliedSyntaxParts?: (InputSuggestion | any)[]) => any) | undefined, inputRef: RefObject<HTMLInputElement>, visualSelectionRange: {
|
|
15
|
-
start: number;
|
|
16
|
-
end: number;
|
|
17
|
-
} | null, visualizedSyntaxSegments: VisualizedInputSyntaxSegment[], mapRawIndexToVisualIndex: (rawIndex: number) => number) => ResolvedVisualSelectionRange;
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { c as M } from "../../_virtual/compiler-runtime.js";
|
|
2
|
-
import _ from "react";
|
|
3
|
-
import { useSyncSyntaxScroll as p, getSelectionMetrics as L, setSelectionRangeSafe as $ } from "./Input.utils.js";
|
|
4
|
-
const A = (r, n) => {
|
|
5
|
-
const t = M.c(6);
|
|
6
|
-
let s;
|
|
7
|
-
t[0] !== r || t[1] !== n ? (s = (u) => {
|
|
8
|
-
if (u === null || !r.current || !n.current)
|
|
9
|
-
return;
|
|
10
|
-
const e = n.current, c = Math.round(u), m = e.querySelector(`[data-visual-index="${c}"]`);
|
|
11
|
-
let f = null, i = null;
|
|
12
|
-
if (m)
|
|
13
|
-
f = m.offsetLeft, i = m.offsetLeft + m.offsetWidth;
|
|
14
|
-
else {
|
|
15
|
-
const E = Array.from(e.querySelectorAll("[data-visual-start][data-visual-end]")).find((d) => {
|
|
16
|
-
const v = Number(d.dataset.visualStart), b = Number(d.dataset.visualEnd);
|
|
17
|
-
return Number.isFinite(v) && Number.isFinite(b) && c >= v && c <= b;
|
|
18
|
-
});
|
|
19
|
-
if (E) {
|
|
20
|
-
const d = Number(E.dataset.visualStart) || 0, v = Number(E.dataset.visualEnd) || d, b = E.offsetWidth, W = v === d ? 0 : (c - d) / (v - d);
|
|
21
|
-
f = E.offsetLeft + b * W, i = f;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
if (f === null || i === null)
|
|
25
|
-
return;
|
|
26
|
-
const S = e.scrollLeft, N = S + e.clientWidth;
|
|
27
|
-
let h = S;
|
|
28
|
-
f - 8 < S ? h = Math.max(f - 8, 0) : i + 8 > N && (h = Math.max(i + 8 - e.clientWidth, 0)), h !== S && (r.current.scrollLeft = h, e.scrollLeft = h);
|
|
29
|
-
}, t[0] = r, t[1] = n, t[2] = s) : s = t[2];
|
|
30
|
-
const o = s, a = p(r, n);
|
|
31
|
-
let l;
|
|
32
|
-
return t[3] !== o || t[4] !== a ? (l = {
|
|
33
|
-
ensureVisualIndexVisible: o,
|
|
34
|
-
syncSyntaxScroll: a
|
|
35
|
-
}, t[3] = o, t[4] = a, t[5] = l) : l = t[5], l;
|
|
36
|
-
}, F = (r, n) => {
|
|
37
|
-
const t = M.c(3);
|
|
38
|
-
let s;
|
|
39
|
-
return t[0] !== n || t[1] !== r ? (s = (o) => {
|
|
40
|
-
if (!r)
|
|
41
|
-
return;
|
|
42
|
-
const {
|
|
43
|
-
selectionStart: a,
|
|
44
|
-
selectionEnd: l
|
|
45
|
-
} = L(o);
|
|
46
|
-
if (a === l)
|
|
47
|
-
return;
|
|
48
|
-
const {
|
|
49
|
-
start: u,
|
|
50
|
-
end: e,
|
|
51
|
-
hasBlockOverlap: c
|
|
52
|
-
} = n(a, l);
|
|
53
|
-
c && (u === a && e === l || $(o, u, e));
|
|
54
|
-
}, t[0] = n, t[1] = r, t[2] = s) : s = t[2], s;
|
|
55
|
-
}, O = (r, n, t, s, o) => _.useMemo(() => {
|
|
56
|
-
if (!r) return null;
|
|
57
|
-
const a = n.current;
|
|
58
|
-
if (!a) return t;
|
|
59
|
-
const {
|
|
60
|
-
rawStart: l,
|
|
61
|
-
rawEnd: u
|
|
62
|
-
} = L(a);
|
|
63
|
-
if (l === u) return null;
|
|
64
|
-
let e = o(l), c = o(u);
|
|
65
|
-
s.forEach((i) => {
|
|
66
|
-
i.type !== "block" || !(l < i.end && u > i.start) || (e = Math.min(e, i.visualStart), c = Math.max(c, i.visualEnd));
|
|
67
|
-
});
|
|
68
|
-
const m = Math.min(e, c), f = Math.max(e, c);
|
|
69
|
-
return {
|
|
70
|
-
start: m,
|
|
71
|
-
end: f
|
|
72
|
-
};
|
|
73
|
-
}, [n, o, r, t, s]);
|
|
74
|
-
export {
|
|
75
|
-
F as useSelectionNormalization,
|
|
76
|
-
O as useSelectionResolution,
|
|
77
|
-
A as useSelectionVisibility
|
|
78
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
import { VisualizedInputSyntaxSegment } from './Input.syntax.hook';
|
|
3
|
-
import { InputSuggestion } from './InputSuggestion';
|
|
4
|
-
export type ResolvedVisualSelectionRange = {
|
|
5
|
-
start: number;
|
|
6
|
-
end: number;
|
|
7
|
-
} | null;
|
|
8
|
-
export interface InputSyntaxProps {
|
|
9
|
-
transformSyntax?: ((value: any, appliedSyntaxParts?: (InputSuggestion | any)[]) => any);
|
|
10
|
-
syntaxRef: React.RefObject<HTMLDivElement | null>;
|
|
11
|
-
visualizedSyntaxSegments: VisualizedInputSyntaxSegment[];
|
|
12
|
-
resolvedVisualSelectionRange: ResolvedVisualSelectionRange;
|
|
13
|
-
visualCaretIndex: number | null;
|
|
14
|
-
isFocused: boolean;
|
|
15
|
-
onPointerDown: (event: React.PointerEvent<HTMLDivElement>) => void;
|
|
16
|
-
onPointerMove: (event: React.PointerEvent<HTMLDivElement>) => void;
|
|
17
|
-
onPointerUp: (event: React.PointerEvent<HTMLDivElement>) => void;
|
|
18
|
-
}
|
|
19
|
-
export declare const InputSyntax: React.FC<InputSyntaxProps>;
|