@code0-tech/pictor 0.0.0-mvp.40 → 0.0.0-mvp.42

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.
Files changed (56) hide show
  1. package/dist/assets/components/data-table/DataTable.style.css +1 -0
  2. package/dist/assets/components/menu/Menu.style.css +1 -1
  3. package/dist/components/d-flow/DFlow.service.js +80 -100
  4. package/dist/components/d-flow-data-type/DFlowDataType.service.js +6 -7
  5. package/dist/components/d-flow-data-type/rules/DFlowDataTypeContainsKeyRule.d.ts +1 -1
  6. package/dist/components/d-flow-data-type/rules/DFlowDataTypeContainsKeyRule.js +15 -15
  7. package/dist/components/d-flow-data-type/rules/DFlowDataTypeContainsTypeRule.d.ts +1 -1
  8. package/dist/components/d-flow-data-type/rules/DFlowDataTypeContainsTypeRule.js +17 -17
  9. package/dist/components/d-flow-data-type/rules/DFlowDataTypeParentRule.d.ts +1 -1
  10. package/dist/components/d-flow-data-type/rules/DFlowDataTypeParentRule.js +1 -1
  11. package/dist/components/d-flow-data-type/rules/DFlowDataTypeReturnTypeRule.d.ts +2 -1
  12. package/dist/components/d-flow-data-type/rules/DFlowDataTypeReturnTypeRule.js +87 -85
  13. package/dist/components/d-flow-data-type/rules/DFlowDataTypeRule.d.ts +2 -1
  14. package/dist/components/d-flow-function/DFlowFunction.input.hook.d.ts +2 -1
  15. package/dist/components/d-flow-function/DFlowFunction.input.hook.js +5 -5
  16. package/dist/components/d-flow-function/DFlowFunction.return.hook.d.ts +2 -1
  17. package/dist/components/d-flow-function/DFlowFunction.return.hook.js +5 -5
  18. package/dist/components/d-flow-input/DFlowInputDataTypeEditDialog.js +1 -1
  19. package/dist/components/d-flow-input/DFlowInputReferenceBadge.js +17 -17
  20. package/dist/components/d-flow-node/DFlowNode.return.hook.d.ts +5 -0
  21. package/dist/components/d-flow-node/DFlowNode.return.hook.js +27 -0
  22. package/dist/components/d-flow-suggestion/DFlowReferenceSuggestions.hook.js +90 -91
  23. package/dist/components/d-flow-validation/DDataTypeValidation.hook.js +1 -1
  24. package/dist/components/d-flow-validation/DNodeValidation.hook.js +33 -33
  25. package/dist/components/d-flow-validation/DValueValidation.hook.d.ts +2 -1
  26. package/dist/components/d-flow-validation/DValueValidation.hook.js +5 -5
  27. package/dist/components/d-project/DNamespaceProject.service.d.ts +2 -1
  28. package/dist/components/data-table/DataTable.d.ts +23 -0
  29. package/dist/components/data-table/DataTable.js +41 -0
  30. package/dist/components/data-table/DataTableColumn.d.ts +6 -0
  31. package/dist/components/data-table/DataTableColumn.js +22 -0
  32. package/dist/components/data-table/DataTableFilterInput.d.ts +18 -0
  33. package/dist/components/data-table/DataTableFilterInput.js +210 -0
  34. package/dist/components/data-table/DataTableFilterSuggestionMenu.d.ts +7 -0
  35. package/dist/components/data-table/DataTableFilterSuggestionMenu.js +53 -0
  36. package/dist/components/data-table/index.d.ts +4 -0
  37. package/dist/components/data-table/index.js +11 -0
  38. package/dist/components/editor/Editor.d.ts +9 -3
  39. package/dist/components/editor/Editor.js +249 -174
  40. package/dist/components/menu/Menu.d.ts +5 -1
  41. package/dist/components/menu/Menu.js +73 -57
  42. package/dist/index.d.ts +1 -0
  43. package/dist/index.js +182 -171
  44. package/dist/node_modules/@lezer/highlight/dist/index.js +132 -169
  45. package/dist/utils/generics.d.ts +2 -1
  46. package/dist/utils/generics.js +84 -80
  47. package/package.json +32 -21
  48. package/dist/node_modules/@codemirror/language/dist/index.js +0 -429
  49. package/dist/node_modules/@codemirror/lint/dist/index.js +0 -515
  50. package/dist/node_modules/@codemirror/state/dist/index.js +0 -2614
  51. package/dist/node_modules/@codemirror/view/dist/index.js +0 -6227
  52. package/dist/node_modules/@lezer/common/dist/index.js +0 -1357
  53. package/dist/node_modules/@marijn/find-cluster-break/src/index.js +0 -69
  54. package/dist/node_modules/crelt/index.js +0 -27
  55. package/dist/node_modules/style-mod/src/style-mod.js +0 -109
  56. package/dist/node_modules/w3c-keyname/index.js +0 -88
@@ -1,59 +1,59 @@
1
- import { jsxs as n, jsx as r } from "react/jsx-runtime";
2
- import m from "react";
3
- import { createPortal as U } from "react-dom";
1
+ import { jsxs as s, jsx as t } from "react/jsx-runtime";
2
+ import m, { isValidElement as ce } from "react";
3
+ import { createPortal as H } from "react-dom";
4
4
  import "../../utils/contextStore.js";
5
- import { mergeCode0Props as X } from "../../utils/utils.js";
6
- import Y, { Prec as Z, keymap as $, ViewPlugin as ee, RangeSetBuilder as re, Decoration as E, EditorView as te, WidgetType as ie } from "@uiw/react-codemirror";
7
- import { json as ne, jsonParseLinter as oe } from "@codemirror/lang-json";
8
- import { linter as se } from "../../node_modules/@codemirror/lint/dist/index.js";
9
- import { syntaxTree as ae } from "../../node_modules/@codemirror/language/dist/index.js";
10
- import le from "../../node_modules/prettier/standalone.js";
11
- import ce from "../../node_modules/prettier/plugins/babel.js";
12
- import de from "../../node_modules/prettier/plugins/estree.js";
13
- import { createTheme as he } from "@uiw/codemirror-themes";
14
- import { tags as p, getStyleTags as ue } from "../../node_modules/@lezer/highlight/dist/index.js";
15
- import { hashToColor as f } from "../d-flow/DFlow.util.js";
5
+ import { mergeCode0Props as ue } from "../../utils/utils.js";
6
+ import de, { Prec as J, keymap as K, ViewPlugin as me, RangeSetBuilder as he, Decoration as F, EditorView as fe, WidgetType as ge } from "@uiw/react-codemirror";
7
+ import { json as pe, jsonParseLinter as ye } from "@codemirror/lang-json";
8
+ import { syntaxTree as L } from "@codemirror/language";
9
+ import { linter as be } from "@codemirror/lint";
10
+ import ve from "../../node_modules/prettier/standalone.js";
11
+ import we from "../../node_modules/prettier/plugins/babel.js";
12
+ import Se from "../../node_modules/prettier/plugins/estree.js";
13
+ import { createTheme as Ce } from "@uiw/codemirror-themes";
14
+ import { tags as b, getStyleTags as Te } from "../../node_modules/@lezer/highlight/dist/index.js";
15
+ import { hashToColor as v } from "../d-flow/DFlow.util.js";
16
16
  import '../../assets/components/editor/Editor.styles.css';/* empty css */
17
- import { Badge as g } from "../badge/Badge.js";
18
- import { IconExclamationCircle as me, IconAlertTriangle as ge, IconAlertSquareRounded as pe, IconInfoCircle as fe, IconSpace as ye, IconArrowBarToRight as be, IconCornerDownLeft as ve } from "@tabler/icons-react";
19
- import { Text as s } from "../text/Text.js";
20
- import { Flex as v } from "../flex/Flex.js";
21
- import { Tooltip as w, TooltipTrigger as x, TooltipPortal as T, TooltipContent as C, TooltipArrow as S } from "../tooltip/Tooltip.js";
22
- import { ScrollArea as we, ScrollAreaViewport as xe, ScrollAreaScrollbar as B, ScrollAreaThumb as M } from "../scroll-area/ScrollArea.js";
23
- import { autocompletion as Te, acceptCompletion as Ce } from "@codemirror/autocomplete";
24
- function Se(o, t, c) {
25
- return (t = Ae(t)) in o ? Object.defineProperty(o, t, { value: c, enumerable: !0, configurable: !0, writable: !0 }) : o[t] = c, o;
17
+ import { Badge as y } from "../badge/Badge.js";
18
+ import { IconExclamationCircle as xe, IconAlertTriangle as Ae, IconAlertSquareRounded as ke, IconInfoCircle as Ee, IconSpace as ze, IconArrowBarToRight as Pe, IconCornerDownLeft as je } from "@tabler/icons-react";
19
+ import { Text as a } from "../text/Text.js";
20
+ import { Flex as k } from "../flex/Flex.js";
21
+ import { Tooltip as E, TooltipTrigger as z, TooltipPortal as P, TooltipContent as j, TooltipArrow as V } from "../tooltip/Tooltip.js";
22
+ import { ScrollArea as Ve, ScrollAreaViewport as Ne, ScrollAreaScrollbar as G, ScrollAreaThumb as Q } from "../scroll-area/ScrollArea.js";
23
+ import { autocompletion as Ie, acceptCompletion as Re, startCompletion as N } from "@codemirror/autocomplete";
24
+ function Be(i, r, h) {
25
+ return (r = Me(r)) in i ? Object.defineProperty(i, r, { value: h, enumerable: !0, configurable: !0, writable: !0 }) : i[r] = h, i;
26
26
  }
27
- function Ae(o) {
28
- var t = ke(o, "string");
29
- return typeof t == "symbol" ? t : t + "";
27
+ function Me(i) {
28
+ var r = qe(i, "string");
29
+ return typeof r == "symbol" ? r : r + "";
30
30
  }
31
- function ke(o, t) {
32
- if (typeof o != "object" || !o) return o;
33
- var c = o[Symbol.toPrimitive];
34
- if (c !== void 0) {
35
- var d = c.call(o, t);
36
- if (typeof d != "object") return d;
31
+ function qe(i, r) {
32
+ if (typeof i != "object" || !i) return i;
33
+ var h = i[Symbol.toPrimitive];
34
+ if (h !== void 0) {
35
+ var g = h.call(i, r);
36
+ if (typeof g != "object") return g;
37
37
  throw new TypeError("@@toPrimitive must return a primitive value.");
38
38
  }
39
- return (t === "string" ? String : Number)(o);
39
+ return (r === "string" ? String : Number)(i);
40
40
  }
41
- class R extends ie {
42
- constructor(t, c) {
43
- super(), this.type = t, this.rawValue = c;
41
+ class X extends ge {
42
+ constructor(r, h) {
43
+ super(), this.type = r, this.rawValue = h;
44
44
  }
45
45
  toDOM() {
46
- const t = document.createElement("span");
47
- return t.className = "cm-react-anchor", t.dataset.type = this.type, t.dataset.value = this.rawValue, t.contentEditable = "false", t.style.pointerEvents = "none", t.style.verticalAlign = "middle", t.style.display = "inline-block", t;
46
+ const r = document.createElement("span");
47
+ return r.className = "cm-react-anchor", r.dataset.type = this.type, r.dataset.value = this.rawValue, r.contentEditable = "false", r.style.pointerEvents = "none", r.style.verticalAlign = "middle", r.style.display = "inline-block", r;
48
48
  }
49
49
  ignoreEvent() {
50
50
  return !0;
51
51
  }
52
- eq(t) {
53
- return t.type === this.type && t.rawValue === this.rawValue;
52
+ eq(r) {
53
+ return r.type === this.type && r.rawValue === this.rawValue;
54
54
  }
55
55
  }
56
- const ze = he({
56
+ const Fe = Ce({
57
57
  theme: "light",
58
58
  settings: {
59
59
  background: "transparent",
@@ -70,194 +70,269 @@ const ze = he({
70
70
  lineHighlight: "rgba(255,255,255, 0.1)"
71
71
  },
72
72
  styles: [{
73
- tag: p.squareBracket,
74
- color: f("squareBracket")
73
+ tag: b.squareBracket,
74
+ color: v("squareBracket")
75
75
  }, {
76
- tag: p.bracket,
77
- color: f("bracket")
76
+ tag: b.bracket,
77
+ color: v("bracket")
78
78
  }, {
79
- tag: p.string,
80
- color: f("Text")
79
+ tag: b.string,
80
+ color: v("Text")
81
81
  }, {
82
- tag: p.bool,
83
- color: f("Boolean")
82
+ tag: b.bool,
83
+ color: v("Boolean")
84
84
  }, {
85
- tag: p.number,
86
- color: f("Number")
85
+ tag: b.number,
86
+ color: v("Number")
87
87
  }]
88
- }), Ye = (o) => {
88
+ }), Oe = (i) => ce(i) || typeof i == "string" || typeof i == "number" || Array.isArray(i), ct = (i) => {
89
89
  const {
90
- language: t,
91
- tokenizer: c,
92
- tokenHighlights: d,
93
- suggestions: N,
94
- onChange: F,
95
- extensions: V = [],
96
- initialValue: A,
97
- formValidation: O,
98
- disabled: k,
99
- readonly: q,
100
- ..._
101
- } = o, [W, z] = m.useState(""), [D, H] = m.useState(/* @__PURE__ */ new Map()), [a, J] = m.useState([]), j = m.useRef(null);
102
- m.useEffect(() => {
90
+ language: r,
91
+ tokenizer: h,
92
+ tokenHighlights: g,
93
+ suggestions: w,
94
+ onChange: O,
95
+ extensions: W = [],
96
+ initialValue: S,
97
+ formValidation: Y,
98
+ disabled: I,
99
+ showTooltips: Z = !0,
100
+ showValidation: $ = !0,
101
+ readonly: U,
102
+ basicSetup: ee,
103
+ customSuggestionComponent: D = !1,
104
+ ...te
105
+ } = i, [re, R] = m.useState(""), B = m.useRef(null), [oe, ne] = m.useState(/* @__PURE__ */ new Map()), [c, ie] = m.useState([]), [f, p] = m.useState(null), C = m.useRef(null);
106
+ r === "json" && m.useEffect(() => {
103
107
  (async () => {
104
108
  try {
105
- const e = await le.format(JSON.stringify(A) ?? "", {
106
- parser: t,
107
- plugins: [ce, de],
109
+ const e = await ve.format(JSON.stringify(S) ?? "", {
110
+ parser: r,
111
+ plugins: [we, Se],
108
112
  printWidth: 1
109
113
  });
110
- z(e);
114
+ R(e);
111
115
  } catch {
112
- z(JSON.stringify(A) ?? "");
116
+ R(JSON.stringify(S) ?? "");
113
117
  }
114
118
  })();
115
- }, [A]);
116
- const K = m.useMemo(() => {
117
- const e = [...V];
118
- N && (e.push(Te({
119
- override: [N]
120
- })), e.push(Z.highest($.of([{
121
- key: "Tab",
122
- run: Ce
123
- }])))), t === "json" && (e.push(ne()), e.push(se(oe(), {
124
- markerFilter: (i) => (J(i), [])
125
- })));
126
- const l = ee.fromClass(class {
127
- constructor(i) {
128
- Se(this, "decorations", void 0), this.decorations = this.build(i);
119
+ }, [S]);
120
+ const se = m.useMemo(() => {
121
+ const e = [...W];
122
+ if (w) {
123
+ const o = (l) => {
124
+ const u = w(l);
125
+ if (u && Oe(u)) {
126
+ const d = l.view?.coordsAtPos(l.pos);
127
+ return d && p({
128
+ component: u,
129
+ position: {
130
+ top: d.bottom,
131
+ left: d.left
132
+ }
133
+ }), null;
134
+ }
135
+ return p(null), u;
136
+ };
137
+ e.push(Ie({
138
+ ...D ? {
139
+ override: [o]
140
+ } : {
141
+ override: [w]
142
+ }
143
+ })), e.push(J.highest(K.of([{
144
+ key: "Tab",
145
+ run: Re
146
+ }]))), D && e.push(J.highest(K.of([{
147
+ key: "ArrowUp",
148
+ run: (l) => (f || N(l), !0)
149
+ }, {
150
+ key: "ArrowDown",
151
+ run: (l) => f ? (B?.current?.querySelector("[tabindex]")?.focus(), !0) : (N(l), !0)
152
+ }])));
153
+ }
154
+ r === "json" ? (e.push(pe()), e.push(be(ye(), {
155
+ markerFilter: (o) => (ie(o), [])
156
+ }))) : r && e.push(r);
157
+ const n = me.fromClass(class {
158
+ constructor(o) {
159
+ Be(this, "decorations", void 0), this.decorations = this.build(o);
129
160
  }
130
- update(i) {
131
- (i.docChanged || i.viewportChanged) && (this.decorations = this.build(i.view));
161
+ update(o) {
162
+ (o.docChanged || o.viewportChanged) && (this.decorations = this.build(o.view));
132
163
  }
133
- build(i) {
134
- const h = new re(), G = Object.keys(d || {});
135
- return ae(i.state).iterate({
136
- enter: (u) => {
137
- const y = i.state.doc.sliceString(u.from, u.to);
138
- if (y.includes(`
164
+ build(o) {
165
+ const l = new he(), u = Object.keys(g || {});
166
+ return L(o.state).iterate({
167
+ enter: (d) => {
168
+ const x = o.state.doc.sliceString(d.from, d.to);
169
+ if (x.includes(`
139
170
  `)) return;
140
- const P = c?.(y), Q = ue(u)?.tags.map((b) => "name" in b ? b.name : void 0), I = G.find((b) => Q?.includes(b));
141
- I && !P ? h.add(u.from, u.to, E.replace({
142
- widget: new R(I, y),
171
+ const q = h?.(x), ae = Te(d)?.tags.map((A) => "name" in A ? A.name : void 0), _ = u.find((A) => ae?.includes(A));
172
+ _ && !q ? l.add(d.from, d.to, F.replace({
173
+ widget: new X(_, x),
143
174
  point: !0
144
- })) : P && h.add(u.from, u.to, E.replace({
145
- widget: new R(P, y),
175
+ })) : q && l.add(d.from, d.to, F.replace({
176
+ widget: new X(q, x),
146
177
  point: !0
147
178
  }));
148
179
  }
149
- }), h.finish();
180
+ }), l.finish();
150
181
  }
151
182
  }, {
152
- decorations: (i) => i.decorations
183
+ decorations: (o) => o.decorations
153
184
  });
154
- return e.push(l), e.push(te.atomicRanges.of((i) => i.plugin(l)?.decorations || E.none)), e;
155
- }, [t, c, d, V]), L = m.useCallback((e) => {
156
- (e.docChanged || e.viewportChanged || e.selectionSet) && window.requestAnimationFrame(() => {
157
- const l = j.current?.querySelectorAll(".cm-react-anchor"), i = /* @__PURE__ */ new Map();
158
- l?.forEach((h) => {
159
- i.set(h, {
160
- type: h.dataset.type,
161
- value: h.dataset.value
185
+ return e.push(n), e.push(fe.atomicRanges.of((o) => o.plugin(n)?.decorations || F.none)), e;
186
+ }, [r, h, g, W, w, B.current]), [T, le] = m.useState(null), M = m.useCallback((e) => {
187
+ if (e.docChanged || e.viewportChanged || e.selectionSet) {
188
+ if (e.view) {
189
+ const {
190
+ from: n,
191
+ to: o
192
+ } = e.state?.selection?.main ?? {
193
+ from: 0,
194
+ to: 0
195
+ };
196
+ let l = 0;
197
+ L(e.state).iterate({
198
+ from: n,
199
+ to: o,
200
+ enter: (u) => {
201
+ u.from >= n && u.to <= o && l++;
202
+ }
203
+ }), e.selectionSet && l < 2 ? (n === o && n !== T?.from ? p(null) : n === o && n === T?.from && n != 0 ? p((u) => u) : n === o && n === T?.from && n == 0 && p(null), N(e.view)) : e.selectionSet && l >= 2 && p(null), le({
204
+ from: n,
205
+ to: o
162
206
  });
163
- }), H(i);
164
- });
165
- }, []);
166
- return /* @__PURE__ */ n(we, { h: "100%", type: "scroll", children: [
167
- /* @__PURE__ */ r("div", { className: "editor__diagnostics", children: /* @__PURE__ */ n(v, { style: {
207
+ } else e.selectionSet && (p(null), N(e.view));
208
+ window.requestAnimationFrame(() => {
209
+ const n = C.current?.querySelectorAll(".cm-react-anchor"), o = /* @__PURE__ */ new Map();
210
+ n?.forEach((l) => {
211
+ o.set(l, {
212
+ type: l.dataset.type,
213
+ value: l.dataset.value
214
+ });
215
+ }), ne(o);
216
+ });
217
+ }
218
+ }, [T]);
219
+ return m.useEffect(() => {
220
+ if (C.current) {
221
+ const e = window.setTimeout(() => {
222
+ const n = new CustomEvent("scroll");
223
+ C.current?.dispatchEvent(n), M({
224
+ docChanged: !0,
225
+ viewportChanged: !0,
226
+ selectionSet: !1
227
+ });
228
+ }, 50);
229
+ return () => clearTimeout(e);
230
+ }
231
+ return () => {
232
+ };
233
+ }, [M]), /* @__PURE__ */ s(Ve, { h: "100%", type: "scroll", children: [
234
+ $ && /* @__PURE__ */ t("div", { className: "editor__diagnostics", children: /* @__PURE__ */ s(k, { style: {
168
235
  gap: "0.35rem",
169
236
  textWrap: "nowrap"
170
237
  }, align: "center", children: [
171
- a.filter((e) => e.severity == "error").length > 0 ? /* @__PURE__ */ n(w, { children: [
172
- /* @__PURE__ */ r(x, { asChild: !0, children: /* @__PURE__ */ n(g, { color: "red", children: [
173
- /* @__PURE__ */ r(me, { size: 13 }),
174
- /* @__PURE__ */ r(s, { children: a.filter((e) => e.severity == "error").length })
238
+ c.filter((e) => e.severity == "error").length > 0 ? /* @__PURE__ */ s(E, { children: [
239
+ /* @__PURE__ */ t(z, { asChild: !0, children: /* @__PURE__ */ s(y, { color: "red", children: [
240
+ /* @__PURE__ */ t(xe, { size: 13 }),
241
+ /* @__PURE__ */ t(a, { children: c.filter((e) => e.severity == "error").length })
175
242
  ] }) }),
176
- /* @__PURE__ */ r(T, { children: /* @__PURE__ */ n(C, { side: "bottom", children: [
177
- /* @__PURE__ */ r(S, {}),
178
- a.filter((e) => e.severity == "error").map((e) => /* @__PURE__ */ r(s, { size: "xs", children: e.message }, e.message))
243
+ /* @__PURE__ */ t(P, { children: /* @__PURE__ */ s(j, { side: "bottom", children: [
244
+ /* @__PURE__ */ t(V, {}),
245
+ c.filter((e) => e.severity == "error").map((e) => /* @__PURE__ */ t(a, { size: "xs", children: e.message }, e.message))
179
246
  ] }) })
180
247
  ] }) : null,
181
- a.filter((e) => e.severity == "warning").length > 0 ? /* @__PURE__ */ n(w, { children: [
182
- /* @__PURE__ */ r(x, { asChild: !0, children: /* @__PURE__ */ n(g, { color: "orange", children: [
183
- /* @__PURE__ */ r(ge, { size: 13 }),
184
- /* @__PURE__ */ r(s, { children: a.filter((e) => e.severity == "warning").length })
248
+ c.filter((e) => e.severity == "warning").length > 0 ? /* @__PURE__ */ s(E, { children: [
249
+ /* @__PURE__ */ t(z, { asChild: !0, children: /* @__PURE__ */ s(y, { color: "orange", children: [
250
+ /* @__PURE__ */ t(Ae, { size: 13 }),
251
+ /* @__PURE__ */ t(a, { children: c.filter((e) => e.severity == "warning").length })
185
252
  ] }) }),
186
- /* @__PURE__ */ r(T, { children: /* @__PURE__ */ n(C, { side: "bottom", children: [
187
- /* @__PURE__ */ r(S, {}),
188
- a.filter((e) => e.severity == "warning").map((e) => /* @__PURE__ */ r(s, { size: "xs", children: e.message }, e.message))
253
+ /* @__PURE__ */ t(P, { children: /* @__PURE__ */ s(j, { side: "bottom", children: [
254
+ /* @__PURE__ */ t(V, {}),
255
+ c.filter((e) => e.severity == "warning").map((e) => /* @__PURE__ */ t(a, { size: "xs", children: e.message }, e.message))
189
256
  ] }) })
190
257
  ] }) : null,
191
- a.filter((e) => e.severity == "info").length > 0 ? /* @__PURE__ */ n(w, { children: [
192
- /* @__PURE__ */ r(x, { asChild: !0, children: /* @__PURE__ */ n(g, { color: "#9ca3af", children: [
193
- /* @__PURE__ */ r(pe, { size: 13 }),
194
- /* @__PURE__ */ r(s, { children: a.filter((e) => e.severity == "info").length })
258
+ c.filter((e) => e.severity == "info").length > 0 ? /* @__PURE__ */ s(E, { children: [
259
+ /* @__PURE__ */ t(z, { asChild: !0, children: /* @__PURE__ */ s(y, { color: "#9ca3af", children: [
260
+ /* @__PURE__ */ t(ke, { size: 13 }),
261
+ /* @__PURE__ */ t(a, { children: c.filter((e) => e.severity == "info").length })
195
262
  ] }) }),
196
- /* @__PURE__ */ r(T, { children: /* @__PURE__ */ n(C, { side: "bottom", children: [
197
- /* @__PURE__ */ r(S, {}),
198
- a.filter((e) => e.severity == "info").map((e) => /* @__PURE__ */ r(s, { size: "xs", children: e.message }, e.message))
263
+ /* @__PURE__ */ t(P, { children: /* @__PURE__ */ s(j, { side: "bottom", children: [
264
+ /* @__PURE__ */ t(V, {}),
265
+ c.filter((e) => e.severity == "info").map((e) => /* @__PURE__ */ t(a, { size: "xs", children: e.message }, e.message))
199
266
  ] }) })
200
267
  ] }) : null,
201
- a.filter((e) => e.severity == "hint").length > 0 ? /* @__PURE__ */ n(w, { children: [
202
- /* @__PURE__ */ r(x, { asChild: !0, children: /* @__PURE__ */ n(g, { color: "#3b82f6", children: [
203
- /* @__PURE__ */ r(fe, { size: 13 }),
204
- /* @__PURE__ */ r(s, { children: a.filter((e) => e.severity == "hint").length })
268
+ c.filter((e) => e.severity == "hint").length > 0 ? /* @__PURE__ */ s(E, { children: [
269
+ /* @__PURE__ */ t(z, { asChild: !0, children: /* @__PURE__ */ s(y, { color: "#3b82f6", children: [
270
+ /* @__PURE__ */ t(Ee, { size: 13 }),
271
+ /* @__PURE__ */ t(a, { children: c.filter((e) => e.severity == "hint").length })
205
272
  ] }) }),
206
- /* @__PURE__ */ r(T, { children: /* @__PURE__ */ n(C, { side: "bottom", children: [
207
- /* @__PURE__ */ r(S, {}),
208
- a.filter((e) => e.severity == "hint").map((e) => /* @__PURE__ */ r(s, { size: "xs", children: e.message }, e.message))
273
+ /* @__PURE__ */ t(P, { children: /* @__PURE__ */ s(j, { side: "bottom", children: [
274
+ /* @__PURE__ */ t(V, {}),
275
+ c.filter((e) => e.severity == "hint").map((e) => /* @__PURE__ */ t(a, { size: "xs", children: e.message }, e.message))
209
276
  ] }) })
210
277
  ] }) : null
211
278
  ] }) }),
212
- /* @__PURE__ */ r("div", { className: "editor__tools", children: /* @__PURE__ */ n(v, { style: {
279
+ Z && /* @__PURE__ */ t("div", { className: "editor__tools", children: /* @__PURE__ */ s(k, { style: {
213
280
  gap: "0.35rem",
214
281
  textWrap: "nowrap"
215
282
  }, align: "center", children: [
216
- /* @__PURE__ */ n(v, { style: {
283
+ /* @__PURE__ */ s(k, { style: {
217
284
  gap: "0.35rem"
218
285
  }, align: "center", children: [
219
- /* @__PURE__ */ n(g, { color: "secondary", border: !0, children: [
220
- /* @__PURE__ */ r(s, { children: navigator !== void 0 && /Mac/.test(navigator.userAgent) ? "⌃" : "strg" }),
221
- /* @__PURE__ */ r(s, { children: "+" }),
222
- /* @__PURE__ */ r(ye, { size: 13 })
286
+ /* @__PURE__ */ s(y, { color: "secondary", border: !0, children: [
287
+ /* @__PURE__ */ t(a, { children: navigator !== void 0 && /Mac/.test(navigator.userAgent) ? "⌃" : "strg" }),
288
+ /* @__PURE__ */ t(a, { children: "+" }),
289
+ /* @__PURE__ */ t(ze, { size: 13 })
223
290
  ] }),
224
- /* @__PURE__ */ r(s, { children: "to show" })
291
+ /* @__PURE__ */ t(a, { children: "to show" })
225
292
  ] }),
226
- /* @__PURE__ */ r(s, { children: "and" }),
227
- /* @__PURE__ */ n(v, { style: {
293
+ /* @__PURE__ */ t(a, { children: "and" }),
294
+ /* @__PURE__ */ s(k, { style: {
228
295
  gap: "0.35rem"
229
296
  }, align: "center", children: [
230
- /* @__PURE__ */ n(g, { color: "secondary", border: !0, children: [
231
- /* @__PURE__ */ r(be, { size: 13 }),
232
- /* @__PURE__ */ r(s, { children: "or" }),
233
- /* @__PURE__ */ r(ve, { size: 13 })
297
+ /* @__PURE__ */ s(y, { color: "secondary", border: !0, children: [
298
+ /* @__PURE__ */ t(Pe, { size: 13 }),
299
+ /* @__PURE__ */ t(a, { children: "or" }),
300
+ /* @__PURE__ */ t(je, { size: 13 })
234
301
  ] }),
235
- /* @__PURE__ */ r(s, { children: "to select" })
302
+ /* @__PURE__ */ t(a, { children: "to select" })
236
303
  ] }),
237
- /* @__PURE__ */ r(s, { children: "suggestions" })
304
+ /* @__PURE__ */ t(a, { children: "suggestions" })
238
305
  ] }) }),
239
- /* @__PURE__ */ r(xe, { asChild: !0, children: /* @__PURE__ */ n("div", { ref: j, ...X("editor", _), children: [
240
- /* @__PURE__ */ r(Y, { width: "100%", height: "100%", value: W, theme: ze, readOnly: k || q, editable: !k, extensions: K, "aria-disabled": k, className: "editor__control", onChange: (e) => {
241
- z(e);
242
- try {
243
- const l = JSON.parse(e);
244
- F?.(l), O?.setValue(l);
245
- } catch {
246
- }
247
- }, onUpdate: L }),
248
- d && Array.from(D.entries()).map(([e, l]) => {
249
- const i = d[l.type];
250
- return i ? U(/* @__PURE__ */ r("div", { style: {
306
+ /* @__PURE__ */ t(Ne, { asChild: !0, children: /* @__PURE__ */ s("div", { ref: C, ...ue("editor", te), children: [
307
+ /* @__PURE__ */ t(de, { width: "100%", height: "100%", value: r === "json" ? re : S, theme: Fe, readOnly: I || U, editable: !I, extensions: se, "aria-disabled": I, className: "editor__control", onChange: (e) => {
308
+ if (R(e), r === "json")
309
+ try {
310
+ const n = JSON.parse(e);
311
+ O?.(n), Y?.setValue(n);
312
+ } catch {
313
+ }
314
+ else
315
+ O?.(e);
316
+ }, onUpdate: M, basicSetup: ee }),
317
+ g && Array.from(oe.entries()).map(([e, n]) => {
318
+ const o = g[n.type];
319
+ return o ? H(/* @__PURE__ */ t("div", { style: {
251
320
  display: "contents"
252
- }, children: i({
253
- content: l.value
254
- }) }, e.outerHTML + l.value), e) : null;
255
- })
321
+ }, children: o({
322
+ content: n.value
323
+ }) }, e.outerHTML + n.value), e) : null;
324
+ }),
325
+ f && H(/* @__PURE__ */ t("div", { ref: B, style: {
326
+ position: "fixed",
327
+ top: f.position.top,
328
+ left: f.position.left,
329
+ zIndex: 9999
330
+ }, children: f.component }, f.position.top + "-" + f.position.left), document.body)
256
331
  ] }) }),
257
- /* @__PURE__ */ r(B, { orientation: "vertical", children: /* @__PURE__ */ r(M, {}) }),
258
- /* @__PURE__ */ r(B, { orientation: "horizontal", children: /* @__PURE__ */ r(M, {}) })
332
+ /* @__PURE__ */ t(G, { orientation: "vertical", children: /* @__PURE__ */ t(Q, {}) }),
333
+ /* @__PURE__ */ t(G, { orientation: "horizontal", children: /* @__PURE__ */ t(Q, {}) })
259
334
  ] });
260
335
  };
261
336
  export {
262
- Ye as Editor
337
+ ct as Editor
263
338
  };
@@ -1,6 +1,6 @@
1
1
  import { default as React } from 'react';
2
2
  import { Code0ComponentProps, Color } from '../../utils/types';
3
- import { DropdownMenuArrowProps, DropdownMenuContentProps, DropdownMenuGroupProps, DropdownMenuItemProps, DropdownMenuLabelProps, DropdownMenuPortalProps, DropdownMenuProps, DropdownMenuSeparatorProps, DropdownMenuSubContentProps, DropdownMenuSubProps, DropdownMenuSubTriggerProps, DropdownMenuTriggerProps } from '@radix-ui/react-dropdown-menu';
3
+ import { DropdownMenuArrowProps, DropdownMenuCheckboxItemProps, DropdownMenuContentProps, DropdownMenuGroupProps, DropdownMenuItemIndicatorProps, DropdownMenuItemProps, DropdownMenuLabelProps, DropdownMenuPortalProps, DropdownMenuProps, DropdownMenuSeparatorProps, DropdownMenuSubContentProps, DropdownMenuSubProps, DropdownMenuSubTriggerProps, DropdownMenuTriggerProps } from '@radix-ui/react-dropdown-menu';
4
4
  export type MenuProps = Code0ComponentProps & DropdownMenuProps;
5
5
  export type MenuTriggerProps = Code0ComponentProps & DropdownMenuTriggerProps;
6
6
  export type MenuPortalProps = Code0ComponentProps & DropdownMenuPortalProps;
@@ -9,6 +9,8 @@ export type MenuContentProps = Code0ComponentProps & DropdownMenuContentProps &
9
9
  };
10
10
  export type MenuLabelProps = Code0ComponentProps & DropdownMenuLabelProps;
11
11
  export type MenuItemProps = Code0ComponentProps & DropdownMenuItemProps;
12
+ export type MenuCheckboxItemProps = Code0ComponentProps & DropdownMenuCheckboxItemProps;
13
+ export type MenuItemIndicatorProps = Code0ComponentProps & DropdownMenuItemIndicatorProps;
12
14
  export type MenuGroupProps = Code0ComponentProps & DropdownMenuGroupProps;
13
15
  export type MenuSubProps = Code0ComponentProps & DropdownMenuSubProps;
14
16
  export type MenuSubTriggerProps = Code0ComponentProps & DropdownMenuSubTriggerProps;
@@ -28,4 +30,6 @@ export declare const MenuSub: React.FC<MenuSubProps>;
28
30
  export declare const MenuSubTrigger: React.FC<MenuSubTriggerProps>;
29
31
  export declare const MenuSubContent: React.FC<MenuSubContentProps>;
30
32
  export declare const MenuSeparator: React.FC<MenuSeparatorProps>;
33
+ export declare const MenuCheckboxItem: React.FC<MenuCheckboxItemProps>;
34
+ export declare const MenuItemIndicator: React.FC<MenuItemIndicatorProps>;
31
35
  export declare const MenuArrow: React.FC<MenuArrowProps>;