@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,337 @@
|
|
|
1
|
+
import { jsxs as s, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import m, { isValidElement as ce } from "react";
|
|
3
|
+
import { createPortal as K } from "react-dom";
|
|
4
|
+
import "../../utils/contextStore.js";
|
|
5
|
+
import { hashToColor as b, mergeCode0Props as ue } from "../../utils/utils.js";
|
|
6
|
+
import de, { Prec as _, keymap as J, ViewPlugin as me, RangeSetBuilder as he, Decoration as F, EditorView as fe, WidgetType as ge } from "@uiw/react-codemirror";
|
|
7
|
+
import { json as pe, jsonParseLinter as ye } from "@codemirror/lang-json";
|
|
8
|
+
import { syntaxTree as L } from "@codemirror/language";
|
|
9
|
+
import { linter as be } from "@codemirror/lint";
|
|
10
|
+
import ve from "../../node_modules/prettier/standalone.js";
|
|
11
|
+
import we from "../../node_modules/prettier/plugins/babel.js";
|
|
12
|
+
import Se from "../../node_modules/prettier/plugins/estree.js";
|
|
13
|
+
import { createTheme as Ce } from "@uiw/codemirror-themes";
|
|
14
|
+
import { tags as v, getStyleTags as Te } from "../../node_modules/@lezer/highlight/dist/index.js";
|
|
15
|
+
import '../../assets/components/editor/Editor.styles.css';/* empty css */
|
|
16
|
+
import { Badge as y } from "../badge/Badge.js";
|
|
17
|
+
import { IconExclamationCircle as Ae, IconAlertTriangle as xe, IconAlertSquareRounded as ke, IconInfoCircle as Ee, IconSpace as ze, IconArrowBarToRight as Pe, IconCornerDownLeft as je } from "@tabler/icons-react";
|
|
18
|
+
import { Text as a } from "../text/Text.js";
|
|
19
|
+
import { Flex as k } from "../flex/Flex.js";
|
|
20
|
+
import { Tooltip as E, TooltipTrigger as z, TooltipPortal as P, TooltipContent as j, TooltipArrow as V } from "../tooltip/Tooltip.js";
|
|
21
|
+
import { ScrollArea as Ve, ScrollAreaViewport as Ne, ScrollAreaScrollbar as G, ScrollAreaThumb as Q } from "../scroll-area/ScrollArea.js";
|
|
22
|
+
import { autocompletion as Ie, acceptCompletion as Re, startCompletion as N } from "@codemirror/autocomplete";
|
|
23
|
+
function Be(i, r, h) {
|
|
24
|
+
return (r = Me(r)) in i ? Object.defineProperty(i, r, { value: h, enumerable: !0, configurable: !0, writable: !0 }) : i[r] = h, i;
|
|
25
|
+
}
|
|
26
|
+
function Me(i) {
|
|
27
|
+
var r = qe(i, "string");
|
|
28
|
+
return typeof r == "symbol" ? r : r + "";
|
|
29
|
+
}
|
|
30
|
+
function qe(i, r) {
|
|
31
|
+
if (typeof i != "object" || !i) return i;
|
|
32
|
+
var h = i[Symbol.toPrimitive];
|
|
33
|
+
if (h !== void 0) {
|
|
34
|
+
var g = h.call(i, r);
|
|
35
|
+
if (typeof g != "object") return g;
|
|
36
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
37
|
+
}
|
|
38
|
+
return (r === "string" ? String : Number)(i);
|
|
39
|
+
}
|
|
40
|
+
class X extends ge {
|
|
41
|
+
constructor(r, h) {
|
|
42
|
+
super(), this.type = r, this.rawValue = h;
|
|
43
|
+
}
|
|
44
|
+
toDOM() {
|
|
45
|
+
const r = document.createElement("span");
|
|
46
|
+
return r.className = "cm-react-anchor", r.dataset.type = this.type, r.dataset.value = this.rawValue, r.contentEditable = "false", r.style.pointerEvents = "none", r.style.verticalAlign = "middle", r.style.display = "inline-block", r;
|
|
47
|
+
}
|
|
48
|
+
ignoreEvent() {
|
|
49
|
+
return !0;
|
|
50
|
+
}
|
|
51
|
+
eq(r) {
|
|
52
|
+
return r.type === this.type && r.rawValue === this.rawValue;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
const Fe = Ce({
|
|
56
|
+
theme: "light",
|
|
57
|
+
settings: {
|
|
58
|
+
background: "transparent",
|
|
59
|
+
backgroundImage: "",
|
|
60
|
+
foreground: "rgba(255,255,255, 0.75)",
|
|
61
|
+
caret: "gray",
|
|
62
|
+
selection: "rgba(112,179,255,0.25)",
|
|
63
|
+
selectionMatch: "rgba(112,179,255,0.1)",
|
|
64
|
+
fontSize: "0.8rem",
|
|
65
|
+
gutterBackground: "transparent",
|
|
66
|
+
gutterForeground: "rgba(255,255,255, 0.5)",
|
|
67
|
+
gutterBorder: "transparent",
|
|
68
|
+
gutterActiveForeground: "rgba(255,255,255, 1)",
|
|
69
|
+
lineHighlight: "rgba(255,255,255, 0.1)"
|
|
70
|
+
},
|
|
71
|
+
styles: [{
|
|
72
|
+
tag: v.squareBracket,
|
|
73
|
+
color: b("squareBracket")
|
|
74
|
+
}, {
|
|
75
|
+
tag: v.bracket,
|
|
76
|
+
color: b("bracket")
|
|
77
|
+
}, {
|
|
78
|
+
tag: v.string,
|
|
79
|
+
color: b("Text")
|
|
80
|
+
}, {
|
|
81
|
+
tag: v.bool,
|
|
82
|
+
color: b("Boolean")
|
|
83
|
+
}, {
|
|
84
|
+
tag: v.number,
|
|
85
|
+
color: b("Number")
|
|
86
|
+
}]
|
|
87
|
+
}), Oe = (i) => ce(i) || typeof i == "string" || typeof i == "number" || Array.isArray(i), at = (i) => {
|
|
88
|
+
const {
|
|
89
|
+
language: r,
|
|
90
|
+
tokenizer: h,
|
|
91
|
+
tokenHighlights: g,
|
|
92
|
+
suggestions: w,
|
|
93
|
+
onChange: O,
|
|
94
|
+
extensions: W = [],
|
|
95
|
+
initialValue: S,
|
|
96
|
+
formValidation: Y,
|
|
97
|
+
disabled: I,
|
|
98
|
+
showTooltips: Z = !0,
|
|
99
|
+
showValidation: $ = !0,
|
|
100
|
+
readonly: U,
|
|
101
|
+
basicSetup: ee,
|
|
102
|
+
customSuggestionComponent: D = !1,
|
|
103
|
+
...te
|
|
104
|
+
} = i, [re, R] = m.useState(""), B = m.useRef(null), [oe, ne] = m.useState(/* @__PURE__ */ new Map()), [c, ie] = m.useState([]), [f, p] = m.useState(null), C = m.useRef(null);
|
|
105
|
+
r === "json" && m.useEffect(() => {
|
|
106
|
+
(async () => {
|
|
107
|
+
try {
|
|
108
|
+
const e = await ve.format(JSON.stringify(S) ?? "", {
|
|
109
|
+
parser: r,
|
|
110
|
+
plugins: [we, Se],
|
|
111
|
+
printWidth: 1
|
|
112
|
+
});
|
|
113
|
+
R(e);
|
|
114
|
+
} catch {
|
|
115
|
+
R(JSON.stringify(S) ?? "");
|
|
116
|
+
}
|
|
117
|
+
})();
|
|
118
|
+
}, [S]);
|
|
119
|
+
const se = m.useMemo(() => {
|
|
120
|
+
const e = [...W];
|
|
121
|
+
if (w) {
|
|
122
|
+
const o = (l) => {
|
|
123
|
+
const u = w(l);
|
|
124
|
+
if (u && Oe(u)) {
|
|
125
|
+
const d = l.view?.coordsAtPos(l.pos);
|
|
126
|
+
return d && p({
|
|
127
|
+
component: u,
|
|
128
|
+
position: {
|
|
129
|
+
top: d.bottom,
|
|
130
|
+
left: d.left
|
|
131
|
+
}
|
|
132
|
+
}), null;
|
|
133
|
+
}
|
|
134
|
+
return p(null), u;
|
|
135
|
+
};
|
|
136
|
+
e.push(Ie({
|
|
137
|
+
...D ? {
|
|
138
|
+
override: [o]
|
|
139
|
+
} : {
|
|
140
|
+
override: [w]
|
|
141
|
+
}
|
|
142
|
+
})), e.push(_.highest(J.of([{
|
|
143
|
+
key: "Tab",
|
|
144
|
+
run: Re
|
|
145
|
+
}]))), D && e.push(_.highest(J.of([{
|
|
146
|
+
key: "ArrowUp",
|
|
147
|
+
run: (l) => (f || N(l), !0)
|
|
148
|
+
}, {
|
|
149
|
+
key: "ArrowDown",
|
|
150
|
+
run: (l) => f ? (B?.current?.querySelector("[tabindex]")?.focus(), !0) : (N(l), !0)
|
|
151
|
+
}])));
|
|
152
|
+
}
|
|
153
|
+
r === "json" ? (e.push(pe()), e.push(be(ye(), {
|
|
154
|
+
markerFilter: (o) => (ie(o), [])
|
|
155
|
+
}))) : r && e.push(r);
|
|
156
|
+
const n = me.fromClass(class {
|
|
157
|
+
constructor(o) {
|
|
158
|
+
Be(this, "decorations", void 0), this.decorations = this.build(o);
|
|
159
|
+
}
|
|
160
|
+
update(o) {
|
|
161
|
+
(o.docChanged || o.viewportChanged) && (this.decorations = this.build(o.view));
|
|
162
|
+
}
|
|
163
|
+
build(o) {
|
|
164
|
+
const l = new he(), u = Object.keys(g || {});
|
|
165
|
+
return L(o.state).iterate({
|
|
166
|
+
enter: (d) => {
|
|
167
|
+
const A = o.state.doc.sliceString(d.from, d.to);
|
|
168
|
+
if (A.includes(`
|
|
169
|
+
`)) return;
|
|
170
|
+
const q = h?.(A), ae = Te(d)?.tags.map((x) => "name" in x ? x.name : void 0), H = u.find((x) => ae?.includes(x));
|
|
171
|
+
H && !q ? l.add(d.from, d.to, F.replace({
|
|
172
|
+
widget: new X(H, A),
|
|
173
|
+
point: !0
|
|
174
|
+
})) : q && l.add(d.from, d.to, F.replace({
|
|
175
|
+
widget: new X(q, A),
|
|
176
|
+
point: !0
|
|
177
|
+
}));
|
|
178
|
+
}
|
|
179
|
+
}), l.finish();
|
|
180
|
+
}
|
|
181
|
+
}, {
|
|
182
|
+
decorations: (o) => o.decorations
|
|
183
|
+
});
|
|
184
|
+
return e.push(n), e.push(fe.atomicRanges.of((o) => o.plugin(n)?.decorations || F.none)), e;
|
|
185
|
+
}, [r, h, g, W, w, B.current]), [T, le] = m.useState(null), M = m.useCallback((e) => {
|
|
186
|
+
if (e.docChanged || e.viewportChanged || e.selectionSet) {
|
|
187
|
+
if (e.view) {
|
|
188
|
+
const {
|
|
189
|
+
from: n,
|
|
190
|
+
to: o
|
|
191
|
+
} = e.state?.selection?.main ?? {
|
|
192
|
+
from: 0,
|
|
193
|
+
to: 0
|
|
194
|
+
};
|
|
195
|
+
let l = 0;
|
|
196
|
+
L(e.state).iterate({
|
|
197
|
+
from: n,
|
|
198
|
+
to: o,
|
|
199
|
+
enter: (u) => {
|
|
200
|
+
u.from >= n && u.to <= o && l++;
|
|
201
|
+
}
|
|
202
|
+
}), e.selectionSet && l < 2 ? (n === o && n !== T?.from ? p(null) : n === o && n === T?.from && n != 0 ? p((u) => u) : n === o && n === T?.from && n == 0 && p(null), N(e.view)) : e.selectionSet && l >= 2 && p(null), le({
|
|
203
|
+
from: n,
|
|
204
|
+
to: o
|
|
205
|
+
});
|
|
206
|
+
} else e.selectionSet && (p(null), N(e.view));
|
|
207
|
+
window.requestAnimationFrame(() => {
|
|
208
|
+
const n = C.current?.querySelectorAll(".cm-react-anchor"), o = /* @__PURE__ */ new Map();
|
|
209
|
+
n?.forEach((l) => {
|
|
210
|
+
o.set(l, {
|
|
211
|
+
type: l.dataset.type,
|
|
212
|
+
value: l.dataset.value
|
|
213
|
+
});
|
|
214
|
+
}), ne(o);
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
}, [T]);
|
|
218
|
+
return m.useEffect(() => {
|
|
219
|
+
if (C.current) {
|
|
220
|
+
const e = window.setTimeout(() => {
|
|
221
|
+
const n = new CustomEvent("scroll");
|
|
222
|
+
C.current?.dispatchEvent(n), M({
|
|
223
|
+
docChanged: !0,
|
|
224
|
+
viewportChanged: !0,
|
|
225
|
+
selectionSet: !1
|
|
226
|
+
});
|
|
227
|
+
}, 50);
|
|
228
|
+
return () => clearTimeout(e);
|
|
229
|
+
}
|
|
230
|
+
return () => {
|
|
231
|
+
};
|
|
232
|
+
}, [M]), /* @__PURE__ */ s(Ve, { h: "100%", type: "scroll", children: [
|
|
233
|
+
$ && /* @__PURE__ */ t("div", { className: "editor__diagnostics", children: /* @__PURE__ */ s(k, { style: {
|
|
234
|
+
gap: "0.35rem",
|
|
235
|
+
textWrap: "nowrap"
|
|
236
|
+
}, align: "center", children: [
|
|
237
|
+
c.filter((e) => e.severity == "error").length > 0 ? /* @__PURE__ */ s(E, { children: [
|
|
238
|
+
/* @__PURE__ */ t(z, { asChild: !0, children: /* @__PURE__ */ s(y, { color: "red", children: [
|
|
239
|
+
/* @__PURE__ */ t(Ae, { size: 13 }),
|
|
240
|
+
/* @__PURE__ */ t(a, { children: c.filter((e) => e.severity == "error").length })
|
|
241
|
+
] }) }),
|
|
242
|
+
/* @__PURE__ */ t(P, { children: /* @__PURE__ */ s(j, { side: "bottom", children: [
|
|
243
|
+
/* @__PURE__ */ t(V, {}),
|
|
244
|
+
c.filter((e) => e.severity == "error").map((e) => /* @__PURE__ */ t(a, { size: "xs", children: e.message }, e.message))
|
|
245
|
+
] }) })
|
|
246
|
+
] }) : null,
|
|
247
|
+
c.filter((e) => e.severity == "warning").length > 0 ? /* @__PURE__ */ s(E, { children: [
|
|
248
|
+
/* @__PURE__ */ t(z, { asChild: !0, children: /* @__PURE__ */ s(y, { color: "orange", children: [
|
|
249
|
+
/* @__PURE__ */ t(xe, { size: 13 }),
|
|
250
|
+
/* @__PURE__ */ t(a, { children: c.filter((e) => e.severity == "warning").length })
|
|
251
|
+
] }) }),
|
|
252
|
+
/* @__PURE__ */ t(P, { children: /* @__PURE__ */ s(j, { side: "bottom", children: [
|
|
253
|
+
/* @__PURE__ */ t(V, {}),
|
|
254
|
+
c.filter((e) => e.severity == "warning").map((e) => /* @__PURE__ */ t(a, { size: "xs", children: e.message }, e.message))
|
|
255
|
+
] }) })
|
|
256
|
+
] }) : null,
|
|
257
|
+
c.filter((e) => e.severity == "info").length > 0 ? /* @__PURE__ */ s(E, { children: [
|
|
258
|
+
/* @__PURE__ */ t(z, { asChild: !0, children: /* @__PURE__ */ s(y, { color: "#9ca3af", children: [
|
|
259
|
+
/* @__PURE__ */ t(ke, { size: 13 }),
|
|
260
|
+
/* @__PURE__ */ t(a, { children: c.filter((e) => e.severity == "info").length })
|
|
261
|
+
] }) }),
|
|
262
|
+
/* @__PURE__ */ t(P, { children: /* @__PURE__ */ s(j, { side: "bottom", children: [
|
|
263
|
+
/* @__PURE__ */ t(V, {}),
|
|
264
|
+
c.filter((e) => e.severity == "info").map((e) => /* @__PURE__ */ t(a, { size: "xs", children: e.message }, e.message))
|
|
265
|
+
] }) })
|
|
266
|
+
] }) : null,
|
|
267
|
+
c.filter((e) => e.severity == "hint").length > 0 ? /* @__PURE__ */ s(E, { children: [
|
|
268
|
+
/* @__PURE__ */ t(z, { asChild: !0, children: /* @__PURE__ */ s(y, { color: "#3b82f6", children: [
|
|
269
|
+
/* @__PURE__ */ t(Ee, { size: 13 }),
|
|
270
|
+
/* @__PURE__ */ t(a, { children: c.filter((e) => e.severity == "hint").length })
|
|
271
|
+
] }) }),
|
|
272
|
+
/* @__PURE__ */ t(P, { children: /* @__PURE__ */ s(j, { side: "bottom", children: [
|
|
273
|
+
/* @__PURE__ */ t(V, {}),
|
|
274
|
+
c.filter((e) => e.severity == "hint").map((e) => /* @__PURE__ */ t(a, { size: "xs", children: e.message }, e.message))
|
|
275
|
+
] }) })
|
|
276
|
+
] }) : null
|
|
277
|
+
] }) }),
|
|
278
|
+
Z && /* @__PURE__ */ t("div", { className: "editor__tools", children: /* @__PURE__ */ s(k, { style: {
|
|
279
|
+
gap: "0.35rem",
|
|
280
|
+
textWrap: "nowrap"
|
|
281
|
+
}, align: "center", children: [
|
|
282
|
+
/* @__PURE__ */ s(k, { style: {
|
|
283
|
+
gap: "0.35rem"
|
|
284
|
+
}, align: "center", children: [
|
|
285
|
+
/* @__PURE__ */ s(y, { color: "secondary", border: !0, children: [
|
|
286
|
+
/* @__PURE__ */ t(a, { children: navigator !== void 0 && /Mac/.test(navigator.userAgent) ? "⌃" : "strg" }),
|
|
287
|
+
/* @__PURE__ */ t(a, { children: "+" }),
|
|
288
|
+
/* @__PURE__ */ t(ze, { size: 13 })
|
|
289
|
+
] }),
|
|
290
|
+
/* @__PURE__ */ t(a, { children: "to show" })
|
|
291
|
+
] }),
|
|
292
|
+
/* @__PURE__ */ t(a, { children: "and" }),
|
|
293
|
+
/* @__PURE__ */ s(k, { style: {
|
|
294
|
+
gap: "0.35rem"
|
|
295
|
+
}, align: "center", children: [
|
|
296
|
+
/* @__PURE__ */ s(y, { color: "secondary", border: !0, children: [
|
|
297
|
+
/* @__PURE__ */ t(Pe, { size: 13 }),
|
|
298
|
+
/* @__PURE__ */ t(a, { children: "or" }),
|
|
299
|
+
/* @__PURE__ */ t(je, { size: 13 })
|
|
300
|
+
] }),
|
|
301
|
+
/* @__PURE__ */ t(a, { children: "to select" })
|
|
302
|
+
] }),
|
|
303
|
+
/* @__PURE__ */ t(a, { children: "suggestions" })
|
|
304
|
+
] }) }),
|
|
305
|
+
/* @__PURE__ */ t(Ne, { asChild: !0, children: /* @__PURE__ */ s("div", { ref: C, ...ue("editor", te), children: [
|
|
306
|
+
/* @__PURE__ */ t(de, { width: "100%", height: "100%", value: r === "json" ? re : S, theme: Fe, readOnly: I || U, editable: !I, extensions: se, "aria-disabled": I, className: "editor__control", onChange: (e) => {
|
|
307
|
+
if (R(e), r === "json")
|
|
308
|
+
try {
|
|
309
|
+
const n = JSON.parse(e);
|
|
310
|
+
O?.(n), Y?.setValue(n);
|
|
311
|
+
} catch {
|
|
312
|
+
}
|
|
313
|
+
else
|
|
314
|
+
O?.(e);
|
|
315
|
+
}, onUpdate: M, basicSetup: ee }),
|
|
316
|
+
g && Array.from(oe.entries()).map(([e, n]) => {
|
|
317
|
+
const o = g[n.type];
|
|
318
|
+
return o ? K(/* @__PURE__ */ t("div", { style: {
|
|
319
|
+
display: "contents"
|
|
320
|
+
}, children: o({
|
|
321
|
+
content: n.value
|
|
322
|
+
}) }, e.outerHTML + n.value), e) : null;
|
|
323
|
+
}),
|
|
324
|
+
f && K(/* @__PURE__ */ t("div", { ref: B, style: {
|
|
325
|
+
position: "fixed",
|
|
326
|
+
top: f.position.top,
|
|
327
|
+
left: f.position.left,
|
|
328
|
+
zIndex: 9999
|
|
329
|
+
}, children: f.component }, f.position.top + "-" + f.position.left), document.body)
|
|
330
|
+
] }) }),
|
|
331
|
+
/* @__PURE__ */ t(G, { orientation: "vertical", children: /* @__PURE__ */ t(Q, {}) }),
|
|
332
|
+
/* @__PURE__ */ t(G, { orientation: "horizontal", children: /* @__PURE__ */ t(Q, {}) })
|
|
333
|
+
] });
|
|
334
|
+
};
|
|
335
|
+
export {
|
|
336
|
+
at as Editor
|
|
337
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { TabsContentProps, TabsListProps, TabsProps, TabsTriggerProps } from '@radix-ui/react-tabs';
|
|
3
|
+
import { Code0ComponentProps } from '../../utils/types';
|
|
4
|
+
type FileTabsProps = Code0ComponentProps & TabsProps;
|
|
5
|
+
type FileTabsListProps = Code0ComponentProps & TabsListProps & {
|
|
6
|
+
controls?: React.ReactNode;
|
|
7
|
+
};
|
|
8
|
+
type FileTabsTriggerProps = Code0ComponentProps & TabsTriggerProps & {
|
|
9
|
+
onClose?: () => void;
|
|
10
|
+
closable?: boolean;
|
|
11
|
+
};
|
|
12
|
+
type FileTabsContentProps = Code0ComponentProps & TabsContentProps;
|
|
13
|
+
export declare const FileTabs: React.FC<FileTabsProps>;
|
|
14
|
+
export declare const FileTabsList: React.FC<FileTabsListProps>;
|
|
15
|
+
export declare const FileTabsTrigger: React.FC<FileTabsTriggerProps>;
|
|
16
|
+
export declare const FileTabsContent: React.FC<FileTabsContentProps>;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { jsx as a, jsxs as m } from "react/jsx-runtime";
|
|
2
|
+
import { c as b } from "../../_virtual/compiler-runtime.js";
|
|
3
|
+
import { Tabs as g, List as T, Trigger as v, Content as C } from "@radix-ui/react-tabs";
|
|
4
|
+
import { mergeCode0Props as h } from "../../utils/utils.js";
|
|
5
|
+
import '../../assets/components/file-tabs/FileTabs.style.css';/* empty css */
|
|
6
|
+
import { IconX as S } from "@tabler/icons-react";
|
|
7
|
+
import { ScrollAreaViewport as x, ScrollAreaScrollbar as A, ScrollAreaThumb as F, ScrollArea as $ } from "../scroll-area/ScrollArea.js";
|
|
8
|
+
const E = (t) => {
|
|
9
|
+
const e = b.c(4);
|
|
10
|
+
let i;
|
|
11
|
+
e[0] !== t ? (i = h("file-tabs", t), e[0] = t, e[1] = i) : i = e[1];
|
|
12
|
+
let l;
|
|
13
|
+
return e[2] !== i ? (l = /* @__PURE__ */ a(g, { "data-slot": "tabs", ...i }), e[2] = i, e[3] = l) : l = e[3], l;
|
|
14
|
+
}, I = (t) => {
|
|
15
|
+
const e = b.c(10);
|
|
16
|
+
let i;
|
|
17
|
+
e[0] !== t ? (i = h("file-tabs__list", t), e[0] = t, e[1] = i) : i = e[1];
|
|
18
|
+
let l;
|
|
19
|
+
e[2] !== t.children ? (l = /* @__PURE__ */ m("div", { className: "file-tabs__list-content", children: [
|
|
20
|
+
" ",
|
|
21
|
+
t.children
|
|
22
|
+
] }), e[2] = t.children, e[3] = l) : l = e[3];
|
|
23
|
+
let n;
|
|
24
|
+
e[4] !== t.controls ? (n = t.controls ? /* @__PURE__ */ a("div", { className: "file-tabs__list-controls", children: t.controls }) : null, e[4] = t.controls, e[5] = n) : n = e[5];
|
|
25
|
+
let c;
|
|
26
|
+
return e[6] !== i || e[7] !== l || e[8] !== n ? (c = /* @__PURE__ */ m(T, { "data-slot": "tabs", ...i, children: [
|
|
27
|
+
l,
|
|
28
|
+
n
|
|
29
|
+
] }), e[6] = i, e[7] = l, e[8] = n, e[9] = c) : c = e[9], c;
|
|
30
|
+
}, P = (t) => {
|
|
31
|
+
const e = b.c(10), i = t.value;
|
|
32
|
+
let l;
|
|
33
|
+
e[0] !== t ? (l = h("file-tabs__trigger", t), e[0] = t, e[1] = l) : l = e[1];
|
|
34
|
+
const n = l;
|
|
35
|
+
let c;
|
|
36
|
+
e[2] !== t.closable || e[3] !== t.onClose ? (c = t.closable ? /* @__PURE__ */ a("div", { className: "file-tabs__trigger-icon", onClick: t.onClose, children: /* @__PURE__ */ a(S, { size: 12 }) }) : null, e[2] = t.closable, e[3] = t.onClose, e[4] = c) : c = e[4];
|
|
37
|
+
let s;
|
|
38
|
+
return e[5] !== t.children || e[6] !== t.value || e[7] !== n || e[8] !== c ? (s = /* @__PURE__ */ m(v, { "data-slot": "tabs", "data-value": i, ...n, children: [
|
|
39
|
+
t.children,
|
|
40
|
+
c
|
|
41
|
+
] }), e[5] = t.children, e[6] = t.value, e[7] = n, e[8] = c, e[9] = s) : s = e[9], s;
|
|
42
|
+
}, R = (t) => {
|
|
43
|
+
const e = b.c(15);
|
|
44
|
+
let i, l, n, c;
|
|
45
|
+
if (e[0] !== t) {
|
|
46
|
+
const {
|
|
47
|
+
children: _,
|
|
48
|
+
...u
|
|
49
|
+
} = t;
|
|
50
|
+
l = _, i = C, c = "tabs", n = h("file-tabs__content", u), e[0] = t, e[1] = i, e[2] = l, e[3] = n, e[4] = c;
|
|
51
|
+
} else
|
|
52
|
+
i = e[1], l = e[2], n = e[3], c = e[4];
|
|
53
|
+
const s = n;
|
|
54
|
+
let o;
|
|
55
|
+
e[5] !== l ? (o = /* @__PURE__ */ a(x, { children: l }), e[5] = l, e[6] = o) : o = e[6];
|
|
56
|
+
let f;
|
|
57
|
+
e[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ a(A, { orientation: "vertical", children: /* @__PURE__ */ a(F, {}) }), e[7] = f) : f = e[7];
|
|
58
|
+
let r;
|
|
59
|
+
e[8] !== o ? (r = /* @__PURE__ */ m($, { h: "100%", children: [
|
|
60
|
+
o,
|
|
61
|
+
f
|
|
62
|
+
] }), e[8] = o, e[9] = r) : r = e[9];
|
|
63
|
+
let d;
|
|
64
|
+
return e[10] !== i || e[11] !== c || e[12] !== s || e[13] !== r ? (d = /* @__PURE__ */ a(i, { "data-slot": c, ...s, children: r }), e[10] = i, e[11] = c, e[12] = s, e[13] = r, e[14] = d) : d = e[14], d;
|
|
65
|
+
};
|
|
66
|
+
export {
|
|
67
|
+
E as FileTabs,
|
|
68
|
+
R as FileTabsContent,
|
|
69
|
+
I as FileTabsList,
|
|
70
|
+
P as FileTabsTrigger
|
|
71
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FileTabsView } from './FileTabs.view';
|
|
2
|
+
import { ReactiveArrayService } from '../../utils/reactiveArrayService';
|
|
3
|
+
import { View } from '../../utils/view';
|
|
4
|
+
export declare class FileTabsService extends ReactiveArrayService<FileTabsView> {
|
|
5
|
+
getById(id: string): FileTabsView | undefined;
|
|
6
|
+
clearLeft(): void;
|
|
7
|
+
clearRight(): void;
|
|
8
|
+
clearWithoutActive(): void;
|
|
9
|
+
clearAll(): void;
|
|
10
|
+
activateTab(id: string): void;
|
|
11
|
+
removeTabById(id: string): void;
|
|
12
|
+
deleteById(id: string): void;
|
|
13
|
+
registerTab(value: FileTabsView): void;
|
|
14
|
+
add(value: View<FileTabsView>): void;
|
|
15
|
+
getActiveTab(): FileTabsView | undefined;
|
|
16
|
+
getActiveIndex(): number;
|
|
17
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { ReactiveArrayService as h } from "../../utils/reactiveArrayService.js";
|
|
2
|
+
import { View as d } from "../../utils/view.js";
|
|
3
|
+
class v extends h {
|
|
4
|
+
getById(e) {
|
|
5
|
+
return this.values().find((t) => t.id === e);
|
|
6
|
+
}
|
|
7
|
+
clearLeft() {
|
|
8
|
+
const e = this.getActiveIndex();
|
|
9
|
+
this.access.getState().forEach((t, i) => {
|
|
10
|
+
i >= e || this.removeTabById(t.payload.id);
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
clearRight() {
|
|
14
|
+
const e = this.getActiveIndex();
|
|
15
|
+
this.access.getState().forEach((t, i) => {
|
|
16
|
+
i <= e || this.removeTabById(t.payload.id);
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
clearWithoutActive() {
|
|
20
|
+
const e = this.getActiveIndex();
|
|
21
|
+
this.access.getState().forEach((t, i) => {
|
|
22
|
+
i != e && this.removeTabById(t.payload.id);
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
clearAll() {
|
|
26
|
+
this.access.getState().forEach((e) => {
|
|
27
|
+
this.removeTabById(e.payload.id);
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
activateTab(e) {
|
|
31
|
+
this.values().forEach((i) => {
|
|
32
|
+
i.active = !1;
|
|
33
|
+
});
|
|
34
|
+
const t = this.values().find((i) => i.id === e);
|
|
35
|
+
t && (t.active = !0, t.show = !0), this.update();
|
|
36
|
+
}
|
|
37
|
+
removeTabById(e) {
|
|
38
|
+
const t = this.getById(e), i = this.values().findIndex((a) => a.id === e);
|
|
39
|
+
if (t) {
|
|
40
|
+
if (t.active && this.has(i - 1)) {
|
|
41
|
+
const a = this.get(i - 1);
|
|
42
|
+
a.show && this.activateTab(a.id);
|
|
43
|
+
} else if (t.active && this.has(i + 1)) {
|
|
44
|
+
const a = this.get(i + 1);
|
|
45
|
+
a.show && this.activateTab(a.id);
|
|
46
|
+
}
|
|
47
|
+
t.show = !1, t.active = !1, this.update();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
deleteById(e) {
|
|
51
|
+
const t = this.values().findIndex((a) => a.id === e), i = this.get(t);
|
|
52
|
+
i && i.active && this.has(t - 1) ? this.activateTab(this.get(t - 1).id) : i && i.active && this.has(t + 1) && this.activateTab(this.get(t + 1).id), i && this.access.setState((a) => a.filter((s) => s.payload.id !== e));
|
|
53
|
+
}
|
|
54
|
+
registerTab(e) {
|
|
55
|
+
const t = {
|
|
56
|
+
...e,
|
|
57
|
+
show: e.show ?? !1
|
|
58
|
+
};
|
|
59
|
+
this.values().find((a) => a.id === t.id) || this.add(new d(t));
|
|
60
|
+
}
|
|
61
|
+
add(e) {
|
|
62
|
+
const t = {
|
|
63
|
+
...e.payload,
|
|
64
|
+
show: e.payload.show ?? !0
|
|
65
|
+
};
|
|
66
|
+
this.access.setState((i) => {
|
|
67
|
+
const a = i.findIndex((c) => c.payload.id === t.id), s = i.map((c) => ({
|
|
68
|
+
...c.payload,
|
|
69
|
+
active: t.active ? !1 : c.payload.active
|
|
70
|
+
}));
|
|
71
|
+
return a !== -1 ? (s[a] = {
|
|
72
|
+
...s[a],
|
|
73
|
+
...t,
|
|
74
|
+
active: t.active ?? s[a].active,
|
|
75
|
+
show: t.show ?? s[a].show
|
|
76
|
+
}, [...s.map((c) => new d(c))]) : [...s.map((c) => new d(c)), new d(t)];
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
getActiveTab() {
|
|
80
|
+
return this.values().find((e) => e.active);
|
|
81
|
+
}
|
|
82
|
+
getActiveIndex() {
|
|
83
|
+
return this.values().findIndex((e) => e.active);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
export {
|
|
87
|
+
v as FileTabsService
|
|
88
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FileTabsService as r } from "./FileTabs.service.js";
|
|
2
|
+
import { FileTabs as T, FileTabsContent as a, FileTabsList as b, FileTabsTrigger as l } from "./FileTabs.js";
|
|
3
|
+
export {
|
|
4
|
+
T as FileTabs,
|
|
5
|
+
a as FileTabsContent,
|
|
6
|
+
b as FileTabsList,
|
|
7
|
+
r as FileTabsService,
|
|
8
|
+
l as FileTabsTrigger
|
|
9
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Code0Component } from '../../utils/types';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
interface FlexType extends Code0Component<HTMLDivElement> {
|
|
4
|
+
children: React.ReactNode | React.ReactNode[];
|
|
5
|
+
}
|
|
6
|
+
export declare const Flex: React.FC<FlexType>;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { c as s } from "../../_virtual/compiler-runtime.js";
|
|
3
|
+
import { mergeCode0Props as n } from "../../utils/utils.js";
|
|
4
|
+
import '../../assets/components/flex/Flex.style.css';/* empty css */
|
|
5
|
+
const h = (i) => {
|
|
6
|
+
const e = s.c(6);
|
|
7
|
+
let t, r;
|
|
8
|
+
if (e[0] !== i) {
|
|
9
|
+
const {
|
|
10
|
+
children: l,
|
|
11
|
+
...m
|
|
12
|
+
} = i;
|
|
13
|
+
t = l, r = n("flex", m), e[0] = i, e[1] = t, e[2] = r;
|
|
14
|
+
} else
|
|
15
|
+
t = e[1], r = e[2];
|
|
16
|
+
let o;
|
|
17
|
+
return e[3] !== t || e[4] !== r ? (o = /* @__PURE__ */ c("div", { ...r, children: t }), e[3] = t, e[4] = r, e[5] = o) : o = e[5], o;
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
h as Flex
|
|
21
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { CheckboxProps, CheckedState } from '@radix-ui/react-checkbox';
|
|
3
|
+
import { InputProps } from './Input';
|
|
4
|
+
export type CheckboxInputProps = Omit<InputProps<CheckedState>, "wrapperComponent" | "type" | "left" | "right" | "leftType" | "rightType"> & Omit<CheckboxProps, 'defaultChecked' | 'value' | 'defaultValue'>;
|
|
5
|
+
export declare const CheckboxInput: React.FC<CheckboxInputProps>;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { jsx as n, jsxs as j, Fragment as S } from "react/jsx-runtime";
|
|
2
|
+
import { c as $ } from "../../_virtual/compiler-runtime.js";
|
|
3
|
+
import z from "react";
|
|
4
|
+
import { Checkbox as y, CheckboxIndicator as D } from "@radix-ui/react-checkbox";
|
|
5
|
+
import { InputLabel as F } from "./InputLabel.js";
|
|
6
|
+
import { InputDescription as L } from "./InputDescription.js";
|
|
7
|
+
import { mergeCode0Props as E } from "../../utils/utils.js";
|
|
8
|
+
import { InputMessage as P } from "./InputMessage.js";
|
|
9
|
+
import '../../assets/components/form/Input.style.css';/* empty css */
|
|
10
|
+
import { IconMinus as T, IconCheck as q } from "@tabler/icons-react";
|
|
11
|
+
const Y = (l) => {
|
|
12
|
+
const e = $.c(40), {
|
|
13
|
+
title: b,
|
|
14
|
+
description: _,
|
|
15
|
+
formValidation: k,
|
|
16
|
+
...N
|
|
17
|
+
} = l;
|
|
18
|
+
let x;
|
|
19
|
+
e[0] !== k ? (x = k === void 0 ? {
|
|
20
|
+
valid: !0,
|
|
21
|
+
notValidMessage: null,
|
|
22
|
+
setValue: w
|
|
23
|
+
} : k, e[0] = k, e[1] = x) : x = e[1];
|
|
24
|
+
const i = x, [t, R] = z.useState(l.initialValue ?? "indeterminate");
|
|
25
|
+
let g;
|
|
26
|
+
e[2] !== t || e[3] !== i ? (g = () => {
|
|
27
|
+
i.setValue(t);
|
|
28
|
+
}, e[2] = t, e[3] = i, e[4] = g) : g = e[4];
|
|
29
|
+
let v;
|
|
30
|
+
e[5] !== t ? (v = [t], e[5] = t, e[6] = v) : v = e[6], z.useEffect(g, v);
|
|
31
|
+
let o;
|
|
32
|
+
e[7] !== b ? (o = b ? /* @__PURE__ */ n(F, { children: b }) : null, e[7] = b, e[8] = o) : o = e[8];
|
|
33
|
+
let c;
|
|
34
|
+
e[9] !== _ ? (c = _ ? /* @__PURE__ */ n(L, { children: _ }) : null, e[9] = _, e[10] = c) : c = e[10];
|
|
35
|
+
const V = `input ${i?.valid ? "" : "input--not-valid"} checkbox-input`;
|
|
36
|
+
let s;
|
|
37
|
+
e[11] !== V ? (s = E(V, {}), e[11] = V, e[12] = s) : s = e[12];
|
|
38
|
+
let r;
|
|
39
|
+
e[13] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (r = () => R(A), e[13] = r) : r = e[13];
|
|
40
|
+
const I = y, M = E("checkbox-input__button", N);
|
|
41
|
+
let a;
|
|
42
|
+
e[14] !== t ? (a = t === "indeterminate" && /* @__PURE__ */ n(T, { size: 16 }), e[14] = t, e[15] = a) : a = e[15];
|
|
43
|
+
let m;
|
|
44
|
+
e[16] !== t ? (m = t === !0 && /* @__PURE__ */ n(q, { size: 16 }), e[16] = t, e[17] = m) : m = e[17];
|
|
45
|
+
let f;
|
|
46
|
+
e[18] !== a || e[19] !== m ? (f = /* @__PURE__ */ j(D, { className: "checkbox-input__indicator", children: [
|
|
47
|
+
a,
|
|
48
|
+
m
|
|
49
|
+
] }), e[18] = a, e[19] = m, e[20] = f) : f = e[20];
|
|
50
|
+
let u;
|
|
51
|
+
e[21] !== I || e[22] !== t || e[23] !== f || e[24] !== M ? (u = /* @__PURE__ */ n(I, { checked: t, defaultChecked: t, ...M, children: f }), e[21] = I, e[22] = t, e[23] = f, e[24] = M, e[25] = u) : u = e[25];
|
|
52
|
+
let d;
|
|
53
|
+
e[26] !== l.label ? (d = /* @__PURE__ */ n("div", { className: "input__right input__right--action}", children: l.label }), e[26] = l.label, e[27] = d) : d = e[27];
|
|
54
|
+
let h;
|
|
55
|
+
e[28] !== u || e[29] !== d || e[30] !== s || e[31] !== r ? (h = /* @__PURE__ */ j("div", { ...s, onClick: r, children: [
|
|
56
|
+
u,
|
|
57
|
+
d
|
|
58
|
+
] }), e[28] = u, e[29] = d, e[30] = s, e[31] = r, e[32] = h) : h = e[32];
|
|
59
|
+
let p;
|
|
60
|
+
e[33] !== i ? (p = !i?.valid && i?.notValidMessage ? /* @__PURE__ */ n(P, { children: i.notValidMessage }) : null, e[33] = i, e[34] = p) : p = e[34];
|
|
61
|
+
let C;
|
|
62
|
+
return e[35] !== h || e[36] !== p || e[37] !== o || e[38] !== c ? (C = /* @__PURE__ */ j(S, { children: [
|
|
63
|
+
o,
|
|
64
|
+
c,
|
|
65
|
+
h,
|
|
66
|
+
p
|
|
67
|
+
] }), e[35] = h, e[36] = p, e[37] = o, e[38] = c, e[39] = C) : C = e[39], C;
|
|
68
|
+
};
|
|
69
|
+
function w(l) {
|
|
70
|
+
}
|
|
71
|
+
function A(l) {
|
|
72
|
+
return !l;
|
|
73
|
+
}
|
|
74
|
+
export {
|
|
75
|
+
Y as CheckboxInput
|
|
76
|
+
};
|