@code0-tech/pictor 0.18.2 → 0.18.3

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.
@@ -1,557 +1,587 @@
1
- import { jsx as v, jsxs as Re } from "react/jsx-runtime";
2
- import { c as ae } from "../../_virtual/compiler-runtime.js";
3
- import ee, { useMemo as de, useRef as W, useState as le, useEffect as se, useCallback as O } from "react";
4
- import { createEditor as Ve, Editor as he, Transforms as oe, Text as ge, Range as ke, Node as Fe } from "slate";
5
- import { withReact as Le, ReactEditor as Y, Slate as $e, Editable as je } from "slate-react";
6
- import { withHistory as Be } from "slate-history";
7
- import { InputWrapper as Ke } from "./InputWrapper.js";
1
+ import { jsx as S, jsxs as Ne } from "react/jsx-runtime";
2
+ import { c as ve } from "../../_virtual/compiler-runtime.js";
3
+ import oe, { useMemo as Ie, useRef as q, useState as ae, useEffect as te, useCallback as I } from "react";
4
+ import { createEditor as je, Editor as ye, Transforms as le, Text as be, Range as Pe, Node as Be } from "slate";
5
+ import { withReact as Ke, ReactEditor as ne, Slate as Ue, Editable as We } from "slate-react";
6
+ import { withHistory as Ge } from "slate-history";
7
+ import { InputWrapper as qe } from "./InputWrapper.js";
8
8
  import "../../utils/contextStore.js";
9
- import { mergeComponentProps as Ee } from "../../utils/component.js";
9
+ import { mergeComponentProps as Ve } from "../../utils/component.js";
10
10
  import "js-md5";
11
- import { Menu as Ue, MenuPortal as We, MenuContent as Ge, MenuItem as He, MenuSubContent as qe, MenuTrigger as ze, MenuSubTrigger as Je, MenuSub as Qe } from "../menu/Menu.js";
11
+ import { Menu as ze, MenuPortal as Je, MenuContent as Qe, MenuItem as Xe, MenuSubContent as Ye, MenuTrigger as Ze, MenuSubTrigger as et, MenuSub as tt } from "../menu/Menu.js";
12
12
  import '../../assets/components/form/EditorInput.style.css';/* empty css */
13
- const Z = (n) => n?.type === "token", Xe = (n, e) => {
14
- const i = [];
15
- e.forEach((u, d) => {
16
- if (!u.void) return;
17
- const h = new RegExp(u.pattern.source, u.pattern.flags.includes("g") ? u.pattern.flags : u.pattern.flags + "g");
18
- let f;
19
- for (; (f = h.exec(n)) !== null && f[0].length; )
20
- i.push({
21
- start: f.index,
22
- end: f.index + f[0].length,
23
- ruleIndex: d,
24
- token: f[0],
25
- match: f
13
+ const re = (r) => r?.type === "token", nt = (r, e) => {
14
+ const c = [];
15
+ e.forEach((l, g) => {
16
+ if (!l.void) return;
17
+ const p = new RegExp(l.pattern.source, l.pattern.flags.includes("g") ? l.pattern.flags : l.pattern.flags + "g");
18
+ let a;
19
+ for (; (a = p.exec(r)) !== null && a[0].length; )
20
+ c.push({
21
+ start: a.index,
22
+ end: a.index + a[0].length,
23
+ ruleIndex: g,
24
+ token: a[0],
25
+ match: a
26
26
  });
27
- }), i.sort((u, d) => u.start - d.start);
28
- const r = [];
29
- let l = 0;
30
- return i.forEach((u) => {
31
- if (u.start < l) return;
32
- u.start > l ? r.push({
33
- text: n.slice(l, u.start)
34
- }) : r.length && Z(r[r.length - 1]) && r.push({
27
+ }), c.sort((l, g) => l.start - g.start);
28
+ const o = [];
29
+ let i = 0;
30
+ return c.forEach((l) => {
31
+ if (l.start < i) return;
32
+ l.start > i ? o.push({
33
+ text: r.slice(i, l.start)
34
+ }) : o.length && re(o[o.length - 1]) && o.push({
35
35
  text: ""
36
36
  });
37
- const d = {
37
+ const g = {
38
38
  type: "token",
39
- ruleIndex: u.ruleIndex,
40
- token: u.token,
41
- match: u.match,
39
+ ruleIndex: l.ruleIndex,
40
+ token: l.token,
41
+ match: l.match,
42
42
  children: [{
43
43
  text: ""
44
44
  }]
45
45
  };
46
- r.push(d), l = u.end;
47
- }), l < n.length && r.push({
48
- text: n.slice(l)
49
- }), (!r.length || Z(r[0])) && r.unshift({
46
+ o.push(g), i = l.end;
47
+ }), i < r.length && o.push({
48
+ text: r.slice(i)
49
+ }), (!o.length || re(o[0])) && o.unshift({
50
50
  text: ""
51
- }), Z(r[r.length - 1]) && r.push({
51
+ }), re(o[o.length - 1]) && o.push({
52
52
  text: ""
53
- }), r;
54
- }, Me = (n, e) => (n || "").split(`
55
- `).map((i) => ({
53
+ }), o;
54
+ }, _e = (r, e) => (r || "").split(`
55
+ `).map((c) => ({
56
56
  type: "paragraph",
57
- children: Xe(i, e)
58
- })), Ae = (n) => ge.isText(n) ? n.text : Z(n) ? n.token : n.children.map(Ae).join(""), Oe = (n) => n.map(Ae).join(`
59
- `), _e = ee.createContext(null), me = ee.createContext(null), ce = () => {
60
- const n = ee.useContext(_e);
61
- if (!n)
57
+ children: nt(c, e)
58
+ })), Fe = (r) => be.isText(r) ? r.text : re(r) ? r.token : r.children.map(Fe).join(""), Ae = (r) => r.map(Fe).join(`
59
+ `), Le = oe.createContext(null), Ce = oe.createContext(null), fe = () => {
60
+ const r = oe.useContext(Le);
61
+ if (!r)
62
62
  throw new Error("EditorInput.* components must be used inside <EditorInput>");
63
- return n;
64
- }, It = (n) => {
63
+ return r;
64
+ }, Tt = (r) => {
65
65
  const {
66
66
  title: e,
67
- right: i,
68
- left: r,
69
- rightType: l,
70
- leftType: u,
71
- description: d,
72
- wrapperComponent: h,
73
- tokenRules: f = [],
74
- onSelect: p,
75
- search: S,
76
- formValidation: I,
77
- onChange: o,
78
- disabled: k = !1,
79
- readonly: C = !1,
80
- singleLine: g = !1,
81
- placeholder: b,
82
- value: y,
83
- initialValue: F,
84
- defaultValue: E,
85
- children: B
86
- } = n, L = String(y ?? F ?? E ?? ""), x = g ? L.replace(/\n/g, " ") : L, c = de(() => {
87
- const t = Be(Le(Ve())), {
88
- isInline: s,
89
- isVoid: T
67
+ right: c,
68
+ left: o,
69
+ rightType: i,
70
+ leftType: l,
71
+ description: g,
72
+ wrapperComponent: p,
73
+ tokenRules: a = [],
74
+ onSelect: f,
75
+ search: k,
76
+ formValidation: D,
77
+ onChange: w,
78
+ disabled: T = !1,
79
+ readonly: s = !1,
80
+ singleLine: E = !1,
81
+ placeholder: m,
82
+ value: M,
83
+ initialValue: O,
84
+ defaultValue: G,
85
+ children: _
86
+ } = r, F = String(M ?? O ?? G ?? ""), v = E ? F.replace(/\n/g, " ") : F, d = Ie(() => {
87
+ const t = Ge(Ke(je())), {
88
+ isInline: n,
89
+ isVoid: x
90
90
  } = t;
91
- return t.isInline = (D) => Z(D) || s(D), t.isVoid = (D) => Z(D) || T(D), t;
92
- }, []), K = de(() => Me(x, f), []), P = W(x), [$, U] = le(x);
93
- se(() => {
94
- if (x === P.current || (P.current = x, U(x), Oe(c.children) === x)) return;
95
- const t = Me(x, f);
96
- he.withoutNormalizing(c, () => {
97
- oe.deselect(c);
98
- const s = c.children.length;
99
- oe.insertNodes(c, t, {
91
+ return t.isInline = (h) => re(h) || n(h), t.isVoid = (h) => re(h) || x(h), t;
92
+ }, []), y = Ie(() => _e(v, a), []), L = q(v), [B, W] = ae(v);
93
+ te(() => {
94
+ if (v === L.current || (L.current = v, W(v), Ae(d.children) === v)) return;
95
+ const t = _e(v, a);
96
+ ye.withoutNormalizing(d, () => {
97
+ le.deselect(d);
98
+ const n = d.children.length;
99
+ le.insertNodes(d, t, {
100
100
  at: [0]
101
101
  });
102
- for (let T = 0; T < s; T++) oe.removeNodes(c, {
102
+ for (let x = 0; x < n; x++) le.removeNodes(d, {
103
103
  at: [t.length]
104
104
  });
105
105
  });
106
106
  try {
107
- oe.select(c, he.end(c, []));
107
+ le.select(d, ye.end(d, []));
108
108
  } catch {
109
109
  }
110
- }, [x, c, f]);
111
- const [m, G] = le(!1), [H, ie] = le("shortcut"), q = W(H);
112
- q.current = H;
113
- const te = W(null), Q = W(null), j = W(void 0), N = O(() => {
114
- const t = Q.current, s = te.current, T = s?.parentElement;
115
- if (!t || !s || !T) return;
116
- let D = null;
110
+ }, [v, d, a]);
111
+ const [b, A] = ae(!1), [K, $] = ae("shortcut"), J = q(K);
112
+ J.current = K;
113
+ const se = q(null), Z = q(null), U = q(void 0), H = I(() => {
114
+ const t = Z.current, n = se.current, x = n?.parentElement;
115
+ if (!t || !n || !x) return;
116
+ let h = null;
117
117
  try {
118
- c.selection && (D = Y.toDOMRange(c, c.selection).getBoundingClientRect());
118
+ d.selection && (h = ne.toDOMRange(d, d.selection).getBoundingClientRect());
119
119
  } catch {
120
- D = null;
120
+ h = null;
121
121
  }
122
- (!D || !D.width && !D.height && !D.left && !D.top) && (D = s.getBoundingClientRect());
123
- const Se = T.getBoundingClientRect();
124
- t.style.left = `${D.left - Se.left}px`, t.style.top = `${D.top - Se.top}px`, t.style.width = "0px", t.style.height = `${D.height || parseFloat(getComputedStyle(s).lineHeight) || 16}px`;
125
- }, [c]), X = I?.setValue, a = O((t) => {
126
- m && N();
127
- const s = Oe(t);
128
- s !== P.current && (P.current = s, U(s), X?.(s), o?.(s));
129
- }, [m, N, X, o]), V = O(() => {
130
- Q.current && (j.current && clearTimeout(j.current), N(), G(!0));
131
- }, [N]);
132
- se(() => {
133
- m && N();
134
- }, [m, N]);
135
- const A = O(() => {
136
- j.current && clearTimeout(j.current), j.current = setTimeout(() => G(!1), 150);
137
- }, []), R = O(() => {
138
- j.current && clearTimeout(j.current);
139
- }, []), w = W(/* @__PURE__ */ new Map()), [_, fe] = le(null), z = W(null), M = O((t) => {
140
- z.current = t, fe(t);
141
- }, []), [xe, Pe] = le(null), pe = W(null), ne = O((t) => {
142
- pe.current = t, Pe(t);
143
- }, []), ve = O((t, s) => (w.current.set(t, s), () => {
144
- w.current.delete(t), z.current === t && M(null);
145
- }), [M]), re = O(() => Array.from(w.current.entries()).filter(([, t]) => t.el.current && t.parentId === pe.current).sort((t, s) => t[1].el.current.compareDocumentPosition(s[1].el.current) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1).map(([t]) => t), []), J = O((t) => {
146
- M(t), t && w.current.get(t)?.el.current?.scrollIntoView({
122
+ (!h || !h.width && !h.height && !h.left && !h.top) && (h = n.getBoundingClientRect());
123
+ const me = x.getBoundingClientRect();
124
+ t.style.left = `${h.left - me.left}px`, t.style.top = `${h.top - me.top}px`, t.style.width = "0px", t.style.height = `${h.height || parseFloat(getComputedStyle(n).lineHeight) || 16}px`;
125
+ }, [d]), ee = D?.setValue, u = I((t) => {
126
+ b && H();
127
+ const n = Ae(t);
128
+ n !== L.current && (L.current = n, W(n), ee?.(n), w?.(n));
129
+ }, [b, H, ee, w]), j = I(() => {
130
+ Z.current && (U.current && clearTimeout(U.current), H(), A(!0));
131
+ }, [H]);
132
+ te(() => {
133
+ b && H();
134
+ }, [b, H]);
135
+ const N = I(() => {
136
+ U.current && clearTimeout(U.current), U.current = setTimeout(() => A(!1), 150);
137
+ }, []), P = I(() => {
138
+ U.current && clearTimeout(U.current);
139
+ }, []), C = q(/* @__PURE__ */ new Map()), [V, xe] = ae(null), Q = q(null), R = I((t) => {
140
+ Q.current = t, xe(t);
141
+ }, []), [Se, $e] = ae([]), X = q([]), ce = I((t) => {
142
+ X.current = t, $e(t);
143
+ }, []), Te = I((t, n) => (C.current.set(t, n), () => {
144
+ C.current.delete(t), Q.current === t && R(null);
145
+ }), [R]), ie = I(() => Array.from(C.current.entries()).filter(([, t]) => t.el.current && t.parentId === (X.current[X.current.length - 1] ?? null)).sort((t, n) => t[1].el.current.compareDocumentPosition(n[1].el.current) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1).map(([t]) => t), []), Y = I((t) => {
146
+ R(t), t && C.current.get(t)?.el.current?.scrollIntoView({
147
147
  block: "nearest"
148
148
  });
149
- }, [M]), Ie = O(() => {
150
- const t = re();
149
+ }, [R]), De = I(() => {
150
+ const t = ie();
151
151
  if (!t.length) return;
152
- const s = z.current, T = s === null ? -1 : t.indexOf(s);
153
- J(t[Math.min(T + 1, t.length - 1)] ?? t[0]);
154
- }, [re, J]), ye = O(() => {
155
- const t = re();
152
+ const n = Q.current, x = n === null ? -1 : t.indexOf(n);
153
+ Y(t[Math.min(x + 1, t.length - 1)] ?? t[0]);
154
+ }, [ie, Y]), we = I(() => {
155
+ const t = ie();
156
156
  if (!t.length) return;
157
- const s = z.current, T = s === null ? t.length : t.indexOf(s);
158
- J(t[Math.max(T - 1, 0)] ?? t[t.length - 1]);
159
- }, [re, J]), Ce = O(() => {
160
- const t = re();
161
- t.length && J(t[0]);
162
- }, [re, J]), ue = O((t, s) => {
163
- p?.(t, s), q.current !== "focus" && G(!1);
164
- }, [p]), be = O(() => {
165
- const t = z.current;
157
+ const n = Q.current, x = n === null ? t.length : t.indexOf(n);
158
+ Y(t[Math.max(x - 1, 0)] ?? t[t.length - 1]);
159
+ }, [ie, Y]), Oe = I(() => {
160
+ const t = ie();
161
+ t.length && Y(t[0]);
162
+ }, [ie, Y]), pe = I((t, n) => {
163
+ f?.(t, n), J.current !== "focus" && A(!1);
164
+ }, [f]), ke = I(() => {
165
+ const t = Q.current;
166
166
  if (!t) return !1;
167
- const s = w.current.get(t);
168
- return s ? s.onActivate ? (s.onActivate(), !0) : (setTimeout(() => ue(s.getValue(), s.getData()), 0), !0) : !1;
169
- }, [ue]), we = O((t) => {
170
- ne(t), setTimeout(() => {
171
- const s = Array.from(w.current.entries()).filter(([, T]) => T.el.current && T.parentId === t).sort((T, D) => T[1].el.current.compareDocumentPosition(D[1].el.current) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1).map(([T]) => T);
172
- s.length && J(s[0]);
173
- }, 20);
174
- }, [ne, J]), Te = O(() => {
175
- const t = pe.current;
176
- t !== null && (ne(null), M(t));
177
- }, [ne, M]), De = O(() => {
178
- const t = z.current;
167
+ const n = C.current.get(t);
168
+ return n ? n.onActivate ? (n.onActivate(), !0) : (setTimeout(() => pe(n.getValue(), n.getData()), 0), !0) : !1;
169
+ }, [pe]), de = q(void 0), z = I(() => {
170
+ de.current && clearTimeout(de.current), de.current = void 0;
171
+ }, []), he = I((t) => {
172
+ if (t === null) return 0;
173
+ const n = X.current.indexOf(t);
174
+ return n < 0 ? -1 : n + 1;
175
+ }, []), ge = I((t, n) => {
176
+ const x = X.current;
177
+ return x.length === n + 1 && x[n] === t;
178
+ }, []), ue = I((t) => {
179
+ z();
180
+ const n = he(C.current.get(t)?.parentId ?? null);
181
+ n < 0 || ge(t, n) || (ce([...X.current.slice(0, n), t]), setTimeout(() => {
182
+ const x = Array.from(C.current.entries()).filter(([, h]) => h.el.current && h.parentId === t).sort((h, me) => h[1].el.current.compareDocumentPosition(me[1].el.current) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1).map(([h]) => h);
183
+ x.length && Y(x[0]);
184
+ }, 20));
185
+ }, [z, he, ge, ce, Y]), Me = I((t) => {
186
+ z();
187
+ const n = he(C.current.get(t)?.parentId ?? null);
188
+ if (!(n < 0 || ge(t, n))) {
189
+ if (X.current.length <= n) {
190
+ ue(t);
191
+ return;
192
+ }
193
+ de.current = setTimeout(() => ue(t), 60);
194
+ }
195
+ }, [z, he, ge, ue]), Re = I((t) => {
196
+ const n = X.current, x = t === void 0 ? n.length - 1 : n.indexOf(t);
197
+ x < 0 || (ce(n.slice(0, x)), R(n[x]));
198
+ }, [ce, R]), Ee = I(() => {
199
+ const t = Q.current;
179
200
  if (!t) return !1;
180
- const s = w.current.get(t);
181
- return s?.onActivate ? (s.onActivate(), !0) : !1;
201
+ const n = C.current.get(t);
202
+ return n?.onActivate ? (n.onActivate(), !0) : !1;
182
203
  }, []);
183
- se(() => {
184
- m || (M(null), ne(null));
185
- }, [m, M, ne]);
186
- const Ne = de(() => ({
187
- editor: c,
188
- tokenRules: f,
189
- singleLine: g,
190
- disabled: k,
191
- readonly: C,
192
- placeholder: b,
193
- search: S,
194
- documentText: $,
195
- open: m,
196
- setOpen: G,
197
- openMenu: V,
198
- menuOpenMode: H,
199
- setMenuOpenMode: ie,
200
- editorContainerRef: te,
201
- triggerRef: Q,
202
- updateTriggerPosition: N,
203
- scheduleClose: A,
204
- cancelClose: R,
205
- registerItem: ve,
206
- activeId: _,
207
- setActiveId: M,
208
- highlightNext: Ie,
209
- highlightPrevious: ye,
210
- focusFirst: Ce,
211
- selectActive: be,
212
- select: ue,
213
- openSubId: xe,
214
- enterSub: we,
215
- exitSub: Te,
216
- openActiveSub: De
217
- }), [c, f, g, k, C, b, S, $, m, V, H, N, A, R, ve, _, M, Ie, ye, Ce, be, ue, xe, we, Te, De]);
218
- return /* @__PURE__ */ v($e, { editor: c, initialValue: K, onChange: a, children: /* @__PURE__ */ v(_e.Provider, { value: Ne, children: /* @__PURE__ */ v(Ue, { open: m, modal: !1, onOpenChange: (t) => !t && G(!1), children: /* @__PURE__ */ v(Ke, { title: e, description: d, right: i, left: r, rightType: l, leftType: u, formValidation: I, ...h ?? {}, style: {
204
+ te(() => {
205
+ b || (z(), R(null), ce([]));
206
+ }, [b, z, R, ce]), te(() => z, [z]);
207
+ const He = Ie(() => ({
208
+ editor: d,
209
+ tokenRules: a,
210
+ singleLine: E,
211
+ disabled: T,
212
+ readonly: s,
213
+ placeholder: m,
214
+ search: k,
215
+ documentText: B,
216
+ open: b,
217
+ setOpen: A,
218
+ openMenu: j,
219
+ menuOpenMode: K,
220
+ setMenuOpenMode: $,
221
+ editorContainerRef: se,
222
+ triggerRef: Z,
223
+ updateTriggerPosition: H,
224
+ scheduleClose: N,
225
+ cancelClose: P,
226
+ registerItem: Te,
227
+ activeId: V,
228
+ setActiveId: R,
229
+ highlightNext: De,
230
+ highlightPrevious: we,
231
+ focusFirst: Oe,
232
+ selectActive: ke,
233
+ select: pe,
234
+ openSubPath: Se,
235
+ enterSub: ue,
236
+ exitSub: Re,
237
+ hoverSub: Me,
238
+ cancelHoverSub: z,
239
+ openActiveSub: Ee
240
+ }), [d, a, E, T, s, m, k, B, b, j, K, H, N, P, Te, V, R, De, we, Oe, ke, pe, Se, ue, Re, Me, z, Ee]);
241
+ return /* @__PURE__ */ S(Ue, { editor: d, initialValue: y, onChange: u, children: /* @__PURE__ */ S(Le.Provider, { value: He, children: /* @__PURE__ */ S(ze, { open: b, modal: !1, onOpenChange: (t) => !t && A(!1), children: /* @__PURE__ */ S(qe, { title: e, description: g, right: c, left: o, rightType: i, leftType: l, formValidation: D, ...p ?? {}, style: {
219
242
  position: "relative",
220
- ...h?.style
221
- }, children: B }) }) }) });
222
- }, yt = (n) => {
223
- const e = ae.c(44), {
224
- editor: i,
225
- tokenRules: r,
226
- singleLine: l,
227
- disabled: u,
228
- readonly: d,
229
- placeholder: h,
230
- open: f,
231
- openMenu: p,
232
- setOpen: S,
233
- menuOpenMode: I,
234
- editorContainerRef: o,
235
- scheduleClose: k,
236
- cancelClose: C,
237
- highlightNext: g,
238
- highlightPrevious: b,
239
- focusFirst: y,
240
- selectActive: F,
241
- openSubId: E,
242
- exitSub: B,
243
- openActiveSub: L
244
- } = ce();
245
- let x;
246
- e[0] !== C || e[1] !== I || e[2] !== p ? (x = () => {
247
- C(), I === "focus" && p();
248
- }, e[0] = C, e[1] = I, e[2] = p, e[3] = x) : x = e[3];
249
- const c = x;
250
- let K;
251
- e[4] !== r ? (K = (a) => {
252
- const [V, A] = a, R = [];
253
- if (!ge.isText(V) || !r.length)
254
- return R;
243
+ ...p?.style
244
+ }, children: _ }) }) }) });
245
+ }, Dt = (r) => {
246
+ const e = ve.c(44), {
247
+ editor: c,
248
+ tokenRules: o,
249
+ singleLine: i,
250
+ disabled: l,
251
+ readonly: g,
252
+ placeholder: p,
253
+ open: a,
254
+ openMenu: f,
255
+ setOpen: k,
256
+ menuOpenMode: D,
257
+ editorContainerRef: w,
258
+ scheduleClose: T,
259
+ cancelClose: s,
260
+ highlightNext: E,
261
+ highlightPrevious: m,
262
+ focusFirst: M,
263
+ selectActive: O,
264
+ openSubPath: G,
265
+ exitSub: _,
266
+ openActiveSub: F
267
+ } = fe();
268
+ let v;
269
+ e[0] !== s || e[1] !== D || e[2] !== f ? (v = () => {
270
+ s(), D === "focus" && f();
271
+ }, e[0] = s, e[1] = D, e[2] = f, e[3] = v) : v = e[3];
272
+ const d = v;
273
+ let y;
274
+ e[4] !== o ? (y = (u) => {
275
+ const [j, N] = u, P = [];
276
+ if (!be.isText(j) || !o.length)
277
+ return P;
255
278
  const {
256
- text: w
257
- } = V;
258
- return r.forEach((_, fe) => {
259
- if (_.void)
279
+ text: C
280
+ } = j;
281
+ return o.forEach((V, xe) => {
282
+ if (V.void)
260
283
  return;
261
- const z = new RegExp(_.pattern.source, _.pattern.flags.includes("g") ? _.pattern.flags : _.pattern.flags + "g");
262
- let M;
263
- for (; (M = z.exec(w)) !== null && M[0].length; )
264
- R.push({
284
+ const Q = new RegExp(V.pattern.source, V.pattern.flags.includes("g") ? V.pattern.flags : V.pattern.flags + "g");
285
+ let R;
286
+ for (; (R = Q.exec(C)) !== null && R[0].length; )
287
+ P.push({
265
288
  anchor: {
266
- path: A,
267
- offset: M.index
289
+ path: N,
290
+ offset: R.index
268
291
  },
269
292
  focus: {
270
- path: A,
271
- offset: M.index + M[0].length
293
+ path: N,
294
+ offset: R.index + R[0].length
272
295
  },
273
- tokenRuleIndex: fe,
274
- tokenText: M[0],
275
- tokenMatch: M
296
+ tokenRuleIndex: xe,
297
+ tokenText: R[0],
298
+ tokenMatch: R
276
299
  });
277
- }), R;
278
- }, e[4] = r, e[5] = K) : K = e[5];
279
- const P = K;
280
- let $;
281
- e[6] !== r ? ($ = (a) => {
300
+ }), P;
301
+ }, e[4] = o, e[5] = y) : y = e[5];
302
+ const L = y;
303
+ let B;
304
+ e[6] !== o ? (B = (u) => {
282
305
  const {
283
- attributes: V,
284
- children: A,
285
- leaf: R
286
- } = a, w = R;
287
- if (w.tokenRuleIndex !== void 0) {
288
- const _ = r[w.tokenRuleIndex];
289
- if (_)
290
- return _.wrap ? /* @__PURE__ */ v("span", { ...V, children: _.wrap(w.tokenText ?? "", A, w.tokenMatch ?? []) }) : /* @__PURE__ */ v("span", { ...V, children: /* @__PURE__ */ v("span", { style: _.style, className: _.className, children: A }) });
306
+ attributes: j,
307
+ children: N,
308
+ leaf: P
309
+ } = u, C = P;
310
+ if (C.tokenRuleIndex !== void 0) {
311
+ const V = o[C.tokenRuleIndex];
312
+ if (V)
313
+ return V.wrap ? /* @__PURE__ */ S("span", { ...j, children: V.wrap(C.tokenText ?? "", N, C.tokenMatch ?? []) }) : /* @__PURE__ */ S("span", { ...j, children: /* @__PURE__ */ S("span", { style: V.style, className: V.className, children: N }) });
291
314
  }
292
- return /* @__PURE__ */ v("span", { ...V, children: A });
293
- }, e[6] = r, e[7] = $) : $ = e[7];
294
- const U = $;
295
- let m;
296
- e[8] !== r ? (m = (a) => {
315
+ return /* @__PURE__ */ S("span", { ...j, children: N });
316
+ }, e[6] = o, e[7] = B) : B = e[7];
317
+ const W = B;
318
+ let b;
319
+ e[8] !== o ? (b = (u) => {
297
320
  const {
298
- attributes: V,
299
- children: A,
300
- element: R
301
- } = a;
302
- if (Z(R)) {
303
- const w = r[R.ruleIndex], _ = w?.wrap ? w.wrap(R.token, null, R.match ?? []) : /* @__PURE__ */ v("span", { style: w?.style, className: w?.className, children: R.token });
304
- return /* @__PURE__ */ Re("span", { ...V, children: [
305
- /* @__PURE__ */ v("span", { contentEditable: !1, className: "editor-input__token", style: {
321
+ attributes: j,
322
+ children: N,
323
+ element: P
324
+ } = u;
325
+ if (re(P)) {
326
+ const C = o[P.ruleIndex], V = C?.wrap ? C.wrap(P.token, null, P.match ?? []) : /* @__PURE__ */ S("span", { style: C?.style, className: C?.className, children: P.token });
327
+ return /* @__PURE__ */ Ne("span", { ...j, children: [
328
+ /* @__PURE__ */ S("span", { contentEditable: !1, className: "editor-input__token", style: {
306
329
  userSelect: "none"
307
- }, children: _ }),
308
- A
330
+ }, children: V }),
331
+ N
309
332
  ] });
310
333
  }
311
- return /* @__PURE__ */ v("div", { ...V, style: {
334
+ return /* @__PURE__ */ S("div", { ...j, style: {
312
335
  position: "relative"
313
- }, children: A });
314
- }, e[8] = r, e[9] = m) : m = e[9];
315
- const G = m;
316
- let H;
317
- e[10] !== i || e[11] !== B || e[12] !== y || e[13] !== g || e[14] !== b || e[15] !== f || e[16] !== L || e[17] !== p || e[18] !== E || e[19] !== F || e[20] !== S || e[21] !== l || e[22] !== r ? (H = (a) => {
318
- if (l && a.key === "Enter" && a.preventDefault(), a.ctrlKey && a.code === "Space") {
319
- a.preventDefault(), f ? y() : p();
336
+ }, children: N });
337
+ }, e[8] = o, e[9] = b) : b = e[9];
338
+ const A = b;
339
+ let K;
340
+ e[10] !== c || e[11] !== _ || e[12] !== M || e[13] !== E || e[14] !== m || e[15] !== a || e[16] !== F || e[17] !== f || e[18] !== G || e[19] !== O || e[20] !== k || e[21] !== i || e[22] !== o ? (K = (u) => {
341
+ if (i && u.key === "Enter" && u.preventDefault(), u.ctrlKey && u.code === "Space") {
342
+ u.preventDefault(), a ? M() : f();
320
343
  return;
321
344
  }
322
- if (f) {
323
- if (a.key === "ArrowDown") {
324
- a.preventDefault(), g();
345
+ if (a) {
346
+ if (u.key === "ArrowDown") {
347
+ u.preventDefault(), E();
325
348
  return;
326
349
  }
327
- if (a.key === "ArrowUp") {
328
- a.preventDefault(), b();
350
+ if (u.key === "ArrowUp") {
351
+ u.preventDefault(), m();
329
352
  return;
330
353
  }
331
- if (a.key === "ArrowRight" && L()) {
332
- a.preventDefault();
354
+ if (u.key === "ArrowRight" && F()) {
355
+ u.preventDefault();
333
356
  return;
334
357
  }
335
- if (a.key === "ArrowLeft" && E !== null) {
336
- a.preventDefault(), B();
358
+ if (u.key === "ArrowLeft" && G.length > 0) {
359
+ u.preventDefault(), _();
337
360
  return;
338
361
  }
339
- if (a.key === "Enter") {
340
- F() && a.preventDefault();
362
+ if (u.key === "Enter") {
363
+ O() && u.preventDefault();
341
364
  return;
342
365
  }
343
- if (a.key === "Escape") {
344
- a.preventDefault(), E !== null ? B() : S(!1);
366
+ if (u.key === "Escape") {
367
+ u.preventDefault(), G.length > 0 ? _() : k(!1);
345
368
  return;
346
369
  }
347
370
  }
348
- if ((a.key === "ArrowLeft" || a.key === "ArrowRight") && !a.shiftKey && r.some(Ye) && i.selection && ke.isCollapsed(i.selection)) {
349
- a.preventDefault();
350
- const V = a.key === "ArrowLeft";
351
- oe.move(i, {
371
+ if ((u.key === "ArrowLeft" || u.key === "ArrowRight") && !u.shiftKey && o.some(rt) && c.selection && Pe.isCollapsed(c.selection)) {
372
+ u.preventDefault();
373
+ const j = u.key === "ArrowLeft";
374
+ le.move(c, {
352
375
  unit: "offset",
353
- reverse: V
376
+ reverse: j
354
377
  });
355
- const A = i.selection;
356
- if (A && ke.isCollapsed(A)) {
357
- const R = Fe.parent(i, A.anchor.path);
358
- !ge.isText(R) && he.isVoid(i, R) && oe.move(i, {
378
+ const N = c.selection;
379
+ if (N && Pe.isCollapsed(N)) {
380
+ const P = Be.parent(c, N.anchor.path);
381
+ !be.isText(P) && ye.isVoid(c, P) && le.move(c, {
359
382
  unit: "offset",
360
- reverse: V
383
+ reverse: j
361
384
  });
362
385
  }
363
386
  }
364
- }, e[10] = i, e[11] = B, e[12] = y, e[13] = g, e[14] = b, e[15] = f, e[16] = L, e[17] = p, e[18] = E, e[19] = F, e[20] = S, e[21] = l, e[22] = r, e[23] = H) : H = e[23];
365
- const ie = H;
366
- let q;
367
- e[24] !== n ? (q = Ee("editor-input", n), e[24] = n, e[25] = q) : q = e[25];
368
- const te = l ? "input-wrapper__control input-wrapper__control--single-line" : "input-wrapper__control", Q = u || d;
369
- let j;
370
- e[26] !== i || e[27] !== l ? (j = l ? (a) => {
371
- a.preventDefault(), i.insertText(a.clipboardData.getData("text/plain").replace(/\r?\n/g, " "));
372
- } : void 0, e[26] = i, e[27] = l, e[28] = j) : j = e[28];
373
- let N;
374
- e[29] !== P || e[30] !== c || e[31] !== ie || e[32] !== h || e[33] !== G || e[34] !== U || e[35] !== k || e[36] !== te || e[37] !== Q || e[38] !== j ? (N = /* @__PURE__ */ v(je, { className: te, decorate: P, renderLeaf: U, renderElement: G, readOnly: Q, spellCheck: !1, placeholder: h, onBlur: k, onFocus: c, onKeyDown: ie, onPaste: j }), e[29] = P, e[30] = c, e[31] = ie, e[32] = h, e[33] = G, e[34] = U, e[35] = k, e[36] = te, e[37] = Q, e[38] = j, e[39] = N) : N = e[39];
375
- let X;
376
- return e[40] !== o || e[41] !== q || e[42] !== N ? (X = /* @__PURE__ */ v("div", { ...q, ref: o, children: N }), e[40] = o, e[41] = q, e[42] = N, e[43] = X) : X = e[43], X;
377
- }, Ct = (n) => {
378
- const e = ae.c(5), {
379
- triggerRef: i
380
- } = ce();
381
- let r;
382
- e[0] !== n ? (r = Ee("editor-input__menu-anchor", n), e[0] = n, e[1] = r) : r = e[1];
383
- let l;
384
- return e[2] !== r || e[3] !== i ? (l = /* @__PURE__ */ v(ze, { asChild: !0, children: /* @__PURE__ */ v("button", { ref: i, type: "button", tabIndex: -1, "aria-hidden": !0, onMouseDown: Ze, ...r }) }), e[2] = r, e[3] = i, e[4] = l) : l = e[4], l;
385
- }, bt = (n) => {
386
- const e = ae.c(21), {
387
- editor: i,
388
- editorContainerRef: r,
389
- setMenuOpenMode: l
390
- } = ce();
391
- let u, d, h;
392
- e[0] !== n ? ({
393
- children: u,
394
- openOn: h,
395
- ...d
396
- } = n, e[0] = n, e[1] = u, e[2] = d, e[3] = h) : (u = e[1], d = e[2], h = e[3]);
397
- const f = h === void 0 ? "shortcut" : h;
398
- let p, S;
399
- e[4] !== f || e[5] !== l ? (p = () => l(f), S = [f, l], e[4] = f, e[5] = l, e[6] = p, e[7] = S) : (p = e[6], S = e[7]), se(p, S);
400
- let I, o;
401
- e[8] !== i ? (I = (y) => {
402
- y.preventDefault(), Y.focus(i);
403
- }, o = () => Y.focus(i), e[8] = i, e[9] = I, e[10] = o) : (I = e[9], o = e[10]);
404
- let k;
405
- e[11] !== r ? (k = (y) => {
406
- const F = y.target;
407
- F && r.current?.contains(F) && y.preventDefault();
408
- }, e[11] = r, e[12] = k) : k = e[12];
409
- let C;
410
- e[13] !== d || e[14] !== I || e[15] !== o || e[16] !== k ? (C = {
387
+ }, e[10] = c, e[11] = _, e[12] = M, e[13] = E, e[14] = m, e[15] = a, e[16] = F, e[17] = f, e[18] = G, e[19] = O, e[20] = k, e[21] = i, e[22] = o, e[23] = K) : K = e[23];
388
+ const $ = K;
389
+ let J;
390
+ e[24] !== r ? (J = Ve("editor-input", r), e[24] = r, e[25] = J) : J = e[25];
391
+ const se = i ? "input-wrapper__control input-wrapper__control--single-line" : "input-wrapper__control", Z = l || g;
392
+ let U;
393
+ e[26] !== c || e[27] !== i ? (U = i ? (u) => {
394
+ u.preventDefault(), c.insertText(u.clipboardData.getData("text/plain").replace(/\r?\n/g, " "));
395
+ } : void 0, e[26] = c, e[27] = i, e[28] = U) : U = e[28];
396
+ let H;
397
+ e[29] !== L || e[30] !== d || e[31] !== $ || e[32] !== p || e[33] !== A || e[34] !== W || e[35] !== T || e[36] !== se || e[37] !== Z || e[38] !== U ? (H = /* @__PURE__ */ S(We, { className: se, decorate: L, renderLeaf: W, renderElement: A, readOnly: Z, spellCheck: !1, placeholder: p, onBlur: T, onFocus: d, onKeyDown: $, onPaste: U }), e[29] = L, e[30] = d, e[31] = $, e[32] = p, e[33] = A, e[34] = W, e[35] = T, e[36] = se, e[37] = Z, e[38] = U, e[39] = H) : H = e[39];
398
+ let ee;
399
+ return e[40] !== w || e[41] !== J || e[42] !== H ? (ee = /* @__PURE__ */ S("div", { ...J, ref: w, children: H }), e[40] = w, e[41] = J, e[42] = H, e[43] = ee) : ee = e[43], ee;
400
+ }, wt = (r) => {
401
+ const e = ve.c(5), {
402
+ triggerRef: c
403
+ } = fe();
404
+ let o;
405
+ e[0] !== r ? (o = Ve("editor-input__menu-anchor", r), e[0] = r, e[1] = o) : o = e[1];
406
+ let i;
407
+ return e[2] !== o || e[3] !== c ? (i = /* @__PURE__ */ S(Ze, { asChild: !0, children: /* @__PURE__ */ S("button", { ref: c, type: "button", tabIndex: -1, "aria-hidden": !0, onMouseDown: ot, ...o }) }), e[2] = o, e[3] = c, e[4] = i) : i = e[4], i;
408
+ }, Ot = (r) => {
409
+ const e = ve.c(21), {
410
+ editor: c,
411
+ editorContainerRef: o,
412
+ setMenuOpenMode: i
413
+ } = fe();
414
+ let l, g, p;
415
+ e[0] !== r ? ({
416
+ children: l,
417
+ openOn: p,
418
+ ...g
419
+ } = r, e[0] = r, e[1] = l, e[2] = g, e[3] = p) : (l = e[1], g = e[2], p = e[3]);
420
+ const a = p === void 0 ? "shortcut" : p;
421
+ let f, k;
422
+ e[4] !== a || e[5] !== i ? (f = () => i(a), k = [a, i], e[4] = a, e[5] = i, e[6] = f, e[7] = k) : (f = e[6], k = e[7]), te(f, k);
423
+ let D, w;
424
+ e[8] !== c ? (D = (M) => {
425
+ M.preventDefault(), ne.focus(c);
426
+ }, w = () => ne.focus(c), e[8] = c, e[9] = D, e[10] = w) : (D = e[9], w = e[10]);
427
+ let T;
428
+ e[11] !== o ? (T = (M) => {
429
+ const O = M.target;
430
+ O && o.current?.contains(O) && M.preventDefault();
431
+ }, e[11] = o, e[12] = T) : T = e[12];
432
+ let s;
433
+ e[13] !== g || e[14] !== D || e[15] !== w || e[16] !== T ? (s = {
411
434
  color: "primary",
412
435
  align: "start",
413
436
  sideOffset: 8,
414
- onContextMenuCapture: et,
415
- onCloseAutoFocus: tt,
416
- onOpenAutoFocus: I,
417
- onFocusCapture: o,
418
- onInteractOutside: k,
419
- ...d
420
- }, e[13] = d, e[14] = I, e[15] = o, e[16] = k, e[17] = C) : C = e[17];
421
- const g = C;
422
- let b;
423
- return e[18] !== u || e[19] !== g ? (b = /* @__PURE__ */ v(We, { children: /* @__PURE__ */ v(Ge, { ...g, children: u }) }), e[18] = u, e[19] = g, e[20] = b) : b = e[20], b;
424
- }, wt = (n) => {
437
+ onContextMenuCapture: st,
438
+ onCloseAutoFocus: ct,
439
+ onOpenAutoFocus: D,
440
+ onFocusCapture: w,
441
+ onInteractOutside: T,
442
+ ...g
443
+ }, e[13] = g, e[14] = D, e[15] = w, e[16] = T, e[17] = s) : s = e[17];
444
+ const E = s;
445
+ let m;
446
+ return e[18] !== l || e[19] !== E ? (m = /* @__PURE__ */ S(Je, { children: /* @__PURE__ */ S(Qe, { ...E, children: l }) }), e[18] = l, e[19] = E, e[20] = m) : m = e[20], m;
447
+ }, kt = (r) => {
425
448
  const {
426
449
  value: e,
427
- data: i,
428
- children: r,
429
- onlyOnce: l,
430
- aliases: u,
431
- ...d
432
- } = n, {
433
- editor: h,
434
- registerItem: f,
435
- activeId: p,
436
- setActiveId: S,
437
- select: I,
438
- search: o,
439
- documentText: k
440
- } = ce(), C = ee.useContext(me), g = ee.useId(), b = W(null), y = W({
450
+ data: c,
451
+ children: o,
452
+ onlyOnce: i,
453
+ aliases: l,
454
+ ...g
455
+ } = r, {
456
+ editor: p,
457
+ registerItem: a,
458
+ activeId: f,
459
+ setActiveId: k,
460
+ select: D,
461
+ search: w,
462
+ documentText: T,
463
+ cancelHoverSub: s
464
+ } = fe(), E = oe.useContext(Ce), m = oe.useId(), M = q(null), O = q({
441
465
  value: e,
442
- data: i
466
+ data: c
443
467
  });
444
- y.current = {
468
+ O.current = {
445
469
  value: e,
446
- data: i
470
+ data: c
447
471
  };
448
- const F = !!l && k.includes(String(e)), E = o?.trim().toLowerCase() ?? "", B = !E || [typeof r == "string" ? r : String(e), ...u ?? []].some((c) => c.toLowerCase().includes(E)), L = F || !B;
449
- return se(() => {
450
- if (!L)
451
- return f(g, {
452
- getValue: () => y.current.value,
453
- getData: () => y.current.data,
454
- el: b,
455
- parentId: C
472
+ const G = !!i && T.includes(String(e)), _ = w?.trim().toLowerCase() ?? "", F = !_ || [typeof o == "string" ? o : String(e), ...l ?? []].some((y) => y.toLowerCase().includes(_)), v = G || !F;
473
+ return te(() => {
474
+ if (!v)
475
+ return a(m, {
476
+ getValue: () => O.current.value,
477
+ getData: () => O.current.data,
478
+ el: M,
479
+ parentId: E
456
480
  });
457
- }, [g, f, C, L]), L ? null : /* @__PURE__ */ v(He, { ...d, ref: (c) => {
458
- b.current = c;
459
- }, textValue: "", "data-focus": p === g || void 0, onPointerDown: (c) => {
460
- c.preventDefault(), S(g), Y.focus(h);
461
- }, onPointerMove: (c) => {
462
- c.preventDefault(), c.stopPropagation(), p !== g && S(g);
463
- }, onSelect: () => setTimeout(() => I(y.current.value, y.current.data), 0), children: r });
464
- }, Tt = (n) => {
465
- const e = ae.c(38), {
466
- label: i,
467
- children: r
468
- } = n, {
469
- editor: l,
470
- registerItem: u,
471
- activeId: d,
472
- setActiveId: h,
473
- openSubId: f,
474
- enterSub: p,
475
- exitSub: S
476
- } = ce(), I = ee.useContext(me), o = ee.useId(), k = W(null);
477
- let C, g;
478
- e[0] !== p || e[1] !== o || e[2] !== I || e[3] !== u ? (C = () => u(o, {
479
- getValue: nt,
480
- getData: rt,
481
- el: k,
482
- parentId: I,
483
- onActivate: () => p(o)
484
- }), g = [o, u, I, p], e[0] = p, e[1] = o, e[2] = I, e[3] = u, e[4] = C, e[5] = g) : (C = e[4], g = e[5]), se(C, g);
485
- let b;
486
- e[6] !== l ? (b = {
487
- onOpenAutoFocus: (m) => {
488
- m.preventDefault(), Y.focus(l);
481
+ }, [m, a, E, v]), v ? null : /* @__PURE__ */ S(Xe, { ...g, ref: (y) => {
482
+ M.current = y;
483
+ }, textValue: "", "data-focus": f === m || void 0, onPointerDown: (y) => {
484
+ y.preventDefault(), k(m), ne.focus(p);
485
+ }, onPointerMove: (y) => {
486
+ y.preventDefault(), s(), f !== m && k(m);
487
+ }, onSelect: () => setTimeout(() => D(O.current.value, O.current.data), 0), children: o });
488
+ }, Mt = (r) => {
489
+ const e = ve.c(47), {
490
+ label: c,
491
+ children: o
492
+ } = r, {
493
+ editor: i,
494
+ registerItem: l,
495
+ activeId: g,
496
+ setActiveId: p,
497
+ openSubPath: a,
498
+ enterSub: f,
499
+ exitSub: k,
500
+ hoverSub: D,
501
+ cancelHoverSub: w
502
+ } = fe(), T = oe.useContext(Ce), s = oe.useId(), E = q(null);
503
+ let m, M;
504
+ e[0] !== f || e[1] !== s || e[2] !== T || e[3] !== l ? (m = () => l(s, {
505
+ getValue: it,
506
+ getData: lt,
507
+ el: E,
508
+ parentId: T,
509
+ onActivate: () => f(s)
510
+ }), M = [s, l, T, f], e[0] = f, e[1] = s, e[2] = T, e[3] = l, e[4] = m, e[5] = M) : (m = e[4], M = e[5]), te(m, M);
511
+ let O;
512
+ e[6] !== i ? (O = {
513
+ onOpenAutoFocus: ($) => {
514
+ $.preventDefault(), ne.focus(i);
489
515
  },
490
- onFocusCapture: () => Y.focus(l),
491
- onCloseAutoFocus: ot,
492
- onFocusOutside: st,
493
- onInteractOutside: it
494
- }, e[6] = l, e[7] = b) : b = e[7];
495
- const y = b, F = f === o;
496
- let E;
497
- e[8] !== p || e[9] !== S || e[10] !== o || e[11] !== f ? (E = (m) => {
498
- m && f !== o ? p(o) : !m && f === o && S();
499
- }, e[8] = p, e[9] = S, e[10] = o, e[11] = f, e[12] = E) : E = e[12];
516
+ onFocusCapture: () => ne.focus(i),
517
+ onCloseAutoFocus: ut,
518
+ onFocusOutside: at,
519
+ onInteractOutside: ft
520
+ }, e[6] = i, e[7] = O) : O = e[7];
521
+ const G = O;
522
+ let _;
523
+ e[8] !== s || e[9] !== a ? (_ = a.includes(s), e[8] = s, e[9] = a, e[10] = _) : _ = e[10];
524
+ let F;
525
+ e[11] !== f || e[12] !== k || e[13] !== s ? (F = ($) => $ ? f(s) : k(s), e[11] = f, e[12] = k, e[13] = s, e[14] = F) : F = e[14];
526
+ let v;
527
+ e[15] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (v = ($) => {
528
+ E.current = $;
529
+ }, e[15] = v) : v = e[15];
530
+ const d = g === s || void 0;
531
+ let y;
532
+ e[16] !== i || e[17] !== f || e[18] !== s || e[19] !== p ? (y = ($) => {
533
+ $.preventDefault(), p(s), f(s), ne.focus(i);
534
+ }, e[16] = i, e[17] = f, e[18] = s, e[19] = p, e[20] = y) : y = e[20];
535
+ let L;
536
+ e[21] !== D || e[22] !== s || e[23] !== p ? (L = () => {
537
+ p(s), D(s);
538
+ }, e[21] = D, e[22] = s, e[23] = p, e[24] = L) : L = e[24];
500
539
  let B;
501
- e[13] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (B = (m) => {
502
- k.current = m;
503
- }, e[13] = B) : B = e[13];
504
- const L = d === o || void 0;
505
- let x;
506
- e[14] !== l || e[15] !== o || e[16] !== h ? (x = (m) => {
507
- m.preventDefault(), h(o), Y.focus(l);
508
- }, e[14] = l, e[15] = o, e[16] = h, e[17] = x) : x = e[17];
509
- let c;
510
- e[18] !== d || e[19] !== o || e[20] !== h ? (c = () => {
511
- d !== o && h(o);
512
- }, e[18] = d, e[19] = o, e[20] = h, e[21] = c) : c = e[21];
540
+ e[25] !== g || e[26] !== s || e[27] !== p ? (B = ($) => {
541
+ $.preventDefault(), g !== s && p(s);
542
+ }, e[25] = g, e[26] = s, e[27] = p, e[28] = B) : B = e[28];
543
+ let W;
544
+ e[29] !== w || e[30] !== c || e[31] !== B || e[32] !== d || e[33] !== y || e[34] !== L ? (W = /* @__PURE__ */ S(et, { ref: v, "data-focus": d, onPointerDown: y, onPointerEnter: L, onPointerMove: B, onPointerLeave: w, children: c }), e[29] = w, e[30] = c, e[31] = B, e[32] = d, e[33] = y, e[34] = L, e[35] = W) : W = e[35];
545
+ let b;
546
+ e[36] !== o || e[37] !== s ? (b = /* @__PURE__ */ S(Ce.Provider, { value: s, children: o }), e[36] = o, e[37] = s, e[38] = b) : b = e[38];
547
+ let A;
548
+ e[39] !== G || e[40] !== b ? (A = /* @__PURE__ */ S(Ye, { color: "primary", ...G, children: b }), e[39] = G, e[40] = b, e[41] = A) : A = e[41];
513
549
  let K;
514
- e[22] !== i || e[23] !== L || e[24] !== x || e[25] !== c ? (K = /* @__PURE__ */ v(Je, { ref: B, "data-focus": L, onPointerDown: x, onPointerMove: c, children: i }), e[22] = i, e[23] = L, e[24] = x, e[25] = c, e[26] = K) : K = e[26];
515
- let P;
516
- e[27] !== r || e[28] !== o ? (P = /* @__PURE__ */ v(me.Provider, { value: o, children: r }), e[27] = r, e[28] = o, e[29] = P) : P = e[29];
517
- let $;
518
- e[30] !== y || e[31] !== P ? ($ = /* @__PURE__ */ v(qe, { color: "primary", ...y, children: P }), e[30] = y, e[31] = P, e[32] = $) : $ = e[32];
519
- let U;
520
- return e[33] !== K || e[34] !== $ || e[35] !== F || e[36] !== E ? (U = /* @__PURE__ */ Re(Qe, { open: F, onOpenChange: E, children: [
521
- K,
522
- $
523
- ] }), e[33] = K, e[34] = $, e[35] = F, e[36] = E, e[37] = U) : U = e[37], U;
550
+ return e[42] !== W || e[43] !== A || e[44] !== _ || e[45] !== F ? (K = /* @__PURE__ */ Ne(tt, { open: _, onOpenChange: F, children: [
551
+ W,
552
+ A
553
+ ] }), e[42] = W, e[43] = A, e[44] = _, e[45] = F, e[46] = K) : K = e[46], K;
524
554
  };
525
- function Ye(n) {
526
- return n.void;
555
+ function rt(r) {
556
+ return r.void;
527
557
  }
528
- function Ze(n) {
529
- return n.preventDefault();
558
+ function ot(r) {
559
+ return r.preventDefault();
530
560
  }
531
- function et(n) {
532
- return n.stopPropagation();
561
+ function st(r) {
562
+ return r.stopPropagation();
533
563
  }
534
- function tt(n) {
535
- return n.preventDefault();
564
+ function ct(r) {
565
+ return r.preventDefault();
536
566
  }
537
- function nt() {
567
+ function it() {
538
568
  }
539
- function rt() {
569
+ function lt() {
540
570
  }
541
- function ot(n) {
542
- return n.preventDefault();
571
+ function ut(r) {
572
+ return r.preventDefault();
543
573
  }
544
- function st(n) {
545
- return n.preventDefault();
574
+ function at(r) {
575
+ return r.preventDefault();
546
576
  }
547
- function it(n) {
548
- return n.preventDefault();
577
+ function ft(r) {
578
+ return r.preventDefault();
549
579
  }
550
580
  export {
551
- It as EditorInput,
552
- bt as EditorInputMenu,
553
- wt as EditorInputMenuItem,
554
- Tt as EditorInputSubMenu,
555
- Ct as EditorInputTrigger,
556
- yt as EditorInputValue
581
+ Tt as EditorInput,
582
+ Ot as EditorInputMenu,
583
+ kt as EditorInputMenuItem,
584
+ Mt as EditorInputSubMenu,
585
+ wt as EditorInputTrigger,
586
+ Dt as EditorInputValue
557
587
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@code0-tech/pictor",
3
- "version": "0.18.2",
3
+ "version": "0.18.3",
4
4
  "type": "module",
5
5
  "description": "A simple template for a custom React component library",
6
6
  "scripts": {