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