@vc-shell/framework 1.1.99-alpha.1 → 1.1.99-alpha.11
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/dist/framework.js +3814 -3806
- package/dist/index.css +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/_internal/vc-table-columns-header/vc-table-columns-header.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/_internal/vc-table-row/vc-table-row.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-table/composables/useTableModifications.d.ts +14 -0
- package/dist/ui/components/organisms/vc-table/composables/useTableModifications.d.ts.map +1 -0
- package/dist/{vendor-core-js-DDuR6YMQ.js → vendor-core-js-BFxlwwN5.js} +2 -2
- package/dist/{vendor-intlify-core-base-Da62SG4M.js → vendor-intlify-core-base-BPrkwvwk.js} +4 -4
- package/dist/{vendor-intlify-message-compiler-CHvGSH2u.js → vendor-intlify-message-compiler-Dguf6mhj.js} +2 -2
- package/dist/{vendor-intlify-shared-jWBPd9WB.js → vendor-intlify-shared-Di50oJUK.js} +1 -1
- package/dist/{vendor-prosemirror-commands-Cu1q5ZDk.js → vendor-prosemirror-commands-quHSf-06.js} +2 -2
- package/dist/{vendor-prosemirror-dropcursor-BuGmFgFS.js → vendor-prosemirror-dropcursor-B02qFqyv.js} +2 -2
- package/dist/{vendor-prosemirror-gapcursor-CyYcCWVK.js → vendor-prosemirror-gapcursor-csIPOlxW.js} +3 -3
- package/dist/{vendor-prosemirror-history-DzRcbrCw.js → vendor-prosemirror-history-1c9GGwnq.js} +3 -3
- package/dist/{vendor-prosemirror-keymap-KfbdOEJw.js → vendor-prosemirror-keymap-qY1NCp1b.js} +1 -1
- package/dist/{vendor-prosemirror-schema-list-CwCUArvx.js → vendor-prosemirror-schema-list-D8uyGoVp.js} +1 -1
- package/dist/{vendor-prosemirror-state-DHaVEu5h.js → vendor-prosemirror-state-Du7AF5Ax.js} +1 -1
- package/dist/{vendor-prosemirror-tables-mYok4vGT.js → vendor-prosemirror-tables-CtOx19Gr.js} +4 -4
- package/dist/{vendor-prosemirror-transform-CAHmg-qG.js → vendor-prosemirror-transform-dNz_YAu0.js} +6 -5
- package/dist/{vendor-prosemirror-view-CspJa44O.js → vendor-prosemirror-view-DpmNEJam.js} +2 -2
- package/dist/{vendor-tiptap-core-ClsTgaMv.js → vendor-tiptap-core-CEgpCf7B.js} +560 -493
- package/dist/{vendor-tiptap-extension-blockquote-r1MBx4hD.js → vendor-tiptap-extension-blockquote-wzBz8o9Q.js} +14 -13
- package/dist/{vendor-tiptap-extension-bold-BjLI4i8b.js → vendor-tiptap-extension-bold-CRRLMaAK.js} +1 -1
- package/dist/{vendor-tiptap-extension-code-D5-kDnMW.js → vendor-tiptap-extension-code-BIFA2Gxl.js} +1 -1
- package/dist/{vendor-tiptap-extension-code-block-RjEb0zPA.js → vendor-tiptap-extension-code-block-BSjY11bc.js} +2 -2
- package/dist/{vendor-tiptap-extension-document--PLOxIdq.js → vendor-tiptap-extension-document-DwvKx2hp.js} +1 -1
- package/dist/{vendor-tiptap-extension-hard-break-9cxC2YOS.js → vendor-tiptap-extension-hard-break-CZuhkJI2.js} +10 -10
- package/dist/{vendor-tiptap-extension-heading-2w0TutHn.js → vendor-tiptap-extension-heading-D35S-y-k.js} +1 -1
- package/dist/{vendor-tiptap-extension-horizontal-rule-CFowa_lc.js → vendor-tiptap-extension-horizontal-rule-4Qo7zefW.js} +2 -2
- package/dist/{vendor-tiptap-extension-image-aWn-na6j.js → vendor-tiptap-extension-image-Bbpsr_TM.js} +1 -1
- package/dist/{vendor-tiptap-extension-italic-Bn-6saY0.js → vendor-tiptap-extension-italic-CiQh9zGx.js} +1 -1
- package/dist/{vendor-tiptap-extension-link-BmcG1_k-.js → vendor-tiptap-extension-link-CrsWLfRc.js} +2 -2
- package/dist/{vendor-tiptap-extension-list-BrNBJ45n.js → vendor-tiptap-extension-list-pQaMlGjQ.js} +1 -1
- package/dist/{vendor-tiptap-extension-paragraph-DAiYhwUB.js → vendor-tiptap-extension-paragraph-BrThgWMs.js} +1 -1
- package/dist/vendor-tiptap-extension-placeholder-CrwIFpUp.js +1 -0
- package/dist/{vendor-tiptap-extension-strike-DqbXPfos.js → vendor-tiptap-extension-strike-CyPVcK5D.js} +1 -1
- package/dist/{vendor-tiptap-extension-table-DQwPaR7v.js → vendor-tiptap-extension-table-B7FEy-Bb.js} +3 -3
- package/dist/vendor-tiptap-extension-table-cell-Bbz2gi81.js +1 -0
- package/dist/vendor-tiptap-extension-table-header-Bbz2gi81.js +1 -0
- package/dist/vendor-tiptap-extension-table-row-Bbz2gi81.js +1 -0
- package/dist/{vendor-tiptap-extension-text-BFnfj70b.js → vendor-tiptap-extension-text-DqBjoYBM.js} +1 -1
- package/dist/{vendor-tiptap-extension-text-style-Darua3qr.js → vendor-tiptap-extension-text-style-DnaDmb_a.js} +1 -1
- package/dist/{vendor-tiptap-extension-underline-QyVnBqQZ.js → vendor-tiptap-extension-underline-fXgsxVmp.js} +1 -1
- package/dist/{vendor-tiptap-extensions-CU-D7bfm.js → vendor-tiptap-extensions-BFy2DVsW.js} +38 -38
- package/dist/{vendor-tiptap-markdown-BwATYN5A.js → vendor-tiptap-markdown-Ctlbws1-.js} +2 -2
- package/dist/vendor-tiptap-pm-6BAzdajG.js +1 -0
- package/dist/{vendor-tiptap-starter-kit-5luf7zzS.js → vendor-tiptap-starter-kit-BmGksOsA.js} +17 -17
- package/dist/{vendor-tiptap-vue-3-CFBErZGb.js → vendor-tiptap-vue-3-DKq4aaS7.js} +1 -1
- package/dist/{vendor-vue-i18n-CO5LWKE0.js → vendor-vue-i18n-DPqZrTrP.js} +315 -308
- package/package.json +5 -5
- package/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/_internal/vc-table-columns-header/vc-table-columns-header.vue +4 -5
- package/ui/components/organisms/vc-table/_internal/vc-table-desktop-view/_internal/vc-table-row/vc-table-row.vue +4 -5
- package/ui/components/organisms/vc-table/composables/useTableModifications.ts +25 -0
- package/dist/vendor-tiptap-extension-placeholder-9tURDKy-.js +0 -1
- package/dist/vendor-tiptap-extension-table-cell-C0tEP_0i.js +0 -1
- package/dist/vendor-tiptap-extension-table-header-C0tEP_0i.js +0 -1
- package/dist/vendor-tiptap-extension-table-row-C0tEP_0i.js +0 -1
- package/dist/vendor-tiptap-pm-d91nGny8.js +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { f as
|
|
2
|
-
import { c as
|
|
3
|
-
import { N as G, E as
|
|
4
|
-
import { D as
|
|
5
|
-
import { l as
|
|
6
|
-
import { E as
|
|
7
|
-
import { a as
|
|
8
|
-
var
|
|
1
|
+
import { f as ue, c as ht, T as fe, e as pe, l as he, j as Bt, a as X, b as me, R as ge } from "./vendor-prosemirror-transform-dNz_YAu0.js";
|
|
2
|
+
import { c as ve, d as ye, e as be, j as we, a as ke, b as Me, f as xe, g as Se, h as Ee, l as Te, i as Ae, n as Ce, s as Pe, k as $e, m as Ne, o as Re, p as ze, q as Tt, w as Ie } from "./vendor-prosemirror-commands-quHSf-06.js";
|
|
3
|
+
import { N as G, E as Be, S as L, T as P, P as $, a as _, A as _e } from "./vendor-prosemirror-state-Du7AF5Ax.js";
|
|
4
|
+
import { D as je, a as _t, F as B, b as De, d as ct, S as Oe } from "./vendor-prosemirror-model-DFp4ML7B.js";
|
|
5
|
+
import { l as Le, s as Fe, w as He } from "./vendor-prosemirror-schema-list-D8uyGoVp.js";
|
|
6
|
+
import { E as Ve } from "./vendor-prosemirror-view-DpmNEJam.js";
|
|
7
|
+
import { a as We } from "./vendor-prosemirror-keymap-qY1NCp1b.js";
|
|
8
|
+
var Ue = Object.defineProperty, mt = (e, t) => {
|
|
9
9
|
for (var n in t)
|
|
10
|
-
|
|
10
|
+
Ue(e, n, { get: t[n], enumerable: !0 });
|
|
11
11
|
};
|
|
12
12
|
function tt(e) {
|
|
13
13
|
const { state: t, transaction: n } = e;
|
|
@@ -101,71 +101,73 @@ var et = class {
|
|
|
101
101
|
};
|
|
102
102
|
return i;
|
|
103
103
|
}
|
|
104
|
-
},
|
|
105
|
-
mt(
|
|
106
|
-
blur: () =>
|
|
107
|
-
clearContent: () =>
|
|
108
|
-
clearNodes: () =>
|
|
109
|
-
command: () =>
|
|
110
|
-
createParagraphNear: () =>
|
|
111
|
-
cut: () =>
|
|
112
|
-
deleteCurrentNode: () =>
|
|
113
|
-
deleteNode: () =>
|
|
114
|
-
deleteRange: () =>
|
|
115
|
-
deleteSelection: () =>
|
|
116
|
-
enter: () =>
|
|
117
|
-
exitCode: () =>
|
|
118
|
-
extendMarkRange: () =>
|
|
119
|
-
first: () =>
|
|
120
|
-
focus: () =>
|
|
121
|
-
forEach: () =>
|
|
122
|
-
insertContent: () =>
|
|
123
|
-
insertContentAt: () =>
|
|
124
|
-
joinBackward: () =>
|
|
125
|
-
joinDown: () =>
|
|
126
|
-
joinForward: () =>
|
|
127
|
-
joinItemBackward: () =>
|
|
128
|
-
joinItemForward: () =>
|
|
129
|
-
joinTextblockBackward: () =>
|
|
130
|
-
joinTextblockForward: () =>
|
|
131
|
-
joinUp: () =>
|
|
132
|
-
keyboardShortcut: () =>
|
|
133
|
-
lift: () =>
|
|
134
|
-
liftEmptyBlock: () =>
|
|
135
|
-
liftListItem: () =>
|
|
136
|
-
newlineInCode: () =>
|
|
137
|
-
resetAttributes: () =>
|
|
138
|
-
scrollIntoView: () =>
|
|
139
|
-
selectAll: () =>
|
|
140
|
-
selectNodeBackward: () =>
|
|
141
|
-
selectNodeForward: () =>
|
|
142
|
-
selectParentNode: () =>
|
|
143
|
-
selectTextblockEnd: () =>
|
|
144
|
-
selectTextblockStart: () =>
|
|
145
|
-
setContent: () =>
|
|
146
|
-
setMark: () =>
|
|
147
|
-
setMeta: () =>
|
|
148
|
-
setNode: () =>
|
|
149
|
-
setNodeSelection: () =>
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
104
|
+
}, jt = {};
|
|
105
|
+
mt(jt, {
|
|
106
|
+
blur: () => Ke,
|
|
107
|
+
clearContent: () => qe,
|
|
108
|
+
clearNodes: () => Je,
|
|
109
|
+
command: () => Xe,
|
|
110
|
+
createParagraphNear: () => Ye,
|
|
111
|
+
cut: () => Ze,
|
|
112
|
+
deleteCurrentNode: () => Qe,
|
|
113
|
+
deleteNode: () => Ge,
|
|
114
|
+
deleteRange: () => tn,
|
|
115
|
+
deleteSelection: () => en,
|
|
116
|
+
enter: () => nn,
|
|
117
|
+
exitCode: () => rn,
|
|
118
|
+
extendMarkRange: () => sn,
|
|
119
|
+
first: () => on,
|
|
120
|
+
focus: () => cn,
|
|
121
|
+
forEach: () => ln,
|
|
122
|
+
insertContent: () => dn,
|
|
123
|
+
insertContentAt: () => pn,
|
|
124
|
+
joinBackward: () => gn,
|
|
125
|
+
joinDown: () => mn,
|
|
126
|
+
joinForward: () => vn,
|
|
127
|
+
joinItemBackward: () => yn,
|
|
128
|
+
joinItemForward: () => bn,
|
|
129
|
+
joinTextblockBackward: () => wn,
|
|
130
|
+
joinTextblockForward: () => kn,
|
|
131
|
+
joinUp: () => hn,
|
|
132
|
+
keyboardShortcut: () => xn,
|
|
133
|
+
lift: () => Sn,
|
|
134
|
+
liftEmptyBlock: () => En,
|
|
135
|
+
liftListItem: () => Tn,
|
|
136
|
+
newlineInCode: () => An,
|
|
137
|
+
resetAttributes: () => Cn,
|
|
138
|
+
scrollIntoView: () => Pn,
|
|
139
|
+
selectAll: () => $n,
|
|
140
|
+
selectNodeBackward: () => Nn,
|
|
141
|
+
selectNodeForward: () => Rn,
|
|
142
|
+
selectParentNode: () => zn,
|
|
143
|
+
selectTextblockEnd: () => In,
|
|
144
|
+
selectTextblockStart: () => Bn,
|
|
145
|
+
setContent: () => _n,
|
|
146
|
+
setMark: () => tr,
|
|
147
|
+
setMeta: () => er,
|
|
148
|
+
setNode: () => nr,
|
|
149
|
+
setNodeSelection: () => rr,
|
|
150
|
+
setTextDirection: () => sr,
|
|
151
|
+
setTextSelection: () => or,
|
|
152
|
+
sinkListItem: () => ir,
|
|
153
|
+
splitBlock: () => ar,
|
|
154
|
+
splitListItem: () => cr,
|
|
155
|
+
toggleList: () => lr,
|
|
156
|
+
toggleMark: () => dr,
|
|
157
|
+
toggleNode: () => ur,
|
|
158
|
+
toggleWrap: () => fr,
|
|
159
|
+
undoInputRule: () => pr,
|
|
160
|
+
unsetAllMarks: () => hr,
|
|
161
|
+
unsetMark: () => mr,
|
|
162
|
+
unsetTextDirection: () => gr,
|
|
163
|
+
updateAttributes: () => vr,
|
|
164
|
+
wrapIn: () => yr,
|
|
165
|
+
wrapInList: () => br
|
|
164
166
|
});
|
|
165
|
-
var
|
|
167
|
+
var Ke = () => ({ editor: e, view: t }) => (requestAnimationFrame(() => {
|
|
166
168
|
var n;
|
|
167
169
|
e.isDestroyed || (t.dom.blur(), (n = window?.getSelection()) == null || n.removeAllRanges());
|
|
168
|
-
}), !0),
|
|
170
|
+
}), !0), qe = (e = !0) => ({ commands: t }) => t.setContent("", { emitUpdate: e }), Je = () => ({ state: e, tr: t, dispatch: n }) => {
|
|
169
171
|
const { selection: r } = t, { ranges: s } = r;
|
|
170
172
|
return n && s.forEach(({ $from: o, $to: i }) => {
|
|
171
173
|
e.doc.nodesBetween(o.pos, i.pos, (a, c) => {
|
|
@@ -174,7 +176,7 @@ var We = () => ({ editor: e, view: t }) => (requestAnimationFrame(() => {
|
|
|
174
176
|
const { doc: l, mapping: d } = t, u = l.resolve(d.map(c)), f = l.resolve(d.map(c + a.nodeSize)), p = u.blockRange(f);
|
|
175
177
|
if (!p)
|
|
176
178
|
return;
|
|
177
|
-
const h =
|
|
179
|
+
const h = he(p);
|
|
178
180
|
if (a.type.isTextblock) {
|
|
179
181
|
const { defaultType: m } = u.parent.contentMatchAt(u.index());
|
|
180
182
|
t.setNodeMarkup(p.start, m);
|
|
@@ -182,12 +184,12 @@ var We = () => ({ editor: e, view: t }) => (requestAnimationFrame(() => {
|
|
|
182
184
|
(h || h === 0) && t.lift(p, h);
|
|
183
185
|
});
|
|
184
186
|
}), !0;
|
|
185
|
-
},
|
|
187
|
+
}, Xe = (e) => (t) => e(t), Ye = () => ({ state: e, dispatch: t }) => ve(e, t), Ze = (e, t) => ({ editor: n, tr: r }) => {
|
|
186
188
|
const { state: s } = n, o = s.doc.slice(e.from, e.to);
|
|
187
189
|
r.deleteRange(e.from, e.to);
|
|
188
190
|
const i = r.mapping.map(t);
|
|
189
191
|
return r.insert(i, o.content), r.setSelection(new P(r.doc.resolve(Math.max(i - 1, 0)))), !0;
|
|
190
|
-
},
|
|
192
|
+
}, Qe = () => ({ tr: e, dispatch: t }) => {
|
|
191
193
|
const { selection: n } = e, r = n.$anchor.node();
|
|
192
194
|
if (r.content.size > 0)
|
|
193
195
|
return !1;
|
|
@@ -210,7 +212,7 @@ function T(e, t) {
|
|
|
210
212
|
}
|
|
211
213
|
return e;
|
|
212
214
|
}
|
|
213
|
-
var
|
|
215
|
+
var Ge = (e) => ({ tr: t, state: n, dispatch: r }) => {
|
|
214
216
|
const s = T(e, n.schema), o = t.selection.$anchor;
|
|
215
217
|
for (let i = o.depth; i > 0; i -= 1)
|
|
216
218
|
if (o.node(i).type === s) {
|
|
@@ -221,10 +223,10 @@ var Ze = (e) => ({ tr: t, state: n, dispatch: r }) => {
|
|
|
221
223
|
return !0;
|
|
222
224
|
}
|
|
223
225
|
return !1;
|
|
224
|
-
},
|
|
226
|
+
}, tn = (e) => ({ tr: t, dispatch: n }) => {
|
|
225
227
|
const { from: r, to: s } = e;
|
|
226
228
|
return n && t.delete(r, s), !0;
|
|
227
|
-
},
|
|
229
|
+
}, en = () => ({ state: e, dispatch: t }) => ye(e, t), nn = () => ({ commands: e }) => e.keyboardShortcut("Enter"), rn = () => ({ state: e, dispatch: t }) => be(e, t);
|
|
228
230
|
function gt(e) {
|
|
229
231
|
return Object.prototype.toString.call(e) === "[object RegExp]";
|
|
230
232
|
}
|
|
@@ -232,7 +234,7 @@ function Z(e, t, n = { strict: !0 }) {
|
|
|
232
234
|
const r = Object.keys(t);
|
|
233
235
|
return r.length ? r.every((s) => n.strict ? t[s] === e[s] : gt(t[s]) ? t[s].test(e[s]) : t[s] === e[s]) : !0;
|
|
234
236
|
}
|
|
235
|
-
function
|
|
237
|
+
function Dt(e, t, n = {}) {
|
|
236
238
|
return e.find((r) => r.type === t && Z(
|
|
237
239
|
// Only check equality for the attributes that are provided
|
|
238
240
|
Object.fromEntries(Object.keys(n).map((s) => [s, r.attrs[s]])),
|
|
@@ -240,14 +242,14 @@ function jt(e, t, n = {}) {
|
|
|
240
242
|
));
|
|
241
243
|
}
|
|
242
244
|
function At(e, t, n = {}) {
|
|
243
|
-
return !!
|
|
245
|
+
return !!Dt(e, t, n);
|
|
244
246
|
}
|
|
245
247
|
function vt(e, t, n) {
|
|
246
248
|
var r;
|
|
247
249
|
if (!e || !t)
|
|
248
250
|
return;
|
|
249
251
|
let s = e.parent.childAfter(e.parentOffset);
|
|
250
|
-
if ((!s.node || !s.node.marks.some((d) => d.type === t)) && (s = e.parent.childBefore(e.parentOffset)), !s.node || !s.node.marks.some((d) => d.type === t) || (n = n || ((r = s.node.marks[0]) == null ? void 0 : r.attrs), !
|
|
252
|
+
if ((!s.node || !s.node.marks.some((d) => d.type === t)) && (s = e.parent.childBefore(e.parentOffset)), !s.node || !s.node.marks.some((d) => d.type === t) || (n = n || ((r = s.node.marks[0]) == null ? void 0 : r.attrs), !Dt([...s.node.marks], t, n)))
|
|
251
253
|
return;
|
|
252
254
|
let i = s.index, a = e.start() + s.offset, c = i + 1, l = a + s.node.nodeSize;
|
|
253
255
|
for (; i > 0 && At([...e.parent.child(i - 1).marks], t, n); )
|
|
@@ -259,7 +261,7 @@ function vt(e, t, n) {
|
|
|
259
261
|
to: l
|
|
260
262
|
};
|
|
261
263
|
}
|
|
262
|
-
function
|
|
264
|
+
function z(e, t) {
|
|
263
265
|
if (typeof e == "string") {
|
|
264
266
|
if (!t.marks[e])
|
|
265
267
|
throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);
|
|
@@ -267,8 +269,8 @@ function R(e, t) {
|
|
|
267
269
|
}
|
|
268
270
|
return e;
|
|
269
271
|
}
|
|
270
|
-
var
|
|
271
|
-
const o =
|
|
272
|
+
var sn = (e, t = {}) => ({ tr: n, state: r, dispatch: s }) => {
|
|
273
|
+
const o = z(e, r.schema), { doc: i, selection: a } = n, { $from: c, from: l, to: d } = a;
|
|
272
274
|
if (s) {
|
|
273
275
|
const u = vt(c, o, t);
|
|
274
276
|
if (u && u.from <= l && u.to >= d) {
|
|
@@ -277,7 +279,7 @@ var nn = (e, t = {}) => ({ tr: n, state: r, dispatch: s }) => {
|
|
|
277
279
|
}
|
|
278
280
|
}
|
|
279
281
|
return !0;
|
|
280
|
-
},
|
|
282
|
+
}, on = (e) => (t) => {
|
|
281
283
|
const n = typeof e == "function" ? e(t) : e;
|
|
282
284
|
for (let r = 0; r < n.length; r += 1)
|
|
283
285
|
if (n[r](t))
|
|
@@ -287,10 +289,10 @@ var nn = (e, t = {}) => ({ tr: n, state: r, dispatch: s }) => {
|
|
|
287
289
|
function Ot(e) {
|
|
288
290
|
return e instanceof P;
|
|
289
291
|
}
|
|
290
|
-
function
|
|
292
|
+
function D(e = 0, t = 0, n = 0) {
|
|
291
293
|
return Math.min(Math.max(e, t), n);
|
|
292
294
|
}
|
|
293
|
-
function
|
|
295
|
+
function Lt(e, t = null) {
|
|
294
296
|
if (!t)
|
|
295
297
|
return null;
|
|
296
298
|
const n = L.atStart(e), r = L.atEnd(e);
|
|
@@ -299,22 +301,22 @@ function Dt(e, t = null) {
|
|
|
299
301
|
if (t === "end")
|
|
300
302
|
return r;
|
|
301
303
|
const s = n.from, o = r.to;
|
|
302
|
-
return t === "all" ? P.create(e,
|
|
304
|
+
return t === "all" ? P.create(e, D(0, s, o), D(e.content.size, s, o)) : P.create(e, D(t, s, o), D(t, s, o));
|
|
303
305
|
}
|
|
304
|
-
function
|
|
306
|
+
function an() {
|
|
305
307
|
return navigator.platform === "Android" || /android/i.test(navigator.userAgent);
|
|
306
308
|
}
|
|
307
309
|
function yt() {
|
|
308
310
|
return ["iPad Simulator", "iPhone Simulator", "iPod Simulator", "iPad", "iPhone", "iPod"].includes(navigator.platform) || // iPad on iOS 13 detection
|
|
309
311
|
navigator.userAgent.includes("Mac") && "ontouchend" in document;
|
|
310
312
|
}
|
|
311
|
-
var
|
|
313
|
+
var cn = (e = null, t = {}) => ({ editor: n, view: r, tr: s, dispatch: o }) => {
|
|
312
314
|
t = {
|
|
313
315
|
scrollIntoView: !0,
|
|
314
316
|
...t
|
|
315
317
|
};
|
|
316
318
|
const i = () => {
|
|
317
|
-
(yt() ||
|
|
319
|
+
(yt() || an()) && r.dom.focus(), requestAnimationFrame(() => {
|
|
318
320
|
n.isDestroyed || (r.focus(), t?.scrollIntoView && n.commands.scrollIntoView());
|
|
319
321
|
});
|
|
320
322
|
};
|
|
@@ -322,13 +324,13 @@ var on = (e = null, t = {}) => ({ editor: n, view: r, tr: s, dispatch: o }) => {
|
|
|
322
324
|
return !0;
|
|
323
325
|
if (o && e === null && !Ot(n.state.selection))
|
|
324
326
|
return i(), !0;
|
|
325
|
-
const a =
|
|
327
|
+
const a = Lt(s.doc, e) || n.state.selection, c = n.state.selection.eq(a);
|
|
326
328
|
return o && (c || s.setSelection(a), c && s.storedMarks && s.setStoredMarks(s.storedMarks), i()), !0;
|
|
327
|
-
},
|
|
329
|
+
}, ln = (e, t) => (n) => e.every((r, s) => t(r, { ...n, index: s })), dn = (e, t) => ({ tr: n, commands: r }) => r.insertContentAt({ from: n.selection.from, to: n.selection.to }, e, t), Ft = (e) => {
|
|
328
330
|
const t = e.childNodes;
|
|
329
331
|
for (let n = t.length - 1; n >= 0; n -= 1) {
|
|
330
332
|
const r = t[n];
|
|
331
|
-
r.nodeType === 3 && r.nodeValue && /^(\n\s\s|\n)$/.test(r.nodeValue) ? e.removeChild(r) : r.nodeType === 1 &&
|
|
333
|
+
r.nodeType === 3 && r.nodeValue && /^(\n\s\s|\n)$/.test(r.nodeValue) ? e.removeChild(r) : r.nodeType === 1 && Ft(r);
|
|
332
334
|
}
|
|
333
335
|
return e;
|
|
334
336
|
};
|
|
@@ -336,10 +338,10 @@ function U(e) {
|
|
|
336
338
|
if (typeof window > "u")
|
|
337
339
|
throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");
|
|
338
340
|
const t = `<body>${e}</body>`, n = new window.DOMParser().parseFromString(t, "text/html").body;
|
|
339
|
-
return
|
|
341
|
+
return Ft(n);
|
|
340
342
|
}
|
|
341
|
-
function
|
|
342
|
-
if (e instanceof
|
|
343
|
+
function H(e, t, n) {
|
|
344
|
+
if (e instanceof De || e instanceof B)
|
|
343
345
|
return e;
|
|
344
346
|
n = {
|
|
345
347
|
slice: !0,
|
|
@@ -350,13 +352,13 @@ function F(e, t, n) {
|
|
|
350
352
|
if (r)
|
|
351
353
|
try {
|
|
352
354
|
if (Array.isArray(e) && e.length > 0)
|
|
353
|
-
return
|
|
355
|
+
return B.fromArray(e.map((a) => t.nodeFromJSON(a)));
|
|
354
356
|
const i = t.nodeFromJSON(e);
|
|
355
357
|
return n.errorOnInvalidContent && i.check(), i;
|
|
356
358
|
} catch (o) {
|
|
357
359
|
if (n.errorOnInvalidContent)
|
|
358
360
|
throw new Error("[tiptap error]: Invalid JSON content", { cause: o });
|
|
359
|
-
return console.warn("[tiptap warn]: Invalid content.", "Passed value:", e, "Error:", o),
|
|
361
|
+
return console.warn("[tiptap warn]: Invalid content.", "Passed value:", e, "Error:", o), H("", t, n);
|
|
360
362
|
}
|
|
361
363
|
if (s) {
|
|
362
364
|
if (n.errorOnInvalidContent) {
|
|
@@ -387,14 +389,14 @@ function F(e, t, n) {
|
|
|
387
389
|
const o = ct.fromSchema(t);
|
|
388
390
|
return n.slice ? o.parseSlice(U(e), n.parseOptions).content : o.parse(U(e), n.parseOptions);
|
|
389
391
|
}
|
|
390
|
-
return
|
|
392
|
+
return H("", t, n);
|
|
391
393
|
}
|
|
392
|
-
function
|
|
394
|
+
function un(e, t, n) {
|
|
393
395
|
const r = e.steps.length - 1;
|
|
394
396
|
if (r < t)
|
|
395
397
|
return;
|
|
396
398
|
const s = e.steps[r];
|
|
397
|
-
if (!(s instanceof
|
|
399
|
+
if (!(s instanceof me || s instanceof ge))
|
|
398
400
|
return;
|
|
399
401
|
const o = e.mapping.maps[r];
|
|
400
402
|
let i = 0;
|
|
@@ -402,7 +404,7 @@ function ln(e, t, n) {
|
|
|
402
404
|
i === 0 && (i = d);
|
|
403
405
|
}), e.setSelection(L.near(e.doc.resolve(i), n));
|
|
404
406
|
}
|
|
405
|
-
var
|
|
407
|
+
var fn = (e) => !("type" in e), pn = (e, t, n) => ({ tr: r, dispatch: s, editor: o }) => {
|
|
406
408
|
var i;
|
|
407
409
|
if (s) {
|
|
408
410
|
n = {
|
|
@@ -427,7 +429,7 @@ var dn = (e) => !("type" in e), un = (e, t, n) => ({ tr: r, dispatch: s, editor:
|
|
|
427
429
|
};
|
|
428
430
|
if (!n.errorOnInvalidContent && !o.options.enableContentCheck && o.options.emitContentError)
|
|
429
431
|
try {
|
|
430
|
-
|
|
432
|
+
H(t, o.schema, {
|
|
431
433
|
parseOptions: l,
|
|
432
434
|
errorOnInvalidContent: !0
|
|
433
435
|
});
|
|
@@ -435,7 +437,7 @@ var dn = (e) => !("type" in e), un = (e, t, n) => ({ tr: r, dispatch: s, editor:
|
|
|
435
437
|
c(g);
|
|
436
438
|
}
|
|
437
439
|
try {
|
|
438
|
-
a =
|
|
440
|
+
a = H(t, o.schema, {
|
|
439
441
|
parseOptions: l,
|
|
440
442
|
errorOnInvalidContent: (i = n.errorOnInvalidContent) != null ? i : o.options.enableContentCheck
|
|
441
443
|
});
|
|
@@ -443,7 +445,7 @@ var dn = (e) => !("type" in e), un = (e, t, n) => ({ tr: r, dispatch: s, editor:
|
|
|
443
445
|
return c(g), !1;
|
|
444
446
|
}
|
|
445
447
|
let { from: d, to: u } = typeof e == "number" ? { from: e, to: e } : { from: e.from, to: e.to }, f = !0, p = !0;
|
|
446
|
-
if ((
|
|
448
|
+
if ((fn(a) ? a : [a]).forEach((g) => {
|
|
447
449
|
g.check(), f = f ? g.isText && g.marks.length === 0 : !1, p = p ? g.isBlock : !1;
|
|
448
450
|
}), d === u && p) {
|
|
449
451
|
const { parent: g } = r.doc.resolve(d);
|
|
@@ -453,7 +455,7 @@ var dn = (e) => !("type" in e), un = (e, t, n) => ({ tr: r, dispatch: s, editor:
|
|
|
453
455
|
if (f) {
|
|
454
456
|
if (Array.isArray(t))
|
|
455
457
|
m = t.map((g) => g.text || "").join("");
|
|
456
|
-
else if (t instanceof
|
|
458
|
+
else if (t instanceof B) {
|
|
457
459
|
let g = "";
|
|
458
460
|
t.forEach((v) => {
|
|
459
461
|
v.text && (g += v.text);
|
|
@@ -465,28 +467,28 @@ var dn = (e) => !("type" in e), un = (e, t, n) => ({ tr: r, dispatch: s, editor:
|
|
|
465
467
|
const g = r.doc.resolve(d), v = g.node(), b = g.parentOffset === 0, k = v.isText || v.isTextblock, M = v.content.size > 0;
|
|
466
468
|
b && k && M && (d = Math.max(0, d - 1)), r.replaceWith(d, u, m);
|
|
467
469
|
}
|
|
468
|
-
n.updateSelection &&
|
|
470
|
+
n.updateSelection && un(r, r.steps.length - 1, -1), n.applyInputRules && r.setMeta("applyInputRules", { from: d, text: m }), n.applyPasteRules && r.setMeta("applyPasteRules", { from: d, text: m });
|
|
469
471
|
}
|
|
470
472
|
return !0;
|
|
471
|
-
},
|
|
473
|
+
}, hn = () => ({ state: e, dispatch: t }) => we(e, t), mn = () => ({ state: e, dispatch: t }) => ke(e, t), gn = () => ({ state: e, dispatch: t }) => Me(e, t), vn = () => ({ state: e, dispatch: t }) => xe(e, t), yn = () => ({ state: e, dispatch: t, tr: n }) => {
|
|
472
474
|
try {
|
|
473
|
-
const r =
|
|
475
|
+
const r = Bt(e.doc, e.selection.$from.pos, -1);
|
|
474
476
|
return r == null ? !1 : (n.join(r, 2), t && t(n), !0);
|
|
475
477
|
} catch {
|
|
476
478
|
return !1;
|
|
477
479
|
}
|
|
478
|
-
},
|
|
480
|
+
}, bn = () => ({ state: e, dispatch: t, tr: n }) => {
|
|
479
481
|
try {
|
|
480
|
-
const r =
|
|
482
|
+
const r = Bt(e.doc, e.selection.$from.pos, 1);
|
|
481
483
|
return r == null ? !1 : (n.join(r, 2), t && t(n), !0);
|
|
482
484
|
} catch {
|
|
483
485
|
return !1;
|
|
484
486
|
}
|
|
485
|
-
},
|
|
486
|
-
function
|
|
487
|
+
}, wn = () => ({ state: e, dispatch: t }) => Se(e, t), kn = () => ({ state: e, dispatch: t }) => Ee(e, t);
|
|
488
|
+
function Ht() {
|
|
487
489
|
return typeof navigator < "u" ? /Mac/.test(navigator.platform) : !1;
|
|
488
490
|
}
|
|
489
|
-
function
|
|
491
|
+
function Mn(e) {
|
|
490
492
|
const t = e.split(/-(?!$)/);
|
|
491
493
|
let n = t[t.length - 1];
|
|
492
494
|
n === "Space" && (n = " ");
|
|
@@ -502,14 +504,14 @@ function wn(e) {
|
|
|
502
504
|
else if (/^s(hift)?$/i.test(c))
|
|
503
505
|
o = !0;
|
|
504
506
|
else if (/^mod$/i.test(c))
|
|
505
|
-
yt() ||
|
|
507
|
+
yt() || Ht() ? i = !0 : s = !0;
|
|
506
508
|
else
|
|
507
509
|
throw new Error(`Unrecognized modifier name: ${c}`);
|
|
508
510
|
}
|
|
509
511
|
return r && (n = `Alt-${n}`), s && (n = `Ctrl-${n}`), i && (n = `Meta-${n}`), o && (n = `Shift-${n}`), n;
|
|
510
512
|
}
|
|
511
|
-
var
|
|
512
|
-
const o =
|
|
513
|
+
var xn = (e) => ({ editor: t, view: n, tr: r, dispatch: s }) => {
|
|
514
|
+
const o = Mn(e).split(/-(?!$)/), i = o.find((l) => !["Alt", "Ctrl", "Meta", "Shift"].includes(l)), a = new KeyboardEvent("keydown", {
|
|
513
515
|
key: i === "Space" ? " " : i,
|
|
514
516
|
altKey: o.includes("Alt"),
|
|
515
517
|
ctrlKey: o.includes("Ctrl"),
|
|
@@ -525,7 +527,7 @@ var kn = (e) => ({ editor: t, view: n, tr: r, dispatch: s }) => {
|
|
|
525
527
|
d && s && r.maybeStep(d);
|
|
526
528
|
}), !0;
|
|
527
529
|
};
|
|
528
|
-
function
|
|
530
|
+
function V(e, t, n = {}) {
|
|
529
531
|
const { from: r, to: s, empty: o } = e.selection, i = t ? T(t, e.schema) : null, a = [];
|
|
530
532
|
e.doc.nodesBetween(r, s, (u, f) => {
|
|
531
533
|
if (u.isText)
|
|
@@ -540,13 +542,13 @@ function H(e, t, n = {}) {
|
|
|
540
542
|
const c = s - r, l = a.filter((u) => i ? i.name === u.node.type.name : !0).filter((u) => Z(u.node.attrs, n, { strict: !1 }));
|
|
541
543
|
return o ? !!l.length : l.reduce((u, f) => u + f.to - f.from, 0) >= c;
|
|
542
544
|
}
|
|
543
|
-
var
|
|
545
|
+
var Sn = (e, t = {}) => ({ state: n, dispatch: r }) => {
|
|
544
546
|
const s = T(e, n.schema);
|
|
545
|
-
return
|
|
546
|
-
},
|
|
547
|
+
return V(n, s, t) ? Te(n, r) : !1;
|
|
548
|
+
}, En = () => ({ state: e, dispatch: t }) => Ae(e, t), Tn = (e) => ({ state: t, dispatch: n }) => {
|
|
547
549
|
const r = T(e, t.schema);
|
|
548
|
-
return
|
|
549
|
-
},
|
|
550
|
+
return Le(r)(t, n);
|
|
551
|
+
}, An = () => ({ state: e, dispatch: t }) => Ce(e, t);
|
|
550
552
|
function nt(e, t) {
|
|
551
553
|
return t.nodes[e] ? "node" : t.marks[e] ? "mark" : null;
|
|
552
554
|
}
|
|
@@ -554,34 +556,38 @@ function Ct(e, t) {
|
|
|
554
556
|
const n = typeof t == "string" ? [t] : t;
|
|
555
557
|
return Object.keys(e).reduce((r, s) => (n.includes(s) || (r[s] = e[s]), r), {});
|
|
556
558
|
}
|
|
557
|
-
var
|
|
559
|
+
var Cn = (e, t) => ({ tr: n, state: r, dispatch: s }) => {
|
|
558
560
|
let o = null, i = null;
|
|
559
561
|
const a = nt(
|
|
560
562
|
typeof e == "string" ? e : e.name,
|
|
561
563
|
r.schema
|
|
562
564
|
);
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
565
|
+
if (!a)
|
|
566
|
+
return !1;
|
|
567
|
+
a === "node" && (o = T(e, r.schema)), a === "mark" && (i = z(e, r.schema));
|
|
568
|
+
let c = !1;
|
|
569
|
+
return n.selection.ranges.forEach((l) => {
|
|
570
|
+
r.doc.nodesBetween(l.$from.pos, l.$to.pos, (d, u) => {
|
|
571
|
+
o && o === d.type && (c = !0, s && n.setNodeMarkup(u, void 0, Ct(d.attrs, t))), i && d.marks.length && d.marks.forEach((f) => {
|
|
572
|
+
i === f.type && (c = !0, s && n.addMark(u, u + d.nodeSize, i.create(Ct(f.attrs, t))));
|
|
567
573
|
});
|
|
568
574
|
});
|
|
569
|
-
}),
|
|
570
|
-
},
|
|
575
|
+
}), c;
|
|
576
|
+
}, Pn = () => ({ tr: e, dispatch: t }) => (t && e.scrollIntoView(), !0), $n = () => ({ tr: e, dispatch: t }) => {
|
|
571
577
|
if (t) {
|
|
572
|
-
const n = new
|
|
578
|
+
const n = new _e(e.doc);
|
|
573
579
|
e.setSelection(n);
|
|
574
580
|
}
|
|
575
581
|
return !0;
|
|
576
|
-
},
|
|
582
|
+
}, Nn = () => ({ state: e, dispatch: t }) => Pe(e, t), Rn = () => ({ state: e, dispatch: t }) => $e(e, t), zn = () => ({ state: e, dispatch: t }) => Ne(e, t), In = () => ({ state: e, dispatch: t }) => Re(e, t), Bn = () => ({ state: e, dispatch: t }) => ze(e, t);
|
|
577
583
|
function ft(e, t, n = {}, r = {}) {
|
|
578
|
-
return
|
|
584
|
+
return H(e, t, {
|
|
579
585
|
slice: !1,
|
|
580
586
|
parseOptions: n,
|
|
581
587
|
errorOnInvalidContent: r.errorOnInvalidContent
|
|
582
588
|
});
|
|
583
589
|
}
|
|
584
|
-
var
|
|
590
|
+
var _n = (e, { errorOnInvalidContent: t, emitUpdate: n = !0, parseOptions: r = {} } = {}) => ({ editor: s, tr: o, dispatch: i, commands: a }) => {
|
|
585
591
|
const { doc: c } = o;
|
|
586
592
|
if (r.preserveWhitespace !== "full") {
|
|
587
593
|
const l = ft(e, s.schema, r, {
|
|
@@ -594,23 +600,23 @@ var In = (e, { errorOnInvalidContent: t, emitUpdate: n = !0, parseOptions: r = {
|
|
|
594
600
|
errorOnInvalidContent: t ?? s.options.enableContentCheck
|
|
595
601
|
});
|
|
596
602
|
};
|
|
597
|
-
function
|
|
598
|
-
const n =
|
|
603
|
+
function Vt(e, t) {
|
|
604
|
+
const n = z(t, e.schema), { from: r, to: s, empty: o } = e.selection, i = [];
|
|
599
605
|
o ? (e.storedMarks && i.push(...e.storedMarks), i.push(...e.selection.$head.marks())) : e.doc.nodesBetween(r, s, (c) => {
|
|
600
606
|
i.push(...c.marks);
|
|
601
607
|
});
|
|
602
608
|
const a = i.find((c) => c.type.name === n.name);
|
|
603
609
|
return a ? { ...a.attrs } : {};
|
|
604
610
|
}
|
|
605
|
-
function
|
|
606
|
-
const n = new
|
|
611
|
+
function jn(e, t) {
|
|
612
|
+
const n = new fe(e);
|
|
607
613
|
return t.forEach((r) => {
|
|
608
614
|
r.steps.forEach((s) => {
|
|
609
615
|
n.step(s);
|
|
610
616
|
});
|
|
611
617
|
}), n;
|
|
612
618
|
}
|
|
613
|
-
function
|
|
619
|
+
function Dn(e) {
|
|
614
620
|
for (let t = 0; t < e.edgeCount; t += 1) {
|
|
615
621
|
const { type: n } = e.edge(t);
|
|
616
622
|
if (n.isTextblock && !n.hasRequiredAttrs())
|
|
@@ -618,7 +624,7 @@ function Bn(e) {
|
|
|
618
624
|
}
|
|
619
625
|
return null;
|
|
620
626
|
}
|
|
621
|
-
function
|
|
627
|
+
function Qr(e, t, n) {
|
|
622
628
|
const r = [];
|
|
623
629
|
return e.nodesBetween(t.from, t.to, (s, o) => {
|
|
624
630
|
n(s) && r.push({
|
|
@@ -627,7 +633,7 @@ function Jr(e, t, n) {
|
|
|
627
633
|
});
|
|
628
634
|
}), r;
|
|
629
635
|
}
|
|
630
|
-
function
|
|
636
|
+
function On(e, t) {
|
|
631
637
|
for (let n = e.depth; n > 0; n -= 1) {
|
|
632
638
|
const r = e.node(n);
|
|
633
639
|
if (t(r))
|
|
@@ -640,7 +646,7 @@ function jn(e, t) {
|
|
|
640
646
|
}
|
|
641
647
|
}
|
|
642
648
|
function rt(e) {
|
|
643
|
-
return (t) =>
|
|
649
|
+
return (t) => On(t.$from, e);
|
|
644
650
|
}
|
|
645
651
|
function y(e, t, n) {
|
|
646
652
|
return e.config[t] === void 0 && e.parent ? y(e.parent, t, n) : typeof e.config[t] == "function" ? e.config[t].bind({
|
|
@@ -659,19 +665,19 @@ function bt(e) {
|
|
|
659
665
|
}).flat(10);
|
|
660
666
|
}
|
|
661
667
|
function wt(e, t) {
|
|
662
|
-
const n =
|
|
668
|
+
const n = je.fromSchema(t).serializeFragment(e), s = document.implementation.createHTMLDocument().createElement("div");
|
|
663
669
|
return s.appendChild(n), s.innerHTML;
|
|
664
670
|
}
|
|
665
|
-
function
|
|
671
|
+
function Wt(e) {
|
|
666
672
|
return typeof e == "function";
|
|
667
673
|
}
|
|
668
|
-
function
|
|
669
|
-
return
|
|
674
|
+
function x(e, t = void 0, ...n) {
|
|
675
|
+
return Wt(e) ? t ? e.bind(t)(...n) : e(...n) : e;
|
|
670
676
|
}
|
|
671
|
-
function
|
|
677
|
+
function Ln(e = {}) {
|
|
672
678
|
return Object.keys(e).length === 0 && e.constructor === Object;
|
|
673
679
|
}
|
|
674
|
-
function
|
|
680
|
+
function F(e) {
|
|
675
681
|
const t = e.filter((s) => s.type === "extension"), n = e.filter((s) => s.type === "node"), r = e.filter((s) => s.type === "mark");
|
|
676
682
|
return {
|
|
677
683
|
baseExtensions: t,
|
|
@@ -679,8 +685,8 @@ function V(e) {
|
|
|
679
685
|
markExtensions: r
|
|
680
686
|
};
|
|
681
687
|
}
|
|
682
|
-
function
|
|
683
|
-
const t = [], { nodeExtensions: n, markExtensions: r } =
|
|
688
|
+
function Ut(e) {
|
|
689
|
+
const t = [], { nodeExtensions: n, markExtensions: r } = F(e), s = [...n, ...r], o = {
|
|
684
690
|
default: null,
|
|
685
691
|
validate: void 0,
|
|
686
692
|
rendered: !0,
|
|
@@ -742,7 +748,7 @@ function Wt(e) {
|
|
|
742
748
|
});
|
|
743
749
|
}), t;
|
|
744
750
|
}
|
|
745
|
-
function
|
|
751
|
+
function Fn(...e) {
|
|
746
752
|
return e.filter((t) => !!t).reduce((t, n) => {
|
|
747
753
|
const r = { ...t };
|
|
748
754
|
return Object.entries(n).forEach(([s, o]) => {
|
|
@@ -770,9 +776,9 @@ function Dn(...e) {
|
|
|
770
776
|
function Q(e, t) {
|
|
771
777
|
return t.filter((n) => n.type === e.type.name).filter((n) => n.attribute.rendered).map((n) => n.attribute.renderHTML ? n.attribute.renderHTML(e.attrs) || {} : {
|
|
772
778
|
[n.name]: e.attrs[n.name]
|
|
773
|
-
}).reduce((n, r) =>
|
|
779
|
+
}).reduce((n, r) => Fn(n, r), {});
|
|
774
780
|
}
|
|
775
|
-
function
|
|
781
|
+
function Hn(e) {
|
|
776
782
|
return typeof e != "string" ? e : e.match(/^[+-]?(?:\d*\.)?\d+$/) ? Number(e) : e === "true" ? !0 : e === "false" ? !1 : e;
|
|
777
783
|
}
|
|
778
784
|
function Pt(e, t) {
|
|
@@ -783,7 +789,7 @@ function Pt(e, t) {
|
|
|
783
789
|
if (r === !1)
|
|
784
790
|
return !1;
|
|
785
791
|
const s = t.reduce((o, i) => {
|
|
786
|
-
const a = i.attribute.parseHTML ? i.attribute.parseHTML(n) :
|
|
792
|
+
const a = i.attribute.parseHTML ? i.attribute.parseHTML(n) : Hn(n.getAttribute(i.name));
|
|
787
793
|
return a == null ? o : {
|
|
788
794
|
...o,
|
|
789
795
|
[i.name]: a
|
|
@@ -796,12 +802,17 @@ function Pt(e, t) {
|
|
|
796
802
|
function $t(e) {
|
|
797
803
|
return Object.fromEntries(
|
|
798
804
|
// @ts-ignore
|
|
799
|
-
Object.entries(e).filter(([t, n]) => t === "attrs" &&
|
|
805
|
+
Object.entries(e).filter(([t, n]) => t === "attrs" && Ln(n) ? !1 : n != null)
|
|
800
806
|
);
|
|
801
807
|
}
|
|
802
|
-
function
|
|
808
|
+
function Nt(e) {
|
|
809
|
+
var t, n;
|
|
810
|
+
const r = {};
|
|
811
|
+
return !((t = e?.attribute) != null && t.isRequired) && "default" in (e?.attribute || {}) && (r.default = e.attribute.default), ((n = e?.attribute) == null ? void 0 : n.validate) !== void 0 && (r.validate = e.attribute.validate), [e.name, r];
|
|
812
|
+
}
|
|
813
|
+
function Vn(e, t) {
|
|
803
814
|
var n;
|
|
804
|
-
const r =
|
|
815
|
+
const r = Ut(e), { nodeExtensions: s, markExtensions: o } = F(e), i = (n = s.find((l) => y(l, "topNode"))) == null ? void 0 : n.name, a = Object.fromEntries(
|
|
805
816
|
s.map((l) => {
|
|
806
817
|
const d = r.filter((v) => v.type === l.name), u = {
|
|
807
818
|
name: l.name,
|
|
@@ -816,30 +827,22 @@ function Fn(e, t) {
|
|
|
816
827
|
};
|
|
817
828
|
}, {}), p = $t({
|
|
818
829
|
...f,
|
|
819
|
-
content:
|
|
820
|
-
marks:
|
|
821
|
-
group:
|
|
822
|
-
inline:
|
|
823
|
-
atom:
|
|
824
|
-
selectable:
|
|
825
|
-
draggable:
|
|
826
|
-
code:
|
|
827
|
-
whitespace:
|
|
828
|
-
linebreakReplacement:
|
|
830
|
+
content: x(y(l, "content", u)),
|
|
831
|
+
marks: x(y(l, "marks", u)),
|
|
832
|
+
group: x(y(l, "group", u)),
|
|
833
|
+
inline: x(y(l, "inline", u)),
|
|
834
|
+
atom: x(y(l, "atom", u)),
|
|
835
|
+
selectable: x(y(l, "selectable", u)),
|
|
836
|
+
draggable: x(y(l, "draggable", u)),
|
|
837
|
+
code: x(y(l, "code", u)),
|
|
838
|
+
whitespace: x(y(l, "whitespace", u)),
|
|
839
|
+
linebreakReplacement: x(
|
|
829
840
|
y(l, "linebreakReplacement", u)
|
|
830
841
|
),
|
|
831
|
-
defining:
|
|
832
|
-
isolating:
|
|
833
|
-
attrs: Object.fromEntries(
|
|
834
|
-
|
|
835
|
-
var b, k;
|
|
836
|
-
return [
|
|
837
|
-
v.name,
|
|
838
|
-
{ default: (b = v?.attribute) == null ? void 0 : b.default, validate: (k = v?.attribute) == null ? void 0 : k.validate }
|
|
839
|
-
];
|
|
840
|
-
})
|
|
841
|
-
)
|
|
842
|
-
}), h = S(y(l, "parseHTML", u));
|
|
842
|
+
defining: x(y(l, "defining", u)),
|
|
843
|
+
isolating: x(y(l, "isolating", u)),
|
|
844
|
+
attrs: Object.fromEntries(d.map(Nt))
|
|
845
|
+
}), h = x(y(l, "parseHTML", u));
|
|
843
846
|
h && (p.parseDOM = h.map(
|
|
844
847
|
(v) => Pt(v, d)
|
|
845
848
|
));
|
|
@@ -866,21 +869,13 @@ function Fn(e, t) {
|
|
|
866
869
|
};
|
|
867
870
|
}, {}), p = $t({
|
|
868
871
|
...f,
|
|
869
|
-
inclusive:
|
|
870
|
-
excludes:
|
|
871
|
-
group:
|
|
872
|
-
spanning:
|
|
873
|
-
code:
|
|
874
|
-
attrs: Object.fromEntries(
|
|
875
|
-
|
|
876
|
-
var v, b;
|
|
877
|
-
return [
|
|
878
|
-
g.name,
|
|
879
|
-
{ default: (v = g?.attribute) == null ? void 0 : v.default, validate: (b = g?.attribute) == null ? void 0 : b.validate }
|
|
880
|
-
];
|
|
881
|
-
})
|
|
882
|
-
)
|
|
883
|
-
}), h = S(y(l, "parseHTML", u));
|
|
872
|
+
inclusive: x(y(l, "inclusive", u)),
|
|
873
|
+
excludes: x(y(l, "excludes", u)),
|
|
874
|
+
group: x(y(l, "group", u)),
|
|
875
|
+
spanning: x(y(l, "spanning", u)),
|
|
876
|
+
code: x(y(l, "code", u)),
|
|
877
|
+
attrs: Object.fromEntries(d.map(Nt))
|
|
878
|
+
}), h = x(y(l, "parseHTML", u));
|
|
884
879
|
h && (p.parseDOM = h.map(
|
|
885
880
|
(g) => Pt(g, d)
|
|
886
881
|
));
|
|
@@ -897,7 +892,7 @@ function Fn(e, t) {
|
|
|
897
892
|
marks: c
|
|
898
893
|
});
|
|
899
894
|
}
|
|
900
|
-
function
|
|
895
|
+
function Wn(e) {
|
|
901
896
|
const t = e.filter((n, r) => e.indexOf(n) !== r);
|
|
902
897
|
return Array.from(new Set(t));
|
|
903
898
|
}
|
|
@@ -907,13 +902,13 @@ function kt(e) {
|
|
|
907
902
|
return s > o ? -1 : s < o ? 1 : 0;
|
|
908
903
|
});
|
|
909
904
|
}
|
|
910
|
-
function
|
|
911
|
-
const t = kt(bt(e)), n =
|
|
905
|
+
function Kt(e) {
|
|
906
|
+
const t = kt(bt(e)), n = Wn(t.map((r) => r.name));
|
|
912
907
|
return n.length && console.warn(
|
|
913
908
|
`[tiptap warn]: Duplicate extension names found: [${n.map((r) => `'${r}'`).join(", ")}]. This can lead to issues.`
|
|
914
909
|
), t;
|
|
915
910
|
}
|
|
916
|
-
function
|
|
911
|
+
function qt(e, t, n) {
|
|
917
912
|
const { from: r, to: s } = t, { blockSeparator: o = `
|
|
918
913
|
|
|
919
914
|
`, textSerializers: i = {} } = n || {};
|
|
@@ -933,19 +928,19 @@ function Kt(e, t, n) {
|
|
|
933
928
|
c.isText && (a += (f = c?.text) == null ? void 0 : f.slice(Math.max(r, l) - l, s - l));
|
|
934
929
|
}), a;
|
|
935
930
|
}
|
|
936
|
-
function
|
|
931
|
+
function Un(e, t) {
|
|
937
932
|
const n = {
|
|
938
933
|
from: 0,
|
|
939
934
|
to: e.content.size
|
|
940
935
|
};
|
|
941
|
-
return
|
|
936
|
+
return qt(e, n, t);
|
|
942
937
|
}
|
|
943
|
-
function
|
|
938
|
+
function Jt(e) {
|
|
944
939
|
return Object.fromEntries(
|
|
945
940
|
Object.entries(e.nodes).filter(([, t]) => t.spec.toText).map(([t, n]) => [t, n.spec.toText])
|
|
946
941
|
);
|
|
947
942
|
}
|
|
948
|
-
function
|
|
943
|
+
function Kn(e, t) {
|
|
949
944
|
const n = T(t, e.schema), { from: r, to: s } = e.selection, o = [];
|
|
950
945
|
e.doc.nodesBetween(r, s, (a) => {
|
|
951
946
|
o.push(a);
|
|
@@ -953,25 +948,25 @@ function Wn(e, t) {
|
|
|
953
948
|
const i = o.reverse().find((a) => a.type.name === n.name);
|
|
954
949
|
return i ? { ...i.attrs } : {};
|
|
955
950
|
}
|
|
956
|
-
function
|
|
951
|
+
function qn(e, t) {
|
|
957
952
|
const n = nt(
|
|
958
953
|
typeof t == "string" ? t : t.name,
|
|
959
954
|
e.schema
|
|
960
955
|
);
|
|
961
|
-
return n === "node" ?
|
|
956
|
+
return n === "node" ? Kn(e, t) : n === "mark" ? Vt(e, t) : {};
|
|
962
957
|
}
|
|
963
|
-
function
|
|
958
|
+
function Jn(e, t = JSON.stringify) {
|
|
964
959
|
const n = {};
|
|
965
960
|
return e.filter((r) => {
|
|
966
961
|
const s = t(r);
|
|
967
962
|
return Object.prototype.hasOwnProperty.call(n, s) ? !1 : n[s] = !0;
|
|
968
963
|
});
|
|
969
964
|
}
|
|
970
|
-
function
|
|
971
|
-
const t =
|
|
965
|
+
function Xn(e) {
|
|
966
|
+
const t = Jn(e);
|
|
972
967
|
return t.length === 1 ? t : t.filter((n, r) => !t.filter((o, i) => i !== r).some((o) => n.oldRange.from >= o.oldRange.from && n.oldRange.to <= o.oldRange.to && n.newRange.from >= o.newRange.from && n.newRange.to <= o.newRange.to));
|
|
973
968
|
}
|
|
974
|
-
function
|
|
969
|
+
function Yn(e) {
|
|
975
970
|
const { mapping: t, steps: n } = e, r = [];
|
|
976
971
|
return t.maps.forEach((s, o) => {
|
|
977
972
|
const i = [];
|
|
@@ -998,9 +993,9 @@ function Jn(e) {
|
|
|
998
993
|
}
|
|
999
994
|
});
|
|
1000
995
|
});
|
|
1001
|
-
}),
|
|
996
|
+
}), Xn(r);
|
|
1002
997
|
}
|
|
1003
|
-
function
|
|
998
|
+
function Xt(e, t, n) {
|
|
1004
999
|
const r = [];
|
|
1005
1000
|
return e === t ? n.resolve(e).marks().forEach((s) => {
|
|
1006
1001
|
const o = n.resolve(e), i = vt(o, s.type);
|
|
@@ -1018,7 +1013,7 @@ function Jt(e, t, n) {
|
|
|
1018
1013
|
);
|
|
1019
1014
|
}), r;
|
|
1020
1015
|
}
|
|
1021
|
-
var
|
|
1016
|
+
var Gr = (e, t, n, r = 20) => {
|
|
1022
1017
|
const s = e.doc.resolve(n);
|
|
1023
1018
|
let o = r, i = null;
|
|
1024
1019
|
for (; o > 0 && i === null; ) {
|
|
@@ -1038,7 +1033,7 @@ function Y(e, t, n) {
|
|
|
1038
1033
|
})
|
|
1039
1034
|
);
|
|
1040
1035
|
}
|
|
1041
|
-
var
|
|
1036
|
+
var Zn = (e, t = 500) => {
|
|
1042
1037
|
let n = "";
|
|
1043
1038
|
const r = e.parentOffset;
|
|
1044
1039
|
return e.parent.nodesBetween(Math.max(0, r - t), r, (s, o, i, a) => {
|
|
@@ -1053,7 +1048,7 @@ var Xn = (e, t = 500) => {
|
|
|
1053
1048
|
}), n;
|
|
1054
1049
|
};
|
|
1055
1050
|
function pt(e, t, n = {}) {
|
|
1056
|
-
const { empty: r, ranges: s } = e.selection, o = t ?
|
|
1051
|
+
const { empty: r, ranges: s } = e.selection, o = t ? z(t, e.schema) : null;
|
|
1057
1052
|
if (r)
|
|
1058
1053
|
return !!(e.storedMarks || e.selection.$from.marks()).filter((u) => o ? o.name === u.type.name : !0).find((u) => Z(u.attrs, n, { strict: !1 }));
|
|
1059
1054
|
let i = 0;
|
|
@@ -1077,13 +1072,13 @@ function pt(e, t, n = {}) {
|
|
|
1077
1072
|
const c = a.filter((u) => o ? o.name === u.mark.type.name : !0).filter((u) => Z(u.mark.attrs, n, { strict: !1 })).reduce((u, f) => u + f.to - f.from, 0), l = a.filter((u) => o ? u.mark.type !== o && u.mark.type.excludes(o) : !0).reduce((u, f) => u + f.to - f.from, 0);
|
|
1078
1073
|
return (c > 0 ? c + l : c) >= i;
|
|
1079
1074
|
}
|
|
1080
|
-
function
|
|
1075
|
+
function Qn(e, t, n = {}) {
|
|
1081
1076
|
if (!t)
|
|
1082
|
-
return
|
|
1077
|
+
return V(e, null, n) || pt(e, null, n);
|
|
1083
1078
|
const r = nt(t, e.schema);
|
|
1084
|
-
return r === "node" ?
|
|
1079
|
+
return r === "node" ? V(e, t, n) : r === "mark" ? pt(e, t, n) : !1;
|
|
1085
1080
|
}
|
|
1086
|
-
var
|
|
1081
|
+
var ts = (e, t) => {
|
|
1087
1082
|
const { $from: n, $to: r, $anchor: s } = e.selection;
|
|
1088
1083
|
if (t) {
|
|
1089
1084
|
const o = rt((a) => a.type.name === t)(e.selection);
|
|
@@ -1093,22 +1088,22 @@ var Yr = (e, t) => {
|
|
|
1093
1088
|
return s.pos + 1 === i.end();
|
|
1094
1089
|
}
|
|
1095
1090
|
return !(r.parentOffset < r.parent.nodeSize - 2 || n.pos !== r.pos);
|
|
1096
|
-
},
|
|
1091
|
+
}, es = (e) => {
|
|
1097
1092
|
const { $from: t, $to: n } = e.selection;
|
|
1098
1093
|
return !(t.parentOffset > 0 || t.pos !== n.pos);
|
|
1099
1094
|
};
|
|
1100
|
-
function
|
|
1095
|
+
function Rt(e, t) {
|
|
1101
1096
|
return Array.isArray(t) ? t.some((n) => (typeof n == "string" ? n : n.name) === e.name) : t;
|
|
1102
1097
|
}
|
|
1103
|
-
function
|
|
1104
|
-
const { nodeExtensions: n } =
|
|
1098
|
+
function zt(e, t) {
|
|
1099
|
+
const { nodeExtensions: n } = F(t), r = n.find((i) => i.name === e);
|
|
1105
1100
|
if (!r)
|
|
1106
1101
|
return !1;
|
|
1107
1102
|
const s = {
|
|
1108
1103
|
name: r.name,
|
|
1109
1104
|
options: r.options,
|
|
1110
1105
|
storage: r.storage
|
|
1111
|
-
}, o =
|
|
1106
|
+
}, o = x(y(r, "group", s));
|
|
1112
1107
|
return typeof o != "string" ? !1 : o.split(" ").includes("list");
|
|
1113
1108
|
}
|
|
1114
1109
|
function Mt(e, {
|
|
@@ -1136,10 +1131,10 @@ function Mt(e, {
|
|
|
1136
1131
|
}
|
|
1137
1132
|
return !1;
|
|
1138
1133
|
}
|
|
1139
|
-
function
|
|
1134
|
+
function ns(e) {
|
|
1140
1135
|
return e instanceof G;
|
|
1141
1136
|
}
|
|
1142
|
-
function
|
|
1137
|
+
function Gn(e, t, n) {
|
|
1143
1138
|
var r;
|
|
1144
1139
|
const { selection: s } = t;
|
|
1145
1140
|
let o = null;
|
|
@@ -1161,11 +1156,11 @@ function Zn(e, t, n) {
|
|
|
1161
1156
|
}), l;
|
|
1162
1157
|
});
|
|
1163
1158
|
}
|
|
1164
|
-
var
|
|
1165
|
-
const { selection: o } = n, { empty: i, ranges: a } = o, c =
|
|
1159
|
+
var tr = (e, t = {}) => ({ tr: n, state: r, dispatch: s }) => {
|
|
1160
|
+
const { selection: o } = n, { empty: i, ranges: a } = o, c = z(e, r.schema);
|
|
1166
1161
|
if (s)
|
|
1167
1162
|
if (i) {
|
|
1168
|
-
const l =
|
|
1163
|
+
const l = Vt(r, c);
|
|
1169
1164
|
n.addStoredMark(
|
|
1170
1165
|
c.create({
|
|
1171
1166
|
...l,
|
|
@@ -1189,41 +1184,50 @@ var Qn = (e, t = {}) => ({ tr: n, state: r, dispatch: s }) => {
|
|
|
1189
1184
|
}) : n.addMark(h, m, c.create(t));
|
|
1190
1185
|
});
|
|
1191
1186
|
});
|
|
1192
|
-
return
|
|
1193
|
-
},
|
|
1187
|
+
return Gn(r, n, c);
|
|
1188
|
+
}, er = (e, t) => ({ tr: n }) => (n.setMeta(e, t), !0), nr = (e, t = {}) => ({ state: n, dispatch: r, chain: s }) => {
|
|
1194
1189
|
const o = T(e, n.schema);
|
|
1195
1190
|
let i;
|
|
1196
1191
|
return n.selection.$anchor.sameParent(n.selection.$head) && (i = n.selection.$anchor.parent.attrs), o.isTextblock ? s().command(({ commands: a }) => Tt(o, { ...i, ...t })(n) ? !0 : a.clearNodes()).command(({ state: a }) => Tt(o, { ...i, ...t })(a, r)).run() : (console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'), !1);
|
|
1197
|
-
},
|
|
1192
|
+
}, rr = (e) => ({ tr: t, dispatch: n }) => {
|
|
1198
1193
|
if (n) {
|
|
1199
|
-
const { doc: r } = t, s =
|
|
1194
|
+
const { doc: r } = t, s = D(e, 0, r.content.size), o = G.create(r, s);
|
|
1200
1195
|
t.setSelection(o);
|
|
1201
1196
|
}
|
|
1202
1197
|
return !0;
|
|
1203
|
-
},
|
|
1198
|
+
}, sr = (e, t) => ({ tr: n, state: r, dispatch: s }) => {
|
|
1199
|
+
const { selection: o } = r;
|
|
1200
|
+
let i, a;
|
|
1201
|
+
return typeof t == "number" ? (i = t, a = t) : t && "from" in t && "to" in t ? (i = t.from, a = t.to) : (i = o.from, a = o.to), s && n.doc.nodesBetween(i, a, (c, l) => {
|
|
1202
|
+
c.isText || n.setNodeMarkup(l, void 0, {
|
|
1203
|
+
...c.attrs,
|
|
1204
|
+
dir: e
|
|
1205
|
+
});
|
|
1206
|
+
}), !0;
|
|
1207
|
+
}, or = (e) => ({ tr: t, dispatch: n }) => {
|
|
1204
1208
|
if (n) {
|
|
1205
|
-
const { doc: r } = t, { from: s, to: o } = typeof e == "number" ? { from: e, to: e } : e, i = P.atStart(r).from, a = P.atEnd(r).to, c =
|
|
1209
|
+
const { doc: r } = t, { from: s, to: o } = typeof e == "number" ? { from: e, to: e } : e, i = P.atStart(r).from, a = P.atEnd(r).to, c = D(s, i, a), l = D(o, i, a), d = P.create(r, c, l);
|
|
1206
1210
|
t.setSelection(d);
|
|
1207
1211
|
}
|
|
1208
1212
|
return !0;
|
|
1209
|
-
},
|
|
1213
|
+
}, ir = (e) => ({ state: t, dispatch: n }) => {
|
|
1210
1214
|
const r = T(e, t.schema);
|
|
1211
|
-
return
|
|
1215
|
+
return Fe(r)(t, n);
|
|
1212
1216
|
};
|
|
1213
|
-
function
|
|
1217
|
+
function It(e, t) {
|
|
1214
1218
|
const n = e.storedMarks || e.selection.$to.parentOffset && e.selection.$from.marks();
|
|
1215
1219
|
if (n) {
|
|
1216
1220
|
const r = n.filter((s) => t?.includes(s.type.name));
|
|
1217
1221
|
e.tr.ensureMarks(r);
|
|
1218
1222
|
}
|
|
1219
1223
|
}
|
|
1220
|
-
var
|
|
1224
|
+
var ar = ({ keepMarks: e = !0 } = {}) => ({ tr: t, state: n, dispatch: r, editor: s }) => {
|
|
1221
1225
|
const { selection: o, doc: i } = t, { $from: a, $to: c } = o, l = s.extensionManager.attributes, d = Y(l, a.node().type.name, a.node().attrs);
|
|
1222
1226
|
if (o instanceof G && o.node.isBlock)
|
|
1223
|
-
return !a.parentOffset || !X(i, a.pos) ? !1 : (r && (e &&
|
|
1227
|
+
return !a.parentOffset || !X(i, a.pos) ? !1 : (r && (e && It(n, s.extensionManager.splittableMarks), t.split(a.pos).scrollIntoView()), !0);
|
|
1224
1228
|
if (!a.parent.isBlock)
|
|
1225
1229
|
return !1;
|
|
1226
|
-
const u = c.parentOffset === c.parent.content.size, f = a.depth === 0 ? void 0 :
|
|
1230
|
+
const u = c.parentOffset === c.parent.content.size, f = a.depth === 0 ? void 0 : Dn(a.node(-1).contentMatchAt(a.indexAfter(-1)));
|
|
1227
1231
|
let p = u && f ? [
|
|
1228
1232
|
{
|
|
1229
1233
|
type: f,
|
|
@@ -1240,10 +1244,10 @@ var sr = ({ keepMarks: e = !0 } = {}) => ({ tr: t, state: n, dispatch: r, editor
|
|
|
1240
1244
|
const m = t.mapping.map(a.before()), g = t.doc.resolve(m);
|
|
1241
1245
|
a.node(-1).canReplaceWith(g.index(), g.index() + 1, f) && t.setNodeMarkup(t.mapping.map(a.before()), f);
|
|
1242
1246
|
}
|
|
1243
|
-
e &&
|
|
1247
|
+
e && It(n, s.extensionManager.splittableMarks), t.scrollIntoView();
|
|
1244
1248
|
}
|
|
1245
1249
|
return h;
|
|
1246
|
-
},
|
|
1250
|
+
}, cr = (e, t = {}) => ({ tr: n, state: r, dispatch: s, editor: o }) => {
|
|
1247
1251
|
var i;
|
|
1248
1252
|
const a = T(e, r.schema), { $from: c, $to: l } = r.selection, d = r.selection.node;
|
|
1249
1253
|
if (d && d.isBlock || c.depth < 2 || !c.sameParent(l))
|
|
@@ -1256,10 +1260,10 @@ var sr = ({ keepMarks: e = !0 } = {}) => ({ tr: t, state: n, dispatch: r, editor
|
|
|
1256
1260
|
if (c.depth === 2 || c.node(-3).type !== a || c.index(-2) !== c.node(-2).childCount - 1)
|
|
1257
1261
|
return !1;
|
|
1258
1262
|
if (s) {
|
|
1259
|
-
let v =
|
|
1263
|
+
let v = B.empty;
|
|
1260
1264
|
const b = c.index(-1) ? 1 : c.index(-2) ? 2 : 3;
|
|
1261
1265
|
for (let A = c.depth - b; A >= c.depth - 3; A -= 1)
|
|
1262
|
-
v =
|
|
1266
|
+
v = B.from(c.node(A).copy(v));
|
|
1263
1267
|
const k = (
|
|
1264
1268
|
// eslint-disable-next-line no-nested-ternary
|
|
1265
1269
|
c.indexAfter(-1) < c.node(-2).childCount ? 1 : c.indexAfter(-2) < c.node(-3).childCount ? 2 : 3
|
|
@@ -1267,11 +1271,11 @@ var sr = ({ keepMarks: e = !0 } = {}) => ({ tr: t, state: n, dispatch: r, editor
|
|
|
1267
1271
|
...Y(f, c.node().type.name, c.node().attrs),
|
|
1268
1272
|
...t
|
|
1269
1273
|
}, w = ((i = a.contentMatch.defaultType) == null ? void 0 : i.createAndFill(M)) || void 0;
|
|
1270
|
-
v = v.append(
|
|
1271
|
-
const
|
|
1272
|
-
n.replace(
|
|
1274
|
+
v = v.append(B.from(a.createAndFill(null, w) || void 0));
|
|
1275
|
+
const S = c.before(c.depth - (b - 1));
|
|
1276
|
+
n.replace(S, c.after(-k), new Oe(v, 4 - b, 0));
|
|
1273
1277
|
let E = -1;
|
|
1274
|
-
n.doc.nodesBetween(
|
|
1278
|
+
n.doc.nodesBetween(S, n.doc.content.size, (A, C) => {
|
|
1275
1279
|
if (E > -1)
|
|
1276
1280
|
return !1;
|
|
1277
1281
|
A.isTextblock && A.content.size === 0 && (E = C + 1);
|
|
@@ -1297,7 +1301,7 @@ var sr = ({ keepMarks: e = !0 } = {}) => ({ tr: t, state: n, dispatch: r, editor
|
|
|
1297
1301
|
const { selection: v, storedMarks: b } = r, { splittableMarks: k } = o.extensionManager, M = b || v.$to.parentOffset && v.$from.marks();
|
|
1298
1302
|
if (n.split(c.pos, 2, g).scrollIntoView(), !M || !s)
|
|
1299
1303
|
return !0;
|
|
1300
|
-
const w = M.filter((
|
|
1304
|
+
const w = M.filter((S) => k.includes(S.type.name));
|
|
1301
1305
|
n.ensureMarks(w);
|
|
1302
1306
|
}
|
|
1303
1307
|
return !0;
|
|
@@ -1319,32 +1323,32 @@ var sr = ({ keepMarks: e = !0 } = {}) => ({ tr: t, state: n, dispatch: r, editor
|
|
|
1319
1323
|
return !0;
|
|
1320
1324
|
const s = e.doc.nodeAt(r);
|
|
1321
1325
|
return n.node.type === s?.type && ht(e.doc, r) && e.join(r), !0;
|
|
1322
|
-
},
|
|
1326
|
+
}, lr = (e, t, n, r = {}) => ({ editor: s, tr: o, state: i, dispatch: a, chain: c, commands: l, can: d }) => {
|
|
1323
1327
|
const { extensions: u, splittableMarks: f } = s.extensionManager, p = T(e, i.schema), h = T(t, i.schema), { selection: m, storedMarks: g } = i, { $from: v, $to: b } = m, k = v.blockRange(b), M = g || m.$to.parentOffset && m.$from.marks();
|
|
1324
1328
|
if (!k)
|
|
1325
1329
|
return !1;
|
|
1326
|
-
const w = rt((
|
|
1330
|
+
const w = rt((S) => zt(S.type.name, u))(m);
|
|
1327
1331
|
if (k.depth >= 1 && w && k.depth - w.depth <= 1) {
|
|
1328
1332
|
if (w.node.type === p)
|
|
1329
1333
|
return l.liftListItem(h);
|
|
1330
|
-
if (
|
|
1334
|
+
if (zt(w.node.type.name, u) && p.validContent(w.node.content) && a)
|
|
1331
1335
|
return c().command(() => (o.setNodeMarkup(w.pos, p), !0)).command(() => dt(o, p)).command(() => ut(o, p)).run();
|
|
1332
1336
|
}
|
|
1333
1337
|
return !n || !M || !a ? c().command(() => d().wrapInList(p, r) ? !0 : l.clearNodes()).wrapInList(p, r).command(() => dt(o, p)).command(() => ut(o, p)).run() : c().command(() => {
|
|
1334
|
-
const
|
|
1335
|
-
return o.ensureMarks(E),
|
|
1338
|
+
const S = d().wrapInList(p, r), E = M.filter((A) => f.includes(A.type.name));
|
|
1339
|
+
return o.ensureMarks(E), S ? !0 : l.clearNodes();
|
|
1336
1340
|
}).wrapInList(p, r).command(() => dt(o, p)).command(() => ut(o, p)).run();
|
|
1337
|
-
},
|
|
1338
|
-
const { extendEmptyMarkRange: o = !1 } = n, i =
|
|
1341
|
+
}, dr = (e, t = {}, n = {}) => ({ state: r, commands: s }) => {
|
|
1342
|
+
const { extendEmptyMarkRange: o = !1 } = n, i = z(e, r.schema);
|
|
1339
1343
|
return pt(r, i, t) ? s.unsetMark(i, { extendEmptyMarkRange: o }) : s.setMark(i, t);
|
|
1340
|
-
},
|
|
1341
|
-
const o = T(e, r.schema), i = T(t, r.schema), a =
|
|
1344
|
+
}, ur = (e, t, n = {}) => ({ state: r, commands: s }) => {
|
|
1345
|
+
const o = T(e, r.schema), i = T(t, r.schema), a = V(r, o, n);
|
|
1342
1346
|
let c;
|
|
1343
1347
|
return r.selection.$anchor.sameParent(r.selection.$head) && (c = r.selection.$anchor.parent.attrs), a ? s.setNode(i, c) : s.setNode(o, { ...c, ...n });
|
|
1344
|
-
},
|
|
1348
|
+
}, fr = (e, t = {}) => ({ state: n, commands: r }) => {
|
|
1345
1349
|
const s = T(e, n.schema);
|
|
1346
|
-
return
|
|
1347
|
-
},
|
|
1350
|
+
return V(n, s, t) ? r.lift(s) : r.wrapIn(s, t);
|
|
1351
|
+
}, pr = () => ({ state: e, dispatch: t }) => {
|
|
1348
1352
|
const n = e.plugins;
|
|
1349
1353
|
for (let r = 0; r < n.length; r += 1) {
|
|
1350
1354
|
const s = n[r];
|
|
@@ -1364,14 +1368,14 @@ var sr = ({ keepMarks: e = !0 } = {}) => ({ tr: t, state: n, dispatch: r, editor
|
|
|
1364
1368
|
}
|
|
1365
1369
|
}
|
|
1366
1370
|
return !1;
|
|
1367
|
-
},
|
|
1371
|
+
}, hr = () => ({ tr: e, dispatch: t }) => {
|
|
1368
1372
|
const { selection: n } = e, { empty: r, ranges: s } = n;
|
|
1369
1373
|
return r || t && s.forEach((o) => {
|
|
1370
1374
|
e.removeMark(o.$from.pos, o.$to.pos);
|
|
1371
1375
|
}), !0;
|
|
1372
|
-
},
|
|
1376
|
+
}, mr = (e, t = {}) => ({ tr: n, state: r, dispatch: s }) => {
|
|
1373
1377
|
var o;
|
|
1374
|
-
const { extendEmptyMarkRange: i = !1 } = t, { selection: a } = n, c =
|
|
1378
|
+
const { extendEmptyMarkRange: i = !1 } = t, { selection: a } = n, c = z(e, r.schema), { $from: l, empty: d, ranges: u } = a;
|
|
1375
1379
|
if (!s)
|
|
1376
1380
|
return !0;
|
|
1377
1381
|
if (d && i) {
|
|
@@ -1383,55 +1387,68 @@ var sr = ({ keepMarks: e = !0 } = {}) => ({ tr: t, state: n, dispatch: r, editor
|
|
|
1383
1387
|
n.removeMark(f.$from.pos, f.$to.pos, c);
|
|
1384
1388
|
});
|
|
1385
1389
|
return n.removeStoredMark(c), !0;
|
|
1386
|
-
},
|
|
1390
|
+
}, gr = (e) => ({ tr: t, state: n, dispatch: r }) => {
|
|
1391
|
+
const { selection: s } = n;
|
|
1392
|
+
let o, i;
|
|
1393
|
+
return typeof e == "number" ? (o = e, i = e) : e && "from" in e && "to" in e ? (o = e.from, i = e.to) : (o = s.from, i = s.to), r && t.doc.nodesBetween(o, i, (a, c) => {
|
|
1394
|
+
if (a.isText)
|
|
1395
|
+
return;
|
|
1396
|
+
const l = { ...a.attrs };
|
|
1397
|
+
delete l.dir, t.setNodeMarkup(c, void 0, l);
|
|
1398
|
+
}), !0;
|
|
1399
|
+
}, vr = (e, t = {}) => ({ tr: n, state: r, dispatch: s }) => {
|
|
1387
1400
|
let o = null, i = null;
|
|
1388
1401
|
const a = nt(
|
|
1389
1402
|
typeof e == "string" ? e : e.name,
|
|
1390
1403
|
r.schema
|
|
1391
1404
|
);
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1405
|
+
if (!a)
|
|
1406
|
+
return !1;
|
|
1407
|
+
a === "node" && (o = T(e, r.schema)), a === "mark" && (i = z(e, r.schema));
|
|
1408
|
+
let c = !1;
|
|
1409
|
+
return n.selection.ranges.forEach((l) => {
|
|
1410
|
+
const d = l.$from.pos, u = l.$to.pos;
|
|
1411
|
+
let f, p, h, m;
|
|
1412
|
+
n.selection.empty ? r.doc.nodesBetween(d, u, (g, v) => {
|
|
1413
|
+
o && o === g.type && (c = !0, h = Math.max(v, d), m = Math.min(v + g.nodeSize, u), f = v, p = g);
|
|
1414
|
+
}) : r.doc.nodesBetween(d, u, (g, v) => {
|
|
1415
|
+
v < d && o && o === g.type && (c = !0, h = Math.max(v, d), m = Math.min(v + g.nodeSize, u), f = v, p = g), v >= d && v <= u && (o && o === g.type && (c = !0, s && n.setNodeMarkup(v, void 0, {
|
|
1416
|
+
...g.attrs,
|
|
1400
1417
|
...t
|
|
1401
|
-
}), i &&
|
|
1402
|
-
if (i ===
|
|
1403
|
-
const
|
|
1418
|
+
})), i && g.marks.length && g.marks.forEach((b) => {
|
|
1419
|
+
if (i === b.type && (c = !0, s)) {
|
|
1420
|
+
const k = Math.max(v, d), M = Math.min(v + g.nodeSize, u);
|
|
1404
1421
|
n.addMark(
|
|
1405
|
-
b,
|
|
1406
1422
|
k,
|
|
1423
|
+
M,
|
|
1407
1424
|
i.create({
|
|
1408
|
-
...
|
|
1425
|
+
...b.attrs,
|
|
1409
1426
|
...t
|
|
1410
1427
|
})
|
|
1411
1428
|
);
|
|
1412
1429
|
}
|
|
1413
1430
|
}));
|
|
1414
|
-
}),
|
|
1415
|
-
...
|
|
1431
|
+
}), p && (f !== void 0 && s && n.setNodeMarkup(f, void 0, {
|
|
1432
|
+
...p.attrs,
|
|
1416
1433
|
...t
|
|
1417
|
-
}), i &&
|
|
1418
|
-
i ===
|
|
1419
|
-
p,
|
|
1434
|
+
}), i && p.marks.length && p.marks.forEach((g) => {
|
|
1435
|
+
i === g.type && s && n.addMark(
|
|
1420
1436
|
h,
|
|
1437
|
+
m,
|
|
1421
1438
|
i.create({
|
|
1422
|
-
...
|
|
1439
|
+
...g.attrs,
|
|
1423
1440
|
...t
|
|
1424
1441
|
})
|
|
1425
1442
|
);
|
|
1426
1443
|
}));
|
|
1427
|
-
}),
|
|
1428
|
-
},
|
|
1444
|
+
}), c;
|
|
1445
|
+
}, yr = (e, t = {}) => ({ state: n, dispatch: r }) => {
|
|
1429
1446
|
const s = T(e, n.schema);
|
|
1430
|
-
return
|
|
1431
|
-
},
|
|
1447
|
+
return Ie(s, t)(n, r);
|
|
1448
|
+
}, br = (e, t = {}) => ({ state: n, dispatch: r }) => {
|
|
1432
1449
|
const s = T(e, n.schema);
|
|
1433
|
-
return
|
|
1434
|
-
},
|
|
1450
|
+
return He(s, t)(n, r);
|
|
1451
|
+
}, wr = class {
|
|
1435
1452
|
constructor() {
|
|
1436
1453
|
this.callbacks = {};
|
|
1437
1454
|
}
|
|
@@ -1460,7 +1477,7 @@ var sr = ({ keepMarks: e = !0 } = {}) => ({ tr: t, state: n, dispatch: r, editor
|
|
|
1460
1477
|
var t;
|
|
1461
1478
|
this.find = e.find, this.handler = e.handler, this.undoable = (t = e.undoable) != null ? t : !0;
|
|
1462
1479
|
}
|
|
1463
|
-
},
|
|
1480
|
+
}, kr = (e, t) => {
|
|
1464
1481
|
if (gt(t))
|
|
1465
1482
|
return t.exec(e);
|
|
1466
1483
|
const n = t(e);
|
|
@@ -1481,11 +1498,11 @@ function K(e) {
|
|
|
1481
1498
|
)
|
|
1482
1499
|
return !1;
|
|
1483
1500
|
let d = !1;
|
|
1484
|
-
const u =
|
|
1501
|
+
const u = Zn(l) + o;
|
|
1485
1502
|
return i.forEach((f) => {
|
|
1486
1503
|
if (d)
|
|
1487
1504
|
return;
|
|
1488
|
-
const p =
|
|
1505
|
+
const p = kr(u, f.find);
|
|
1489
1506
|
if (!p)
|
|
1490
1507
|
return;
|
|
1491
1508
|
const h = c.state.tr, m = tt({
|
|
@@ -1513,8 +1530,8 @@ function K(e) {
|
|
|
1513
1530
|
}), c.dispatch(h), d = !0);
|
|
1514
1531
|
}), d;
|
|
1515
1532
|
}
|
|
1516
|
-
function
|
|
1517
|
-
const { editor: t, rules: n } = e, r = new
|
|
1533
|
+
function Mr(e) {
|
|
1534
|
+
const { editor: t, rules: n } = e, r = new $({
|
|
1518
1535
|
state: {
|
|
1519
1536
|
init() {
|
|
1520
1537
|
return null;
|
|
@@ -1526,7 +1543,7 @@ function yr(e) {
|
|
|
1526
1543
|
const c = s.getMeta("applyInputRules");
|
|
1527
1544
|
return !!c && setTimeout(() => {
|
|
1528
1545
|
let { text: d } = c;
|
|
1529
|
-
typeof d == "string" ? d = d : d = wt(
|
|
1546
|
+
typeof d == "string" ? d = d : d = wt(B.from(d), i.schema);
|
|
1530
1547
|
const { from: u } = c, f = u + d.length;
|
|
1531
1548
|
K({
|
|
1532
1549
|
editor: t,
|
|
@@ -1585,19 +1602,19 @@ function yr(e) {
|
|
|
1585
1602
|
});
|
|
1586
1603
|
return r;
|
|
1587
1604
|
}
|
|
1588
|
-
function
|
|
1605
|
+
function xr(e) {
|
|
1589
1606
|
return Object.prototype.toString.call(e).slice(8, -1);
|
|
1590
1607
|
}
|
|
1591
1608
|
function q(e) {
|
|
1592
|
-
return
|
|
1609
|
+
return xr(e) !== "Object" ? !1 : e.constructor === Object && Object.getPrototypeOf(e) === Object.prototype;
|
|
1593
1610
|
}
|
|
1594
|
-
function
|
|
1611
|
+
function Yt(e, t) {
|
|
1595
1612
|
const n = { ...e };
|
|
1596
1613
|
return q(e) && q(t) && Object.keys(t).forEach((r) => {
|
|
1597
|
-
q(t[r]) && q(e[r]) ? n[r] =
|
|
1614
|
+
q(t[r]) && q(e[r]) ? n[r] = Yt(e[r], t[r]) : n[r] = t[r];
|
|
1598
1615
|
}), n;
|
|
1599
1616
|
}
|
|
1600
|
-
var
|
|
1617
|
+
var xt = class {
|
|
1601
1618
|
constructor(e = {}) {
|
|
1602
1619
|
this.type = "extendable", this.parent = null, this.child = null, this.name = "", this.config = {
|
|
1603
1620
|
name: this.name
|
|
@@ -1608,7 +1625,7 @@ var St = class {
|
|
|
1608
1625
|
}
|
|
1609
1626
|
get options() {
|
|
1610
1627
|
return {
|
|
1611
|
-
...
|
|
1628
|
+
...x(
|
|
1612
1629
|
y(this, "addOptions", {
|
|
1613
1630
|
name: this.name
|
|
1614
1631
|
})
|
|
@@ -1617,7 +1634,7 @@ var St = class {
|
|
|
1617
1634
|
}
|
|
1618
1635
|
get storage() {
|
|
1619
1636
|
return {
|
|
1620
|
-
...
|
|
1637
|
+
...x(
|
|
1621
1638
|
y(this, "addStorage", {
|
|
1622
1639
|
name: this.name,
|
|
1623
1640
|
options: this.options
|
|
@@ -1628,7 +1645,7 @@ var St = class {
|
|
|
1628
1645
|
configure(e = {}) {
|
|
1629
1646
|
const t = this.extend({
|
|
1630
1647
|
...this.config,
|
|
1631
|
-
addOptions: () =>
|
|
1648
|
+
addOptions: () => Yt(this.options, e)
|
|
1632
1649
|
});
|
|
1633
1650
|
return t.name = this.name, t.parent = this.parent, t;
|
|
1634
1651
|
}
|
|
@@ -1636,7 +1653,7 @@ var St = class {
|
|
|
1636
1653
|
const t = new this.constructor({ ...this.config, ...e });
|
|
1637
1654
|
return t.parent = this, this.child = t, t.name = "name" in e ? e.name : t.parent.name, t;
|
|
1638
1655
|
}
|
|
1639
|
-
},
|
|
1656
|
+
}, Sr = class Zt extends xt {
|
|
1640
1657
|
constructor() {
|
|
1641
1658
|
super(...arguments), this.type = "mark";
|
|
1642
1659
|
}
|
|
@@ -1646,7 +1663,7 @@ var St = class {
|
|
|
1646
1663
|
*/
|
|
1647
1664
|
static create(t = {}) {
|
|
1648
1665
|
const n = typeof t == "function" ? t() : t;
|
|
1649
|
-
return new
|
|
1666
|
+
return new Zt(n);
|
|
1650
1667
|
}
|
|
1651
1668
|
static handleExit({ editor: t, mark: n }) {
|
|
1652
1669
|
const { tr: r } = t.state, s = t.state.selection.$from;
|
|
@@ -1667,14 +1684,14 @@ var St = class {
|
|
|
1667
1684
|
return super.extend(n);
|
|
1668
1685
|
}
|
|
1669
1686
|
};
|
|
1670
|
-
function
|
|
1687
|
+
function Er(e) {
|
|
1671
1688
|
return typeof e == "number";
|
|
1672
1689
|
}
|
|
1673
|
-
var
|
|
1690
|
+
var Tr = class {
|
|
1674
1691
|
constructor(e) {
|
|
1675
1692
|
this.find = e.find, this.handler = e.handler;
|
|
1676
1693
|
}
|
|
1677
|
-
},
|
|
1694
|
+
}, Ar = (e, t, n) => {
|
|
1678
1695
|
if (gt(t))
|
|
1679
1696
|
return [...e.matchAll(t)];
|
|
1680
1697
|
const r = t(e, n);
|
|
@@ -1683,7 +1700,7 @@ var Mr = class {
|
|
|
1683
1700
|
return o.index = s.index, o.input = e, o.data = s.data, s.replaceWith && (s.text.includes(s.replaceWith) || console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'), o.push(s.replaceWith)), o;
|
|
1684
1701
|
}) : [];
|
|
1685
1702
|
};
|
|
1686
|
-
function
|
|
1703
|
+
function Cr(e) {
|
|
1687
1704
|
const { editor: t, state: n, from: r, to: s, rule: o, pasteEvent: i, dropEvent: a } = e, { commands: c, chain: l, can: d } = new et({
|
|
1688
1705
|
editor: t,
|
|
1689
1706
|
state: n
|
|
@@ -1692,15 +1709,15 @@ function xr(e) {
|
|
|
1692
1709
|
var m, g, v, b, k;
|
|
1693
1710
|
if ((g = (m = p.type) == null ? void 0 : m.spec) != null && g.code || !(p.isText || p.isTextblock || p.isInline))
|
|
1694
1711
|
return;
|
|
1695
|
-
const M = (k = (b = (v = p.content) == null ? void 0 : v.size) != null ? b : p.nodeSize) != null ? k : 0, w = Math.max(r, h),
|
|
1696
|
-
if (w >=
|
|
1712
|
+
const M = (k = (b = (v = p.content) == null ? void 0 : v.size) != null ? b : p.nodeSize) != null ? k : 0, w = Math.max(r, h), S = Math.min(s, h + M);
|
|
1713
|
+
if (w >= S)
|
|
1697
1714
|
return;
|
|
1698
|
-
const E = p.isText ? p.text || "" : p.textBetween(w - h,
|
|
1699
|
-
|
|
1715
|
+
const E = p.isText ? p.text || "" : p.textBetween(w - h, S - h, void 0, "");
|
|
1716
|
+
Ar(E, o.find, i).forEach((C) => {
|
|
1700
1717
|
if (C.index === void 0)
|
|
1701
1718
|
return;
|
|
1702
|
-
const
|
|
1703
|
-
from: n.tr.mapping.map(
|
|
1719
|
+
const j = w + C.index + 1, it = j + C[0].length, W = {
|
|
1720
|
+
from: n.tr.mapping.map(j),
|
|
1704
1721
|
to: n.tr.mapping.map(it)
|
|
1705
1722
|
}, at = o.handler({
|
|
1706
1723
|
state: n,
|
|
@@ -1716,14 +1733,14 @@ function xr(e) {
|
|
|
1716
1733
|
});
|
|
1717
1734
|
}), u.every((p) => p !== null);
|
|
1718
1735
|
}
|
|
1719
|
-
var J = null,
|
|
1736
|
+
var J = null, Pr = (e) => {
|
|
1720
1737
|
var t;
|
|
1721
1738
|
const n = new ClipboardEvent("paste", {
|
|
1722
1739
|
clipboardData: new DataTransfer()
|
|
1723
1740
|
});
|
|
1724
1741
|
return (t = n.clipboardData) == null || t.setData("text/html", e), n;
|
|
1725
1742
|
};
|
|
1726
|
-
function
|
|
1743
|
+
function $r(e) {
|
|
1727
1744
|
const { editor: t, rules: n } = e;
|
|
1728
1745
|
let r = null, s = !1, o = !1, i = typeof ClipboardEvent < "u" ? new ClipboardEvent("paste") : null, a;
|
|
1729
1746
|
try {
|
|
@@ -1742,7 +1759,7 @@ function Tr(e) {
|
|
|
1742
1759
|
state: d,
|
|
1743
1760
|
transaction: m
|
|
1744
1761
|
});
|
|
1745
|
-
if (!(!
|
|
1762
|
+
if (!(!Cr({
|
|
1746
1763
|
editor: t,
|
|
1747
1764
|
state: g,
|
|
1748
1765
|
from: Math.max(u - 1, 0),
|
|
@@ -1759,7 +1776,7 @@ function Tr(e) {
|
|
|
1759
1776
|
return i = typeof ClipboardEvent < "u" ? new ClipboardEvent("paste") : null, m;
|
|
1760
1777
|
}
|
|
1761
1778
|
};
|
|
1762
|
-
return n.map((d) => new
|
|
1779
|
+
return n.map((d) => new $({
|
|
1763
1780
|
// we register a global drag handler to track the current drag source element
|
|
1764
1781
|
view(u) {
|
|
1765
1782
|
const f = (h) => {
|
|
@@ -1799,18 +1816,18 @@ function Tr(e) {
|
|
|
1799
1816
|
return;
|
|
1800
1817
|
if (b) {
|
|
1801
1818
|
let { text: w } = v;
|
|
1802
|
-
typeof w == "string" ? w = w : w = wt(
|
|
1803
|
-
const { from:
|
|
1819
|
+
typeof w == "string" ? w = w : w = wt(B.from(w), p.schema);
|
|
1820
|
+
const { from: S } = v, E = S + w.length, A = Pr(w);
|
|
1804
1821
|
return c({
|
|
1805
1822
|
rule: d,
|
|
1806
1823
|
state: p,
|
|
1807
|
-
from:
|
|
1824
|
+
from: S,
|
|
1808
1825
|
to: { b: E },
|
|
1809
1826
|
pasteEvt: A
|
|
1810
1827
|
});
|
|
1811
1828
|
}
|
|
1812
1829
|
const k = f.doc.content.findDiffStart(p.doc.content), M = f.doc.content.findDiffEnd(p.doc.content);
|
|
1813
|
-
if (!(!
|
|
1830
|
+
if (!(!Er(k) || !M || k === M.b))
|
|
1814
1831
|
return c({
|
|
1815
1832
|
rule: d,
|
|
1816
1833
|
state: p,
|
|
@@ -1823,7 +1840,7 @@ function Tr(e) {
|
|
|
1823
1840
|
}
|
|
1824
1841
|
var ot = class {
|
|
1825
1842
|
constructor(e, t) {
|
|
1826
|
-
this.splittableMarks = [], this.editor = t, this.baseExtensions = e, this.extensions =
|
|
1843
|
+
this.splittableMarks = [], this.editor = t, this.baseExtensions = e, this.extensions = Kt(e), this.schema = Vn(this.extensions, t), this.setupExtensions();
|
|
1827
1844
|
}
|
|
1828
1845
|
/**
|
|
1829
1846
|
* Get all commands from the extensions.
|
|
@@ -1863,19 +1880,19 @@ var ot = class {
|
|
|
1863
1880
|
s
|
|
1864
1881
|
);
|
|
1865
1882
|
let a = {};
|
|
1866
|
-
if (r.type === "mark" && y(r, "exitable", s) && (a.ArrowRight = () =>
|
|
1883
|
+
if (r.type === "mark" && y(r, "exitable", s) && (a.ArrowRight = () => Sr.handleExit({ editor: e, mark: r })), i) {
|
|
1867
1884
|
const f = Object.fromEntries(
|
|
1868
1885
|
Object.entries(i()).map(([p, h]) => [p, () => h({ editor: e })])
|
|
1869
1886
|
);
|
|
1870
1887
|
a = { ...a, ...f };
|
|
1871
1888
|
}
|
|
1872
|
-
const c =
|
|
1889
|
+
const c = We(a);
|
|
1873
1890
|
o.push(c);
|
|
1874
1891
|
const l = y(r, "addInputRules", s);
|
|
1875
|
-
if (
|
|
1892
|
+
if (Rt(r, e.options.enableInputRules) && l) {
|
|
1876
1893
|
const f = l();
|
|
1877
1894
|
if (f && f.length) {
|
|
1878
|
-
const p =
|
|
1895
|
+
const p = Mr({
|
|
1879
1896
|
editor: e,
|
|
1880
1897
|
rules: f
|
|
1881
1898
|
}), h = Array.isArray(p) ? p : [p];
|
|
@@ -1883,10 +1900,10 @@ var ot = class {
|
|
|
1883
1900
|
}
|
|
1884
1901
|
}
|
|
1885
1902
|
const d = y(r, "addPasteRules", s);
|
|
1886
|
-
if (
|
|
1903
|
+
if (Rt(r, e.options.enablePasteRules) && d) {
|
|
1887
1904
|
const f = d();
|
|
1888
1905
|
if (f && f.length) {
|
|
1889
|
-
const p =
|
|
1906
|
+
const p = $r({ editor: e, rules: f });
|
|
1890
1907
|
o.push(...p);
|
|
1891
1908
|
}
|
|
1892
1909
|
}
|
|
@@ -1907,14 +1924,14 @@ var ot = class {
|
|
|
1907
1924
|
* @returns An array of attributes
|
|
1908
1925
|
*/
|
|
1909
1926
|
get attributes() {
|
|
1910
|
-
return
|
|
1927
|
+
return Ut(this.extensions);
|
|
1911
1928
|
}
|
|
1912
1929
|
/**
|
|
1913
1930
|
* Get all node views from the extensions.
|
|
1914
1931
|
* @returns An object with all node views where the key is the node name and the value is the node view function
|
|
1915
1932
|
*/
|
|
1916
1933
|
get nodeViews() {
|
|
1917
|
-
const { editor: e } = this, { nodeExtensions: t } =
|
|
1934
|
+
const { editor: e } = this, { nodeExtensions: t } = F(this.extensions);
|
|
1918
1935
|
return Object.fromEntries(
|
|
1919
1936
|
t.filter((n) => !!y(n, "addNodeView")).map((n) => {
|
|
1920
1937
|
const r = this.attributes.filter((c) => c.type === n.name), s = {
|
|
@@ -1949,7 +1966,7 @@ var ot = class {
|
|
|
1949
1966
|
);
|
|
1950
1967
|
}
|
|
1951
1968
|
get markViews() {
|
|
1952
|
-
const { editor: e } = this, { markExtensions: t } =
|
|
1969
|
+
const { editor: e } = this, { markExtensions: t } = F(this.extensions);
|
|
1953
1970
|
return Object.fromEntries(
|
|
1954
1971
|
t.filter((n) => !!y(n, "addMarkView")).map((n) => {
|
|
1955
1972
|
const r = this.attributes.filter((a) => a.type === n.name), s = {
|
|
@@ -1957,7 +1974,7 @@ var ot = class {
|
|
|
1957
1974
|
options: n.options,
|
|
1958
1975
|
storage: this.editor.extensionStorage[n.name],
|
|
1959
1976
|
editor: e,
|
|
1960
|
-
type:
|
|
1977
|
+
type: z(n.name, this.schema)
|
|
1961
1978
|
}, o = y(n, "addMarkView", s);
|
|
1962
1979
|
if (!o)
|
|
1963
1980
|
return [];
|
|
@@ -1973,7 +1990,7 @@ var ot = class {
|
|
|
1973
1990
|
extension: n,
|
|
1974
1991
|
HTMLAttributes: d,
|
|
1975
1992
|
updateAttributes: (u) => {
|
|
1976
|
-
|
|
1993
|
+
Wr(a, e, u);
|
|
1977
1994
|
}
|
|
1978
1995
|
});
|
|
1979
1996
|
};
|
|
@@ -1998,7 +2015,7 @@ var ot = class {
|
|
|
1998
2015
|
editor: this.editor,
|
|
1999
2016
|
type: lt(t.name, this.schema)
|
|
2000
2017
|
};
|
|
2001
|
-
t.type === "mark" && ((n =
|
|
2018
|
+
t.type === "mark" && ((n = x(y(t, "keepOnSplit", r))) == null || n) && this.splittableMarks.push(t.name);
|
|
2002
2019
|
const s = y(t, "onBeforeCreate", r), o = y(t, "onCreate", r), i = y(t, "onUpdate", r), a = y(
|
|
2003
2020
|
t,
|
|
2004
2021
|
"onSelectionUpdate",
|
|
@@ -2008,23 +2025,24 @@ var ot = class {
|
|
|
2008
2025
|
});
|
|
2009
2026
|
}
|
|
2010
2027
|
};
|
|
2011
|
-
ot.resolve =
|
|
2028
|
+
ot.resolve = Kt;
|
|
2012
2029
|
ot.sort = kt;
|
|
2013
2030
|
ot.flatten = bt;
|
|
2014
|
-
var
|
|
2015
|
-
mt(
|
|
2016
|
-
ClipboardTextSerializer: () =>
|
|
2017
|
-
Commands: () =>
|
|
2018
|
-
Delete: () =>
|
|
2019
|
-
Drop: () =>
|
|
2020
|
-
Editable: () =>
|
|
2021
|
-
FocusEvents: () =>
|
|
2022
|
-
Keymap: () =>
|
|
2023
|
-
Paste: () =>
|
|
2024
|
-
Tabindex: () =>
|
|
2025
|
-
|
|
2031
|
+
var Nr = {};
|
|
2032
|
+
mt(Nr, {
|
|
2033
|
+
ClipboardTextSerializer: () => Gt,
|
|
2034
|
+
Commands: () => te,
|
|
2035
|
+
Delete: () => ee,
|
|
2036
|
+
Drop: () => ne,
|
|
2037
|
+
Editable: () => re,
|
|
2038
|
+
FocusEvents: () => oe,
|
|
2039
|
+
Keymap: () => ie,
|
|
2040
|
+
Paste: () => ae,
|
|
2041
|
+
Tabindex: () => ce,
|
|
2042
|
+
TextDirection: () => le,
|
|
2043
|
+
focusEventsPluginKey: () => se
|
|
2026
2044
|
});
|
|
2027
|
-
var
|
|
2045
|
+
var N = class Qt extends xt {
|
|
2028
2046
|
constructor() {
|
|
2029
2047
|
super(...arguments), this.type = "extension";
|
|
2030
2048
|
}
|
|
@@ -2034,7 +2052,7 @@ var z = class Zt extends St {
|
|
|
2034
2052
|
*/
|
|
2035
2053
|
static create(t = {}) {
|
|
2036
2054
|
const n = typeof t == "function" ? t() : t;
|
|
2037
|
-
return new
|
|
2055
|
+
return new Qt(n);
|
|
2038
2056
|
}
|
|
2039
2057
|
configure(t) {
|
|
2040
2058
|
return super.configure(t);
|
|
@@ -2043,7 +2061,7 @@ var z = class Zt extends St {
|
|
|
2043
2061
|
const n = typeof t == "function" ? t() : t;
|
|
2044
2062
|
return super.extend(n);
|
|
2045
2063
|
}
|
|
2046
|
-
},
|
|
2064
|
+
}, Gt = N.create({
|
|
2047
2065
|
name: "clipboardTextSerializer",
|
|
2048
2066
|
addOptions() {
|
|
2049
2067
|
return {
|
|
@@ -2052,12 +2070,12 @@ var z = class Zt extends St {
|
|
|
2052
2070
|
},
|
|
2053
2071
|
addProseMirrorPlugins() {
|
|
2054
2072
|
return [
|
|
2055
|
-
new
|
|
2056
|
-
key: new
|
|
2073
|
+
new $({
|
|
2074
|
+
key: new _("clipboardTextSerializer"),
|
|
2057
2075
|
props: {
|
|
2058
2076
|
clipboardTextSerializer: () => {
|
|
2059
|
-
const { editor: e } = this, { state: t, schema: n } = e, { doc: r, selection: s } = t, { ranges: o } = s, i = Math.min(...o.map((d) => d.$from.pos)), a = Math.max(...o.map((d) => d.$to.pos)), c =
|
|
2060
|
-
return
|
|
2077
|
+
const { editor: e } = this, { state: t, schema: n } = e, { doc: r, selection: s } = t, { ranges: o } = s, i = Math.min(...o.map((d) => d.$from.pos)), a = Math.max(...o.map((d) => d.$to.pos)), c = Jt(n);
|
|
2078
|
+
return qt(r, { from: i, to: a }, {
|
|
2061
2079
|
...this.options.blockSeparator !== void 0 ? { blockSeparator: this.options.blockSeparator } : {},
|
|
2062
2080
|
textSerializers: c
|
|
2063
2081
|
});
|
|
@@ -2066,14 +2084,14 @@ var z = class Zt extends St {
|
|
|
2066
2084
|
})
|
|
2067
2085
|
];
|
|
2068
2086
|
}
|
|
2069
|
-
}),
|
|
2087
|
+
}), te = N.create({
|
|
2070
2088
|
name: "commands",
|
|
2071
2089
|
addCommands() {
|
|
2072
2090
|
return {
|
|
2073
|
-
...
|
|
2091
|
+
...jt
|
|
2074
2092
|
};
|
|
2075
2093
|
}
|
|
2076
|
-
}),
|
|
2094
|
+
}), ee = N.create({
|
|
2077
2095
|
name: "delete",
|
|
2078
2096
|
onUpdate({ transaction: e, appendedTransactions: t }) {
|
|
2079
2097
|
var n, r, s;
|
|
@@ -2081,8 +2099,8 @@ var z = class Zt extends St {
|
|
|
2081
2099
|
var i, a, c, l;
|
|
2082
2100
|
if ((l = (c = (a = (i = this.editor.options.coreExtensionOptions) == null ? void 0 : i.delete) == null ? void 0 : a.filterTransaction) == null ? void 0 : c.call(a, e)) != null ? l : e.getMeta("y-sync$"))
|
|
2083
2101
|
return;
|
|
2084
|
-
const d =
|
|
2085
|
-
|
|
2102
|
+
const d = jn(e.before, [e, ...t]);
|
|
2103
|
+
Yn(d).forEach((p) => {
|
|
2086
2104
|
d.mapping.mapResult(p.oldRange.from).deletedAfter && d.mapping.mapResult(p.oldRange.to).deletedBefore && d.before.nodesBetween(p.oldRange.from, p.oldRange.to, (h, m) => {
|
|
2087
2105
|
const g = m + h.nodeSize - 2, v = p.oldRange.from <= m && g <= p.oldRange.to;
|
|
2088
2106
|
this.editor.emit("delete", {
|
|
@@ -2104,8 +2122,8 @@ var z = class Zt extends St {
|
|
|
2104
2122
|
const f = d.mapping;
|
|
2105
2123
|
d.steps.forEach((p, h) => {
|
|
2106
2124
|
var m, g;
|
|
2107
|
-
if (p instanceof
|
|
2108
|
-
const v = f.slice(h).map(p.from, -1), b = f.slice(h).map(p.to), k = f.invert().map(v, -1), M = f.invert().map(b), w = (m = d.doc.nodeAt(v - 1)) == null ? void 0 : m.marks.some((E) => E.eq(p.mark)),
|
|
2125
|
+
if (p instanceof pe) {
|
|
2126
|
+
const v = f.slice(h).map(p.from, -1), b = f.slice(h).map(p.to), k = f.invert().map(v, -1), M = f.invert().map(b), w = (m = d.doc.nodeAt(v - 1)) == null ? void 0 : m.marks.some((E) => E.eq(p.mark)), S = (g = d.doc.nodeAt(b)) == null ? void 0 : g.marks.some((E) => E.eq(p.mark));
|
|
2109
2127
|
this.editor.emit("delete", {
|
|
2110
2128
|
type: "mark",
|
|
2111
2129
|
mark: p.mark,
|
|
@@ -2119,7 +2137,7 @@ var z = class Zt extends St {
|
|
|
2119
2137
|
from: v,
|
|
2120
2138
|
to: b
|
|
2121
2139
|
},
|
|
2122
|
-
partial: !!(
|
|
2140
|
+
partial: !!(S || w),
|
|
2123
2141
|
editor: this.editor,
|
|
2124
2142
|
transaction: e,
|
|
2125
2143
|
combinedTransform: d
|
|
@@ -2129,12 +2147,12 @@ var z = class Zt extends St {
|
|
|
2129
2147
|
};
|
|
2130
2148
|
(s = (r = (n = this.editor.options.coreExtensionOptions) == null ? void 0 : n.delete) == null ? void 0 : r.async) == null || s ? setTimeout(o, 0) : o();
|
|
2131
2149
|
}
|
|
2132
|
-
}),
|
|
2150
|
+
}), ne = N.create({
|
|
2133
2151
|
name: "drop",
|
|
2134
2152
|
addProseMirrorPlugins() {
|
|
2135
2153
|
return [
|
|
2136
|
-
new
|
|
2137
|
-
key: new
|
|
2154
|
+
new $({
|
|
2155
|
+
key: new _("tiptapDrop"),
|
|
2138
2156
|
props: {
|
|
2139
2157
|
handleDrop: (e, t, n, r) => {
|
|
2140
2158
|
this.editor.emit("drop", {
|
|
@@ -2148,25 +2166,25 @@ var z = class Zt extends St {
|
|
|
2148
2166
|
})
|
|
2149
2167
|
];
|
|
2150
2168
|
}
|
|
2151
|
-
}),
|
|
2169
|
+
}), re = N.create({
|
|
2152
2170
|
name: "editable",
|
|
2153
2171
|
addProseMirrorPlugins() {
|
|
2154
2172
|
return [
|
|
2155
|
-
new
|
|
2156
|
-
key: new
|
|
2173
|
+
new $({
|
|
2174
|
+
key: new _("editable"),
|
|
2157
2175
|
props: {
|
|
2158
2176
|
editable: () => this.editor.options.editable
|
|
2159
2177
|
}
|
|
2160
2178
|
})
|
|
2161
2179
|
];
|
|
2162
2180
|
}
|
|
2163
|
-
}),
|
|
2181
|
+
}), se = new _("focusEvents"), oe = N.create({
|
|
2164
2182
|
name: "focusEvents",
|
|
2165
2183
|
addProseMirrorPlugins() {
|
|
2166
2184
|
const { editor: e } = this;
|
|
2167
2185
|
return [
|
|
2168
|
-
new
|
|
2169
|
-
key:
|
|
2186
|
+
new $({
|
|
2187
|
+
key: se,
|
|
2170
2188
|
props: {
|
|
2171
2189
|
handleDOMEvents: {
|
|
2172
2190
|
focus: (t, n) => {
|
|
@@ -2184,7 +2202,7 @@ var z = class Zt extends St {
|
|
|
2184
2202
|
})
|
|
2185
2203
|
];
|
|
2186
2204
|
}
|
|
2187
|
-
}),
|
|
2205
|
+
}), ie = N.create({
|
|
2188
2206
|
name: "keymap",
|
|
2189
2207
|
addKeyboardShortcuts() {
|
|
2190
2208
|
const e = () => this.editor.commands.first(({ commands: i }) => [
|
|
@@ -2229,7 +2247,7 @@ var z = class Zt extends St {
|
|
|
2229
2247
|
"Ctrl-a": () => this.editor.commands.selectTextblockStart(),
|
|
2230
2248
|
"Ctrl-e": () => this.editor.commands.selectTextblockEnd()
|
|
2231
2249
|
};
|
|
2232
|
-
return yt() ||
|
|
2250
|
+
return yt() || Ht() ? o : s;
|
|
2233
2251
|
},
|
|
2234
2252
|
addProseMirrorPlugins() {
|
|
2235
2253
|
return [
|
|
@@ -2238,8 +2256,8 @@ var z = class Zt extends St {
|
|
|
2238
2256
|
// to a paragraph if necessary.
|
|
2239
2257
|
// This is an alternative to ProseMirror's `AllSelection`, which doesn’t work well
|
|
2240
2258
|
// with many other commands.
|
|
2241
|
-
new
|
|
2242
|
-
key: new
|
|
2259
|
+
new $({
|
|
2260
|
+
key: new _("clearDocument"),
|
|
2243
2261
|
appendTransaction: (e, t, n) => {
|
|
2244
2262
|
if (e.some((m) => m.getMeta("composition")))
|
|
2245
2263
|
return;
|
|
@@ -2262,12 +2280,12 @@ var z = class Zt extends St {
|
|
|
2262
2280
|
})
|
|
2263
2281
|
];
|
|
2264
2282
|
}
|
|
2265
|
-
}),
|
|
2283
|
+
}), ae = N.create({
|
|
2266
2284
|
name: "paste",
|
|
2267
2285
|
addProseMirrorPlugins() {
|
|
2268
2286
|
return [
|
|
2269
|
-
new
|
|
2270
|
-
key: new
|
|
2287
|
+
new $({
|
|
2288
|
+
key: new _("tiptapPaste"),
|
|
2271
2289
|
props: {
|
|
2272
2290
|
handlePaste: (e, t, n) => {
|
|
2273
2291
|
this.editor.emit("paste", {
|
|
@@ -2280,19 +2298,63 @@ var z = class Zt extends St {
|
|
|
2280
2298
|
})
|
|
2281
2299
|
];
|
|
2282
2300
|
}
|
|
2283
|
-
}),
|
|
2301
|
+
}), ce = N.create({
|
|
2284
2302
|
name: "tabindex",
|
|
2285
2303
|
addProseMirrorPlugins() {
|
|
2286
2304
|
return [
|
|
2287
|
-
new
|
|
2288
|
-
key: new
|
|
2305
|
+
new $({
|
|
2306
|
+
key: new _("tabindex"),
|
|
2289
2307
|
props: {
|
|
2290
2308
|
attributes: () => this.editor.isEditable ? { tabindex: "0" } : {}
|
|
2291
2309
|
}
|
|
2292
2310
|
})
|
|
2293
2311
|
];
|
|
2294
2312
|
}
|
|
2295
|
-
}),
|
|
2313
|
+
}), le = N.create({
|
|
2314
|
+
name: "textDirection",
|
|
2315
|
+
addOptions() {
|
|
2316
|
+
return {
|
|
2317
|
+
direction: void 0
|
|
2318
|
+
};
|
|
2319
|
+
},
|
|
2320
|
+
addGlobalAttributes() {
|
|
2321
|
+
if (!this.options.direction)
|
|
2322
|
+
return [];
|
|
2323
|
+
const { nodeExtensions: e } = F(this.extensions);
|
|
2324
|
+
return [
|
|
2325
|
+
{
|
|
2326
|
+
types: e.filter((t) => t.name !== "text").map((t) => t.name),
|
|
2327
|
+
attributes: {
|
|
2328
|
+
dir: {
|
|
2329
|
+
default: this.options.direction,
|
|
2330
|
+
parseHTML: (t) => {
|
|
2331
|
+
const n = t.getAttribute("dir");
|
|
2332
|
+
return n && (n === "ltr" || n === "rtl" || n === "auto") ? n : this.options.direction;
|
|
2333
|
+
},
|
|
2334
|
+
renderHTML: (t) => t.dir ? {
|
|
2335
|
+
dir: t.dir
|
|
2336
|
+
} : {}
|
|
2337
|
+
}
|
|
2338
|
+
}
|
|
2339
|
+
}
|
|
2340
|
+
];
|
|
2341
|
+
},
|
|
2342
|
+
addProseMirrorPlugins() {
|
|
2343
|
+
return [
|
|
2344
|
+
new $({
|
|
2345
|
+
key: new _("textDirection"),
|
|
2346
|
+
props: {
|
|
2347
|
+
attributes: () => {
|
|
2348
|
+
const e = this.options.direction;
|
|
2349
|
+
return e ? {
|
|
2350
|
+
dir: e
|
|
2351
|
+
} : {};
|
|
2352
|
+
}
|
|
2353
|
+
}
|
|
2354
|
+
})
|
|
2355
|
+
];
|
|
2356
|
+
}
|
|
2357
|
+
}), Rr = class O {
|
|
2296
2358
|
constructor(t, n, r = !1, s = null) {
|
|
2297
2359
|
this.currentNode = null, this.actualDepth = null, this.isBlock = r, this.resolvedPos = t, this.editor = n, this.currentNode = s;
|
|
2298
2360
|
}
|
|
@@ -2351,15 +2413,15 @@ var z = class Zt extends St {
|
|
|
2351
2413
|
if (this.depth === 0)
|
|
2352
2414
|
return null;
|
|
2353
2415
|
const t = this.resolvedPos.start(this.resolvedPos.depth - 1), n = this.resolvedPos.doc.resolve(t);
|
|
2354
|
-
return new
|
|
2416
|
+
return new O(n, this.editor);
|
|
2355
2417
|
}
|
|
2356
2418
|
get before() {
|
|
2357
2419
|
let t = this.resolvedPos.doc.resolve(this.from - (this.isBlock ? 1 : 2));
|
|
2358
|
-
return t.depth !== this.depth && (t = this.resolvedPos.doc.resolve(this.from - 3)), new
|
|
2420
|
+
return t.depth !== this.depth && (t = this.resolvedPos.doc.resolve(this.from - 3)), new O(t, this.editor);
|
|
2359
2421
|
}
|
|
2360
2422
|
get after() {
|
|
2361
2423
|
let t = this.resolvedPos.doc.resolve(this.to + (this.isBlock ? 2 : 1));
|
|
2362
|
-
return t.depth !== this.depth && (t = this.resolvedPos.doc.resolve(this.to + 3)), new
|
|
2424
|
+
return t.depth !== this.depth && (t = this.resolvedPos.doc.resolve(this.to + 3)), new O(t, this.editor);
|
|
2363
2425
|
}
|
|
2364
2426
|
get children() {
|
|
2365
2427
|
const t = [];
|
|
@@ -2370,8 +2432,8 @@ var z = class Zt extends St {
|
|
|
2370
2432
|
const a = this.resolvedPos.doc.resolve(i);
|
|
2371
2433
|
if (!s && a.depth <= this.depth)
|
|
2372
2434
|
return;
|
|
2373
|
-
const c = new
|
|
2374
|
-
s && (c.actualDepth = this.depth + 1), t.push(new
|
|
2435
|
+
const c = new O(a, this.editor, s, s ? n : null);
|
|
2436
|
+
s && (c.actualDepth = this.depth + 1), t.push(new O(a, this.editor, s, s ? n : null));
|
|
2375
2437
|
}), t;
|
|
2376
2438
|
}
|
|
2377
2439
|
get firstChild() {
|
|
@@ -2417,7 +2479,7 @@ var z = class Zt extends St {
|
|
|
2417
2479
|
...t
|
|
2418
2480
|
}), this.editor.view.dispatch(n);
|
|
2419
2481
|
}
|
|
2420
|
-
},
|
|
2482
|
+
}, zr = `.ProseMirror {
|
|
2421
2483
|
position: relative;
|
|
2422
2484
|
}
|
|
2423
2485
|
|
|
@@ -2488,14 +2550,14 @@ img.ProseMirror-separator {
|
|
|
2488
2550
|
.ProseMirror-focused .ProseMirror-gapcursor {
|
|
2489
2551
|
display: block;
|
|
2490
2552
|
}`;
|
|
2491
|
-
function
|
|
2553
|
+
function Ir(e, t, n) {
|
|
2492
2554
|
const r = document.querySelector("style[data-tiptap-style]");
|
|
2493
2555
|
if (r !== null)
|
|
2494
2556
|
return r;
|
|
2495
2557
|
const s = document.createElement("style");
|
|
2496
2558
|
return t && s.setAttribute("nonce", t), s.setAttribute("data-tiptap-style", ""), s.innerHTML = e, document.getElementsByTagName("head")[0].appendChild(s), s;
|
|
2497
2559
|
}
|
|
2498
|
-
var
|
|
2560
|
+
var rs = class extends wr {
|
|
2499
2561
|
constructor(t = {}) {
|
|
2500
2562
|
super(), this.css = null, this.className = "tiptap", this.editorView = null, this.isFocused = !1, this.isInitialized = !1, this.extensionStorage = {}, this.instanceId = Math.random().toString(36).slice(2, 9), this.options = {
|
|
2501
2563
|
element: typeof document < "u" ? document.createElement("div") : null,
|
|
@@ -2505,6 +2567,7 @@ var Gr = class extends gr {
|
|
|
2505
2567
|
extensions: [],
|
|
2506
2568
|
autofocus: !1,
|
|
2507
2569
|
editable: !0,
|
|
2570
|
+
textDirection: void 0,
|
|
2508
2571
|
editorProps: {},
|
|
2509
2572
|
parseOptions: {},
|
|
2510
2573
|
coreExtensionOptions: {},
|
|
@@ -2530,8 +2593,8 @@ var Gr = class extends gr {
|
|
|
2530
2593
|
onDrop: () => null,
|
|
2531
2594
|
onDelete: () => null
|
|
2532
2595
|
}, this.isCapturingTransaction = !1, this.capturedTransaction = null, this.setOptions(t), this.createExtensionManager(), this.createCommandManager(), this.createSchema(), this.on("beforeCreate", this.options.onBeforeCreate), this.emit("beforeCreate", { editor: this }), this.on("mount", this.options.onMount), this.on("unmount", this.options.onUnmount), this.on("contentError", this.options.onContentError), this.on("create", this.options.onCreate), this.on("update", this.options.onUpdate), this.on("selectionUpdate", this.options.onSelectionUpdate), this.on("transaction", this.options.onTransaction), this.on("focus", this.options.onFocus), this.on("blur", this.options.onBlur), this.on("destroy", this.options.onDestroy), this.on("drop", ({ event: s, slice: o, moved: i }) => this.options.onDrop(s, o, i)), this.on("paste", ({ event: s, slice: o }) => this.options.onPaste(s, o)), this.on("delete", this.options.onDelete);
|
|
2533
|
-
const n = this.createDoc(), r =
|
|
2534
|
-
this.editorState =
|
|
2596
|
+
const n = this.createDoc(), r = Lt(n, this.options.autofocus);
|
|
2597
|
+
this.editorState = Be.create({
|
|
2535
2598
|
doc: n,
|
|
2536
2599
|
schema: this.schema,
|
|
2537
2600
|
selection: r || void 0
|
|
@@ -2546,7 +2609,7 @@ var Gr = class extends gr {
|
|
|
2546
2609
|
"[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment."
|
|
2547
2610
|
);
|
|
2548
2611
|
this.createView(t), this.emit("mount", { editor: this }), this.css && !document.head.contains(this.css) && document.head.appendChild(this.css), window.setTimeout(() => {
|
|
2549
|
-
this.isDestroyed || (this.commands.focus(this.options.autofocus), this.emit("create", { editor: this }), this.isInitialized = !0);
|
|
2612
|
+
this.isDestroyed || (this.options.autofocus !== !1 && this.options.autofocus !== null && this.commands.focus(this.options.autofocus), this.emit("create", { editor: this }), this.isInitialized = !0);
|
|
2550
2613
|
}, 0);
|
|
2551
2614
|
}
|
|
2552
2615
|
/**
|
|
@@ -2593,7 +2656,7 @@ var Gr = class extends gr {
|
|
|
2593
2656
|
* Inject CSS styles.
|
|
2594
2657
|
*/
|
|
2595
2658
|
injectCSS() {
|
|
2596
|
-
this.options.injectCSS && typeof document < "u" && (this.css =
|
|
2659
|
+
this.options.injectCSS && typeof document < "u" && (this.css = Ir(zr, this.options.injectNonce));
|
|
2597
2660
|
}
|
|
2598
2661
|
/**
|
|
2599
2662
|
* Update editor options.
|
|
@@ -2666,7 +2729,7 @@ var Gr = class extends gr {
|
|
|
2666
2729
|
* @returns The new editor state
|
|
2667
2730
|
*/
|
|
2668
2731
|
registerPlugin(t, n) {
|
|
2669
|
-
const r =
|
|
2732
|
+
const r = Wt(n) ? n(t, [...this.state.plugins]) : [...this.state.plugins, t], s = this.state.reconfigure({ plugins: r });
|
|
2670
2733
|
return this.view.updateState(s), s;
|
|
2671
2734
|
}
|
|
2672
2735
|
/**
|
|
@@ -2696,17 +2759,20 @@ var Gr = class extends gr {
|
|
|
2696
2759
|
createExtensionManager() {
|
|
2697
2760
|
var t, n;
|
|
2698
2761
|
const s = [...this.options.enableCoreExtensions ? [
|
|
2699
|
-
|
|
2700
|
-
|
|
2762
|
+
re,
|
|
2763
|
+
Gt.configure({
|
|
2701
2764
|
blockSeparator: (n = (t = this.options.coreExtensionOptions) == null ? void 0 : t.clipboardTextSerializer) == null ? void 0 : n.blockSeparator
|
|
2702
2765
|
}),
|
|
2703
|
-
|
|
2704
|
-
se,
|
|
2766
|
+
te,
|
|
2705
2767
|
oe,
|
|
2768
|
+
ie,
|
|
2769
|
+
ce,
|
|
2770
|
+
ne,
|
|
2706
2771
|
ae,
|
|
2707
2772
|
ee,
|
|
2708
|
-
|
|
2709
|
-
|
|
2773
|
+
le.configure({
|
|
2774
|
+
direction: this.options.textDirection
|
|
2775
|
+
})
|
|
2710
2776
|
].filter((o) => typeof this.options.enableCoreExtensions == "object" ? this.options.enableCoreExtensions[o.name] !== !1 : !0) : [], ...this.options.extensions].filter((o) => ["extension", "node", "mark"].includes(o?.type));
|
|
2711
2777
|
this.extensionManager = new ot(s, this);
|
|
2712
2778
|
}
|
|
@@ -2753,7 +2819,7 @@ var Gr = class extends gr {
|
|
|
2753
2819
|
*/
|
|
2754
2820
|
createView(t) {
|
|
2755
2821
|
var n;
|
|
2756
|
-
this.editorView = new
|
|
2822
|
+
this.editorView = new Ve(t, {
|
|
2757
2823
|
...this.options.editorProps,
|
|
2758
2824
|
attributes: {
|
|
2759
2825
|
// add `role="textbox"` to the editor element
|
|
@@ -2847,11 +2913,11 @@ var Gr = class extends gr {
|
|
|
2847
2913
|
* Get attributes of the currently selected node or mark.
|
|
2848
2914
|
*/
|
|
2849
2915
|
getAttributes(t) {
|
|
2850
|
-
return
|
|
2916
|
+
return qn(this.state, t);
|
|
2851
2917
|
}
|
|
2852
2918
|
isActive(t, n) {
|
|
2853
2919
|
const r = typeof t == "string" ? t : null, s = typeof t == "string" ? n : t;
|
|
2854
|
-
return
|
|
2920
|
+
return Qn(this.state, r, s);
|
|
2855
2921
|
}
|
|
2856
2922
|
/**
|
|
2857
2923
|
* Get the document as JSON.
|
|
@@ -2872,10 +2938,10 @@ var Gr = class extends gr {
|
|
|
2872
2938
|
const { blockSeparator: n = `
|
|
2873
2939
|
|
|
2874
2940
|
`, textSerializers: r = {} } = t || {};
|
|
2875
|
-
return
|
|
2941
|
+
return Un(this.state.doc, {
|
|
2876
2942
|
blockSeparator: n,
|
|
2877
2943
|
textSerializers: {
|
|
2878
|
-
...
|
|
2944
|
+
...Jt(this.schema),
|
|
2879
2945
|
...r
|
|
2880
2946
|
}
|
|
2881
2947
|
});
|
|
@@ -2909,23 +2975,23 @@ var Gr = class extends gr {
|
|
|
2909
2975
|
}
|
|
2910
2976
|
$pos(t) {
|
|
2911
2977
|
const n = this.state.doc.resolve(t);
|
|
2912
|
-
return new
|
|
2978
|
+
return new Rr(n, this);
|
|
2913
2979
|
}
|
|
2914
2980
|
get $doc() {
|
|
2915
2981
|
return this.$pos(0);
|
|
2916
2982
|
}
|
|
2917
2983
|
};
|
|
2918
|
-
function
|
|
2984
|
+
function os(e) {
|
|
2919
2985
|
return new st({
|
|
2920
2986
|
find: e.find,
|
|
2921
2987
|
handler: ({ state: t, range: n, match: r }) => {
|
|
2922
|
-
const s =
|
|
2988
|
+
const s = x(e.getAttributes, void 0, r);
|
|
2923
2989
|
if (s === !1 || s === null)
|
|
2924
2990
|
return null;
|
|
2925
2991
|
const { tr: o } = t, i = r[r.length - 1], a = r[0];
|
|
2926
2992
|
if (i) {
|
|
2927
2993
|
const c = a.search(/\S/), l = n.from + a.indexOf(i), d = l + i.length;
|
|
2928
|
-
if (
|
|
2994
|
+
if (Xt(n.from, n.to, t.doc).filter((p) => p.mark.type.excluded.find((m) => m === e.type && m !== p.mark.type)).filter((p) => p.to > l).length)
|
|
2929
2995
|
return null;
|
|
2930
2996
|
d < n.to && o.delete(d, n.to), l > n.from && o.delete(n.from + c, l);
|
|
2931
2997
|
const f = n.from + c + i.length;
|
|
@@ -2935,11 +3001,11 @@ function es(e) {
|
|
|
2935
3001
|
undoable: e.undoable
|
|
2936
3002
|
});
|
|
2937
3003
|
}
|
|
2938
|
-
function
|
|
3004
|
+
function is(e) {
|
|
2939
3005
|
return new st({
|
|
2940
3006
|
find: e.find,
|
|
2941
3007
|
handler: ({ state: t, range: n, match: r }) => {
|
|
2942
|
-
const s =
|
|
3008
|
+
const s = x(e.getAttributes, void 0, r) || {}, { tr: o } = t, i = n.from;
|
|
2943
3009
|
let a = n.to;
|
|
2944
3010
|
const c = e.type.create(s);
|
|
2945
3011
|
if (r[1]) {
|
|
@@ -2957,11 +3023,11 @@ function ns(e) {
|
|
|
2957
3023
|
undoable: e.undoable
|
|
2958
3024
|
});
|
|
2959
3025
|
}
|
|
2960
|
-
function
|
|
3026
|
+
function as(e) {
|
|
2961
3027
|
return new st({
|
|
2962
3028
|
find: e.find,
|
|
2963
3029
|
handler: ({ state: t, range: n, match: r }) => {
|
|
2964
|
-
const s = t.doc.resolve(n.from), o =
|
|
3030
|
+
const s = t.doc.resolve(n.from), o = x(e.getAttributes, void 0, r) || {};
|
|
2965
3031
|
if (!s.node(-1).canReplaceWith(s.index(-1), s.indexAfter(-1), e.type))
|
|
2966
3032
|
return null;
|
|
2967
3033
|
t.tr.delete(n.from, n.to).setBlockType(n.from, n.from, e.type, o);
|
|
@@ -2969,11 +3035,11 @@ function rs(e) {
|
|
|
2969
3035
|
undoable: e.undoable
|
|
2970
3036
|
});
|
|
2971
3037
|
}
|
|
2972
|
-
function
|
|
3038
|
+
function cs(e) {
|
|
2973
3039
|
return new st({
|
|
2974
3040
|
find: e.find,
|
|
2975
3041
|
handler: ({ state: t, range: n, match: r, chain: s }) => {
|
|
2976
|
-
const o =
|
|
3042
|
+
const o = x(e.getAttributes, void 0, r) || {}, i = t.tr.delete(n.from, n.to), c = i.doc.resolve(n.from).blockRange(), l = c && ue(c, e.type, o);
|
|
2977
3043
|
if (!l)
|
|
2978
3044
|
return null;
|
|
2979
3045
|
if (i.wrap(c, l), e.keepMarks && e.editor) {
|
|
@@ -2993,7 +3059,7 @@ function ss(e) {
|
|
|
2993
3059
|
undoable: e.undoable
|
|
2994
3060
|
});
|
|
2995
3061
|
}
|
|
2996
|
-
var
|
|
3062
|
+
var Br = (e) => "touches" in e, ls = class {
|
|
2997
3063
|
/**
|
|
2998
3064
|
* Creates a new ResizableNodeView instance.
|
|
2999
3065
|
*
|
|
@@ -3169,7 +3235,7 @@ var Nr = (e) => "touches" in e, os = class {
|
|
|
3169
3235
|
* @param direction - The direction of the handle being dragged
|
|
3170
3236
|
*/
|
|
3171
3237
|
handleResizeStart(e, t) {
|
|
3172
|
-
e.preventDefault(), e.stopPropagation(), this.isResizing = !0, this.activeHandle = t,
|
|
3238
|
+
e.preventDefault(), e.stopPropagation(), this.isResizing = !0, this.activeHandle = t, Br(e) ? (this.startX = e.touches[0].clientX, this.startY = e.touches[0].clientY) : (this.startX = e.clientX, this.startY = e.clientY), this.startWidth = this.element.offsetWidth, this.startHeight = this.element.offsetHeight, this.startWidth > 0 && this.startHeight > 0 && (this.aspectRatio = this.startWidth / this.startHeight), this.getPos(), this.container.dataset.resizeState = "true", this.classNames.resizing && this.container.classList.add(this.classNames.resizing), document.addEventListener("mousemove", this.handleMouseMove), document.addEventListener("touchmove", this.handleTouchMove), document.addEventListener("mouseup", this.handleMouseUp), document.addEventListener("keydown", this.handleKeyDown), document.addEventListener("keyup", this.handleKeyUp);
|
|
3173
3239
|
}
|
|
3174
3240
|
handleResize(e, t) {
|
|
3175
3241
|
if (!this.activeHandle)
|
|
@@ -3246,7 +3312,7 @@ var Nr = (e) => "touches" in e, os = class {
|
|
|
3246
3312
|
};
|
|
3247
3313
|
}
|
|
3248
3314
|
};
|
|
3249
|
-
function
|
|
3315
|
+
function ds(e, t) {
|
|
3250
3316
|
const { selection: n } = e, { $from: r } = n;
|
|
3251
3317
|
if (n instanceof G) {
|
|
3252
3318
|
const o = r.index();
|
|
@@ -3261,17 +3327,17 @@ function is(e, t) {
|
|
|
3261
3327
|
}
|
|
3262
3328
|
return !1;
|
|
3263
3329
|
}
|
|
3264
|
-
var
|
|
3265
|
-
mt(
|
|
3266
|
-
createAtomBlockMarkdownSpec: () =>
|
|
3267
|
-
createBlockMarkdownSpec: () =>
|
|
3268
|
-
createInlineMarkdownSpec: () =>
|
|
3269
|
-
parseAttributes: () =>
|
|
3270
|
-
parseIndentedBlocks: () =>
|
|
3271
|
-
renderNestedMarkdownContent: () =>
|
|
3330
|
+
var _r = {};
|
|
3331
|
+
mt(_r, {
|
|
3332
|
+
createAtomBlockMarkdownSpec: () => jr,
|
|
3333
|
+
createBlockMarkdownSpec: () => Dr,
|
|
3334
|
+
createInlineMarkdownSpec: () => Fr,
|
|
3335
|
+
parseAttributes: () => St,
|
|
3336
|
+
parseIndentedBlocks: () => Hr,
|
|
3337
|
+
renderNestedMarkdownContent: () => Vr,
|
|
3272
3338
|
serializeAttributes: () => Et
|
|
3273
3339
|
});
|
|
3274
|
-
function
|
|
3340
|
+
function St(e) {
|
|
3275
3341
|
if (!e?.trim())
|
|
3276
3342
|
return {};
|
|
3277
3343
|
const t = {}, n = [], r = e.replace(/["']([^"']*)["']/g, (l) => (n.push(l), `__QUOTED_${n.length - 1}__`)), s = r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);
|
|
@@ -3300,11 +3366,11 @@ function Et(e) {
|
|
|
3300
3366
|
n === "class" || n === "id" || (r === !0 ? t.push(n) : r !== !1 && r != null && t.push(`${n}="${String(r)}"`));
|
|
3301
3367
|
}), t.join(" ");
|
|
3302
3368
|
}
|
|
3303
|
-
function
|
|
3369
|
+
function jr(e) {
|
|
3304
3370
|
const {
|
|
3305
3371
|
nodeName: t,
|
|
3306
3372
|
name: n,
|
|
3307
|
-
parseAttributes: r =
|
|
3373
|
+
parseAttributes: r = St,
|
|
3308
3374
|
serializeAttributes: s = Et,
|
|
3309
3375
|
defaultAttributes: o = {},
|
|
3310
3376
|
requiredAttributes: i = [],
|
|
@@ -3349,12 +3415,12 @@ function zr(e) {
|
|
|
3349
3415
|
}
|
|
3350
3416
|
};
|
|
3351
3417
|
}
|
|
3352
|
-
function
|
|
3418
|
+
function Dr(e) {
|
|
3353
3419
|
const {
|
|
3354
3420
|
nodeName: t,
|
|
3355
3421
|
name: n,
|
|
3356
3422
|
getContent: r,
|
|
3357
|
-
parseAttributes: s =
|
|
3423
|
+
parseAttributes: s = St,
|
|
3358
3424
|
serializeAttributes: o = Et,
|
|
3359
3425
|
defaultAttributes: i = {},
|
|
3360
3426
|
content: a = "block",
|
|
@@ -3393,39 +3459,39 @@ function Ir(e) {
|
|
|
3393
3459
|
const [v, b = ""] = g, k = s(b);
|
|
3394
3460
|
let M = 1;
|
|
3395
3461
|
const w = v.length;
|
|
3396
|
-
let
|
|
3462
|
+
let S = "";
|
|
3397
3463
|
const E = /^:::([\w-]*)(\s.*)?/gm, A = u.slice(w);
|
|
3398
3464
|
for (E.lastIndex = 0; ; ) {
|
|
3399
3465
|
const C = E.exec(A);
|
|
3400
3466
|
if (C === null)
|
|
3401
3467
|
break;
|
|
3402
|
-
const
|
|
3468
|
+
const j = C.index, it = C[1];
|
|
3403
3469
|
if (!((h = C[2]) != null && h.endsWith(":::"))) {
|
|
3404
3470
|
if (it)
|
|
3405
3471
|
M += 1;
|
|
3406
3472
|
else if (M -= 1, M === 0) {
|
|
3407
|
-
const W = A.slice(0,
|
|
3408
|
-
|
|
3409
|
-
const at = u.slice(0, w +
|
|
3473
|
+
const W = A.slice(0, j);
|
|
3474
|
+
S = W.trim();
|
|
3475
|
+
const at = u.slice(0, w + j + C[0].length);
|
|
3410
3476
|
let I = [];
|
|
3411
|
-
if (
|
|
3477
|
+
if (S)
|
|
3412
3478
|
if (a === "block")
|
|
3413
|
-
for (I = p.blockTokens(W), I.forEach((
|
|
3414
|
-
|
|
3479
|
+
for (I = p.blockTokens(W), I.forEach((R) => {
|
|
3480
|
+
R.text && (!R.tokens || R.tokens.length === 0) && (R.tokens = p.inlineTokens(R.text));
|
|
3415
3481
|
}); I.length > 0; ) {
|
|
3416
|
-
const
|
|
3417
|
-
if (
|
|
3482
|
+
const R = I[I.length - 1];
|
|
3483
|
+
if (R.type === "paragraph" && (!R.text || R.text.trim() === ""))
|
|
3418
3484
|
I.pop();
|
|
3419
3485
|
else
|
|
3420
3486
|
break;
|
|
3421
3487
|
}
|
|
3422
3488
|
else
|
|
3423
|
-
I = p.inlineTokens(
|
|
3489
|
+
I = p.inlineTokens(S);
|
|
3424
3490
|
return {
|
|
3425
3491
|
type: t,
|
|
3426
3492
|
raw: at,
|
|
3427
3493
|
attributes: k,
|
|
3428
|
-
content:
|
|
3494
|
+
content: S,
|
|
3429
3495
|
tokens: I
|
|
3430
3496
|
};
|
|
3431
3497
|
}
|
|
@@ -3445,7 +3511,7 @@ ${g}
|
|
|
3445
3511
|
}
|
|
3446
3512
|
};
|
|
3447
3513
|
}
|
|
3448
|
-
function
|
|
3514
|
+
function Or(e) {
|
|
3449
3515
|
if (!e.trim())
|
|
3450
3516
|
return {};
|
|
3451
3517
|
const t = {}, n = /(\w+)=(?:"([^"]*)"|'([^']*)')/g;
|
|
@@ -3456,16 +3522,16 @@ function _r(e) {
|
|
|
3456
3522
|
}
|
|
3457
3523
|
return t;
|
|
3458
3524
|
}
|
|
3459
|
-
function
|
|
3525
|
+
function Lr(e) {
|
|
3460
3526
|
return Object.entries(e).filter(([, t]) => t != null).map(([t, n]) => `${t}="${n}"`).join(" ");
|
|
3461
3527
|
}
|
|
3462
|
-
function
|
|
3528
|
+
function Fr(e) {
|
|
3463
3529
|
const {
|
|
3464
3530
|
nodeName: t,
|
|
3465
3531
|
name: n,
|
|
3466
3532
|
getContent: r,
|
|
3467
|
-
parseAttributes: s =
|
|
3468
|
-
serializeAttributes: o =
|
|
3533
|
+
parseAttributes: s = Or,
|
|
3534
|
+
serializeAttributes: o = Lr,
|
|
3469
3535
|
defaultAttributes: i = {},
|
|
3470
3536
|
selfClosing: a = !1,
|
|
3471
3537
|
allowedAttributes: c
|
|
@@ -3521,7 +3587,7 @@ function jr(e) {
|
|
|
3521
3587
|
}
|
|
3522
3588
|
};
|
|
3523
3589
|
}
|
|
3524
|
-
function
|
|
3590
|
+
function Hr(e, t, n) {
|
|
3525
3591
|
var r, s, o, i;
|
|
3526
3592
|
const a = e.split(`
|
|
3527
3593
|
`), c = [];
|
|
@@ -3533,7 +3599,8 @@ function Or(e, t, n) {
|
|
|
3533
3599
|
if (c.length > 0)
|
|
3534
3600
|
break;
|
|
3535
3601
|
if (f.trim() === "") {
|
|
3536
|
-
d += 1
|
|
3602
|
+
d += 1, l = `${l}${f}
|
|
3603
|
+
`;
|
|
3537
3604
|
continue;
|
|
3538
3605
|
} else
|
|
3539
3606
|
return;
|
|
@@ -3545,7 +3612,7 @@ function Or(e, t, n) {
|
|
|
3545
3612
|
for (d += 1; d < a.length; ) {
|
|
3546
3613
|
const w = a[d];
|
|
3547
3614
|
if (w.trim() === "") {
|
|
3548
|
-
const E = a.slice(d + 1).findIndex((
|
|
3615
|
+
const E = a.slice(d + 1).findIndex((j) => j.trim() !== "");
|
|
3549
3616
|
if (E === -1)
|
|
3550
3617
|
break;
|
|
3551
3618
|
if ((((s = (r = a[d + 1 + E].match(/^(\s*)/)) == null ? void 0 : r[1]) == null ? void 0 : s.length) || 0) > m) {
|
|
@@ -3564,7 +3631,7 @@ function Or(e, t, n) {
|
|
|
3564
3631
|
let b;
|
|
3565
3632
|
const k = v.slice(1);
|
|
3566
3633
|
if (k.length > 0) {
|
|
3567
|
-
const w = k.map((
|
|
3634
|
+
const w = k.map((S) => S.slice(m + u)).join(`
|
|
3568
3635
|
`);
|
|
3569
3636
|
w.trim() && (t.customNestedParser ? b = t.customNestedParser(w) : b = n.blockTokens(w));
|
|
3570
3637
|
}
|
|
@@ -3574,10 +3641,10 @@ function Or(e, t, n) {
|
|
|
3574
3641
|
if (c.length !== 0)
|
|
3575
3642
|
return {
|
|
3576
3643
|
items: c,
|
|
3577
|
-
raw: l
|
|
3644
|
+
raw: l
|
|
3578
3645
|
};
|
|
3579
3646
|
}
|
|
3580
|
-
function
|
|
3647
|
+
function Vr(e, t, n, r) {
|
|
3581
3648
|
if (!e || !Array.isArray(e.content))
|
|
3582
3649
|
return "";
|
|
3583
3650
|
const s = typeof n == "function" ? n(r) : n, [o, ...i] = e.content, a = t.renderChildren([o]), c = [`${s}${a}`];
|
|
@@ -3592,7 +3659,7 @@ function Dr(e, t, n, r) {
|
|
|
3592
3659
|
}), c.join(`
|
|
3593
3660
|
`);
|
|
3594
3661
|
}
|
|
3595
|
-
function
|
|
3662
|
+
function Wr(e, t, n = {}) {
|
|
3596
3663
|
const { state: r } = t, { doc: s, tr: o } = r, i = e;
|
|
3597
3664
|
s.descendants((a, c) => {
|
|
3598
3665
|
const l = o.mapping.map(c), d = o.mapping.map(c) + a.nodeSize;
|
|
@@ -3615,7 +3682,7 @@ function Lr(e, t, n = {}) {
|
|
|
3615
3682
|
}
|
|
3616
3683
|
}), o.docChanged && t.view.dispatch(o);
|
|
3617
3684
|
}
|
|
3618
|
-
var
|
|
3685
|
+
var us = class de extends xt {
|
|
3619
3686
|
constructor() {
|
|
3620
3687
|
super(...arguments), this.type = "node";
|
|
3621
3688
|
}
|
|
@@ -3625,7 +3692,7 @@ var as = class ce extends St {
|
|
|
3625
3692
|
*/
|
|
3626
3693
|
static create(t = {}) {
|
|
3627
3694
|
const n = typeof t == "function" ? t() : t;
|
|
3628
|
-
return new
|
|
3695
|
+
return new de(n);
|
|
3629
3696
|
}
|
|
3630
3697
|
configure(t) {
|
|
3631
3698
|
return super.configure(t);
|
|
@@ -3635,25 +3702,25 @@ var as = class ce extends St {
|
|
|
3635
3702
|
return super.extend(n);
|
|
3636
3703
|
}
|
|
3637
3704
|
};
|
|
3638
|
-
function
|
|
3639
|
-
return new
|
|
3705
|
+
function fs(e) {
|
|
3706
|
+
return new Tr({
|
|
3640
3707
|
find: e.find,
|
|
3641
3708
|
handler: ({ state: t, range: n, match: r, pasteEvent: s }) => {
|
|
3642
|
-
const o =
|
|
3709
|
+
const o = x(e.getAttributes, void 0, r, s);
|
|
3643
3710
|
if (o === !1 || o === null)
|
|
3644
3711
|
return null;
|
|
3645
3712
|
const { tr: i } = t, a = r[r.length - 1], c = r[0];
|
|
3646
3713
|
let l = n.to;
|
|
3647
3714
|
if (a) {
|
|
3648
3715
|
const d = c.search(/\S/), u = n.from + c.indexOf(a), f = u + a.length;
|
|
3649
|
-
if (
|
|
3716
|
+
if (Xt(n.from, n.to, t.doc).filter((h) => h.mark.type.excluded.find((g) => g === e.type && g !== h.mark.type)).filter((h) => h.to > u).length)
|
|
3650
3717
|
return null;
|
|
3651
3718
|
f < n.to && i.delete(f, n.to), u > n.from && i.delete(n.from + d, u), l = n.from + d + a.length, i.addMark(n.from + d, l, e.type.create(o || {})), i.removeStoredMark(e.type);
|
|
3652
3719
|
}
|
|
3653
3720
|
}
|
|
3654
3721
|
});
|
|
3655
3722
|
}
|
|
3656
|
-
var
|
|
3723
|
+
var ps = (e, t) => {
|
|
3657
3724
|
if (e === "slot")
|
|
3658
3725
|
return 0;
|
|
3659
3726
|
if (e instanceof Function)
|
|
@@ -3665,35 +3732,35 @@ var ls = (e, t) => {
|
|
|
3665
3732
|
};
|
|
3666
3733
|
export {
|
|
3667
3734
|
wt as A,
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
|
|
3735
|
+
rs as B,
|
|
3736
|
+
N as E,
|
|
3737
|
+
Sr as M,
|
|
3738
|
+
us as N,
|
|
3739
|
+
ls as R,
|
|
3740
|
+
fs as a,
|
|
3741
|
+
os as b,
|
|
3742
|
+
ds as c,
|
|
3743
|
+
jn as d,
|
|
3744
|
+
Xt as e,
|
|
3745
|
+
Qr as f,
|
|
3746
|
+
Yn as g,
|
|
3747
|
+
ps as h,
|
|
3748
|
+
ns as i,
|
|
3749
|
+
qn as j,
|
|
3750
|
+
V as k,
|
|
3751
|
+
es as l,
|
|
3752
|
+
Fn as m,
|
|
3753
|
+
is as n,
|
|
3754
|
+
ts as o,
|
|
3688
3755
|
T as p,
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
3756
|
+
Gr as q,
|
|
3757
|
+
Vr as r,
|
|
3758
|
+
Hr as s,
|
|
3759
|
+
as as t,
|
|
3760
|
+
x as u,
|
|
3694
3761
|
y as v,
|
|
3695
|
-
|
|
3696
|
-
|
|
3762
|
+
cs as w,
|
|
3763
|
+
On as x,
|
|
3697
3764
|
Mt as y,
|
|
3698
|
-
|
|
3765
|
+
Nr as z
|
|
3699
3766
|
};
|