@harbour-enterprises/superdoc 0.9.24 → 0.9.25
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/chunks/{super-editor.es-C8w4J5jx.es.js → super-editor.es-CIN79FjT.es.js} +211 -209
- package/dist/chunks/{super-editor.es-dH2QglKu.cjs → super-editor.es-h2nZfGPP.cjs} +2 -2
- package/dist/super-editor/chunks/{converter-Cwp-Sia4.js → converter-sW9TD9S-.js} +2 -2
- package/dist/super-editor/chunks/{docx-zipper-CnOgTDAX.js → docx-zipper-CtBfaHzU.js} +1 -1
- package/dist/super-editor/chunks/{editor-D1IioTBl.js → editor--8YB7Owp.js} +35 -33
- package/dist/super-editor/chunks/{toolbar-CTkdGAwV.js → toolbar-DxQCXy5M.js} +2 -2
- package/dist/super-editor/converter.es.js +1 -1
- package/dist/super-editor/core/commands/splitListItem.d.ts.map +1 -1
- package/dist/super-editor/docx-zipper.es.js +2 -2
- package/dist/super-editor/editor.es.js +3 -3
- package/dist/super-editor/extensions/list-item/helpers/styledListMarkerPlugin.d.ts.map +1 -1
- package/dist/super-editor/extensions/ordered-list/helpers/orderedListMarkerPlugin.d.ts.map +1 -1
- package/dist/super-editor/file-zipper.es.js +1 -1
- package/dist/super-editor/super-editor.es.js +6 -6
- package/dist/super-editor/toolbar.es.js +2 -2
- package/dist/super-editor.cjs +1 -1
- package/dist/super-editor.es.js +1 -1
- package/dist/superdoc.cjs +2 -2
- package/dist/superdoc.es.js +3 -3
- package/dist/superdoc.umd.js +35 -33
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -16094,7 +16094,7 @@ const us = class l1 {
|
|
|
16094
16094
|
return;
|
|
16095
16095
|
}
|
|
16096
16096
|
}
|
|
16097
|
-
static updateDocumentVersion(e = this.convertedXml, n = "0.9.
|
|
16097
|
+
static updateDocumentVersion(e = this.convertedXml, n = "0.9.25") {
|
|
16098
16098
|
const r = "docProps/custom.xml";
|
|
16099
16099
|
e[r] || (e[r] = c1());
|
|
16100
16100
|
const o = e["docProps/custom.xml"];
|
|
@@ -16319,7 +16319,7 @@ function UT(t) {
|
|
|
16319
16319
|
function c1() {
|
|
16320
16320
|
return OE;
|
|
16321
16321
|
}
|
|
16322
|
-
function u1(t = 2, e = "0.9.
|
|
16322
|
+
function u1(t = 2, e = "0.9.25") {
|
|
16323
16323
|
return {
|
|
16324
16324
|
type: "element",
|
|
16325
16325
|
name: "property",
|
|
@@ -23331,7 +23331,7 @@ e.sv.get(t.id.client) > t.id.clock && !Me.isDeleted(e.ds, t.id), ZO = [{ light:
|
|
|
23331
23331
|
/** @type {ColorDef} */
|
|
23332
23332
|
t.get(n)
|
|
23333
23333
|
);
|
|
23334
|
-
},
|
|
23334
|
+
}, eM = (t, {
|
|
23335
23335
|
colors: e = ZO,
|
|
23336
23336
|
colorMapping: n = /* @__PURE__ */ new Map(),
|
|
23337
23337
|
permanentUserData: r = null,
|
|
@@ -23340,7 +23340,7 @@ e.sv.get(t.id.client) > t.id.clock && !Me.isDeleted(e.ds, t.id), ZO = [{ light:
|
|
|
23340
23340
|
mapping: i
|
|
23341
23341
|
} = {}) => {
|
|
23342
23342
|
let s = !1;
|
|
23343
|
-
const a = new
|
|
23343
|
+
const a = new nM(t, i), l = new it({
|
|
23344
23344
|
props: {
|
|
23345
23345
|
editable: (c) => {
|
|
23346
23346
|
const u = ct.getState(c);
|
|
@@ -23415,7 +23415,7 @@ e.sv.get(t.id.client) > t.id.clock && !Me.isDeleted(e.ds, t.id), ZO = [{ light:
|
|
|
23415
23415
|
})
|
|
23416
23416
|
});
|
|
23417
23417
|
return l;
|
|
23418
|
-
},
|
|
23418
|
+
}, tM = (t, e, n) => {
|
|
23419
23419
|
if (e !== null && e.anchor !== null && e.head !== null)
|
|
23420
23420
|
if (e.type === "all")
|
|
23421
23421
|
t.setSelection(new Zn(t.doc));
|
|
@@ -23449,7 +23449,7 @@ e.sv.get(t.id.client) > t.id.clock && !Me.isDeleted(e.ds, t.id), ZO = [{ light:
|
|
|
23449
23449
|
t.mapping
|
|
23450
23450
|
)
|
|
23451
23451
|
});
|
|
23452
|
-
class
|
|
23452
|
+
class nM {
|
|
23453
23453
|
/**
|
|
23454
23454
|
* @param {Y.XmlFragment} yXmlFragment The bind source
|
|
23455
23455
|
* @param {ProsemirrorMapping} mapping
|
|
@@ -23636,7 +23636,7 @@ class n5 {
|
|
|
23636
23636
|
this.prosemirrorView.state.doc.content.size,
|
|
23637
23637
|
new xe(ge.from(i), 0, 0)
|
|
23638
23638
|
);
|
|
23639
|
-
|
|
23639
|
+
tM(s, this.beforeTransactionSelection, this), s = s.setMeta(ct, { isChangeOrigin: !0, isUndoRedoOperation: n.origin instanceof Me.UndoManager }), this.beforeTransactionSelection !== null && this._isLocalCursorInView() && s.scrollIntoView(), this.prosemirrorView.dispatch(s);
|
|
23640
23640
|
});
|
|
23641
23641
|
}
|
|
23642
23642
|
/**
|
|
@@ -23702,7 +23702,7 @@ const p2 = (t, e, n, r, o, i) => {
|
|
|
23702
23702
|
]), c.doc.transact((d) => {
|
|
23703
23703
|
c._item.delete(d);
|
|
23704
23704
|
}));
|
|
23705
|
-
const u =
|
|
23705
|
+
const u = rM(
|
|
23706
23706
|
l,
|
|
23707
23707
|
e,
|
|
23708
23708
|
n,
|
|
@@ -23742,12 +23742,12 @@ const p2 = (t, e, n, r, o, i) => {
|
|
|
23742
23742
|
t._item.delete(l);
|
|
23743
23743
|
}, ct), n.mapping.delete(t), null;
|
|
23744
23744
|
}
|
|
23745
|
-
},
|
|
23745
|
+
}, rM = (t, e, n, r, o, i) => {
|
|
23746
23746
|
const s = [], a = t.toDelta(r, o, i);
|
|
23747
23747
|
try {
|
|
23748
23748
|
for (let l = 0; l < a.length; l++) {
|
|
23749
23749
|
const c = a[l];
|
|
23750
|
-
s.push(e.text(c.insert,
|
|
23750
|
+
s.push(e.text(c.insert, cM(c.attributes, e)));
|
|
23751
23751
|
}
|
|
23752
23752
|
} catch {
|
|
23753
23753
|
return t.doc.transact((l) => {
|
|
@@ -23755,14 +23755,14 @@ const p2 = (t, e, n, r, o, i) => {
|
|
|
23755
23755
|
}, ct), null;
|
|
23756
23756
|
}
|
|
23757
23757
|
return s;
|
|
23758
|
-
},
|
|
23758
|
+
}, oM = (t, e) => {
|
|
23759
23759
|
const n = new Me.XmlText(), r = t.map((o) => ({
|
|
23760
23760
|
// @ts-ignore
|
|
23761
23761
|
insert: o.text,
|
|
23762
23762
|
attributes: g2(o.marks, e)
|
|
23763
23763
|
}));
|
|
23764
23764
|
return n.applyDelta(r), e.mapping.set(n, t), n;
|
|
23765
|
-
},
|
|
23765
|
+
}, iM = (t, e) => {
|
|
23766
23766
|
const n = new Me.XmlElement(t.type.name);
|
|
23767
23767
|
for (const r in t.attrs) {
|
|
23768
23768
|
const o = t.attrs[r];
|
|
@@ -23774,7 +23774,7 @@ const p2 = (t, e, n, r, o, i) => {
|
|
|
23774
23774
|
(r) => rf(r, e)
|
|
23775
23775
|
)
|
|
23776
23776
|
), e.mapping.set(n, t), n;
|
|
23777
|
-
}, rf = (t, e) => t instanceof Array ?
|
|
23777
|
+
}, rf = (t, e) => t instanceof Array ? oM(t, e) : iM(t, e), Fy = (t) => typeof t == "object" && t !== null, Op = (t, e) => {
|
|
23778
23778
|
const n = Object.keys(t).filter((o) => t[o] !== null);
|
|
23779
23779
|
let r = n.length === Object.keys(e).filter((o) => e[o] !== null).length;
|
|
23780
23780
|
for (let o = 0; o < n.length && r; o++) {
|
|
@@ -23839,7 +23839,7 @@ const p2 = (t, e, n, r, o, i) => {
|
|
|
23839
23839
|
equalityFactor: l + c,
|
|
23840
23840
|
foundMappedChild: u
|
|
23841
23841
|
};
|
|
23842
|
-
},
|
|
23842
|
+
}, sM = (t) => {
|
|
23843
23843
|
let e = "", n = t._start;
|
|
23844
23844
|
const r = {};
|
|
23845
23845
|
for (; n !== null; )
|
|
@@ -23848,9 +23848,9 @@ const p2 = (t, e, n, r, o, i) => {
|
|
|
23848
23848
|
str: e,
|
|
23849
23849
|
nAttrs: r
|
|
23850
23850
|
};
|
|
23851
|
-
},
|
|
23851
|
+
}, aM = (t, e, n) => {
|
|
23852
23852
|
n.mapping.set(t, e);
|
|
23853
|
-
const { nAttrs: r, str: o } =
|
|
23853
|
+
const { nAttrs: r, str: o } = sM(t), i = e.map((c) => ({
|
|
23854
23854
|
insert: (
|
|
23855
23855
|
/** @type {any} */
|
|
23856
23856
|
c.text
|
|
@@ -23863,7 +23863,7 @@ const p2 = (t, e, n, r, o, i) => {
|
|
|
23863
23863
|
t.delete(l, a), t.insert(l, s), t.applyDelta(
|
|
23864
23864
|
i.map((c) => ({ retain: c.insert.length, attributes: c.attributes }))
|
|
23865
23865
|
);
|
|
23866
|
-
},
|
|
23866
|
+
}, lM = /(.*)(--[a-zA-Z0-9+/=]{8})$/, m2 = (t) => lM.exec(t)?.[1] ?? t, cM = (t, e) => {
|
|
23867
23867
|
const n = [];
|
|
23868
23868
|
for (const r in t)
|
|
23869
23869
|
n.push(e.mark(m2(r), t[r]));
|
|
@@ -23908,7 +23908,7 @@ const p2 = (t, e, n, r, o, i) => {
|
|
|
23908
23908
|
for (; a - c - u > 0 && i - c - u > 0; ) {
|
|
23909
23909
|
const f = s[c], p = o[c], h = s[a - u - 1], m = o[i - u - 1];
|
|
23910
23910
|
if (f instanceof Me.XmlText && p instanceof Array)
|
|
23911
|
-
h2(f, p) ||
|
|
23911
|
+
h2(f, p) || aM(f, p, r), c += 1;
|
|
23912
23912
|
else {
|
|
23913
23913
|
let y = f instanceof Me.XmlElement && sf(f, p), g = h instanceof Me.XmlElement && sf(h, m);
|
|
23914
23914
|
if (y && g) {
|
|
@@ -23956,7 +23956,7 @@ const p2 = (t, e, n, r, o, i) => {
|
|
|
23956
23956
|
}, ct);
|
|
23957
23957
|
}, sf = (t, e) => !(e instanceof Array) && t.nodeName === e.type.name;
|
|
23958
23958
|
let Ss = null;
|
|
23959
|
-
const
|
|
23959
|
+
const uM = () => {
|
|
23960
23960
|
const t = (
|
|
23961
23961
|
/** @type {Map<EditorView, Map<any, any>>} */
|
|
23962
23962
|
Ss
|
|
@@ -23967,8 +23967,8 @@ const u5 = () => {
|
|
|
23967
23967
|
r.setMeta(s, i);
|
|
23968
23968
|
}), n.dispatch(r));
|
|
23969
23969
|
});
|
|
23970
|
-
},
|
|
23971
|
-
Ss || (Ss = /* @__PURE__ */ new Map(), $p(0,
|
|
23970
|
+
}, dM = (t, e, n) => {
|
|
23971
|
+
Ss || (Ss = /* @__PURE__ */ new Map(), $p(0, uM)), c2(Ss, t, Qa).set(e, n);
|
|
23972
23972
|
}, $l = (t, e, n) => {
|
|
23973
23973
|
if (t === 0)
|
|
23974
23974
|
return Me.createRelativePositionFromTypeIndex(e, 0, -1);
|
|
@@ -24025,10 +24025,10 @@ const u5 = () => {
|
|
|
24025
24025
|
if (r === null)
|
|
24026
24026
|
throw l2();
|
|
24027
24027
|
if (t === 0 && r.constructor !== Me.XmlText && r !== e)
|
|
24028
|
-
return
|
|
24028
|
+
return fM(r._item.parent, r._item);
|
|
24029
24029
|
}
|
|
24030
24030
|
return Me.createRelativePositionFromTypeIndex(e, e._length, -1);
|
|
24031
|
-
},
|
|
24031
|
+
}, fM = (t, e) => {
|
|
24032
24032
|
let n = null, r = null;
|
|
24033
24033
|
return t._item === null ? r = Me.findRootTypeKey(t) : n = Me.createID(t._item.id.client, t._item.id.clock), new Me.RelativePosition(n, r, e.id);
|
|
24034
24034
|
}, qs = (t, e, n, r) => {
|
|
@@ -24077,7 +24077,7 @@ const u5 = () => {
|
|
|
24077
24077
|
a;
|
|
24078
24078
|
}
|
|
24079
24079
|
return s - 1;
|
|
24080
|
-
},
|
|
24080
|
+
}, pM = (t, e) => {
|
|
24081
24081
|
const n = t.toArray().map(
|
|
24082
24082
|
(r) => ks(
|
|
24083
24083
|
/** @type {Y.XmlElement} */
|
|
@@ -24087,22 +24087,22 @@ const u5 = () => {
|
|
|
24087
24087
|
)
|
|
24088
24088
|
).filter((r) => r !== null);
|
|
24089
24089
|
return ge.fromArray(n);
|
|
24090
|
-
},
|
|
24090
|
+
}, hM = (t, e) => e.topNodeType.create(null, pM(t, e)), mM = (t, e, n) => t !== e, gM = (t) => {
|
|
24091
24091
|
const e = document.createElement("span");
|
|
24092
24092
|
e.classList.add("ProseMirror-yjs-cursor"), e.setAttribute("style", `border-color: ${t.color}`);
|
|
24093
24093
|
const n = document.createElement("div");
|
|
24094
24094
|
n.setAttribute("style", `background-color: ${t.color}`), n.insertBefore(document.createTextNode(t.name), null);
|
|
24095
24095
|
const r = document.createTextNode(""), o = document.createTextNode("");
|
|
24096
24096
|
return e.insertBefore(r, null), e.insertBefore(n, null), e.insertBefore(o, null), e;
|
|
24097
|
-
},
|
|
24097
|
+
}, yM = (t) => ({
|
|
24098
24098
|
style: `background-color: ${t.color}70`,
|
|
24099
24099
|
class: "ProseMirror-yjs-selection"
|
|
24100
|
-
}),
|
|
24100
|
+
}), wM = /^#[0-9a-fA-F]{6}$/, Ly = (t, e, n, r, o) => {
|
|
24101
24101
|
const i = ct.getState(t), s = i.doc, a = [];
|
|
24102
24102
|
return i.snapshot != null || i.prevSnapshot != null || i.binding.mapping.size === 0 ? Ue.create(t.doc, []) : (e.getStates().forEach((l, c) => {
|
|
24103
24103
|
if (n(s.clientID, c, l) && l.cursor != null) {
|
|
24104
24104
|
const u = l.user || {};
|
|
24105
|
-
u.color == null ? u.color = "#ffa500" :
|
|
24105
|
+
u.color == null ? u.color = "#ffa500" : wM.test(u.color) || console.warn("A user uses an unsupported color format", u), u.name == null && (u.name = `User: ${c}`);
|
|
24106
24106
|
let d = qs(
|
|
24107
24107
|
s,
|
|
24108
24108
|
i.type,
|
|
@@ -24132,10 +24132,10 @@ const u5 = () => {
|
|
|
24132
24132
|
}
|
|
24133
24133
|
}
|
|
24134
24134
|
}), Ue.create(t.doc, a));
|
|
24135
|
-
},
|
|
24136
|
-
awarenessStateFilter: e =
|
|
24137
|
-
cursorBuilder: n =
|
|
24138
|
-
selectionBuilder: r =
|
|
24135
|
+
}, bM = (t, {
|
|
24136
|
+
awarenessStateFilter: e = mM,
|
|
24137
|
+
cursorBuilder: n = gM,
|
|
24138
|
+
selectionBuilder: r = yM,
|
|
24139
24139
|
getSelection: o = (s) => s.selection
|
|
24140
24140
|
} = {}, i = "cursor") => new it({
|
|
24141
24141
|
key: xa,
|
|
@@ -24165,7 +24165,7 @@ const u5 = () => {
|
|
|
24165
24165
|
},
|
|
24166
24166
|
view: (s) => {
|
|
24167
24167
|
const a = () => {
|
|
24168
|
-
s.docView &&
|
|
24168
|
+
s.docView && dM(s, xa, { awarenessUpdated: !0 });
|
|
24169
24169
|
}, l = () => {
|
|
24170
24170
|
const c = ct.getState(s.state), u = t.getLocalState() || {};
|
|
24171
24171
|
if (s.hasFocus()) {
|
|
@@ -24202,21 +24202,21 @@ const u5 = () => {
|
|
|
24202
24202
|
}
|
|
24203
24203
|
};
|
|
24204
24204
|
}
|
|
24205
|
-
}),
|
|
24205
|
+
}), vM = (t) => {
|
|
24206
24206
|
const e = Jr.getState(t).undoManager;
|
|
24207
24207
|
if (e != null)
|
|
24208
24208
|
return e.undo(), !0;
|
|
24209
|
-
},
|
|
24209
|
+
}, xM = (t) => {
|
|
24210
24210
|
const e = Jr.getState(t).undoManager;
|
|
24211
24211
|
if (e != null)
|
|
24212
24212
|
return e.redo(), !0;
|
|
24213
|
-
},
|
|
24213
|
+
}, kM = /* @__PURE__ */ new Set(["paragraph"]), SM = (t, e) => !(t instanceof cS) || !(t.content instanceof uS) || !(t.content.type instanceof dS || t.content.type instanceof fS && e.has(t.content.type.nodeName)) || t.content.type._length === 0, CM = ({ protectedNodes: t = kM, trackedOrigins: e = [], undoManager: n = null } = {}) => new it({
|
|
24214
24214
|
key: Jr,
|
|
24215
24215
|
state: {
|
|
24216
24216
|
init: (r, o) => {
|
|
24217
24217
|
const i = ct.getState(o), s = n || new lS(i.type, {
|
|
24218
24218
|
trackedOrigins: new Set([ct].concat(e)),
|
|
24219
|
-
deleteFilter: (a) =>
|
|
24219
|
+
deleteFilter: (a) => SM(a, t),
|
|
24220
24220
|
captureTransaction: (a) => a.meta.get("addToHistory") !== !1
|
|
24221
24221
|
});
|
|
24222
24222
|
return {
|
|
@@ -24258,7 +24258,7 @@ const u5 = () => {
|
|
|
24258
24258
|
}
|
|
24259
24259
|
});
|
|
24260
24260
|
var dr;
|
|
24261
|
-
class
|
|
24261
|
+
class AM {
|
|
24262
24262
|
constructor() {
|
|
24263
24263
|
Hr(this, dr, /* @__PURE__ */ new Map());
|
|
24264
24264
|
}
|
|
@@ -24381,18 +24381,18 @@ var Xr = {
|
|
|
24381
24381
|
220: "|",
|
|
24382
24382
|
221: "}",
|
|
24383
24383
|
222: '"'
|
|
24384
|
-
},
|
|
24384
|
+
}, EM = typeof navigator < "u" && /Mac/.test(navigator.platform), TM = typeof navigator < "u" && /MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);
|
|
24385
24385
|
for (var Pt = 0; Pt < 10; Pt++) Xr[48 + Pt] = Xr[96 + Pt] = String(Pt);
|
|
24386
24386
|
for (var Pt = 1; Pt <= 24; Pt++) Xr[Pt + 111] = "F" + Pt;
|
|
24387
24387
|
for (var Pt = 65; Pt <= 90; Pt++)
|
|
24388
24388
|
Xr[Pt] = String.fromCharCode(Pt + 32), Ol[Pt] = String.fromCharCode(Pt);
|
|
24389
24389
|
for (var Lu in Xr) Ol.hasOwnProperty(Lu) || (Ol[Lu] = Xr[Lu]);
|
|
24390
|
-
function $
|
|
24391
|
-
var e =
|
|
24390
|
+
function $M(t) {
|
|
24391
|
+
var e = EM && t.metaKey && t.shiftKey && !t.ctrlKey && !t.altKey || TM && t.shiftKey && t.key && t.key.length == 1 || t.key == "Unidentified", n = !e && t.key || (t.shiftKey ? Ol : Xr)[t.keyCode] || t.key || "Unidentified";
|
|
24392
24392
|
return n == "Esc" && (n = "Escape"), n == "Del" && (n = "Delete"), n == "Left" && (n = "ArrowLeft"), n == "Up" && (n = "ArrowUp"), n == "Right" && (n = "ArrowRight"), n == "Down" && (n = "ArrowDown"), n;
|
|
24393
24393
|
}
|
|
24394
|
-
const
|
|
24395
|
-
function
|
|
24394
|
+
const OM = typeof navigator < "u" ? /Mac|iP(hone|[oa]d)/.test(navigator.platform) : !1;
|
|
24395
|
+
function MM(t) {
|
|
24396
24396
|
let e = t.split(/-(?!$)/), n = e[e.length - 1];
|
|
24397
24397
|
n == "Space" && (n = " ");
|
|
24398
24398
|
let r, o, i, s;
|
|
@@ -24407,28 +24407,28 @@ function M5(t) {
|
|
|
24407
24407
|
else if (/^s(hift)?$/i.test(l))
|
|
24408
24408
|
i = !0;
|
|
24409
24409
|
else if (/^mod$/i.test(l))
|
|
24410
|
-
|
|
24410
|
+
OM ? s = !0 : o = !0;
|
|
24411
24411
|
else
|
|
24412
24412
|
throw new Error("Unrecognized modifier name: " + l);
|
|
24413
24413
|
}
|
|
24414
24414
|
return r && (n = "Alt-" + n), o && (n = "Ctrl-" + n), s && (n = "Meta-" + n), i && (n = "Shift-" + n), n;
|
|
24415
24415
|
}
|
|
24416
|
-
function
|
|
24416
|
+
function _M(t) {
|
|
24417
24417
|
let e = /* @__PURE__ */ Object.create(null);
|
|
24418
24418
|
for (let n in t)
|
|
24419
|
-
e[
|
|
24419
|
+
e[MM(n)] = t[n];
|
|
24420
24420
|
return e;
|
|
24421
24421
|
}
|
|
24422
24422
|
function Bu(t, e, n = !0) {
|
|
24423
24423
|
return e.altKey && (t = "Alt-" + t), e.ctrlKey && (t = "Ctrl-" + t), e.metaKey && (t = "Meta-" + t), n && e.shiftKey && (t = "Shift-" + t), t;
|
|
24424
24424
|
}
|
|
24425
|
-
function
|
|
24425
|
+
function DM(t) {
|
|
24426
24426
|
return new it({ props: { handleKeyDown: Mp(t) } });
|
|
24427
24427
|
}
|
|
24428
24428
|
function Mp(t) {
|
|
24429
|
-
let e =
|
|
24429
|
+
let e = _M(t);
|
|
24430
24430
|
return function(n, r) {
|
|
24431
|
-
let o = $
|
|
24431
|
+
let o = $M(r), i, s = e[Bu(o, r)];
|
|
24432
24432
|
if (s && s(n.state, n.dispatch, n))
|
|
24433
24433
|
return !0;
|
|
24434
24434
|
if (o.length == 1 && o != " ") {
|
|
@@ -24645,11 +24645,11 @@ Ml = /* @__PURE__ */ new WeakSet(), y2 = function(t, e) {
|
|
|
24645
24645
|
}
|
|
24646
24646
|
return n;
|
|
24647
24647
|
}, Hr(Ie, Ml);
|
|
24648
|
-
function
|
|
24648
|
+
function IM(t = {}) {
|
|
24649
24649
|
return Object.keys(t).length === 0 && t.constructor === Object;
|
|
24650
24650
|
}
|
|
24651
24651
|
function af(t) {
|
|
24652
|
-
const e = Object.entries(t).filter(([n, r]) => n === "attrs" &&
|
|
24652
|
+
const e = Object.entries(t).filter(([n, r]) => n === "attrs" && IM(r) ? !1 : r != null);
|
|
24653
24653
|
return Object.fromEntries(e);
|
|
24654
24654
|
}
|
|
24655
24655
|
var _l, b2, v2;
|
|
@@ -24731,11 +24731,11 @@ _l = /* @__PURE__ */ new WeakSet(), b2 = function(t, e, n) {
|
|
|
24731
24731
|
});
|
|
24732
24732
|
return Object.fromEntries(r);
|
|
24733
24733
|
}, Hr(x2, _l);
|
|
24734
|
-
let
|
|
24734
|
+
let NM = x2;
|
|
24735
24735
|
function Us(t, e) {
|
|
24736
24736
|
return e.nodes[t] || e.marks[t] || null;
|
|
24737
24737
|
}
|
|
24738
|
-
function
|
|
24738
|
+
function FM(t, e) {
|
|
24739
24739
|
return Array.isArray(e) ? e.some((n) => (typeof n == "string" ? n : n.name) === t.name) : e;
|
|
24740
24740
|
}
|
|
24741
24741
|
function _p(t, e) {
|
|
@@ -24854,11 +24854,11 @@ let k2 = class S2 {
|
|
|
24854
24854
|
return a;
|
|
24855
24855
|
}
|
|
24856
24856
|
};
|
|
24857
|
-
function
|
|
24857
|
+
function RM(t, e) {
|
|
24858
24858
|
const n = Li.fromSchema(e).serializeFragment(t), r = document.implementation.createHTMLDocument().createElement("div");
|
|
24859
24859
|
return r.appendChild(n), r.innerHTML;
|
|
24860
24860
|
}
|
|
24861
|
-
const
|
|
24861
|
+
const LM = (t, e = 500) => {
|
|
24862
24862
|
let n = "";
|
|
24863
24863
|
const r = t.parentOffset;
|
|
24864
24864
|
return t.parent.nodesBetween(
|
|
@@ -24875,12 +24875,12 @@ const L5 = (t, e = 500) => {
|
|
|
24875
24875
|
}
|
|
24876
24876
|
), n;
|
|
24877
24877
|
};
|
|
24878
|
-
class
|
|
24878
|
+
class BM {
|
|
24879
24879
|
constructor(e) {
|
|
24880
24880
|
Pe(this, "match"), Pe(this, "handler"), this.match = e.match, this.handler = e.handler;
|
|
24881
24881
|
}
|
|
24882
24882
|
}
|
|
24883
|
-
const
|
|
24883
|
+
const PM = (t, e) => {
|
|
24884
24884
|
if (Yv(e))
|
|
24885
24885
|
return e.exec(t);
|
|
24886
24886
|
const n = e(t);
|
|
@@ -24905,11 +24905,11 @@ const P5 = (t, e) => {
|
|
|
24905
24905
|
if (l.parent.type.spec.code || (l.nodeBefore || l.nodeAfter)?.marks.find((d) => d.type.spec.code))
|
|
24906
24906
|
return !1;
|
|
24907
24907
|
let c = !1;
|
|
24908
|
-
const u =
|
|
24908
|
+
const u = LM(l) + o;
|
|
24909
24909
|
return i.forEach((d) => {
|
|
24910
24910
|
if (c)
|
|
24911
24911
|
return;
|
|
24912
|
-
const f =
|
|
24912
|
+
const f = PM(u, d.match);
|
|
24913
24913
|
if (!f)
|
|
24914
24914
|
return;
|
|
24915
24915
|
const p = a.state.tr, h = _p(p, a.state), m = {
|
|
@@ -24933,7 +24933,7 @@ const P5 = (t, e) => {
|
|
|
24933
24933
|
text: o
|
|
24934
24934
|
}), a.dispatch(p), c = !0);
|
|
24935
24935
|
}), c;
|
|
24936
|
-
},
|
|
24936
|
+
}, zM = ({ editor: t, rules: e }) => {
|
|
24937
24937
|
const n = new it({
|
|
24938
24938
|
key: new lt("inputRulesPlugin"),
|
|
24939
24939
|
state: {
|
|
@@ -24947,7 +24947,7 @@ const P5 = (t, e) => {
|
|
|
24947
24947
|
const a = r.getMeta("applyInputRules");
|
|
24948
24948
|
return a && setTimeout(() => {
|
|
24949
24949
|
let { text: l } = a;
|
|
24950
|
-
typeof l != "string" && (l =
|
|
24950
|
+
typeof l != "string" && (l = RM(ge.from(l), i.schema));
|
|
24951
24951
|
const { from: c } = a, u = c + l.length;
|
|
24952
24952
|
Pu({
|
|
24953
24953
|
editor: t,
|
|
@@ -24993,9 +24993,9 @@ const P5 = (t, e) => {
|
|
|
24993
24993
|
return n;
|
|
24994
24994
|
};
|
|
24995
24995
|
var Dl, C2, By;
|
|
24996
|
-
const
|
|
24996
|
+
const jM = class ds {
|
|
24997
24997
|
constructor(e, n, r) {
|
|
24998
|
-
Hr(this, Dl), Pe(this, "editor"), Pe(this, "schema"), Pe(this, "extensions"), Pe(this, "externalExtensions", []), Pe(this, "splittableMarks", []), this.editor = r, this.externalExtensions = n || [], this.extensions = ds.getResolvedExtensions([...e, ...this.externalExtensions]), this.schema =
|
|
24998
|
+
Hr(this, Dl), Pe(this, "editor"), Pe(this, "schema"), Pe(this, "extensions"), Pe(this, "externalExtensions", []), Pe(this, "splittableMarks", []), this.editor = r, this.externalExtensions = n || [], this.extensions = ds.getResolvedExtensions([...e, ...this.externalExtensions]), this.schema = NM.createSchemaByExtensions(this.extensions, r), Be(this, Dl, C2).call(this);
|
|
24999
24999
|
}
|
|
25000
25000
|
/**
|
|
25001
25001
|
* Static method for creating ExtensionService.
|
|
@@ -25070,9 +25070,9 @@ const j5 = class ds {
|
|
|
25070
25070
|
const f = Object.entries(l()).map(([p, h]) => [p, (...m) => h({ editor: e, keymapArgs: m })]);
|
|
25071
25071
|
c = { ...Object.fromEntries(f) };
|
|
25072
25072
|
}
|
|
25073
|
-
a.push(
|
|
25073
|
+
a.push(DM(c));
|
|
25074
25074
|
const u = Fe(i, "addInputRules", s);
|
|
25075
|
-
|
|
25075
|
+
FM(i, e.options.enableInputRules) && u && r.push(...u());
|
|
25076
25076
|
const d = Fe(i, "addPmPlugins", s);
|
|
25077
25077
|
if (d) {
|
|
25078
25078
|
const f = d();
|
|
@@ -25081,7 +25081,7 @@ const j5 = class ds {
|
|
|
25081
25081
|
return a;
|
|
25082
25082
|
}).flat();
|
|
25083
25083
|
return [
|
|
25084
|
-
|
|
25084
|
+
zM({
|
|
25085
25085
|
editor: e,
|
|
25086
25086
|
rules: r
|
|
25087
25087
|
}),
|
|
@@ -25149,23 +25149,23 @@ By = function(t) {
|
|
|
25149
25149
|
}, n = Fe(t, "onBeforeCreate", e), r = Fe(t, "onCreate", e), o = Fe(t, "onUpdate", e), i = Fe(t, "onSelectionUpdate", e), s = Fe(t, "onTransaction", e), a = Fe(t, "onFocus", e), l = Fe(t, "onBlur", e), c = Fe(t, "onDestroy", e);
|
|
25150
25150
|
n && this.editor.on("beforeCreate", n), r && this.editor.on("create", r), o && this.editor.on("update", o), i && this.editor.on("selectionUpdate", i), s && this.editor.on("transaction", s), a && this.editor.on("focus", a), l && this.editor.on("blur", l), c && this.editor.on("destroy", c);
|
|
25151
25151
|
};
|
|
25152
|
-
let
|
|
25153
|
-
const
|
|
25152
|
+
let qM = jM;
|
|
25153
|
+
const UM = (t) => (e) => {
|
|
25154
25154
|
const n = typeof t == "function" ? t(e) : t;
|
|
25155
25155
|
for (let r = 0; r < n.length; r += 1)
|
|
25156
25156
|
if (n[r](e)) return !0;
|
|
25157
25157
|
return !1;
|
|
25158
|
-
},
|
|
25158
|
+
}, VM = (t) => (e) => t(e), HM = () => ({ tr: t }) => (t.insertText(" ", t.selection.from, t.selection.to), !0), WM = () => ({ tr: t, state: e }) => {
|
|
25159
25159
|
let n = t.selection.from;
|
|
25160
25160
|
const r = e.schema.nodes.tab.create();
|
|
25161
25161
|
return t.insert(n, r), !0;
|
|
25162
|
-
},
|
|
25163
|
-
function
|
|
25162
|
+
}, GM = (t, e) => ({ tr: n }) => (n.setMeta(t, e), !0), Dp = (t, e) => t.selection.empty ? !1 : (e && e(t.tr.deleteSelection().scrollIntoView()), !0);
|
|
25163
|
+
function KM(t, e) {
|
|
25164
25164
|
let { $cursor: n } = t.selection;
|
|
25165
25165
|
return !n || (e ? !e.endOfTextblock("backward", t) : n.parentOffset > 0) ? null : n;
|
|
25166
25166
|
}
|
|
25167
25167
|
const A2 = (t, e, n) => {
|
|
25168
|
-
let r =
|
|
25168
|
+
let r = KM(t, n);
|
|
25169
25169
|
if (!r)
|
|
25170
25170
|
return !1;
|
|
25171
25171
|
let o = T2(r);
|
|
@@ -25222,12 +25222,12 @@ function T2(t) {
|
|
|
25222
25222
|
}
|
|
25223
25223
|
return null;
|
|
25224
25224
|
}
|
|
25225
|
-
function
|
|
25225
|
+
function JM(t, e) {
|
|
25226
25226
|
let { $cursor: n } = t.selection;
|
|
25227
25227
|
return !n || (e ? !e.endOfTextblock("forward", t) : n.parentOffset < n.parent.content.size) ? null : n;
|
|
25228
25228
|
}
|
|
25229
25229
|
const $2 = (t, e, n) => {
|
|
25230
|
-
let r =
|
|
25230
|
+
let r = JM(t, n);
|
|
25231
25231
|
if (!r)
|
|
25232
25232
|
return !1;
|
|
25233
25233
|
let o = M2(r);
|
|
@@ -25270,7 +25270,7 @@ function M2(t) {
|
|
|
25270
25270
|
}
|
|
25271
25271
|
return null;
|
|
25272
25272
|
}
|
|
25273
|
-
const
|
|
25273
|
+
const XM = (t, e) => {
|
|
25274
25274
|
let n = t.selection, r = n instanceof Le, o;
|
|
25275
25275
|
if (r) {
|
|
25276
25276
|
if (n.node.isTextblock || !eo(t.doc, n.from))
|
|
@@ -25283,7 +25283,7 @@ const X5 = (t, e) => {
|
|
|
25283
25283
|
r && i.setSelection(Le.create(i.doc, o - t.doc.resolve(o).nodeBefore.nodeSize)), e(i.scrollIntoView());
|
|
25284
25284
|
}
|
|
25285
25285
|
return !0;
|
|
25286
|
-
},
|
|
25286
|
+
}, YM = (t, e) => {
|
|
25287
25287
|
let n = t.selection, r;
|
|
25288
25288
|
if (n instanceof Le) {
|
|
25289
25289
|
if (n.node.isTextblock || !eo(t.doc, n.to))
|
|
@@ -25305,7 +25305,7 @@ function Ip(t) {
|
|
|
25305
25305
|
}
|
|
25306
25306
|
return null;
|
|
25307
25307
|
}
|
|
25308
|
-
const
|
|
25308
|
+
const ZM = (t, e) => {
|
|
25309
25309
|
let { $head: n, $anchor: r } = t.selection;
|
|
25310
25310
|
if (!n.parent.type.spec.code || !n.sameParent(r))
|
|
25311
25311
|
return !1;
|
|
@@ -25341,7 +25341,7 @@ const Z5 = (t, e) => {
|
|
|
25341
25341
|
let r = n.blockRange(), o = r && oa(r);
|
|
25342
25342
|
return o == null ? !1 : (e && e(t.tr.lift(r, o).scrollIntoView()), !0);
|
|
25343
25343
|
};
|
|
25344
|
-
function
|
|
25344
|
+
function QM(t) {
|
|
25345
25345
|
return (e, n) => {
|
|
25346
25346
|
let { $from: r, $to: o } = e.selection;
|
|
25347
25347
|
if (e.selection instanceof Le && e.selection.node.isBlock)
|
|
@@ -25368,14 +25368,14 @@ function Q5(t) {
|
|
|
25368
25368
|
return n && n(u.scrollIntoView()), !0;
|
|
25369
25369
|
};
|
|
25370
25370
|
}
|
|
25371
|
-
const
|
|
25372
|
-
function
|
|
25371
|
+
const e5 = QM(), t5 = (t, e) => (e && e(t.tr.setSelection(new Zn(t.doc))), !0);
|
|
25372
|
+
function n5(t, e, n) {
|
|
25373
25373
|
let r = e.nodeBefore, o = e.nodeAfter, i = e.index();
|
|
25374
25374
|
return !r || !o || !r.type.compatibleContent(o.type) ? !1 : !r.content.size && e.parent.canReplace(i - 1, i) ? (n && n(t.tr.delete(e.pos - r.nodeSize, e.pos).scrollIntoView()), !0) : !e.parent.canReplace(i, i + 1) || !(o.isTextblock || eo(t.doc, e.pos)) ? !1 : (n && n(t.tr.join(e.pos).scrollIntoView()), !0);
|
|
25375
25375
|
}
|
|
25376
25376
|
function N2(t, e, n, r) {
|
|
25377
25377
|
let o = e.nodeBefore, i = e.nodeAfter, s, a, l = o.type.spec.isolating || i.type.spec.isolating;
|
|
25378
|
-
if (!l &&
|
|
25378
|
+
if (!l && n5(t, e, n))
|
|
25379
25379
|
return !0;
|
|
25380
25380
|
let c = !l && e.parent.canReplace(e.index(), e.index() + 1);
|
|
25381
25381
|
if (c && (s = (a = o.contentMatchAt(o.childCount)).findWrapping(i.type)) && a.matchType(s[0] || i.type).validEnd) {
|
|
@@ -25423,7 +25423,7 @@ function F2(t) {
|
|
|
25423
25423
|
return o.node(i).isTextblock ? (n && n(e.tr.setSelection(Ve.create(e.doc, t < 0 ? o.start(i) : o.end(i)))), !0) : !1;
|
|
25424
25424
|
};
|
|
25425
25425
|
}
|
|
25426
|
-
const
|
|
25426
|
+
const r5 = F2(-1), o5 = F2(1);
|
|
25427
25427
|
function Py(t, e = null) {
|
|
25428
25428
|
return function(n, r) {
|
|
25429
25429
|
let o = !1;
|
|
@@ -25464,7 +25464,7 @@ function Np(...t) {
|
|
|
25464
25464
|
}
|
|
25465
25465
|
Np(Dp, A2, E2);
|
|
25466
25466
|
Np(Dp, $2, O2);
|
|
25467
|
-
Np(_2, D2, I2,
|
|
25467
|
+
Np(_2, D2, I2, e5);
|
|
25468
25468
|
typeof navigator < "u" ? /Mac|iP(hone|[oa]d)/.test(navigator.platform) : typeof os < "u" && os.platform && os.platform() == "darwin";
|
|
25469
25469
|
function R2(t) {
|
|
25470
25470
|
for (let e = 0; e < t.edgeCount; e++) {
|
|
@@ -25479,7 +25479,7 @@ const zy = (t, e) => {
|
|
|
25479
25479
|
const r = n.filter((o) => e?.includes(o.type.name));
|
|
25480
25480
|
t.tr.ensureMarks(r);
|
|
25481
25481
|
}
|
|
25482
|
-
},
|
|
25482
|
+
}, i5 = ({ keepMarks: t = !0 } = {}) => (e) => {
|
|
25483
25483
|
const { tr: n, state: r, dispatch: o, editor: i } = e, { selection: s, doc: a } = n, { $from: l, $to: c } = s, u = i.extensionService.attributes, d = Ie.getSplittedAttributes(u, l.node().type.name, l.node().attrs);
|
|
25484
25484
|
if (s instanceof Le && s.node.isBlock)
|
|
25485
25485
|
return !l.parentOffset || !vr(a, l.pos) ? !1 : (o && (t && zy(r, i.extensionService.splittableMarks), n.split(l.pos).scrollIntoView()), !0);
|
|
@@ -25496,9 +25496,9 @@ const zy = (t, e) => {
|
|
|
25496
25496
|
t && zy(r, i.extensionService.splittableMarks), n.scrollIntoView();
|
|
25497
25497
|
}
|
|
25498
25498
|
return !0;
|
|
25499
|
-
},
|
|
25499
|
+
}, s5 = () => ({ state: t, dispatch: e }) => I2(t, e), a5 = () => ({ state: t, dispatch: e }) => D2(t, e), l5 = () => ({ state: t, dispatch: e }) => _2(t, e), c5 = () => ({ state: t, dispatch: e }) => ZM(t, e), L2 = (t) => {
|
|
25500
25500
|
};
|
|
25501
|
-
function
|
|
25501
|
+
function u5(t, e, n) {
|
|
25502
25502
|
const { selection: r } = e;
|
|
25503
25503
|
let o = null;
|
|
25504
25504
|
if (L2() && (o = r.$cursor), o) {
|
|
@@ -25517,7 +25517,7 @@ function uM(t, e, n) {
|
|
|
25517
25517
|
}), a;
|
|
25518
25518
|
});
|
|
25519
25519
|
}
|
|
25520
|
-
const
|
|
25520
|
+
const d5 = (t, e = {}) => ({ tr: n, state: r, dispatch: o }) => {
|
|
25521
25521
|
const { selection: i } = n, { empty: s, ranges: a } = i, l = Tr(t, r.schema);
|
|
25522
25522
|
if (o)
|
|
25523
25523
|
if (s) {
|
|
@@ -25545,12 +25545,12 @@ const dM = (t, e = {}) => ({ tr: n, state: r, dispatch: o }) => {
|
|
|
25545
25545
|
}) : n.addMark(h, m, l.create(e));
|
|
25546
25546
|
});
|
|
25547
25547
|
});
|
|
25548
|
-
return
|
|
25548
|
+
return u5(r, n, l);
|
|
25549
25549
|
};
|
|
25550
25550
|
function cf(t, e, n = {}) {
|
|
25551
25551
|
return t.find((r) => r.type === e && ki(r.attrs, n));
|
|
25552
25552
|
}
|
|
25553
|
-
function
|
|
25553
|
+
function f5(t, e, n = {}) {
|
|
25554
25554
|
return !!cf(t, e, n);
|
|
25555
25555
|
}
|
|
25556
25556
|
function Fp(t, e, n = {}) {
|
|
@@ -25562,11 +25562,11 @@ function Fp(t, e, n = {}) {
|
|
|
25562
25562
|
let i = r.index, s = t.start() + r.offset, a = i + 1, l = s + r.node.nodeSize;
|
|
25563
25563
|
for (cf([...r.node.marks], e, n); i > 0 && o.isInSet(t.parent.child(i - 1).marks); )
|
|
25564
25564
|
i -= 1, s -= t.parent.child(i).nodeSize;
|
|
25565
|
-
for (; a < t.parent.childCount &&
|
|
25565
|
+
for (; a < t.parent.childCount && f5([...t.parent.child(a).marks], e, n); )
|
|
25566
25566
|
l += t.parent.child(a).nodeSize, a += 1;
|
|
25567
25567
|
return { from: s, to: l };
|
|
25568
25568
|
}
|
|
25569
|
-
const
|
|
25569
|
+
const p5 = (t, e = {}) => ({ tr: n, state: r, dispatch: o }) => {
|
|
25570
25570
|
const { extendEmptyMarkRange: i = !1 } = e, { selection: s } = n, a = Tr(t, r.schema), { $from: l, empty: c, ranges: u } = s;
|
|
25571
25571
|
if (!o) return !0;
|
|
25572
25572
|
if (c && i) {
|
|
@@ -25578,7 +25578,7 @@ const pM = (t, e = {}) => ({ tr: n, state: r, dispatch: o }) => {
|
|
|
25578
25578
|
n.removeMark(d.$from.pos, d.$to.pos, a);
|
|
25579
25579
|
});
|
|
25580
25580
|
return n.removeStoredMark(a), !0;
|
|
25581
|
-
},
|
|
25581
|
+
}, h5 = () => ({ tr: t, dispatch: e }) => {
|
|
25582
25582
|
const { selection: n } = t, { empty: r, ranges: o } = n;
|
|
25583
25583
|
return r || e && o.forEach((i) => {
|
|
25584
25584
|
t.removeMark(i.$from.pos, i.$to.pos);
|
|
@@ -25607,10 +25607,10 @@ function Il(t, e, n = {}) {
|
|
|
25607
25607
|
const l = a.filter((u) => i ? i.name === u.mark.type.name : !0).filter((u) => ki(u.mark.attrs, n, { strict: !1 })).reduce((u, d) => u + d.to - d.from, 0), c = a.filter((u) => i ? u.mark.type !== i && u.mark.type.excludes(i) : !0).reduce((u, d) => u + d.to - d.from, 0);
|
|
25608
25608
|
return (l > 0 ? l + c : l) >= s;
|
|
25609
25609
|
}
|
|
25610
|
-
const
|
|
25610
|
+
const m5 = (t, e = {}, n = {}) => ({ state: r, commands: o }) => {
|
|
25611
25611
|
const { extendEmptyMarkRange: i = !1 } = n, s = Tr(t, r.schema);
|
|
25612
25612
|
return Il(r, s, e) ? o.unsetMark(s, { extendEmptyMarkRange: i }) : o.setMark(s, e);
|
|
25613
|
-
},
|
|
25613
|
+
}, g5 = () => ({ state: t, tr: e, dispatch: n }) => {
|
|
25614
25614
|
const { selection: r } = e, { ranges: o } = r;
|
|
25615
25615
|
return n && o.forEach(({ $from: i, $to: s }) => {
|
|
25616
25616
|
t.doc.nodesBetween(i.pos, s.pos, (a, l) => {
|
|
@@ -25625,7 +25625,7 @@ const mM = (t, e = {}, n = {}) => ({ state: r, commands: o }) => {
|
|
|
25625
25625
|
(h || h === 0) && e.lift(p, h);
|
|
25626
25626
|
});
|
|
25627
25627
|
}), !0;
|
|
25628
|
-
},
|
|
25628
|
+
}, y5 = (t, e = {}) => ({ state: n, dispatch: r, chain: o }) => {
|
|
25629
25629
|
const i = Ct(t, n.schema);
|
|
25630
25630
|
return i.isTextblock ? o().command(({ commands: s }) => Py(i, e)(n) ? !0 : s.clearNodes()).command(({ state: s }) => Py(i, e)(s, r)).run() : !1;
|
|
25631
25631
|
};
|
|
@@ -25643,10 +25643,10 @@ function Nl(t, e, n = {}) {
|
|
|
25643
25643
|
const l = o - r, c = a.filter((u) => s ? s.name === u.node.type.name : !0).filter((u) => ki(u.node.attrs, n, { strict: !1 }));
|
|
25644
25644
|
return i ? !!c.length : c.reduce((u, d) => u + d.to - d.from, 0) >= l;
|
|
25645
25645
|
}
|
|
25646
|
-
const
|
|
25646
|
+
const w5 = (t, e, n = {}) => ({ state: r, commands: o }) => {
|
|
25647
25647
|
const i = Ct(t, r.schema), s = Ct(e, r.schema);
|
|
25648
25648
|
return Nl(r, i, n) ? o.setNode(s) : o.setNode(i, n);
|
|
25649
|
-
},
|
|
25649
|
+
}, b5 = () => ({ state: t, dispatch: e }) => t5(t, e), v5 = () => ({ state: t, dispatch: e }) => Dp(t, e), x5 = (t, e = {}) => ({ tr: n, state: r, dispatch: o }) => {
|
|
25650
25650
|
let i = null, s = null;
|
|
25651
25651
|
const a = la(
|
|
25652
25652
|
typeof t == "string" ? t : t.name,
|
|
@@ -25668,7 +25668,7 @@ function jy(t, e) {
|
|
|
25668
25668
|
const n = typeof e == "string" ? [e] : e;
|
|
25669
25669
|
return Object.keys(t).reduce((r, o) => (n.includes(o) || (r[o] = t[o]), r), {});
|
|
25670
25670
|
}
|
|
25671
|
-
const
|
|
25671
|
+
const k5 = (t, e) => ({ tr: n, state: r, dispatch: o }) => {
|
|
25672
25672
|
let i = null, s = null;
|
|
25673
25673
|
const a = la(
|
|
25674
25674
|
typeof t == "string" ? t : t.name,
|
|
@@ -25681,7 +25681,7 @@ const kM = (t, e) => ({ tr: n, state: r, dispatch: o }) => {
|
|
|
25681
25681
|
});
|
|
25682
25682
|
});
|
|
25683
25683
|
}), !0) : !1;
|
|
25684
|
-
},
|
|
25684
|
+
}, S5 = () => ({ state: t, dispatch: e }) => XM(t, e), C5 = () => ({ state: t, dispatch: e }) => YM(t, e), A5 = () => ({ state: t, dispatch: e }) => A2(t, e), E5 = () => ({ state: t, dispatch: e }) => $2(t, e), T5 = () => ({ state: t, dispatch: e }) => E2(t, e), $5 = () => ({ state: t, dispatch: e }) => O2(t, e), O5 = () => ({ state: t, dispatch: e }) => r5(t, e), M5 = () => ({ state: t, dispatch: e }) => o5(t, e), _5 = (t, e) => ({ tr: n, commands: r }) => r.insertContentAt({ from: n.selection.from, to: n.selection.to }, t, e), B2 = (t) => {
|
|
25685
25685
|
const e = t.childNodes;
|
|
25686
25686
|
for (let n = e.length - 1; n >= 0; n -= 1) {
|
|
25687
25687
|
const r = e[n];
|
|
@@ -25742,7 +25742,7 @@ function uf(t, e, n) {
|
|
|
25742
25742
|
}
|
|
25743
25743
|
return uf("", e, n);
|
|
25744
25744
|
}
|
|
25745
|
-
function
|
|
25745
|
+
function D5(t, e, n) {
|
|
25746
25746
|
const r = t.steps.length - 1;
|
|
25747
25747
|
if (r < e)
|
|
25748
25748
|
return;
|
|
@@ -25755,7 +25755,7 @@ function DM(t, e, n) {
|
|
|
25755
25755
|
s === 0 && (s = u);
|
|
25756
25756
|
}), t.setSelection(qe.near(t.doc.resolve(s), n));
|
|
25757
25757
|
}
|
|
25758
|
-
const
|
|
25758
|
+
const I5 = (t) => !("type" in t), N5 = (t, e, n) => ({ tr: r, dispatch: o, editor: i }) => {
|
|
25759
25759
|
if (o) {
|
|
25760
25760
|
n = {
|
|
25761
25761
|
parseOptions: {},
|
|
@@ -25783,17 +25783,17 @@ const IM = (t) => !("type" in t), NM = (t, e, n) => ({ tr: r, dispatch: o, edito
|
|
|
25783
25783
|
}), !1;
|
|
25784
25784
|
}
|
|
25785
25785
|
let { from: a, to: l } = typeof t == "number" ? { from: t, to: t } : { from: t.from, to: t.to }, c = !0, u = !0;
|
|
25786
|
-
if ((
|
|
25786
|
+
if ((I5(s) ? s : [s]).forEach((f) => {
|
|
25787
25787
|
f.check(), c = c ? f.isText && f.marks.length === 0 : !1, u = u ? f.isBlock : !1;
|
|
25788
25788
|
}), a === l && u) {
|
|
25789
25789
|
const { parent: f } = r.doc.resolve(a);
|
|
25790
25790
|
f.isTextblock && !f.type.spec.code && !f.childCount && (a -= 1, l += 1);
|
|
25791
25791
|
}
|
|
25792
25792
|
let d;
|
|
25793
|
-
c ? (Array.isArray(e) ? d = e.map((f) => f.text || "").join("") : typeof e == "object" && e && e.text ? d = e.text : d = e, r.insertText(d, a, l)) : (d = s, r.replaceWith(a, l, d)), n.updateSelection &&
|
|
25793
|
+
c ? (Array.isArray(e) ? d = e.map((f) => f.text || "").join("") : typeof e == "object" && e && e.text ? d = e.text : d = e, r.insertText(d, a, l)) : (d = s, r.replaceWith(a, l, d)), n.updateSelection && D5(r, r.steps.length - 1, -1), n.applyInputRules && r.setMeta("applyInputRules", { from: a, text: d }), n.applyPasteRules && r.setMeta("applyPasteRules", { from: a, text: d });
|
|
25794
25794
|
}
|
|
25795
25795
|
return !0;
|
|
25796
|
-
},
|
|
25796
|
+
}, F5 = () => ({ state: t, dispatch: e }) => {
|
|
25797
25797
|
const n = t.plugins;
|
|
25798
25798
|
for (let r = 0; r < n.length; r += 1) {
|
|
25799
25799
|
const o = n[r];
|
|
@@ -25814,16 +25814,16 @@ const IM = (t) => !("type" in t), NM = (t, e, n) => ({ tr: r, dispatch: o, edito
|
|
|
25814
25814
|
}
|
|
25815
25815
|
return !1;
|
|
25816
25816
|
};
|
|
25817
|
-
function
|
|
25817
|
+
function R5(t, e = null) {
|
|
25818
25818
|
return function(n, r) {
|
|
25819
25819
|
let { $from: o, $to: i } = n.selection, s = o.blockRange(i);
|
|
25820
25820
|
if (!s)
|
|
25821
25821
|
return !1;
|
|
25822
25822
|
let a = r ? n.tr : null;
|
|
25823
|
-
return
|
|
25823
|
+
return L5(a, s, t, e) ? (r && r(a.scrollIntoView()), !0) : !1;
|
|
25824
25824
|
};
|
|
25825
25825
|
}
|
|
25826
|
-
function
|
|
25826
|
+
function L5(t, e, n, r = null) {
|
|
25827
25827
|
let o = !1, i = e, s = e.$from.doc;
|
|
25828
25828
|
if (e.depth >= 2 && e.$from.node(e.depth - 1).type.compatibleContent(n) && e.startIndex == 0) {
|
|
25829
25829
|
if (e.$from.index(e.depth - 1) == 0)
|
|
@@ -25832,9 +25832,9 @@ function LM(t, e, n, r = null) {
|
|
|
25832
25832
|
i = new yl(l, l, e.depth), e.endIndex < e.parent.childCount && (e = new yl(e.$from, s.resolve(e.$to.end(e.depth)), e.depth)), o = !0;
|
|
25833
25833
|
}
|
|
25834
25834
|
let a = yv(i, n, r, e);
|
|
25835
|
-
return a ? (t &&
|
|
25835
|
+
return a ? (t && B5(t, e, a, o, n), !0) : !1;
|
|
25836
25836
|
}
|
|
25837
|
-
function
|
|
25837
|
+
function B5(t, e, n, r, o) {
|
|
25838
25838
|
let i = ge.empty;
|
|
25839
25839
|
for (let u = n.length - 1; u >= 0; u--)
|
|
25840
25840
|
i = ge.from(n[u].type.create(n[u].attrs, i));
|
|
@@ -25847,13 +25847,13 @@ function BM(t, e, n, r, o) {
|
|
|
25847
25847
|
!f && vr(t.doc, l, a) && (t.split(l, a), l += 2 * a), l += c.child(u).nodeSize;
|
|
25848
25848
|
return t;
|
|
25849
25849
|
}
|
|
25850
|
-
function
|
|
25850
|
+
function P5(t) {
|
|
25851
25851
|
return function(e, n) {
|
|
25852
25852
|
let { $from: r, $to: o } = e.selection, i = r.blockRange(o, (s) => s.childCount > 0 && s.firstChild.type == t);
|
|
25853
|
-
return i ? n ? r.node(i.depth - 1).type == t ?
|
|
25853
|
+
return i ? n ? r.node(i.depth - 1).type == t ? z5(e, n, t, i) : j5(e, n, i) : !0 : !1;
|
|
25854
25854
|
};
|
|
25855
25855
|
}
|
|
25856
|
-
function
|
|
25856
|
+
function z5(t, e, n, r) {
|
|
25857
25857
|
let o = t.tr, i = r.end, s = r.$to.end(r.depth);
|
|
25858
25858
|
i < s && (o.step(new pn(i - 1, s, i, s, new xe(ge.from(n.create(null, r.parent.copy())), 1, 0), 1, !0)), r = new yl(o.doc.resolve(r.$from.pos), o.doc.resolve(s), r.depth));
|
|
25859
25859
|
const a = oa(r);
|
|
@@ -25863,7 +25863,7 @@ function zM(t, e, n, r) {
|
|
|
25863
25863
|
let l = o.doc.resolve(o.mapping.map(i, -1) - 1);
|
|
25864
25864
|
return eo(o.doc, l.pos) && l.nodeBefore.type == l.nodeAfter.type && o.join(l.pos), e(o.scrollIntoView()), !0;
|
|
25865
25865
|
}
|
|
25866
|
-
function
|
|
25866
|
+
function j5(t, e, n) {
|
|
25867
25867
|
let r = t.tr, o = n.parent;
|
|
25868
25868
|
for (let p = n.end, h = n.endIndex - 1, m = n.startIndex; h > m; h--)
|
|
25869
25869
|
p -= o.child(h).nodeSize, r.delete(p - 1, p + 1);
|
|
@@ -25876,7 +25876,7 @@ function jM(t, e, n) {
|
|
|
25876
25876
|
let d = i.pos, f = d + s.nodeSize;
|
|
25877
25877
|
return r.step(new pn(d - (a ? 1 : 0), f + (l ? 1 : 0), d + 1, f - 1, new xe((a ? ge.empty : ge.from(o.copy(ge.empty))).append(l ? ge.empty : ge.from(o.copy(ge.empty))), a ? 0 : 1, l ? 0 : 1), a ? 0 : 1)), e(r.scrollIntoView()), !0;
|
|
25878
25878
|
}
|
|
25879
|
-
function
|
|
25879
|
+
function q5(t) {
|
|
25880
25880
|
return function(e, n) {
|
|
25881
25881
|
let { $from: r, $to: o } = e.selection, i = r.blockRange(o, (c) => c.childCount > 0 && c.firstChild.type == t);
|
|
25882
25882
|
if (!i)
|
|
@@ -25894,9 +25894,9 @@ function qM(t) {
|
|
|
25894
25894
|
return !0;
|
|
25895
25895
|
};
|
|
25896
25896
|
}
|
|
25897
|
-
const
|
|
25897
|
+
const U5 = (t, e = {}) => ({ state: n, dispatch: r }) => {
|
|
25898
25898
|
const o = Ct(t, n.schema);
|
|
25899
|
-
return
|
|
25899
|
+
return R5(o, e)(n, r);
|
|
25900
25900
|
}, uc = (t, e) => {
|
|
25901
25901
|
for (let n = t.depth; n > 0; n--) {
|
|
25902
25902
|
const r = t.node(n);
|
|
@@ -25917,7 +25917,7 @@ const UM = (t, e = {}) => ({ state: n, dispatch: r }) => {
|
|
|
25917
25917
|
storage: n.storage
|
|
25918
25918
|
}, o = Ye(Fe(n, "group", r));
|
|
25919
25919
|
return typeof o != "string" ? !1 : o.split(" ").includes("list");
|
|
25920
|
-
},
|
|
25920
|
+
}, V5 = {
|
|
25921
25921
|
type: "element",
|
|
25922
25922
|
name: "w:abstractNum",
|
|
25923
25923
|
attributes: {
|
|
@@ -26416,7 +26416,7 @@ const UM = (t, e = {}) => ({ state: n, dispatch: r }) => {
|
|
|
26416
26416
|
]
|
|
26417
26417
|
}
|
|
26418
26418
|
]
|
|
26419
|
-
},
|
|
26419
|
+
}, H5 = {
|
|
26420
26420
|
type: "element",
|
|
26421
26421
|
name: "w:abstractNum",
|
|
26422
26422
|
attributes: {
|
|
@@ -27074,14 +27074,14 @@ const UM = (t, e = {}) => ({ state: n, dispatch: r }) => {
|
|
|
27074
27074
|
if (r === void 0) return !0;
|
|
27075
27075
|
const o = t.doc.nodeAt(r);
|
|
27076
27076
|
return n.node.type === o?.type && eo(t.doc, r) && t.join(r), !0;
|
|
27077
|
-
},
|
|
27077
|
+
}, W5 = (t, e, n, r = {}) => (o) => {
|
|
27078
27078
|
const { editor: i, tr: s, state: a, dispatch: l, chain: c, can: u, commands: d } = o, { extensions: f, splittableMarks: p } = i.extensionService, h = Ct(t, a.schema), m = Ct(e, a.schema), { selection: y, storedMarks: g } = a, { $from: v, $to: x } = y, w = v.blockRange(x), E = g || y.$to.parentOffset && y.$from.marks();
|
|
27079
27079
|
if (!w) return !1;
|
|
27080
27080
|
const O = un((U) => df(U.type.name, f))(y), { numbering: M } = i.converter;
|
|
27081
27081
|
if (w.depth >= 1 && O && w.depth - O.depth <= 1) {
|
|
27082
27082
|
if (O.node.type === h) {
|
|
27083
27083
|
const { listId: U } = O.node.attrs;
|
|
27084
|
-
return i.converter.numbering =
|
|
27084
|
+
return i.converter.numbering = K5(U, M), d.liftListItem(m);
|
|
27085
27085
|
}
|
|
27086
27086
|
if (df(O.node.type.name, f) && h.validContent(O.node.content) && l)
|
|
27087
27087
|
return c().command(() => (s.setNodeMarkup(O.pos, h), !0)).command(() => zu(s, h)).command(() => ju(s, h)).run();
|
|
@@ -27094,9 +27094,9 @@ const UM = (t, e = {}) => ({ state: n, dispatch: r }) => {
|
|
|
27094
27094
|
}
|
|
27095
27095
|
return oe ? !0 : d.clearNodes();
|
|
27096
27096
|
}, S = P2(M.definitions);
|
|
27097
|
-
return i.converter.numbering =
|
|
27098
|
-
}, P2 = (t) => Math.max(...Object.keys(t).map(Number)) + 1,
|
|
27099
|
-
const r = n.name === "orderedList" ?
|
|
27097
|
+
return i.converter.numbering = G5(S, M, h), r.listId = S, !n || !E || !l ? c().command(N({ ensureMarks: !1 })).wrapInList(h, r).command(() => zu(s, h)).command(() => ju(s, h)).run() : c().command(N({ ensureMarks: !0 })).wrapInList(h, r).command(() => zu(s, h)).command(() => ju(s, h)).run();
|
|
27098
|
+
}, P2 = (t) => Math.max(...Object.keys(t).map(Number)) + 1, G5 = (t, e, n) => {
|
|
27099
|
+
const r = n.name === "orderedList" ? V5 : H5, o = { ...e }, i = P2(o.abstracts), s = {
|
|
27100
27100
|
...r,
|
|
27101
27101
|
attributes: {
|
|
27102
27102
|
...r.attributes,
|
|
@@ -27116,10 +27116,10 @@ const UM = (t, e = {}) => ({ state: n, dispatch: r }) => {
|
|
|
27116
27116
|
]
|
|
27117
27117
|
};
|
|
27118
27118
|
return o.definitions[t] = a, o;
|
|
27119
|
-
},
|
|
27119
|
+
}, K5 = (t, e) => {
|
|
27120
27120
|
const { definitions: n, abstracts: r } = e, o = n[t].elements[0].attributes["w:val"];
|
|
27121
27121
|
return delete n[t], delete r[o], e;
|
|
27122
|
-
},
|
|
27122
|
+
}, J5 = (t) => (e) => {
|
|
27123
27123
|
const { tr: n, state: r, dispatch: o, editor: i } = e, s = Ct(t, r.schema), { $from: a, $to: l, node: c } = r.selection;
|
|
27124
27124
|
if (c && c.isBlock || a.depth < 2 || !a.sameParent(l))
|
|
27125
27125
|
return !1;
|
|
@@ -27168,58 +27168,58 @@ const UM = (t, e = {}) => ({ state: n, dispatch: r }) => {
|
|
|
27168
27168
|
const { selection: y, storedMarks: g } = r, { splittableMarks: v } = i.extensionService, x = g || y.$to.parentOffset && y.$from.marks();
|
|
27169
27169
|
if (n.split(a.pos, 2, m).scrollIntoView(), !x || !o) return !0;
|
|
27170
27170
|
const w = x.filter((E) => v.includes(E.type.name));
|
|
27171
|
-
n.ensureMarks(w);
|
|
27171
|
+
n.ensureMarks(w), n.setMeta("splitListItem", w);
|
|
27172
27172
|
}
|
|
27173
27173
|
return !0;
|
|
27174
|
-
},
|
|
27174
|
+
}, X5 = (t) => ({ state: e, dispatch: n }) => {
|
|
27175
27175
|
const r = Ct(t, e.schema);
|
|
27176
|
-
return
|
|
27177
|
-
},
|
|
27176
|
+
return q5(r)(e, n);
|
|
27177
|
+
}, Y5 = (t) => ({ state: e, dispatch: n }) => {
|
|
27178
27178
|
const r = Ct(t, e.schema);
|
|
27179
|
-
return
|
|
27180
|
-
},
|
|
27179
|
+
return P5(r)(e, n);
|
|
27180
|
+
}, Z5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
27181
27181
|
__proto__: null,
|
|
27182
|
-
clearNodes:
|
|
27183
|
-
command:
|
|
27184
|
-
createParagraphNear:
|
|
27185
|
-
deleteSelection:
|
|
27186
|
-
exitCode:
|
|
27187
|
-
first:
|
|
27188
|
-
insertContent:
|
|
27189
|
-
insertContentAt:
|
|
27190
|
-
insertTabChar:
|
|
27191
|
-
insertTabNode:
|
|
27192
|
-
joinBackward:
|
|
27193
|
-
joinDown:
|
|
27194
|
-
joinForward:
|
|
27195
|
-
joinUp:
|
|
27196
|
-
liftEmptyBlock:
|
|
27197
|
-
liftListItem:
|
|
27198
|
-
newlineInCode:
|
|
27199
|
-
resetAttributes:
|
|
27200
|
-
selectAll:
|
|
27201
|
-
selectNodeBackward:
|
|
27202
|
-
selectNodeForward: $
|
|
27203
|
-
selectTextblockEnd:
|
|
27204
|
-
selectTextblockStart:
|
|
27205
|
-
setMark:
|
|
27206
|
-
setMeta:
|
|
27207
|
-
setNode:
|
|
27208
|
-
sinkListItem:
|
|
27209
|
-
splitBlock:
|
|
27210
|
-
splitListItem:
|
|
27211
|
-
toggleList:
|
|
27212
|
-
toggleMark:
|
|
27213
|
-
toggleNode:
|
|
27214
|
-
undoInputRule:
|
|
27215
|
-
unsetAllMarks:
|
|
27216
|
-
unsetMark:
|
|
27217
|
-
updateAttributes:
|
|
27218
|
-
wrapInList:
|
|
27219
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
27182
|
+
clearNodes: g5,
|
|
27183
|
+
command: VM,
|
|
27184
|
+
createParagraphNear: a5,
|
|
27185
|
+
deleteSelection: v5,
|
|
27186
|
+
exitCode: c5,
|
|
27187
|
+
first: UM,
|
|
27188
|
+
insertContent: _5,
|
|
27189
|
+
insertContentAt: N5,
|
|
27190
|
+
insertTabChar: HM,
|
|
27191
|
+
insertTabNode: WM,
|
|
27192
|
+
joinBackward: A5,
|
|
27193
|
+
joinDown: C5,
|
|
27194
|
+
joinForward: E5,
|
|
27195
|
+
joinUp: S5,
|
|
27196
|
+
liftEmptyBlock: s5,
|
|
27197
|
+
liftListItem: Y5,
|
|
27198
|
+
newlineInCode: l5,
|
|
27199
|
+
resetAttributes: k5,
|
|
27200
|
+
selectAll: b5,
|
|
27201
|
+
selectNodeBackward: T5,
|
|
27202
|
+
selectNodeForward: $5,
|
|
27203
|
+
selectTextblockEnd: M5,
|
|
27204
|
+
selectTextblockStart: O5,
|
|
27205
|
+
setMark: d5,
|
|
27206
|
+
setMeta: GM,
|
|
27207
|
+
setNode: y5,
|
|
27208
|
+
sinkListItem: X5,
|
|
27209
|
+
splitBlock: i5,
|
|
27210
|
+
splitListItem: J5,
|
|
27211
|
+
toggleList: W5,
|
|
27212
|
+
toggleMark: m5,
|
|
27213
|
+
toggleNode: w5,
|
|
27214
|
+
undoInputRule: F5,
|
|
27215
|
+
unsetAllMarks: h5,
|
|
27216
|
+
unsetMark: p5,
|
|
27217
|
+
updateAttributes: x5,
|
|
27218
|
+
wrapInList: U5
|
|
27219
|
+
}, Symbol.toStringTag, { value: "Module" })), Q5 = dt.create({
|
|
27220
27220
|
name: "commands",
|
|
27221
27221
|
addCommands() {
|
|
27222
|
-
return { ...
|
|
27222
|
+
return { ...Z5 };
|
|
27223
27223
|
}
|
|
27224
27224
|
}), e_ = () => ["iPad Simulator", "iPhone Simulator", "iPod Simulator", "iPad", "iPhone", "iPod"].includes(
|
|
27225
27225
|
navigator.platform
|
|
@@ -28407,7 +28407,7 @@ const X2 = ({ state: t, tr: e, step: n, newTr: r, map: o, doc: i, user: s, date:
|
|
|
28407
28407
|
if (t === "initial" || t === "0.4.14") return Object.values(E_);
|
|
28408
28408
|
};
|
|
28409
28409
|
var ci, ex, Ke, tx, nx, qu, rx, ff, pf, Uu, Vu, hf, mf, Hu, Wu, Gu, Gy, fs, ps, Ky, Jy, ox, ix;
|
|
28410
|
-
const T_ = class sx extends
|
|
28410
|
+
const T_ = class sx extends AM {
|
|
28411
28411
|
constructor(e) {
|
|
28412
28412
|
super(), Hr(this, Ke), Hr(this, ci), Pe(this, "extensionService"), Pe(this, "extensionStorage", {}), Pe(this, "schema"), Pe(this, "view"), Pe(this, "isFocused", !1), Hr(this, ex), Pe(this, "options", {
|
|
28413
28413
|
element: null,
|
|
@@ -28760,7 +28760,7 @@ const T_ = class sx extends A5 {
|
|
|
28760
28760
|
* @returns {Y.Doc | undefined} Updated Y.Doc if any, otherwise undefined
|
|
28761
28761
|
*/
|
|
28762
28762
|
processCollaborationMigrations() {
|
|
28763
|
-
if (console.debug("[checkVersionMigrations] Current editor version", "0.9.
|
|
28763
|
+
if (console.debug("[checkVersionMigrations] Current editor version", "0.9.25"), !this.options.ydoc) return;
|
|
28764
28764
|
let e = this.options.ydoc.getMap("meta").get("version");
|
|
28765
28765
|
e || (e = "initial"), console.debug("[checkVersionMigrations] Document version", e);
|
|
28766
28766
|
const n = Wy(e) || [], r = this.state.plugins.find((i) => i.key.startsWith("y-sync"));
|
|
@@ -28815,10 +28815,10 @@ ff = function() {
|
|
|
28815
28815
|
* Creates extension service.
|
|
28816
28816
|
*/
|
|
28817
28817
|
Uu = function() {
|
|
28818
|
-
const t = ["extension", "node", "mark"], e = [o_,
|
|
28818
|
+
const t = ["extension", "node", "mark"], e = [o_, Q5, i_, r_], n = this.options.externalExtensions || [], r = [...e, ...this.options.extensions].filter(
|
|
28819
28819
|
(o) => t.includes(o?.type)
|
|
28820
28820
|
);
|
|
28821
|
-
this.extensionService =
|
|
28821
|
+
this.extensionService = qM.create(r, n, this);
|
|
28822
28822
|
}, /**
|
|
28823
28823
|
* Creates a command service.
|
|
28824
28824
|
*/
|
|
@@ -28860,7 +28860,7 @@ Wu = function() {
|
|
|
28860
28860
|
try {
|
|
28861
28861
|
const { mode: e, fragment: n, isHeadless: r, content: o, loadFromSchema: i } = this.options;
|
|
28862
28862
|
if (e === "docx")
|
|
28863
|
-
t = z2(this.converter, this.schema, this), t = Be(this, Ke, Jy).call(this, t), n && r && (t =
|
|
28863
|
+
t = z2(this.converter, this.schema, this), t = Be(this, Ke, Jy).call(this, t), n && r && (t = hM(n, this.schema));
|
|
28864
28864
|
else if (e === "text")
|
|
28865
28865
|
if (o) {
|
|
28866
28866
|
let s = o;
|
|
@@ -29658,8 +29658,8 @@ const P_ = dt.create({
|
|
|
29658
29658
|
},
|
|
29659
29659
|
addCommands() {
|
|
29660
29660
|
return {
|
|
29661
|
-
undo: () => ({ tr: t, state: e, dispatch: n }) => (t.setMeta("preventDispatch", !0), t.setMeta("inputType", "historyUndo"), Jr.getState(e).undoManager.undoStack.length === 0 ? !1 : n ?
|
|
29662
|
-
redo: () => ({ tr: t, state: e, dispatch: n }) => (t.setMeta("preventDispatch", !0), t.setMeta("inputType", "historyRedo"), Jr.getState(e).undoManager.redoStack.length === 0 ? !1 : n ?
|
|
29661
|
+
undo: () => ({ tr: t, state: e, dispatch: n }) => (t.setMeta("preventDispatch", !0), t.setMeta("inputType", "historyUndo"), Jr.getState(e).undoManager.undoStack.length === 0 ? !1 : n ? vM(e) : !0),
|
|
29662
|
+
redo: () => ({ tr: t, state: e, dispatch: n }) => (t.setMeta("preventDispatch", !0), t.setMeta("inputType", "historyRedo"), Jr.getState(e).undoManager.redoStack.length === 0 ? !1 : n ? xM(e) : !0),
|
|
29663
29663
|
addImageToCollaboration: ({ mediaPath: t, fileData: e }) => () => {
|
|
29664
29664
|
this.options.ydoc && this.options.ydoc.getMap("media").set(t, e);
|
|
29665
29665
|
}
|
|
@@ -29674,12 +29674,12 @@ const P_ = dt.create({
|
|
|
29674
29674
|
}
|
|
29675
29675
|
}), q_ = (t, e) => {
|
|
29676
29676
|
const n = t.getXmlFragment("supereditor");
|
|
29677
|
-
return [
|
|
29677
|
+
return [eM(n, { onFirstRender: () => {
|
|
29678
29678
|
if (!e.options.isNewFile) return;
|
|
29679
29679
|
const r = t.getMap("meta");
|
|
29680
29680
|
r.set("docx", e.options.content), r.set("fonts", e.options.fonts);
|
|
29681
29681
|
} }), n];
|
|
29682
|
-
}, U_ = () =>
|
|
29682
|
+
}, U_ = () => CM(), V_ = (t, e) => {
|
|
29683
29683
|
const n = t.getMap("meta");
|
|
29684
29684
|
n.observe((r) => {
|
|
29685
29685
|
const o = n.get("lockedBy"), i = n.get("locked");
|
|
@@ -29719,7 +29719,7 @@ const P_ = dt.create({
|
|
|
29719
29719
|
},
|
|
29720
29720
|
addPmPlugins() {
|
|
29721
29721
|
const { collaborationProvider: t = null } = this.editor.options;
|
|
29722
|
-
return t ? [
|
|
29722
|
+
return t ? [bM(t.awareness, { cursorBuilder: G_ })] : [];
|
|
29723
29723
|
}
|
|
29724
29724
|
}), G_ = (t) => {
|
|
29725
29725
|
const e = document.createElement("span");
|
|
@@ -29767,7 +29767,7 @@ const P_ = dt.create({
|
|
|
29767
29767
|
}
|
|
29768
29768
|
});
|
|
29769
29769
|
function Ll(t) {
|
|
29770
|
-
return new
|
|
29770
|
+
return new BM({
|
|
29771
29771
|
match: t.match,
|
|
29772
29772
|
handler: ({
|
|
29773
29773
|
state: e,
|
|
@@ -29951,7 +29951,7 @@ function Y_(t) {
|
|
|
29951
29951
|
listLevel: S
|
|
29952
29952
|
};
|
|
29953
29953
|
});
|
|
29954
|
-
}), a ? i : null;
|
|
29954
|
+
}), i.setMeta("orderedListMarker", !0), a ? i : null;
|
|
29955
29955
|
}
|
|
29956
29956
|
});
|
|
29957
29957
|
}
|
|
@@ -30223,12 +30223,12 @@ function uD(t = {}) {
|
|
|
30223
30223
|
return Ue.create(n.doc, r);
|
|
30224
30224
|
},
|
|
30225
30225
|
apply(e, n, r, o) {
|
|
30226
|
-
if (!e.docChanged) return n;
|
|
30227
|
-
const i = [
|
|
30228
|
-
...Qy(o),
|
|
30226
|
+
if (!e.docChanged || e.getMeta("orderedListMarker")) return n;
|
|
30227
|
+
const i = e.getMeta("splitListItem"), s = [
|
|
30228
|
+
...Qy(o, i),
|
|
30229
30229
|
...ew(o)
|
|
30230
30230
|
];
|
|
30231
|
-
return Ue.create(o.doc,
|
|
30231
|
+
return Ue.create(o.doc, s);
|
|
30232
30232
|
}
|
|
30233
30233
|
},
|
|
30234
30234
|
props: {
|
|
@@ -30238,33 +30238,35 @@ function uD(t = {}) {
|
|
|
30238
30238
|
}
|
|
30239
30239
|
});
|
|
30240
30240
|
}
|
|
30241
|
-
function Qy(t) {
|
|
30242
|
-
let { doc:
|
|
30243
|
-
|
|
30244
|
-
|
|
30245
|
-
|
|
30246
|
-
|
|
30247
|
-
|
|
30241
|
+
function Qy(t, e = []) {
|
|
30242
|
+
let { doc: n, storedMarks: r } = t, o = [];
|
|
30243
|
+
Array.isArray(r) && e.push(...r);
|
|
30244
|
+
let i = Lp(n, (s) => s.type.name === "listItem");
|
|
30245
|
+
return i.length && i.forEach(({ node: s, pos: a }) => {
|
|
30246
|
+
let l = Tr("textStyle", n.type.schema), c = [...e.filter((y) => y.type === l)];
|
|
30247
|
+
if (fD(s) && e.length) {
|
|
30248
|
+
const y = e.filter((g) => g.type === l);
|
|
30249
|
+
c.push(...y);
|
|
30248
30250
|
} else {
|
|
30249
|
-
|
|
30250
|
-
|
|
30251
|
+
const y = dD(s, n, l);
|
|
30252
|
+
c.push(...y);
|
|
30251
30253
|
}
|
|
30252
|
-
let
|
|
30253
|
-
|
|
30254
|
-
let { attrs:
|
|
30255
|
-
if (
|
|
30256
|
-
let [
|
|
30257
|
-
Number.isNaN(
|
|
30254
|
+
let u = null, d = null;
|
|
30255
|
+
c.forEach((y) => {
|
|
30256
|
+
let { attrs: g } = y;
|
|
30257
|
+
if (g.fontSize && !u) {
|
|
30258
|
+
let [v, x] = Sr(g.fontSize);
|
|
30259
|
+
Number.isNaN(v) || (x = x ?? "pt", u = `${v}${x}`);
|
|
30258
30260
|
}
|
|
30259
|
-
|
|
30261
|
+
g.fontFamily && !d && (d = g.fontFamily);
|
|
30260
30262
|
});
|
|
30261
|
-
let
|
|
30262
|
-
style: `--marker-font-size: ${
|
|
30263
|
-
},
|
|
30264
|
-
style: `--marker-font-family: ${
|
|
30265
|
-
},
|
|
30266
|
-
|
|
30267
|
-
}),
|
|
30263
|
+
let f = {
|
|
30264
|
+
style: `--marker-font-size: ${u ?? "initial"}`
|
|
30265
|
+
}, p = {
|
|
30266
|
+
style: `--marker-font-family: ${d ?? "initial"}`
|
|
30267
|
+
}, h = Ie.mergeAttributes(f, p), m = He.node(a, a + s.nodeSize, h);
|
|
30268
|
+
o.push(m);
|
|
30269
|
+
}), o;
|
|
30268
30270
|
}
|
|
30269
30271
|
function ew(t) {
|
|
30270
30272
|
let { doc: e } = t, n = [], r = Lp(e, (o) => o.type.name === "listItem");
|