@code0-tech/pictor 0.10.4 → 0.10.6

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.
Files changed (37) hide show
  1. package/dist/assets/components/json-view/JsonView.style.css +1 -0
  2. package/dist/components/breadcrumb/Breadcrumb.js +2 -2
  3. package/dist/components/button/Button.js +11 -11
  4. package/dist/components/command/Command.js +19 -22
  5. package/dist/components/data-table/DataTable.js +15 -15
  6. package/dist/components/data-table/DataTableFilterSuggestionMenu.js +15 -15
  7. package/dist/components/editor/Editor.js +13 -13
  8. package/dist/components/form/CheckboxInput.js +4 -4
  9. package/dist/components/form/EditorInput.js +69 -64
  10. package/dist/components/form/EmailInput.js +9 -9
  11. package/dist/components/form/InputContentEditable.hook.js +11 -11
  12. package/dist/components/form/InputWrapper.js +15 -15
  13. package/dist/components/form/NumberInput.js +9 -9
  14. package/dist/components/form/PasswordInput.js +4 -4
  15. package/dist/components/form/SwitchInput.js +7 -7
  16. package/dist/components/form/TextAreaInput.js +6 -6
  17. package/dist/components/form/TextInput.js +6 -6
  18. package/dist/components/form/useForm.js +2 -2
  19. package/dist/components/fullscreen/FullScreen.js +2 -2
  20. package/dist/components/gantt/Gantt.js +67 -54
  21. package/dist/components/gantt/GanttGroup.js +117 -98
  22. package/dist/components/gantt/GanttHeader.js +45 -36
  23. package/dist/components/json-view/JsonView.d.ts +19 -0
  24. package/dist/components/json-view/JsonView.js +107 -0
  25. package/dist/index.d.ts +1 -0
  26. package/dist/index.js +102 -100
  27. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.js +59 -0
  28. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.js +34 -0
  29. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/index.js +47 -0
  30. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/utils.js +12 -0
  31. package/dist/node_modules/framer-motion/dist/es/utils/use-composed-ref.js +28 -0
  32. package/dist/node_modules/react/cjs/react-compiler-runtime.development.js +2 -2
  33. package/dist/node_modules/react/cjs/react-compiler-runtime.production.js +8 -8
  34. package/dist/utils/reactiveArrayService.js +4 -4
  35. package/package.json +9 -7
  36. package/dist/components/gantt/GanttFooter.d.ts +0 -2
  37. package/dist/components/gantt/GanttFooter.js +0 -38
@@ -0,0 +1 @@
1
+ .json-view{width:100%;box-sizing:border-box}.json-view{font-family:Inter,sans-serif;font-weight:400;letter-spacing:-.5px}.json-view__arrow{display:inline-flex;align-items:center;justify-content:center;color:#ffffff80;margin-right:.35rem;cursor:pointer;transition:ease-in .05s transform}.json-view__arrow:hover{color:#ffffffbf}.json-view__arrow[data-expanded=false]{transform:rotate(90deg)!important}.json-view__arrow[data-expanded=true]{transform:rotate(0)!important}.json-view__copy{display:inline-flex;align-items:center;justify-content:center;cursor:pointer;color:#ffffff80;margin-left:.7rem!important}.json-view__copy:hover{color:#ffffffbf}.json-view__copy[data-copied=true]{color:#29bf12}
@@ -5,7 +5,7 @@ import { mergeComponentProps as a } from "../../utils/component.js";
5
5
  import "js-md5";
6
6
  import '../../assets/components/breadcrumb/Breadcrumb.style.css';/* empty css */
7
7
  import { IconChevronRight as d } from "@tabler/icons-react";
8
- const j = (i) => {
8
+ const v = (i) => {
9
9
  const {
10
10
  splitter: m = /* @__PURE__ */ t(d, { size: 16 }),
11
11
  children: l,
@@ -17,5 +17,5 @@ const j = (i) => {
17
17
  ] }, o)) });
18
18
  };
19
19
  export {
20
- j as Breadcrumb
20
+ v as Breadcrumb
21
21
  };
@@ -5,28 +5,28 @@ import z from "react";
5
5
  import "../../utils/contextStore.js";
6
6
  import { mergeComponentProps as S } from "../../utils/component.js";
7
7
  import "js-md5";
8
- const k = z.forwardRef((a, s) => {
8
+ const P = z.forwardRef((a, d) => {
9
9
  const t = h.c(11);
10
10
  let o, n, e, i;
11
- if (t[0] !== a || t[1] !== s) {
11
+ if (t[0] !== a || t[1] !== d) {
12
12
  const {
13
13
  children: f,
14
- variant: c,
15
- color: l,
14
+ variant: l,
15
+ color: c,
16
16
  paddingSize: m,
17
- active: b,
18
- disabled: u,
17
+ active: u,
18
+ disabled: b,
19
19
  ...p
20
20
  } = a;
21
21
  o = f;
22
- const v = c === void 0 ? "normal" : c, $ = l === void 0 ? "secondary" : l, g = m === void 0 ? "xs" : m, x = b === void 0 ? !1 : b;
23
- n = u === void 0 ? !1 : u, e = s, i = S(`button button--${$} ${x ? "button--active" : ""} ${n ? "button--disabled" : ""} button--${v} button--${g}`, p), t[0] = a, t[1] = s, t[2] = o, t[3] = n, t[4] = e, t[5] = i;
22
+ const v = l === void 0 ? "normal" : l, $ = c === void 0 ? "secondary" : c, g = m === void 0 ? "xs" : m, x = u === void 0 ? !1 : u;
23
+ n = b === void 0 ? !1 : b, e = d, i = S(`button button--${$} ${x ? "button--active" : ""} ${n ? "button--disabled" : ""} button--${v} button--${g}`, p), t[0] = a, t[1] = d, t[2] = o, t[3] = n, t[4] = e, t[5] = i;
24
24
  } else
25
25
  o = t[2], n = t[3], e = t[4], i = t[5];
26
- const d = n ? "true" : "false";
26
+ const s = n ? "true" : "false";
27
27
  let r;
28
- return t[6] !== o || t[7] !== e || t[8] !== i || t[9] !== d ? (r = /* @__PURE__ */ R("button", { ref: e, ...i, "aria-disabled": d, children: o }), t[6] = o, t[7] = e, t[8] = i, t[9] = d, t[10] = r) : r = t[10], r;
28
+ return t[6] !== o || t[7] !== e || t[8] !== i || t[9] !== s ? (r = /* @__PURE__ */ R("button", { ref: e, ...i, "aria-disabled": s, children: o }), t[6] = o, t[7] = e, t[8] = i, t[9] = s, t[10] = r) : r = t[10], r;
29
29
  });
30
30
  export {
31
- k as Button
31
+ P as Button
32
32
  };
@@ -6,16 +6,12 @@ import "react";
6
6
  import { mergeComponentProps as r } from "../../utils/component.js";
7
7
  import "js-md5";
8
8
  import { DialogPortal as u, DialogContent as h, Dialog as g, DialogOverlay as C } from "../dialog/Dialog.js";
9
- import '../../assets/components/form/SelectInput.style.css';import '../../assets/components/form/FileInput.style.css';import '../../assets/components/form/EditorInput.style.css';import '../../assets/components/form/Input.style.css';import '../../assets/components/command/Command.style.css';/* empty css */
9
+ import '../../assets/components/form/SelectInput.style.css';import '../../assets/components/form/FileInput.style.css';import '../../assets/components/form/Input.style.css';import '../../assets/components/command/Command.style.css';/* empty css */
10
10
  import { Badge as _ } from "../badge/Badge.js";
11
11
  import "@radix-ui/react-checkbox";
12
12
  import "@tabler/icons-react";
13
13
  /* empty css */
14
- import "../form/InputWrapper.js";
15
- import "@uiw/react-codemirror";
16
- import "@uiw/codemirror-themes";
17
- import "../../node_modules/@lezer/highlight/dist/index.js";
18
- /* empty css */
14
+ import "../form/EditorInput.js";
19
15
  import "../form/EmailInput.js";
20
16
  import "@ark-ui/react";
21
17
  /* empty css */
@@ -26,6 +22,7 @@ import "../form/PasswordInput.js";
26
22
  import "@radix-ui/react-one-time-password-field";
27
23
  import "@radix-ui/react-radio-group";
28
24
  import "@radix-ui/react-select";
25
+ import "../form/InputWrapper.js";
29
26
  /* empty css */
30
27
  import "../form/SwitchInput.js";
31
28
  import "../form/TextAreaInput.js";
@@ -37,7 +34,7 @@ const P = (e) => {
37
34
  const o = m;
38
35
  let n;
39
36
  return t[2] !== o ? (n = /* @__PURE__ */ i(a, { ...o }), t[2] = o, t[3] = n) : n = t[3], n;
40
- }, Z = (e) => {
37
+ }, W = (e) => {
41
38
  const t = c.c(11);
42
39
  let m;
43
40
  t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ i(C, {}), t[0] = m) : m = t[0];
@@ -50,14 +47,14 @@ const P = (e) => {
50
47
  ] }), t[3] = e.contentProps, t[4] = o, t[5] = n) : n = t[5];
51
48
  let l;
52
49
  return t[6] !== e.dialogProps || t[7] !== e.onOpenChange || t[8] !== e.open || t[9] !== n ? (l = /* @__PURE__ */ i(g, { ...e.dialogProps, open: e.open, onOpenChange: e.onOpenChange, children: n }), t[6] = e.dialogProps, t[7] = e.onOpenChange, t[8] = e.open, t[9] = n, t[10] = l) : l = t[10], l;
53
- }, p = (e) => {
50
+ }, X = (e) => {
54
51
  const t = c.c(4);
55
52
  let m;
56
53
  t[0] !== e ? (m = r("command__list", e), t[0] = e, t[1] = m) : m = t[1];
57
54
  const o = m;
58
55
  let n;
59
56
  return t[2] !== o ? (n = /* @__PURE__ */ i(a.List, { ...o }), t[2] = o, t[3] = n) : n = t[3], n;
60
- }, tt = (e) => {
57
+ }, Y = (e) => {
61
58
  const t = c.c(10);
62
59
  let m;
63
60
  t[0] !== e.value ? (m = e.value?.toString(), t[0] = e.value, t[1] = m) : m = t[1];
@@ -76,35 +73,35 @@ const P = (e) => {
76
73
  t[4] !== e ? (n = /* @__PURE__ */ i($, { className: "command__input", ...e }), t[4] = e, t[5] = n) : n = t[5];
77
74
  let l;
78
75
  return t[6] !== m || t[7] !== o || t[8] !== n ? (l = /* @__PURE__ */ i(a.Input, { value: m, onValueChange: o, asChild: !0, children: n }), t[6] = m, t[7] = o, t[8] = n, t[9] = l) : l = t[9], l;
79
- }, et = (e) => {
76
+ }, Z = (e) => {
80
77
  const t = c.c(4);
81
78
  let m;
82
79
  t[0] !== e ? (m = r("command__empty", e), t[0] = e, t[1] = m) : m = t[1];
83
80
  const o = m;
84
81
  let n;
85
82
  return t[2] !== o ? (n = /* @__PURE__ */ i(a.Empty, { ...o }), t[2] = o, t[3] = n) : n = t[3], n;
86
- }, nt = (e) => {
83
+ }, p = (e) => {
87
84
  const t = c.c(4);
88
85
  let m;
89
86
  t[0] !== e ? (m = r("command__group", e), t[0] = e, t[1] = m) : m = t[1];
90
87
  const o = m;
91
88
  let n;
92
89
  return t[2] !== o ? (n = /* @__PURE__ */ i(a.Group, { ...o }), t[2] = o, t[3] = n) : n = t[3], n;
93
- }, mt = (e) => {
90
+ }, tt = (e) => {
94
91
  const t = c.c(4);
95
92
  let m;
96
93
  t[0] !== e ? (m = r("command__item", e), t[0] = e, t[1] = m) : m = t[1];
97
94
  const o = m;
98
95
  let n;
99
96
  return t[2] !== o ? (n = /* @__PURE__ */ i(a.Item, { ...o }), t[2] = o, t[3] = n) : n = t[3], n;
100
- }, ot = (e) => {
97
+ }, et = (e) => {
101
98
  const t = c.c(4);
102
99
  let m;
103
100
  t[0] !== e ? (m = r("command__separator", e), t[0] = e, t[1] = m) : m = t[1];
104
101
  const o = m;
105
102
  let n;
106
103
  return t[2] !== o ? (n = /* @__PURE__ */ i(a.Separator, { ...o }), t[2] = o, t[3] = n) : n = t[3], n;
107
- }, it = (e) => {
104
+ }, nt = (e) => {
108
105
  const t = c.c(5);
109
106
  let m;
110
107
  t[0] !== e ? (m = r("command__shortcut", e), t[0] = e, t[1] = m) : m = t[1];
@@ -114,12 +111,12 @@ const P = (e) => {
114
111
  };
115
112
  export {
116
113
  P as Command,
117
- Z as CommandDialog,
118
- et as CommandEmpty,
119
- nt as CommandGroup,
120
- tt as CommandInput,
121
- mt as CommandItem,
122
- p as CommandList,
123
- ot as CommandSeparator,
124
- it as CommandShortcut
114
+ W as CommandDialog,
115
+ Z as CommandEmpty,
116
+ p as CommandGroup,
117
+ Y as CommandInput,
118
+ tt as CommandItem,
119
+ X as CommandList,
120
+ et as CommandSeparator,
121
+ nt as CommandShortcut
125
122
  };
@@ -1,40 +1,40 @@
1
- import { jsxs as g, jsx as p } from "react/jsx-runtime";
2
- import h from "react";
1
+ import { jsxs as _, jsx as p } from "react/jsx-runtime";
2
+ import g from "react";
3
3
  import '../../assets/components/data-table/DataTable.style.css';/* empty css */
4
4
  import "../../utils/contextStore.js";
5
- import { mergeComponentProps as C } from "../../utils/component.js";
5
+ import { mergeComponentProps as h } from "../../utils/component.js";
6
6
  import "js-md5";
7
- const A = (l, m) => m.split(".").reduce((t, f) => {
7
+ const d = (l, m) => m.split(".").reduce((t, f) => {
8
8
  if (t != null)
9
- return Array.isArray(t) ? t.map((o) => o?.[f]).filter((o) => o !== void 0) : t[f];
9
+ return Array.isArray(t) ? t.map((a) => a?.[f]).filter((a) => a !== void 0) : t[f];
10
10
  }, l), w = (l) => {
11
11
  const {
12
12
  data: m,
13
13
  sort: t,
14
14
  filter: f,
15
- loading: o,
16
- loadingComponent: j,
17
- emptyComponent: d,
15
+ loading: a,
16
+ loadingComponent: C,
17
+ emptyComponent: A,
18
18
  onSelect: u,
19
19
  children: O,
20
20
  ...b
21
- } = l, y = m.filter((i) => Object.entries(f || {}).every(([a, {
21
+ } = l, y = m.filter((i) => Object.entries(f || {}).every(([o, {
22
22
  operator: n,
23
23
  value: r
24
24
  }]) => {
25
- const e = A(i, a);
25
+ const e = d(i, o);
26
26
  return n === "isOneOf" && !Array.isArray(r) && !Array.isArray(e) ? e === r : n === "isOneOf" && !Array.isArray(r) && Array.isArray(e) ? Array.from(e).includes(r) : n === "isOneOf" && Array.isArray(r) && !Array.isArray(e) ? Array.from(r).some((s) => s === e) : n === "isOneOf" && Array.isArray(r) && Array.isArray(e) ? Array.from(r).some((s) => Array.from(e).includes(s)) : !1;
27
- })), c = h.useMemo(() => t ? [...y].sort((i, a) => {
27
+ })), c = g.useMemo(() => t ? [...y].sort((i, o) => {
28
28
  for (const [n, r] of Object.entries(t)) {
29
- const e = A(i, n), s = A(a, n);
29
+ const e = d(i, n), s = d(o, n);
30
30
  if (e < s) return r === "asc" ? -1 : 1;
31
31
  if (e > s) return r === "asc" ? 1 : -1;
32
32
  }
33
33
  return 0;
34
34
  }) : y, [y, t]);
35
- return /* @__PURE__ */ g("table", { ...C("data-table", b), children: [
36
- c.map((i, a) => /* @__PURE__ */ p("tr", { className: "data-table__row", onClick: () => u?.(i), children: O?.(i, a) })),
37
- c.length === 0 && !o && d ? /* @__PURE__ */ p("tr", { className: "data-table__row", onClick: () => u?.(void 0), children: d }) : null
35
+ return /* @__PURE__ */ _("table", { ...h("data-table", b), children: [
36
+ c.map((i, o) => /* @__PURE__ */ p("tr", { className: "data-table__row", onClick: () => u?.(i), children: O?.(i, o) })),
37
+ c.length === 0 && !a && A ? /* @__PURE__ */ p("tr", { className: "data-table__row", onClick: () => u?.(void 0), children: A }) : null
38
38
  ] });
39
39
  };
40
40
  export {
@@ -1,16 +1,16 @@
1
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";
2
+ import { c as _ } from "../../_virtual/compiler-runtime.js";
3
+ import v from "react";
4
+ import { MenuTrigger as w, MenuContent as y, Menu as g } from "../menu/Menu.js";
5
5
  const T = (t) => {
6
- const e = v.c(11), {
7
- children: l,
8
- context: m
9
- } = t, [u, p] = w.useState(!0), h = _;
6
+ const e = _.c(11), {
7
+ children: c,
8
+ context: u
9
+ } = t, [m, p] = v.useState(!0), h = y;
10
10
  let r;
11
11
  e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (r = (a) => p(a), e[0] = r) : r = e[0];
12
12
  let i;
13
- e[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ f(y, { asChild: !0, children: /* @__PURE__ */ f("div", { style: {
13
+ e[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ f(w, { asChild: !0, children: /* @__PURE__ */ f("div", { style: {
14
14
  position: "absolute",
15
15
  top: 0,
16
16
  left: 0,
@@ -18,9 +18,9 @@ const T = (t) => {
18
18
  height: 0
19
19
  } }) }), e[1] = i) : i = e[1];
20
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];
21
+ e[2] !== u?.view ? (n = (a) => {
22
+ ["Escape", "ArrowUp", "ArrowDown"].includes(a.key) || u?.view?.focus();
23
+ }, e[2] = u?.view, e[3] = n) : n = e[3];
24
24
  let s;
25
25
  e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (s = {
26
26
  position: "fixed",
@@ -29,12 +29,12 @@ const T = (t) => {
29
29
  pointerEvents: "auto"
30
30
  }, e[4] = s) : s = e[4];
31
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: [
32
+ e[5] !== c || e[6] !== n ? (o = /* @__PURE__ */ f(h, { miw: "200px", onInteractOutside: b, onOpenAutoFocus: D, onKeyDown: n, style: s, children: c }), e[5] = c, e[6] = n, e[7] = o) : o = e[7];
33
+ let l;
34
+ return e[8] !== m || e[9] !== o ? (l = /* @__PURE__ */ d(g, { open: m, onOpenChange: r, modal: !1, children: [
35
35
  i,
36
36
  o
37
- ] }), e[8] = u, e[9] = o, e[10] = c) : c = e[10], c;
37
+ ] }), e[8] = m, e[9] = o, e[10] = l) : l = e[10], l;
38
38
  };
39
39
  function x(t) {
40
40
  return t;
@@ -1,10 +1,10 @@
1
1
  import { jsxs as s, jsx as r } from "react/jsx-runtime";
2
2
  import m, { isValidElement as me } from "react";
3
- import { createPortal as K } from "react-dom";
3
+ import { createPortal as H } from "react-dom";
4
4
  import "../../utils/contextStore.js";
5
5
  import { mergeComponentProps as he } from "../../utils/component.js";
6
6
  import { hashToColor as w } from "../../utils/color.js";
7
- import fe, { Prec as _, keymap as J, ViewPlugin as ge, RangeSetBuilder as pe, Decoration as F, EditorView as ye, WidgetType as be } from "@uiw/react-codemirror";
7
+ import fe, { Prec as K, keymap as J, ViewPlugin as ge, RangeSetBuilder as pe, Decoration as F, EditorView as ye, WidgetType as be } from "@uiw/react-codemirror";
8
8
  import { json as ve, jsonParseLinter as Se } from "@codemirror/lang-json";
9
9
  import { syntaxTree as L } from "@codemirror/language";
10
10
  import { linter as we } from "@codemirror/lint";
@@ -53,7 +53,7 @@ class X extends be {
53
53
  return t.type === this.type && t.rawValue === this.rawValue;
54
54
  }
55
55
  }
56
- const De = (i) => me(i) || typeof i == "string" || typeof i == "number" || Array.isArray(i), dr = (i) => {
56
+ const _e = (i) => me(i) || typeof i == "string" || typeof i == "number" || Array.isArray(i), dr = (i) => {
57
57
  const {
58
58
  language: t,
59
59
  tokenizer: f,
@@ -70,9 +70,9 @@ const De = (i) => me(i) || typeof i == "string" || typeof i == "number" || Array
70
70
  showValidation: U = !0,
71
71
  readonly: ee,
72
72
  basicSetup: re,
73
- customSuggestionComponent: D = !1,
73
+ customSuggestionComponent: _ = !1,
74
74
  ...te
75
- } = i, [oe, I] = m.useState(), R = m.useRef(null), [ne, ie] = m.useState(/* @__PURE__ */ new Map()), [u, se] = m.useState([]), [T, le] = m.useState(null), [g, y] = m.useState(null), H = m.useRef(null);
75
+ } = i, [oe, I] = m.useState(), R = m.useRef(null), [ne, ie] = m.useState(/* @__PURE__ */ new Map()), [u, se] = m.useState([]), [T, le] = m.useState(null), [g, y] = m.useState(null), D = m.useRef(null);
76
76
  m.useEffect(() => {
77
77
  (async () => {
78
78
  try {
@@ -92,7 +92,7 @@ const De = (i) => me(i) || typeof i == "string" || typeof i == "number" || Array
92
92
  if (V) {
93
93
  const n = (o) => {
94
94
  const c = V(o);
95
- if (c && De(c)) {
95
+ if (c && _e(c)) {
96
96
  const l = o.view?.coordsAtPos(o.pos);
97
97
  return l && y({
98
98
  component: c,
@@ -105,15 +105,15 @@ const De = (i) => me(i) || typeof i == "string" || typeof i == "number" || Array
105
105
  return y(null), c;
106
106
  };
107
107
  e.push(Be({
108
- ...D ? {
108
+ ..._ ? {
109
109
  override: [n]
110
110
  } : {
111
111
  override: [V]
112
112
  }
113
- })), e.push(_.highest(J.of([{
113
+ })), e.push(K.highest(J.of([{
114
114
  key: "Tab",
115
115
  run: Fe
116
- }]))), D && e.push(_.highest(J.of([{
116
+ }]))), _ && e.push(K.highest(J.of([{
117
117
  key: "ArrowUp",
118
118
  run: (o) => (g || E(o), !0)
119
119
  }, {
@@ -177,7 +177,7 @@ const De = (i) => me(i) || typeof i == "string" || typeof i == "number" || Array
177
177
  to: c
178
178
  });
179
179
  } else e.selectionSet && (y(null), E(e.view));
180
- const d = H.current?.querySelectorAll(".cm-react-anchor"), n = /* @__PURE__ */ new Map();
180
+ const d = D.current?.querySelectorAll(".cm-react-anchor"), n = /* @__PURE__ */ new Map();
181
181
  d?.forEach((o) => {
182
182
  n.set(o, {
183
183
  type: o.dataset.type,
@@ -291,7 +291,7 @@ const De = (i) => me(i) || typeof i == "string" || typeof i == "number" || Array
291
291
  ] }),
292
292
  /* @__PURE__ */ r(a, { children: "suggestions" })
293
293
  ] }) }),
294
- /* @__PURE__ */ r(Me, { asChild: !0, children: /* @__PURE__ */ s("div", { ref: H, ...he("editor", te), children: [
294
+ /* @__PURE__ */ r(Me, { asChild: !0, children: /* @__PURE__ */ s("div", { ref: D, ...he("editor", te), children: [
295
295
  /* @__PURE__ */ r(fe, { width: "100%", height: "100%", value: oe, theme: ue, readOnly: N || ee, editable: !N, extensions: ae, "aria-disabled": N, className: "editor__control", onChange: (e) => {
296
296
  if (I(e), t === "json")
297
297
  try {
@@ -304,13 +304,13 @@ const De = (i) => me(i) || typeof i == "string" || typeof i == "number" || Array
304
304
  }, onUpdate: ce, basicSetup: re }),
305
305
  p && Array.from(ne.entries()).map(([e, d]) => {
306
306
  const n = p[d.type];
307
- return n ? K(/* @__PURE__ */ r("div", { style: {
307
+ return n ? H(/* @__PURE__ */ r("div", { style: {
308
308
  display: "contents"
309
309
  }, children: n({
310
310
  content: d.value
311
311
  }) }, e.outerHTML + d.value), e) : null;
312
312
  }),
313
- g && K(/* @__PURE__ */ r("div", { ref: R, style: {
313
+ g && H(/* @__PURE__ */ r("div", { ref: R, style: {
314
314
  position: "fixed",
315
315
  top: g.position.top,
316
316
  left: g.position.left,
@@ -12,8 +12,8 @@ import '../../assets/components/form/Input.style.css';/* empty css
12
12
  import { IconMinus as T, IconCheck as q } from "@tabler/icons-react";
13
13
  const ee = (l) => {
14
14
  const e = $.c(40), {
15
- title: b,
16
- description: _,
15
+ title: _,
16
+ description: b,
17
17
  formValidation: k,
18
18
  ...N
19
19
  } = l;
@@ -31,9 +31,9 @@ const ee = (l) => {
31
31
  let v;
32
32
  e[5] !== t ? (v = [t], e[5] = t, e[6] = v) : v = e[6], z.useEffect(g, v);
33
33
  let o;
34
- e[7] !== b ? (o = b ? /* @__PURE__ */ n(F, { children: b }) : null, e[7] = b, e[8] = o) : o = e[8];
34
+ e[7] !== _ ? (o = _ ? /* @__PURE__ */ n(F, { children: _ }) : null, e[7] = _, e[8] = o) : o = e[8];
35
35
  let c;
36
- e[9] !== _ ? (c = _ ? /* @__PURE__ */ n(L, { children: _ }) : null, e[9] = _, e[10] = c) : c = e[10];
36
+ e[9] !== b ? (c = b ? /* @__PURE__ */ n(L, { children: b }) : null, e[9] = b, e[10] = c) : c = e[10];
37
37
  const V = `input ${i?.valid ? "" : "input--not-valid"} checkbox-input`;
38
38
  let r;
39
39
  e[11] !== V ? (r = E(V, {}), e[11] = V, e[12] = r) : r = e[12];
@@ -1,70 +1,75 @@
1
- import { jsx as a } from "react/jsx-runtime";
2
- import y from "react";
3
- import { InputWrapper as C } from "./InputWrapper.js";
4
- import T from "@uiw/react-codemirror";
5
- import { createTheme as B } from "@uiw/codemirror-themes";
6
- import { tags as e } from "../../node_modules/@lezer/highlight/dist/index.js";
1
+ import { jsx as c } from "react/jsx-runtime";
2
+ import e from "react";
3
+ import { InputWrapper as B } from "./InputWrapper.js";
4
+ import I from "@uiw/react-codemirror";
5
+ import { createTheme as p } from "@uiw/codemirror-themes";
6
+ import { tags as t } from "../../node_modules/@lezer/highlight/dist/index.js";
7
7
  import "../../utils/contextStore.js";
8
- import { mergeComponentProps as A } from "../../utils/component.js";
9
- import { hashToColor as t } from "../../utils/color.js";
8
+ import { mergeComponentProps as x } from "../../utils/component.js";
9
+ import { hashToColor as r } from "../../utils/color.js";
10
10
  import '../../assets/components/form/EditorInput.style.css';/* empty css */
11
- const V = (i) => {
11
+ const A = [], L = [], P = {
12
+ lineNumbers: !1,
13
+ foldGutter: !1,
14
+ highlightActiveLine: !1,
15
+ highlightActiveLineGutter: !1
16
+ }, u = {
17
+ background: "transparent",
18
+ backgroundImage: "",
19
+ foreground: "rgba(255,255,255, 0.75)",
20
+ caret: "gray",
21
+ selection: "rgba(112,179,255,0.25)",
22
+ selectionMatch: "rgba(112,179,255,0.1)",
23
+ fontSize: "0.8rem",
24
+ gutterBackground: "transparent",
25
+ gutterForeground: "rgba(255,255,255, 0.5)",
26
+ gutterBorder: "transparent",
27
+ gutterActiveForeground: "rgba(255,255,255, 1)",
28
+ lineHighlight: "rgba(255,255,255, 0.1)"
29
+ }, h = [{
30
+ tag: t.squareBracket,
31
+ color: r("squareBracket")
32
+ }, {
33
+ tag: t.bracket,
34
+ color: r("bracket")
35
+ }, {
36
+ tag: t.string,
37
+ color: r("Text")
38
+ }, {
39
+ tag: t.bool,
40
+ color: r("Boolean")
41
+ }, {
42
+ tag: t.number,
43
+ color: r("Number")
44
+ }], Y = p({
45
+ theme: "light",
46
+ settings: u,
47
+ styles: h
48
+ }), F = e.memo((d) => {
12
49
  const {
13
- title: g,
14
- right: s,
15
- left: m,
16
- rightType: l,
17
- leftType: c,
18
- language: p,
19
- description: u,
20
- extensions: h = [],
21
- tokenStyles: r = [],
22
- formValidation: o,
23
- onChange: f,
24
- wrapperComponent: b,
25
- ...d
26
- } = i, k = [...h, p], x = y.useMemo(() => B({
50
+ title: f,
51
+ right: E,
52
+ left: T,
53
+ rightType: b,
54
+ leftType: S,
55
+ language: o,
56
+ description: _,
57
+ extensions: n = A,
58
+ tokenStyles: a = L,
59
+ formValidation: s,
60
+ onChange: i,
61
+ wrapperComponent: k,
62
+ ...g
63
+ } = d, C = e.useMemo(() => o ? [...n, o] : n, [n, o]), M = e.useMemo(() => a.length === 0 ? Y : p({
27
64
  theme: "light",
28
- settings: {
29
- background: "transparent",
30
- backgroundImage: "",
31
- foreground: "rgba(255,255,255, 0.75)",
32
- caret: "gray",
33
- selection: "rgba(112,179,255,0.25)",
34
- selectionMatch: "rgba(112,179,255,0.1)",
35
- fontSize: "0.8rem",
36
- gutterBackground: "transparent",
37
- gutterForeground: "rgba(255,255,255, 0.5)",
38
- gutterBorder: "transparent",
39
- gutterActiveForeground: "rgba(255,255,255, 1)",
40
- lineHighlight: "rgba(255,255,255, 0.1)"
41
- },
42
- styles: [{
43
- tag: e.squareBracket,
44
- color: t("squareBracket")
45
- }, {
46
- tag: e.bracket,
47
- color: t("bracket")
48
- }, {
49
- tag: e.string,
50
- color: t("Text")
51
- }, {
52
- tag: e.bool,
53
- color: t("Boolean")
54
- }, {
55
- tag: e.number,
56
- color: t("Number")
57
- }, ...r]
58
- }), [r]);
59
- return /* @__PURE__ */ a(C, { title: g, description: u, right: s, left: m, rightType: l, leftType: c, formValidation: o, wrapperComponent: b, children: /* @__PURE__ */ a(T, { extensions: k, onChange: (n) => {
60
- o?.setValue?.(n), f?.(n);
61
- }, theme: x, ...A("editor-input", d), basicSetup: {
62
- lineNumbers: !1,
63
- foldGutter: !1,
64
- highlightActiveLine: !1,
65
- highlightActiveLineGutter: !1
66
- } }) });
67
- };
65
+ settings: u,
66
+ styles: [...h, ...a]
67
+ }), [a]), m = s?.setValue, y = e.useCallback((l) => {
68
+ m?.(l), i?.(l);
69
+ }, [m, i]), N = e.useMemo(() => x("editor-input", g), [g]);
70
+ return /* @__PURE__ */ c(B, { title: f, description: _, right: E, left: T, rightType: b, leftType: S, formValidation: s, wrapperComponent: k, children: /* @__PURE__ */ c(I, { extensions: C, onChange: y, theme: M, ...N, basicSetup: P }) });
71
+ });
72
+ F.displayName = "EditorInput";
68
73
  export {
69
- V as EditorInput
74
+ F as EditorInput
70
75
  };
@@ -1,21 +1,21 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
- import r from "react";
3
- import { Input as m } from "./Input.js";
4
- import { IconX as l } from "@tabler/icons-react";
2
+ import e from "react";
3
+ import { Input as l } from "./Input.js";
4
+ import { IconX as m } from "@tabler/icons-react";
5
5
  import { Button as f } from "../button/Button.js";
6
6
  import { clearInputElement as s } from "./Input.utils.js";
7
- const p = /(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/, d = (t) => p.test(t), R = r.forwardRef((t, x) => {
8
- x = x || r.useRef(null);
7
+ const p = /(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/, I = (t) => p.test(t), _ = e.forwardRef((t, x) => {
8
+ x = x || e.useRef(null);
9
9
  const {
10
- clearable: e = !1,
10
+ clearable: r = !1,
11
11
  right: n,
12
12
  ...c
13
13
  } = t, i = () => {
14
14
  s(x.current);
15
15
  }, a = [n];
16
- return e && a.push(/* @__PURE__ */ o(f, { onClick: i, children: /* @__PURE__ */ o(l, { size: 13 }) })), /* @__PURE__ */ o(m, { right: a, type: "email", ref: x, ...c });
16
+ return r && a.push(/* @__PURE__ */ o(f, { onClick: i, children: /* @__PURE__ */ o(m, { size: 13 }) })), /* @__PURE__ */ o(l, { right: a, type: "email", ref: x, ...c });
17
17
  });
18
18
  export {
19
- R as EmailInput,
20
- d as emailValidation
19
+ _ as EmailInput,
20
+ I as emailValidation
21
21
  };
@@ -401,8 +401,8 @@ const F = "input__token", K = "input__token--selected", q = "aria-data", O = "
401
401
  s(r.current);
402
402
  }, e[15] = r, e[16] = s, e[17] = w) : w = e[17];
403
403
  const V = w, G = me;
404
- let L;
405
- e[18] !== r || e[19] !== s ? (L = (i) => {
404
+ let _;
405
+ e[18] !== r || e[19] !== s ? (_ = (i) => {
406
406
  const g = r.current;
407
407
  if (!g || document.activeElement !== g)
408
408
  return !1;
@@ -414,26 +414,26 @@ const F = "input__token", K = "input__token--selected", q = "aria-data", O = "
414
414
  return i.preventDefault(), i.stopPropagation(), $(g), !0;
415
415
  }
416
416
  return i.key === "Enter" ? (i.preventDefault(), !0) : !1;
417
- }, e[18] = r, e[19] = s, e[20] = L) : L = e[20];
418
- const X = L;
419
- let M;
420
- e[21] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (M = () => {
417
+ }, e[18] = r, e[19] = s, e[20] = _) : _ = e[20];
418
+ const X = _;
419
+ let L;
420
+ e[21] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (L = () => {
421
421
  const i = u.current;
422
422
  return u.current = null, i;
423
- }, e[21] = M) : M = e[21];
424
- let _;
425
- return e[22] !== y || e[23] !== d || e[24] !== V || e[25] !== X || e[26] !== S || e[27] !== p || e[28] !== s ? (_ = {
423
+ }, e[21] = L) : L = e[21];
424
+ let M;
425
+ return e[22] !== y || e[23] !== d || e[24] !== V || e[25] !== X || e[26] !== S || e[27] !== p || e[28] !== s ? (M = {
426
426
  editorHtml: d,
427
427
  setEditorHtml: c,
428
428
  initializeFromExternalValue: p,
429
429
  updateEditorState: s,
430
- takePendingSelection: M,
430
+ takePendingSelection: L,
431
431
  applySuggestionValueSyntax: y,
432
432
  handlePaste: S,
433
433
  handleChange: V,
434
434
  handleKeyDownCapture: G,
435
435
  handleKeyDown: X
436
- }, e[22] = y, e[23] = d, e[24] = V, e[25] = X, e[26] = S, e[27] = p, e[28] = s, e[29] = _) : _ = e[29], _;
436
+ }, e[22] = y, e[23] = d, e[24] = V, e[25] = X, e[26] = S, e[27] = p, e[28] = s, e[29] = M) : M = e[29], M;
437
437
  };
438
438
  function pe(t) {
439
439
  return typeof t != "string";