@levo-so/site-runtime 0.3.8 → 0.3.9
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/{DateTimeWidget-hFjcn3o6.js → DateTimeWidget-LfaosVVW.js} +1 -1
- package/{KBChatWidget-ClHFDgJ5.js → KBChatWidget-CuAtGhHT.js} +11 -10
- package/{PopupBody-DZVwDLkg-Cfy3lWGs.js → PopupBody-BI-MJqmd-C0qNyN7V.js} +285 -168
- package/PopupRenderer-D66Gx63H-C6RnOnl2.js +388 -0
- package/{RichTextWidget-DkKHEq4j.js → RichTextWidget-BFWVevY7.js} +3 -3
- package/{dist-DPmVG7VB.js → dist-Rjs__H25.js} +3 -3
- package/{dist-CRDgdAkQ.js → dist-orLT2eNz.js} +498 -466
- package/index.d.ts +511 -0
- package/index.js +925 -783
- package/{kbChat-C00LVlxP.js → kbChat-L55effMi.js} +2 -2
- package/package.json +37 -27
- package/popups.js +1 -1
- package/routes-CyKmkoRM.js +316 -0
- package/start.d.ts +38 -0
- package/start.js +19 -0
- package/styles.css +1 -1
- package/{usePopupRedirect-BThP_YPW-COUseDik.js → usePopupRedirect-CAAdcpaW-D9XoiVhG.js} +15 -13
- package/PopupRenderer-BjW1jg70-W2y-PEPH.js +0 -387
- /package/{PhoneWidget-BmBO-kvA.js → PhoneWidget-D-CcDuie.js} +0 -0
- /package/{Popover-3N88sRp4.js → Popover-BTdlOQP_.js} +0 -0
- /package/{es-CztjLuNy.js → es-Bj3CsMJz.js} +0 -0
- /package/{nodeAlignment-BnJljFlw.js → nodeAlignment-COvc-rIj.js} +0 -0
- /package/{pillChrome-BAu5AfCT.js → pillChrome-uieiq_SK.js} +0 -0
- /package/{popupState-JmpeKzgM-qhNTV79U.js → popupState-JmpeKzgM-D_77LiAa.js} +0 -0
- /package/{react-CV3jf2mc.js → react-B9yvlbH0.js} +0 -0
- /package/{rteTheme.cssm-xg0gJ28J.js → rteTheme.cssm-CaRzrwtu.js} +0 -0
|
@@ -1,42 +1,45 @@
|
|
|
1
1
|
import { r as e } from "./ThemeProvider-DutrjSTF.js";
|
|
2
|
-
import { t } from "./LevoProvider-Bsjkcwc8.js";
|
|
2
|
+
import { n as t } from "./LevoProvider-Bsjkcwc8.js";
|
|
3
3
|
import { i as n, r, t as i } from "./Dialog-dT7y641z.js";
|
|
4
4
|
import { t as a } from "./inlineCollectionTheme-CWcMCUti.js";
|
|
5
|
-
import {
|
|
6
|
-
import { n as p, r as m, t as h } from "./nodeAlignment-
|
|
5
|
+
import { c as o, g as s, h as c, i as l, m as u, r as d, u as f } from "./usePopupRedirect-CAAdcpaW-D9XoiVhG.js";
|
|
6
|
+
import { n as p, r as m, t as h } from "./nodeAlignment-COvc-rIj.js";
|
|
7
7
|
import { c as ee } from "react/compiler-runtime";
|
|
8
8
|
import g from "clsx";
|
|
9
9
|
import { Fragment as te, jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
10
|
-
import y, { Suspense as
|
|
11
|
-
import { IconCheck as
|
|
12
|
-
import { Extension as
|
|
13
|
-
import { DOMParser as
|
|
10
|
+
import y, { Suspense as ne, lazy as b, useMemo as x, useState as re } from "react";
|
|
11
|
+
import { IconCheck as ie, IconCopy as ae } from "@tabler/icons-react";
|
|
12
|
+
import { Extension as S, Mark as C, Node as w, extensions as T, getAttributesFromExtensions as E, getExtensionField as D, getSchema as O, getSchemaByResolvedExtensions as k, getStyleProperty as A, markInputRule as j, markPasteRule as M, mergeAttributes as N, resolveExtensions as oe, splitExtensions as se, textblockTypeInputRule as ce } from "@tiptap/core";
|
|
13
|
+
import { DOMParser as le, Node as P, Schema as ue } from "@tiptap/pm/model";
|
|
14
14
|
import { jsx as F } from "@tiptap/core/jsx-runtime";
|
|
15
|
-
import { BulletList as
|
|
16
|
-
import { Color as
|
|
17
|
-
import { Document as
|
|
18
|
-
import { Link as
|
|
19
|
-
import { Subscript as
|
|
20
|
-
import { Superscript as
|
|
21
|
-
import { Typography as
|
|
22
|
-
import { UniqueID as
|
|
23
|
-
//#region ../../node_modules/.pnpm/@tiptap+html@3.
|
|
24
|
-
function
|
|
15
|
+
import { BulletList as de, ListItem as fe, OrderedList as pe } from "@tiptap/extension-list";
|
|
16
|
+
import { Color as me, TextStyle as he } from "@tiptap/extension-text-style";
|
|
17
|
+
import { Document as ge } from "@tiptap/extension-document";
|
|
18
|
+
import { Link as I } from "@tiptap/extension-link";
|
|
19
|
+
import { Subscript as L } from "@tiptap/extension-subscript";
|
|
20
|
+
import { Superscript as _e } from "@tiptap/extension-superscript";
|
|
21
|
+
import { Typography as ve } from "@tiptap/extension-typography";
|
|
22
|
+
import { UniqueID as ye } from "@tiptap/extension-unique-id";
|
|
23
|
+
//#region ../../node_modules/.pnpm/@tiptap+html@3.30.0_@tiptap+core@3.30.0_@tiptap+pm@3.30.0__@tiptap+pm@3.30.0_happy-dom@20.9.0/node_modules/@tiptap/html/dist/index.js
|
|
24
|
+
function be(e, t, n) {
|
|
25
25
|
if (typeof window > "u") throw Error("generateJSON can only be used in a browser environment\nIf you want to use this in a Node environment, use the `@tiptap/html/server` import instead.");
|
|
26
26
|
let r = O(t), i = new window.DOMParser().parseFromString(e, "text/html");
|
|
27
27
|
if (!i) throw Error("Failed to parse HTML string");
|
|
28
|
-
return
|
|
28
|
+
return le.fromSchema(r).parse(i.body, n).toJSON();
|
|
29
29
|
}
|
|
30
30
|
//#endregion
|
|
31
|
-
//#region ../../node_modules/.pnpm/@tiptap+static-renderer@3.
|
|
32
|
-
function
|
|
31
|
+
//#region ../../node_modules/.pnpm/@tiptap+static-renderer@3.30.0_@tiptap+core@3.30.0_@tiptap+pm@3.30.0__@tiptap+pm@3.30.0_32db194579d7d1b9da503a9162bec3c3/node_modules/@tiptap/static-renderer/dist/pm/react/index.js
|
|
32
|
+
function xe(e, t, n) {
|
|
33
33
|
let r = e.attrs;
|
|
34
34
|
return r ? t.filter((t) => t.type === (typeof e.type == "string" ? e.type : e.type.name) ? n ? t.attribute.rendered : !0 : !1).map((e) => e.attribute.renderHTML && e.attribute.renderHTML(r) || { [e.name]: e.name in r ? r[e.name] : e.attribute.default }).reduce((e, t) => N(e, t), {}) : {};
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
return
|
|
36
|
+
function R(e, t) {
|
|
37
|
+
return xe(e, t, !0);
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function Se(e, t) {
|
|
40
|
+
return t?.textDirection ? [T.TextDirection.configure({ direction: t.textDirection }), ...e] : e;
|
|
41
|
+
}
|
|
42
|
+
function Ce(e, t, n, r) {
|
|
40
43
|
let i = D(t, "renderHTML", {
|
|
41
44
|
name: t.name,
|
|
42
45
|
options: t.options,
|
|
@@ -47,7 +50,7 @@ function fe(e, t, n, r) {
|
|
|
47
50
|
try {
|
|
48
51
|
return e(i({
|
|
49
52
|
node: r,
|
|
50
|
-
HTMLAttributes:
|
|
53
|
+
HTMLAttributes: R(r, n)
|
|
51
54
|
}))(a);
|
|
52
55
|
} catch (e) {
|
|
53
56
|
throw Error(`[tiptap error]: Node ${t.name} cannot be rendered, it's "renderToHTML" method threw an error: ${e.message}`, { cause: e });
|
|
@@ -56,7 +59,7 @@ function fe(e, t, n, r) {
|
|
|
56
59
|
throw Error(`[tiptap error]: Node ${t.name} cannot be rendered, it is missing a "renderToHTML" method, please implement it or override the corresponding "nodeMapping" method to have a custom rendering`);
|
|
57
60
|
}];
|
|
58
61
|
}
|
|
59
|
-
function
|
|
62
|
+
function we(e, t, n, r) {
|
|
60
63
|
let i = D(t, "renderHTML", {
|
|
61
64
|
name: t.name,
|
|
62
65
|
options: t.options,
|
|
@@ -67,7 +70,7 @@ function pe(e, t, n, r) {
|
|
|
67
70
|
try {
|
|
68
71
|
return e(i({
|
|
69
72
|
mark: r,
|
|
70
|
-
HTMLAttributes:
|
|
73
|
+
HTMLAttributes: R(r, n)
|
|
71
74
|
}))(a);
|
|
72
75
|
} catch (e) {
|
|
73
76
|
throw Error(`[tiptap error]: Mark ${t.name} cannot be rendered, it's "renderToHTML" method threw an error: ${e.message}`, { cause: e });
|
|
@@ -76,25 +79,116 @@ function pe(e, t, n, r) {
|
|
|
76
79
|
throw Error(`Node ${t.name} cannot be rendered, it is missing a "renderToHTML" method`);
|
|
77
80
|
}];
|
|
78
81
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
82
|
+
var z = "__tiptapUnhandledNode__", B = "__tiptapUnhandledMark__", V = "__originalType", H = "__originalAttrs", U = {
|
|
83
|
+
[V]: { default: "" },
|
|
84
|
+
[H]: { default: {} }
|
|
85
|
+
};
|
|
86
|
+
function Te(e, t) {
|
|
87
|
+
let n = !1, r = (e) => {
|
|
88
|
+
var i, a;
|
|
89
|
+
n || (e.type && !(e.type in t.nodes) && (n = !0), (i = e.marks) == null || i.forEach((e) => {
|
|
90
|
+
e.type && !(e.type in t.marks) && (n = !0);
|
|
91
|
+
}), (a = e.content) == null || a.forEach(r));
|
|
92
|
+
};
|
|
93
|
+
return r(e), n;
|
|
94
|
+
}
|
|
95
|
+
function Ee(e, t, n) {
|
|
96
|
+
let r = !!n?.unhandledNode, i = !!n?.unhandledMark, a = (e) => i && !(e.type in t.marks) ? {
|
|
97
|
+
type: B,
|
|
98
|
+
attrs: {
|
|
99
|
+
[V]: e.type,
|
|
100
|
+
[H]: e.attrs ?? {}
|
|
101
|
+
}
|
|
102
|
+
} : e, o = (e) => r && e.type != null && !(e.type in t.nodes), s = (e, t) => ({
|
|
103
|
+
...t,
|
|
104
|
+
type: z,
|
|
105
|
+
attrs: {
|
|
106
|
+
[V]: e.type,
|
|
107
|
+
[H]: e.attrs ?? {}
|
|
108
|
+
}
|
|
109
|
+
}), c = (e) => {
|
|
110
|
+
let t = {
|
|
111
|
+
...e,
|
|
112
|
+
marks: e.marks?.map(a),
|
|
113
|
+
content: e.content?.map(c)
|
|
114
|
+
};
|
|
115
|
+
return o(e) ? s(e, t) : t;
|
|
116
|
+
};
|
|
117
|
+
return c(e);
|
|
118
|
+
}
|
|
119
|
+
function De(e) {
|
|
120
|
+
return new ue({
|
|
121
|
+
topNode: e.spec.topNode,
|
|
122
|
+
nodes: e.spec.nodes.addToEnd(z, { attrs: U }),
|
|
123
|
+
marks: e.spec.marks.addToEnd(B, { attrs: U })
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
function Oe(e, t, n) {
|
|
127
|
+
if (e instanceof P) return e;
|
|
128
|
+
let r = k(t);
|
|
129
|
+
return Te(e, r) ? P.fromJSON(De(r), Ee(e, r, n)) : P.fromJSON(r, e);
|
|
130
|
+
}
|
|
131
|
+
function W(e) {
|
|
132
|
+
return e.type === z || e.type === B ? {
|
|
133
|
+
...e,
|
|
134
|
+
type: e.attrs[V],
|
|
135
|
+
attrs: e.attrs[H]
|
|
136
|
+
} : e;
|
|
137
|
+
}
|
|
138
|
+
function G(e) {
|
|
139
|
+
let t = W(e);
|
|
140
|
+
return {
|
|
141
|
+
...t,
|
|
142
|
+
marks: t.marks?.map((e) => W(e)),
|
|
143
|
+
content: t.content?.map(G)
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
function K(e) {
|
|
147
|
+
let t = Object.assign(/* @__PURE__ */ Object.create(null), {
|
|
148
|
+
type: { name: e.attrs[V] },
|
|
149
|
+
attrs: e.attrs[H],
|
|
150
|
+
toJSON: () => G(e.toJSON())
|
|
151
|
+
});
|
|
152
|
+
return new Proxy(e, { get(e, n) {
|
|
153
|
+
let r = t[n];
|
|
154
|
+
if (r !== void 0) return r;
|
|
155
|
+
let i = e[n];
|
|
156
|
+
return typeof i == "function" ? i.bind(e) : i;
|
|
157
|
+
} });
|
|
158
|
+
}
|
|
159
|
+
function ke(e) {
|
|
160
|
+
return (t) => e({
|
|
161
|
+
...t,
|
|
162
|
+
node: K(t.node)
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
function Ae(e) {
|
|
166
|
+
return (t) => e({
|
|
167
|
+
...t,
|
|
168
|
+
mark: K(t.mark)
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
function je({ renderer: e, domOutputSpecToElement: t, mapDefinedTypes: n, content: r, extensions: i, options: a }) {
|
|
172
|
+
i = oe(i);
|
|
173
|
+
let o = E(i), { nodeExtensions: s, markExtensions: c } = se(i), { unhandledNode: l, unhandledMark: u, nodeMapping: d, markMapping: f } = a ?? {};
|
|
174
|
+
return r = Oe(r, i, a), e({
|
|
83
175
|
...a,
|
|
84
176
|
nodeMapping: {
|
|
85
|
-
...Object.fromEntries(s.filter((e) => e.name in n ? !1 :
|
|
177
|
+
...Object.fromEntries(s.filter((e) => e.name in n ? !1 : d ? !(e.name in d) : !0).map((e) => Ce(t, e, o, a))),
|
|
86
178
|
...n,
|
|
87
|
-
...
|
|
179
|
+
...d,
|
|
180
|
+
...l ? { [z]: ke(l) } : {}
|
|
88
181
|
},
|
|
89
182
|
markMapping: {
|
|
90
|
-
...Object.fromEntries(c.filter((e) =>
|
|
91
|
-
...
|
|
183
|
+
...Object.fromEntries(c.filter((e) => f ? !(e.name in f) : !0).map((e) => we(t, e, o, a))),
|
|
184
|
+
...f,
|
|
185
|
+
...u ? { [B]: Ae(u) } : {}
|
|
92
186
|
}
|
|
93
187
|
})({ content: r });
|
|
94
188
|
}
|
|
95
|
-
function
|
|
189
|
+
function Me(e, { nodeMapping: t, markMapping: n, unhandledNode: r, unhandledMark: i }) {
|
|
96
190
|
return function a({ content: o, parent: s }) {
|
|
97
|
-
let c = typeof o.type == "string" ? o.type : o.type
|
|
191
|
+
let c = typeof o.type == "string" ? o.type : o.type?.name ?? "", l = t[c] ?? r;
|
|
98
192
|
if (!l) throw Error(`missing handler for node type ${c}`);
|
|
99
193
|
let u = e({
|
|
100
194
|
component: l,
|
|
@@ -128,10 +222,14 @@ function he(e, { nodeMapping: t, markMapping: n, unhandledNode: r, unhandledMark
|
|
|
128
222
|
}, u) : u;
|
|
129
223
|
};
|
|
130
224
|
}
|
|
131
|
-
function
|
|
225
|
+
function Ne(e) {
|
|
132
226
|
let t = 0;
|
|
133
|
-
return
|
|
227
|
+
return Me(({ component: e, props: { children: n, ...r } }) => y.createElement(e, Object.assign(r, { key: t++ }), [].concat(n)), e);
|
|
134
228
|
}
|
|
229
|
+
var Pe = {
|
|
230
|
+
colspan: "colSpan",
|
|
231
|
+
rowspan: "rowSpan"
|
|
232
|
+
};
|
|
135
233
|
function q(e, t) {
|
|
136
234
|
return e ? Object.entries(e).reduce((e, [t, n]) => {
|
|
137
235
|
if (t === "class") return Object.assign(e, { className: n });
|
|
@@ -145,7 +243,8 @@ function q(e, t) {
|
|
|
145
243
|
}
|
|
146
244
|
}), Object.assign(e, { style: t });
|
|
147
245
|
}
|
|
148
|
-
|
|
246
|
+
let r = Pe[t] ?? t;
|
|
247
|
+
return Object.assign(e, { [r]: n });
|
|
149
248
|
}, { key: t }) : { key: t };
|
|
150
249
|
}
|
|
151
250
|
function J(e, t = 0) {
|
|
@@ -158,22 +257,22 @@ function J(e, t = 0) {
|
|
|
158
257
|
}
|
|
159
258
|
throw Error("[tiptap error]: Unsupported DomOutputSpec type, check the `renderHTML` method output or implement a node mapping", { cause: e });
|
|
160
259
|
}
|
|
161
|
-
function
|
|
162
|
-
return
|
|
163
|
-
renderer:
|
|
260
|
+
function Fe({ content: e, extensions: t, staticEditorOptions: n, options: r }) {
|
|
261
|
+
return je({
|
|
262
|
+
renderer: Ne,
|
|
164
263
|
domOutputSpecToElement: J,
|
|
165
264
|
mapDefinedTypes: {
|
|
166
265
|
doc: ({ children: e }) => y.createElement(y.Fragment, {}, e),
|
|
167
266
|
text: ({ node: e }) => e.text ?? ""
|
|
168
267
|
},
|
|
169
268
|
content: e,
|
|
170
|
-
extensions: t,
|
|
171
|
-
options:
|
|
269
|
+
extensions: Se(t, n),
|
|
270
|
+
options: r
|
|
172
271
|
});
|
|
173
272
|
}
|
|
174
273
|
//#endregion
|
|
175
|
-
//#region ../../node_modules/.pnpm/@tiptap+extension-bold@3.
|
|
176
|
-
var
|
|
274
|
+
//#region ../../node_modules/.pnpm/@tiptap+extension-bold@3.30.0_@tiptap+core@3.30.0_@tiptap+pm@3.30.0_/node_modules/@tiptap/extension-bold/dist/index.js
|
|
275
|
+
var Ie = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, Le = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g, Re = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/, ze = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g, Be = C.create({
|
|
177
276
|
name: "bold",
|
|
178
277
|
addOptions() {
|
|
179
278
|
return { HTMLAttributes: {} };
|
|
@@ -223,23 +322,38 @@ var ve = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, ye = /(?:^|\s)(
|
|
|
223
322
|
},
|
|
224
323
|
addInputRules() {
|
|
225
324
|
return [j({
|
|
226
|
-
find:
|
|
325
|
+
find: Ie,
|
|
227
326
|
type: this.type
|
|
228
327
|
}), j({
|
|
229
|
-
find:
|
|
328
|
+
find: Re,
|
|
230
329
|
type: this.type
|
|
231
330
|
})];
|
|
232
331
|
},
|
|
233
332
|
addPasteRules() {
|
|
234
333
|
return [M({
|
|
235
|
-
find:
|
|
334
|
+
find: Le,
|
|
236
335
|
type: this.type
|
|
237
336
|
}), M({
|
|
238
|
-
find:
|
|
337
|
+
find: ze,
|
|
239
338
|
type: this.type
|
|
240
339
|
})];
|
|
241
340
|
}
|
|
242
|
-
}),
|
|
341
|
+
}), Ve = (e) => {
|
|
342
|
+
let t = /`([^`]+)`(?!`)$/.exec(e);
|
|
343
|
+
return !t || t.index > 0 && e[t.index - 1] === "`" ? null : {
|
|
344
|
+
index: t.index,
|
|
345
|
+
text: t[0],
|
|
346
|
+
replaceWith: t[1]
|
|
347
|
+
};
|
|
348
|
+
}, He = (e) => {
|
|
349
|
+
let t = /`([^`]+)`(?!`)/g, n = [], r;
|
|
350
|
+
for (; (r = t.exec(e)) !== null;) r.index > 0 && e[r.index - 1] === "`" || n.push({
|
|
351
|
+
index: r.index,
|
|
352
|
+
text: r[0],
|
|
353
|
+
replaceWith: r[1]
|
|
354
|
+
});
|
|
355
|
+
return n;
|
|
356
|
+
}, Ue = C.create({
|
|
243
357
|
name: "code",
|
|
244
358
|
addOptions() {
|
|
245
359
|
return { HTMLAttributes: {} };
|
|
@@ -275,17 +389,17 @@ var ve = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, ye = /(?:^|\s)(
|
|
|
275
389
|
},
|
|
276
390
|
addInputRules() {
|
|
277
391
|
return [j({
|
|
278
|
-
find:
|
|
392
|
+
find: Ve,
|
|
279
393
|
type: this.type
|
|
280
394
|
})];
|
|
281
395
|
},
|
|
282
396
|
addPasteRules() {
|
|
283
397
|
return [M({
|
|
284
|
-
find:
|
|
398
|
+
find: He,
|
|
285
399
|
type: this.type
|
|
286
400
|
})];
|
|
287
401
|
}
|
|
288
|
-
}),
|
|
402
|
+
}), We = w.create({
|
|
289
403
|
name: "hardBreak",
|
|
290
404
|
markdownTokenName: "br",
|
|
291
405
|
addOptions() {
|
|
@@ -320,7 +434,7 @@ var ve = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, ye = /(?:^|\s)(
|
|
|
320
434
|
e.ensureMarks(t);
|
|
321
435
|
}
|
|
322
436
|
return !0;
|
|
323
|
-
}).run();
|
|
437
|
+
}).scrollIntoView().run();
|
|
324
438
|
})]) };
|
|
325
439
|
},
|
|
326
440
|
addKeyboardShortcuts() {
|
|
@@ -329,7 +443,7 @@ var ve = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, ye = /(?:^|\s)(
|
|
|
329
443
|
"Shift-Enter": () => this.editor.commands.setHardBreak()
|
|
330
444
|
};
|
|
331
445
|
}
|
|
332
|
-
}),
|
|
446
|
+
}), Ge = w.create({
|
|
333
447
|
name: "heading",
|
|
334
448
|
addOptions() {
|
|
335
449
|
return {
|
|
@@ -384,13 +498,13 @@ var ve = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, ye = /(?:^|\s)(
|
|
|
384
498
|
}), {});
|
|
385
499
|
},
|
|
386
500
|
addInputRules() {
|
|
387
|
-
return this.options.levels.map((e) =>
|
|
501
|
+
return this.options.levels.map((e) => ce({
|
|
388
502
|
find: RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),
|
|
389
503
|
type: this.type,
|
|
390
504
|
getAttributes: { level: e }
|
|
391
505
|
}));
|
|
392
506
|
}
|
|
393
|
-
}),
|
|
507
|
+
}), Ke = /(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/, qe = /(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g, Je = C.create({
|
|
394
508
|
name: "highlight",
|
|
395
509
|
addOptions() {
|
|
396
510
|
return {
|
|
@@ -449,17 +563,17 @@ var ve = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, ye = /(?:^|\s)(
|
|
|
449
563
|
},
|
|
450
564
|
addInputRules() {
|
|
451
565
|
return [j({
|
|
452
|
-
find:
|
|
566
|
+
find: Ke,
|
|
453
567
|
type: this.type
|
|
454
568
|
})];
|
|
455
569
|
},
|
|
456
570
|
addPasteRules() {
|
|
457
571
|
return [M({
|
|
458
|
-
find:
|
|
572
|
+
find: qe,
|
|
459
573
|
type: this.type
|
|
460
574
|
})];
|
|
461
575
|
}
|
|
462
|
-
}),
|
|
576
|
+
}), Ye = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/, Xe = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g, Ze = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/, Qe = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g, $e = C.create({
|
|
463
577
|
name: "italic",
|
|
464
578
|
addOptions() {
|
|
465
579
|
return { HTMLAttributes: {} };
|
|
@@ -507,23 +621,23 @@ var ve = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, ye = /(?:^|\s)(
|
|
|
507
621
|
},
|
|
508
622
|
addInputRules() {
|
|
509
623
|
return [j({
|
|
510
|
-
find:
|
|
624
|
+
find: Ye,
|
|
511
625
|
type: this.type
|
|
512
626
|
}), j({
|
|
513
|
-
find:
|
|
627
|
+
find: Ze,
|
|
514
628
|
type: this.type
|
|
515
629
|
})];
|
|
516
630
|
},
|
|
517
631
|
addPasteRules() {
|
|
518
632
|
return [M({
|
|
519
|
-
find:
|
|
633
|
+
find: Xe,
|
|
520
634
|
type: this.type
|
|
521
635
|
}), M({
|
|
522
|
-
find:
|
|
636
|
+
find: Qe,
|
|
523
637
|
type: this.type
|
|
524
638
|
})];
|
|
525
639
|
}
|
|
526
|
-
}), Y = " ", X = "\xA0",
|
|
640
|
+
}), Y = " ", X = "\xA0", et = w.create({
|
|
527
641
|
name: "paragraph",
|
|
528
642
|
priority: 1e3,
|
|
529
643
|
addOptions() {
|
|
@@ -562,7 +676,7 @@ var ve = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, ye = /(?:^|\s)(
|
|
|
562
676
|
addKeyboardShortcuts() {
|
|
563
677
|
return { "Mod-Alt-0": () => this.editor.commands.setParagraph() };
|
|
564
678
|
}
|
|
565
|
-
}),
|
|
679
|
+
}), tt = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/, nt = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g, rt = C.create({
|
|
566
680
|
name: "strike",
|
|
567
681
|
addOptions() {
|
|
568
682
|
return { HTMLAttributes: {} };
|
|
@@ -601,17 +715,17 @@ var ve = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, ye = /(?:^|\s)(
|
|
|
601
715
|
},
|
|
602
716
|
addInputRules() {
|
|
603
717
|
return [j({
|
|
604
|
-
find:
|
|
718
|
+
find: tt,
|
|
605
719
|
type: this.type
|
|
606
720
|
})];
|
|
607
721
|
},
|
|
608
722
|
addPasteRules() {
|
|
609
723
|
return [M({
|
|
610
|
-
find:
|
|
724
|
+
find: nt,
|
|
611
725
|
type: this.type
|
|
612
726
|
})];
|
|
613
727
|
}
|
|
614
|
-
}),
|
|
728
|
+
}), it = w.create({
|
|
615
729
|
name: "text",
|
|
616
730
|
group: "inline",
|
|
617
731
|
parseMarkdown: (e) => ({
|
|
@@ -619,7 +733,7 @@ var ve = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, ye = /(?:^|\s)(
|
|
|
619
733
|
text: e.text || ""
|
|
620
734
|
}),
|
|
621
735
|
renderMarkdown: (e) => e.text || ""
|
|
622
|
-
}),
|
|
736
|
+
}), at = C.create({
|
|
623
737
|
name: "underline",
|
|
624
738
|
addOptions() {
|
|
625
739
|
return { HTMLAttributes: {} };
|
|
@@ -675,7 +789,7 @@ var ve = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, ye = /(?:^|\s)(
|
|
|
675
789
|
"Mod-U": () => this.editor.commands.toggleUnderline()
|
|
676
790
|
};
|
|
677
791
|
}
|
|
678
|
-
}),
|
|
792
|
+
}), ot = {
|
|
679
793
|
100: "1f4af",
|
|
680
794
|
1234: "1f522",
|
|
681
795
|
regional_indicator_a: "🇦",
|
|
@@ -2609,7 +2723,7 @@ var ve = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, ye = /(?:^|\s)(
|
|
|
2609
2723
|
england: "1f3f4-e0067-e0062-e0065-e006e-e0067-e007f",
|
|
2610
2724
|
scotland: "1f3f4-e0067-e0062-e0073-e0063-e0074-e007f",
|
|
2611
2725
|
wales: "1f3f4-e0067-e0062-e0077-e006c-e0073-e007f"
|
|
2612
|
-
},
|
|
2726
|
+
}, st = "https://cdn.jsdelivr.net/npm/emoji-datasource-apple/img/apple/64", Z = (e) => /^[A-Fa-f0-9-]+$/.test(e), ct = w.create({
|
|
2613
2727
|
name: "emoji",
|
|
2614
2728
|
inline: !0,
|
|
2615
2729
|
group: "inline",
|
|
@@ -2626,12 +2740,12 @@ var ve = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, ye = /(?:^|\s)(
|
|
|
2626
2740
|
return [{ tag: "span[data-type=\"emoji\"]" }];
|
|
2627
2741
|
},
|
|
2628
2742
|
renderHTML({ HTMLAttributes: e, node: t }) {
|
|
2629
|
-
let n = N(e, { "data-type": "emoji" }), r = t.attrs.name, i = r ?
|
|
2743
|
+
let n = N(e, { "data-type": "emoji" }), r = t.attrs.name, i = r ? ot[r] : void 0;
|
|
2630
2744
|
return i ? Z(i) ? [
|
|
2631
2745
|
"span",
|
|
2632
2746
|
n,
|
|
2633
2747
|
["img", {
|
|
2634
|
-
src: `${
|
|
2748
|
+
src: `${st}/${i}.png`,
|
|
2635
2749
|
draggable: "false",
|
|
2636
2750
|
loading: "lazy",
|
|
2637
2751
|
align: "absmiddle",
|
|
@@ -2647,7 +2761,7 @@ var ve = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, ye = /(?:^|\s)(
|
|
|
2647
2761
|
`:${r || "emoji"}:`
|
|
2648
2762
|
];
|
|
2649
2763
|
}
|
|
2650
|
-
}),
|
|
2764
|
+
}), lt = S.create({
|
|
2651
2765
|
name: "fontSize",
|
|
2652
2766
|
addOptions() {
|
|
2653
2767
|
return { types: ["textStyle"] };
|
|
@@ -2669,37 +2783,37 @@ var ve = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, ye = /(?:^|\s)(
|
|
|
2669
2783
|
};
|
|
2670
2784
|
}
|
|
2671
2785
|
}), Q = [
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
De,
|
|
2676
|
-
Se,
|
|
2677
|
-
Fe,
|
|
2678
|
-
ze,
|
|
2679
|
-
Te,
|
|
2680
|
-
I,
|
|
2681
|
-
R,
|
|
2682
|
-
L,
|
|
2683
|
-
Ee,
|
|
2684
|
-
Ve,
|
|
2685
|
-
H.configure({ openOnClick: !1 }),
|
|
2686
|
-
B,
|
|
2786
|
+
ge,
|
|
2787
|
+
et,
|
|
2788
|
+
it,
|
|
2687
2789
|
Ge,
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2790
|
+
Be,
|
|
2791
|
+
$e,
|
|
2792
|
+
rt,
|
|
2793
|
+
Ue,
|
|
2794
|
+
de,
|
|
2795
|
+
pe,
|
|
2796
|
+
fe,
|
|
2693
2797
|
We,
|
|
2798
|
+
at,
|
|
2799
|
+
I.configure({ openOnClick: !1 }),
|
|
2800
|
+
he,
|
|
2801
|
+
lt,
|
|
2802
|
+
ve,
|
|
2803
|
+
_e,
|
|
2804
|
+
L,
|
|
2805
|
+
me,
|
|
2806
|
+
Je.configure({ multicolor: !0 }),
|
|
2807
|
+
ct,
|
|
2694
2808
|
h,
|
|
2695
|
-
|
|
2809
|
+
ye.configure({ types: [
|
|
2696
2810
|
"paragraph",
|
|
2697
2811
|
"heading",
|
|
2698
2812
|
"bulletList",
|
|
2699
2813
|
"orderedList"
|
|
2700
2814
|
] })
|
|
2701
|
-
], $ = (e) =>
|
|
2702
|
-
let i =
|
|
2815
|
+
], $ = (e) => be(e, Q), ut = ({ content: e, className: t, ref: n, ...r }) => {
|
|
2816
|
+
let i = x(() => e ? typeof e == "string" ? e ? $(e) : null : e.json && Object.keys(e.json).length > 0 ? e.json : e.html ? $(e.html) : null : null, [e]), a = x(() => i ? Fe({
|
|
2703
2817
|
content: i,
|
|
2704
2818
|
extensions: Q
|
|
2705
2819
|
}) : null, [i]);
|
|
@@ -2709,97 +2823,100 @@ var ve = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, ye = /(?:^|\s)(
|
|
|
2709
2823
|
...r,
|
|
2710
2824
|
children: a
|
|
2711
2825
|
}) : null;
|
|
2712
|
-
},
|
|
2713
|
-
left:
|
|
2714
|
-
center:
|
|
2715
|
-
right:
|
|
2716
|
-
},
|
|
2717
|
-
let o = ee(33), {
|
|
2718
|
-
o[0] !==
|
|
2719
|
-
if (
|
|
2720
|
-
let e =
|
|
2826
|
+
}, dt = /* @__PURE__ */ s({ PopupBody: () => gt }), ft = b(() => import("./dist-orLT2eNz.js").then((e) => e.t).then((e) => ({ default: e.CollectionFormBuilder }))), pt = p({ baseSpacing: ".625rem" }), mt = { style: a({ form: { gap: "1rem" } }) }, ht = {
|
|
2827
|
+
left: o,
|
|
2828
|
+
center: d,
|
|
2829
|
+
right: l
|
|
2830
|
+
}, gt = (a) => {
|
|
2831
|
+
let o = ee(33), { disableInteraction: s } = a, { popup: l, callbacks: d, client: p, preview: m } = u(), h = d?.onAction, g = c(l), { content: y } = l, [b, x] = re(!1), S;
|
|
2832
|
+
o[0] !== y.action || o[1] !== h || o[2] !== l ? (S = () => {
|
|
2833
|
+
if (y.action?.type !== "redirect" || !y.action.copyValue) return;
|
|
2834
|
+
let e = y.action.copyValue;
|
|
2721
2835
|
navigator.clipboard.writeText(e).then(() => {
|
|
2722
|
-
|
|
2836
|
+
x(!0), setTimeout(() => x(!1), 2e3), h?.(l, {
|
|
2723
2837
|
action_type: "copy",
|
|
2724
2838
|
copy_value: e
|
|
2725
2839
|
});
|
|
2726
2840
|
});
|
|
2727
|
-
}, o[0] =
|
|
2728
|
-
let
|
|
2729
|
-
o[4] ===
|
|
2841
|
+
}, o[0] = y.action, o[1] = h, o[2] = l, o[3] = S) : S = o[3];
|
|
2842
|
+
let C = S, w = y.align ?? "left", T = y.size ?? "medium", E;
|
|
2843
|
+
o[4] === T ? E = o[5] : (E = f({ size: T }), o[4] = T, o[5] = E);
|
|
2844
|
+
let D;
|
|
2845
|
+
o[6] === s ? D = o[7] : (D = s ? { pointerEvents: "none" } : void 0, o[6] = s, o[7] = D);
|
|
2730
2846
|
let O;
|
|
2731
|
-
o[
|
|
2732
|
-
let k;
|
|
2733
|
-
o[8] !== T || o[9] !== g.description || o[10] !== g.heading ? (k = (g.heading || g.description) && /* @__PURE__ */ v(i, {
|
|
2847
|
+
o[8] !== w || o[9] !== y.description || o[10] !== y.heading ? (O = (y.heading || y.description) && /* @__PURE__ */ v(i, {
|
|
2734
2848
|
className: "zv6sjd4",
|
|
2735
|
-
style: { textAlign:
|
|
2736
|
-
children: [
|
|
2737
|
-
}), o[8] =
|
|
2738
|
-
let
|
|
2739
|
-
o[12] ===
|
|
2849
|
+
style: { textAlign: w },
|
|
2850
|
+
children: [y.heading && /* @__PURE__ */ _(n, { children: y.heading }), y.description && /* @__PURE__ */ _(r, { children: y.description })]
|
|
2851
|
+
}), o[8] = w, o[9] = y.description, o[10] = y.heading, o[11] = O) : O = o[11];
|
|
2852
|
+
let k;
|
|
2853
|
+
o[12] === y.body ? k = o[13] : (k = (y.body?.html || y.body?.json) && /* @__PURE__ */ _(ut, {
|
|
2740
2854
|
className: "zv6sjd5",
|
|
2741
|
-
style:
|
|
2742
|
-
content:
|
|
2743
|
-
}), o[12] =
|
|
2744
|
-
let
|
|
2745
|
-
o[14] !==
|
|
2855
|
+
style: pt,
|
|
2856
|
+
content: y.body
|
|
2857
|
+
}), o[12] = y.body, o[13] = k);
|
|
2858
|
+
let A;
|
|
2859
|
+
o[14] !== w || o[15] !== p || o[16] !== y.action || o[17] !== h || o[18] !== l || o[19] !== m ? (A = y.action?.type === "form" && p && /* @__PURE__ */ _("div", {
|
|
2746
2860
|
className: "zv6sjd7",
|
|
2747
|
-
children: /* @__PURE__ */ _(
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2861
|
+
children: /* @__PURE__ */ _(ne, { children: /* @__PURE__ */ _(t, {
|
|
2862
|
+
client: p,
|
|
2863
|
+
children: /* @__PURE__ */ _(ft, {
|
|
2864
|
+
collection_id: y.action.collectionKey,
|
|
2865
|
+
formVariant: y.action.formVariant,
|
|
2866
|
+
theme: mt,
|
|
2867
|
+
uiConfig: {
|
|
2868
|
+
hideFormHeading: !0,
|
|
2869
|
+
hideSectionHeadings: !0
|
|
2870
|
+
},
|
|
2871
|
+
successConfig: y.action.successRedirectUrl ? { action: {
|
|
2872
|
+
type: "redirect",
|
|
2873
|
+
value: y.action.successRedirectUrl
|
|
2874
|
+
} } : void 0,
|
|
2875
|
+
submitButtonConfig: {
|
|
2876
|
+
show: !0,
|
|
2877
|
+
text: y.action.label || "Submit",
|
|
2878
|
+
styles: y.action.fullWidth && (y.action.formVariant ?? "default") === "default" ? "zv6sjdb" : ht[w]
|
|
2879
|
+
},
|
|
2880
|
+
workspace_id: p.workspace,
|
|
2881
|
+
containerStyles: "zv6sjd6",
|
|
2882
|
+
preview: m,
|
|
2883
|
+
onSuccess: () => {
|
|
2884
|
+
y.action?.type === "form" && h?.(l, {
|
|
2885
|
+
action_type: "form_submit",
|
|
2886
|
+
collection_key: y.action.collectionKey
|
|
2887
|
+
});
|
|
2888
|
+
}
|
|
2889
|
+
})
|
|
2773
2890
|
}) })
|
|
2774
|
-
}), o[14] =
|
|
2775
|
-
let
|
|
2776
|
-
o[21] !==
|
|
2891
|
+
}), o[14] = w, o[15] = p, o[16] = y.action, o[17] = h, o[18] = l, o[19] = m, o[20] = A) : A = o[20];
|
|
2892
|
+
let j;
|
|
2893
|
+
o[21] !== y.action || o[22] !== b || o[23] !== C || o[24] !== g ? (j = y.action?.type === "redirect" && /* @__PURE__ */ v(te, { children: [y.action.copyValue && /* @__PURE__ */ v("button", {
|
|
2777
2894
|
type: "button",
|
|
2778
2895
|
className: "zv6sjdd",
|
|
2779
|
-
onClick:
|
|
2896
|
+
onClick: C,
|
|
2780
2897
|
children: [/* @__PURE__ */ _("span", {
|
|
2781
2898
|
className: "zv6sjde",
|
|
2782
|
-
children:
|
|
2783
|
-
}), _(
|
|
2899
|
+
children: y.action.copyValue
|
|
2900
|
+
}), _(b ? ie : ae, {
|
|
2784
2901
|
size: 18,
|
|
2785
2902
|
className: "zv6sjdf"
|
|
2786
2903
|
})]
|
|
2787
2904
|
}), /* @__PURE__ */ _(e, {
|
|
2788
2905
|
className: "zv6sjdc",
|
|
2789
|
-
onClick: () =>
|
|
2790
|
-
children:
|
|
2791
|
-
})] }), o[21] =
|
|
2792
|
-
let
|
|
2793
|
-
return o[26] !==
|
|
2794
|
-
className:
|
|
2795
|
-
style:
|
|
2906
|
+
onClick: () => g?.(),
|
|
2907
|
+
children: y.action.label || "Button"
|
|
2908
|
+
})] }), o[21] = y.action, o[22] = b, o[23] = C, o[24] = g, o[25] = j) : j = o[25];
|
|
2909
|
+
let M;
|
|
2910
|
+
return o[26] !== E || o[27] !== D || o[28] !== O || o[29] !== k || o[30] !== A || o[31] !== j ? (M = /* @__PURE__ */ v("div", {
|
|
2911
|
+
className: E,
|
|
2912
|
+
style: D,
|
|
2796
2913
|
children: [
|
|
2914
|
+
O,
|
|
2797
2915
|
k,
|
|
2798
2916
|
A,
|
|
2799
|
-
j
|
|
2800
|
-
M
|
|
2917
|
+
j
|
|
2801
2918
|
]
|
|
2802
|
-
}), o[26] =
|
|
2919
|
+
}), o[26] = E, o[27] = D, o[28] = O, o[29] = k, o[30] = A, o[31] = j, o[32] = M) : M = o[32], M;
|
|
2803
2920
|
};
|
|
2804
2921
|
//#endregion
|
|
2805
|
-
export {
|
|
2922
|
+
export { dt as n };
|