@levo-so/studio 0.1.114 → 0.2.1

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 (49) hide show
  1. package/{BillingStep-DjNmSVkY.js → BillingStep-D4P_J_PJ.js} +1 -1
  2. package/Button-CmwbMGFV.js +505 -0
  3. package/{CollectionField-DrJuHNsg.js → CollectionField-D25BVweU.js} +29 -77
  4. package/{DateTimeWidget-CzBq92zC.js → DateTimeWidget-CG9ylSgA.js} +8 -8
  5. package/{EntryCard-C2KA5HMX.js → EntryCard-FxB1uCis.js} +4 -4
  6. package/{KBChatWidget-CPrg_etS.js → KBChatWidget-_kcueoxi.js} +388 -360
  7. package/{LoginCard-S_2jls6v.js → LoginCard-D8ZVZjbR.js} +3 -3
  8. package/{LoginForm-DeYsk4kd.js → LoginForm-Cg5F4guy.js} +2 -2
  9. package/{LoginModal-BbDfB4S9.js → LoginModal-Cn6Nsuz3.js} +4 -4
  10. package/{MessageCard-x6jPClGi.js → MessageCard-Bx6pC8wW.js} +2 -2
  11. package/{MessageFooter-CHuPnL_D.js → MessageFooter-CsY4uBIJ.js} +2 -2
  12. package/{ModalManager-DQVNPEuG.js → ModalManager-BIKunQ8D.js} +1 -1
  13. package/{PendingApprovalCard-C06B_Tg-.js → PendingApprovalCard-0ORO4y9v.js} +3 -3
  14. package/{PhoneWidget-DdX8_-2v.js → PhoneWidget-CZr1PZ4G.js} +3 -3
  15. package/{PopupRenderer-Bncp54gB-DysCmUdR.js → PopupRenderer-Bncp54gB-BOJj-taW.js} +15 -16
  16. package/{ProfileCard-DGanb4BY.js → ProfileCard-C2lXYYkC.js} +9 -8
  17. package/RichTextWidget-Dcq-NsEi.js +748 -0
  18. package/{RteThemeProvider-LFGzAYi1.js → RteThemeProvider-DxYOzcck.js} +1 -1
  19. package/Spinner-wdUA5kVe.js +7 -0
  20. package/{StripePaymentModal-BsYNQ4MB.js → StripePaymentModal-DfFlmYsp.js} +17 -17
  21. package/{bookingCard-CUv7WgqT.js → bookingCard-CZ3Jj9sL.js} +218 -217
  22. package/{dialog-LRLdr3kq.js → dialog-CznAfWcE.js} +32 -32
  23. package/{dist-D-y51gmU.js → dist-B91ZHPA-.js} +1103 -1261
  24. package/index.d.ts +0 -2
  25. package/index.js +2719 -2269
  26. package/kbChat-BpJkUcpv.js +163 -0
  27. package/{nodeAlignment-BC_Uferw.js → nodeAlignment-DS9_DLGB.js} +31 -23
  28. package/package.json +10 -10
  29. package/pillChrome-B4uuWJhY.js +16 -0
  30. package/studio.css +1 -1
  31. package/{useLogin-B2HHZxTi.js → useLogin-mEuzGlb2.js} +1 -1
  32. package/Button-Uwxgkriw.js +0 -1657
  33. package/RichTextWidget-BfZ3sCcx.js +0 -113
  34. package/Toolbar-6IXR9qAh.js +0 -645
  35. package/collection.d.ts +0 -500
  36. package/collection.js +0 -30
  37. package/inlineRteTheme-abXxag3B.js +0 -9
  38. package/kbChat-DCrdcXir.js +0 -166
  39. package/pillChrome-CQoJfFk3.js +0 -16
  40. package/utils-NDllPDUz.js +0 -5
  41. /package/{AuthProvider-C6bvedwF.js → AuthProvider-CFQqiIf1.js} +0 -0
  42. /package/{Beams-DboMUgCv.js → Beams-CDt4Mt3M.js} +0 -0
  43. /package/{Dots-a8xSboDv.js → Dots-DadBreAs.js} +0 -0
  44. /package/{Gradient-NacpoDCM.js → Gradient-CPoU73FR.js} +0 -0
  45. /package/{Grid-BJQvxnks.js → Grid-CAXyHMvM.js} +0 -0
  46. /package/{Popover-C_IQMM8H.js → Popover-Dt4--ulK.js} +0 -0
  47. /package/{Waves-DUuT_IFr.js → Waves-DPbfUhRX.js} +0 -0
  48. /package/{authentication-TdyaDNTn.js → authentication-BSNkm1-l.js} +0 -0
  49. /package/{card-D5fPArfa.js → card-DFSlAwCq.js} +0 -0
@@ -1,645 +0,0 @@
1
- import { t as e } from "./Button-lUfKisu8.js";
2
- import { t } from "./nodeAlignment-BC_Uferw.js";
3
- import { l as n } from "./CollectionField-DrJuHNsg.js";
4
- import { n as r, r as i, t as a } from "./Tooltip-DreKXbTO.js";
5
- import { a as o, i as s, n as c, o as l, r as u } from "./Popover-C_IQMM8H.js";
6
- import { c as d } from "react/compiler-runtime";
7
- import { forwardRef as f, useEffect as p, useState as m } from "react";
8
- import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
9
- import v from "clsx";
10
- import { IconAlignCenter as y, IconAlignJustified as b, IconAlignLeft as x, IconAlignRight as S, IconArrowBackUp as C, IconArrowForwardUp as w, IconBold as T, IconChevronDown as E, IconCode as ee, IconCornerDownLeft as te, IconExternalLink as ne, IconH1 as D, IconH2 as O, IconH3 as k, IconH4 as A, IconH5 as j, IconH6 as M, IconItalic as N, IconLink as re, IconList as ie, IconListNumbers as P, IconPencil as F, IconPilcrow as I, IconRotate2 as L, IconStrikethrough as R, IconSubscript as z, IconSuperscript as B, IconTrash as ae, IconUnderline as V } from "@tabler/icons-react";
11
- import { Subscript as H } from "@tiptap/extension-subscript";
12
- import { Superscript as U } from "@tiptap/extension-superscript";
13
- import { Typography as W } from "@tiptap/extension-typography";
14
- import { UniqueID as G } from "@tiptap/extension-unique-id";
15
- import { AllSelection as K, NodeSelection as q, TextSelection as J } from "@tiptap/pm/state";
16
- import { Placeholder as Y, Selection as oe } from "@tiptap/extensions";
17
- import { StarterKit as se } from "@tiptap/starter-kit";
18
- import { useCurrentEditor as ce, useEditorState as X } from "@tiptap/react";
19
- //#region ../../libraries/react-collection/dist/components/editor/extensionKit.js
20
- var le = (e = { placeholder: "Write something ..." }) => [
21
- se.configure({
22
- blockquote: !1,
23
- codeBlock: !1,
24
- horizontalRule: !1,
25
- dropcursor: { width: 2 },
26
- link: {
27
- openOnClick: !1,
28
- HTMLAttributes: { target: "_blank" }
29
- }
30
- }),
31
- Y.configure({ placeholder: e?.placeholder }),
32
- W,
33
- oe,
34
- U,
35
- H,
36
- t,
37
- G.configure({ types: [
38
- "paragraph",
39
- "heading",
40
- "bulletList",
41
- "orderedList"
42
- ] })
43
- ], Z = f((t, n) => {
44
- let o = d(27), s, c, l, u, f, p, m;
45
- o[0] === t ? (s = o[1], c = o[2], l = o[3], u = o[4], f = o[5], p = o[6], m = o[7]) : ({label: u, Icon: s, isActive: l, iconSize: p, trailing: m, className: c, ...f} = t, o[0] = t, o[1] = s, o[2] = c, o[3] = l, o[4] = u, o[5] = f, o[6] = p, o[7] = m);
46
- let h = p === void 0 ? 16 : p, y = l || void 0, b = l && "_1vaxhty0", x;
47
- o[8] !== c || o[9] !== b ? (x = v(b, c), o[8] = c, o[9] = b, o[10] = x) : x = o[10];
48
- let S;
49
- o[11] !== s || o[12] !== h ? (S = /* @__PURE__ */ g(s, { size: h }), o[11] = s, o[12] = h, o[13] = S) : S = o[13];
50
- let C;
51
- o[14] !== u || o[15] !== f || o[16] !== n || o[17] !== y || o[18] !== x || o[19] !== S || o[20] !== m ? (C = /* @__PURE__ */ g(r, {
52
- onPointerDown: ue,
53
- render: /* @__PURE__ */ _(e, {
54
- ref: n,
55
- type: "button",
56
- variant: "ghost",
57
- size: "sm",
58
- tabIndex: -1,
59
- "aria-label": u,
60
- "aria-pressed": y,
61
- className: x,
62
- ...f,
63
- children: [S, m]
64
- })
65
- }), o[14] = u, o[15] = f, o[16] = n, o[17] = y, o[18] = x, o[19] = S, o[20] = m, o[21] = C) : C = o[21];
66
- let w;
67
- o[22] === u ? w = o[23] : (w = /* @__PURE__ */ g(i, { children: u }), o[22] = u, o[23] = w);
68
- let T;
69
- return o[24] !== C || o[25] !== w ? (T = /* @__PURE__ */ _(a, { children: [C, w] }), o[24] = C, o[25] = w, o[26] = T) : T = o[26], T;
70
- });
71
- Z.displayName = "ToolbarButton";
72
- function ue(e) {
73
- return e.preventDefault();
74
- }
75
- //#endregion
76
- //#region ../../libraries/react-collection/dist/components/editor/Toolbar.cssm.js
77
- var de = "_261ja30", Q = "_261ja31", fe = [
78
- "paragraph",
79
- "heading",
80
- "bulletList",
81
- "orderedList",
82
- "taskList",
83
- "codeBlock"
84
- ], pe = [
85
- "tableCell",
86
- "tableHeader",
87
- "quoteCaption",
88
- "detailsSummary"
89
- ], me = (e) => {
90
- if (!e) return !1;
91
- let { $from: t } = e.state.selection;
92
- for (let e = t.depth; e > 0; e--) if (pe.includes(t.node(e).type.name)) return !0;
93
- return !1;
94
- }, he = (e, t) => {
95
- if (!e || t.length === 0) return !1;
96
- let { selection: n } = e.state, r = new Set(t);
97
- if (n instanceof q) {
98
- let e = n.node?.type?.name;
99
- return !!e && r.has(e);
100
- }
101
- if (n instanceof J || n instanceof K) {
102
- let t = !0;
103
- return e.state.doc.nodesBetween(n.from, n.to, (e) => e.isTextblock && !r.has(e.type.name) ? (t = !1, !1) : t), t;
104
- }
105
- return !1;
106
- }, ge = /[\0-\x20\xA0\u1680\u180E\u2000-\u2029\u205F\u3000]/g, _e = [
107
- "http",
108
- "https",
109
- "ftp",
110
- "ftps",
111
- "mailto",
112
- "tel",
113
- "callto",
114
- "sms"
115
- ], ve = (e, t) => {
116
- try {
117
- let n = new URL(e, t), r = n.href.replace(ge, ""), i = RegExp(`^(?:(?:${_e.join("|")}):|[^a-z]|[a-z0-9+.\\-]+(?:[^a-z+.\\-:]|$))`, "i");
118
- if (r.match(i)) return n.href;
119
- } catch {}
120
- return "#";
121
- }, ye = (e, t = []) => {
122
- let { tr: n } = e.state, { selection: r } = n;
123
- return r.empty ? !1 : (r.ranges.forEach((e) => {
124
- n.doc.nodesBetween(e.$from.pos, e.$to.pos, (e, r) => (e.isInline && e.marks.forEach((i) => {
125
- t.includes(i.type.name) || n.removeMark(r, r + e.nodeSize, i.type);
126
- }), !0));
127
- }), e.view.dispatch(n), e.commands.focus(), !0);
128
- }, be = (e) => {
129
- let { selection: t } = e.state;
130
- if (t.empty) return !1;
131
- for (let n of t.ranges) {
132
- let t = !1;
133
- if (e.state.doc.nodesBetween(n.$from.pos, n.$to.pos, (e) => e.isInline && e.marks.length > 0 ? (t = !0, !1) : !0), t) return !0;
134
- }
135
- return !1;
136
- }, xe = "j67x6z0", Se = "j67x6z1", Ce = "_5pk5r80", we = (e) => {
137
- let t = d(50), { editor: n } = e, [f, h] = m(!1), { isActive: v, currentUrl: y } = X({
138
- editor: n,
139
- selector: Te
140
- }) ?? {
141
- isActive: !1,
142
- currentUrl: ""
143
- }, [b, x] = m(y), S, C;
144
- t[0] !== y || t[1] !== f ? (S = () => {
145
- f && x(y);
146
- }, C = [f, y], t[0] = y, t[1] = f, t[2] = S, t[3] = C) : (S = t[2], C = t[3]), p(S, C);
147
- let w;
148
- t[4] !== n || t[5] !== b ? (w = () => {
149
- b && (n.chain().focus().extendMarkRange("link").setLink({ href: b }).run(), h(!1));
150
- }, t[4] = n, t[5] = b, t[6] = w) : w = t[6];
151
- let T = w, E;
152
- t[7] === n ? E = t[8] : (E = () => {
153
- n.chain().focus().extendMarkRange("link").unsetLink().run(), x(""), h(!1);
154
- }, t[7] = n, t[8] = E);
155
- let ee = E, D;
156
- t[9] === b ? D = t[10] : (D = () => {
157
- let e = ve(b, window.location.href);
158
- e !== "#" && window.open(e, "_blank", "noopener,noreferrer");
159
- }, t[9] = b, t[10] = D);
160
- let O = D, k;
161
- t[11] === Symbol.for("react.memo_cache_sentinel") ? (k = (e) => {
162
- e.preventDefault(), h(!0);
163
- }, t[11] = k) : k = t[11];
164
- let A;
165
- t[12] === v ? A = t[13] : (A = /* @__PURE__ */ g(l, {
166
- onPointerDown: Ee,
167
- render: /* @__PURE__ */ g(Z, {
168
- label: "Link",
169
- Icon: re,
170
- isActive: v,
171
- onClick: k
172
- })
173
- }), t[12] = v, t[13] = A);
174
- let j;
175
- t[14] === Symbol.for("react.memo_cache_sentinel") ? (j = (e) => x(e.target.value), t[14] = j) : j = t[14];
176
- let M;
177
- t[15] === T ? M = t[16] : (M = (e) => {
178
- e.key === "Enter" && (e.preventDefault(), T());
179
- }, t[15] = T, t[16] = M);
180
- let N;
181
- t[17] !== M || t[18] !== b ? (N = /* @__PURE__ */ g("input", {
182
- className: Se,
183
- value: b,
184
- onChange: j,
185
- onKeyDown: M,
186
- placeholder: "Paste a link..."
187
- }), t[17] = M, t[18] = b, t[19] = N) : N = t[19];
188
- let ie = !b && !v, P;
189
- t[20] === Symbol.for("react.memo_cache_sentinel") ? (P = /* @__PURE__ */ g(te, { size: 16 }), t[20] = P) : P = t[20];
190
- let F;
191
- t[21] !== T || t[22] !== ie ? (F = /* @__PURE__ */ g(r, { render: /* @__PURE__ */ g("button", {
192
- type: "button",
193
- className: Ce,
194
- onClick: T,
195
- disabled: ie,
196
- "aria-label": "Apply link",
197
- children: P
198
- }) }), t[21] = T, t[22] = ie, t[23] = F) : F = t[23];
199
- let I;
200
- t[24] === Symbol.for("react.memo_cache_sentinel") ? (I = /* @__PURE__ */ g(i, { children: "Apply link" }), t[24] = I) : I = t[24];
201
- let L;
202
- t[25] === F ? L = t[26] : (L = /* @__PURE__ */ _(a, { children: [F, I] }), t[25] = F, t[26] = L);
203
- let R = !b && !v, z;
204
- t[27] === Symbol.for("react.memo_cache_sentinel") ? (z = /* @__PURE__ */ g(ne, { size: 16 }), t[27] = z) : z = t[27];
205
- let B;
206
- t[28] !== O || t[29] !== R ? (B = /* @__PURE__ */ g(r, { render: /* @__PURE__ */ g("button", {
207
- type: "button",
208
- className: Ce,
209
- onClick: O,
210
- disabled: R,
211
- "aria-label": "Open in new window",
212
- children: z
213
- }) }), t[28] = O, t[29] = R, t[30] = B) : B = t[30];
214
- let V;
215
- t[31] === Symbol.for("react.memo_cache_sentinel") ? (V = /* @__PURE__ */ g(i, { children: "Open in new window" }), t[31] = V) : V = t[31];
216
- let H;
217
- t[32] === B ? H = t[33] : (H = /* @__PURE__ */ _(a, { children: [B, V] }), t[32] = B, t[33] = H);
218
- let U = !b && !v, W;
219
- t[34] === Symbol.for("react.memo_cache_sentinel") ? (W = /* @__PURE__ */ g(ae, { size: 16 }), t[34] = W) : W = t[34];
220
- let G;
221
- t[35] !== ee || t[36] !== U ? (G = /* @__PURE__ */ g(r, { render: /* @__PURE__ */ g("button", {
222
- type: "button",
223
- className: Ce,
224
- onClick: ee,
225
- disabled: U,
226
- "aria-label": "Remove link",
227
- children: W
228
- }) }), t[35] = ee, t[36] = U, t[37] = G) : G = t[37];
229
- let K;
230
- t[38] === Symbol.for("react.memo_cache_sentinel") ? (K = /* @__PURE__ */ g(i, { children: "Remove link" }), t[38] = K) : K = t[38];
231
- let q;
232
- t[39] === G ? q = t[40] : (q = /* @__PURE__ */ _(a, { children: [G, K] }), t[39] = G, t[40] = q);
233
- let J;
234
- t[41] !== N || t[42] !== L || t[43] !== H || t[44] !== q ? (J = /* @__PURE__ */ g(s, { children: /* @__PURE__ */ g(u, {
235
- side: "bottom",
236
- align: "center",
237
- children: /* @__PURE__ */ _(o.Popup, {
238
- className: xe,
239
- children: [
240
- N,
241
- L,
242
- H,
243
- q
244
- ]
245
- })
246
- }) }), t[41] = N, t[42] = L, t[43] = H, t[44] = q, t[45] = J) : J = t[45];
247
- let Y;
248
- return t[46] !== f || t[47] !== J || t[48] !== A ? (Y = /* @__PURE__ */ _(c, {
249
- open: f,
250
- onOpenChange: h,
251
- children: [A, J]
252
- }), t[46] = f, t[47] = J, t[48] = A, t[49] = Y) : Y = t[49], Y;
253
- };
254
- function Te(e) {
255
- let { editor: t } = e;
256
- return {
257
- isActive: t.isActive("link"),
258
- currentUrl: t.getAttributes("link")?.href ?? ""
259
- };
260
- }
261
- function Ee(e) {
262
- return e.preventDefault();
263
- }
264
- //#endregion
265
- //#region ../../libraries/react-collection/dist/components/editor/menus/TurnIntoMenu.cssm.js
266
- var De = "_1keigwl0", Oe = "_1keigwl1 _5pk5r80", $ = (e) => (t) => t.chain().focus().setHeading({ level: e }).run(), ke = [
267
- {
268
- type: "paragraph",
269
- label: "Text",
270
- Icon: I,
271
- isActive: (e) => e.isActive("paragraph"),
272
- canApply: (e) => e.can().setParagraph() || e.can().clearNodes(),
273
- apply: (e) => e.chain().focus().setParagraph().run()
274
- },
275
- {
276
- type: "heading_1",
277
- label: "Heading 1",
278
- Icon: D,
279
- isActive: (e) => e.isActive("heading", { level: 1 }),
280
- canApply: (e) => e.can().setHeading({ level: 1 }) || e.can().clearNodes(),
281
- apply: $(1)
282
- },
283
- {
284
- type: "heading_2",
285
- label: "Heading 2",
286
- Icon: O,
287
- isActive: (e) => e.isActive("heading", { level: 2 }),
288
- canApply: (e) => e.can().setHeading({ level: 2 }) || e.can().clearNodes(),
289
- apply: $(2)
290
- },
291
- {
292
- type: "heading_3",
293
- label: "Heading 3",
294
- Icon: k,
295
- isActive: (e) => e.isActive("heading", { level: 3 }),
296
- canApply: (e) => e.can().setHeading({ level: 3 }) || e.can().clearNodes(),
297
- apply: $(3)
298
- },
299
- {
300
- type: "heading_4",
301
- label: "Heading 4",
302
- Icon: A,
303
- isActive: (e) => e.isActive("heading", { level: 4 }),
304
- canApply: (e) => e.can().setHeading({ level: 4 }) || e.can().clearNodes(),
305
- apply: $(4)
306
- },
307
- {
308
- type: "heading_5",
309
- label: "Heading 5",
310
- Icon: j,
311
- isActive: (e) => e.isActive("heading", { level: 5 }),
312
- canApply: (e) => e.can().setHeading({ level: 5 }) || e.can().clearNodes(),
313
- apply: $(5)
314
- },
315
- {
316
- type: "heading_6",
317
- label: "Heading 6",
318
- Icon: M,
319
- isActive: (e) => e.isActive("heading", { level: 6 }),
320
- canApply: (e) => e.can().setHeading({ level: 6 }) || e.can().clearNodes(),
321
- apply: $(6)
322
- },
323
- {
324
- type: "bulletList",
325
- label: "Bullet List",
326
- Icon: ie,
327
- isActive: (e) => e.isActive("bulletList"),
328
- canApply: (e) => e.can().toggleBulletList() || e.can().clearNodes(),
329
- apply: (e) => e.chain().focus().toggleBulletList().run()
330
- },
331
- {
332
- type: "orderedList",
333
- label: "Ordered List",
334
- Icon: P,
335
- isActive: (e) => e.isActive("orderedList"),
336
- canApply: (e) => e.can().toggleOrderedList() || e.can().clearNodes(),
337
- apply: (e) => e.chain().focus().toggleOrderedList().run()
338
- }
339
- ], Ae = (e) => {
340
- let t = d(19), { editor: n } = e, [r, i] = m(!1), { activeBlock: a, canConvert: f, structural: p } = X({
341
- editor: n,
342
- selector: je
343
- }) ?? {
344
- activeBlock: null,
345
- canConvert: !1,
346
- structural: !1
347
- }, h = a?.Icon ?? F, v = a?.label ?? "Turn Into", y = p || !f, b, x;
348
- t[0] === Symbol.for("react.memo_cache_sentinel") ? (b = /* @__PURE__ */ g(E, { size: 12 }), x = (e) => {
349
- e.preventDefault(), i(!0);
350
- }, t[0] = b, t[1] = x) : (b = t[0], x = t[1]);
351
- let S;
352
- t[2] !== h || t[3] !== y || t[4] !== v ? (S = /* @__PURE__ */ g(l, {
353
- onPointerDown: Me,
354
- render: /* @__PURE__ */ g(Z, {
355
- label: v,
356
- Icon: h,
357
- disabled: y,
358
- trailing: b,
359
- onClick: x
360
- })
361
- }), t[2] = h, t[3] = y, t[4] = v, t[5] = S) : S = t[5];
362
- let C;
363
- if (t[6] !== a?.type || t[7] !== n) {
364
- let e;
365
- t[9] === a?.type ? e = t[10] : (e = (e) => a?.type !== e.type, t[9] = a?.type, t[10] = e);
366
- let r;
367
- t[11] === n ? r = t[12] : (r = (e) => /* @__PURE__ */ _("button", {
368
- type: "button",
369
- className: Oe,
370
- disabled: !e.canApply(n),
371
- onClick: () => {
372
- e.apply(n), i(!1);
373
- },
374
- children: [/* @__PURE__ */ g(e.Icon, { size: 16 }), /* @__PURE__ */ g("span", { children: e.label })]
375
- }, e.type), t[11] = n, t[12] = r), C = ke.filter(e).map(r), t[6] = a?.type, t[7] = n, t[8] = C;
376
- } else C = t[8];
377
- let w;
378
- t[13] === C ? w = t[14] : (w = /* @__PURE__ */ g(s, { children: /* @__PURE__ */ g(u, {
379
- side: "bottom",
380
- align: "start",
381
- children: /* @__PURE__ */ g(o.Popup, {
382
- className: De,
383
- children: C
384
- })
385
- }) }), t[13] = C, t[14] = w);
386
- let T;
387
- return t[15] !== r || t[16] !== S || t[17] !== w ? (T = /* @__PURE__ */ _(c, {
388
- open: r,
389
- onOpenChange: i,
390
- children: [S, w]
391
- }), t[15] = r, t[16] = S, t[17] = w, t[18] = T) : T = t[18], T;
392
- };
393
- function je(e) {
394
- let { editor: t } = e;
395
- return {
396
- activeBlock: ke.find((e) => e.isActive(t)) ?? null,
397
- canConvert: he(t, fe),
398
- structural: me(t)
399
- };
400
- }
401
- function Me(e) {
402
- return e.preventDefault();
403
- }
404
- //#endregion
405
- //#region ../../libraries/react-collection/dist/components/editor/Toolbar.js
406
- var Ne = [
407
- {
408
- mark: "bold",
409
- label: "Bold",
410
- Icon: T
411
- },
412
- {
413
- mark: "italic",
414
- label: "Italic",
415
- Icon: N
416
- },
417
- {
418
- mark: "underline",
419
- label: "Underline",
420
- Icon: V
421
- },
422
- {
423
- mark: "strike",
424
- label: "Strike",
425
- Icon: R
426
- },
427
- {
428
- mark: "code",
429
- label: "Code",
430
- Icon: ee
431
- }
432
- ], Pe = [{
433
- mark: "superscript",
434
- label: "Superscript",
435
- Icon: B
436
- }, {
437
- mark: "subscript",
438
- label: "Subscript",
439
- Icon: z
440
- }], Fe = [
441
- {
442
- align: "left",
443
- label: "Align left",
444
- Icon: x
445
- },
446
- {
447
- align: "center",
448
- label: "Align center",
449
- Icon: y
450
- },
451
- {
452
- align: "right",
453
- label: "Align right",
454
- Icon: S
455
- },
456
- {
457
- align: "justify",
458
- label: "Align justify",
459
- Icon: b
460
- }
461
- ], Ie = (e) => {
462
- let t = d(9), { editor: n, mark: r, label: i, Icon: a } = e, { isActive: o, canExecute: s } = X({
463
- editor: n,
464
- selector: (e) => {
465
- let { editor: t } = e;
466
- return {
467
- isActive: t.isActive(r),
468
- canExecute: t.isEditable && t.can().toggleMark(r)
469
- };
470
- }
471
- }) ?? {
472
- isActive: !1,
473
- canExecute: !1
474
- }, c = !s, l;
475
- t[0] !== n || t[1] !== r ? (l = () => n.chain().focus().toggleMark(r).run(), t[0] = n, t[1] = r, t[2] = l) : l = t[2];
476
- let u;
477
- return t[3] !== a || t[4] !== o || t[5] !== i || t[6] !== c || t[7] !== l ? (u = /* @__PURE__ */ g(Z, {
478
- label: i,
479
- Icon: a,
480
- isActive: o,
481
- disabled: c,
482
- onClick: l
483
- }), t[3] = a, t[4] = o, t[5] = i, t[6] = c, t[7] = l, t[8] = u) : u = t[8], u;
484
- }, Le = (e) => {
485
- let t = d(9), { editor: n, align: r, label: i, Icon: a } = e, { isActive: o, canExecute: s } = X({
486
- editor: n,
487
- selector: (e) => {
488
- let { editor: t } = e;
489
- return {
490
- isActive: t.isActive({ textAlign: r }),
491
- canExecute: t.isEditable && t.can().setNodeTextAlign(r)
492
- };
493
- }
494
- }) ?? {
495
- isActive: !1,
496
- canExecute: !1
497
- }, c = !s, l;
498
- t[0] !== r || t[1] !== n ? (l = () => n.chain().focus().setNodeTextAlign(r).run(), t[0] = r, t[1] = n, t[2] = l) : l = t[2];
499
- let u;
500
- return t[3] !== a || t[4] !== o || t[5] !== i || t[6] !== c || t[7] !== l ? (u = /* @__PURE__ */ g(Z, {
501
- label: i,
502
- Icon: a,
503
- isActive: o,
504
- disabled: c,
505
- onClick: l
506
- }), t[3] = a, t[4] = o, t[5] = i, t[6] = c, t[7] = l, t[8] = u) : u = t[8], u;
507
- }, Re = (e) => {
508
- let t = d(5), { editor: n } = e, r = !(X({
509
- editor: n,
510
- selector: He
511
- }) ?? !1), i;
512
- t[0] === n ? i = t[1] : (i = () => n.chain().focus().undo().run(), t[0] = n, t[1] = i);
513
- let a;
514
- return t[2] !== r || t[3] !== i ? (a = /* @__PURE__ */ g(Z, {
515
- label: "Undo",
516
- Icon: C,
517
- disabled: r,
518
- onClick: i
519
- }), t[2] = r, t[3] = i, t[4] = a) : a = t[4], a;
520
- }, ze = (e) => {
521
- let t = d(5), { editor: n } = e, r = !(X({
522
- editor: n,
523
- selector: Ue
524
- }) ?? !1), i;
525
- t[0] === n ? i = t[1] : (i = () => n.chain().focus().redo().run(), t[0] = n, t[1] = i);
526
- let a;
527
- return t[2] !== r || t[3] !== i ? (a = /* @__PURE__ */ g(Z, {
528
- label: "Redo",
529
- Icon: w,
530
- disabled: r,
531
- onClick: i
532
- }), t[2] = r, t[3] = i, t[4] = a) : a = t[4], a;
533
- }, Be = (e) => {
534
- let t = d(5), { editor: n } = e, r = !(X({
535
- editor: n,
536
- selector: We
537
- }) ?? !1), i;
538
- t[0] === n ? i = t[1] : (i = () => ye(n), t[0] = n, t[1] = i);
539
- let a;
540
- return t[2] !== r || t[3] !== i ? (a = /* @__PURE__ */ g(Z, {
541
- label: "Reset formatting",
542
- Icon: L,
543
- disabled: r,
544
- onClick: i
545
- }), t[2] = r, t[3] = i, t[4] = a) : a = t[4], a;
546
- }, Ve = (e) => {
547
- let t = d(33), { children: r } = e, { editor: i } = ce();
548
- if (!i) return null;
549
- let a;
550
- t[0] === i ? a = t[1] : (a = /* @__PURE__ */ g("div", {
551
- className: Q,
552
- children: /* @__PURE__ */ g(Ae, { editor: i })
553
- }), t[0] = i, t[1] = a);
554
- let o;
555
- t[2] === Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ g(n, { orientation: "vertical" }), t[2] = o) : o = t[2];
556
- let s;
557
- t[3] === i ? s = t[4] : (s = Ne.map((e) => /* @__PURE__ */ g(Ie, {
558
- editor: i,
559
- ...e
560
- }, e.mark)), t[3] = i, t[4] = s);
561
- let c;
562
- t[5] === s ? c = t[6] : (c = /* @__PURE__ */ g("div", {
563
- className: Q,
564
- children: s
565
- }), t[5] = s, t[6] = c);
566
- let l;
567
- t[7] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ g(n, { orientation: "vertical" }), t[7] = l) : l = t[7];
568
- let u;
569
- t[8] === i ? u = t[9] : (u = /* @__PURE__ */ g("div", {
570
- className: Q,
571
- children: /* @__PURE__ */ g(we, { editor: i })
572
- }), t[8] = i, t[9] = u);
573
- let f;
574
- t[10] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ g(n, { orientation: "vertical" }), t[10] = f) : f = t[10];
575
- let p;
576
- t[11] === i ? p = t[12] : (p = Fe.map((e) => /* @__PURE__ */ g(Le, {
577
- editor: i,
578
- ...e
579
- }, e.align)), t[11] = i, t[12] = p);
580
- let m;
581
- t[13] === p ? m = t[14] : (m = /* @__PURE__ */ g("div", {
582
- className: Q,
583
- children: p
584
- }), t[13] = p, t[14] = m);
585
- let v;
586
- t[15] === Symbol.for("react.memo_cache_sentinel") ? (v = /* @__PURE__ */ g(n, { orientation: "vertical" }), t[15] = v) : v = t[15];
587
- let y;
588
- t[16] === i ? y = t[17] : (y = Pe.map((e) => /* @__PURE__ */ g(Ie, {
589
- editor: i,
590
- ...e
591
- }, e.mark)), t[16] = i, t[17] = y);
592
- let b;
593
- t[18] === y ? b = t[19] : (b = /* @__PURE__ */ g("div", {
594
- className: Q,
595
- children: y
596
- }), t[18] = y, t[19] = b);
597
- let x;
598
- t[20] === Symbol.for("react.memo_cache_sentinel") ? (x = /* @__PURE__ */ g(n, { orientation: "vertical" }), t[20] = x) : x = t[20];
599
- let S;
600
- t[21] === i ? S = t[22] : (S = /* @__PURE__ */ _("div", {
601
- className: Q,
602
- children: [
603
- /* @__PURE__ */ g(Be, { editor: i }),
604
- /* @__PURE__ */ g(Re, { editor: i }),
605
- /* @__PURE__ */ g(ze, { editor: i })
606
- ]
607
- }), t[21] = i, t[22] = S);
608
- let C;
609
- t[23] === r ? C = t[24] : (C = r && /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(n, { orientation: "vertical" }), /* @__PURE__ */ g("div", {
610
- className: "_261ja31",
611
- children: r
612
- })] }), t[23] = r, t[24] = C);
613
- let w;
614
- return t[25] !== a || t[26] !== b || t[27] !== S || t[28] !== C || t[29] !== c || t[30] !== u || t[31] !== m ? (w = /* @__PURE__ */ _("div", {
615
- className: de,
616
- children: [
617
- a,
618
- o,
619
- c,
620
- l,
621
- u,
622
- f,
623
- m,
624
- v,
625
- b,
626
- x,
627
- S,
628
- C
629
- ]
630
- }), t[25] = a, t[26] = b, t[27] = S, t[28] = C, t[29] = c, t[30] = u, t[31] = m, t[32] = w) : w = t[32], w;
631
- };
632
- function He(e) {
633
- let { editor: t } = e;
634
- return t.isEditable && t.can().undo();
635
- }
636
- function Ue(e) {
637
- let { editor: t } = e;
638
- return t.isEditable && t.can().redo();
639
- }
640
- function We(e) {
641
- let { editor: t } = e;
642
- return t.isEditable && be(t);
643
- }
644
- //#endregion
645
- export { Z as n, le as r, Ve as t };