@levo-so/studio 0.1.94 → 0.1.96
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{BillingStep-o2yIMjLk.js → BillingStep-C3jJkLXQ.js} +1 -1
- package/{Button-_hpg7Rxx.js → Button-CwN6jTXH.js} +17 -12
- package/CollectionField-DnbpB0Z5.js +254 -0
- package/CollectionInput-BoNAc4sq.js +132 -0
- package/DateTimeWidget-IRleQI-3.js +255 -0
- package/{EntryCard-B-feJvrB.js → EntryCard-CZIUBwtE.js} +3 -3
- package/{LoginCard-CF9JbU-y.js → LoginCard-Bthy9dcf.js} +3 -3
- package/{LoginForm-CdpNCQJa.js → LoginForm-CPMtCyMF.js} +4 -0
- package/{LoginModal-ngTHCyli.js → LoginModal-BPI5tOIZ.js} +3 -3
- package/{MessageCard-D2uja800.js → MessageCard-BYxgc9dl.js} +2 -2
- package/{ModalManager-B7pCzvK1.js → ModalManager-BaIL6HG-.js} +1 -1
- package/{PendingApprovalCard-Dut-Xiw1.js → PendingApprovalCard-DEnawzxD.js} +3 -3
- package/PhoneWidget-CjhHfwuG.js +100 -0
- package/Popover-DHVZdJuv.js +56 -0
- package/RichTextWidget-CgT1_zC3.js +1135 -0
- package/Tooltip-ByJRyayB.js +78 -0
- package/VerifyButton-DFKzKYxC.js +283 -0
- package/{bookingCard-CGV9svhn.js → bookingCard-Bw4tvDYh.js} +3 -3
- package/collection.d.ts +81 -46
- package/collection.js +8 -5
- package/dist-D_jY4Tf1.js +3168 -0
- package/getFieldValidations-qVzuq6mv.js +195 -0
- package/index.d.ts +23 -5
- package/index.js +1634 -1420
- package/nodeAlignment-CG3qmAuQ.js +180 -0
- package/package.json +3 -4
- package/studio.css +1 -1
- package/theme.cssm-De_pl52g.js +4 -0
- package/{utils-KqbqLlMF.js → utils-F6eBcsyI.js} +1 -1
- package/widgets-Dvyv5_uj.js +215 -0
- package/dist-DDKHTnIW.js +0 -3653
- package/widgets-B84lq4lO.js +0 -351
- /package/{Beams-CCNNOvfW.js → Beams-Blr-zwvz.js} +0 -0
- /package/{Dots-89WGkd-z.js → Dots-DeBKuibU.js} +0 -0
- /package/{Gradient-vTa_uWCj.js → Gradient-DGFxOjft.js} +0 -0
- /package/{Grid-CrtztrxK.js → Grid-A7HRCQ0T.js} +0 -0
- /package/{MessageFooter-Bu-jyPkJ.js → MessageFooter-C6DivT4m.js} +0 -0
- /package/{StripePaymentModal-CajqohNM.js → StripePaymentModal-BcePXzmC.js} +0 -0
- /package/{Waves-BhA6CLEI.js → Waves-CIT6Ngng.js} +0 -0
- /package/{card-DCbhJCO9.js → card-izMd2DvE.js} +0 -0
- /package/{dialog-CILIXExr.js → dialog-CCWrvmHd.js} +0 -0
|
@@ -0,0 +1,1135 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { a as e, i as t, o as n, t as r } from "./nodeAlignment-CG3qmAuQ.js";
|
|
3
|
+
import { a as i, i as a, n as o, r as s, t as c } from "./Tooltip-ByJRyayB.js";
|
|
4
|
+
import { n as l, t as u } from "./getFieldValidations-qVzuq6mv.js";
|
|
5
|
+
import { i as d, n as f, o as p, r as m, t as h } from "./Popover-DHVZdJuv.js";
|
|
6
|
+
import { d as g, p as _, t as v } from "./CollectionField-DnbpB0Z5.js";
|
|
7
|
+
import { useEffect as y, useMemo as b, useRef as x, useState as S } from "react";
|
|
8
|
+
import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
|
|
9
|
+
import { c as E } from "react/compiler-runtime";
|
|
10
|
+
import D, { clsx as O } from "clsx";
|
|
11
|
+
import { EditorContent as k, EditorContext as A, useCurrentEditor as j, useEditor as M, useEditorState as N } from "@tiptap/react";
|
|
12
|
+
import { createRuntimeFn as P } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
13
|
+
import { AllSelection as F, NodeSelection as I, TextSelection as L } from "@tiptap/pm/state";
|
|
14
|
+
import { mergeProps as R } from "@base-ui/react/merge-props";
|
|
15
|
+
import { useRender as z } from "@base-ui/react/use-render";
|
|
16
|
+
import { IconAlignCenter as B, IconAlignJustified as V, IconAlignLeft as H, IconAlignRight as ee, IconArrowBackUp as U, IconArrowForwardUp as te, IconBold as W, IconChevronDown as G, IconCode as K, IconCornerDownLeft as ne, IconExternalLink as re, IconH1 as ie, IconH2 as ae, IconH3 as oe, IconH4 as se, IconH5 as ce, IconH6 as le, IconItalic as ue, IconLink as de, IconList as fe, IconListNumbers as pe, IconPencil as me, IconPilcrow as he, IconRotate2 as ge, IconStrikethrough as _e, IconSubscript as ve, IconSuperscript as ye, IconTrash as be, IconUnderline as xe, IconUnlink as Se } from "@tabler/icons-react";
|
|
17
|
+
import { Subscript as Ce } from "@tiptap/extension-subscript";
|
|
18
|
+
import { Superscript as we } from "@tiptap/extension-superscript";
|
|
19
|
+
import { Typography as Te } from "@tiptap/extension-typography";
|
|
20
|
+
import { UniqueID as Ee } from "@tiptap/extension-unique-id";
|
|
21
|
+
import { Placeholder as De, Selection as Oe } from "@tiptap/extensions";
|
|
22
|
+
import ke from "@tiptap/starter-kit";
|
|
23
|
+
import { useController as Ae } from "react-hook-form";
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region ../../libraries/rich-text-editor/dist/styles/inlineRteTheme.js
|
|
26
|
+
var je = i({ baseSpacing: "var(--_1wlnmgm0)" });
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region ../../libraries/rich-text-editor/dist/utils/getElementOverflowPosition.js
|
|
29
|
+
function Me(e, t) {
|
|
30
|
+
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = n.top < r.top, a = n.bottom > r.bottom;
|
|
31
|
+
return i && a ? "both" : i ? "top" : a ? "bottom" : "none";
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
//#region ../../libraries/rich-text-editor/dist/components/popoverMenu/PopoverMenu.cssm.js
|
|
35
|
+
var Ne = P({
|
|
36
|
+
defaultClassName: "_1bcyrm90",
|
|
37
|
+
variantClassNames: { orientation: {
|
|
38
|
+
vertical: "_1bcyrm91",
|
|
39
|
+
horizontal: "_1bcyrm92"
|
|
40
|
+
} },
|
|
41
|
+
defaultVariants: { orientation: "vertical" },
|
|
42
|
+
compoundVariants: []
|
|
43
|
+
}), Pe = "_1bcyrm93", Fe = "_1bcyrm96", Ie = (e) => {
|
|
44
|
+
let t = E(11), n, r;
|
|
45
|
+
t[0] === e ? (n = t[1], r = t[2]) : ({orientation: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
46
|
+
let { editor: i } = j(), a;
|
|
47
|
+
t[3] === i ? a = t[4] : (a = () => i ? i.view.dom : null, t[3] = i, t[4] = a);
|
|
48
|
+
let o;
|
|
49
|
+
t[5] === n ? o = t[6] : (o = Ne({ orientation: n }), t[5] = n, t[6] = o);
|
|
50
|
+
let s;
|
|
51
|
+
return t[7] !== r || t[8] !== a || t[9] !== o ? (s = /* @__PURE__ */ w(h, {
|
|
52
|
+
initialFocus: !1,
|
|
53
|
+
finalFocus: a,
|
|
54
|
+
className: o,
|
|
55
|
+
"data-selector": "popover-menu-content",
|
|
56
|
+
...r
|
|
57
|
+
}), t[7] = r, t[8] = a, t[9] = o, t[10] = s) : s = t[10], s;
|
|
58
|
+
}, Le = (e) => {
|
|
59
|
+
let t = E(21), n, r, i, a, u;
|
|
60
|
+
t[0] === e ? (n = t[1], r = t[2], i = t[3], a = t[4], u = t[5]) : ({className: n, isSelected: r, tooltip: u, showTooltip: a, ...i} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i, t[4] = a, t[5] = u);
|
|
61
|
+
let d = a === void 0 ? !0 : a, f = x(null), p, m;
|
|
62
|
+
t[6] === r ? (p = t[7], m = t[8]) : (p = () => {
|
|
63
|
+
if (!f.current || !r) return;
|
|
64
|
+
let e = f.current.closest("[data-selector=\"popover-menu-content\"]");
|
|
65
|
+
if (!e) return;
|
|
66
|
+
let t = Me(f.current, e);
|
|
67
|
+
(t === "top" || t === "bottom") && f.current.scrollIntoView({
|
|
68
|
+
behavior: "smooth",
|
|
69
|
+
block: "nearest",
|
|
70
|
+
inline: "nearest"
|
|
71
|
+
});
|
|
72
|
+
}, m = [r], t[6] = r, t[7] = p, t[8] = m), y(p, m);
|
|
73
|
+
let h = !d || !u, g = r && "_1bcyrm95", _;
|
|
74
|
+
t[9] !== n || t[10] !== g ? (_ = D(Fe, g, n), t[9] = n, t[10] = g, t[11] = _) : _ = t[11];
|
|
75
|
+
let v;
|
|
76
|
+
t[12] !== i || t[13] !== _ ? (v = /* @__PURE__ */ w(o, {
|
|
77
|
+
onPointerDown: Be,
|
|
78
|
+
render: /* @__PURE__ */ w(l, {
|
|
79
|
+
ref: f,
|
|
80
|
+
type: "button",
|
|
81
|
+
role: "button",
|
|
82
|
+
tabIndex: -1,
|
|
83
|
+
variant: "ghost",
|
|
84
|
+
size: "sm",
|
|
85
|
+
className: _,
|
|
86
|
+
onPointerDown: Ve,
|
|
87
|
+
...i
|
|
88
|
+
})
|
|
89
|
+
}), t[12] = i, t[13] = _, t[14] = v) : v = t[14];
|
|
90
|
+
let b;
|
|
91
|
+
t[15] === u ? b = t[16] : (b = /* @__PURE__ */ w(s, { children: u }), t[15] = u, t[16] = b);
|
|
92
|
+
let S;
|
|
93
|
+
return t[17] !== h || t[18] !== v || t[19] !== b ? (S = /* @__PURE__ */ T(c, {
|
|
94
|
+
disabled: h,
|
|
95
|
+
children: [v, b]
|
|
96
|
+
}), t[17] = h, t[18] = v, t[19] = b, t[20] = S) : S = t[20], S;
|
|
97
|
+
}, Re = (e) => {
|
|
98
|
+
let t = E(8), n, r;
|
|
99
|
+
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
100
|
+
let i;
|
|
101
|
+
t[3] === n ? i = t[4] : (i = D(Pe, n), t[3] = n, t[4] = i);
|
|
102
|
+
let a;
|
|
103
|
+
return t[5] !== r || t[6] !== i ? (a = /* @__PURE__ */ w("div", {
|
|
104
|
+
className: i,
|
|
105
|
+
...r
|
|
106
|
+
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
107
|
+
}, ze = (e) => {
|
|
108
|
+
let t = E(2), n;
|
|
109
|
+
return t[0] === e ? n = t[1] : (n = /* @__PURE__ */ w(_, {
|
|
110
|
+
id: "popover-menu-separator",
|
|
111
|
+
...e
|
|
112
|
+
}), t[0] = e, t[1] = n), n;
|
|
113
|
+
};
|
|
114
|
+
function Be(e) {
|
|
115
|
+
return e.preventDefault();
|
|
116
|
+
}
|
|
117
|
+
function Ve(e) {
|
|
118
|
+
return e.preventDefault();
|
|
119
|
+
}
|
|
120
|
+
//#endregion
|
|
121
|
+
//#region ../../libraries/rich-text-editor/dist/hooks/useAction.js
|
|
122
|
+
var He = (e, t, n) => {
|
|
123
|
+
let r = E(16), i;
|
|
124
|
+
r[0] !== t || r[1] !== n ? (i = (e) => {
|
|
125
|
+
let { editor: r } = e;
|
|
126
|
+
return r ? {
|
|
127
|
+
isVisible: t.checkIsVisible ? t.checkIsVisible(r, n) : !0,
|
|
128
|
+
isActive: t.checkIsActive ? t.checkIsActive(r, n) : !1,
|
|
129
|
+
canExecute: t.checkCanExecute ? t.checkCanExecute(r, n) : !0,
|
|
130
|
+
execute: (e) => {
|
|
131
|
+
if (!r) return;
|
|
132
|
+
let i = e ?? n ?? {};
|
|
133
|
+
return t.execute(r, i);
|
|
134
|
+
}
|
|
135
|
+
} : null;
|
|
136
|
+
}, r[0] = t, r[1] = n, r[2] = i) : i = r[2];
|
|
137
|
+
let a;
|
|
138
|
+
r[3] !== e || r[4] !== i ? (a = {
|
|
139
|
+
editor: e,
|
|
140
|
+
selector: i
|
|
141
|
+
}, r[3] = e, r[4] = i, r[5] = a) : a = r[5];
|
|
142
|
+
let o = N(a), s;
|
|
143
|
+
r[6] !== t || r[7] !== n || r[8] !== e ? (s = (r) => {
|
|
144
|
+
if (!e) return;
|
|
145
|
+
let i = r ?? n ?? {};
|
|
146
|
+
return t.execute(e, i);
|
|
147
|
+
}, r[6] = t, r[7] = n, r[8] = e, r[9] = s) : s = r[9];
|
|
148
|
+
let c = s, l = o?.isVisible ?? !0, u = o?.isActive ?? !1, d = o?.canExecute ?? !1, f;
|
|
149
|
+
return r[10] !== t || r[11] !== c || r[12] !== l || r[13] !== u || r[14] !== d ? (f = {
|
|
150
|
+
...t,
|
|
151
|
+
isVisible: l,
|
|
152
|
+
isActive: u,
|
|
153
|
+
canExecute: d,
|
|
154
|
+
execute: c
|
|
155
|
+
}, r[10] = t, r[11] = c, r[12] = l, r[13] = u, r[14] = d, r[15] = f) : f = r[15], f;
|
|
156
|
+
};
|
|
157
|
+
//#endregion
|
|
158
|
+
//#region ../../libraries/rich-text-editor/dist/utils/isMac.js
|
|
159
|
+
function Ue() {
|
|
160
|
+
return typeof navigator < "u" && navigator.platform.toLowerCase().includes("mac");
|
|
161
|
+
}
|
|
162
|
+
//#endregion
|
|
163
|
+
//#region ../../libraries/rich-text-editor/dist/utils/parseShortcutKeys.js
|
|
164
|
+
var We = {
|
|
165
|
+
mod: "⌘",
|
|
166
|
+
command: "⌘",
|
|
167
|
+
meta: "⌘",
|
|
168
|
+
ctrl: "⌃",
|
|
169
|
+
control: "⌃",
|
|
170
|
+
alt: "⌥",
|
|
171
|
+
option: "⌥",
|
|
172
|
+
shift: "⇧",
|
|
173
|
+
backspace: "Del",
|
|
174
|
+
delete: "⌦",
|
|
175
|
+
enter: "⏎",
|
|
176
|
+
escape: "⎋",
|
|
177
|
+
capslock: "⇪"
|
|
178
|
+
}, Ge = (e, t, n = !0) => t ? We[e.toLowerCase()] || (n ? e.toUpperCase() : e) : n ? e.charAt(0).toUpperCase() + e.slice(1) : e, Ke = (e) => {
|
|
179
|
+
let { shortcutKeys: t, delimiter: n = "+", capitalize: r = !0 } = e;
|
|
180
|
+
return t ? t.split(n).map((e) => e.trim()).map((e) => Ge(e, Ue(), r)) : [];
|
|
181
|
+
}, qe = "ytl8j00", Je = P({
|
|
182
|
+
defaultClassName: "_1u80mrm0",
|
|
183
|
+
variantClassNames: { variant: {
|
|
184
|
+
default: "_1u80mrm1",
|
|
185
|
+
secondary: "_1u80mrm2",
|
|
186
|
+
destructive: "_1u80mrm3",
|
|
187
|
+
outline: "_1u80mrm4",
|
|
188
|
+
ghost: "_1u80mrm5",
|
|
189
|
+
link: "_1u80mrm6"
|
|
190
|
+
} },
|
|
191
|
+
defaultVariants: { variant: "default" },
|
|
192
|
+
compoundVariants: []
|
|
193
|
+
});
|
|
194
|
+
//#endregion
|
|
195
|
+
//#region ../../libraries/levocn/dist/ui/badge/Badge.js
|
|
196
|
+
function Ye(e) {
|
|
197
|
+
let t = E(13), n, r, i, a, o;
|
|
198
|
+
if (t[0] !== e) {
|
|
199
|
+
let { className: s, variant: c, render: l, ...u } = e;
|
|
200
|
+
n = l, o = c === void 0 ? "default" : c, a = z, r = "span", i = R({ className: O(Je({ variant: o }), s) }, u), t[0] = e, t[1] = n, t[2] = r, t[3] = i, t[4] = a, t[5] = o;
|
|
201
|
+
} else n = t[1], r = t[2], i = t[3], a = t[4], o = t[5];
|
|
202
|
+
let s;
|
|
203
|
+
t[6] === o ? s = t[7] : (s = {
|
|
204
|
+
slot: "badge",
|
|
205
|
+
variant: o
|
|
206
|
+
}, t[6] = o, t[7] = s);
|
|
207
|
+
let c;
|
|
208
|
+
return t[8] !== n || t[9] !== r || t[10] !== i || t[11] !== s ? (c = {
|
|
209
|
+
defaultTagName: r,
|
|
210
|
+
props: i,
|
|
211
|
+
render: n,
|
|
212
|
+
state: s
|
|
213
|
+
}, t[8] = n, t[9] = r, t[10] = i, t[11] = s, t[12] = c) : c = t[12], a(c);
|
|
214
|
+
}
|
|
215
|
+
//#endregion
|
|
216
|
+
//#region ../../libraries/rich-text-editor/dist/components/textShortcutBadge/TextShortcutBadge.js
|
|
217
|
+
function Xe(e) {
|
|
218
|
+
let t = E(4), { shortcutKeys: n } = e;
|
|
219
|
+
if (!n) return null;
|
|
220
|
+
let r;
|
|
221
|
+
t[0] === n ? r = t[1] : (r = Ke({ shortcutKeys: n }), t[0] = n, t[1] = r);
|
|
222
|
+
let i;
|
|
223
|
+
return t[2] === r ? i = t[3] : (i = /* @__PURE__ */ w(Ye, {
|
|
224
|
+
variant: "secondary",
|
|
225
|
+
className: qe,
|
|
226
|
+
children: r
|
|
227
|
+
}), t[2] = r, t[3] = i), i;
|
|
228
|
+
}
|
|
229
|
+
//#endregion
|
|
230
|
+
//#region ../../libraries/rich-text-editor/dist/components/popoverMenu/PopoverActionButton.js
|
|
231
|
+
var Ze = (e) => {
|
|
232
|
+
let t = E(23), { action: n, context: r, showLabel: i, showShortCut: a, isHovered: o, showTooltip: s, buttonProps: c, iconSize: l, onClick: u } = e, d = s === void 0 ? !0 : s, f = l === void 0 ? 16 : l, { editor: p } = j(), { isActive: m, isVisible: h, canExecute: g, execute: _, Icon: v, label: y, shortcutsKeys: b } = He(p, n, r);
|
|
233
|
+
if (!h && !g) return null;
|
|
234
|
+
let x = !g, S = m || o, C;
|
|
235
|
+
t[0] !== r || t[1] !== _ || t[2] !== u ? (C = () => {
|
|
236
|
+
_(r), u?.();
|
|
237
|
+
}, t[0] = r, t[1] = _, t[2] = u, t[3] = C) : C = t[3];
|
|
238
|
+
let D;
|
|
239
|
+
t[4] !== v || t[5] !== f ? (D = v && /* @__PURE__ */ w(v, { size: f }), t[4] = v, t[5] = f, t[6] = D) : D = t[6];
|
|
240
|
+
let O;
|
|
241
|
+
t[7] !== y || t[8] !== i ? (O = i && /* @__PURE__ */ w("span", { children: y }), t[7] = y, t[8] = i, t[9] = O) : O = t[9];
|
|
242
|
+
let k;
|
|
243
|
+
t[10] !== b || t[11] !== a ? (k = a && /* @__PURE__ */ w(Xe, { shortcutKeys: b }), t[10] = b, t[11] = a, t[12] = k) : k = t[12];
|
|
244
|
+
let A;
|
|
245
|
+
return t[13] !== c || t[14] !== y || t[15] !== d || t[16] !== x || t[17] !== S || t[18] !== C || t[19] !== D || t[20] !== O || t[21] !== k ? (A = /* @__PURE__ */ T(Le, {
|
|
246
|
+
disabled: x,
|
|
247
|
+
isSelected: S,
|
|
248
|
+
showTooltip: d,
|
|
249
|
+
tooltip: y,
|
|
250
|
+
onClick: C,
|
|
251
|
+
...c,
|
|
252
|
+
children: [
|
|
253
|
+
D,
|
|
254
|
+
" ",
|
|
255
|
+
O,
|
|
256
|
+
k
|
|
257
|
+
]
|
|
258
|
+
}), t[13] = c, t[14] = y, t[15] = d, t[16] = x, t[17] = S, t[18] = C, t[19] = D, t[20] = O, t[21] = k, t[22] = A) : A = t[22], A;
|
|
259
|
+
};
|
|
260
|
+
//#endregion
|
|
261
|
+
//#region ../../libraries/rich-text-editor/dist/bridge/createEditorAction.js
|
|
262
|
+
function q(e) {
|
|
263
|
+
return e;
|
|
264
|
+
}
|
|
265
|
+
//#endregion
|
|
266
|
+
//#region ../../libraries/rich-text-editor/dist/utils/isInsideStructuralNode.js
|
|
267
|
+
var Qe = (e) => {
|
|
268
|
+
if (!e) return !1;
|
|
269
|
+
let { $from: t } = e.state.selection, n = [
|
|
270
|
+
"tableCell",
|
|
271
|
+
"tableHeader",
|
|
272
|
+
"quoteCaption",
|
|
273
|
+
"detailsSummary"
|
|
274
|
+
];
|
|
275
|
+
for (let e = t.depth; e > 0; e--) if (n.includes(t.node(e).type.name)) return !0;
|
|
276
|
+
return !1;
|
|
277
|
+
}, $e = "_1xwc9hu0", et = (e) => {
|
|
278
|
+
let t = E(15), { value: n, onChange: r, onKeyDown: i, placeholder: a, autoFocus: o, type: s, autoComplete: c, autoCorrect: l, autoCapitalize: u, className: d } = e, f = a === void 0 ? "Paste a link..." : a, p = o === void 0 ? !0 : o, m = s === void 0 ? "url" : s, h = c === void 0 ? "off" : c, _ = l === void 0 ? "off" : l, v = u === void 0 ? "off" : u, y;
|
|
279
|
+
t[0] === r ? y = t[1] : (y = (e) => r(e.target.value), t[0] = r, t[1] = y);
|
|
280
|
+
let b;
|
|
281
|
+
t[2] === d ? b = t[3] : (b = O($e, d), t[2] = d, t[3] = b);
|
|
282
|
+
let x;
|
|
283
|
+
return t[4] !== v || t[5] !== h || t[6] !== _ || t[7] !== p || t[8] !== i || t[9] !== f || t[10] !== y || t[11] !== b || t[12] !== m || t[13] !== n ? (x = /* @__PURE__ */ w(g, {
|
|
284
|
+
type: m,
|
|
285
|
+
placeholder: f,
|
|
286
|
+
value: n,
|
|
287
|
+
onChange: y,
|
|
288
|
+
onKeyDown: i,
|
|
289
|
+
autoFocus: p,
|
|
290
|
+
autoComplete: h,
|
|
291
|
+
autoCorrect: _,
|
|
292
|
+
autoCapitalize: v,
|
|
293
|
+
className: b
|
|
294
|
+
}), t[4] = v, t[5] = h, t[6] = _, t[7] = p, t[8] = i, t[9] = f, t[10] = y, t[11] = b, t[12] = m, t[13] = n, t[14] = x) : x = t[14], x;
|
|
295
|
+
};
|
|
296
|
+
//#endregion
|
|
297
|
+
//#region ../../libraries/rich-text-editor/dist/utils/isExtensionAvailable.js
|
|
298
|
+
function tt(e, t) {
|
|
299
|
+
if (!e) return !1;
|
|
300
|
+
let n = Array.isArray(t) ? t : [t], r = n.some((t) => e.extensionManager.extensions.some((e) => e.name === t));
|
|
301
|
+
return r || console.warn(`None of the extensions [${n.join(", ")}] were found in the editor schema. Ensure they are included in the editor configuration.`), r;
|
|
302
|
+
}
|
|
303
|
+
//#endregion
|
|
304
|
+
//#region ../../libraries/rich-text-editor/dist/features/nodeStyling/actions/textAlign.js
|
|
305
|
+
var nt = "textAlign", rt = ({ align: e, ...t }) => q({
|
|
306
|
+
...t,
|
|
307
|
+
checkIsActive: (t) => !t || !t.isEditable ? !1 : t.isActive({ textAlign: e }),
|
|
308
|
+
checkIsVisible: (e) => !e || !e.isEditable ? !1 : tt(e, nt),
|
|
309
|
+
checkCanExecute: (t) => !t || !t.isEditable || !tt(t, nt) ? !1 : t.can().setNodeTextAlign(e),
|
|
310
|
+
execute: (t) => {
|
|
311
|
+
if (!t || !t.isEditable) return !1;
|
|
312
|
+
try {
|
|
313
|
+
if (!tt(t, nt)) return !1;
|
|
314
|
+
let n = t.chain().focus();
|
|
315
|
+
return "setNodeTextAlign" in n ? n.setNodeTextAlign(e).run() : !1;
|
|
316
|
+
} catch {
|
|
317
|
+
return !1;
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
}), it = rt({
|
|
321
|
+
label: "Align left",
|
|
322
|
+
Icon: H,
|
|
323
|
+
shortcutsKeys: "mod+shift+l",
|
|
324
|
+
align: "left"
|
|
325
|
+
}), at = rt({
|
|
326
|
+
label: "Align center",
|
|
327
|
+
Icon: B,
|
|
328
|
+
shortcutsKeys: "mod+shift+e",
|
|
329
|
+
align: "center"
|
|
330
|
+
}), ot = rt({
|
|
331
|
+
label: "Align right",
|
|
332
|
+
Icon: ee,
|
|
333
|
+
shortcutsKeys: "mod+shift+r",
|
|
334
|
+
align: "right"
|
|
335
|
+
}), st = rt({
|
|
336
|
+
label: "Align justify",
|
|
337
|
+
Icon: V,
|
|
338
|
+
shortcutsKeys: "mod+shift+j",
|
|
339
|
+
align: "justify"
|
|
340
|
+
}), ct = (e, t) => t?.schema ? t.schema.spec.marks.get(e) !== void 0 : !1;
|
|
341
|
+
//#endregion
|
|
342
|
+
//#region ../../libraries/rich-text-editor/dist/utils/findNodeAtPosition.js
|
|
343
|
+
function lt(e, t) {
|
|
344
|
+
try {
|
|
345
|
+
return e.state.doc.nodeAt(t) || (console.warn(`No node found at position ${t}`), null);
|
|
346
|
+
} catch (e) {
|
|
347
|
+
return console.error(`Error getting node at position ${t}:`, e), null;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
//#endregion
|
|
351
|
+
//#region ../../libraries/rich-text-editor/dist/utils/findNodePosition.js
|
|
352
|
+
function ut(e) {
|
|
353
|
+
let { editor: n, node: r, nodePos: i } = e;
|
|
354
|
+
if (!n || !n.state?.doc) return null;
|
|
355
|
+
let a = r != null, o = t(i);
|
|
356
|
+
if (!a && !o) return null;
|
|
357
|
+
if (a) {
|
|
358
|
+
let e = -1, t = null;
|
|
359
|
+
if (n.state.doc.descendants((n, i) => n === r ? (e = i, t = n, !1) : !0), e !== -1 && t !== null) return {
|
|
360
|
+
pos: e,
|
|
361
|
+
node: t
|
|
362
|
+
};
|
|
363
|
+
}
|
|
364
|
+
if (o) {
|
|
365
|
+
let e = lt(n, i);
|
|
366
|
+
if (e) return {
|
|
367
|
+
pos: i,
|
|
368
|
+
node: e
|
|
369
|
+
};
|
|
370
|
+
}
|
|
371
|
+
return null;
|
|
372
|
+
}
|
|
373
|
+
//#endregion
|
|
374
|
+
//#region ../../libraries/rich-text-editor/dist/utils/isNodeInSchema.js
|
|
375
|
+
var J = (e, t) => t?.schema ? t.schema.spec.nodes.get(e) !== void 0 : !1;
|
|
376
|
+
//#endregion
|
|
377
|
+
//#region ../../libraries/rich-text-editor/dist/utils/selectionWithinConvertibleTypes.js
|
|
378
|
+
function dt(e, t = []) {
|
|
379
|
+
if (!e || t.length === 0) return !1;
|
|
380
|
+
let { state: n } = e, { selection: r } = n, i = new Set(t);
|
|
381
|
+
if (r instanceof I) {
|
|
382
|
+
let e = r.node?.type?.name;
|
|
383
|
+
return !!e && i.has(e);
|
|
384
|
+
}
|
|
385
|
+
if (r instanceof L || r instanceof F) {
|
|
386
|
+
let e = !0;
|
|
387
|
+
return n.doc.nodesBetween(r.from, r.to, (t) => t.isTextblock && !i.has(t.type.name) ? (e = !1, !1) : e), e;
|
|
388
|
+
}
|
|
389
|
+
return !1;
|
|
390
|
+
}
|
|
391
|
+
//#endregion
|
|
392
|
+
//#region ../../libraries/rich-text-editor/dist/features/codeBlock/actions/codeBlock.js
|
|
393
|
+
var ft = q({
|
|
394
|
+
label: "Code Block",
|
|
395
|
+
Icon: K,
|
|
396
|
+
shortcutsKeys: "mod+alt+c",
|
|
397
|
+
checkIsActive: (e) => e?.isActive("codeBlock") || !1,
|
|
398
|
+
checkIsVisible: (e) => !e || !e.isEditable || Qe(e) ? !1 : J("codeBlock", e),
|
|
399
|
+
checkCanExecute: (e, t = !0) => !e || !e.isEditable || !J("codeBlock", e) ? !1 : t ? dt(e, [
|
|
400
|
+
"paragraph",
|
|
401
|
+
"heading",
|
|
402
|
+
"bulletList",
|
|
403
|
+
"orderedList",
|
|
404
|
+
"taskList",
|
|
405
|
+
"codeBlock"
|
|
406
|
+
]) ? e.can().toggleNode("codeBlock", "paragraph") || e.can().clearNodes() : !1 : e.can().toggleNode("codeBlock", "paragraph"),
|
|
407
|
+
execute: (e) => {
|
|
408
|
+
if (!e || !e.isEditable) return !1;
|
|
409
|
+
try {
|
|
410
|
+
let n = e.view, r = n.state, i = r.tr;
|
|
411
|
+
if (r.selection.empty || r.selection instanceof L) {
|
|
412
|
+
let a = ut({
|
|
413
|
+
editor: e,
|
|
414
|
+
node: r.selection.$anchor.node(1)
|
|
415
|
+
})?.pos;
|
|
416
|
+
if (!t(a)) return !1;
|
|
417
|
+
i = i.setSelection(I.create(r.doc, a)), n.dispatch(i), r = n.state;
|
|
418
|
+
}
|
|
419
|
+
let a = r.selection, o = e.chain().focus();
|
|
420
|
+
if (a instanceof I) {
|
|
421
|
+
let e = a.node.firstChild?.firstChild, t = a.node.lastChild?.lastChild, n = e ? a.from + e.nodeSize : a.from + 1, i = t ? a.to - t.nodeSize : a.to - 1, s = r.doc.resolve(n), c = r.doc.resolve(i);
|
|
422
|
+
o = o.setTextSelection(L.between(s, c)).clearNodes();
|
|
423
|
+
}
|
|
424
|
+
return (e.isActive("codeBlock") ? o.setNode("paragraph") : o.toggleNode("codeBlock", "paragraph")).run(), e.chain().focus().selectTextblockEnd().run(), !0;
|
|
425
|
+
} catch {
|
|
426
|
+
return !1;
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
}), Y = ({ level: e, ...n }) => q({
|
|
430
|
+
checkIsActive: (t) => !t || !t.isEditable ? !1 : Array.isArray(e) ? e.some((e) => t.isActive("heading", { level: e })) : e ? t.isActive("heading", { level: e }) : t.isActive("heading"),
|
|
431
|
+
checkIsVisible: (e) => !(!e || !e.isEditable || Qe(e) || !J("heading", e)),
|
|
432
|
+
checkCanExecute: (t, n = !0) => !t || !t.isEditable || !J("heading", t) ? !1 : n ? dt(t, [
|
|
433
|
+
"paragraph",
|
|
434
|
+
"heading",
|
|
435
|
+
"bulletList",
|
|
436
|
+
"orderedList",
|
|
437
|
+
"taskList",
|
|
438
|
+
"codeBlock"
|
|
439
|
+
]) ? e ? t.can().setNode("heading", { level: e }) || t.can().clearNodes() : t.can().setNode("heading") || t.can().clearNodes() : !1 : e ? t.can().setNode("heading", { level: e }) : t.can().setNode("heading"),
|
|
440
|
+
execute: (n) => {
|
|
441
|
+
if (!n || !n.isEditable) return !1;
|
|
442
|
+
let r = Array.isArray(e) ? e : [e];
|
|
443
|
+
try {
|
|
444
|
+
let i = n.view, a = i.state, o = a.tr;
|
|
445
|
+
if (a.selection.empty || a.selection instanceof L) {
|
|
446
|
+
let e = ut({
|
|
447
|
+
editor: n,
|
|
448
|
+
node: a.selection.$anchor.node(1)
|
|
449
|
+
})?.pos;
|
|
450
|
+
if (!t(e)) return !1;
|
|
451
|
+
o = o.setSelection(I.create(a.doc, e)), i.dispatch(o), a = i.state;
|
|
452
|
+
}
|
|
453
|
+
let s = a.selection, c = n.chain().focus();
|
|
454
|
+
if (s instanceof I) {
|
|
455
|
+
let e = s.node.firstChild?.firstChild, t = s.node.lastChild?.lastChild, n = e ? s.from + e.nodeSize : s.from + 1, r = t ? s.to - t.nodeSize : s.to - 1, i = a.doc.resolve(n), o = a.doc.resolve(r);
|
|
456
|
+
c = c.setTextSelection(L.between(i, o)).clearNodes();
|
|
457
|
+
}
|
|
458
|
+
return (r.some((e) => n.isActive("heading", { level: e })) ? c.setNode("paragraph") : c.setNode("heading", { level: e })).run(), n.chain().focus().selectTextblockEnd().run(), !0;
|
|
459
|
+
} catch {
|
|
460
|
+
return !1;
|
|
461
|
+
}
|
|
462
|
+
},
|
|
463
|
+
...n
|
|
464
|
+
}), pt = Y({
|
|
465
|
+
label: "Heading 1",
|
|
466
|
+
Icon: ie,
|
|
467
|
+
shortcutsKeys: "ctrl+alt+1",
|
|
468
|
+
level: 1
|
|
469
|
+
}), mt = Y({
|
|
470
|
+
label: "Heading 2",
|
|
471
|
+
Icon: ae,
|
|
472
|
+
shortcutsKeys: "ctrl+alt+2",
|
|
473
|
+
level: 2
|
|
474
|
+
}), ht = Y({
|
|
475
|
+
label: "Heading 3",
|
|
476
|
+
Icon: oe,
|
|
477
|
+
shortcutsKeys: "ctrl+alt+3",
|
|
478
|
+
level: 3
|
|
479
|
+
}), gt = Y({
|
|
480
|
+
label: "Heading 4",
|
|
481
|
+
Icon: se,
|
|
482
|
+
shortcutsKeys: "ctrl+alt+4",
|
|
483
|
+
level: 4
|
|
484
|
+
}), _t = Y({
|
|
485
|
+
label: "Heading 5",
|
|
486
|
+
Icon: ce,
|
|
487
|
+
shortcutsKeys: "ctrl+alt+5",
|
|
488
|
+
level: 5
|
|
489
|
+
}), vt = Y({
|
|
490
|
+
label: "Heading 6",
|
|
491
|
+
Icon: le,
|
|
492
|
+
shortcutsKeys: "ctrl+alt+6",
|
|
493
|
+
level: 6
|
|
494
|
+
}), yt = ({ type: e, ...n }) => q({
|
|
495
|
+
...n,
|
|
496
|
+
checkIsActive: (t) => !t || !t.isEditable ? !1 : t.isActive(e),
|
|
497
|
+
checkIsVisible: (t) => !t || !t.isEditable || Qe(t) ? !1 : J(e, t),
|
|
498
|
+
checkCanExecute: (t, n = !0) => !t || !t.isEditable || !J(e, t) ? !1 : n ? dt(t, [
|
|
499
|
+
"paragraph",
|
|
500
|
+
"heading",
|
|
501
|
+
"bulletList",
|
|
502
|
+
"orderedList",
|
|
503
|
+
"taskList",
|
|
504
|
+
"codeBlock"
|
|
505
|
+
]) ? e === "bulletList" ? t.can().toggleBulletList() || t.can().clearNodes() : t.can().toggleOrderedList() || t.can().clearNodes() : !1 : e === "bulletList" ? t.can().toggleBulletList() : t.can().toggleOrderedList(),
|
|
506
|
+
execute: (n) => {
|
|
507
|
+
if (!n || !n.isEditable || !(e === "bulletList" ? n.can().toggleBulletList() || n.can().clearNodes() : n.can().toggleOrderedList() || n.can().clearNodes())) return !1;
|
|
508
|
+
try {
|
|
509
|
+
let r = n.view, i = r.state, a = i.tr;
|
|
510
|
+
if (i.selection.empty || i.selection instanceof L) {
|
|
511
|
+
let e = ut({
|
|
512
|
+
editor: n,
|
|
513
|
+
node: i.selection.$anchor.node(1)
|
|
514
|
+
})?.pos;
|
|
515
|
+
if (!t(e)) return !1;
|
|
516
|
+
a = a.setSelection(I.create(i.doc, e)), r.dispatch(a), i = r.state;
|
|
517
|
+
}
|
|
518
|
+
let o = i.selection, s = n.chain().focus();
|
|
519
|
+
if (o instanceof I) {
|
|
520
|
+
let e = o.node.firstChild?.firstChild, t = o.node.lastChild?.lastChild, n = e ? o.from + e.nodeSize : o.from + 1, r = t ? o.to - t.nodeSize : o.to - 1, a = i.doc.resolve(n), c = i.doc.resolve(r);
|
|
521
|
+
s = s.setTextSelection(L.between(a, c)).clearNodes();
|
|
522
|
+
}
|
|
523
|
+
return n.isActive(e) ? s.liftListItem("listItem").lift("bulletList").lift("orderedList").lift("taskList").run() : e === "bulletList" ? s.toggleBulletList().run() : s.toggleOrderedList().run(), n.chain().focus().selectTextblockEnd().run(), !0;
|
|
524
|
+
} catch {
|
|
525
|
+
return !1;
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
}), bt = yt({
|
|
529
|
+
label: "Bullet List",
|
|
530
|
+
Icon: fe,
|
|
531
|
+
shortcutsKeys: "mod+shift+8",
|
|
532
|
+
type: "bulletList"
|
|
533
|
+
}), xt = yt({
|
|
534
|
+
label: "Ordered List",
|
|
535
|
+
Icon: pe,
|
|
536
|
+
shortcutsKeys: "mod+shift+7",
|
|
537
|
+
type: "orderedList"
|
|
538
|
+
}), St = q({
|
|
539
|
+
label: "Text",
|
|
540
|
+
Icon: he,
|
|
541
|
+
shortcutsKeys: "mod+alt+0",
|
|
542
|
+
checkIsActive: (e) => !e || !e.isEditable ? !1 : e.isActive("paragraph"),
|
|
543
|
+
checkIsVisible: (e) => !e || !e.isEditable ? !1 : J("paragraph", e),
|
|
544
|
+
checkCanExecute: (e, t = !0) => !e || !e.isEditable || !e.schema.nodes.paragraph ? !1 : t ? dt(e, [
|
|
545
|
+
"paragraph",
|
|
546
|
+
"heading",
|
|
547
|
+
"bulletList",
|
|
548
|
+
"orderedList",
|
|
549
|
+
"taskList",
|
|
550
|
+
"codeBlock"
|
|
551
|
+
]) ? e.can().setNode("paragraph") || e.can().clearNodes() : !1 : e.can().setNode("paragraph"),
|
|
552
|
+
execute: (e) => {
|
|
553
|
+
if (!e || !e.isEditable) return !1;
|
|
554
|
+
try {
|
|
555
|
+
let n = e.view, r = n.state, i = r.tr;
|
|
556
|
+
if (r.selection.empty || r.selection instanceof L) {
|
|
557
|
+
let a = ut({
|
|
558
|
+
editor: e,
|
|
559
|
+
node: r.selection.$anchor.node(1)
|
|
560
|
+
})?.pos;
|
|
561
|
+
if (!t(a)) return !1;
|
|
562
|
+
i = i.setSelection(I.create(r.doc, a)), n.dispatch(i), r = n.state;
|
|
563
|
+
}
|
|
564
|
+
let a = r.selection, o = e.chain().focus();
|
|
565
|
+
if (a instanceof I) {
|
|
566
|
+
let e = a.node.firstChild?.firstChild, t = a.node.lastChild?.lastChild, n = e ? a.from + e.nodeSize : a.from + 1, i = t ? a.to - t.nodeSize : a.to - 1, s = r.doc.resolve(n), c = r.doc.resolve(i);
|
|
567
|
+
o = o.setTextSelection(L.between(s, c)).clearNodes();
|
|
568
|
+
}
|
|
569
|
+
return e.isActive("paragraph") || o.setNode("paragraph").run(), e.chain().focus().selectTextblockEnd().run(), !0;
|
|
570
|
+
} catch {
|
|
571
|
+
return !1;
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
});
|
|
575
|
+
({ ...St });
|
|
576
|
+
//#endregion
|
|
577
|
+
//#region ../../libraries/rich-text-editor/dist/features/nodeStyling/ui/TurnIntoMenu.js
|
|
578
|
+
var Ct = [
|
|
579
|
+
"heading_1",
|
|
580
|
+
"heading_2",
|
|
581
|
+
"heading_3",
|
|
582
|
+
"heading_4",
|
|
583
|
+
"heading_5",
|
|
584
|
+
"heading_6",
|
|
585
|
+
"bulletList",
|
|
586
|
+
"orderedList",
|
|
587
|
+
"codeBlock",
|
|
588
|
+
"paragraph"
|
|
589
|
+
], X = {
|
|
590
|
+
paragraph: St,
|
|
591
|
+
heading_1: pt,
|
|
592
|
+
heading_2: mt,
|
|
593
|
+
heading_3: ht,
|
|
594
|
+
heading_4: gt,
|
|
595
|
+
heading_5: _t,
|
|
596
|
+
heading_6: vt,
|
|
597
|
+
codeBlock: ft,
|
|
598
|
+
bulletList: bt,
|
|
599
|
+
orderedList: xt
|
|
600
|
+
}, wt = Object.keys(X), Tt = (e) => {
|
|
601
|
+
let t = E(4), { isActive: n, type: r, onSelect: i } = e, a = X[r];
|
|
602
|
+
if (!a || n) return null;
|
|
603
|
+
let o;
|
|
604
|
+
return t[0] !== a || t[1] !== n || t[2] !== i ? (o = /* @__PURE__ */ w(Ze, {
|
|
605
|
+
action: a,
|
|
606
|
+
showShortCut: !0,
|
|
607
|
+
showLabel: !0,
|
|
608
|
+
showTooltip: !1,
|
|
609
|
+
isSelected: n,
|
|
610
|
+
onClick: i
|
|
611
|
+
}), t[0] = a, t[1] = n, t[2] = i, t[3] = o) : o = t[3], o;
|
|
612
|
+
};
|
|
613
|
+
function Et(e) {
|
|
614
|
+
return e ? wt.filter((t) => e.includes(t)) : wt;
|
|
615
|
+
}
|
|
616
|
+
var Dt = (e) => {
|
|
617
|
+
let t = E(6), { blockTypes: n, activeType: r, onSelect: i } = e, a;
|
|
618
|
+
t[0] !== r || t[1] !== n || t[2] !== i ? (a = Array.isArray(n) && n.map((e) => /* @__PURE__ */ w(Tt, {
|
|
619
|
+
type: e,
|
|
620
|
+
isActive: r === e,
|
|
621
|
+
onSelect: i
|
|
622
|
+
}, e)), t[0] = r, t[1] = n, t[2] = i, t[3] = a) : a = t[3];
|
|
623
|
+
let o;
|
|
624
|
+
return t[4] === a ? o = t[5] : (o = /* @__PURE__ */ w(C, { children: a }), t[4] = a, t[5] = o), o;
|
|
625
|
+
};
|
|
626
|
+
//#endregion
|
|
627
|
+
//#region ../../libraries/rich-text-editor/dist/features/formatting/actions/marks.js
|
|
628
|
+
function Z(e) {
|
|
629
|
+
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
630
|
+
}
|
|
631
|
+
var Q = ({ type: e, ...t }) => q({
|
|
632
|
+
checkCanExecute: (t) => !t || !t.isEditable || !ct(e, t) ? !1 : t.can().toggleMark(e),
|
|
633
|
+
checkIsActive: (t) => !t || !t.isEditable ? !1 : t.isActive(e),
|
|
634
|
+
checkIsVisible: (t) => !(!t || !t.isEditable || !ct(e, t)),
|
|
635
|
+
execute: (t) => !t || !t.isEditable ? !1 : t.chain().focus().toggleMark(e).run(),
|
|
636
|
+
...t
|
|
637
|
+
}), Ot = Q({
|
|
638
|
+
label: Z("bold"),
|
|
639
|
+
Icon: W,
|
|
640
|
+
shortcutsKeys: "mod+b",
|
|
641
|
+
type: "bold"
|
|
642
|
+
}), kt = Q({
|
|
643
|
+
label: Z("italic"),
|
|
644
|
+
Icon: ue,
|
|
645
|
+
shortcutsKeys: "mod+i",
|
|
646
|
+
type: "italic"
|
|
647
|
+
}), At = Q({
|
|
648
|
+
label: Z("strike"),
|
|
649
|
+
Icon: _e,
|
|
650
|
+
shortcutsKeys: "mod+shift+s",
|
|
651
|
+
type: "strike"
|
|
652
|
+
}), jt = Q({
|
|
653
|
+
label: Z("code"),
|
|
654
|
+
Icon: K,
|
|
655
|
+
shortcutsKeys: "mod+e",
|
|
656
|
+
type: "code"
|
|
657
|
+
}), Mt = Q({
|
|
658
|
+
label: Z("underline"),
|
|
659
|
+
Icon: xe,
|
|
660
|
+
shortcutsKeys: "mod+u",
|
|
661
|
+
type: "underline"
|
|
662
|
+
}), Nt = Q({
|
|
663
|
+
label: Z("superscript"),
|
|
664
|
+
Icon: ye,
|
|
665
|
+
shortcutsKeys: "mod+.",
|
|
666
|
+
type: "superscript"
|
|
667
|
+
}), Pt = Q({
|
|
668
|
+
label: Z("subscript"),
|
|
669
|
+
Icon: ve,
|
|
670
|
+
shortcutsKeys: "mod+,",
|
|
671
|
+
type: "subscript"
|
|
672
|
+
}), Ft = q({
|
|
673
|
+
label: "Get URL",
|
|
674
|
+
execute: (e) => e && e.getAttributes("link").href || null
|
|
675
|
+
}), It = q({
|
|
676
|
+
label: "Set link",
|
|
677
|
+
Icon: de,
|
|
678
|
+
checkIsActive: (e) => !!e?.isActive("link"),
|
|
679
|
+
checkIsVisible: (e) => !!e?.isEditable,
|
|
680
|
+
checkCanExecute: (e) => !!e?.isEditable,
|
|
681
|
+
execute: (e, t) => {
|
|
682
|
+
!e || !t?.url || e.chain().focus().extendMarkRange("link").setLink({ href: t.url }).run();
|
|
683
|
+
}
|
|
684
|
+
}), Lt = q({
|
|
685
|
+
label: "Remove link",
|
|
686
|
+
Icon: Se,
|
|
687
|
+
checkIsVisible: (e) => !!e?.isEditable && e.isActive("link"),
|
|
688
|
+
checkCanExecute: (e) => !!e?.isEditable && e.isActive("link"),
|
|
689
|
+
execute: (e) => {
|
|
690
|
+
e && e.chain().focus().extendMarkRange("link").unsetLink().run();
|
|
691
|
+
}
|
|
692
|
+
}), Rt = q({
|
|
693
|
+
label: "Open link",
|
|
694
|
+
Icon: re,
|
|
695
|
+
execute: (e, t) => {
|
|
696
|
+
t?.url && window.open(t.url, "_blank", "noopener,noreferrer");
|
|
697
|
+
}
|
|
698
|
+
}), zt = (e) => {
|
|
699
|
+
let t = E(36), { editor: n, url: r, setLink: i, removeLink: a, isActive: o } = e, [s, c] = S(r), l;
|
|
700
|
+
t[0] !== s || t[1] !== i ? (l = (e) => {
|
|
701
|
+
e.key === "Enter" && (e.preventDefault(), i(s));
|
|
702
|
+
}, t[0] = s, t[1] = i, t[2] = l) : l = t[2];
|
|
703
|
+
let u = l, d;
|
|
704
|
+
t[3] === a ? d = t[4] : (d = () => {
|
|
705
|
+
a(), c("");
|
|
706
|
+
}, t[3] = a, t[4] = d);
|
|
707
|
+
let f = d, p;
|
|
708
|
+
t[5] !== u || t[6] !== s ? (p = /* @__PURE__ */ w(et, {
|
|
709
|
+
value: s,
|
|
710
|
+
onChange: c,
|
|
711
|
+
onKeyDown: u,
|
|
712
|
+
placeholder: "Paste a link..."
|
|
713
|
+
}), t[5] = u, t[6] = s, t[7] = p) : p = t[7];
|
|
714
|
+
let m;
|
|
715
|
+
t[8] !== s || t[9] !== i ? (m = () => i(s), t[8] = s, t[9] = i, t[10] = m) : m = t[10];
|
|
716
|
+
let h = !s && !o, g;
|
|
717
|
+
t[11] === Symbol.for("react.memo_cache_sentinel") ? (g = /* @__PURE__ */ w(ne, { size: 16 }), t[11] = g) : g = t[11];
|
|
718
|
+
let _;
|
|
719
|
+
t[12] !== m || t[13] !== h ? (_ = /* @__PURE__ */ w(Le, {
|
|
720
|
+
onClick: m,
|
|
721
|
+
tooltip: "Apply link",
|
|
722
|
+
disabled: h,
|
|
723
|
+
children: g
|
|
724
|
+
}), t[12] = m, t[13] = h, t[14] = _) : _ = t[14];
|
|
725
|
+
let v;
|
|
726
|
+
t[15] !== p || t[16] !== _ ? (v = /* @__PURE__ */ T(Re, { children: [p, _] }), t[15] = p, t[16] = _, t[17] = v) : v = t[17];
|
|
727
|
+
let y;
|
|
728
|
+
t[18] === Symbol.for("react.memo_cache_sentinel") ? (y = /* @__PURE__ */ w(ze, { orientation: "vertical" }), t[18] = y) : y = t[18];
|
|
729
|
+
let b;
|
|
730
|
+
t[19] !== n || t[20] !== s ? (b = () => Rt?.execute(n, { url: s }), t[19] = n, t[20] = s, t[21] = b) : b = t[21];
|
|
731
|
+
let x = !r && !o, C;
|
|
732
|
+
t[22] === Symbol.for("react.memo_cache_sentinel") ? (C = /* @__PURE__ */ w(re, { size: 16 }), t[22] = C) : C = t[22];
|
|
733
|
+
let D;
|
|
734
|
+
t[23] !== b || t[24] !== x ? (D = /* @__PURE__ */ w(Le, {
|
|
735
|
+
onClick: b,
|
|
736
|
+
tooltip: "Open in new window",
|
|
737
|
+
disabled: x,
|
|
738
|
+
children: C
|
|
739
|
+
}), t[23] = b, t[24] = x, t[25] = D) : D = t[25];
|
|
740
|
+
let O = !s && !o, k;
|
|
741
|
+
t[26] === Symbol.for("react.memo_cache_sentinel") ? (k = /* @__PURE__ */ w(be, { size: 16 }), t[26] = k) : k = t[26];
|
|
742
|
+
let A;
|
|
743
|
+
t[27] !== f || t[28] !== O ? (A = /* @__PURE__ */ w(Le, {
|
|
744
|
+
onClick: f,
|
|
745
|
+
tooltip: "Remove link",
|
|
746
|
+
disabled: O,
|
|
747
|
+
children: k
|
|
748
|
+
}), t[27] = f, t[28] = O, t[29] = A) : A = t[29];
|
|
749
|
+
let j;
|
|
750
|
+
t[30] !== D || t[31] !== A ? (j = /* @__PURE__ */ T(Re, { children: [D, A] }), t[30] = D, t[31] = A, t[32] = j) : j = t[32];
|
|
751
|
+
let M;
|
|
752
|
+
return t[33] !== j || t[34] !== v ? (M = /* @__PURE__ */ T(Ie, {
|
|
753
|
+
orientation: "horizontal",
|
|
754
|
+
children: [
|
|
755
|
+
v,
|
|
756
|
+
y,
|
|
757
|
+
j
|
|
758
|
+
]
|
|
759
|
+
}), t[33] = j, t[34] = v, t[35] = M) : M = t[35], M;
|
|
760
|
+
}, Bt = q({
|
|
761
|
+
label: "Reset formatting",
|
|
762
|
+
Icon: ge,
|
|
763
|
+
shortcutsKeys: "mod+r",
|
|
764
|
+
checkIsVisible: (e) => {
|
|
765
|
+
if (!e || !e.isEditable) return !1;
|
|
766
|
+
let { selection: t } = e.state;
|
|
767
|
+
if (t.empty) return !1;
|
|
768
|
+
for (let n of t.ranges) {
|
|
769
|
+
let t = !1;
|
|
770
|
+
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;
|
|
771
|
+
}
|
|
772
|
+
return !1;
|
|
773
|
+
},
|
|
774
|
+
checkCanExecute: (e) => {
|
|
775
|
+
if (!e || !e.isEditable) return !1;
|
|
776
|
+
let { selection: t } = e.state;
|
|
777
|
+
return !t.empty;
|
|
778
|
+
},
|
|
779
|
+
execute: (e, { preserveMarks: t = [] } = {}) => {
|
|
780
|
+
if (!e) return !1;
|
|
781
|
+
try {
|
|
782
|
+
let { tr: n } = e.state, { selection: r } = n;
|
|
783
|
+
return r.empty ? !1 : (r.ranges.forEach((e) => {
|
|
784
|
+
n.doc.nodesBetween(e.$from.pos, e.$to.pos, (e, r) => (e.isInline && e.marks.forEach((i) => {
|
|
785
|
+
t.includes(i.type.name) || n.removeMark(r, r + e.nodeSize, i.type);
|
|
786
|
+
}), !0));
|
|
787
|
+
}), e.view.dispatch(n), e.commands.focus(), !0);
|
|
788
|
+
} catch {
|
|
789
|
+
return !1;
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
}), Vt = "_4av8tc0", Ht = "_4av8tc1", Ut = "gn566j0", $ = (e) => {
|
|
793
|
+
let t = E(41), n, r, i, a, u, d, f, p, m, h;
|
|
794
|
+
t[0] === e ? (n = t[1], r = t[2], i = t[3], a = t[4], u = t[5], d = t[6], f = t[7], p = t[8], m = t[9], h = t[10]) : ({action: n, context: a, showLabel: f, showShortCut: p, isHovered: u, showTooltip: m, buttonProps: r, iconSize: h, className: i, ...d} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i, t[4] = a, t[5] = u, t[6] = d, t[7] = f, t[8] = p, t[9] = m, t[10] = h);
|
|
795
|
+
let g = m === void 0 ? !0 : m, _ = h === void 0 ? 16 : h, { editor: v } = j(), { isActive: y, isVisible: b, canExecute: x, execute: S, Icon: C, label: O, shortcutsKeys: k } = He(v, n, a), A = !b || !x, M = y || u, N = !g || !O, P = M && "gn566j1", F;
|
|
796
|
+
t[11] !== i || t[12] !== P ? (F = D(Ut, P, i), t[11] = i, t[12] = P, t[13] = F) : F = t[13];
|
|
797
|
+
let I;
|
|
798
|
+
t[14] !== a || t[15] !== S ? (I = () => S(a), t[14] = a, t[15] = S, t[16] = I) : I = t[16];
|
|
799
|
+
let L;
|
|
800
|
+
t[17] !== C || t[18] !== _ ? (L = C && /* @__PURE__ */ w(C, { size: _ }), t[17] = C, t[18] = _, t[19] = L) : L = t[19];
|
|
801
|
+
let R;
|
|
802
|
+
t[20] !== O || t[21] !== f ? (R = f && /* @__PURE__ */ w("span", { children: O }), t[20] = O, t[21] = f, t[22] = R) : R = t[22];
|
|
803
|
+
let z;
|
|
804
|
+
t[23] !== k || t[24] !== p ? (z = p && /* @__PURE__ */ w(Xe, { shortcutKeys: k }), t[23] = k, t[24] = p, t[25] = z) : z = t[25];
|
|
805
|
+
let B;
|
|
806
|
+
t[26] !== r || t[27] !== A || t[28] !== d || t[29] !== F || t[30] !== I || t[31] !== L || t[32] !== R || t[33] !== z ? (B = /* @__PURE__ */ w(o, {
|
|
807
|
+
onPointerDown: Wt,
|
|
808
|
+
render: /* @__PURE__ */ T(l, {
|
|
809
|
+
type: "button",
|
|
810
|
+
role: "button",
|
|
811
|
+
tabIndex: -1,
|
|
812
|
+
variant: "ghost",
|
|
813
|
+
size: "sm",
|
|
814
|
+
disabled: A,
|
|
815
|
+
className: F,
|
|
816
|
+
onPointerDown: Gt,
|
|
817
|
+
onClick: I,
|
|
818
|
+
...d,
|
|
819
|
+
...r,
|
|
820
|
+
children: [
|
|
821
|
+
L,
|
|
822
|
+
R,
|
|
823
|
+
z
|
|
824
|
+
]
|
|
825
|
+
})
|
|
826
|
+
}), t[26] = r, t[27] = A, t[28] = d, t[29] = F, t[30] = I, t[31] = L, t[32] = R, t[33] = z, t[34] = B) : B = t[34];
|
|
827
|
+
let V;
|
|
828
|
+
t[35] === O ? V = t[36] : (V = /* @__PURE__ */ w(s, { children: O }), t[35] = O, t[36] = V);
|
|
829
|
+
let H;
|
|
830
|
+
return t[37] !== B || t[38] !== V || t[39] !== N ? (H = /* @__PURE__ */ T(c, {
|
|
831
|
+
disabled: N,
|
|
832
|
+
children: [B, V]
|
|
833
|
+
}), t[37] = B, t[38] = V, t[39] = N, t[40] = H) : H = t[40], H;
|
|
834
|
+
};
|
|
835
|
+
function Wt(e) {
|
|
836
|
+
return e.preventDefault();
|
|
837
|
+
}
|
|
838
|
+
function Gt(e) {
|
|
839
|
+
return e.preventDefault();
|
|
840
|
+
}
|
|
841
|
+
//#endregion
|
|
842
|
+
//#region ../../libraries/rich-text-editor/dist/features/core/actions/undoRedo.js
|
|
843
|
+
var Kt = "mod+z", qt = "mod+shift+z", Jt = ({ action: e, ...t }) => q({
|
|
844
|
+
checkIsVisible: (t) => !!(t?.isEditable && (e === "undo" ? t.can().undo() : t.can().redo())),
|
|
845
|
+
checkCanExecute: (t) => !t || !t.isEditable ? !1 : e === "undo" ? t.can().undo() : t.can().redo(),
|
|
846
|
+
execute: (t) => t ? e === "undo" ? t.chain().focus().undo().run() : t.chain().focus().redo().run() : !1,
|
|
847
|
+
...t
|
|
848
|
+
}), Yt = Jt({
|
|
849
|
+
label: "Undo",
|
|
850
|
+
Icon: U,
|
|
851
|
+
shortcutsKeys: Kt,
|
|
852
|
+
action: "undo"
|
|
853
|
+
}), Xt = Jt({
|
|
854
|
+
label: "Redo",
|
|
855
|
+
Icon: te,
|
|
856
|
+
shortcutsKeys: qt,
|
|
857
|
+
action: "redo"
|
|
858
|
+
}), Zt = (e) => {
|
|
859
|
+
let t = E(16), { editor: n } = e, [r, i] = S(!1), { execute: a, isActive: o } = He(n, It), s;
|
|
860
|
+
t[0] === n ? s = t[1] : (s = Ft.execute(n), t[0] = n, t[1] = s);
|
|
861
|
+
let c = s, l;
|
|
862
|
+
t[2] === a ? l = t[3] : (l = (e) => {
|
|
863
|
+
a({ url: e }), i(!1);
|
|
864
|
+
}, t[2] = a, t[3] = l);
|
|
865
|
+
let u = l, h;
|
|
866
|
+
t[4] === n ? h = t[5] : (h = () => {
|
|
867
|
+
Lt.execute(n), i(!1);
|
|
868
|
+
}, t[4] = n, t[5] = h);
|
|
869
|
+
let g = h, _;
|
|
870
|
+
t[6] === Symbol.for("react.memo_cache_sentinel") ? (_ = /* @__PURE__ */ w(p, {
|
|
871
|
+
onPointerDown: Qt,
|
|
872
|
+
render: /* @__PURE__ */ w($, {
|
|
873
|
+
action: It,
|
|
874
|
+
onClick: (e) => {
|
|
875
|
+
e.preventDefault(), i(!0);
|
|
876
|
+
}
|
|
877
|
+
})
|
|
878
|
+
}), t[6] = _) : _ = t[6];
|
|
879
|
+
let v = c || "", y;
|
|
880
|
+
t[7] !== n || t[8] !== g || t[9] !== u || t[10] !== o || t[11] !== v ? (y = /* @__PURE__ */ w(d, { children: /* @__PURE__ */ w(m, {
|
|
881
|
+
side: "bottom",
|
|
882
|
+
align: "center",
|
|
883
|
+
children: /* @__PURE__ */ w(zt, {
|
|
884
|
+
editor: n,
|
|
885
|
+
url: v,
|
|
886
|
+
setLink: u,
|
|
887
|
+
removeLink: g,
|
|
888
|
+
isActive: o
|
|
889
|
+
})
|
|
890
|
+
}) }), t[7] = n, t[8] = g, t[9] = u, t[10] = o, t[11] = v, t[12] = y) : y = t[12];
|
|
891
|
+
let b;
|
|
892
|
+
return t[13] !== r || t[14] !== y ? (b = /* @__PURE__ */ T(f, {
|
|
893
|
+
open: r,
|
|
894
|
+
onOpenChange: i,
|
|
895
|
+
children: [_, y]
|
|
896
|
+
}), t[13] = r, t[14] = y, t[15] = b) : b = t[15], b;
|
|
897
|
+
};
|
|
898
|
+
function Qt(e) {
|
|
899
|
+
return e.preventDefault();
|
|
900
|
+
}
|
|
901
|
+
//#endregion
|
|
902
|
+
//#region ../../libraries/rich-text-editor/dist/editors/components/toolbar/ToolbarTurnIntoMenu.js
|
|
903
|
+
var $t = ({ editor: e, blockTypes: t }) => {
|
|
904
|
+
let [n, r] = S(!1), i = Et(t), a = N({
|
|
905
|
+
editor: e,
|
|
906
|
+
selector: ({ editor: e }) => Ct.find((t) => X[t]?.checkIsActive?.(e)) || null
|
|
907
|
+
}), o = a ? X[a].Icon : me, s = a ? X[a].label : "Turn Into", c = b(() => i?.some((t) => X[t]?.checkCanExecute?.(e) ?? !1), [e, i]), l = b(() => q({
|
|
908
|
+
label: s,
|
|
909
|
+
Icon: (e) => /* @__PURE__ */ T("div", {
|
|
910
|
+
className: Ht,
|
|
911
|
+
children: [o && /* @__PURE__ */ w(o, { ...e }), /* @__PURE__ */ w(G, { size: 12 })]
|
|
912
|
+
}),
|
|
913
|
+
checkIsVisible: () => !0,
|
|
914
|
+
checkCanExecute: () => !!c,
|
|
915
|
+
execute: () => {}
|
|
916
|
+
}), [
|
|
917
|
+
s,
|
|
918
|
+
o,
|
|
919
|
+
c
|
|
920
|
+
]);
|
|
921
|
+
return e ? /* @__PURE__ */ T(f, {
|
|
922
|
+
open: n,
|
|
923
|
+
onOpenChange: r,
|
|
924
|
+
children: [/* @__PURE__ */ w(p, {
|
|
925
|
+
onPointerDown: (e) => e.preventDefault(),
|
|
926
|
+
render: /* @__PURE__ */ w($, {
|
|
927
|
+
action: l,
|
|
928
|
+
onClick: (e) => {
|
|
929
|
+
e.preventDefault(), r(!0);
|
|
930
|
+
}
|
|
931
|
+
})
|
|
932
|
+
}), /* @__PURE__ */ w(d, { children: /* @__PURE__ */ w(m, {
|
|
933
|
+
side: "bottom",
|
|
934
|
+
align: "start",
|
|
935
|
+
children: /* @__PURE__ */ w(Ie, {
|
|
936
|
+
orientation: "vertical",
|
|
937
|
+
children: /* @__PURE__ */ w(Dt, {
|
|
938
|
+
activeType: a,
|
|
939
|
+
blockTypes: i,
|
|
940
|
+
onSelect: () => r(!1)
|
|
941
|
+
})
|
|
942
|
+
})
|
|
943
|
+
}) })]
|
|
944
|
+
}) : null;
|
|
945
|
+
}, en = "_1vx76w30", tn = () => {
|
|
946
|
+
let e = E(25), { editor: t } = j();
|
|
947
|
+
if (!t) return null;
|
|
948
|
+
let n;
|
|
949
|
+
e[0] === t ? n = e[1] : (n = /* @__PURE__ */ w($t, { editor: t }), e[0] = t, e[1] = n);
|
|
950
|
+
let r, i, a, o, s, c, l, u, d;
|
|
951
|
+
e[2] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ w(_, { orientation: "vertical" }), i = /* @__PURE__ */ w($, { action: Ot }), a = /* @__PURE__ */ w($, { action: kt }), o = /* @__PURE__ */ w($, { action: Mt }), s = /* @__PURE__ */ w($, { action: At }), c = /* @__PURE__ */ w($, { action: jt }), l = /* @__PURE__ */ w($, { action: Nt }), u = /* @__PURE__ */ w($, { action: Pt }), d = /* @__PURE__ */ w(_, { orientation: "vertical" }), e[2] = r, e[3] = i, e[4] = a, e[5] = o, e[6] = s, e[7] = c, e[8] = l, e[9] = u, e[10] = d) : (r = e[2], i = e[3], a = e[4], o = e[5], s = e[6], c = e[7], l = e[8], u = e[9], d = e[10]);
|
|
952
|
+
let f;
|
|
953
|
+
e[11] === t ? f = e[12] : (f = /* @__PURE__ */ w(Zt, { editor: t }), e[11] = t, e[12] = f);
|
|
954
|
+
let p, m, h, g, v, y, b, x, S;
|
|
955
|
+
e[13] === Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ w(_, { orientation: "vertical" }), m = /* @__PURE__ */ w($, { action: it }), h = /* @__PURE__ */ w($, { action: at }), g = /* @__PURE__ */ w($, { action: ot }), v = /* @__PURE__ */ w($, { action: st }), y = /* @__PURE__ */ w(_, { orientation: "vertical" }), b = /* @__PURE__ */ w($, { action: Bt }), x = /* @__PURE__ */ w($, { action: Yt }), S = /* @__PURE__ */ w($, { action: Xt }), e[13] = p, e[14] = m, e[15] = h, e[16] = g, e[17] = v, e[18] = y, e[19] = b, e[20] = x, e[21] = S) : (p = e[13], m = e[14], h = e[15], g = e[16], v = e[17], y = e[18], b = e[19], x = e[20], S = e[21]);
|
|
956
|
+
let C;
|
|
957
|
+
return e[22] !== n || e[23] !== f ? (C = /* @__PURE__ */ T("div", {
|
|
958
|
+
className: Vt,
|
|
959
|
+
children: [
|
|
960
|
+
n,
|
|
961
|
+
r,
|
|
962
|
+
i,
|
|
963
|
+
a,
|
|
964
|
+
o,
|
|
965
|
+
s,
|
|
966
|
+
c,
|
|
967
|
+
l,
|
|
968
|
+
u,
|
|
969
|
+
d,
|
|
970
|
+
f,
|
|
971
|
+
p,
|
|
972
|
+
m,
|
|
973
|
+
h,
|
|
974
|
+
g,
|
|
975
|
+
v,
|
|
976
|
+
y,
|
|
977
|
+
b,
|
|
978
|
+
x,
|
|
979
|
+
S
|
|
980
|
+
]
|
|
981
|
+
}), e[22] = n, e[23] = f, e[24] = C) : C = e[24], C;
|
|
982
|
+
}, nn = (e = { placeholder: "Write something ..." }) => [
|
|
983
|
+
ke.configure({
|
|
984
|
+
blockquote: !1,
|
|
985
|
+
codeBlock: !1,
|
|
986
|
+
horizontalRule: !1,
|
|
987
|
+
dropcursor: { width: 2 },
|
|
988
|
+
link: {
|
|
989
|
+
openOnClick: !1,
|
|
990
|
+
HTMLAttributes: { target: "_blank" }
|
|
991
|
+
}
|
|
992
|
+
}),
|
|
993
|
+
De.configure({ placeholder: e?.placeholder }),
|
|
994
|
+
Te,
|
|
995
|
+
Oe,
|
|
996
|
+
we,
|
|
997
|
+
Ce,
|
|
998
|
+
r,
|
|
999
|
+
Ee.configure({ types: [
|
|
1000
|
+
"paragraph",
|
|
1001
|
+
"heading",
|
|
1002
|
+
"bulletList",
|
|
1003
|
+
"orderedList"
|
|
1004
|
+
] })
|
|
1005
|
+
], rn = "bkiyfq0", an = "bkiyfq1", on = (e) => {
|
|
1006
|
+
let t = E(14), { editorState: r, onChange: i, className: a, placeholder: o, editable: s } = e, c = o === void 0 ? "Write something ..." : o, l = s === void 0 ? !0 : s, u;
|
|
1007
|
+
t[0] === c ? u = t[1] : (u = nn({ placeholder: c }), t[0] = c, t[1] = u);
|
|
1008
|
+
let d = r?.json ? r?.json : r?.html, f;
|
|
1009
|
+
t[2] === a ? f = t[3] : (f = D(n, a), t[2] = a, t[3] = f);
|
|
1010
|
+
let p;
|
|
1011
|
+
t[4] === f ? p = t[5] : (p = { attributes: {
|
|
1012
|
+
autocomplete: "off",
|
|
1013
|
+
autocorrect: "off",
|
|
1014
|
+
autocapitalize: "off",
|
|
1015
|
+
class: f
|
|
1016
|
+
} }, t[4] = f, t[5] = p);
|
|
1017
|
+
let m;
|
|
1018
|
+
t[6] === i ? m = t[7] : (m = (e) => {
|
|
1019
|
+
let { editor: t } = e;
|
|
1020
|
+
i?.(t);
|
|
1021
|
+
}, t[6] = i, t[7] = m);
|
|
1022
|
+
let h;
|
|
1023
|
+
return t[8] !== l || t[9] !== u || t[10] !== d || t[11] !== p || t[12] !== m ? (h = {
|
|
1024
|
+
extensions: u,
|
|
1025
|
+
content: d,
|
|
1026
|
+
editable: l,
|
|
1027
|
+
editorProps: p,
|
|
1028
|
+
onUpdate: m,
|
|
1029
|
+
immediatelyRender: !1
|
|
1030
|
+
}, t[8] = l, t[9] = u, t[10] = d, t[11] = p, t[12] = m, t[13] = h) : h = t[13], M(h);
|
|
1031
|
+
}, sn = (t) => {
|
|
1032
|
+
let n = E(22), { editor: r, className: i, theme: o } = t;
|
|
1033
|
+
if (!r) return null;
|
|
1034
|
+
let s;
|
|
1035
|
+
n[0] === r ? s = n[1] : (s = { editor: r }, n[0] = r, n[1] = s);
|
|
1036
|
+
let c;
|
|
1037
|
+
n[2] === i ? c = n[3] : (c = D(rn, i), n[2] = i, n[3] = c);
|
|
1038
|
+
let l, u;
|
|
1039
|
+
n[4] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ w(tn, {}), u = /* @__PURE__ */ w(_, { orientation: "horizontal" }), n[4] = l, n[5] = u) : (l = n[4], u = n[5]);
|
|
1040
|
+
let d;
|
|
1041
|
+
n[6] === r.commands ? d = n[7] : (d = () => r.commands.focus(), n[6] = r.commands, n[7] = d);
|
|
1042
|
+
let f;
|
|
1043
|
+
n[8] === r ? f = n[9] : (f = /* @__PURE__ */ w(k, { editor: r }), n[8] = r, n[9] = f);
|
|
1044
|
+
let p;
|
|
1045
|
+
n[10] !== d || n[11] !== f ? (p = /* @__PURE__ */ w("div", {
|
|
1046
|
+
className: an,
|
|
1047
|
+
onClick: d,
|
|
1048
|
+
children: f
|
|
1049
|
+
}), n[10] = d, n[11] = f, n[12] = p) : p = n[12];
|
|
1050
|
+
let m;
|
|
1051
|
+
n[13] !== c || n[14] !== p ? (m = /* @__PURE__ */ T("div", {
|
|
1052
|
+
className: c,
|
|
1053
|
+
children: [
|
|
1054
|
+
l,
|
|
1055
|
+
u,
|
|
1056
|
+
p
|
|
1057
|
+
]
|
|
1058
|
+
}), n[13] = c, n[14] = p, n[15] = m) : m = n[15];
|
|
1059
|
+
let h;
|
|
1060
|
+
n[16] !== s || n[17] !== m ? (h = /* @__PURE__ */ w(a, { children: /* @__PURE__ */ w(A.Provider, {
|
|
1061
|
+
value: s,
|
|
1062
|
+
children: m
|
|
1063
|
+
}) }), n[16] = s, n[17] = m, n[18] = h) : h = n[18];
|
|
1064
|
+
let g;
|
|
1065
|
+
return n[19] !== h || n[20] !== o ? (g = /* @__PURE__ */ w(e, {
|
|
1066
|
+
theme: o,
|
|
1067
|
+
children: h
|
|
1068
|
+
}), n[19] = h, n[20] = o, n[21] = g) : g = n[21], g;
|
|
1069
|
+
}, cn = (e) => {
|
|
1070
|
+
let t = E(45), { field: n } = e, [r, i] = S(!1), { key: a, label: o, helper_text: s, readonly: c } = n, l = a === void 0 ? "" : a, d = o === void 0 ? "" : o, f = s === void 0 ? "" : s, p = c === void 0 ? !1 : c, m = l, h;
|
|
1071
|
+
t[0] === n ? h = t[1] : (h = u(n), t[0] = n, t[1] = h);
|
|
1072
|
+
let g;
|
|
1073
|
+
t[2] !== m || t[3] !== h ? (g = {
|
|
1074
|
+
name: m,
|
|
1075
|
+
rules: h
|
|
1076
|
+
}, t[2] = m, t[3] = h, t[4] = g) : g = t[4];
|
|
1077
|
+
let { field: _, fieldState: b } = Ae(g), { value: x, onBlur: C, onChange: T, disabled: O } = _, k = !!n?.required, A = b?.error?.message, j;
|
|
1078
|
+
t[5] === x ? j = t[6] : (j = { html: x }, t[5] = x, t[6] = j);
|
|
1079
|
+
let M = !O && !p, N;
|
|
1080
|
+
t[7] === T ? N = t[8] : (N = (e) => {
|
|
1081
|
+
T(e.getHTML());
|
|
1082
|
+
}, t[7] = T, t[8] = N);
|
|
1083
|
+
let P;
|
|
1084
|
+
t[9] !== N || t[10] !== j || t[11] !== M ? (P = {
|
|
1085
|
+
editorState: j,
|
|
1086
|
+
editable: M,
|
|
1087
|
+
onChange: N
|
|
1088
|
+
}, t[9] = N, t[10] = j, t[11] = M, t[12] = P) : P = t[12];
|
|
1089
|
+
let F = on(P), I;
|
|
1090
|
+
t[13] !== F || t[14] !== r || t[15] !== x ? (I = () => {
|
|
1091
|
+
F?.commands && !r && (F.commands.setContent(x || ""), i(!0));
|
|
1092
|
+
}, t[13] = F, t[14] = r, t[15] = x, t[16] = I) : I = t[16];
|
|
1093
|
+
let L;
|
|
1094
|
+
t[17] === x ? L = t[18] : (L = [x], t[17] = x, t[18] = L), y(I, L);
|
|
1095
|
+
let R, z;
|
|
1096
|
+
t[19] !== O || t[20] !== F || t[21] !== p ? (R = () => {
|
|
1097
|
+
F && F.setEditable(!O && !p);
|
|
1098
|
+
}, z = [
|
|
1099
|
+
F,
|
|
1100
|
+
O,
|
|
1101
|
+
p
|
|
1102
|
+
], t[19] = O, t[20] = F, t[21] = p, t[22] = R, t[23] = z) : (R = t[22], z = t[23]), y(R, z);
|
|
1103
|
+
let B, V;
|
|
1104
|
+
t[24] !== F || t[25] !== C ? (B = () => {
|
|
1105
|
+
if (F) return F.on("blur", C), () => {
|
|
1106
|
+
F.off("blur", C);
|
|
1107
|
+
};
|
|
1108
|
+
}, V = [F, C], t[24] = F, t[25] = C, t[26] = B, t[27] = V) : (B = t[26], V = t[27]), y(B, V);
|
|
1109
|
+
let H = O && "_1vx76w31", ee = p && "_1vx76w32", U;
|
|
1110
|
+
t[28] !== H || t[29] !== ee ? (U = D(en, H, ee), t[28] = H, t[29] = ee, t[30] = U) : U = t[30];
|
|
1111
|
+
let te;
|
|
1112
|
+
t[31] === Symbol.for("react.memo_cache_sentinel") ? (te = { style: je({ baseSpacing: ".875rem" }) }, t[31] = te) : te = t[31];
|
|
1113
|
+
let W;
|
|
1114
|
+
t[32] === F ? W = t[33] : (W = /* @__PURE__ */ w(sn, {
|
|
1115
|
+
editor: F,
|
|
1116
|
+
theme: te
|
|
1117
|
+
}), t[32] = F, t[33] = W);
|
|
1118
|
+
let G;
|
|
1119
|
+
t[34] !== U || t[35] !== W ? (G = /* @__PURE__ */ w("div", {
|
|
1120
|
+
className: U,
|
|
1121
|
+
children: W
|
|
1122
|
+
}), t[34] = U, t[35] = W, t[36] = G) : G = t[36];
|
|
1123
|
+
let K;
|
|
1124
|
+
return t[37] !== A || t[38] !== f || t[39] !== k || t[40] !== d || t[41] !== m || t[42] !== p || t[43] !== G ? (K = /* @__PURE__ */ w(v, {
|
|
1125
|
+
error: A,
|
|
1126
|
+
helperText: f,
|
|
1127
|
+
readOnly: p,
|
|
1128
|
+
label: d,
|
|
1129
|
+
htmlFor: m,
|
|
1130
|
+
isRequired: k,
|
|
1131
|
+
children: G
|
|
1132
|
+
}), t[37] = A, t[38] = f, t[39] = k, t[40] = d, t[41] = m, t[42] = p, t[43] = G, t[44] = K) : K = t[44], K;
|
|
1133
|
+
};
|
|
1134
|
+
//#endregion
|
|
1135
|
+
export { cn as RichTextWidget, cn as default };
|