@code0-tech/pictor 0.4.0 → 0.5.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 CHANGED
@@ -1,29 +1,7 @@
1
- Copyright (c) 2023-present Code0
1
+ Copyright 2023-2026 Code0 UG (haftungsbeschränkt) i.G.
2
2
 
3
- Portions of this software are licensed as follows:
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
4
 
5
- * All content residing under the "docs/" directory of this repository is licensed under "Creative Commons: CC BY-SA 4.0 license".
6
- * All third party components incorporated into the Code0 Software are licensed under the original license provided by the owner of the applicable component.
7
- * Content outside of the above mentioned directories or restrictions above is available as defined below.
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
6
 
9
- Permission is hereby granted, free of charge, to any person obtaining a copy
10
- of this software. This Software comes with restrictions, including the rights
11
- to use, copy, modify, merge, publish, distribute and not sublicense, and/or sell copies of this Software,
12
- and to permit persons to whom this Software is furnished to do so, subject to the following conditions:
13
-
14
- The above copyright notice and this permission notice shall be included in all
15
- copies or substantial portions of this Software.
16
-
17
- This Software can be used, copied, merged, published and distributed commercially and non commercially, but it is not allowed
18
- to sell this Software and/or any copies.
19
-
20
- You agree that Code0 and/or its licensors (as applicable) retain all right, title and interest in and
21
- to all such modifications and/or patches and/or copies of this Software.
22
-
23
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29
- SOFTWARE.
7
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -2,7 +2,7 @@ import { default as React } from 'react';
2
2
  import { Code0Component } from '../../utils';
3
3
  import { ValidationProps } from '../form';
4
4
  import { Extension } from '@uiw/react-codemirror';
5
- import { StreamLanguage } from '@codemirror/language';
5
+ import { StreamLanguage, TagStyle } from '@codemirror/language';
6
6
  import { CompletionContext, CompletionResult } from '@codemirror/autocomplete';
7
7
  import { BasicSetupOptions } from '@uiw/codemirror-extensions-basic-setup';
8
8
  export type EditorTokenizer = (content: string) => string | null;
@@ -24,6 +24,8 @@ export interface EditorInputProps extends Omit<Code0Component<HTMLDivElement>, '
24
24
  readonly?: boolean;
25
25
  showTooltips?: boolean;
26
26
  showValidation?: boolean;
27
+ formatter?: (value: string) => Promise<string>;
27
28
  basicSetup?: BasicSetupOptions;
29
+ tokenStyles?: TagStyle[];
28
30
  }
29
31
  export declare const Editor: React.FC<EditorInputProps>;
@@ -1,337 +1,325 @@
1
- import { jsxs as s, jsx as t } from "react/jsx-runtime";
2
- import m, { isValidElement as ce } from "react";
1
+ import { jsxs as s, jsx as r } from "react/jsx-runtime";
2
+ import m, { isValidElement as me } from "react";
3
3
  import { createPortal as K } from "react-dom";
4
4
  import "../../utils/contextStore.js";
5
- import { hashToColor as b, mergeCode0Props as ue } from "../../utils/utils.js";
6
- import de, { Prec as _, keymap as J, 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";
5
+ import { hashToColor as w, mergeCode0Props as he } from "../../utils/utils.js";
6
+ import fe, { Prec as _, keymap as J, ViewPlugin as ge, RangeSetBuilder as pe, Decoration as F, EditorView as ye, WidgetType as be } from "@uiw/react-codemirror";
7
+ import { json as ve, jsonParseLinter as Se } from "@codemirror/lang-json";
8
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 v, getStyleTags as Te } from "../../node_modules/@lezer/highlight/dist/index.js";
9
+ import { linter as we } from "@codemirror/lint";
10
+ import Ce from "../../node_modules/prettier/standalone.js";
11
+ import Te from "../../node_modules/prettier/plugins/babel.js";
12
+ import xe from "../../node_modules/prettier/plugins/estree.js";
13
+ import { createTheme as Ae } from "@uiw/codemirror-themes";
14
+ import { getStyleTags as ke, tags as C } from "../../node_modules/@lezer/highlight/dist/index.js";
15
15
  import '../../assets/components/editor/Editor.styles.css';/* empty css */
16
- import { Badge as y } from "../badge/Badge.js";
17
- import { IconExclamationCircle as Ae, IconAlertTriangle as xe, IconAlertSquareRounded as ke, IconInfoCircle as Ee, IconSpace as ze, IconArrowBarToRight as Pe, IconCornerDownLeft as je } from "@tabler/icons-react";
16
+ import { Badge as b } from "../badge/Badge.js";
17
+ import { IconExclamationCircle as ze, IconAlertTriangle as je, IconAlertSquareRounded as Pe, IconInfoCircle as Ee, IconSpace as Ve, IconArrowBarToRight as Ne, IconCornerDownLeft as Ie } from "@tabler/icons-react";
18
18
  import { Text as a } from "../text/Text.js";
19
- import { Flex as k } from "../flex/Flex.js";
20
- import { Tooltip as E, TooltipTrigger as z, TooltipPortal as P, TooltipContent as j, TooltipArrow as V } from "../tooltip/Tooltip.js";
21
- import { ScrollArea as Ve, ScrollAreaViewport as Ne, ScrollAreaScrollbar as G, ScrollAreaThumb as Q } from "../scroll-area/ScrollArea.js";
22
- import { autocompletion as Ie, acceptCompletion as Re, startCompletion as N } from "@codemirror/autocomplete";
23
- function Be(i, r, h) {
24
- return (r = Me(r)) in i ? Object.defineProperty(i, r, { value: h, enumerable: !0, configurable: !0, writable: !0 }) : i[r] = h, i;
19
+ import { Flex as x } from "../flex/Flex.js";
20
+ import { Tooltip as A, TooltipTrigger as k, TooltipPortal as z, TooltipContent as j, TooltipArrow as P } from "../tooltip/Tooltip.js";
21
+ import { ScrollArea as Re, ScrollAreaViewport as Me, ScrollAreaScrollbar as G, ScrollAreaThumb as Q } from "../scroll-area/ScrollArea.js";
22
+ import { autocompletion as Be, acceptCompletion as Fe, startCompletion as E } from "@codemirror/autocomplete";
23
+ function Oe(i, t, f) {
24
+ return (t = qe(t)) in i ? Object.defineProperty(i, t, { value: f, enumerable: !0, configurable: !0, writable: !0 }) : i[t] = f, i;
25
25
  }
26
- function Me(i) {
27
- var r = qe(i, "string");
28
- return typeof r == "symbol" ? r : r + "";
26
+ function qe(i) {
27
+ var t = We(i, "string");
28
+ return typeof t == "symbol" ? t : t + "";
29
29
  }
30
- function qe(i, r) {
30
+ function We(i, t) {
31
31
  if (typeof i != "object" || !i) return i;
32
- var h = i[Symbol.toPrimitive];
33
- if (h !== void 0) {
34
- var g = h.call(i, r);
35
- if (typeof g != "object") return g;
32
+ var f = i[Symbol.toPrimitive];
33
+ if (f !== void 0) {
34
+ var p = f.call(i, t);
35
+ if (typeof p != "object") return p;
36
36
  throw new TypeError("@@toPrimitive must return a primitive value.");
37
37
  }
38
- return (r === "string" ? String : Number)(i);
38
+ return (t === "string" ? String : Number)(i);
39
39
  }
40
- class X extends ge {
41
- constructor(r, h) {
42
- super(), this.type = r, this.rawValue = h;
40
+ class X extends be {
41
+ constructor(t, f) {
42
+ super(), this.type = t, this.rawValue = f;
43
43
  }
44
44
  toDOM() {
45
- const r = document.createElement("span");
46
- 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;
45
+ const t = document.createElement("span");
46
+ 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;
47
47
  }
48
48
  ignoreEvent() {
49
49
  return !0;
50
50
  }
51
- eq(r) {
52
- return r.type === this.type && r.rawValue === this.rawValue;
51
+ eq(t) {
52
+ return t.type === this.type && t.rawValue === this.rawValue;
53
53
  }
54
54
  }
55
- const Fe = Ce({
56
- theme: "light",
57
- settings: {
58
- background: "transparent",
59
- backgroundImage: "",
60
- foreground: "rgba(255,255,255, 0.75)",
61
- caret: "gray",
62
- selection: "rgba(112,179,255,0.25)",
63
- selectionMatch: "rgba(112,179,255,0.1)",
64
- fontSize: "0.8rem",
65
- gutterBackground: "transparent",
66
- gutterForeground: "rgba(255,255,255, 0.5)",
67
- gutterBorder: "transparent",
68
- gutterActiveForeground: "rgba(255,255,255, 1)",
69
- lineHighlight: "rgba(255,255,255, 0.1)"
70
- },
71
- styles: [{
72
- tag: v.squareBracket,
73
- color: b("squareBracket")
74
- }, {
75
- tag: v.bracket,
76
- color: b("bracket")
77
- }, {
78
- tag: v.string,
79
- color: b("Text")
80
- }, {
81
- tag: v.bool,
82
- color: b("Boolean")
83
- }, {
84
- tag: v.number,
85
- color: b("Number")
86
- }]
87
- }), Oe = (i) => ce(i) || typeof i == "string" || typeof i == "number" || Array.isArray(i), at = (i) => {
55
+ const De = (i) => me(i) || typeof i == "string" || typeof i == "number" || Array.isArray(i), ur = (i) => {
88
56
  const {
89
- language: r,
90
- tokenizer: h,
91
- tokenHighlights: g,
92
- suggestions: w,
93
- onChange: O,
94
- extensions: W = [],
95
- initialValue: S,
96
- formValidation: Y,
97
- disabled: I,
98
- showTooltips: Z = !0,
99
- showValidation: $ = !0,
100
- readonly: U,
101
- basicSetup: ee,
57
+ language: t,
58
+ tokenizer: f,
59
+ tokenHighlights: p,
60
+ tokenStyles: O = [],
61
+ suggestions: V,
62
+ onChange: q,
63
+ extensions: Y = [],
64
+ formatter: W,
65
+ initialValue: v,
66
+ formValidation: Z,
67
+ disabled: N,
68
+ showTooltips: $ = !0,
69
+ showValidation: U = !0,
70
+ readonly: ee,
71
+ basicSetup: re,
102
72
  customSuggestionComponent: D = !1,
103
73
  ...te
104
- } = 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);
105
- r === "json" && m.useEffect(() => {
74
+ } = i, [oe, I] = m.useState(), R = m.useRef(null), [ne, ie] = m.useState(/* @__PURE__ */ new Map()), [u, se] = m.useState([]), [T, le] = m.useState(null), [g, y] = m.useState(null), H = m.useRef(null);
75
+ m.useEffect(() => {
106
76
  (async () => {
107
77
  try {
108
- const e = await ve.format(JSON.stringify(S) ?? "", {
109
- parser: r,
110
- plugins: [we, Se],
78
+ const e = W ? await W(v) : t === "json" ? await Ce.format(JSON.stringify(v), {
79
+ parser: "json",
80
+ plugins: [Te, xe],
111
81
  printWidth: 1
112
- });
113
- R(e);
82
+ }) : v;
83
+ I(e);
114
84
  } catch {
115
- R(JSON.stringify(S) ?? "");
85
+ I(t == "json" ? JSON.stringify(v) : v);
116
86
  }
117
87
  })();
118
- }, [S]);
119
- const se = m.useMemo(() => {
120
- const e = [...W];
121
- if (w) {
122
- const o = (l) => {
123
- const u = w(l);
124
- if (u && Oe(u)) {
125
- const d = l.view?.coordsAtPos(l.pos);
126
- return d && p({
127
- component: u,
88
+ }, []);
89
+ const ae = m.useMemo(() => {
90
+ const e = [...Y];
91
+ if (V) {
92
+ const n = (o) => {
93
+ const c = V(o);
94
+ if (c && De(c)) {
95
+ const l = o.view?.coordsAtPos(o.pos);
96
+ return l && y({
97
+ component: c,
128
98
  position: {
129
- top: d.bottom,
130
- left: d.left
99
+ top: l.bottom,
100
+ left: l.left
131
101
  }
132
102
  }), null;
133
103
  }
134
- return p(null), u;
104
+ return y(null), c;
135
105
  };
136
- e.push(Ie({
106
+ e.push(Be({
137
107
  ...D ? {
138
- override: [o]
108
+ override: [n]
139
109
  } : {
140
- override: [w]
110
+ override: [V]
141
111
  }
142
112
  })), e.push(_.highest(J.of([{
143
113
  key: "Tab",
144
- run: Re
114
+ run: Fe
145
115
  }]))), D && e.push(_.highest(J.of([{
146
116
  key: "ArrowUp",
147
- run: (l) => (f || N(l), !0)
117
+ run: (o) => (g || E(o), !0)
148
118
  }, {
149
119
  key: "ArrowDown",
150
- run: (l) => f ? (B?.current?.querySelector("[tabindex]")?.focus(), !0) : (N(l), !0)
120
+ run: (o) => g ? (R?.current?.querySelector("[tabindex]")?.focus(), !0) : (E(o), !0)
151
121
  }])));
152
122
  }
153
- r === "json" ? (e.push(pe()), e.push(be(ye(), {
154
- markerFilter: (o) => (ie(o), [])
155
- }))) : r && e.push(r);
156
- const n = me.fromClass(class {
157
- constructor(o) {
158
- Be(this, "decorations", void 0), this.decorations = this.build(o);
123
+ t === "json" ? (e.push(ve()), e.push(we(Se(), {
124
+ markerFilter: (n) => (se(n), [])
125
+ }))) : t && e.push(t);
126
+ const d = ge.fromClass(class {
127
+ constructor(n) {
128
+ Oe(this, "decorations", void 0), this.decorations = this.build(n);
159
129
  }
160
- update(o) {
161
- (o.docChanged || o.viewportChanged) && (this.decorations = this.build(o.view));
130
+ update(n) {
131
+ (n.docChanged || n.viewportChanged) && (this.decorations = this.build(n.view));
162
132
  }
163
- build(o) {
164
- const l = new he(), u = Object.keys(g || {});
165
- return L(o.state).iterate({
166
- enter: (d) => {
167
- const A = o.state.doc.sliceString(d.from, d.to);
168
- if (A.includes(`
133
+ build(n) {
134
+ const o = new pe(), c = Object.keys(p || {});
135
+ return L(n.state).iterate({
136
+ enter: (l) => {
137
+ const h = n.state.doc.sliceString(l.from, l.to);
138
+ if (h.includes(`
169
139
  `)) return;
170
- const q = h?.(A), ae = Te(d)?.tags.map((x) => "name" in x ? x.name : void 0), H = u.find((x) => ae?.includes(x));
171
- H && !q ? l.add(d.from, d.to, F.replace({
172
- widget: new X(H, A),
140
+ const M = f?.(h), de = ke(l)?.tags.map((S) => "name" in S ? S.name : void 0), B = c.find((S) => de?.includes(S));
141
+ B && !M ? p?.[B]({
142
+ content: h
143
+ }) && o.add(l.from, l.to, F.replace({
144
+ widget: new X(B, h),
173
145
  point: !0
174
- })) : q && l.add(d.from, d.to, F.replace({
175
- widget: new X(q, A),
146
+ })) : M && o.add(l.from, l.to, F.replace({
147
+ widget: new X(M, h),
176
148
  point: !0
177
149
  }));
178
150
  }
179
- }), l.finish();
151
+ }), o.finish();
180
152
  }
181
153
  }, {
182
- decorations: (o) => o.decorations
154
+ decorations: (n) => n.decorations
183
155
  });
184
- return e.push(n), e.push(fe.atomicRanges.of((o) => o.plugin(n)?.decorations || F.none)), e;
185
- }, [r, h, g, W, w, B.current]), [T, le] = m.useState(null), M = m.useCallback((e) => {
156
+ return e.push(d), e.push(ye.atomicRanges.of((n) => n.plugin(d)?.decorations || F.none)), e;
157
+ }, [R]), ce = m.useCallback((e) => {
186
158
  if (e.docChanged || e.viewportChanged || e.selectionSet) {
187
159
  if (e.view) {
188
160
  const {
189
- from: n,
190
- to: o
161
+ from: o,
162
+ to: c
191
163
  } = e.state?.selection?.main ?? {
192
164
  from: 0,
193
165
  to: 0
194
166
  };
195
167
  let l = 0;
196
168
  L(e.state).iterate({
197
- from: n,
198
- to: o,
199
- enter: (u) => {
200
- u.from >= n && u.to <= o && l++;
169
+ from: o,
170
+ to: c,
171
+ enter: (h) => {
172
+ h.from >= o && h.to <= c && l++;
201
173
  }
202
- }), 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({
203
- from: n,
204
- to: o
174
+ }), e.selectionSet && l < 2 ? (o === c && o !== T?.from ? y(null) : o === c && o === T?.from && o != 0 ? y((h) => h) : o === c && o === T?.from && o == 0 && y(null), E(e.view)) : e.selectionSet && l >= 2 && y(null), le({
175
+ from: o,
176
+ to: c
205
177
  });
206
- } else e.selectionSet && (p(null), N(e.view));
207
- window.requestAnimationFrame(() => {
208
- const n = C.current?.querySelectorAll(".cm-react-anchor"), o = /* @__PURE__ */ new Map();
209
- n?.forEach((l) => {
210
- o.set(l, {
211
- type: l.dataset.type,
212
- value: l.dataset.value
213
- });
214
- }), ne(o);
215
- });
216
- }
217
- }, [T]);
218
- return m.useEffect(() => {
219
- if (C.current) {
220
- const e = window.setTimeout(() => {
221
- const n = new CustomEvent("scroll");
222
- C.current?.dispatchEvent(n), M({
223
- docChanged: !0,
224
- viewportChanged: !0,
225
- selectionSet: !1
178
+ } else e.selectionSet && (y(null), E(e.view));
179
+ const d = H.current?.querySelectorAll(".cm-react-anchor"), n = /* @__PURE__ */ new Map();
180
+ d?.forEach((o) => {
181
+ n.set(o, {
182
+ type: o.dataset.type,
183
+ value: o.dataset.value
226
184
  });
227
- }, 50);
228
- return () => clearTimeout(e);
185
+ }), ie(n);
229
186
  }
230
- return () => {
231
- };
232
- }, [M]), /* @__PURE__ */ s(Ve, { h: "100%", type: "scroll", children: [
233
- $ && /* @__PURE__ */ t("div", { className: "editor__diagnostics", children: /* @__PURE__ */ s(k, { style: {
187
+ }, [T]), ue = m.useMemo(() => Ae({
188
+ theme: "light",
189
+ settings: {
190
+ background: "transparent",
191
+ backgroundImage: "",
192
+ foreground: "rgba(255,255,255, 0.75)",
193
+ caret: "gray",
194
+ selection: "rgba(112,179,255,0.25)",
195
+ selectionMatch: "rgba(112,179,255,0.1)",
196
+ fontSize: "0.8rem",
197
+ gutterBackground: "transparent",
198
+ gutterForeground: "rgba(255,255,255, 0.5)",
199
+ gutterBorder: "transparent",
200
+ gutterActiveForeground: "rgba(255,255,255, 1)",
201
+ lineHighlight: "rgba(255,255,255, 0.1)"
202
+ },
203
+ styles: [{
204
+ tag: C.squareBracket,
205
+ color: w("squareBracket")
206
+ }, {
207
+ tag: C.bracket,
208
+ color: w("bracket")
209
+ }, {
210
+ tag: C.string,
211
+ color: w("Text")
212
+ }, {
213
+ tag: C.bool,
214
+ color: w("Boolean")
215
+ }, {
216
+ tag: C.number,
217
+ color: w("Number")
218
+ }, ...O]
219
+ }), [O]);
220
+ return /* @__PURE__ */ s(Re, { h: "100%", type: "scroll", children: [
221
+ U && /* @__PURE__ */ r("div", { className: "editor__diagnostics", children: /* @__PURE__ */ s(x, { style: {
234
222
  gap: "0.35rem",
235
223
  textWrap: "nowrap"
236
224
  }, align: "center", children: [
237
- c.filter((e) => e.severity == "error").length > 0 ? /* @__PURE__ */ s(E, { children: [
238
- /* @__PURE__ */ t(z, { asChild: !0, children: /* @__PURE__ */ s(y, { color: "red", children: [
239
- /* @__PURE__ */ t(Ae, { size: 13 }),
240
- /* @__PURE__ */ t(a, { children: c.filter((e) => e.severity == "error").length })
225
+ u.filter((e) => e.severity == "error").length > 0 ? /* @__PURE__ */ s(A, { children: [
226
+ /* @__PURE__ */ r(k, { asChild: !0, children: /* @__PURE__ */ s(b, { color: "red", children: [
227
+ /* @__PURE__ */ r(ze, { size: 13 }),
228
+ /* @__PURE__ */ r(a, { children: u.filter((e) => e.severity == "error").length })
241
229
  ] }) }),
242
- /* @__PURE__ */ t(P, { children: /* @__PURE__ */ s(j, { side: "bottom", children: [
243
- /* @__PURE__ */ t(V, {}),
244
- c.filter((e) => e.severity == "error").map((e) => /* @__PURE__ */ t(a, { size: "xs", children: e.message }, e.message))
230
+ /* @__PURE__ */ r(z, { children: /* @__PURE__ */ s(j, { side: "bottom", children: [
231
+ /* @__PURE__ */ r(P, {}),
232
+ u.filter((e) => e.severity == "error").map((e) => /* @__PURE__ */ r(a, { size: "xs", children: e.message }, e.message))
245
233
  ] }) })
246
234
  ] }) : null,
247
- c.filter((e) => e.severity == "warning").length > 0 ? /* @__PURE__ */ s(E, { children: [
248
- /* @__PURE__ */ t(z, { asChild: !0, children: /* @__PURE__ */ s(y, { color: "orange", children: [
249
- /* @__PURE__ */ t(xe, { size: 13 }),
250
- /* @__PURE__ */ t(a, { children: c.filter((e) => e.severity == "warning").length })
235
+ u.filter((e) => e.severity == "warning").length > 0 ? /* @__PURE__ */ s(A, { children: [
236
+ /* @__PURE__ */ r(k, { asChild: !0, children: /* @__PURE__ */ s(b, { color: "orange", children: [
237
+ /* @__PURE__ */ r(je, { size: 13 }),
238
+ /* @__PURE__ */ r(a, { children: u.filter((e) => e.severity == "warning").length })
251
239
  ] }) }),
252
- /* @__PURE__ */ t(P, { children: /* @__PURE__ */ s(j, { side: "bottom", children: [
253
- /* @__PURE__ */ t(V, {}),
254
- c.filter((e) => e.severity == "warning").map((e) => /* @__PURE__ */ t(a, { size: "xs", children: e.message }, e.message))
240
+ /* @__PURE__ */ r(z, { children: /* @__PURE__ */ s(j, { side: "bottom", children: [
241
+ /* @__PURE__ */ r(P, {}),
242
+ u.filter((e) => e.severity == "warning").map((e) => /* @__PURE__ */ r(a, { size: "xs", children: e.message }, e.message))
255
243
  ] }) })
256
244
  ] }) : null,
257
- c.filter((e) => e.severity == "info").length > 0 ? /* @__PURE__ */ s(E, { children: [
258
- /* @__PURE__ */ t(z, { asChild: !0, children: /* @__PURE__ */ s(y, { color: "#9ca3af", children: [
259
- /* @__PURE__ */ t(ke, { size: 13 }),
260
- /* @__PURE__ */ t(a, { children: c.filter((e) => e.severity == "info").length })
245
+ u.filter((e) => e.severity == "info").length > 0 ? /* @__PURE__ */ s(A, { children: [
246
+ /* @__PURE__ */ r(k, { asChild: !0, children: /* @__PURE__ */ s(b, { color: "#9ca3af", children: [
247
+ /* @__PURE__ */ r(Pe, { size: 13 }),
248
+ /* @__PURE__ */ r(a, { children: u.filter((e) => e.severity == "info").length })
261
249
  ] }) }),
262
- /* @__PURE__ */ t(P, { children: /* @__PURE__ */ s(j, { side: "bottom", children: [
263
- /* @__PURE__ */ t(V, {}),
264
- c.filter((e) => e.severity == "info").map((e) => /* @__PURE__ */ t(a, { size: "xs", children: e.message }, e.message))
250
+ /* @__PURE__ */ r(z, { children: /* @__PURE__ */ s(j, { side: "bottom", children: [
251
+ /* @__PURE__ */ r(P, {}),
252
+ u.filter((e) => e.severity == "info").map((e) => /* @__PURE__ */ r(a, { size: "xs", children: e.message }, e.message))
265
253
  ] }) })
266
254
  ] }) : null,
267
- c.filter((e) => e.severity == "hint").length > 0 ? /* @__PURE__ */ s(E, { children: [
268
- /* @__PURE__ */ t(z, { asChild: !0, children: /* @__PURE__ */ s(y, { color: "#3b82f6", children: [
269
- /* @__PURE__ */ t(Ee, { size: 13 }),
270
- /* @__PURE__ */ t(a, { children: c.filter((e) => e.severity == "hint").length })
255
+ u.filter((e) => e.severity == "hint").length > 0 ? /* @__PURE__ */ s(A, { children: [
256
+ /* @__PURE__ */ r(k, { asChild: !0, children: /* @__PURE__ */ s(b, { color: "#3b82f6", children: [
257
+ /* @__PURE__ */ r(Ee, { size: 13 }),
258
+ /* @__PURE__ */ r(a, { children: u.filter((e) => e.severity == "hint").length })
271
259
  ] }) }),
272
- /* @__PURE__ */ t(P, { children: /* @__PURE__ */ s(j, { side: "bottom", children: [
273
- /* @__PURE__ */ t(V, {}),
274
- c.filter((e) => e.severity == "hint").map((e) => /* @__PURE__ */ t(a, { size: "xs", children: e.message }, e.message))
260
+ /* @__PURE__ */ r(z, { children: /* @__PURE__ */ s(j, { side: "bottom", children: [
261
+ /* @__PURE__ */ r(P, {}),
262
+ u.filter((e) => e.severity == "hint").map((e) => /* @__PURE__ */ r(a, { size: "xs", children: e.message }, e.message))
275
263
  ] }) })
276
264
  ] }) : null
277
265
  ] }) }),
278
- Z && /* @__PURE__ */ t("div", { className: "editor__tools", children: /* @__PURE__ */ s(k, { style: {
266
+ $ && /* @__PURE__ */ r("div", { className: "editor__tools", children: /* @__PURE__ */ s(x, { style: {
279
267
  gap: "0.35rem",
280
268
  textWrap: "nowrap"
281
269
  }, align: "center", children: [
282
- /* @__PURE__ */ s(k, { style: {
270
+ /* @__PURE__ */ s(x, { style: {
283
271
  gap: "0.35rem"
284
272
  }, align: "center", children: [
285
- /* @__PURE__ */ s(y, { color: "secondary", border: !0, children: [
286
- /* @__PURE__ */ t(a, { children: navigator !== void 0 && /Mac/.test(navigator.userAgent) ? "⌃" : "strg" }),
287
- /* @__PURE__ */ t(a, { children: "+" }),
288
- /* @__PURE__ */ t(ze, { size: 13 })
273
+ /* @__PURE__ */ s(b, { color: "secondary", border: !0, children: [
274
+ /* @__PURE__ */ r(a, { children: navigator !== void 0 && /Mac/.test(navigator.userAgent) ? "⌃" : "strg" }),
275
+ /* @__PURE__ */ r(a, { children: "+" }),
276
+ /* @__PURE__ */ r(Ve, { size: 13 })
289
277
  ] }),
290
- /* @__PURE__ */ t(a, { children: "to show" })
278
+ /* @__PURE__ */ r(a, { children: "to show" })
291
279
  ] }),
292
- /* @__PURE__ */ t(a, { children: "and" }),
293
- /* @__PURE__ */ s(k, { style: {
280
+ /* @__PURE__ */ r(a, { children: "and" }),
281
+ /* @__PURE__ */ s(x, { style: {
294
282
  gap: "0.35rem"
295
283
  }, align: "center", children: [
296
- /* @__PURE__ */ s(y, { color: "secondary", border: !0, children: [
297
- /* @__PURE__ */ t(Pe, { size: 13 }),
298
- /* @__PURE__ */ t(a, { children: "or" }),
299
- /* @__PURE__ */ t(je, { size: 13 })
284
+ /* @__PURE__ */ s(b, { color: "secondary", border: !0, children: [
285
+ /* @__PURE__ */ r(Ne, { size: 13 }),
286
+ /* @__PURE__ */ r(a, { children: "or" }),
287
+ /* @__PURE__ */ r(Ie, { size: 13 })
300
288
  ] }),
301
- /* @__PURE__ */ t(a, { children: "to select" })
289
+ /* @__PURE__ */ r(a, { children: "to select" })
302
290
  ] }),
303
- /* @__PURE__ */ t(a, { children: "suggestions" })
291
+ /* @__PURE__ */ r(a, { children: "suggestions" })
304
292
  ] }) }),
305
- /* @__PURE__ */ t(Ne, { asChild: !0, children: /* @__PURE__ */ s("div", { ref: C, ...ue("editor", te), children: [
306
- /* @__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) => {
307
- if (R(e), r === "json")
293
+ /* @__PURE__ */ r(Me, { asChild: !0, children: /* @__PURE__ */ s("div", { ref: H, ...he("editor", te), children: [
294
+ /* @__PURE__ */ r(fe, { width: "100%", height: "100%", value: oe, theme: ue, readOnly: N || ee, editable: !N, extensions: ae, "aria-disabled": N, className: "editor__control", onChange: (e) => {
295
+ if (I(e), t === "json")
308
296
  try {
309
- const n = JSON.parse(e);
310
- O?.(n), Y?.setValue(n);
297
+ const d = JSON.parse(e);
298
+ q?.(d), Z?.setValue(d);
311
299
  } catch {
312
300
  }
313
301
  else
314
- O?.(e);
315
- }, onUpdate: M, basicSetup: ee }),
316
- g && Array.from(oe.entries()).map(([e, n]) => {
317
- const o = g[n.type];
318
- return o ? K(/* @__PURE__ */ t("div", { style: {
302
+ q?.(e);
303
+ }, onUpdate: ce, basicSetup: re }),
304
+ p && Array.from(ne.entries()).map(([e, d]) => {
305
+ const n = p[d.type];
306
+ return n ? K(/* @__PURE__ */ r("div", { style: {
319
307
  display: "contents"
320
- }, children: o({
321
- content: n.value
322
- }) }, e.outerHTML + n.value), e) : null;
308
+ }, children: n({
309
+ content: d.value
310
+ }) }, e.outerHTML + d.value), e) : null;
323
311
  }),
324
- f && K(/* @__PURE__ */ t("div", { ref: B, style: {
312
+ g && K(/* @__PURE__ */ r("div", { ref: R, style: {
325
313
  position: "fixed",
326
- top: f.position.top,
327
- left: f.position.left,
314
+ top: g.position.top,
315
+ left: g.position.left,
328
316
  zIndex: 9999
329
- }, children: f.component }, f.position.top + "-" + f.position.left), document.body)
317
+ }, children: g.component }, g.position.top + "-" + g.position.left), document.body)
330
318
  ] }) }),
331
- /* @__PURE__ */ t(G, { orientation: "vertical", children: /* @__PURE__ */ t(Q, {}) }),
332
- /* @__PURE__ */ t(G, { orientation: "horizontal", children: /* @__PURE__ */ t(Q, {}) })
319
+ /* @__PURE__ */ r(G, { orientation: "vertical", children: /* @__PURE__ */ r(Q, {}) }),
320
+ /* @__PURE__ */ r(G, { orientation: "horizontal", children: /* @__PURE__ */ r(Q, {}) })
333
321
  ] });
334
322
  };
335
323
  export {
336
- at as Editor
324
+ ur as Editor
337
325
  };
package/dist/index.js CHANGED
@@ -1,31 +1,31 @@
1
1
  import { Alert as r } from "./components/alert/Alert.js";
2
2
  import { AuroraBackground as n } from "./components/aurora/Aurora.js";
3
3
  import { Avatar as p } from "./components/avatar/Avatar.js";
4
- import { Badge as i } from "./components/badge/Badge.js";
4
+ import { Badge as u } from "./components/badge/Badge.js";
5
5
  import { Breadcrumb as x } from "./components/breadcrumb/Breadcrumb.js";
6
6
  import { Button as f } from "./components/button/Button.js";
7
7
  import { ButtonGroup as g } from "./components/button-group/ButtonGroup.js";
8
- import { Card as c } from "./components/card/Card.js";
8
+ import { Card as b } from "./components/card/Card.js";
9
9
  import { Col as T } from "./components/col/Col.js";
10
- import { Command as s, CommandDialog as M, CommandEmpty as I, CommandGroup as D, CommandInput as v, CommandItem as A, CommandList as F, CommandSeparator as y, CommandShortcut as P } from "./components/command/Command.js";
10
+ import { Command as s, CommandDialog as M, CommandEmpty as I, CommandGroup as D, CommandInput as A, CommandItem as v, CommandList as F, CommandSeparator as P, CommandShortcut as R } from "./components/command/Command.js";
11
11
  import { Container as L } from "./components/container/Container.js";
12
- import { ContextMenu as w, ContextMenuArrow as B, ContextMenuContent as G, ContextMenuGroup as z, ContextMenuItem as O, ContextMenuLabel as k, ContextMenuPortal as E, ContextMenuSeparator as H, ContextMenuSub as N, ContextMenuSubContent as j, ContextMenuSubTrigger as Q, ContextMenuTrigger as V } from "./components/context-menu/ContextMenu.js";
12
+ import { ContextMenu as w, ContextMenuArrow as G, ContextMenuContent as z, ContextMenuGroup as B, ContextMenuItem as O, ContextMenuLabel as k, ContextMenuPortal as E, ContextMenuSeparator as H, ContextMenuSub as N, ContextMenuSubContent as j, ContextMenuSubTrigger as Q, ContextMenuTrigger as V } from "./components/context-menu/ContextMenu.js";
13
13
  import { DataTable as q } from "./components/data-table/DataTable.js";
14
14
  import { DataTableColumn as K } from "./components/data-table/DataTableColumn.js";
15
15
  import { DataTableFilterInput as W, createFilterQueryLanguage as X } from "./components/data-table/DataTableFilterInput.js";
16
16
  import { DataTableFilterSuggestionMenu as _ } from "./components/data-table/DataTableFilterSuggestionMenu.js";
17
- import { Dialog as ee, DialogClose as oe, DialogContent as re, DialogDescription as te, DialogFooter as ne, DialogHeader as ae, DialogOverlay as pe, DialogPortal as me, DialogTitle as ie, DialogTrigger as ue } from "./components/dialog/Dialog.js";
17
+ import { Dialog as ee, DialogClose as oe, DialogContent as re, DialogDescription as te, DialogFooter as ne, DialogHeader as ae, DialogOverlay as pe, DialogPortal as me, DialogTitle as ue, DialogTrigger as ie } from "./components/dialog/Dialog.js";
18
18
  import { Editor as le } from "./components/editor/Editor.js";
19
19
  import { FileTabsService as Ce } from "./components/file-tabs/FileTabs.service.js";
20
- import { FileTabs as Se, FileTabsContent as ce, FileTabsList as be, FileTabsTrigger as Te } from "./components/file-tabs/FileTabs.js";
20
+ import { FileTabs as Se, FileTabsContent as be, FileTabsList as ce, FileTabsTrigger as Te } from "./components/file-tabs/FileTabs.js";
21
21
  import { Flex as se } from "./components/flex/Flex.js";
22
22
  import { CheckboxInput as Ie } from "./components/form/CheckboxInput.js";
23
- import { EmailInput as ve, emailValidation as Ae } from "./components/form/EmailInput.js";
24
- import { Input as ye } from "./components/form/Input.js";
25
- import { InputDescription as Re } from "./components/form/InputDescription.js";
23
+ import { EmailInput as Ae, emailValidation as ve } from "./components/form/EmailInput.js";
24
+ import { Input as Pe } from "./components/form/Input.js";
25
+ import { InputDescription as ye } from "./components/form/InputDescription.js";
26
26
  import { InputLabel as he } from "./components/form/InputLabel.js";
27
- import { InputMessage as Be } from "./components/form/InputMessage.js";
28
- import { InputSuggestionMenuContent as ze, InputSuggestionMenuContentItems as Oe } from "./components/form/InputSuggestion.js";
27
+ import { InputMessage as Ge } from "./components/form/InputMessage.js";
28
+ import { InputSuggestionMenuContent as Be, InputSuggestionMenuContentItems as Oe } from "./components/form/InputSuggestion.js";
29
29
  import { NumberInput as Ee } from "./components/form/NumberInput.js";
30
30
  import { PasswordInput as Ne } from "./components/form/PasswordInput.js";
31
31
  import { PinInput as Qe, PinInputField as Ve, PinInputHiddenField as Ze } from "./components/form/PinInput.js";
@@ -37,51 +37,50 @@ import { TextInput as eo } from "./components/form/TextInput.js";
37
37
  import { useForm as ro } from "./components/form/useForm.js";
38
38
  import { buildDefaultSyntax as no } from "./components/form/Input.syntax.hook.js";
39
39
  import { FullScreen as po } from "./components/fullscreen/FullScreen.js";
40
- import { Layout as io } from "./components/layout/Layout.js";
41
- import { Menu as xo, MenuArrow as lo, MenuCheckboxItem as fo, MenuContent as Co, MenuGroup as go, MenuItem as So, MenuItemIndicator as co, MenuLabel as bo, MenuPortal as To, MenuSeparator as so, MenuSub as Mo, MenuSubContent as Io, MenuSubTrigger as Do, MenuTrigger as vo } from "./components/menu/Menu.js";
40
+ import { Layout as uo } from "./components/layout/Layout.js";
41
+ import { Menu as xo, MenuArrow as lo, MenuCheckboxItem as fo, MenuContent as Co, MenuGroup as go, MenuItem as So, MenuItemIndicator as bo, MenuLabel as co, MenuPortal as To, MenuSeparator as so, MenuSub as Mo, MenuSubContent as Io, MenuSubTrigger as Do, MenuTrigger as Ao } from "./components/menu/Menu.js";
42
42
  import { Quote as Fo } from "./components/quote/Quote.js";
43
- import { ResizableHandle as Po, ResizablePanel as Ro, ResizablePanelGroup as Lo } from "./components/resizable/Resizable.js";
43
+ import { ResizableHandle as Ro, ResizablePanel as yo, ResizablePanelGroup as Lo } from "./components/resizable/Resizable.js";
44
44
  import { Row as wo } from "./components/row/Row.js";
45
- import { ScrollArea as Go, ScrollAreaCorner as zo, ScrollAreaScrollbar as Oo, ScrollAreaThumb as ko, ScrollAreaViewport as Eo } from "./components/scroll-area/ScrollArea.js";
45
+ import { ScrollArea as zo, ScrollAreaCorner as Bo, ScrollAreaScrollbar as Oo, ScrollAreaThumb as ko, ScrollAreaViewport as Eo } from "./components/scroll-area/ScrollArea.js";
46
46
  import { SegmentedControl as No, SegmentedControlItem as jo } from "./components/segmented-control/SegmentedControl.js";
47
47
  import { Spacing as Vo } from "./components/spacing/Spacing.js";
48
48
  import { Tab as qo, TabContent as Jo, TabList as Ko, TabTrigger as Uo } from "./components/tab/Tab.js";
49
49
  import { Text as Xo } from "./components/text/Text.js";
50
50
  import { Toast as _o, toast as $o } from "./components/toast/Toast.js";
51
51
  import { Tooltip as or, TooltipArrow as rr, TooltipContent as tr, TooltipPortal as nr, TooltipTrigger as ar } from "./components/tooltip/Tooltip.js";
52
- import { ContextStore as mr, ContextStoreProvider as ir, useService as ur, useStore as xr } from "./utils/contextStore.js";
53
- import { InspectionSeverity as fr, underlineBySeverity as Cr } from "./utils/inspection.js";
54
- import { NonReactiveArrayService as Sr, createNonReactiveArrayService as cr } from "./utils/nonReactiveArrayService.js";
55
- import { ObjectService as Tr, createObjectService as dr } from "./utils/objectStore.js";
56
- import { ReactiveArrayService as Mr, useReactiveArrayService as Ir } from "./utils/reactiveArrayService.js";
57
- import { Colors as vr } from "./utils/types.js";
58
- import { getDOMSizeFromCodeZeroSize as Fr, hashToColor as yr, mergeCode0Props as Pr } from "./utils/utils.js";
52
+ import { ContextStore as mr, ContextStoreProvider as ur, useService as ir, useStore as xr } from "./utils/contextStore.js";
53
+ import { NonReactiveArrayService as fr, createNonReactiveArrayService as Cr } from "./utils/nonReactiveArrayService.js";
54
+ import { ObjectService as Sr, createObjectService as br } from "./utils/objectStore.js";
55
+ import { ReactiveArrayService as Tr, useReactiveArrayService as dr } from "./utils/reactiveArrayService.js";
56
+ import { Colors as Mr } from "./utils/types.js";
57
+ import { getDOMSizeFromCodeZeroSize as Dr, hashToColor as Ar, mergeCode0Props as vr } from "./utils/utils.js";
59
58
  export {
60
59
  r as Alert,
61
60
  n as AuroraBackground,
62
61
  p as Avatar,
63
- i as Badge,
62
+ u as Badge,
64
63
  x as Breadcrumb,
65
64
  f as Button,
66
65
  g as ButtonGroup,
67
- c as Card,
66
+ b as Card,
68
67
  Ie as CheckboxInput,
69
68
  T as Col,
70
- vr as Colors,
69
+ Mr as Colors,
71
70
  s as Command,
72
71
  M as CommandDialog,
73
72
  I as CommandEmpty,
74
73
  D as CommandGroup,
75
- v as CommandInput,
76
- A as CommandItem,
74
+ A as CommandInput,
75
+ v as CommandItem,
77
76
  F as CommandList,
78
- y as CommandSeparator,
79
- P as CommandShortcut,
77
+ P as CommandSeparator,
78
+ R as CommandShortcut,
80
79
  L as Container,
81
80
  w as ContextMenu,
82
- B as ContextMenuArrow,
83
- G as ContextMenuContent,
84
- z as ContextMenuGroup,
81
+ G as ContextMenuArrow,
82
+ z as ContextMenuContent,
83
+ B as ContextMenuGroup,
85
84
  O as ContextMenuItem,
86
85
  k as ContextMenuLabel,
87
86
  E as ContextMenuPortal,
@@ -91,7 +90,7 @@ export {
91
90
  Q as ContextMenuSubTrigger,
92
91
  V as ContextMenuTrigger,
93
92
  mr as ContextStore,
94
- ir as ContextStoreProvider,
93
+ ur as ContextStoreProvider,
95
94
  q as DataTable,
96
95
  K as DataTableColumn,
97
96
  W as DataTableFilterInput,
@@ -104,42 +103,41 @@ export {
104
103
  ae as DialogHeader,
105
104
  pe as DialogOverlay,
106
105
  me as DialogPortal,
107
- ie as DialogTitle,
108
- ue as DialogTrigger,
106
+ ue as DialogTitle,
107
+ ie as DialogTrigger,
109
108
  le as Editor,
110
- ve as EmailInput,
109
+ Ae as EmailInput,
111
110
  Se as FileTabs,
112
- ce as FileTabsContent,
113
- be as FileTabsList,
111
+ be as FileTabsContent,
112
+ ce as FileTabsList,
114
113
  Ce as FileTabsService,
115
114
  Te as FileTabsTrigger,
116
115
  se as Flex,
117
116
  po as FullScreen,
118
- ye as Input,
119
- Re as InputDescription,
117
+ Pe as Input,
118
+ ye as InputDescription,
120
119
  he as InputLabel,
121
- Be as InputMessage,
122
- ze as InputSuggestionMenuContent,
120
+ Ge as InputMessage,
121
+ Be as InputSuggestionMenuContent,
123
122
  Oe as InputSuggestionMenuContentItems,
124
- fr as InspectionSeverity,
125
- io as Layout,
123
+ uo as Layout,
126
124
  xo as Menu,
127
125
  lo as MenuArrow,
128
126
  fo as MenuCheckboxItem,
129
127
  Co as MenuContent,
130
128
  go as MenuGroup,
131
129
  So as MenuItem,
132
- co as MenuItemIndicator,
133
- bo as MenuLabel,
130
+ bo as MenuItemIndicator,
131
+ co as MenuLabel,
134
132
  To as MenuPortal,
135
133
  so as MenuSeparator,
136
134
  Mo as MenuSub,
137
135
  Io as MenuSubContent,
138
136
  Do as MenuSubTrigger,
139
- vo as MenuTrigger,
140
- Sr as NonReactiveArrayService,
137
+ Ao as MenuTrigger,
138
+ fr as NonReactiveArrayService,
141
139
  Ee as NumberInput,
142
- Tr as ObjectService,
140
+ Sr as ObjectService,
143
141
  Ne as PasswordInput,
144
142
  Qe as PinInput,
145
143
  Ve as PinInputField,
@@ -147,13 +145,13 @@ export {
147
145
  Fo as Quote,
148
146
  Je as RadioGroup,
149
147
  Ue as RadioInput,
150
- Mr as ReactiveArrayService,
151
- Po as ResizableHandle,
152
- Ro as ResizablePanel,
148
+ Tr as ReactiveArrayService,
149
+ Ro as ResizableHandle,
150
+ yo as ResizablePanel,
153
151
  Lo as ResizablePanelGroup,
154
152
  wo as Row,
155
- Go as ScrollArea,
156
- zo as ScrollAreaCorner,
153
+ zo as ScrollArea,
154
+ Bo as ScrollAreaCorner,
157
155
  Oo as ScrollAreaScrollbar,
158
156
  ko as ScrollAreaThumb,
159
157
  Eo as ScrollAreaViewport,
@@ -176,16 +174,15 @@ export {
176
174
  ar as TooltipTrigger,
177
175
  no as buildDefaultSyntax,
178
176
  X as createFilterQueryLanguage,
179
- cr as createNonReactiveArrayService,
180
- dr as createObjectService,
181
- Ae as emailValidation,
182
- Fr as getDOMSizeFromCodeZeroSize,
183
- yr as hashToColor,
184
- Pr as mergeCode0Props,
177
+ Cr as createNonReactiveArrayService,
178
+ br as createObjectService,
179
+ ve as emailValidation,
180
+ Dr as getDOMSizeFromCodeZeroSize,
181
+ Ar as hashToColor,
182
+ vr as mergeCode0Props,
185
183
  $o as toast,
186
- Cr as underlineBySeverity,
187
184
  ro as useForm,
188
- Ir as useReactiveArrayService,
189
- ur as useService,
185
+ dr as useReactiveArrayService,
186
+ ir as useService,
190
187
  xr as useStore
191
188
  };
@@ -1,6 +1,5 @@
1
1
  export * from './arrayService';
2
2
  export * from './contextStore';
3
- export * from './inspection';
4
3
  export * from './nonReactiveArrayService';
5
4
  export * from './objectStore';
6
5
  export * from './reactiveArrayService';
@@ -1,25 +1,22 @@
1
- import { ContextStore as o, ContextStoreProvider as t, useService as i, useStore as c } from "./contextStore.js";
2
- import { InspectionSeverity as S, underlineBySeverity as a } from "./inspection.js";
3
- import { NonReactiveArrayService as p, createNonReactiveArrayService as x } from "./nonReactiveArrayService.js";
4
- import { ObjectService as f, createObjectService as s } from "./objectStore.js";
5
- import { ReactiveArrayService as C, useReactiveArrayService as d } from "./reactiveArrayService.js";
6
- import { Colors as A } from "./types.js";
7
- import { getDOMSizeFromCodeZeroSize as l, hashToColor as O, mergeCode0Props as b } from "./utils.js";
1
+ import { ContextStore as o, ContextStoreProvider as t, useService as c, useStore as i } from "./contextStore.js";
2
+ import { NonReactiveArrayService as S, createNonReactiveArrayService as a } from "./nonReactiveArrayService.js";
3
+ import { ObjectService as x, createObjectService as p } from "./objectStore.js";
4
+ import { ReactiveArrayService as s, useReactiveArrayService as C } from "./reactiveArrayService.js";
5
+ import { Colors as y } from "./types.js";
6
+ import { getDOMSizeFromCodeZeroSize as R, hashToColor as d, mergeCode0Props as u } from "./utils.js";
8
7
  export {
9
- A as Colors,
8
+ y as Colors,
10
9
  o as ContextStore,
11
10
  t as ContextStoreProvider,
12
- S as InspectionSeverity,
13
- p as NonReactiveArrayService,
14
- f as ObjectService,
15
- C as ReactiveArrayService,
16
- x as createNonReactiveArrayService,
17
- s as createObjectService,
18
- l as getDOMSizeFromCodeZeroSize,
19
- O as hashToColor,
20
- b as mergeCode0Props,
21
- a as underlineBySeverity,
22
- d as useReactiveArrayService,
23
- i as useService,
24
- c as useStore
11
+ S as NonReactiveArrayService,
12
+ x as ObjectService,
13
+ s as ReactiveArrayService,
14
+ a as createNonReactiveArrayService,
15
+ p as createObjectService,
16
+ R as getDOMSizeFromCodeZeroSize,
17
+ d as hashToColor,
18
+ u as mergeCode0Props,
19
+ C as useReactiveArrayService,
20
+ c as useService,
21
+ i as useStore
25
22
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@code0-tech/pictor",
3
- "version": "0.4.0",
3
+ "version": "0.5.1",
4
4
  "type": "module",
5
5
  "description": "A simple template for a custom React component library",
6
6
  "scripts": {
@@ -17,20 +17,17 @@
17
17
  },
18
18
  "author": "CodeZero",
19
19
  "devDependencies": {
20
- "@ariakit/react": "^0.4.22",
21
20
  "@babel/plugin-proposal-decorators": "^7.29.0",
22
21
  "@babel/plugin-transform-class-properties": "^7.28.6",
23
- "@code0-tech/sagittarius-graphql-types": "0.0.0-experimental-2342308809-931efb40b4bf3245999c53abbdd9164cea82e82d",
24
22
  "@codemirror/autocomplete": "^6.20.1",
25
23
  "@codemirror/lang-json": "^6.0.2",
26
- "@codemirror/language": "^6.12.2",
24
+ "@codemirror/language": "^6.12.3",
27
25
  "@codemirror/lint": "^6.9.5",
28
- "@codemirror/state": "^6.5.4",
29
- "@codemirror/view": "^6.39.16",
26
+ "@codemirror/state": "^6.6.0",
27
+ "@codemirror/view": "^6.40.0",
30
28
  "@dagrejs/dagre": "^2.0.4",
31
29
  "@lezer/common": "^1.5.1",
32
30
  "@mdx-js/react": "^3.1.1",
33
- "@monaco-editor/react": "^4.7.0",
34
31
  "@radix-ui/react-checkbox": "^1.3.3",
35
32
  "@radix-ui/react-context-menu": "^2.2.16",
36
33
  "@radix-ui/react-dialog": "^1.1.15",
@@ -42,54 +39,50 @@
42
39
  "@radix-ui/react-tabs": "^1.1.13",
43
40
  "@radix-ui/react-toggle-group": "^1.1.11",
44
41
  "@radix-ui/react-tooltip": "^1.2.8",
45
- "@rollup/plugin-commonjs": "^29.0.0",
42
+ "@rollup/plugin-commonjs": "^29.0.2",
46
43
  "@rollup/plugin-node-resolve": "^16.0.3",
47
- "@rollup/plugin-terser": "^0.4.4",
44
+ "@rollup/plugin-terser": "^1.0.0",
48
45
  "@rollup/plugin-typescript": "^12.3.0",
49
- "@storybook/addon-a11y": "^10.2.17",
50
- "@storybook/addon-docs": "^10.2.17",
51
- "@storybook/addon-links": "^10.2.17",
52
- "@storybook/addon-onboarding": "^10.2.17",
53
- "@storybook/addon-vitest": "^10.2.17",
54
- "@storybook/builder-vite": "^10.2.17",
55
- "@storybook/cli": "^10.2.17",
56
- "@storybook/react-vite": "^10.2.17",
46
+ "@storybook/addon-a11y": "^10.3.3",
47
+ "@storybook/addon-docs": "^10.3.3",
48
+ "@storybook/addon-links": "^10.3.3",
49
+ "@storybook/addon-onboarding": "^10.3.3",
50
+ "@storybook/addon-vitest": "^10.3.3",
51
+ "@storybook/builder-vite": "^10.3.3",
52
+ "@storybook/cli": "^10.3.3",
53
+ "@storybook/react-vite": "^10.3.3",
57
54
  "@tabler/icons-react": "3.40.0",
58
55
  "@types/jest-image-snapshot": "^6.4.1",
59
56
  "@types/react": "^19.2.14",
60
57
  "@types/react-dom": "^19.2.3",
61
58
  "@types/react-syntax-highlighter": "^15.5.13",
62
- "@uiw/codemirror-themes": "^4.25.8",
59
+ "@uiw/codemirror-themes": "^4.25.9",
63
60
  "@uiw/react-codemirror": "^4.25.8",
64
- "@vitejs/plugin-react": "^5.1.4",
61
+ "@vitejs/plugin-react": "^5.2.0",
65
62
  "@vitest/browser-playwright": "^4.0.18",
66
63
  "@vitest/coverage-v8": "^4.0.18",
67
64
  "@xyflow/react": "^12.10.1",
68
65
  "axe-playwright": "^2.2.2",
69
- "babel-loader": "^10.0.0",
66
+ "babel-loader": "^10.1.1",
70
67
  "babel-plugin-react-compiler": "^19.1.0-rc.3",
71
68
  "cmdk": "^1.1.1",
72
69
  "concurrently": "^9.2.1",
73
70
  "css-loader": "^7.1.4",
74
71
  "html-webpack-plugin": "^5.6.6",
75
72
  "identity-obj-proxy": "^3.0.0",
76
- "jest-image-snapshot": "^6.5.1",
73
+ "jest-image-snapshot": "^6.5.2",
77
74
  "js-md5": "^0.8.3",
78
- "ldrs": "^1.1.9",
79
75
  "merge-props": "^6.0.0",
80
- "overlap-area": "^1.1.0",
81
76
  "playwright": "1.58.1",
82
77
  "react": "^19.2.4",
83
- "react-contenteditable": "^3.3.7",
84
78
  "react-dom": "^19.2.4",
85
- "react-resizable-panels": "^4.7.1",
86
- "react-syntax-highlighter": "^16.1.1",
79
+ "react-resizable-panels": "^4.7.6",
87
80
  "react-zoom-pan-pinch": "^3.7.0",
88
81
  "rimraf": "^6.1.3",
89
- "sass": "^1.97.3",
82
+ "sass": "^1.98.0",
90
83
  "sass-loader": "^16.0.7",
91
84
  "sonner": "^2.0.7",
92
- "storybook": "^10.2.17",
85
+ "storybook": "^10.3.3",
93
86
  "style-loader": "^4.0.0",
94
87
  "ts-jest": "^29.4.6",
95
88
  "ts-node": "^10.9.2",
@@ -110,15 +103,12 @@
110
103
  ],
111
104
  "types": "dist/index.d.ts",
112
105
  "peerDependencies": {
113
- "@ariakit/react": "^0.4.17",
114
- "@code0-tech/sagittarius-graphql-types": "0.0.0-experimental-2342308809-931efb40b4bf3245999c53abbdd9164cea82e82d",
115
106
  "@codemirror/autocomplete": "^6.20.0",
116
107
  "@codemirror/lang-json": "^6.0.2",
117
108
  "@codemirror/language": "^6.12.1",
118
109
  "@codemirror/lint": "^6.9.4",
119
110
  "@codemirror/state": "^6.5.4",
120
111
  "@codemirror/view": "^6.39.13",
121
- "@monaco-editor/react": "^4.7.0",
122
112
  "@radix-ui/react-checkbox": "^1.3.3",
123
113
  "@radix-ui/react-context-menu": "^2.2.16",
124
114
  "@radix-ui/react-dialog": "^1.1.15",
@@ -136,14 +126,10 @@
136
126
  "@xyflow/react": "^12.10.0",
137
127
  "cmdk": "^1.1.1",
138
128
  "js-md5": "^0.8.3",
139
- "ldrs": "^1.1.9",
140
129
  "merge-props": "^6.0.0",
141
- "overlap-area": "^1.1.0",
142
130
  "react": "^18.0.0 || ^19.0.0",
143
- "react-contenteditable": "^3.3.7",
144
131
  "react-dom": "^18.0.0 || ^19.0.0",
145
132
  "react-resizable-panels": "^4.3.1",
146
- "react-syntax-highlighter": "^16.1.0",
147
133
  "react-zoom-pan-pinch": "^3.7.0",
148
134
  "sonner": "^2.0.7",
149
135
  "avvvatars-react": "^0.4.2"
@@ -1,15 +0,0 @@
1
- import { NodeParameter, Translation } from '@code0-tech/sagittarius-graphql-types';
2
- import { CSSProperties } from 'react';
3
- export declare enum InspectionSeverity {
4
- TYPO = 0,
5
- GRAMMAR = 1,
6
- WEAK = 2,
7
- WARNING = 3,
8
- ERROR = 4
9
- }
10
- export interface ValidationResult {
11
- parameterId: NodeParameter['id'];
12
- type: InspectionSeverity;
13
- message: Array<Translation>;
14
- }
15
- export declare const underlineBySeverity: Record<InspectionSeverity, CSSProperties>;
@@ -1,29 +0,0 @@
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
- };
26
- export {
27
- r as InspectionSeverity,
28
- g as underlineBySeverity
29
- };