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