@code0-tech/pictor 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/compiler-runtime.js +5 -0
- package/dist/_virtual/compiler-runtime2.js +4 -0
- package/dist/_virtual/react-compiler-runtime.development.js +4 -0
- package/dist/_virtual/react-compiler-runtime.production.js +4 -0
- package/dist/assets/components/alert/Alert.style.css +1 -0
- package/dist/assets/components/aurora/Aurora.style.css +1 -0
- package/dist/assets/components/avatar/Avatar.style.css +1 -0
- package/dist/assets/components/badge/Badge.style.css +1 -0
- package/dist/assets/components/breadcrumb/Breadcrumb.style.css +1 -0
- package/dist/assets/components/button/Button.style.css +1 -0
- package/dist/assets/components/button-group/ButtonGroup.style.css +1 -0
- package/dist/assets/components/card/Card.style.css +1 -0
- package/dist/assets/components/col/Col.style.css +1 -0
- package/dist/assets/components/command/Command.style.css +1 -0
- package/dist/assets/components/container/Container.style.css +1 -0
- package/dist/assets/components/context-menu/ContextMenu.style.css +1 -0
- package/dist/assets/components/data-table/DataTable.style.css +1 -0
- package/dist/assets/components/dialog/Dialog.style.css +1 -0
- package/dist/assets/components/editor/Editor.styles.css +1 -0
- package/dist/assets/components/file-tabs/FileTabs.style.css +1 -0
- package/dist/assets/components/flex/Flex.style.css +1 -0
- package/dist/assets/components/form/Input.style.css +1 -0
- package/dist/assets/components/fullscreen/FullScreen.style.css +1 -0
- package/dist/assets/components/layout/Layout.style.css +1 -0
- package/dist/assets/components/menu/Menu.style.css +1 -0
- package/dist/assets/components/quote/Quote.style.css +1 -0
- package/dist/assets/components/resizable/Resizable.style.css +1 -0
- package/dist/assets/components/row/Row.style.css +1 -0
- package/dist/assets/components/scroll-area/ScrollArea.style.css +1 -0
- package/dist/assets/components/segmented-control/SegmentedControl.style.css +1 -0
- package/dist/assets/components/spacing/Spacing.style.css +1 -0
- package/dist/assets/components/tab/Tab.style.css +1 -0
- package/dist/assets/components/text/Text.style.css +1 -0
- package/dist/assets/components/toast/Toast.style.css +1 -0
- package/dist/assets/components/tooltip/Tooltip.style.css +1 -0
- package/dist/components/alert/Alert.d.ts +7 -0
- package/dist/components/alert/Alert.js +39 -0
- package/dist/components/aurora/Aurora.d.ts +5 -0
- package/dist/components/aurora/Aurora.js +23 -0
- package/dist/components/avatar/Avatar.d.ts +10 -0
- package/dist/components/avatar/Avatar.js +53 -0
- package/dist/components/badge/Badge.d.ts +8 -0
- package/dist/components/badge/Badge.js +63 -0
- package/dist/components/breadcrumb/Breadcrumb.d.ts +7 -0
- package/dist/components/breadcrumb/Breadcrumb.js +19 -0
- package/dist/components/button/Button.d.ts +11 -0
- package/dist/components/button/Button.js +31 -0
- package/dist/components/button-group/ButtonGroup.d.ts +8 -0
- package/dist/components/button-group/ButtonGroup.js +28 -0
- package/dist/components/card/Card.d.ts +15 -0
- package/dist/components/card/Card.js +42 -0
- package/dist/components/card/CardSection.d.ts +10 -0
- package/dist/components/card/CardSection.js +28 -0
- package/dist/{esm/components → components}/col/Col.d.ts +3 -5
- package/dist/components/col/Col.js +27 -0
- package/dist/components/command/Command.d.ts +30 -0
- package/dist/components/command/Command.js +103 -0
- package/dist/components/container/Container.d.ts +6 -0
- package/dist/components/container/Container.js +21 -0
- package/dist/components/context-menu/ContextMenu.d.ts +31 -0
- package/dist/components/context-menu/ContextMenu.js +106 -0
- 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 +212 -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/dialog/Dialog.d.ts +29 -0
- package/dist/components/dialog/Dialog.js +102 -0
- package/dist/components/editor/Editor.d.ts +29 -0
- package/dist/components/editor/Editor.js +337 -0
- package/dist/components/file-tabs/FileTabs.d.ts +17 -0
- package/dist/components/file-tabs/FileTabs.js +71 -0
- package/dist/components/file-tabs/FileTabs.service.d.ts +17 -0
- package/dist/components/file-tabs/FileTabs.service.js +88 -0
- package/dist/components/file-tabs/FileTabs.view.d.ts +10 -0
- package/dist/components/file-tabs/FileTabs.view.js +1 -0
- package/dist/components/file-tabs/index.d.ts +3 -0
- package/dist/components/file-tabs/index.js +9 -0
- package/dist/components/flex/Flex.d.ts +7 -0
- package/dist/components/flex/Flex.js +21 -0
- package/dist/components/form/CheckboxInput.d.ts +5 -0
- package/dist/components/form/CheckboxInput.js +76 -0
- package/dist/components/form/EmailInput.d.ts +8 -0
- package/dist/components/form/EmailInput.js +21 -0
- package/dist/components/form/Input.d.ts +35 -0
- package/dist/components/form/Input.js +434 -0
- package/dist/components/form/Input.syntax.hook.d.ts +10 -0
- package/dist/components/form/Input.syntax.hook.js +14 -0
- package/dist/components/form/Input.utils.d.ts +10 -0
- package/dist/components/form/Input.utils.js +38 -0
- package/dist/components/form/InputContentEditable.hook.d.ts +52 -0
- package/dist/components/form/InputContentEditable.hook.js +449 -0
- package/dist/components/form/InputDescription.d.ts +5 -0
- package/dist/components/form/InputDescription.js +12 -0
- package/dist/components/form/InputLabel.d.ts +5 -0
- package/dist/components/form/InputLabel.js +12 -0
- package/dist/components/form/InputMessage.d.ts +5 -0
- package/dist/components/form/InputMessage.js +18 -0
- package/dist/components/form/InputSuggestion.d.ts +27 -0
- package/dist/components/form/InputSuggestion.js +218 -0
- package/dist/components/form/NumberInput.d.ts +6 -0
- package/dist/components/form/NumberInput.js +20 -0
- package/dist/components/form/PasswordInput.d.ts +8 -0
- package/dist/components/form/PasswordInput.js +19 -0
- package/dist/components/form/PinInput.d.ts +11 -0
- package/dist/components/form/PinInput.js +66 -0
- package/dist/components/form/RadioGroup.d.ts +5 -0
- package/dist/components/form/RadioGroup.js +48 -0
- package/dist/components/form/RadioInput.d.ts +7 -0
- package/dist/components/form/RadioInput.js +27 -0
- package/dist/components/form/SwitchInput.d.ts +6 -0
- package/dist/components/form/SwitchInput.js +19 -0
- package/dist/components/form/TextAreaInput.d.ts +7 -0
- package/dist/components/form/TextAreaInput.js +20 -0
- package/dist/components/form/TextInput.d.ts +7 -0
- package/dist/components/form/TextInput.js +20 -0
- package/dist/components/form/index.d.ts +17 -0
- package/dist/components/form/index.js +40 -0
- package/dist/components/form/useForm.d.ts +30 -0
- package/dist/components/form/useForm.js +78 -0
- package/dist/components/fullscreen/FullScreen.d.ts +6 -0
- package/dist/components/fullscreen/FullScreen.js +26 -0
- package/dist/components/layout/Layout.d.ts +12 -0
- package/dist/components/layout/Layout.js +75 -0
- package/dist/components/menu/Menu.d.ts +35 -0
- package/dist/components/menu/Menu.js +120 -0
- package/dist/components/quote/Quote.d.ts +10 -0
- package/dist/components/quote/Quote.js +44 -0
- package/dist/components/resizable/Resizable.d.ts +12 -0
- package/dist/components/resizable/Resizable.js +34 -0
- package/dist/components/row/Row.d.ts +6 -0
- package/dist/components/row/Row.js +21 -0
- package/dist/components/scroll-area/ScrollArea.d.ts +13 -0
- package/dist/components/scroll-area/ScrollArea.js +43 -0
- package/dist/components/segmented-control/SegmentedControl.d.ts +10 -0
- package/dist/components/segmented-control/SegmentedControl.js +26 -0
- package/dist/components/spacing/Spacing.d.ts +6 -0
- package/dist/components/spacing/Spacing.js +23 -0
- package/dist/components/tab/Tab.d.ts +11 -0
- package/dist/components/tab/Tab.js +40 -0
- package/dist/components/text/Text.d.ts +8 -0
- package/dist/components/text/Text.js +23 -0
- package/dist/components/toast/Toast.d.ts +13 -0
- package/dist/components/toast/Toast.js +66 -0
- package/dist/components/tooltip/Tooltip.d.ts +17 -0
- package/dist/components/tooltip/Tooltip.js +48 -0
- package/dist/index.d.ts +33 -305
- package/dist/index.js +191 -0
- package/dist/node_modules/@lezer/common/dist/index.js +146 -0
- package/dist/node_modules/@lezer/highlight/dist/index.js +543 -0
- package/dist/node_modules/prettier/plugins/babel.js +7157 -0
- package/dist/node_modules/prettier/plugins/estree.js +4453 -0
- package/dist/node_modules/prettier/standalone.js +2429 -0
- package/dist/node_modules/react/cjs/react-compiler-runtime.development.js +21 -0
- package/dist/node_modules/react/cjs/react-compiler-runtime.production.js +14 -0
- package/dist/node_modules/react/compiler-runtime.js +10 -0
- package/dist/utils/arrayService.d.ts +10 -0
- package/dist/utils/arrayService.js +1 -0
- package/dist/utils/contextStore.d.ts +62 -0
- package/dist/utils/contextStore.js +60 -0
- package/dist/utils/index.d.ts +8 -0
- package/dist/utils/index.js +25 -0
- package/dist/utils/inspection.d.ts +15 -0
- package/dist/utils/inspection.js +29 -0
- package/dist/utils/nonReactiveArrayService.d.ts +19 -0
- package/dist/utils/nonReactiveArrayService.js +54 -0
- package/dist/utils/objectStore.d.ts +12 -0
- package/dist/utils/objectStore.js +34 -0
- package/dist/utils/reactiveArrayService.d.ts +23 -0
- package/dist/utils/reactiveArrayService.js +90 -0
- package/dist/{cjs/utils → utils}/types.d.ts +4 -4
- package/dist/utils/types.js +4 -0
- package/dist/utils/utils.d.ts +55 -0
- package/dist/utils/utils.js +159 -0
- package/dist/utils/view.d.ts +8 -0
- package/dist/utils/view.js +28 -0
- package/package.json +130 -54
- package/dist/cjs/components/Text/Text.d.ts +0 -10
- package/dist/cjs/components/alert/Alert.d.ts +0 -16
- package/dist/cjs/components/badge/Badge.d.ts +0 -9
- package/dist/cjs/components/button/Button.d.ts +0 -17
- package/dist/cjs/components/button-group/ButtonGroup.d.ts +0 -9
- package/dist/cjs/components/card/Card.d.ts +0 -20
- package/dist/cjs/components/col/Col.d.ts +0 -15
- package/dist/cjs/components/container/Container.d.ts +0 -8
- package/dist/cjs/components/dropdown/Dropdown.d.ts +0 -24
- package/dist/cjs/components/dropdown/DropdownFooter.d.ts +0 -13
- package/dist/cjs/components/dropdown/DropdownHeader.d.ts +0 -13
- package/dist/cjs/components/dropdown/DropdownItem.d.ts +0 -12
- package/dist/cjs/components/dropdown/DropdownItemGroup.d.ts +0 -12
- package/dist/cjs/components/flex/Flex.d.ts +0 -8
- package/dist/cjs/components/input/Input.d.ts +0 -37
- package/dist/cjs/components/list-group/ListGroup.d.ts +0 -12
- package/dist/cjs/components/menu/InternalMenu.d.ts +0 -4
- package/dist/cjs/components/menu/Menu.d.ts +0 -41
- package/dist/cjs/components/popover/InternalPopover.d.ts +0 -10
- package/dist/cjs/components/popover/Popover.d.ts +0 -16
- package/dist/cjs/components/quote/Quote.d.ts +0 -12
- package/dist/cjs/components/row/Row.d.ts +0 -8
- package/dist/cjs/components/tooltip/Tooltip.d.ts +0 -18
- package/dist/cjs/index.d.ts +0 -17
- package/dist/cjs/index.js +0 -9284
- package/dist/cjs/utils/utils.d.ts +0 -18
- package/dist/esm/components/Text/Text.d.ts +0 -10
- package/dist/esm/components/alert/Alert.d.ts +0 -16
- package/dist/esm/components/badge/Badge.d.ts +0 -9
- package/dist/esm/components/button/Button.d.ts +0 -17
- package/dist/esm/components/button-group/ButtonGroup.d.ts +0 -9
- package/dist/esm/components/card/Card.d.ts +0 -20
- package/dist/esm/components/container/Container.d.ts +0 -8
- package/dist/esm/components/dropdown/Dropdown.d.ts +0 -24
- package/dist/esm/components/dropdown/DropdownFooter.d.ts +0 -13
- package/dist/esm/components/dropdown/DropdownHeader.d.ts +0 -13
- package/dist/esm/components/dropdown/DropdownItem.d.ts +0 -12
- package/dist/esm/components/dropdown/DropdownItemGroup.d.ts +0 -12
- package/dist/esm/components/flex/Flex.d.ts +0 -8
- package/dist/esm/components/input/Input.d.ts +0 -37
- package/dist/esm/components/list-group/ListGroup.d.ts +0 -12
- package/dist/esm/components/menu/InternalMenu.d.ts +0 -4
- package/dist/esm/components/menu/Menu.d.ts +0 -41
- package/dist/esm/components/popover/InternalPopover.d.ts +0 -10
- package/dist/esm/components/popover/Popover.d.ts +0 -16
- package/dist/esm/components/quote/Quote.d.ts +0 -12
- package/dist/esm/components/row/Row.d.ts +0 -8
- package/dist/esm/components/tooltip/Tooltip.d.ts +0 -18
- package/dist/esm/index.d.ts +0 -17
- package/dist/esm/index.js +0 -9259
- package/dist/esm/utils/types.d.ts +0 -57
- package/dist/esm/utils/utils.d.ts +0 -18
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { c as Q } from "../../_virtual/compiler-runtime.js";
|
|
3
|
+
import { Editor as z } from "../editor/Editor.js";
|
|
4
|
+
import { StreamLanguage as U, syntaxTree as J } from "@codemirror/language";
|
|
5
|
+
import { EditorState as K } from "@uiw/react-codemirror";
|
|
6
|
+
import { Badge as b } from "../badge/Badge.js";
|
|
7
|
+
import { DataTableFilterSuggestionMenu as j } from "./DataTableFilterSuggestionMenu.js";
|
|
8
|
+
import { MenuItem as G } from "../menu/Menu.js";
|
|
9
|
+
import "../../utils/contextStore.js";
|
|
10
|
+
import "react";
|
|
11
|
+
import { hashToColor as X } from "../../utils/utils.js";
|
|
12
|
+
const $ = {
|
|
13
|
+
"=": "isOneOf",
|
|
14
|
+
"!=": "isNotOneOf"
|
|
15
|
+
}, H = {
|
|
16
|
+
isOneOf: "is one of",
|
|
17
|
+
isNotOneOf: "is not one of"
|
|
18
|
+
}, Y = {
|
|
19
|
+
isOneOf: "=",
|
|
20
|
+
isNotOneOf: "!="
|
|
21
|
+
}, y = (r) => r.replace(/^\\|\\$/g, ""), Z = (r) => U.define({
|
|
22
|
+
startState: () => ({
|
|
23
|
+
tokens: []
|
|
24
|
+
}),
|
|
25
|
+
token(e, n) {
|
|
26
|
+
if (e.eatSpace()) return null;
|
|
27
|
+
if (e.match("!=") || e.match("=") && e.peek() !== "=")
|
|
28
|
+
return n.tokens.push("operator"), "operator";
|
|
29
|
+
if (e.peek() === "\\") {
|
|
30
|
+
e.next();
|
|
31
|
+
const k = [];
|
|
32
|
+
for (; !e.eol() && e.peek() !== "\\"; ) k.push(e.next());
|
|
33
|
+
if (e.peek() === "\\") {
|
|
34
|
+
e.next();
|
|
35
|
+
const S = k.join("");
|
|
36
|
+
if (r.includes(S) && n.tokens[n.tokens.length - 1] !== "propertyName")
|
|
37
|
+
return n.tokens.push("propertyName"), "propertyName";
|
|
38
|
+
if (n.tokens[n.tokens.length - 1] !== "literal")
|
|
39
|
+
return n.tokens.push("literal"), "literal";
|
|
40
|
+
}
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
return e.next(), null;
|
|
44
|
+
}
|
|
45
|
+
}), ye = (r) => {
|
|
46
|
+
const e = Q.c(17), {
|
|
47
|
+
filterTokens: n,
|
|
48
|
+
onChange: k
|
|
49
|
+
} = r;
|
|
50
|
+
let S;
|
|
51
|
+
e[0] !== n ? (S = Z(n?.map(q) || []), e[0] = n, e[1] = S) : S = e[1];
|
|
52
|
+
const A = S;
|
|
53
|
+
let v;
|
|
54
|
+
e[2] !== n ? (v = (o) => {
|
|
55
|
+
if (!o.trim())
|
|
56
|
+
return {};
|
|
57
|
+
const d = {}, l = o.split(/\\/).filter(Boolean);
|
|
58
|
+
for (let i = 0; i + 2 < l.length; i = i + 3, i) {
|
|
59
|
+
const p = l[i], a = l[i + 1], _ = l[i + 2];
|
|
60
|
+
if (!p || !a || !_)
|
|
61
|
+
continue;
|
|
62
|
+
const L = n?.find((t) => t.token === p);
|
|
63
|
+
if (!L)
|
|
64
|
+
continue;
|
|
65
|
+
const h = $[a];
|
|
66
|
+
if (!h)
|
|
67
|
+
continue;
|
|
68
|
+
const O = _.split(",").map(x).filter(Boolean);
|
|
69
|
+
O.length > 0 && (d[L.key] = {
|
|
70
|
+
operator: h,
|
|
71
|
+
value: O
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
return d;
|
|
75
|
+
}, e[2] = n, e[3] = v) : v = e[3];
|
|
76
|
+
const B = v;
|
|
77
|
+
let w;
|
|
78
|
+
e[4] !== k || e[5] !== B ? (w = (o) => {
|
|
79
|
+
const d = B(o);
|
|
80
|
+
k?.(d);
|
|
81
|
+
}, e[4] = k, e[5] = B, e[6] = w) : w = e[6];
|
|
82
|
+
const F = w;
|
|
83
|
+
let C;
|
|
84
|
+
e[7] !== n ? (C = (o) => {
|
|
85
|
+
const d = J(o.state), l = d.resolveInner(o.pos, -1), i = d.resolveInner(o.pos, 1), {
|
|
86
|
+
propertyNode: p,
|
|
87
|
+
operatorNode: a
|
|
88
|
+
} = (() => {
|
|
89
|
+
const t = {
|
|
90
|
+
propertyNode: null,
|
|
91
|
+
operatorNode: null
|
|
92
|
+
};
|
|
93
|
+
for (let s = l; s; s = s.prevSibling)
|
|
94
|
+
s.name === "propertyName" && !t.propertyNode && (t.propertyNode = s), s.name === "operator" && !t.operatorNode && (t.operatorNode = s);
|
|
95
|
+
return t;
|
|
96
|
+
})(), _ = p ? o.pos < p.to ? "propertyName" : o.pos === p.to ? "operator" : a ? o.pos < a.to ? "operator" : o.pos === a.to ? "literal" : l.name === "literal" ? "propertyName" : l.name === "invalid" && o.state.sliceDoc(l.from, l.to).startsWith("\\") ? "literal" : (() => {
|
|
97
|
+
const t = o.state.sliceDoc(a.to, o.pos);
|
|
98
|
+
return t.trim() ? t.includes(" ") ? "propertyName" : "literal" : t.length > 0 ? "propertyName" : "literal";
|
|
99
|
+
})() : (i.name === "operator", "operator") : "propertyName", L = p ? y(o.state.sliceDoc(p.from, p.to)) : "", h = n?.find((t) => t.token === L), O = (t, s, c, g) => {
|
|
100
|
+
g ? o.view?.dispatch({
|
|
101
|
+
changes: {
|
|
102
|
+
from: t,
|
|
103
|
+
to: s,
|
|
104
|
+
insert: c
|
|
105
|
+
},
|
|
106
|
+
selection: {
|
|
107
|
+
anchor: o.pos
|
|
108
|
+
},
|
|
109
|
+
scrollIntoView: !1
|
|
110
|
+
}) : (o.view?.dispatch({
|
|
111
|
+
changes: {
|
|
112
|
+
from: t,
|
|
113
|
+
to: s,
|
|
114
|
+
insert: c
|
|
115
|
+
},
|
|
116
|
+
selection: {
|
|
117
|
+
anchor: t + c.length
|
|
118
|
+
},
|
|
119
|
+
scrollIntoView: !0
|
|
120
|
+
}), o.view?.focus());
|
|
121
|
+
};
|
|
122
|
+
if (_ === "propertyName") {
|
|
123
|
+
const t = /* @__PURE__ */ new Set(), s = o.matchBefore(/\\?[\w-]*/), c = s ? s.from : o.pos, g = p && o.pos <= p.to, N = i.name === "propertyName" ? i.to : g ? p.to : o.pos, m = g && p.from < c ? p.from : c, W = y(o.state.sliceDoc(m, o.pos)), R = n?.filter((f) => f.token.startsWith(W) && !t.has(f.token)) || [];
|
|
124
|
+
if (d.iterate({
|
|
125
|
+
enter: (f) => {
|
|
126
|
+
f.name === "propertyName" && t.add(y(o.state.sliceDoc(f.from, f.to)));
|
|
127
|
+
}
|
|
128
|
+
}), R.length)
|
|
129
|
+
return /* @__PURE__ */ u(j, { context: o, children: R.map((f) => /* @__PURE__ */ u(G, { onSelect: () => {
|
|
130
|
+
let M = `\\${f.token}\\`;
|
|
131
|
+
l.name === "literal" && o.state.sliceDoc(N, N + 1) !== "\\" && (M = "\\" + M), O(m, N, M);
|
|
132
|
+
}, children: f.token }, f.token)) });
|
|
133
|
+
}
|
|
134
|
+
if (_ === "operator" && h) {
|
|
135
|
+
const t = o.matchBefore(/[!=]+/), s = t ? t.from : o.pos, c = a && o.pos <= a.to, g = i.name === "operator" ? i.to : c ? a.to : o.pos, N = c && a.from < s ? a.from : s;
|
|
136
|
+
return /* @__PURE__ */ u(j, { context: o, children: h.operators.map((m) => /* @__PURE__ */ u(G, { onSelect: () => O(N, g, Y[m]), children: H[m] }, m)) });
|
|
137
|
+
}
|
|
138
|
+
if (_ === "literal" && h?.suggestion) {
|
|
139
|
+
const t = a ? o.state.sliceDoc(a.from, a.to) : "", s = $[t];
|
|
140
|
+
if (s && h.operators.includes(s)) {
|
|
141
|
+
const c = i.name === "literal" ? o.state.sliceDoc(i.from, i.to) : "";
|
|
142
|
+
return h.suggestion(o, s, y(c), (g, N) => {
|
|
143
|
+
const m = l.name === "literal" || l.name === "invalid" && o.state.sliceDoc(l.from, l.to).startsWith("\\"), W = m ? l.from : o.pos, R = m ? l.to : i.name === "literal" ? i.to : o.pos;
|
|
144
|
+
O(W, R, `\\${g}\\`, N);
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
return null;
|
|
149
|
+
}, e[7] = n, e[8] = C) : C = e[8];
|
|
150
|
+
const V = C;
|
|
151
|
+
let D, I;
|
|
152
|
+
e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (D = {
|
|
153
|
+
backgroundColor: "rgba(255,255,255,.1)",
|
|
154
|
+
padding: "0.35rem",
|
|
155
|
+
boxSizing: "border-box",
|
|
156
|
+
borderRadius: "1rem",
|
|
157
|
+
boxShadow: "inset 0 1px 1px 0 rgba(255,255,255,.2)"
|
|
158
|
+
}, I = {
|
|
159
|
+
literal: oe,
|
|
160
|
+
operator: te,
|
|
161
|
+
propertyName: re
|
|
162
|
+
}, e[9] = D, e[10] = I) : (D = e[9], I = e[10]);
|
|
163
|
+
let T, E;
|
|
164
|
+
e[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (T = [K.transactionFilter.of(ne)], E = {
|
|
165
|
+
lineNumbers: !1,
|
|
166
|
+
foldGutter: !1,
|
|
167
|
+
highlightActiveLine: !1,
|
|
168
|
+
highlightActiveLineGutter: !1,
|
|
169
|
+
dropCursor: !1,
|
|
170
|
+
indentOnInput: !1
|
|
171
|
+
}, e[11] = T, e[12] = E) : (T = e[11], E = e[12]);
|
|
172
|
+
let P;
|
|
173
|
+
return e[13] !== V || e[14] !== F || e[15] !== A ? (P = /* @__PURE__ */ u(z, { w: "100%", initialValue: "", onChange: F, style: D, tokenHighlights: I, showTooltips: !1, showValidation: !1, customSuggestionComponent: !0, suggestions: V, extensions: T, basicSetup: E, language: A }), e[13] = V, e[14] = F, e[15] = A, e[16] = P) : P = e[16], P;
|
|
174
|
+
};
|
|
175
|
+
function q(r) {
|
|
176
|
+
return r.token;
|
|
177
|
+
}
|
|
178
|
+
function x(r) {
|
|
179
|
+
return r.trim();
|
|
180
|
+
}
|
|
181
|
+
function ee(r) {
|
|
182
|
+
return /* @__PURE__ */ u(b, { style: {
|
|
183
|
+
boxShadow: "none"
|
|
184
|
+
}, color: "secondary", children: r }, r);
|
|
185
|
+
}
|
|
186
|
+
function oe(r) {
|
|
187
|
+
const {
|
|
188
|
+
content: e
|
|
189
|
+
} = r, n = y(e).split(",");
|
|
190
|
+
return n.length > 1 ? /* @__PURE__ */ u(b, { p: 0.175, mx: 0.175, children: n.map(ee) }) : /* @__PURE__ */ u(b, { mx: 0.175, children: y(e) });
|
|
191
|
+
}
|
|
192
|
+
function te(r) {
|
|
193
|
+
const {
|
|
194
|
+
content: e
|
|
195
|
+
} = r;
|
|
196
|
+
return /* @__PURE__ */ u(b, { color: "tertiary", style: {
|
|
197
|
+
boxShadow: "none"
|
|
198
|
+
}, children: H[$[e]] || e });
|
|
199
|
+
}
|
|
200
|
+
function re(r) {
|
|
201
|
+
const {
|
|
202
|
+
content: e
|
|
203
|
+
} = r;
|
|
204
|
+
return /* @__PURE__ */ u(b, { mx: 0.175, color: X(y(e)), children: y(e) });
|
|
205
|
+
}
|
|
206
|
+
function ne(r) {
|
|
207
|
+
return r.docChanged && r.newDoc.lines > 1 ? [] : r;
|
|
208
|
+
}
|
|
209
|
+
export {
|
|
210
|
+
ye as DataTableFilterInput,
|
|
211
|
+
Z as createFilterQueryLanguage
|
|
212
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { CompletionContext } from '@codemirror/autocomplete';
|
|
3
|
+
export interface DataTableFilterSuggestionMenuProps {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
context?: CompletionContext;
|
|
6
|
+
}
|
|
7
|
+
export declare const DataTableFilterSuggestionMenu: React.FC<DataTableFilterSuggestionMenuProps>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { jsx as f, jsxs as d } from "react/jsx-runtime";
|
|
2
|
+
import { c as v } from "../../_virtual/compiler-runtime.js";
|
|
3
|
+
import w from "react";
|
|
4
|
+
import { MenuTrigger as y, MenuContent as _, Menu as g } from "../menu/Menu.js";
|
|
5
|
+
const T = (t) => {
|
|
6
|
+
const e = v.c(11), {
|
|
7
|
+
children: l,
|
|
8
|
+
context: m
|
|
9
|
+
} = t, [u, p] = w.useState(!0), h = _;
|
|
10
|
+
let r;
|
|
11
|
+
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (r = (a) => p(a), e[0] = r) : r = e[0];
|
|
12
|
+
let i;
|
|
13
|
+
e[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ f(y, { asChild: !0, children: /* @__PURE__ */ f("div", { style: {
|
|
14
|
+
position: "absolute",
|
|
15
|
+
top: 0,
|
|
16
|
+
left: 0,
|
|
17
|
+
width: 0,
|
|
18
|
+
height: 0
|
|
19
|
+
} }) }), e[1] = i) : i = e[1];
|
|
20
|
+
let n;
|
|
21
|
+
e[2] !== m?.view ? (n = (a) => {
|
|
22
|
+
["Escape", "ArrowUp", "ArrowDown"].includes(a.key) || m?.view?.focus();
|
|
23
|
+
}, e[2] = m?.view, e[3] = n) : n = e[3];
|
|
24
|
+
let s;
|
|
25
|
+
e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (s = {
|
|
26
|
+
position: "fixed",
|
|
27
|
+
top: 0,
|
|
28
|
+
left: 0,
|
|
29
|
+
pointerEvents: "auto"
|
|
30
|
+
}, e[4] = s) : s = e[4];
|
|
31
|
+
let o;
|
|
32
|
+
e[5] !== l || e[6] !== n ? (o = /* @__PURE__ */ f(h, { miw: "200px", onInteractOutside: b, onOpenAutoFocus: D, onKeyDown: n, style: s, children: l }), e[5] = l, e[6] = n, e[7] = o) : o = e[7];
|
|
33
|
+
let c;
|
|
34
|
+
return e[8] !== u || e[9] !== o ? (c = /* @__PURE__ */ d(g, { open: u, onOpenChange: r, modal: !1, children: [
|
|
35
|
+
i,
|
|
36
|
+
o
|
|
37
|
+
] }), e[8] = u, e[9] = o, e[10] = c) : c = e[10], c;
|
|
38
|
+
};
|
|
39
|
+
function x(t) {
|
|
40
|
+
return t;
|
|
41
|
+
}
|
|
42
|
+
function S(t) {
|
|
43
|
+
return t.startsWith("cm-");
|
|
44
|
+
}
|
|
45
|
+
function b(t) {
|
|
46
|
+
Array.from(t.currentTarget.classList).map(x).some(S) && t.preventDefault();
|
|
47
|
+
}
|
|
48
|
+
function D(t) {
|
|
49
|
+
t.preventDefault(), t.currentTarget.querySelector('[role="menuitem"]')?.focus();
|
|
50
|
+
}
|
|
51
|
+
export {
|
|
52
|
+
T as DataTableFilterSuggestionMenu
|
|
53
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DataTable as t } from "./DataTable.js";
|
|
2
|
+
import { DataTableColumn as o } from "./DataTableColumn.js";
|
|
3
|
+
import { DataTableFilterInput as u, createFilterQueryLanguage as m } from "./DataTableFilterInput.js";
|
|
4
|
+
import { DataTableFilterSuggestionMenu as p } from "./DataTableFilterSuggestionMenu.js";
|
|
5
|
+
export {
|
|
6
|
+
t as DataTable,
|
|
7
|
+
o as DataTableColumn,
|
|
8
|
+
u as DataTableFilterInput,
|
|
9
|
+
p as DataTableFilterSuggestionMenu,
|
|
10
|
+
m as createFilterQueryLanguage
|
|
11
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Code0Component, Code0ComponentProps } from '../../utils';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
4
|
+
export type DialogProps = Code0ComponentProps & React.ComponentProps<typeof DialogPrimitive.Root>;
|
|
5
|
+
export type DialogTriggerProps = Code0ComponentProps & React.ComponentProps<typeof DialogPrimitive.Trigger>;
|
|
6
|
+
export type DialogPortalProps = Code0ComponentProps & React.ComponentProps<typeof DialogPrimitive.Portal>;
|
|
7
|
+
export type DialogCloseProps = Code0ComponentProps & React.ComponentProps<typeof DialogPrimitive.Close>;
|
|
8
|
+
export type DialogOverlayProps = Code0ComponentProps & React.ComponentProps<typeof DialogPrimitive.Overlay>;
|
|
9
|
+
export type DialogTitleProps = Code0ComponentProps & React.ComponentProps<typeof DialogPrimitive.Title>;
|
|
10
|
+
export type DialogDescriptionProps = Code0ComponentProps & React.ComponentProps<typeof DialogPrimitive.Description>;
|
|
11
|
+
export type DialogHeaderProps = Code0ComponentProps & React.ComponentProps<"div">;
|
|
12
|
+
export type DialogFooterProps = Code0ComponentProps & React.ComponentProps<"div">;
|
|
13
|
+
export type DialogContentProps = Code0ComponentProps & React.ComponentProps<typeof DialogPrimitive.Content> & {
|
|
14
|
+
showCloseButton?: boolean;
|
|
15
|
+
title?: string;
|
|
16
|
+
};
|
|
17
|
+
export type DialogStickyContentProps = Code0Component<HTMLDivElement> & {
|
|
18
|
+
children: React.ReactNode | React.ReactNode[];
|
|
19
|
+
};
|
|
20
|
+
export declare const Dialog: React.FC<DialogProps>;
|
|
21
|
+
export declare const DialogTrigger: React.FC<DialogTriggerProps>;
|
|
22
|
+
export declare const DialogPortal: React.FC<DialogPortalProps>;
|
|
23
|
+
export declare const DialogClose: React.FC<DialogCloseProps>;
|
|
24
|
+
export declare const DialogOverlay: React.FC<DialogOverlayProps>;
|
|
25
|
+
export declare const DialogContent: React.FC<DialogContentProps>;
|
|
26
|
+
export declare const DialogTitle: React.FC<DialogTitleProps>;
|
|
27
|
+
export declare const DialogDescription: React.FC<DialogDescriptionProps>;
|
|
28
|
+
export declare const DialogHeader: React.FC<DialogHeaderProps>;
|
|
29
|
+
export declare const DialogFooter: React.FC<DialogFooterProps>;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { jsx as n, jsxs as f } from "react/jsx-runtime";
|
|
2
|
+
import { c } from "../../_virtual/compiler-runtime.js";
|
|
3
|
+
import * as s from "@radix-ui/react-dialog";
|
|
4
|
+
import "../../utils/contextStore.js";
|
|
5
|
+
import "react";
|
|
6
|
+
import { mergeCode0Props as r } from "../../utils/utils.js";
|
|
7
|
+
import { IconX as g } from "@tabler/icons-react";
|
|
8
|
+
import '../../assets/components/dialog/Dialog.style.css';/* empty css */
|
|
9
|
+
import { Button as d } from "../button/Button.js";
|
|
10
|
+
import { Flex as m } from "../flex/Flex.js";
|
|
11
|
+
import { Text as _ } from "../text/Text.js";
|
|
12
|
+
const P = (i) => {
|
|
13
|
+
const t = c.c(4);
|
|
14
|
+
let l;
|
|
15
|
+
t[0] !== i ? (l = r("dialog", i), t[0] = i, t[1] = l) : l = t[1];
|
|
16
|
+
const o = l;
|
|
17
|
+
let e;
|
|
18
|
+
return t[2] !== o ? (e = /* @__PURE__ */ n(s.Root, { ...o }), t[2] = o, t[3] = e) : e = t[3], e;
|
|
19
|
+
}, j = (i) => {
|
|
20
|
+
const t = c.c(4);
|
|
21
|
+
let l;
|
|
22
|
+
t[0] !== i ? (l = r("dialog__trigger", i), t[0] = i, t[1] = l) : l = t[1];
|
|
23
|
+
const o = l;
|
|
24
|
+
let e;
|
|
25
|
+
return t[2] !== o ? (e = /* @__PURE__ */ n(s.Trigger, { ...o }), t[2] = o, t[3] = e) : e = t[3], e;
|
|
26
|
+
}, z = (i) => {
|
|
27
|
+
const t = c.c(4);
|
|
28
|
+
let l;
|
|
29
|
+
t[0] !== i ? (l = r("dialog__portal", i), t[0] = i, t[1] = l) : l = t[1];
|
|
30
|
+
const o = l;
|
|
31
|
+
let e;
|
|
32
|
+
return t[2] !== o ? (e = /* @__PURE__ */ n(s.Portal, { ...o }), t[2] = o, t[3] = e) : e = t[3], e;
|
|
33
|
+
}, u = (i) => {
|
|
34
|
+
const t = c.c(4);
|
|
35
|
+
let l;
|
|
36
|
+
t[0] !== i ? (l = r("dialog__close", i), t[0] = i, t[1] = l) : l = t[1];
|
|
37
|
+
const o = l;
|
|
38
|
+
let e;
|
|
39
|
+
return t[2] !== o ? (e = /* @__PURE__ */ n(s.Close, { ...o }), t[2] = o, t[3] = e) : e = t[3], e;
|
|
40
|
+
}, F = (i) => {
|
|
41
|
+
const t = c.c(4);
|
|
42
|
+
let l;
|
|
43
|
+
t[0] !== i ? (l = r("dialog__overlay", i), t[0] = i, t[1] = l) : l = t[1];
|
|
44
|
+
const o = l;
|
|
45
|
+
let e;
|
|
46
|
+
return t[2] !== o ? (e = /* @__PURE__ */ n(s.Overlay, { ...o }), t[2] = o, t[3] = e) : e = t[3], e;
|
|
47
|
+
}, O = (i) => {
|
|
48
|
+
const t = c.c(9);
|
|
49
|
+
let l;
|
|
50
|
+
t[0] !== i ? (l = r("dialog__content", i), t[0] = i, t[1] = l) : l = t[1];
|
|
51
|
+
const o = l;
|
|
52
|
+
let e;
|
|
53
|
+
t[2] !== i.showCloseButton || t[3] !== i.title ? (e = i.showCloseButton && /* @__PURE__ */ f(m, { align: "center", justify: "space-between", children: [
|
|
54
|
+
/* @__PURE__ */ n(_, { hierarchy: "primary", size: "xl", children: i.title }),
|
|
55
|
+
/* @__PURE__ */ n(u, { asChild: !0, children: /* @__PURE__ */ n(d, { children: /* @__PURE__ */ n(g, { size: 16 }) }) })
|
|
56
|
+
] }), t[2] = i.showCloseButton, t[3] = i.title, t[4] = e) : e = t[4];
|
|
57
|
+
let a;
|
|
58
|
+
return t[5] !== i.children || t[6] !== o || t[7] !== e ? (a = /* @__PURE__ */ f(s.Content, { ...o, children: [
|
|
59
|
+
e,
|
|
60
|
+
i.children
|
|
61
|
+
] }), t[5] = i.children, t[6] = o, t[7] = e, t[8] = a) : a = t[8], a;
|
|
62
|
+
}, R = (i) => {
|
|
63
|
+
const t = c.c(4);
|
|
64
|
+
let l;
|
|
65
|
+
t[0] !== i ? (l = r("dialog__title", i), t[0] = i, t[1] = l) : l = t[1];
|
|
66
|
+
const o = l;
|
|
67
|
+
let e;
|
|
68
|
+
return t[2] !== o ? (e = /* @__PURE__ */ n(s.Title, { ...o }), t[2] = o, t[3] = e) : e = t[3], e;
|
|
69
|
+
}, b = (i) => {
|
|
70
|
+
const t = c.c(4);
|
|
71
|
+
let l;
|
|
72
|
+
t[0] !== i ? (l = r("dialog__description", i), t[0] = i, t[1] = l) : l = t[1];
|
|
73
|
+
const o = l;
|
|
74
|
+
let e;
|
|
75
|
+
return t[2] !== o ? (e = /* @__PURE__ */ n(s.Description, { ...o }), t[2] = o, t[3] = e) : e = t[3], e;
|
|
76
|
+
}, E = (i) => {
|
|
77
|
+
const t = c.c(4);
|
|
78
|
+
let l;
|
|
79
|
+
t[0] !== i ? (l = r("dialog__header", i), t[0] = i, t[1] = l) : l = t[1];
|
|
80
|
+
const o = l;
|
|
81
|
+
let e;
|
|
82
|
+
return t[2] !== o ? (e = /* @__PURE__ */ n("div", { ...o }), t[2] = o, t[3] = e) : e = t[3], e;
|
|
83
|
+
}, H = (i) => {
|
|
84
|
+
const t = c.c(4);
|
|
85
|
+
let l;
|
|
86
|
+
t[0] !== i ? (l = r("dialog__footer", i), t[0] = i, t[1] = l) : l = t[1];
|
|
87
|
+
const o = l;
|
|
88
|
+
let e;
|
|
89
|
+
return t[2] !== o ? (e = /* @__PURE__ */ n("div", { ...o }), t[2] = o, t[3] = e) : e = t[3], e;
|
|
90
|
+
};
|
|
91
|
+
export {
|
|
92
|
+
P as Dialog,
|
|
93
|
+
u as DialogClose,
|
|
94
|
+
O as DialogContent,
|
|
95
|
+
b as DialogDescription,
|
|
96
|
+
H as DialogFooter,
|
|
97
|
+
E as DialogHeader,
|
|
98
|
+
F as DialogOverlay,
|
|
99
|
+
z as DialogPortal,
|
|
100
|
+
R as DialogTitle,
|
|
101
|
+
j as DialogTrigger
|
|
102
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { Code0Component } from '../../utils';
|
|
3
|
+
import { ValidationProps } from '../form';
|
|
4
|
+
import { Extension } from '@uiw/react-codemirror';
|
|
5
|
+
import { StreamLanguage } from '@codemirror/language';
|
|
6
|
+
import { CompletionContext, CompletionResult } from '@codemirror/autocomplete';
|
|
7
|
+
import { BasicSetupOptions } from '@uiw/codemirror-extensions-basic-setup';
|
|
8
|
+
export type EditorTokenizer = (content: string) => string | null;
|
|
9
|
+
export interface EditorRendererProps {
|
|
10
|
+
content: string;
|
|
11
|
+
}
|
|
12
|
+
export interface EditorTokenHighlights {
|
|
13
|
+
[tokenName: string]: (props: EditorRendererProps) => React.ReactNode;
|
|
14
|
+
}
|
|
15
|
+
export interface EditorInputProps extends Omit<Code0Component<HTMLDivElement>, 'onChange' | 'defaultValue' | 'value'>, ValidationProps<any> {
|
|
16
|
+
language?: 'json' | StreamLanguage<unknown>;
|
|
17
|
+
tokenizer?: EditorTokenizer;
|
|
18
|
+
tokenHighlights?: EditorTokenHighlights;
|
|
19
|
+
suggestions?: (context: CompletionContext) => CompletionResult | React.ReactNode | null;
|
|
20
|
+
customSuggestionComponent?: boolean;
|
|
21
|
+
onChange?: (value: any) => void;
|
|
22
|
+
extensions?: Extension[];
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
readonly?: boolean;
|
|
25
|
+
showTooltips?: boolean;
|
|
26
|
+
showValidation?: boolean;
|
|
27
|
+
basicSetup?: BasicSetupOptions;
|
|
28
|
+
}
|
|
29
|
+
export declare const Editor: React.FC<EditorInputProps>;
|