@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 +4 -26
- package/dist/components/editor/Editor.d.ts +3 -1
- package/dist/components/editor/Editor.js +217 -229
- package/dist/index.js +60 -63
- package/dist/utils/index.d.ts +0 -1
- package/dist/utils/index.js +18 -21
- package/package.json +21 -35
- package/dist/utils/inspection.d.ts +0 -15
- package/dist/utils/inspection.js +0 -29
package/LICENSE
CHANGED
|
@@ -1,29 +1,7 @@
|
|
|
1
|
-
Copyright
|
|
1
|
+
Copyright 2023-2026 Code0 UG (haftungsbeschränkt) i.G.
|
|
2
2
|
|
|
3
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
2
|
-
import m, { isValidElement as
|
|
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
|
|
6
|
-
import
|
|
7
|
-
import { json as
|
|
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
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import { createTheme as
|
|
14
|
-
import {
|
|
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
|
|
17
|
-
import { IconExclamationCircle as
|
|
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
|
|
20
|
-
import { Tooltip as
|
|
21
|
-
import { ScrollArea as
|
|
22
|
-
import { autocompletion as
|
|
23
|
-
function
|
|
24
|
-
return (
|
|
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
|
|
27
|
-
var
|
|
28
|
-
return typeof
|
|
26
|
+
function qe(i) {
|
|
27
|
+
var t = We(i, "string");
|
|
28
|
+
return typeof t == "symbol" ? t : t + "";
|
|
29
29
|
}
|
|
30
|
-
function
|
|
30
|
+
function We(i, t) {
|
|
31
31
|
if (typeof i != "object" || !i) return i;
|
|
32
|
-
var
|
|
33
|
-
if (
|
|
34
|
-
var
|
|
35
|
-
if (typeof
|
|
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 (
|
|
38
|
+
return (t === "string" ? String : Number)(i);
|
|
39
39
|
}
|
|
40
|
-
class X extends
|
|
41
|
-
constructor(
|
|
42
|
-
super(), this.type =
|
|
40
|
+
class X extends be {
|
|
41
|
+
constructor(t, f) {
|
|
42
|
+
super(), this.type = t, this.rawValue = f;
|
|
43
43
|
}
|
|
44
44
|
toDOM() {
|
|
45
|
-
const
|
|
46
|
-
return
|
|
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(
|
|
52
|
-
return
|
|
51
|
+
eq(t) {
|
|
52
|
+
return t.type === this.type && t.rawValue === this.rawValue;
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
const
|
|
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:
|
|
90
|
-
tokenizer:
|
|
91
|
-
tokenHighlights:
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
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, [
|
|
105
|
-
|
|
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
|
|
109
|
-
parser:
|
|
110
|
-
plugins: [
|
|
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
|
-
|
|
82
|
+
}) : v;
|
|
83
|
+
I(e);
|
|
114
84
|
} catch {
|
|
115
|
-
|
|
85
|
+
I(t == "json" ? JSON.stringify(v) : v);
|
|
116
86
|
}
|
|
117
87
|
})();
|
|
118
|
-
}, [
|
|
119
|
-
const
|
|
120
|
-
const e = [...
|
|
121
|
-
if (
|
|
122
|
-
const
|
|
123
|
-
const
|
|
124
|
-
if (
|
|
125
|
-
const
|
|
126
|
-
return
|
|
127
|
-
component:
|
|
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:
|
|
130
|
-
left:
|
|
99
|
+
top: l.bottom,
|
|
100
|
+
left: l.left
|
|
131
101
|
}
|
|
132
102
|
}), null;
|
|
133
103
|
}
|
|
134
|
-
return
|
|
104
|
+
return y(null), c;
|
|
135
105
|
};
|
|
136
|
-
e.push(
|
|
106
|
+
e.push(Be({
|
|
137
107
|
...D ? {
|
|
138
|
-
override: [
|
|
108
|
+
override: [n]
|
|
139
109
|
} : {
|
|
140
|
-
override: [
|
|
110
|
+
override: [V]
|
|
141
111
|
}
|
|
142
112
|
})), e.push(_.highest(J.of([{
|
|
143
113
|
key: "Tab",
|
|
144
|
-
run:
|
|
114
|
+
run: Fe
|
|
145
115
|
}]))), D && e.push(_.highest(J.of([{
|
|
146
116
|
key: "ArrowUp",
|
|
147
|
-
run: (
|
|
117
|
+
run: (o) => (g || E(o), !0)
|
|
148
118
|
}, {
|
|
149
119
|
key: "ArrowDown",
|
|
150
|
-
run: (
|
|
120
|
+
run: (o) => g ? (R?.current?.querySelector("[tabindex]")?.focus(), !0) : (E(o), !0)
|
|
151
121
|
}])));
|
|
152
122
|
}
|
|
153
|
-
|
|
154
|
-
markerFilter: (
|
|
155
|
-
}))) :
|
|
156
|
-
const
|
|
157
|
-
constructor(
|
|
158
|
-
|
|
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(
|
|
161
|
-
(
|
|
130
|
+
update(n) {
|
|
131
|
+
(n.docChanged || n.viewportChanged) && (this.decorations = this.build(n.view));
|
|
162
132
|
}
|
|
163
|
-
build(
|
|
164
|
-
const
|
|
165
|
-
return L(
|
|
166
|
-
enter: (
|
|
167
|
-
const
|
|
168
|
-
if (
|
|
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
|
|
171
|
-
|
|
172
|
-
|
|
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
|
-
})) :
|
|
175
|
-
widget: new X(
|
|
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
|
-
}),
|
|
151
|
+
}), o.finish();
|
|
180
152
|
}
|
|
181
153
|
}, {
|
|
182
|
-
decorations: (
|
|
154
|
+
decorations: (n) => n.decorations
|
|
183
155
|
});
|
|
184
|
-
return e.push(
|
|
185
|
-
}, [
|
|
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:
|
|
190
|
-
to:
|
|
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:
|
|
198
|
-
to:
|
|
199
|
-
enter: (
|
|
200
|
-
|
|
169
|
+
from: o,
|
|
170
|
+
to: c,
|
|
171
|
+
enter: (h) => {
|
|
172
|
+
h.from >= o && h.to <= c && l++;
|
|
201
173
|
}
|
|
202
|
-
}), e.selectionSet && l < 2 ? (
|
|
203
|
-
from:
|
|
204
|
-
to:
|
|
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 && (
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
n
|
|
210
|
-
o.
|
|
211
|
-
|
|
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
|
-
},
|
|
228
|
-
return () => clearTimeout(e);
|
|
185
|
+
}), ie(n);
|
|
229
186
|
}
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
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
|
-
|
|
238
|
-
/* @__PURE__ */
|
|
239
|
-
/* @__PURE__ */
|
|
240
|
-
/* @__PURE__ */
|
|
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__ */
|
|
243
|
-
/* @__PURE__ */
|
|
244
|
-
|
|
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
|
-
|
|
248
|
-
/* @__PURE__ */
|
|
249
|
-
/* @__PURE__ */
|
|
250
|
-
/* @__PURE__ */
|
|
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__ */
|
|
253
|
-
/* @__PURE__ */
|
|
254
|
-
|
|
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
|
-
|
|
258
|
-
/* @__PURE__ */
|
|
259
|
-
/* @__PURE__ */
|
|
260
|
-
/* @__PURE__ */
|
|
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__ */
|
|
263
|
-
/* @__PURE__ */
|
|
264
|
-
|
|
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
|
-
|
|
268
|
-
/* @__PURE__ */
|
|
269
|
-
/* @__PURE__ */
|
|
270
|
-
/* @__PURE__ */
|
|
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__ */
|
|
273
|
-
/* @__PURE__ */
|
|
274
|
-
|
|
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
|
-
|
|
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(
|
|
270
|
+
/* @__PURE__ */ s(x, { style: {
|
|
283
271
|
gap: "0.35rem"
|
|
284
272
|
}, align: "center", children: [
|
|
285
|
-
/* @__PURE__ */ s(
|
|
286
|
-
/* @__PURE__ */
|
|
287
|
-
/* @__PURE__ */
|
|
288
|
-
/* @__PURE__ */
|
|
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__ */
|
|
278
|
+
/* @__PURE__ */ r(a, { children: "to show" })
|
|
291
279
|
] }),
|
|
292
|
-
/* @__PURE__ */
|
|
293
|
-
/* @__PURE__ */ s(
|
|
280
|
+
/* @__PURE__ */ r(a, { children: "and" }),
|
|
281
|
+
/* @__PURE__ */ s(x, { style: {
|
|
294
282
|
gap: "0.35rem"
|
|
295
283
|
}, align: "center", children: [
|
|
296
|
-
/* @__PURE__ */ s(
|
|
297
|
-
/* @__PURE__ */
|
|
298
|
-
/* @__PURE__ */
|
|
299
|
-
/* @__PURE__ */
|
|
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__ */
|
|
289
|
+
/* @__PURE__ */ r(a, { children: "to select" })
|
|
302
290
|
] }),
|
|
303
|
-
/* @__PURE__ */
|
|
291
|
+
/* @__PURE__ */ r(a, { children: "suggestions" })
|
|
304
292
|
] }) }),
|
|
305
|
-
/* @__PURE__ */
|
|
306
|
-
/* @__PURE__ */
|
|
307
|
-
if (
|
|
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
|
|
310
|
-
|
|
297
|
+
const d = JSON.parse(e);
|
|
298
|
+
q?.(d), Z?.setValue(d);
|
|
311
299
|
} catch {
|
|
312
300
|
}
|
|
313
301
|
else
|
|
314
|
-
|
|
315
|
-
}, onUpdate:
|
|
316
|
-
|
|
317
|
-
const
|
|
318
|
-
return
|
|
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:
|
|
321
|
-
content:
|
|
322
|
-
}) }, e.outerHTML +
|
|
308
|
+
}, children: n({
|
|
309
|
+
content: d.value
|
|
310
|
+
}) }, e.outerHTML + d.value), e) : null;
|
|
323
311
|
}),
|
|
324
|
-
|
|
312
|
+
g && K(/* @__PURE__ */ r("div", { ref: R, style: {
|
|
325
313
|
position: "fixed",
|
|
326
|
-
top:
|
|
327
|
-
left:
|
|
314
|
+
top: g.position.top,
|
|
315
|
+
left: g.position.left,
|
|
328
316
|
zIndex: 9999
|
|
329
|
-
}, children:
|
|
317
|
+
}, children: g.component }, g.position.top + "-" + g.position.left), document.body)
|
|
330
318
|
] }) }),
|
|
331
|
-
/* @__PURE__ */
|
|
332
|
-
/* @__PURE__ */
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
24
|
-
import { Input as
|
|
25
|
-
import { InputDescription as
|
|
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
|
|
28
|
-
import { InputSuggestionMenuContent as
|
|
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
|
|
41
|
-
import { Menu as xo, MenuArrow as lo, MenuCheckboxItem as fo, MenuContent as Co, MenuGroup as go, MenuItem as So, MenuItemIndicator as
|
|
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
|
|
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
|
|
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
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
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
|
-
|
|
62
|
+
u as Badge,
|
|
64
63
|
x as Breadcrumb,
|
|
65
64
|
f as Button,
|
|
66
65
|
g as ButtonGroup,
|
|
67
|
-
|
|
66
|
+
b as Card,
|
|
68
67
|
Ie as CheckboxInput,
|
|
69
68
|
T as Col,
|
|
70
|
-
|
|
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
|
-
|
|
76
|
-
|
|
74
|
+
A as CommandInput,
|
|
75
|
+
v as CommandItem,
|
|
77
76
|
F as CommandList,
|
|
78
|
-
|
|
79
|
-
|
|
77
|
+
P as CommandSeparator,
|
|
78
|
+
R as CommandShortcut,
|
|
80
79
|
L as Container,
|
|
81
80
|
w as ContextMenu,
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
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
|
-
|
|
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
|
-
|
|
108
|
-
|
|
106
|
+
ue as DialogTitle,
|
|
107
|
+
ie as DialogTrigger,
|
|
109
108
|
le as Editor,
|
|
110
|
-
|
|
109
|
+
Ae as EmailInput,
|
|
111
110
|
Se as FileTabs,
|
|
112
|
-
|
|
113
|
-
|
|
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
|
-
|
|
119
|
-
|
|
117
|
+
Pe as Input,
|
|
118
|
+
ye as InputDescription,
|
|
120
119
|
he as InputLabel,
|
|
121
|
-
|
|
122
|
-
|
|
120
|
+
Ge as InputMessage,
|
|
121
|
+
Be as InputSuggestionMenuContent,
|
|
123
122
|
Oe as InputSuggestionMenuContentItems,
|
|
124
|
-
|
|
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
|
-
|
|
133
|
-
|
|
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
|
-
|
|
140
|
-
|
|
137
|
+
Ao as MenuTrigger,
|
|
138
|
+
fr as NonReactiveArrayService,
|
|
141
139
|
Ee as NumberInput,
|
|
142
|
-
|
|
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
|
-
|
|
151
|
-
|
|
152
|
-
|
|
148
|
+
Tr as ReactiveArrayService,
|
|
149
|
+
Ro as ResizableHandle,
|
|
150
|
+
yo as ResizablePanel,
|
|
153
151
|
Lo as ResizablePanelGroup,
|
|
154
152
|
wo as Row,
|
|
155
|
-
|
|
156
|
-
|
|
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
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
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
|
-
|
|
189
|
-
|
|
185
|
+
dr as useReactiveArrayService,
|
|
186
|
+
ir as useService,
|
|
190
187
|
xr as useStore
|
|
191
188
|
};
|
package/dist/utils/index.d.ts
CHANGED
package/dist/utils/index.js
CHANGED
|
@@ -1,25 +1,22 @@
|
|
|
1
|
-
import { ContextStore as o, ContextStoreProvider as t, useService as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
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
|
-
|
|
8
|
+
y as Colors,
|
|
10
9
|
o as ContextStore,
|
|
11
10
|
t as ContextStoreProvider,
|
|
12
|
-
S as
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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.
|
|
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.
|
|
24
|
+
"@codemirror/language": "^6.12.3",
|
|
27
25
|
"@codemirror/lint": "^6.9.5",
|
|
28
|
-
"@codemirror/state": "^6.
|
|
29
|
-
"@codemirror/view": "^6.
|
|
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.
|
|
42
|
+
"@rollup/plugin-commonjs": "^29.0.2",
|
|
46
43
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
47
|
-
"@rollup/plugin-terser": "^0.
|
|
44
|
+
"@rollup/plugin-terser": "^1.0.0",
|
|
48
45
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
49
|
-
"@storybook/addon-a11y": "^10.
|
|
50
|
-
"@storybook/addon-docs": "^10.
|
|
51
|
-
"@storybook/addon-links": "^10.
|
|
52
|
-
"@storybook/addon-onboarding": "^10.
|
|
53
|
-
"@storybook/addon-vitest": "^10.
|
|
54
|
-
"@storybook/builder-vite": "^10.
|
|
55
|
-
"@storybook/cli": "^10.
|
|
56
|
-
"@storybook/react-vite": "^10.
|
|
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.
|
|
59
|
+
"@uiw/codemirror-themes": "^4.25.9",
|
|
63
60
|
"@uiw/react-codemirror": "^4.25.8",
|
|
64
|
-
"@vitejs/plugin-react": "^5.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
82
|
+
"sass": "^1.98.0",
|
|
90
83
|
"sass-loader": "^16.0.7",
|
|
91
84
|
"sonner": "^2.0.7",
|
|
92
|
-
"storybook": "^10.
|
|
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>;
|
package/dist/utils/inspection.js
DELETED
|
@@ -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
|
-
};
|