@levo-so/studio 0.1.102 → 0.1.104

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 (59) hide show
  1. package/{AuthProvider-56TywIOB.js → AuthProvider-C6bvedwF.js} +16 -16
  2. package/{BillingStep-BTRobf00.js → BillingStep-2cKT5Pir.js} +1 -1
  3. package/{Button-DTrN8kki.js → Button-DtPwDEN0.js} +240 -143
  4. package/Button-lUfKisu8.js +116 -0
  5. package/CollectionField-xa-jed3_.js +232 -0
  6. package/{CollectionInput-lHOvWWav.js → CollectionInput-CpNGIXJx.js} +32 -32
  7. package/DateTimeWidget-DPHIhkAi.js +256 -0
  8. package/Dialog-IrII0ugb.js +130 -0
  9. package/{EntryCard-CqZlbw1Z.js → EntryCard-j4uZb2cE.js} +6 -6
  10. package/{LoginCard-DWLnYJJU.js → LoginCard-asvOHIRg.js} +3 -3
  11. package/{LoginForm-CEUbBeE3.js → LoginForm-BdsPVHdO.js} +200 -200
  12. package/{LoginModal-AWNLO49X.js → LoginModal-CyvbEK26.js} +4 -4
  13. package/{MessageCard-C5ULcfuw.js → MessageCard-lrXKEsBP.js} +2 -2
  14. package/{MessageFooter-CATwNJJU.js → MessageFooter-D-dCrzJH.js} +2 -2
  15. package/{ModalManager-DQXhkmyC.js → ModalManager-BcPk4sbK.js} +1 -1
  16. package/{PendingApprovalCard-BowwZMBu.js → PendingApprovalCard-hYkupl9A.js} +3 -3
  17. package/PhoneWidget-BOFhs8Ra.js +100 -0
  18. package/{Popover-Du4iigVw.js → Popover-O1poOHk2.js} +19 -20
  19. package/PopupRenderer-C7OHYphU-IWM6d7gW.js +2668 -0
  20. package/{RichTextWidget-iYdVRBGB.js → RichTextWidget-18XLL8wW.js} +27 -25
  21. package/RteThemeProvider-Cfepkyer.js +20 -0
  22. package/{StripePaymentModal-DC-ySB_o.js → StripePaymentModal-DrLMN18M.js} +17 -17
  23. package/Toolbar-Y6JtgPFn.js +645 -0
  24. package/Tooltip-NEMQqPyr.js +67 -0
  25. package/VerifyButton-TNkt-SDu.js +177 -0
  26. package/bookingCard-BdV2YSkq.js +636 -0
  27. package/collection.js +8 -8
  28. package/{dialog-CCWrvmHd.js → dialog-C8-iHixJ.js} +32 -32
  29. package/dist-CsX9NP5P.js +3188 -0
  30. package/generateRadiusScale-BpcgkGtN.js +71 -0
  31. package/getFieldValidations-CSkSV2hW.js +90 -0
  32. package/index.d.ts +53 -2
  33. package/index.js +5867 -7655
  34. package/inlineRteTheme-Ajq9PNpQ.js +9 -0
  35. package/{nodeAlignment-DoVbjk29.js → nodeAlignment-DKCIjzlR.js} +3 -3
  36. package/package.json +60 -76
  37. package/rolldown-runtime-CAFD8bLK.js +11 -0
  38. package/studio.css +1 -1
  39. package/{useLogin-D2VCOHYI.js → useLogin-B2qE8710.js} +23 -23
  40. package/{utils-Bh9uGjo1.js → utils-CZLafTgN.js} +1 -1
  41. package/{widgets-CG5Z_dk7.js → widgets-eu5zXTf-.js} +38 -105
  42. package/CollectionField-7uXvhxYK.js +0 -274
  43. package/DateTimeWidget-BHCP5osb.js +0 -255
  44. package/PhoneWidget-C6uZmrk8.js +0 -100
  45. package/Toolbar-BHi_B-nE.js +0 -737
  46. package/Tooltip-K_gFzjOa.js +0 -68
  47. package/VerifyButton-D21AOIX3.js +0 -273
  48. package/bookingCard--NlgtcJs.js +0 -577
  49. package/dist-x5VFEnQl.js +0 -3185
  50. package/getFieldValidations-DZnDgNI0.js +0 -159
  51. package/inlineRteTheme-Cn_Vqgsm.js +0 -23
  52. /package/{Beams-DkcjMVZl.js → Beams-DEybrmUZ.js} +0 -0
  53. /package/{Dots-BrEPvoj3.js → Dots-CMyy77GM.js} +0 -0
  54. /package/{Gradient-B4Er9hym.js → Gradient-DBn_zXzI.js} +0 -0
  55. /package/{Grid-B4XWU9eL.js → Grid-kGCr-6by.js} +0 -0
  56. /package/{Waves-kW-EBDdJ.js → Waves-DjLcbiBu.js} +0 -0
  57. /package/{authentication-fXmNYss1.js → authentication-hnV1BI8s.js} +0 -0
  58. /package/{card-BwNr7kQS.js → card-5ooLmYSr.js} +0 -0
  59. /package/{theme.cssm-2YTdd8Yh.js → theme.cssm-BXDp-ojp.js} +0 -0
@@ -1,737 +0,0 @@
1
- import { t as e } from "./nodeAlignment-DoVbjk29.js";
2
- import { l as t, u as n } from "./CollectionField-7uXvhxYK.js";
3
- import { n as r, r as i, t as a } from "./Tooltip-K_gFzjOa.js";
4
- import { a as o, i as s, n as c, o as l, r as u } from "./Popover-Du4iigVw.js";
5
- import { forwardRef as d, useEffect as f, useState as p } from "react";
6
- import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
7
- import { c as _ } from "react/compiler-runtime";
8
- import v from "clsx";
9
- import { Document as y } from "@tiptap/extension-document";
10
- import { Link as b } from "@tiptap/extension-link";
11
- import { CodeBlock as x } from "@tiptap/extension-code-block";
12
- import { Details as S } from "@tiptap/extension-details";
13
- import { DetailsContent as C } from "@tiptap/extension-details-content";
14
- import { DetailsSummary as w } from "@tiptap/extension-details-summary";
15
- import { TextStyle as T } from "@tiptap/extension-text-style";
16
- import { HorizontalRule as E } from "@tiptap/extension-horizontal-rule";
17
- import { Image as ee } from "@tiptap/extension-image";
18
- import { AllSelection as D, NodeSelection as te, TextSelection as O } from "@tiptap/pm/state";
19
- import { Table as k, TableCell as A, TableHeader as j, TableRow as M } from "@tiptap/extension-table";
20
- import { BulletList as N } from "@tiptap/extension-bullet-list";
21
- import { Color as P } from "@tiptap/extension-color";
22
- import { HardBreak as F } from "@tiptap/extension-hard-break";
23
- import { Heading as I } from "@tiptap/extension-heading";
24
- import { Highlight as L } from "@tiptap/extension-highlight";
25
- import { ListItem as R } from "@tiptap/extension-list-item";
26
- import { OrderedList as z } from "@tiptap/extension-ordered-list";
27
- import { Paragraph as B } from "@tiptap/extension-paragraph";
28
- import { Subscript as V } from "@tiptap/extension-subscript";
29
- import { Superscript as H } from "@tiptap/extension-superscript";
30
- import { Text as U } from "@tiptap/extension-text";
31
- import { Underline as W } from "@tiptap/extension-underline";
32
- import { Typography as G } from "@tiptap/extension-typography";
33
- import { UniqueID as K } from "@tiptap/extension-unique-id";
34
- import { Youtube as q } from "@tiptap/extension-youtube";
35
- import { IconAlignCenter as J, IconAlignJustified as Y, IconAlignLeft as ne, IconAlignRight as re, IconArrowBackUp as ie, IconArrowForwardUp as ae, IconBold as oe, IconChevronDown as se, IconCode as ce, IconCornerDownLeft as le, IconExternalLink as ue, IconH1 as de, IconH2 as fe, IconH3 as pe, IconH4 as me, IconH5 as he, IconH6 as ge, IconItalic as _e, IconLink as ve, IconList as ye, IconListNumbers as be, IconPencil as xe, IconPilcrow as Se, IconRotate2 as Ce, IconStrikethrough as we, IconSubscript as Te, IconSuperscript as Ee, IconTrash as De, IconUnderline as Oe } from "@tabler/icons-react";
36
- import { Mention as ke } from "@tiptap/extension-mention";
37
- import { CharacterCount as Ae } from "@tiptap/extension-character-count";
38
- import { DragHandle as je } from "@tiptap/extension-drag-handle";
39
- import { DragHandle as Me } from "@tiptap/extension-drag-handle-react";
40
- import { Dropcursor as Ne } from "@tiptap/extension-dropcursor";
41
- import { Emoji as Pe } from "@tiptap/extension-emoji";
42
- import { FileHandler as Fe } from "@tiptap/extension-file-handler";
43
- import { Focus as Ie } from "@tiptap/extension-focus";
44
- import { Gapcursor as Le } from "@tiptap/extension-gapcursor";
45
- import { ListKeymap as Re } from "@tiptap/extension-list-keymap";
46
- import { TextAlign as ze } from "@tiptap/extension-text-align";
47
- //#region \0rolldown/runtime.js
48
- var Be = Object.defineProperty, Ve = Object.getOwnPropertyDescriptor, He = Object.getOwnPropertyNames, Ue = Object.prototype.hasOwnProperty, We = (e, t) => {
49
- let n = {};
50
- for (var r in e) Be(n, r, {
51
- get: e[r],
52
- enumerable: !0
53
- });
54
- return t || Be(n, Symbol.toStringTag, { value: "Module" }), n;
55
- }, Ge = (e, t, n, r) => {
56
- if (t && typeof t == "object" || typeof t == "function") for (var i = He(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !Ue.call(e, s) && s !== n && Be(e, s, {
57
- get: ((e) => t[e]).bind(null, s),
58
- enumerable: !(r = Ve(t, s)) || r.enumerable
59
- });
60
- return e;
61
- }, Ke = (e, t, n) => (Ge(e, t, "default"), n && Ge(n, t, "default")), X = /* @__PURE__ */ We({
62
- BulletList: () => N,
63
- CharacterCount: () => Ae,
64
- CodeBlock: () => x,
65
- Color: () => P,
66
- Details: () => S,
67
- DetailsContent: () => C,
68
- DetailsSummary: () => w,
69
- Document: () => y,
70
- DragHandle: () => je,
71
- DragHandleReact: () => Me,
72
- Dropcursor: () => Ne,
73
- Emoji: () => Pe,
74
- FileHandler: () => Fe,
75
- Focus: () => Ie,
76
- Gapcursor: () => Le,
77
- HardBreak: () => F,
78
- Heading: () => I,
79
- Highlight: () => L,
80
- HorizontalRule: () => E,
81
- Image: () => ee,
82
- Link: () => b,
83
- ListItem: () => R,
84
- ListKeymap: () => Re,
85
- Mention: () => ke,
86
- OrderedList: () => z,
87
- Paragraph: () => B,
88
- Subscript: () => V,
89
- Superscript: () => H,
90
- Table: () => k,
91
- TableCell: () => A,
92
- TableHeader: () => j,
93
- TableRow: () => M,
94
- Text: () => U,
95
- TextAlign: () => ze,
96
- TextStyle: () => T,
97
- Typography: () => G,
98
- Underline: () => W,
99
- UniqueID: () => K,
100
- Youtube: () => q
101
- });
102
- import * as qe from "@tiptap/core";
103
- Ke(X, qe);
104
- import * as Je from "@tiptap/extensions";
105
- Ke(X, Je);
106
- import * as Ye from "@tiptap/react";
107
- Ke(X, Ye);
108
- import * as Xe from "@tiptap/starter-kit";
109
- Ke(X, Xe);
110
- //#endregion
111
- //#region ../../libraries/react-collection/dist/components/editor/extensionKit.js
112
- var Ze = (t = { placeholder: "Write something ..." }) => [
113
- X.StarterKit.configure({
114
- blockquote: !1,
115
- codeBlock: !1,
116
- horizontalRule: !1,
117
- dropcursor: { width: 2 },
118
- link: {
119
- openOnClick: !1,
120
- HTMLAttributes: { target: "_blank" }
121
- }
122
- }),
123
- X.Placeholder.configure({ placeholder: t?.placeholder }),
124
- G,
125
- X.Selection,
126
- H,
127
- V,
128
- e,
129
- K.configure({ types: [
130
- "paragraph",
131
- "heading",
132
- "bulletList",
133
- "orderedList"
134
- ] })
135
- ], Z = d((e, t) => {
136
- let o = _(27), s, c, l, u, d, f, p;
137
- o[0] === e ? (s = o[1], c = o[2], l = o[3], u = o[4], d = o[5], f = o[6], p = o[7]) : ({label: u, Icon: s, isActive: l, iconSize: f, trailing: p, className: c, ...d} = e, o[0] = e, o[1] = s, o[2] = c, o[3] = l, o[4] = u, o[5] = d, o[6] = f, o[7] = p);
138
- let m = f === void 0 ? 16 : f, y = l || void 0, b = l && "_1vaxhty0", x;
139
- o[8] !== c || o[9] !== b ? (x = v(b, c), o[8] = c, o[9] = b, o[10] = x) : x = o[10];
140
- let S;
141
- o[11] !== s || o[12] !== m ? (S = /* @__PURE__ */ h(s, { size: m }), o[11] = s, o[12] = m, o[13] = S) : S = o[13];
142
- let C;
143
- o[14] !== u || o[15] !== d || o[16] !== t || o[17] !== y || o[18] !== x || o[19] !== S || o[20] !== p ? (C = /* @__PURE__ */ h(r, {
144
- onPointerDown: Qe,
145
- render: /* @__PURE__ */ g(n, {
146
- ref: t,
147
- type: "button",
148
- variant: "ghost",
149
- size: "sm",
150
- tabIndex: -1,
151
- "aria-label": u,
152
- "aria-pressed": y,
153
- className: x,
154
- ...d,
155
- children: [S, p]
156
- })
157
- }), o[14] = u, o[15] = d, o[16] = t, o[17] = y, o[18] = x, o[19] = S, o[20] = p, o[21] = C) : C = o[21];
158
- let w;
159
- o[22] === u ? w = o[23] : (w = /* @__PURE__ */ h(i, { children: u }), o[22] = u, o[23] = w);
160
- let T;
161
- return o[24] !== C || o[25] !== w ? (T = /* @__PURE__ */ g(a, { children: [C, w] }), o[24] = C, o[25] = w, o[26] = T) : T = o[26], T;
162
- });
163
- Z.displayName = "ToolbarButton";
164
- function Qe(e) {
165
- return e.preventDefault();
166
- }
167
- //#endregion
168
- //#region ../../libraries/react-collection/dist/components/editor/Toolbar.cssm.js
169
- var $e = "_261ja30", Q = "_261ja31", et = [
170
- "paragraph",
171
- "heading",
172
- "bulletList",
173
- "orderedList",
174
- "taskList",
175
- "codeBlock"
176
- ], tt = [
177
- "tableCell",
178
- "tableHeader",
179
- "quoteCaption",
180
- "detailsSummary"
181
- ], nt = (e) => {
182
- if (!e) return !1;
183
- let { $from: t } = e.state.selection;
184
- for (let e = t.depth; e > 0; e--) if (tt.includes(t.node(e).type.name)) return !0;
185
- return !1;
186
- }, rt = (e, t) => {
187
- if (!e || t.length === 0) return !1;
188
- let { selection: n } = e.state, r = new Set(t);
189
- if (n instanceof te) {
190
- let e = n.node?.type?.name;
191
- return !!e && r.has(e);
192
- }
193
- if (n instanceof O || n instanceof D) {
194
- let t = !0;
195
- return e.state.doc.nodesBetween(n.from, n.to, (e) => e.isTextblock && !r.has(e.type.name) ? (t = !1, !1) : t), t;
196
- }
197
- return !1;
198
- }, it = /[\0-\x20\xA0\u1680\u180E\u2000-\u2029\u205F\u3000]/g, at = [
199
- "http",
200
- "https",
201
- "ftp",
202
- "ftps",
203
- "mailto",
204
- "tel",
205
- "callto",
206
- "sms"
207
- ], ot = (e, t) => {
208
- try {
209
- let n = new URL(e, t), r = n.href.replace(it, ""), i = RegExp(`^(?:(?:${at.join("|")}):|[^a-z]|[a-z0-9+.\\-]+(?:[^a-z+.\\-:]|$))`, "i");
210
- if (r.match(i)) return n.href;
211
- } catch {}
212
- return "#";
213
- }, st = (e, t = []) => {
214
- let { tr: n } = e.state, { selection: r } = n;
215
- return r.empty ? !1 : (r.ranges.forEach((e) => {
216
- n.doc.nodesBetween(e.$from.pos, e.$to.pos, (e, r) => (e.isInline && e.marks.forEach((i) => {
217
- t.includes(i.type.name) || n.removeMark(r, r + e.nodeSize, i.type);
218
- }), !0));
219
- }), e.view.dispatch(n), e.commands.focus(), !0);
220
- }, ct = (e) => {
221
- let { selection: t } = e.state;
222
- if (t.empty) return !1;
223
- for (let n of t.ranges) {
224
- let t = !1;
225
- 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;
226
- }
227
- return !1;
228
- }, lt = "j67x6z0", ut = "j67x6z1", dt = "_5pk5r80", ft = (e) => {
229
- let t = _(50), { editor: n } = e, [d, m] = p(!1), { isActive: v, currentUrl: y } = (0, X.useEditorState)({
230
- editor: n,
231
- selector: pt
232
- }) ?? {
233
- isActive: !1,
234
- currentUrl: ""
235
- }, [b, x] = p(y), S, C;
236
- t[0] !== y || t[1] !== d ? (S = () => {
237
- d && x(y);
238
- }, C = [d, y], t[0] = y, t[1] = d, t[2] = S, t[3] = C) : (S = t[2], C = t[3]), f(S, C);
239
- let w;
240
- t[4] !== n || t[5] !== b ? (w = () => {
241
- b && (n.chain().focus().extendMarkRange("link").setLink({ href: b }).run(), m(!1));
242
- }, t[4] = n, t[5] = b, t[6] = w) : w = t[6];
243
- let T = w, E;
244
- t[7] === n ? E = t[8] : (E = () => {
245
- n.chain().focus().extendMarkRange("link").unsetLink().run(), x(""), m(!1);
246
- }, t[7] = n, t[8] = E);
247
- let ee = E, D;
248
- t[9] === b ? D = t[10] : (D = () => {
249
- let e = ot(b, window.location.href);
250
- e !== "#" && window.open(e, "_blank", "noopener,noreferrer");
251
- }, t[9] = b, t[10] = D);
252
- let te = D, O;
253
- t[11] === Symbol.for("react.memo_cache_sentinel") ? (O = (e) => {
254
- e.preventDefault(), m(!0);
255
- }, t[11] = O) : O = t[11];
256
- let k;
257
- t[12] === v ? k = t[13] : (k = /* @__PURE__ */ h(l, {
258
- onPointerDown: mt,
259
- render: /* @__PURE__ */ h(Z, {
260
- label: "Link",
261
- Icon: ve,
262
- isActive: v,
263
- onClick: O
264
- })
265
- }), t[12] = v, t[13] = k);
266
- let A;
267
- t[14] === Symbol.for("react.memo_cache_sentinel") ? (A = (e) => x(e.target.value), t[14] = A) : A = t[14];
268
- let j;
269
- t[15] === T ? j = t[16] : (j = (e) => {
270
- e.key === "Enter" && (e.preventDefault(), T());
271
- }, t[15] = T, t[16] = j);
272
- let M;
273
- t[17] !== j || t[18] !== b ? (M = /* @__PURE__ */ h("input", {
274
- className: ut,
275
- value: b,
276
- onChange: A,
277
- onKeyDown: j,
278
- placeholder: "Paste a link..."
279
- }), t[17] = j, t[18] = b, t[19] = M) : M = t[19];
280
- let N = !b && !v, P;
281
- t[20] === Symbol.for("react.memo_cache_sentinel") ? (P = /* @__PURE__ */ h(le, { size: 16 }), t[20] = P) : P = t[20];
282
- let F;
283
- t[21] !== T || t[22] !== N ? (F = /* @__PURE__ */ h(r, { render: /* @__PURE__ */ h("button", {
284
- type: "button",
285
- className: dt,
286
- onClick: T,
287
- disabled: N,
288
- "aria-label": "Apply link",
289
- children: P
290
- }) }), t[21] = T, t[22] = N, t[23] = F) : F = t[23];
291
- let I;
292
- t[24] === Symbol.for("react.memo_cache_sentinel") ? (I = /* @__PURE__ */ h(i, { children: "Apply link" }), t[24] = I) : I = t[24];
293
- let L;
294
- t[25] === F ? L = t[26] : (L = /* @__PURE__ */ g(a, { children: [F, I] }), t[25] = F, t[26] = L);
295
- let R = !b && !v, z;
296
- t[27] === Symbol.for("react.memo_cache_sentinel") ? (z = /* @__PURE__ */ h(ue, { size: 16 }), t[27] = z) : z = t[27];
297
- let B;
298
- t[28] !== te || t[29] !== R ? (B = /* @__PURE__ */ h(r, { render: /* @__PURE__ */ h("button", {
299
- type: "button",
300
- className: dt,
301
- onClick: te,
302
- disabled: R,
303
- "aria-label": "Open in new window",
304
- children: z
305
- }) }), t[28] = te, t[29] = R, t[30] = B) : B = t[30];
306
- let V;
307
- t[31] === Symbol.for("react.memo_cache_sentinel") ? (V = /* @__PURE__ */ h(i, { children: "Open in new window" }), t[31] = V) : V = t[31];
308
- let H;
309
- t[32] === B ? H = t[33] : (H = /* @__PURE__ */ g(a, { children: [B, V] }), t[32] = B, t[33] = H);
310
- let U = !b && !v, W;
311
- t[34] === Symbol.for("react.memo_cache_sentinel") ? (W = /* @__PURE__ */ h(De, { size: 16 }), t[34] = W) : W = t[34];
312
- let G;
313
- t[35] !== ee || t[36] !== U ? (G = /* @__PURE__ */ h(r, { render: /* @__PURE__ */ h("button", {
314
- type: "button",
315
- className: dt,
316
- onClick: ee,
317
- disabled: U,
318
- "aria-label": "Remove link",
319
- children: W
320
- }) }), t[35] = ee, t[36] = U, t[37] = G) : G = t[37];
321
- let K;
322
- t[38] === Symbol.for("react.memo_cache_sentinel") ? (K = /* @__PURE__ */ h(i, { children: "Remove link" }), t[38] = K) : K = t[38];
323
- let q;
324
- t[39] === G ? q = t[40] : (q = /* @__PURE__ */ g(a, { children: [G, K] }), t[39] = G, t[40] = q);
325
- let J;
326
- t[41] !== M || t[42] !== L || t[43] !== H || t[44] !== q ? (J = /* @__PURE__ */ h(s, { children: /* @__PURE__ */ h(u, {
327
- side: "bottom",
328
- align: "center",
329
- children: /* @__PURE__ */ g(o.Popup, {
330
- className: lt,
331
- children: [
332
- M,
333
- L,
334
- H,
335
- q
336
- ]
337
- })
338
- }) }), t[41] = M, t[42] = L, t[43] = H, t[44] = q, t[45] = J) : J = t[45];
339
- let Y;
340
- return t[46] !== d || t[47] !== J || t[48] !== k ? (Y = /* @__PURE__ */ g(c, {
341
- open: d,
342
- onOpenChange: m,
343
- children: [k, J]
344
- }), t[46] = d, t[47] = J, t[48] = k, t[49] = Y) : Y = t[49], Y;
345
- };
346
- function pt(e) {
347
- let { editor: t } = e;
348
- return {
349
- isActive: t.isActive("link"),
350
- currentUrl: t.getAttributes("link")?.href ?? ""
351
- };
352
- }
353
- function mt(e) {
354
- return e.preventDefault();
355
- }
356
- //#endregion
357
- //#region ../../libraries/react-collection/dist/components/editor/menus/TurnIntoMenu.cssm.js
358
- var ht = "_1keigwl0", gt = "_1keigwl1 _5pk5r80", $ = (e) => (t) => t.chain().focus().setHeading({ level: e }).run(), _t = [
359
- {
360
- type: "paragraph",
361
- label: "Text",
362
- Icon: Se,
363
- isActive: (e) => e.isActive("paragraph"),
364
- canApply: (e) => e.can().setParagraph() || e.can().clearNodes(),
365
- apply: (e) => e.chain().focus().setParagraph().run()
366
- },
367
- {
368
- type: "heading_1",
369
- label: "Heading 1",
370
- Icon: de,
371
- isActive: (e) => e.isActive("heading", { level: 1 }),
372
- canApply: (e) => e.can().setHeading({ level: 1 }) || e.can().clearNodes(),
373
- apply: $(1)
374
- },
375
- {
376
- type: "heading_2",
377
- label: "Heading 2",
378
- Icon: fe,
379
- isActive: (e) => e.isActive("heading", { level: 2 }),
380
- canApply: (e) => e.can().setHeading({ level: 2 }) || e.can().clearNodes(),
381
- apply: $(2)
382
- },
383
- {
384
- type: "heading_3",
385
- label: "Heading 3",
386
- Icon: pe,
387
- isActive: (e) => e.isActive("heading", { level: 3 }),
388
- canApply: (e) => e.can().setHeading({ level: 3 }) || e.can().clearNodes(),
389
- apply: $(3)
390
- },
391
- {
392
- type: "heading_4",
393
- label: "Heading 4",
394
- Icon: me,
395
- isActive: (e) => e.isActive("heading", { level: 4 }),
396
- canApply: (e) => e.can().setHeading({ level: 4 }) || e.can().clearNodes(),
397
- apply: $(4)
398
- },
399
- {
400
- type: "heading_5",
401
- label: "Heading 5",
402
- Icon: he,
403
- isActive: (e) => e.isActive("heading", { level: 5 }),
404
- canApply: (e) => e.can().setHeading({ level: 5 }) || e.can().clearNodes(),
405
- apply: $(5)
406
- },
407
- {
408
- type: "heading_6",
409
- label: "Heading 6",
410
- Icon: ge,
411
- isActive: (e) => e.isActive("heading", { level: 6 }),
412
- canApply: (e) => e.can().setHeading({ level: 6 }) || e.can().clearNodes(),
413
- apply: $(6)
414
- },
415
- {
416
- type: "bulletList",
417
- label: "Bullet List",
418
- Icon: ye,
419
- isActive: (e) => e.isActive("bulletList"),
420
- canApply: (e) => e.can().toggleBulletList() || e.can().clearNodes(),
421
- apply: (e) => e.chain().focus().toggleBulletList().run()
422
- },
423
- {
424
- type: "orderedList",
425
- label: "Ordered List",
426
- Icon: be,
427
- isActive: (e) => e.isActive("orderedList"),
428
- canApply: (e) => e.can().toggleOrderedList() || e.can().clearNodes(),
429
- apply: (e) => e.chain().focus().toggleOrderedList().run()
430
- }
431
- ], vt = (e) => {
432
- let t = _(19), { editor: n } = e, [r, i] = p(!1), { activeBlock: a, canConvert: d, structural: f } = (0, X.useEditorState)({
433
- editor: n,
434
- selector: yt
435
- }) ?? {
436
- activeBlock: null,
437
- canConvert: !1,
438
- structural: !1
439
- }, m = a?.Icon ?? xe, v = a?.label ?? "Turn Into", y = f || !d, b, x;
440
- t[0] === Symbol.for("react.memo_cache_sentinel") ? (b = /* @__PURE__ */ h(se, { size: 12 }), x = (e) => {
441
- e.preventDefault(), i(!0);
442
- }, t[0] = b, t[1] = x) : (b = t[0], x = t[1]);
443
- let S;
444
- t[2] !== m || t[3] !== y || t[4] !== v ? (S = /* @__PURE__ */ h(l, {
445
- onPointerDown: bt,
446
- render: /* @__PURE__ */ h(Z, {
447
- label: v,
448
- Icon: m,
449
- disabled: y,
450
- trailing: b,
451
- onClick: x
452
- })
453
- }), t[2] = m, t[3] = y, t[4] = v, t[5] = S) : S = t[5];
454
- let C;
455
- if (t[6] !== a?.type || t[7] !== n) {
456
- let e;
457
- t[9] === a?.type ? e = t[10] : (e = (e) => a?.type !== e.type, t[9] = a?.type, t[10] = e);
458
- let r;
459
- t[11] === n ? r = t[12] : (r = (e) => /* @__PURE__ */ g("button", {
460
- type: "button",
461
- className: gt,
462
- disabled: !e.canApply(n),
463
- onClick: () => {
464
- e.apply(n), i(!1);
465
- },
466
- children: [/* @__PURE__ */ h(e.Icon, { size: 16 }), /* @__PURE__ */ h("span", { children: e.label })]
467
- }, e.type), t[11] = n, t[12] = r), C = _t.filter(e).map(r), t[6] = a?.type, t[7] = n, t[8] = C;
468
- } else C = t[8];
469
- let w;
470
- t[13] === C ? w = t[14] : (w = /* @__PURE__ */ h(s, { children: /* @__PURE__ */ h(u, {
471
- side: "bottom",
472
- align: "start",
473
- children: /* @__PURE__ */ h(o.Popup, {
474
- className: ht,
475
- children: C
476
- })
477
- }) }), t[13] = C, t[14] = w);
478
- let T;
479
- return t[15] !== r || t[16] !== S || t[17] !== w ? (T = /* @__PURE__ */ g(c, {
480
- open: r,
481
- onOpenChange: i,
482
- children: [S, w]
483
- }), t[15] = r, t[16] = S, t[17] = w, t[18] = T) : T = t[18], T;
484
- };
485
- function yt(e) {
486
- let { editor: t } = e;
487
- return {
488
- activeBlock: _t.find((e) => e.isActive(t)) ?? null,
489
- canConvert: rt(t, et),
490
- structural: nt(t)
491
- };
492
- }
493
- function bt(e) {
494
- return e.preventDefault();
495
- }
496
- //#endregion
497
- //#region ../../libraries/react-collection/dist/components/editor/Toolbar.js
498
- var xt = [
499
- {
500
- mark: "bold",
501
- label: "Bold",
502
- Icon: oe
503
- },
504
- {
505
- mark: "italic",
506
- label: "Italic",
507
- Icon: _e
508
- },
509
- {
510
- mark: "underline",
511
- label: "Underline",
512
- Icon: Oe
513
- },
514
- {
515
- mark: "strike",
516
- label: "Strike",
517
- Icon: we
518
- },
519
- {
520
- mark: "code",
521
- label: "Code",
522
- Icon: ce
523
- }
524
- ], St = [{
525
- mark: "superscript",
526
- label: "Superscript",
527
- Icon: Ee
528
- }, {
529
- mark: "subscript",
530
- label: "Subscript",
531
- Icon: Te
532
- }], Ct = [
533
- {
534
- align: "left",
535
- label: "Align left",
536
- Icon: ne
537
- },
538
- {
539
- align: "center",
540
- label: "Align center",
541
- Icon: J
542
- },
543
- {
544
- align: "right",
545
- label: "Align right",
546
- Icon: re
547
- },
548
- {
549
- align: "justify",
550
- label: "Align justify",
551
- Icon: Y
552
- }
553
- ], wt = (e) => {
554
- let t = _(9), { editor: n, mark: r, label: i, Icon: a } = e, { isActive: o, canExecute: s } = (0, X.useEditorState)({
555
- editor: n,
556
- selector: (e) => {
557
- let { editor: t } = e;
558
- return {
559
- isActive: t.isActive(r),
560
- canExecute: t.isEditable && t.can().toggleMark(r)
561
- };
562
- }
563
- }) ?? {
564
- isActive: !1,
565
- canExecute: !1
566
- }, c = !s, l;
567
- 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];
568
- let u;
569
- return t[3] !== a || t[4] !== o || t[5] !== i || t[6] !== c || t[7] !== l ? (u = /* @__PURE__ */ h(Z, {
570
- label: i,
571
- Icon: a,
572
- isActive: o,
573
- disabled: c,
574
- onClick: l
575
- }), t[3] = a, t[4] = o, t[5] = i, t[6] = c, t[7] = l, t[8] = u) : u = t[8], u;
576
- }, Tt = (e) => {
577
- let t = _(9), { editor: n, align: r, label: i, Icon: a } = e, { isActive: o, canExecute: s } = (0, X.useEditorState)({
578
- editor: n,
579
- selector: (e) => {
580
- let { editor: t } = e;
581
- return {
582
- isActive: t.isActive({ textAlign: r }),
583
- canExecute: t.isEditable && t.can().setNodeTextAlign(r)
584
- };
585
- }
586
- }) ?? {
587
- isActive: !1,
588
- canExecute: !1
589
- }, c = !s, l;
590
- 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];
591
- let u;
592
- return t[3] !== a || t[4] !== o || t[5] !== i || t[6] !== c || t[7] !== l ? (u = /* @__PURE__ */ h(Z, {
593
- label: i,
594
- Icon: a,
595
- isActive: o,
596
- disabled: c,
597
- onClick: l
598
- }), t[3] = a, t[4] = o, t[5] = i, t[6] = c, t[7] = l, t[8] = u) : u = t[8], u;
599
- }, Et = (e) => {
600
- let t = _(5), { editor: n } = e, r = !((0, X.useEditorState)({
601
- editor: n,
602
- selector: At
603
- }) ?? !1), i;
604
- t[0] === n ? i = t[1] : (i = () => n.chain().focus().undo().run(), t[0] = n, t[1] = i);
605
- let a;
606
- return t[2] !== r || t[3] !== i ? (a = /* @__PURE__ */ h(Z, {
607
- label: "Undo",
608
- Icon: ie,
609
- disabled: r,
610
- onClick: i
611
- }), t[2] = r, t[3] = i, t[4] = a) : a = t[4], a;
612
- }, Dt = (e) => {
613
- let t = _(5), { editor: n } = e, r = !((0, X.useEditorState)({
614
- editor: n,
615
- selector: jt
616
- }) ?? !1), i;
617
- t[0] === n ? i = t[1] : (i = () => n.chain().focus().redo().run(), t[0] = n, t[1] = i);
618
- let a;
619
- return t[2] !== r || t[3] !== i ? (a = /* @__PURE__ */ h(Z, {
620
- label: "Redo",
621
- Icon: ae,
622
- disabled: r,
623
- onClick: i
624
- }), t[2] = r, t[3] = i, t[4] = a) : a = t[4], a;
625
- }, Ot = (e) => {
626
- let t = _(5), { editor: n } = e, r = !((0, X.useEditorState)({
627
- editor: n,
628
- selector: Mt
629
- }) ?? !1), i;
630
- t[0] === n ? i = t[1] : (i = () => st(n), t[0] = n, t[1] = i);
631
- let a;
632
- return t[2] !== r || t[3] !== i ? (a = /* @__PURE__ */ h(Z, {
633
- label: "Reset formatting",
634
- Icon: Ce,
635
- disabled: r,
636
- onClick: i
637
- }), t[2] = r, t[3] = i, t[4] = a) : a = t[4], a;
638
- }, kt = (e) => {
639
- let n = _(33), { children: r } = e, { editor: i } = (0, X.useCurrentEditor)();
640
- if (!i) return null;
641
- let a;
642
- n[0] === i ? a = n[1] : (a = /* @__PURE__ */ h("div", {
643
- className: Q,
644
- children: /* @__PURE__ */ h(vt, { editor: i })
645
- }), n[0] = i, n[1] = a);
646
- let o;
647
- n[2] === Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ h(t, { orientation: "vertical" }), n[2] = o) : o = n[2];
648
- let s;
649
- n[3] === i ? s = n[4] : (s = xt.map((e) => /* @__PURE__ */ h(wt, {
650
- editor: i,
651
- ...e
652
- }, e.mark)), n[3] = i, n[4] = s);
653
- let c;
654
- n[5] === s ? c = n[6] : (c = /* @__PURE__ */ h("div", {
655
- className: Q,
656
- children: s
657
- }), n[5] = s, n[6] = c);
658
- let l;
659
- n[7] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ h(t, { orientation: "vertical" }), n[7] = l) : l = n[7];
660
- let u;
661
- n[8] === i ? u = n[9] : (u = /* @__PURE__ */ h("div", {
662
- className: Q,
663
- children: /* @__PURE__ */ h(ft, { editor: i })
664
- }), n[8] = i, n[9] = u);
665
- let d;
666
- n[10] === Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ h(t, { orientation: "vertical" }), n[10] = d) : d = n[10];
667
- let f;
668
- n[11] === i ? f = n[12] : (f = Ct.map((e) => /* @__PURE__ */ h(Tt, {
669
- editor: i,
670
- ...e
671
- }, e.align)), n[11] = i, n[12] = f);
672
- let p;
673
- n[13] === f ? p = n[14] : (p = /* @__PURE__ */ h("div", {
674
- className: Q,
675
- children: f
676
- }), n[13] = f, n[14] = p);
677
- let v;
678
- n[15] === Symbol.for("react.memo_cache_sentinel") ? (v = /* @__PURE__ */ h(t, { orientation: "vertical" }), n[15] = v) : v = n[15];
679
- let y;
680
- n[16] === i ? y = n[17] : (y = St.map((e) => /* @__PURE__ */ h(wt, {
681
- editor: i,
682
- ...e
683
- }, e.mark)), n[16] = i, n[17] = y);
684
- let b;
685
- n[18] === y ? b = n[19] : (b = /* @__PURE__ */ h("div", {
686
- className: Q,
687
- children: y
688
- }), n[18] = y, n[19] = b);
689
- let x;
690
- n[20] === Symbol.for("react.memo_cache_sentinel") ? (x = /* @__PURE__ */ h(t, { orientation: "vertical" }), n[20] = x) : x = n[20];
691
- let S;
692
- n[21] === i ? S = n[22] : (S = /* @__PURE__ */ g("div", {
693
- className: Q,
694
- children: [
695
- /* @__PURE__ */ h(Ot, { editor: i }),
696
- /* @__PURE__ */ h(Et, { editor: i }),
697
- /* @__PURE__ */ h(Dt, { editor: i })
698
- ]
699
- }), n[21] = i, n[22] = S);
700
- let C;
701
- n[23] === r ? C = n[24] : (C = r && /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(t, { orientation: "vertical" }), /* @__PURE__ */ h("div", {
702
- className: "_261ja31",
703
- children: r
704
- })] }), n[23] = r, n[24] = C);
705
- let w;
706
- return n[25] !== a || n[26] !== b || n[27] !== S || n[28] !== C || n[29] !== c || n[30] !== u || n[31] !== p ? (w = /* @__PURE__ */ g("div", {
707
- className: $e,
708
- children: [
709
- a,
710
- o,
711
- c,
712
- l,
713
- u,
714
- d,
715
- p,
716
- v,
717
- b,
718
- x,
719
- S,
720
- C
721
- ]
722
- }), n[25] = a, n[26] = b, n[27] = S, n[28] = C, n[29] = c, n[30] = u, n[31] = p, n[32] = w) : w = n[32], w;
723
- };
724
- function At(e) {
725
- let { editor: t } = e;
726
- return t.isEditable && t.can().undo();
727
- }
728
- function jt(e) {
729
- let { editor: t } = e;
730
- return t.isEditable && t.can().redo();
731
- }
732
- function Mt(e) {
733
- let { editor: t } = e;
734
- return t.isEditable && ct(t);
735
- }
736
- //#endregion
737
- export { We as a, X as i, Z as n, Ze as r, kt as t };