mhz-ui 1.4.24 → 1.4.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/UiEditor/UiEditor.js +179 -151
- package/package.json +19 -19
|
@@ -8508,8 +8508,8 @@ var Lu = ({ keepMarks: e = !0 } = {}) => ({ tr: t, state: n, dispatch: r, editor
|
|
|
8508
8508
|
function Vu(e) {
|
|
8509
8509
|
let t = e.doc, n = t.firstChild;
|
|
8510
8510
|
if (!n) return null;
|
|
8511
|
-
let r = n.nodeSize - 1;
|
|
8512
|
-
return k.
|
|
8511
|
+
let r = t.resolve(1), i = t.resolve(n.nodeSize - 1);
|
|
8512
|
+
return k.between(r, i);
|
|
8513
8513
|
}
|
|
8514
8514
|
var Hu = (e, t, n, r = {}) => ({ editor: i, tr: a, state: o, dispatch: s, chain: c, commands: l, can: u }) => {
|
|
8515
8515
|
let { extensions: d, splittableMarks: f } = i.extensionManager, p = H(e, o.schema), m = H(t, o.schema), { selection: h, storedMarks: g } = o, { $from: _, $to: ee } = h, v = _.blockRange(ee), y = g || h.$to.parentOffset && h.$from.marks();
|
|
@@ -11849,66 +11849,94 @@ var Hm = (e, t) => {
|
|
|
11849
11849
|
}
|
|
11850
11850
|
}), $m = /^(\s*)(\d+)\.\s+(.*)$/, eh = /^\s/;
|
|
11851
11851
|
function th(e) {
|
|
11852
|
+
let t = e.trimStart();
|
|
11853
|
+
return /^[-+*]\s+/.test(t) || /^\d+\.\s+/.test(t) || /^>\s?/.test(t) || /^```/.test(t) || /^~~~/.test(t);
|
|
11854
|
+
}
|
|
11855
|
+
function nh(e) {
|
|
11856
|
+
let t = [], n = [], r = !1;
|
|
11857
|
+
return e.forEach((e) => {
|
|
11858
|
+
if (r) {
|
|
11859
|
+
n.push(e);
|
|
11860
|
+
return;
|
|
11861
|
+
}
|
|
11862
|
+
if (e.trim() === "") {
|
|
11863
|
+
r = !0, n.push(e);
|
|
11864
|
+
return;
|
|
11865
|
+
}
|
|
11866
|
+
if (t.length > 0 && th(e)) {
|
|
11867
|
+
r = !0, n.push(e);
|
|
11868
|
+
return;
|
|
11869
|
+
}
|
|
11870
|
+
t.push(e);
|
|
11871
|
+
}), {
|
|
11872
|
+
paragraphLines: t,
|
|
11873
|
+
blockLines: n
|
|
11874
|
+
};
|
|
11875
|
+
}
|
|
11876
|
+
function rh(e) {
|
|
11852
11877
|
let t = [], n = 0, r = 0;
|
|
11853
11878
|
for (; n < e.length;) {
|
|
11854
11879
|
let i = e[n], a = i.match($m);
|
|
11855
11880
|
if (!a) break;
|
|
11856
|
-
let [, o, s, c] = a, l = o.length, u = c, d = n + 1, f = [i];
|
|
11881
|
+
let [, o, s, c] = a, l = o.length, u = [c], d = n + 1, f = [i], p = !1;
|
|
11857
11882
|
for (; d < e.length;) {
|
|
11858
11883
|
let t = e[d];
|
|
11859
11884
|
if (t.match($m)) break;
|
|
11860
|
-
if (t.trim() === "") f.push(t), u
|
|
11861
|
-
else if (t.match(eh)) f.push(t), u +=
|
|
11862
|
-
|
|
11863
|
-
|
|
11885
|
+
if (t.trim() === "") f.push(t), u.push(""), p = !0, d += 1;
|
|
11886
|
+
else if (t.match(eh)) f.push(t), u.push(t.slice(l + 2)), d += 1;
|
|
11887
|
+
else {
|
|
11888
|
+
if (p) break;
|
|
11889
|
+
f.push(t), u.push(t), d += 1;
|
|
11890
|
+
}
|
|
11864
11891
|
}
|
|
11865
11892
|
t.push({
|
|
11866
11893
|
indent: l,
|
|
11867
11894
|
number: parseInt(s, 10),
|
|
11868
|
-
content: u.trim(),
|
|
11895
|
+
content: u.join("\n").trim(),
|
|
11896
|
+
contentLines: u,
|
|
11869
11897
|
raw: f.join("\n")
|
|
11870
11898
|
}), r = d, n = d;
|
|
11871
11899
|
}
|
|
11872
11900
|
return [t, r];
|
|
11873
11901
|
}
|
|
11874
|
-
function
|
|
11902
|
+
function ih(e, t, n) {
|
|
11875
11903
|
let r = [], i = 0;
|
|
11876
11904
|
for (; i < e.length;) {
|
|
11877
11905
|
let a = e[i];
|
|
11878
11906
|
if (a.indent === t) {
|
|
11879
|
-
let o = a.
|
|
11880
|
-
|
|
11907
|
+
let { paragraphLines: o, blockLines: s } = nh(a.contentLines), c = o.join("\n").trim(), l = [];
|
|
11908
|
+
c && l.push({
|
|
11881
11909
|
type: "paragraph",
|
|
11882
|
-
raw:
|
|
11883
|
-
tokens: n.inlineTokens(
|
|
11910
|
+
raw: c,
|
|
11911
|
+
tokens: n.inlineTokens(c)
|
|
11884
11912
|
});
|
|
11885
|
-
let
|
|
11886
|
-
if (
|
|
11887
|
-
let e = n.blockTokens(
|
|
11888
|
-
|
|
11889
|
-
}
|
|
11890
|
-
let
|
|
11891
|
-
for (;
|
|
11892
|
-
if (
|
|
11893
|
-
let e =
|
|
11894
|
-
|
|
11913
|
+
let u = s.join("\n").trim();
|
|
11914
|
+
if (u) {
|
|
11915
|
+
let e = n.blockTokens(u);
|
|
11916
|
+
l.push(...e);
|
|
11917
|
+
}
|
|
11918
|
+
let d = i + 1, f = [];
|
|
11919
|
+
for (; d < e.length && e[d].indent > t;) f.push(e[d]), d += 1;
|
|
11920
|
+
if (f.length > 0) {
|
|
11921
|
+
let e = ih(f, Math.min(...f.map((e) => e.indent)), n);
|
|
11922
|
+
l.push({
|
|
11895
11923
|
type: "list",
|
|
11896
11924
|
ordered: !0,
|
|
11897
|
-
start:
|
|
11925
|
+
start: f[0].number,
|
|
11898
11926
|
items: e,
|
|
11899
|
-
raw:
|
|
11927
|
+
raw: f.map((e) => e.raw).join("\n")
|
|
11900
11928
|
});
|
|
11901
11929
|
}
|
|
11902
11930
|
r.push({
|
|
11903
11931
|
type: "list_item",
|
|
11904
11932
|
raw: a.raw,
|
|
11905
|
-
tokens:
|
|
11906
|
-
}), i =
|
|
11933
|
+
tokens: l
|
|
11934
|
+
}), i = d;
|
|
11907
11935
|
} else i += 1;
|
|
11908
11936
|
}
|
|
11909
11937
|
return r;
|
|
11910
11938
|
}
|
|
11911
|
-
function
|
|
11939
|
+
function ah(e, t) {
|
|
11912
11940
|
return e.map((e) => {
|
|
11913
11941
|
if (e.type !== "list_item") return t.parseChildren([e])[0];
|
|
11914
11942
|
let n = [];
|
|
@@ -11930,7 +11958,7 @@ function rh(e, t) {
|
|
|
11930
11958
|
};
|
|
11931
11959
|
});
|
|
11932
11960
|
}
|
|
11933
|
-
var
|
|
11961
|
+
var oh = "listItem", sh = "textStyle", ch = /^(\d+)\.\s$/, lh = qd.create({
|
|
11934
11962
|
name: "orderedList",
|
|
11935
11963
|
addOptions() {
|
|
11936
11964
|
return {
|
|
@@ -11974,7 +12002,7 @@ var ih = "listItem", ah = "textStyle", oh = /^(\d+)\.\s$/, sh = qd.create({
|
|
|
11974
12002
|
markdownTokenName: "list",
|
|
11975
12003
|
parseMarkdown: (e, t) => {
|
|
11976
12004
|
if (e.type !== "list" || !e.ordered) return [];
|
|
11977
|
-
let n = e.start || 1, r = e.items ?
|
|
12005
|
+
let n = e.start || 1, r = e.items ? ah(e.items, t) : [];
|
|
11978
12006
|
return n === 1 ? {
|
|
11979
12007
|
type: "orderedList",
|
|
11980
12008
|
content: r
|
|
@@ -11993,9 +12021,9 @@ var ih = "listItem", ah = "textStyle", oh = /^(\d+)\.\s$/, sh = qd.create({
|
|
|
11993
12021
|
return t === void 0 ? -1 : t;
|
|
11994
12022
|
},
|
|
11995
12023
|
tokenize: (e, t, n) => {
|
|
11996
|
-
let r = e.split("\n"), [i, a] =
|
|
12024
|
+
let r = e.split("\n"), [i, a] = rh(r);
|
|
11997
12025
|
if (i.length === 0) return;
|
|
11998
|
-
let o =
|
|
12026
|
+
let o = ih(i, 0, n);
|
|
11999
12027
|
if (o.length !== 0) return {
|
|
12000
12028
|
type: "list",
|
|
12001
12029
|
ordered: !0,
|
|
@@ -12007,32 +12035,32 @@ var ih = "listItem", ah = "textStyle", oh = /^(\d+)\.\s$/, sh = qd.create({
|
|
|
12007
12035
|
},
|
|
12008
12036
|
markdownOptions: { indentsContent: !0 },
|
|
12009
12037
|
addCommands() {
|
|
12010
|
-
return { toggleOrderedList: () => ({ commands: e, chain: t }) => this.options.keepAttributes ? t().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(
|
|
12038
|
+
return { toggleOrderedList: () => ({ commands: e, chain: t }) => this.options.keepAttributes ? t().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(oh, this.editor.getAttributes(sh)).run() : e.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks) };
|
|
12011
12039
|
},
|
|
12012
12040
|
addKeyboardShortcuts() {
|
|
12013
12041
|
return { "Mod-Shift-7": () => this.editor.commands.toggleOrderedList() };
|
|
12014
12042
|
},
|
|
12015
12043
|
addInputRules() {
|
|
12016
12044
|
let e = Fd({
|
|
12017
|
-
find:
|
|
12045
|
+
find: ch,
|
|
12018
12046
|
type: this.type,
|
|
12019
12047
|
getAttributes: (e) => ({ start: +e[1] }),
|
|
12020
12048
|
joinPredicate: (e, t) => t.childCount + t.attrs.start === +e[1]
|
|
12021
12049
|
});
|
|
12022
12050
|
return (this.options.keepMarks || this.options.keepAttributes) && (e = Fd({
|
|
12023
|
-
find:
|
|
12051
|
+
find: ch,
|
|
12024
12052
|
type: this.type,
|
|
12025
12053
|
keepMarks: this.options.keepMarks,
|
|
12026
12054
|
keepAttributes: this.options.keepAttributes,
|
|
12027
12055
|
getAttributes: (e) => ({
|
|
12028
12056
|
start: +e[1],
|
|
12029
|
-
...this.editor.getAttributes(
|
|
12057
|
+
...this.editor.getAttributes(sh)
|
|
12030
12058
|
}),
|
|
12031
12059
|
joinPredicate: (e, t) => t.childCount + t.attrs.start === +e[1],
|
|
12032
12060
|
editor: this.editor
|
|
12033
12061
|
})), [e];
|
|
12034
12062
|
}
|
|
12035
|
-
}),
|
|
12063
|
+
}), uh = /^\s*(\[([( |x])?\])\s$/, dh = qd.create({
|
|
12036
12064
|
name: "taskItem",
|
|
12037
12065
|
addOptions() {
|
|
12038
12066
|
return {
|
|
@@ -12142,12 +12170,12 @@ var ih = "listItem", ah = "textStyle", oh = /^(\d+)\.\s$/, sh = qd.create({
|
|
|
12142
12170
|
},
|
|
12143
12171
|
addInputRules() {
|
|
12144
12172
|
return [Fd({
|
|
12145
|
-
find:
|
|
12173
|
+
find: uh,
|
|
12146
12174
|
type: this.type,
|
|
12147
12175
|
getAttributes: (e) => ({ checked: e[e.length - 1] === "x" })
|
|
12148
12176
|
})];
|
|
12149
12177
|
}
|
|
12150
|
-
}),
|
|
12178
|
+
}), fh = qd.create({
|
|
12151
12179
|
name: "taskList",
|
|
12152
12180
|
addOptions() {
|
|
12153
12181
|
return {
|
|
@@ -12245,12 +12273,12 @@ K.create({
|
|
|
12245
12273
|
name: "listKit",
|
|
12246
12274
|
addExtensions() {
|
|
12247
12275
|
let e = [];
|
|
12248
|
-
return this.options.bulletList !== !1 && e.push(Bm.configure(this.options.bulletList)), this.options.listItem !== !1 && e.push(Vm.configure(this.options.listItem)), this.options.listKeymap !== !1 && e.push(Qm.configure(this.options.listKeymap)), this.options.orderedList !== !1 && e.push(
|
|
12276
|
+
return this.options.bulletList !== !1 && e.push(Bm.configure(this.options.bulletList)), this.options.listItem !== !1 && e.push(Vm.configure(this.options.listItem)), this.options.listKeymap !== !1 && e.push(Qm.configure(this.options.listKeymap)), this.options.orderedList !== !1 && e.push(lh.configure(this.options.orderedList)), this.options.taskItem !== !1 && e.push(dh.configure(this.options.taskItem)), this.options.taskList !== !1 && e.push(fh.configure(this.options.taskList)), e;
|
|
12249
12277
|
}
|
|
12250
12278
|
});
|
|
12251
12279
|
//#endregion
|
|
12252
12280
|
//#region ../../node_modules/@tiptap/extension-paragraph/dist/index.js
|
|
12253
|
-
var
|
|
12281
|
+
var ph = " ", mh = "\xA0", hh = qd.create({
|
|
12254
12282
|
name: "paragraph",
|
|
12255
12283
|
priority: 1e3,
|
|
12256
12284
|
addOptions() {
|
|
@@ -12272,14 +12300,14 @@ var dh = " ", fh = "\xA0", ph = qd.create({
|
|
|
12272
12300
|
let n = e.tokens || [];
|
|
12273
12301
|
if (n.length === 1 && n[0].type === "image") return t.parseChildren([n[0]]);
|
|
12274
12302
|
let r = t.parseInline(n);
|
|
12275
|
-
return n.length === 1 && n[0].type === "text" && (n[0].raw ===
|
|
12303
|
+
return n.length === 1 && n[0].type === "text" && (n[0].raw === ph || n[0].text === ph || n[0].raw === mh || n[0].text === mh) && r.length === 1 && r[0].type === "text" && (r[0].text === ph || r[0].text === mh) ? t.createNode("paragraph", void 0, []) : t.createNode("paragraph", void 0, r);
|
|
12276
12304
|
},
|
|
12277
12305
|
renderMarkdown: (e, t, n) => {
|
|
12278
12306
|
if (!e) return "";
|
|
12279
12307
|
let r = Array.isArray(e.content) ? e.content : [];
|
|
12280
12308
|
if (r.length === 0) {
|
|
12281
12309
|
let e = Array.isArray(n?.previousNode?.content) ? n.previousNode.content : [];
|
|
12282
|
-
return n?.previousNode?.type === "paragraph" && e.length === 0 ?
|
|
12310
|
+
return n?.previousNode?.type === "paragraph" && e.length === 0 ? ph : "";
|
|
12283
12311
|
}
|
|
12284
12312
|
return t.renderChildren(r);
|
|
12285
12313
|
},
|
|
@@ -12289,7 +12317,7 @@ var dh = " ", fh = "\xA0", ph = qd.create({
|
|
|
12289
12317
|
addKeyboardShortcuts() {
|
|
12290
12318
|
return { "Mod-Alt-0": () => this.editor.commands.setParagraph() };
|
|
12291
12319
|
}
|
|
12292
|
-
}),
|
|
12320
|
+
}), gh = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/, _h = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g, vh = cd.create({
|
|
12293
12321
|
name: "strike",
|
|
12294
12322
|
addOptions() {
|
|
12295
12323
|
return { HTMLAttributes: {} };
|
|
@@ -12328,17 +12356,17 @@ var dh = " ", fh = "\xA0", ph = qd.create({
|
|
|
12328
12356
|
},
|
|
12329
12357
|
addInputRules() {
|
|
12330
12358
|
return [Md({
|
|
12331
|
-
find:
|
|
12359
|
+
find: gh,
|
|
12332
12360
|
type: this.type
|
|
12333
12361
|
})];
|
|
12334
12362
|
},
|
|
12335
12363
|
addPasteRules() {
|
|
12336
12364
|
return [Jd({
|
|
12337
|
-
find:
|
|
12365
|
+
find: _h,
|
|
12338
12366
|
type: this.type
|
|
12339
12367
|
})];
|
|
12340
12368
|
}
|
|
12341
|
-
}),
|
|
12369
|
+
}), yh = qd.create({
|
|
12342
12370
|
name: "text",
|
|
12343
12371
|
group: "inline",
|
|
12344
12372
|
parseMarkdown: (e) => ({
|
|
@@ -12346,7 +12374,7 @@ var dh = " ", fh = "\xA0", ph = qd.create({
|
|
|
12346
12374
|
text: e.text || ""
|
|
12347
12375
|
}),
|
|
12348
12376
|
renderMarkdown: (e) => e.text || ""
|
|
12349
|
-
}),
|
|
12377
|
+
}), bh = cd.create({
|
|
12350
12378
|
name: "underline",
|
|
12351
12379
|
addOptions() {
|
|
12352
12380
|
return { HTMLAttributes: {} };
|
|
@@ -12405,12 +12433,12 @@ var dh = " ", fh = "\xA0", ph = qd.create({
|
|
|
12405
12433
|
});
|
|
12406
12434
|
//#endregion
|
|
12407
12435
|
//#region ../../node_modules/prosemirror-dropcursor/dist/index.js
|
|
12408
|
-
function
|
|
12436
|
+
function xh(e = {}) {
|
|
12409
12437
|
return new j({ view(t) {
|
|
12410
|
-
return new
|
|
12438
|
+
return new Sh(t, e);
|
|
12411
12439
|
} });
|
|
12412
12440
|
}
|
|
12413
|
-
var
|
|
12441
|
+
var Sh = class {
|
|
12414
12442
|
constructor(e, t) {
|
|
12415
12443
|
this.editorView = e, this.cursorPos = null, this.element = null, this.timeout = -1, this.width = t.width ?? 1, this.color = t.color === !1 ? void 0 : t.color || "black", this.class = t.class, this.handlers = [
|
|
12416
12444
|
"dragover",
|
|
@@ -12526,11 +12554,11 @@ var bh = class {
|
|
|
12526
12554
|
return new e(t.resolve(n.pos));
|
|
12527
12555
|
}
|
|
12528
12556
|
getBookmark() {
|
|
12529
|
-
return new
|
|
12557
|
+
return new Ch(this.anchor);
|
|
12530
12558
|
}
|
|
12531
12559
|
static valid(e) {
|
|
12532
12560
|
let t = e.parent;
|
|
12533
|
-
if (t.inlineContent || !
|
|
12561
|
+
if (t.inlineContent || !Th(e) || !Eh(e)) return !1;
|
|
12534
12562
|
let n = t.type.spec.allowGapCursor;
|
|
12535
12563
|
if (n != null) return n;
|
|
12536
12564
|
let r = t.contentMatchAt(e.index()).defaultType;
|
|
@@ -12568,7 +12596,7 @@ var bh = class {
|
|
|
12568
12596
|
}
|
|
12569
12597
|
};
|
|
12570
12598
|
Q.prototype.visible = !1, Q.findFrom = Q.findGapCursorFrom, O.jsonID("gapcursor", Q);
|
|
12571
|
-
var
|
|
12599
|
+
var Ch = class e {
|
|
12572
12600
|
constructor(e) {
|
|
12573
12601
|
this.pos = e;
|
|
12574
12602
|
}
|
|
@@ -12580,10 +12608,10 @@ var xh = class e {
|
|
|
12580
12608
|
return Q.valid(t) ? new Q(t) : O.near(t);
|
|
12581
12609
|
}
|
|
12582
12610
|
};
|
|
12583
|
-
function
|
|
12611
|
+
function wh(e) {
|
|
12584
12612
|
return e.isAtom || e.spec.isolating || e.spec.createGapCursor;
|
|
12585
12613
|
}
|
|
12586
|
-
function
|
|
12614
|
+
function Th(e) {
|
|
12587
12615
|
for (let t = e.depth; t >= 0; t--) {
|
|
12588
12616
|
let n = e.index(t), r = e.node(t);
|
|
12589
12617
|
if (n == 0) {
|
|
@@ -12591,13 +12619,13 @@ function Ch(e) {
|
|
|
12591
12619
|
continue;
|
|
12592
12620
|
}
|
|
12593
12621
|
for (let e = r.child(n - 1);; e = e.lastChild) {
|
|
12594
|
-
if (e.childCount == 0 && !e.inlineContent ||
|
|
12622
|
+
if (e.childCount == 0 && !e.inlineContent || wh(e.type)) return !0;
|
|
12595
12623
|
if (e.inlineContent) return !1;
|
|
12596
12624
|
}
|
|
12597
12625
|
}
|
|
12598
12626
|
return !0;
|
|
12599
12627
|
}
|
|
12600
|
-
function
|
|
12628
|
+
function Eh(e) {
|
|
12601
12629
|
for (let t = e.depth; t >= 0; t--) {
|
|
12602
12630
|
let n = e.indexAfter(t), r = e.node(t);
|
|
12603
12631
|
if (n == r.childCount) {
|
|
@@ -12605,30 +12633,30 @@ function wh(e) {
|
|
|
12605
12633
|
continue;
|
|
12606
12634
|
}
|
|
12607
12635
|
for (let e = r.child(n);; e = e.firstChild) {
|
|
12608
|
-
if (e.childCount == 0 && !e.inlineContent ||
|
|
12636
|
+
if (e.childCount == 0 && !e.inlineContent || wh(e.type)) return !0;
|
|
12609
12637
|
if (e.inlineContent) return !1;
|
|
12610
12638
|
}
|
|
12611
12639
|
}
|
|
12612
12640
|
return !0;
|
|
12613
12641
|
}
|
|
12614
|
-
function
|
|
12642
|
+
function Dh() {
|
|
12615
12643
|
return new j({ props: {
|
|
12616
|
-
decorations:
|
|
12644
|
+
decorations: Mh,
|
|
12617
12645
|
createSelectionBetween(e, t, n) {
|
|
12618
12646
|
return t.pos == n.pos && Q.valid(n) ? new Q(n) : null;
|
|
12619
12647
|
},
|
|
12620
|
-
handleClick:
|
|
12621
|
-
handleKeyDown:
|
|
12622
|
-
handleDOMEvents: { beforeinput:
|
|
12648
|
+
handleClick: Ah,
|
|
12649
|
+
handleKeyDown: Oh,
|
|
12650
|
+
handleDOMEvents: { beforeinput: jh }
|
|
12623
12651
|
} });
|
|
12624
12652
|
}
|
|
12625
|
-
var
|
|
12626
|
-
ArrowLeft:
|
|
12627
|
-
ArrowRight:
|
|
12628
|
-
ArrowUp:
|
|
12629
|
-
ArrowDown:
|
|
12653
|
+
var Oh = bc({
|
|
12654
|
+
ArrowLeft: kh("horiz", -1),
|
|
12655
|
+
ArrowRight: kh("horiz", 1),
|
|
12656
|
+
ArrowUp: kh("vert", -1),
|
|
12657
|
+
ArrowDown: kh("vert", 1)
|
|
12630
12658
|
});
|
|
12631
|
-
function
|
|
12659
|
+
function kh(e, t) {
|
|
12632
12660
|
let n = e == "vert" ? t > 0 ? "down" : "up" : t > 0 ? "right" : "left";
|
|
12633
12661
|
return function(e, r, i) {
|
|
12634
12662
|
let a = e.selection, o = t > 0 ? a.$to : a.$from, s = a.empty;
|
|
@@ -12640,7 +12668,7 @@ function Dh(e, t) {
|
|
|
12640
12668
|
return c ? (r && r(e.tr.setSelection(new Q(c))), !0) : !1;
|
|
12641
12669
|
};
|
|
12642
12670
|
}
|
|
12643
|
-
function
|
|
12671
|
+
function Ah(e, t, n) {
|
|
12644
12672
|
if (!e || !e.editable) return !1;
|
|
12645
12673
|
let r = e.state.doc.resolve(t);
|
|
12646
12674
|
if (!Q.valid(r)) return !1;
|
|
@@ -12650,7 +12678,7 @@ function Oh(e, t, n) {
|
|
|
12650
12678
|
});
|
|
12651
12679
|
return i && i.inside > -1 && A.isSelectable(e.state.doc.nodeAt(i.inside)) ? !1 : (e.dispatch(e.state.tr.setSelection(new Q(r))), !0);
|
|
12652
12680
|
}
|
|
12653
|
-
function
|
|
12681
|
+
function jh(e, t) {
|
|
12654
12682
|
if (t.inputType != "insertCompositionText" || !(e.state.selection instanceof Q)) return !1;
|
|
12655
12683
|
let { $from: n } = e.state.selection, r = n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);
|
|
12656
12684
|
if (!r) return !1;
|
|
@@ -12659,20 +12687,20 @@ function kh(e, t) {
|
|
|
12659
12687
|
let a = e.state.tr.replace(n.pos, n.pos, new w(i, 0, 0));
|
|
12660
12688
|
return a.setSelection(k.near(a.doc.resolve(n.pos + 1))), e.dispatch(a), !1;
|
|
12661
12689
|
}
|
|
12662
|
-
function
|
|
12690
|
+
function Mh(e) {
|
|
12663
12691
|
if (!(e.selection instanceof Q)) return null;
|
|
12664
12692
|
let t = document.createElement("div");
|
|
12665
12693
|
return t.className = "ProseMirror-gapcursor", z.create(e.doc, [ys.widget(e.selection.head, t, { key: "gapcursor" })]);
|
|
12666
12694
|
}
|
|
12667
12695
|
//#endregion
|
|
12668
12696
|
//#region ../../node_modules/rope-sequence/dist/index.js
|
|
12669
|
-
var
|
|
12697
|
+
var Nh = 200, $ = function() {};
|
|
12670
12698
|
$.prototype.append = function(e) {
|
|
12671
|
-
return e.length ? (e = $.from(e), !this.length && e || e.length <
|
|
12699
|
+
return e.length ? (e = $.from(e), !this.length && e || e.length < Nh && this.leafAppend(e) || this.length < Nh && e.leafPrepend(this) || this.appendInner(e)) : this;
|
|
12672
12700
|
}, $.prototype.prepend = function(e) {
|
|
12673
12701
|
return e.length ? $.from(e).append(this) : this;
|
|
12674
12702
|
}, $.prototype.appendInner = function(e) {
|
|
12675
|
-
return new
|
|
12703
|
+
return new Fh(this, e);
|
|
12676
12704
|
}, $.prototype.slice = function(e, t) {
|
|
12677
12705
|
return e === void 0 && (e = 0), t === void 0 && (t = this.length), e >= t ? $.empty : this.sliceInner(Math.max(0, e), Math.min(this.length, t));
|
|
12678
12706
|
}, $.prototype.get = function(e) {
|
|
@@ -12686,9 +12714,9 @@ $.prototype.append = function(e) {
|
|
|
12686
12714
|
return r.push(e(t, n));
|
|
12687
12715
|
}, t, n), r;
|
|
12688
12716
|
}, $.from = function(e) {
|
|
12689
|
-
return e instanceof $ ? e : e && e.length ? new
|
|
12717
|
+
return e instanceof $ ? e : e && e.length ? new Ph(e) : $.empty;
|
|
12690
12718
|
};
|
|
12691
|
-
var
|
|
12719
|
+
var Ph = /* @__PURE__ */ function(e) {
|
|
12692
12720
|
function t(t) {
|
|
12693
12721
|
e.call(this), this.values = t;
|
|
12694
12722
|
}
|
|
@@ -12708,17 +12736,17 @@ var Mh = /* @__PURE__ */ function(e) {
|
|
|
12708
12736
|
}, t.prototype.forEachInvertedInner = function(e, t, n, r) {
|
|
12709
12737
|
for (var i = t - 1; i >= n; i--) if (e(this.values[i], r + i) === !1) return !1;
|
|
12710
12738
|
}, t.prototype.leafAppend = function(e) {
|
|
12711
|
-
if (this.length + e.length <=
|
|
12739
|
+
if (this.length + e.length <= Nh) return new t(this.values.concat(e.flatten()));
|
|
12712
12740
|
}, t.prototype.leafPrepend = function(e) {
|
|
12713
|
-
if (this.length + e.length <=
|
|
12741
|
+
if (this.length + e.length <= Nh) return new t(e.flatten().concat(this.values));
|
|
12714
12742
|
}, n.length.get = function() {
|
|
12715
12743
|
return this.values.length;
|
|
12716
12744
|
}, n.depth.get = function() {
|
|
12717
12745
|
return 0;
|
|
12718
12746
|
}, Object.defineProperties(t.prototype, n), t;
|
|
12719
12747
|
}($);
|
|
12720
|
-
$.empty = new
|
|
12721
|
-
var
|
|
12748
|
+
$.empty = new Ph([]);
|
|
12749
|
+
var Fh = /* @__PURE__ */ function(e) {
|
|
12722
12750
|
function t(t, n) {
|
|
12723
12751
|
e.call(this), this.left = t, this.right = n, this.length = t.length + n.length, this.depth = Math.max(t.depth, n.depth) + 1;
|
|
12724
12752
|
}
|
|
@@ -12745,7 +12773,7 @@ var Nh = /* @__PURE__ */ function(e) {
|
|
|
12745
12773
|
}, t.prototype.appendInner = function(e) {
|
|
12746
12774
|
return this.left.depth >= Math.max(this.right.depth, e.depth) + 1 ? new t(this.left, new t(this.right, e)) : new t(this, e);
|
|
12747
12775
|
}, t;
|
|
12748
|
-
}($),
|
|
12776
|
+
}($), Ih = 500, Lh = class e {
|
|
12749
12777
|
constructor(e, t) {
|
|
12750
12778
|
this.items = e, this.eventCount = t;
|
|
12751
12779
|
}
|
|
@@ -12765,9 +12793,9 @@ var Nh = /* @__PURE__ */ function(e) {
|
|
|
12765
12793
|
return;
|
|
12766
12794
|
}
|
|
12767
12795
|
if (i) {
|
|
12768
|
-
u.push(new
|
|
12796
|
+
u.push(new zh(t.map));
|
|
12769
12797
|
let e = t.step.map(i.slice(a)), n;
|
|
12770
|
-
e && o.maybeStep(e).doc && (n = o.mapping.maps[o.mapping.maps.length - 1], l.push(new
|
|
12798
|
+
e && o.maybeStep(e).doc && (n = o.mapping.maps[o.mapping.maps.length - 1], l.push(new zh(n, void 0, void 0, l.length + u.length))), a--, n && i.appendMap(n, a);
|
|
12771
12799
|
} else o.maybeStep(t.step);
|
|
12772
12800
|
if (t.selection) return s = i ? t.selection.map(i.slice(a)) : t.selection, c = new e(this.items.slice(0, r).append(u.reverse().concat(l)), this.eventCount - 1), !1;
|
|
12773
12801
|
}, this.items.length, 0), {
|
|
@@ -12779,11 +12807,11 @@ var Nh = /* @__PURE__ */ function(e) {
|
|
|
12779
12807
|
addTransform(t, n, r, i) {
|
|
12780
12808
|
let a = [], o = this.eventCount, s = this.items, c = !i && s.length ? s.get(s.length - 1) : null;
|
|
12781
12809
|
for (let e = 0; e < t.steps.length; e++) {
|
|
12782
|
-
let r = t.steps[e].invert(t.docs[e]), l = new
|
|
12810
|
+
let r = t.steps[e].invert(t.docs[e]), l = new zh(t.mapping.maps[e], r, n), u;
|
|
12783
12811
|
(u = c && c.merge(l)) && (l = u, e ? a.pop() : s = s.slice(0, s.length - 1)), a.push(l), n &&= (o++, void 0), i || (c = l);
|
|
12784
12812
|
}
|
|
12785
12813
|
let l = o - r.depth;
|
|
12786
|
-
return l >
|
|
12814
|
+
return l > Vh && (s = Rh(s, l), o -= l), new e(s.append(a), o);
|
|
12787
12815
|
}
|
|
12788
12816
|
remapping(e, t) {
|
|
12789
12817
|
let n = new Nt();
|
|
@@ -12793,7 +12821,7 @@ var Nh = /* @__PURE__ */ function(e) {
|
|
|
12793
12821
|
}, e, t), n;
|
|
12794
12822
|
}
|
|
12795
12823
|
addMaps(t) {
|
|
12796
|
-
return this.eventCount == 0 ? this : new e(this.items.append(t.map((e) => new
|
|
12824
|
+
return this.eventCount == 0 ? this : new e(this.items.append(t.map((e) => new zh(e))), this.eventCount);
|
|
12797
12825
|
}
|
|
12798
12826
|
rebased(t, n) {
|
|
12799
12827
|
if (!this.eventCount) return this;
|
|
@@ -12809,13 +12837,13 @@ var Nh = /* @__PURE__ */ function(e) {
|
|
|
12809
12837
|
let i = a.maps[n];
|
|
12810
12838
|
if (e.step) {
|
|
12811
12839
|
let o = t.steps[n].invert(t.docs[n]), l = e.selection && e.selection.map(a.slice(c + 1, n));
|
|
12812
|
-
l && s++, r.push(new
|
|
12813
|
-
} else r.push(new
|
|
12840
|
+
l && s++, r.push(new zh(i, o, l));
|
|
12841
|
+
} else r.push(new zh(i));
|
|
12814
12842
|
}, i);
|
|
12815
12843
|
let l = [];
|
|
12816
|
-
for (let e = n; e < o; e++) l.push(new
|
|
12844
|
+
for (let e = n; e < o; e++) l.push(new zh(a.maps[e]));
|
|
12817
12845
|
let u = new e(this.items.slice(0, i).append(l).append(r), s);
|
|
12818
|
-
return u.emptyItemCount() >
|
|
12846
|
+
return u.emptyItemCount() > Ih && (u = u.compress(this.items.length - r.length)), u;
|
|
12819
12847
|
}
|
|
12820
12848
|
emptyItemCount() {
|
|
12821
12849
|
let e = 0;
|
|
@@ -12832,21 +12860,21 @@ var Nh = /* @__PURE__ */ function(e) {
|
|
|
12832
12860
|
if (r--, o && n.appendMap(o, r), t) {
|
|
12833
12861
|
let s = e.selection && e.selection.map(n.slice(r));
|
|
12834
12862
|
s && a++;
|
|
12835
|
-
let c = new
|
|
12863
|
+
let c = new zh(o.invert(), t, s), l, u = i.length - 1;
|
|
12836
12864
|
(l = i.length && i[u].merge(c)) ? i[u] = l : i.push(c);
|
|
12837
12865
|
}
|
|
12838
12866
|
} else e.map && r--;
|
|
12839
12867
|
}, this.items.length, 0), new e($.from(i.reverse()), a);
|
|
12840
12868
|
}
|
|
12841
12869
|
};
|
|
12842
|
-
|
|
12843
|
-
function
|
|
12870
|
+
Lh.empty = new Lh($.empty, 0);
|
|
12871
|
+
function Rh(e, t) {
|
|
12844
12872
|
let n;
|
|
12845
12873
|
return e.forEach((e, r) => {
|
|
12846
12874
|
if (e.selection && t-- == 0) return n = r, !1;
|
|
12847
12875
|
}), e.slice(n);
|
|
12848
12876
|
}
|
|
12849
|
-
var
|
|
12877
|
+
var zh = class e {
|
|
12850
12878
|
constructor(e, t, n, r) {
|
|
12851
12879
|
this.map = e, this.step = t, this.selection = n, this.mirrorOffset = r;
|
|
12852
12880
|
}
|
|
@@ -12856,25 +12884,25 @@ var Lh = class e {
|
|
|
12856
12884
|
if (n) return new e(n.getMap().invert(), n, this.selection);
|
|
12857
12885
|
}
|
|
12858
12886
|
}
|
|
12859
|
-
},
|
|
12887
|
+
}, Bh = class {
|
|
12860
12888
|
constructor(e, t, n, r, i) {
|
|
12861
12889
|
this.done = e, this.undone = t, this.prevRanges = n, this.prevTime = r, this.prevComposition = i;
|
|
12862
12890
|
}
|
|
12863
|
-
},
|
|
12864
|
-
function
|
|
12865
|
-
let i = n.getMeta(
|
|
12891
|
+
}, Vh = 20;
|
|
12892
|
+
function Hh(e, t, n, r) {
|
|
12893
|
+
let i = n.getMeta(Xh), a;
|
|
12866
12894
|
if (i) return i.historyState;
|
|
12867
|
-
n.getMeta(
|
|
12895
|
+
n.getMeta(Zh) && (e = new Bh(e.done, e.undone, null, 0, -1));
|
|
12868
12896
|
let o = n.getMeta("appendedTransaction");
|
|
12869
12897
|
if (n.steps.length == 0) return e;
|
|
12870
|
-
if (o && o.getMeta(
|
|
12898
|
+
if (o && o.getMeta(Xh)) return o.getMeta(Xh).redo ? new Bh(e.done.addTransform(n, void 0, r, Yh(t)), e.undone, Wh(n.mapping.maps), e.prevTime, e.prevComposition) : new Bh(e.done, e.undone.addTransform(n, void 0, r, Yh(t)), null, e.prevTime, e.prevComposition);
|
|
12871
12899
|
if (n.getMeta("addToHistory") !== !1 && !(o && o.getMeta("addToHistory") === !1)) {
|
|
12872
|
-
let i = n.getMeta("composition"), a = e.prevTime == 0 || !o && e.prevComposition != i && (e.prevTime < (n.time || 0) - r.newGroupDelay || !
|
|
12873
|
-
return new
|
|
12874
|
-
} else if (a = n.getMeta("rebased")) return new
|
|
12875
|
-
else return new
|
|
12900
|
+
let i = n.getMeta("composition"), a = e.prevTime == 0 || !o && e.prevComposition != i && (e.prevTime < (n.time || 0) - r.newGroupDelay || !Uh(n, e.prevRanges)), s = o ? Gh(e.prevRanges, n.mapping) : Wh(n.mapping.maps);
|
|
12901
|
+
return new Bh(e.done.addTransform(n, a ? t.selection.getBookmark() : void 0, r, Yh(t)), Lh.empty, s, n.time, i ?? e.prevComposition);
|
|
12902
|
+
} else if (a = n.getMeta("rebased")) return new Bh(e.done.rebased(n, a), e.undone.rebased(n, a), Gh(e.prevRanges, n.mapping), e.prevTime, e.prevComposition);
|
|
12903
|
+
else return new Bh(e.done.addMaps(n.mapping.maps), e.undone.addMaps(n.mapping.maps), Gh(e.prevRanges, n.mapping), e.prevTime, e.prevComposition);
|
|
12876
12904
|
}
|
|
12877
|
-
function
|
|
12905
|
+
function Uh(e, t) {
|
|
12878
12906
|
if (!t) return !1;
|
|
12879
12907
|
if (!e.docChanged) return !0;
|
|
12880
12908
|
let n = !1;
|
|
@@ -12882,12 +12910,12 @@ function Vh(e, t) {
|
|
|
12882
12910
|
for (let i = 0; i < t.length; i += 2) e <= t[i + 1] && r >= t[i] && (n = !0);
|
|
12883
12911
|
}), n;
|
|
12884
12912
|
}
|
|
12885
|
-
function
|
|
12913
|
+
function Wh(e) {
|
|
12886
12914
|
let t = [];
|
|
12887
12915
|
for (let n = e.length - 1; n >= 0 && t.length == 0; n--) e[n].forEach((e, n, r, i) => t.push(r, i));
|
|
12888
12916
|
return t;
|
|
12889
12917
|
}
|
|
12890
|
-
function
|
|
12918
|
+
function Gh(e, t) {
|
|
12891
12919
|
if (!e) return null;
|
|
12892
12920
|
let n = [];
|
|
12893
12921
|
for (let r = 0; r < e.length; r += 2) {
|
|
@@ -12896,61 +12924,61 @@ function Uh(e, t) {
|
|
|
12896
12924
|
}
|
|
12897
12925
|
return n;
|
|
12898
12926
|
}
|
|
12899
|
-
function
|
|
12900
|
-
let r =
|
|
12927
|
+
function Kh(e, t, n) {
|
|
12928
|
+
let r = Yh(t), i = Xh.get(t).spec.config, a = (n ? e.undone : e.done).popEvent(t, r);
|
|
12901
12929
|
if (!a) return null;
|
|
12902
|
-
let o = a.selection.resolve(a.transform.doc), s = (n ? e.done : e.undone).addTransform(a.transform, t.selection.getBookmark(), i, r), c = new
|
|
12903
|
-
return a.transform.setSelection(o).setMeta(
|
|
12930
|
+
let o = a.selection.resolve(a.transform.doc), s = (n ? e.done : e.undone).addTransform(a.transform, t.selection.getBookmark(), i, r), c = new Bh(n ? s : a.remaining, n ? a.remaining : s, null, 0, -1);
|
|
12931
|
+
return a.transform.setSelection(o).setMeta(Xh, {
|
|
12904
12932
|
redo: n,
|
|
12905
12933
|
historyState: c
|
|
12906
12934
|
});
|
|
12907
12935
|
}
|
|
12908
|
-
var
|
|
12909
|
-
function
|
|
12936
|
+
var qh = !1, Jh = null;
|
|
12937
|
+
function Yh(e) {
|
|
12910
12938
|
let t = e.plugins;
|
|
12911
|
-
if (
|
|
12912
|
-
|
|
12939
|
+
if (Jh != t) {
|
|
12940
|
+
qh = !1, Jh = t;
|
|
12913
12941
|
for (let e = 0; e < t.length; e++) if (t[e].spec.historyPreserveItems) {
|
|
12914
|
-
|
|
12942
|
+
qh = !0;
|
|
12915
12943
|
break;
|
|
12916
12944
|
}
|
|
12917
12945
|
}
|
|
12918
|
-
return
|
|
12946
|
+
return qh;
|
|
12919
12947
|
}
|
|
12920
|
-
var
|
|
12921
|
-
function
|
|
12948
|
+
var Xh = new M("history"), Zh = new M("closeHistory");
|
|
12949
|
+
function Qh(e = {}) {
|
|
12922
12950
|
return e = {
|
|
12923
12951
|
depth: e.depth || 100,
|
|
12924
12952
|
newGroupDelay: e.newGroupDelay || 500
|
|
12925
12953
|
}, new j({
|
|
12926
|
-
key:
|
|
12954
|
+
key: Xh,
|
|
12927
12955
|
state: {
|
|
12928
12956
|
init() {
|
|
12929
|
-
return new
|
|
12957
|
+
return new Bh(Lh.empty, Lh.empty, null, 0, -1);
|
|
12930
12958
|
},
|
|
12931
12959
|
apply(t, n, r) {
|
|
12932
|
-
return
|
|
12960
|
+
return Hh(n, r, t, e);
|
|
12933
12961
|
}
|
|
12934
12962
|
},
|
|
12935
12963
|
config: e,
|
|
12936
12964
|
props: { handleDOMEvents: { beforeinput(e, t) {
|
|
12937
|
-
let n = t.inputType, r = n == "historyUndo" ?
|
|
12965
|
+
let n = t.inputType, r = n == "historyUndo" ? eg : n == "historyRedo" ? tg : null;
|
|
12938
12966
|
return !r || !e.editable ? !1 : (t.preventDefault(), r(e.state, e.dispatch));
|
|
12939
12967
|
} } }
|
|
12940
12968
|
});
|
|
12941
12969
|
}
|
|
12942
|
-
function
|
|
12970
|
+
function $h(e, t) {
|
|
12943
12971
|
return (n, r) => {
|
|
12944
|
-
let i =
|
|
12972
|
+
let i = Xh.getState(n);
|
|
12945
12973
|
if (!i || (e ? i.undone : i.done).eventCount == 0) return !1;
|
|
12946
12974
|
if (r) {
|
|
12947
|
-
let a =
|
|
12975
|
+
let a = Kh(i, n, e);
|
|
12948
12976
|
a && r(t ? a.scrollIntoView() : a);
|
|
12949
12977
|
}
|
|
12950
12978
|
return !0;
|
|
12951
12979
|
};
|
|
12952
12980
|
}
|
|
12953
|
-
var
|
|
12981
|
+
var eg = $h(!1, !0), tg = $h(!0, !0);
|
|
12954
12982
|
K.create({
|
|
12955
12983
|
name: "characterCount",
|
|
12956
12984
|
addOptions() {
|
|
@@ -13012,7 +13040,7 @@ K.create({
|
|
|
13012
13040
|
})];
|
|
13013
13041
|
}
|
|
13014
13042
|
});
|
|
13015
|
-
var
|
|
13043
|
+
var ng = K.create({
|
|
13016
13044
|
name: "dropCursor",
|
|
13017
13045
|
addOptions() {
|
|
13018
13046
|
return {
|
|
@@ -13022,7 +13050,7 @@ var eg = K.create({
|
|
|
13022
13050
|
};
|
|
13023
13051
|
},
|
|
13024
13052
|
addProseMirrorPlugins() {
|
|
13025
|
-
return [
|
|
13053
|
+
return [xh(this.options)];
|
|
13026
13054
|
}
|
|
13027
13055
|
});
|
|
13028
13056
|
K.create({
|
|
@@ -13056,10 +13084,10 @@ K.create({
|
|
|
13056
13084
|
})];
|
|
13057
13085
|
}
|
|
13058
13086
|
});
|
|
13059
|
-
var
|
|
13087
|
+
var rg = K.create({
|
|
13060
13088
|
name: "gapCursor",
|
|
13061
13089
|
addProseMirrorPlugins() {
|
|
13062
|
-
return [
|
|
13090
|
+
return [Dh()];
|
|
13063
13091
|
},
|
|
13064
13092
|
extendNodeSchema(e) {
|
|
13065
13093
|
return { allowGapCursor: W(U(e, "allowGapCursor", {
|
|
@@ -13068,8 +13096,8 @@ var tg = K.create({
|
|
|
13068
13096
|
storage: e.storage
|
|
13069
13097
|
})) ?? null };
|
|
13070
13098
|
}
|
|
13071
|
-
}),
|
|
13072
|
-
function
|
|
13099
|
+
}), ig = "placeholder";
|
|
13100
|
+
function ag(e) {
|
|
13073
13101
|
return e.replace(/\s+/g, "-").replace(/[^a-zA-Z0-9-]/g, "").replace(/^[0-9-]+/, "").replace(/^-+/, "").toLowerCase();
|
|
13074
13102
|
}
|
|
13075
13103
|
K.create({
|
|
@@ -13078,7 +13106,7 @@ K.create({
|
|
|
13078
13106
|
return {
|
|
13079
13107
|
emptyEditorClass: "is-editor-empty",
|
|
13080
13108
|
emptyNodeClass: "is-empty",
|
|
13081
|
-
dataAttribute:
|
|
13109
|
+
dataAttribute: ig,
|
|
13082
13110
|
placeholder: "Write something …",
|
|
13083
13111
|
showOnlyWhenEditable: !0,
|
|
13084
13112
|
showOnlyCurrent: !0,
|
|
@@ -13086,7 +13114,7 @@ K.create({
|
|
|
13086
13114
|
};
|
|
13087
13115
|
},
|
|
13088
13116
|
addProseMirrorPlugins() {
|
|
13089
|
-
let e = this.options.dataAttribute ? `data-${
|
|
13117
|
+
let e = this.options.dataAttribute ? `data-${ag(this.options.dataAttribute)}` : `data-${ig}`;
|
|
13090
13118
|
return [new j({
|
|
13091
13119
|
key: new M("placeholder"),
|
|
13092
13120
|
props: { decorations: ({ doc: t, selection: n }) => {
|
|
@@ -13130,10 +13158,10 @@ K.create({
|
|
|
13130
13158
|
})];
|
|
13131
13159
|
}
|
|
13132
13160
|
});
|
|
13133
|
-
function
|
|
13161
|
+
function og({ types: e, node: t }) {
|
|
13134
13162
|
return t && Array.isArray(e) && e.includes(t.type) || t?.type === e;
|
|
13135
13163
|
}
|
|
13136
|
-
var
|
|
13164
|
+
var sg = K.create({
|
|
13137
13165
|
name: "trailingNode",
|
|
13138
13166
|
addOptions() {
|
|
13139
13167
|
return {
|
|
@@ -13152,7 +13180,7 @@ var ag = K.create({
|
|
|
13152
13180
|
state: {
|
|
13153
13181
|
init: (e, t) => {
|
|
13154
13182
|
let r = t.tr.doc.lastChild;
|
|
13155
|
-
return !
|
|
13183
|
+
return !og({
|
|
13156
13184
|
node: r,
|
|
13157
13185
|
types: n
|
|
13158
13186
|
});
|
|
@@ -13160,7 +13188,7 @@ var ag = K.create({
|
|
|
13160
13188
|
apply: (e, t) => {
|
|
13161
13189
|
if (!e.docChanged || e.getMeta("__uniqueIDTransaction")) return t;
|
|
13162
13190
|
let r = e.doc.lastChild;
|
|
13163
|
-
return !
|
|
13191
|
+
return !og({
|
|
13164
13192
|
node: r,
|
|
13165
13193
|
types: n
|
|
13166
13194
|
});
|
|
@@ -13168,7 +13196,7 @@ var ag = K.create({
|
|
|
13168
13196
|
}
|
|
13169
13197
|
})];
|
|
13170
13198
|
}
|
|
13171
|
-
}),
|
|
13199
|
+
}), cg = K.create({
|
|
13172
13200
|
name: "undoRedo",
|
|
13173
13201
|
addOptions() {
|
|
13174
13202
|
return {
|
|
@@ -13178,12 +13206,12 @@ var ag = K.create({
|
|
|
13178
13206
|
},
|
|
13179
13207
|
addCommands() {
|
|
13180
13208
|
return {
|
|
13181
|
-
undo: () => ({ state: e, dispatch: t }) =>
|
|
13182
|
-
redo: () => ({ state: e, dispatch: t }) =>
|
|
13209
|
+
undo: () => ({ state: e, dispatch: t }) => eg(e, t),
|
|
13210
|
+
redo: () => ({ state: e, dispatch: t }) => tg(e, t)
|
|
13183
13211
|
};
|
|
13184
13212
|
},
|
|
13185
13213
|
addProseMirrorPlugins() {
|
|
13186
|
-
return [
|
|
13214
|
+
return [Qh(this.options)];
|
|
13187
13215
|
},
|
|
13188
13216
|
addKeyboardShortcuts() {
|
|
13189
13217
|
return {
|
|
@@ -13194,20 +13222,20 @@ var ag = K.create({
|
|
|
13194
13222
|
"Shift-Mod-я": () => this.editor.commands.redo()
|
|
13195
13223
|
};
|
|
13196
13224
|
}
|
|
13197
|
-
}),
|
|
13225
|
+
}), lg = K.create({
|
|
13198
13226
|
name: "starterKit",
|
|
13199
13227
|
addExtensions() {
|
|
13200
13228
|
let e = [];
|
|
13201
|
-
return this.options.bold !== !1 && e.push(sf.configure(this.options.bold)), this.options.blockquote !== !1 && e.push(tf.configure(this.options.blockquote)), this.options.bulletList !== !1 && e.push(Bm.configure(this.options.bulletList)), this.options.code !== !1 && e.push(uf.configure(this.options.code)), this.options.codeBlock !== !1 && e.push(mf.configure(this.options.codeBlock)), this.options.document !== !1 && e.push(hf.configure(this.options.document)), this.options.dropcursor !== !1 && e.push(
|
|
13229
|
+
return this.options.bold !== !1 && e.push(sf.configure(this.options.bold)), this.options.blockquote !== !1 && e.push(tf.configure(this.options.blockquote)), this.options.bulletList !== !1 && e.push(Bm.configure(this.options.bulletList)), this.options.code !== !1 && e.push(uf.configure(this.options.code)), this.options.codeBlock !== !1 && e.push(mf.configure(this.options.codeBlock)), this.options.document !== !1 && e.push(hf.configure(this.options.document)), this.options.dropcursor !== !1 && e.push(ng.configure(this.options.dropcursor)), this.options.gapcursor !== !1 && e.push(rg.configure(this.options.gapcursor)), this.options.hardBreak !== !1 && e.push(gf.configure(this.options.hardBreak)), this.options.heading !== !1 && e.push(_f.configure(this.options.heading)), this.options.undoRedo !== !1 && e.push(cg.configure(this.options.undoRedo)), this.options.horizontalRule !== !1 && e.push(vf.configure(this.options.horizontalRule)), this.options.italic !== !1 && e.push(Cf.configure(this.options.italic)), this.options.listItem !== !1 && e.push(Vm.configure(this.options.listItem)), this.options.listKeymap !== !1 && e.push(Qm.configure(this.options?.listKeymap)), this.options.link !== !1 && e.push(Pm.configure(this.options?.link)), this.options.orderedList !== !1 && e.push(lh.configure(this.options.orderedList)), this.options.paragraph !== !1 && e.push(hh.configure(this.options.paragraph)), this.options.strike !== !1 && e.push(vh.configure(this.options.strike)), this.options.text !== !1 && e.push(yh.configure(this.options.text)), this.options.underline !== !1 && e.push(bh.configure(this.options?.underline)), this.options.trailingNode !== !1 && e.push(sg.configure(this.options?.trailingNode)), e;
|
|
13202
13230
|
}
|
|
13203
|
-
}),
|
|
13231
|
+
}), ug = ["onClick"], dg = /* @__PURE__ */ e(/* @__PURE__ */ s({
|
|
13204
13232
|
__name: "UiEditor",
|
|
13205
13233
|
props: { modelValue: {} },
|
|
13206
13234
|
emits: ["update:modelValue"],
|
|
13207
13235
|
setup(e, { emit: o }) {
|
|
13208
13236
|
let s = e, c = o, l = Qd({
|
|
13209
13237
|
content: n(() => s.modelValue).value,
|
|
13210
|
-
extensions: [
|
|
13238
|
+
extensions: [lg],
|
|
13211
13239
|
onUpdate: () => {
|
|
13212
13240
|
c("update:modelValue", l.value?.getHTML());
|
|
13213
13241
|
}
|
|
@@ -13242,7 +13270,7 @@ var ag = K.create({
|
|
|
13242
13270
|
onClick: (e) => t.method(),
|
|
13243
13271
|
class: f(e.$style.action),
|
|
13244
13272
|
type: "button"
|
|
13245
|
-
}, v(t.name), 11,
|
|
13273
|
+
}, v(t.name), 11, ug)), 64))], 2), a(y(Zd), {
|
|
13246
13274
|
editor: y(l),
|
|
13247
13275
|
class: f(e.$style.editor)
|
|
13248
13276
|
}, null, 8, ["editor", "class"])], 2));
|
|
@@ -13254,4 +13282,4 @@ var ag = K.create({
|
|
|
13254
13282
|
editor: "_editor_85du8_41"
|
|
13255
13283
|
} }]]);
|
|
13256
13284
|
//#endregion
|
|
13257
|
-
export {
|
|
13285
|
+
export { dg as default };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mhz-ui",
|
|
3
3
|
"description": "Mhz ui kit",
|
|
4
|
-
"version": "1.4.
|
|
4
|
+
"version": "1.4.25",
|
|
5
5
|
"author": "Alexandr Dergunov <dergunovs@mail.ru> (https://github.com/dergunovs)",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
@@ -25,16 +25,16 @@
|
|
|
25
25
|
"test:cov": "NODE_OPTIONS='--no-experimental-webstorage' vitest run --coverage"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@tiptap/pm": "3.22.
|
|
29
|
-
"@tiptap/starter-kit": "3.22.
|
|
30
|
-
"@tiptap/vue-3": "3.22.
|
|
28
|
+
"@tiptap/pm": "3.22.4",
|
|
29
|
+
"@tiptap/starter-kit": "3.22.4",
|
|
30
|
+
"@tiptap/vue-3": "3.22.4",
|
|
31
31
|
"@vueform/slider": "2.1.10",
|
|
32
32
|
"@vueuse/core": "14.2.1",
|
|
33
33
|
"@vueuse/integrations": "14.2.1",
|
|
34
34
|
"chart.js": "4.5.1",
|
|
35
35
|
"mhz-helpers": "*",
|
|
36
36
|
"perfect-debounce": "2.1.0",
|
|
37
|
-
"vue": "3.6.0-beta.
|
|
37
|
+
"vue": "3.6.0-beta.10",
|
|
38
38
|
"vue-chartjs": "5.3.3",
|
|
39
39
|
"vue-router": "5.0.4"
|
|
40
40
|
},
|
|
@@ -44,44 +44,44 @@
|
|
|
44
44
|
"@storybook/addon-themes": "10.3.5",
|
|
45
45
|
"@storybook/vue3": "10.3.5",
|
|
46
46
|
"@storybook/vue3-vite": "10.3.5",
|
|
47
|
-
"@types/node": "25.
|
|
48
|
-
"@vitejs/plugin-vue": "6.0.
|
|
49
|
-
"@vitest/coverage-v8": "4.1.
|
|
47
|
+
"@types/node": "25.6.0",
|
|
48
|
+
"@vitejs/plugin-vue": "6.0.6",
|
|
49
|
+
"@vitest/coverage-v8": "4.1.4",
|
|
50
50
|
"@vue/test-utils": "2.4.6",
|
|
51
|
-
"eslint": "10.2.
|
|
51
|
+
"eslint": "10.2.1",
|
|
52
52
|
"eslint-config-prettier": "10.1.8",
|
|
53
53
|
"eslint-import-resolver-typescript": "4.4.4",
|
|
54
54
|
"eslint-plugin-import-x": "4.16.2",
|
|
55
55
|
"eslint-plugin-prettier": "5.5.5",
|
|
56
|
-
"eslint-plugin-sonarjs": "4.0.
|
|
56
|
+
"eslint-plugin-sonarjs": "4.0.3",
|
|
57
57
|
"eslint-plugin-unicorn": "64.0.0",
|
|
58
58
|
"eslint-plugin-vue": "10.8.0",
|
|
59
|
-
"globals": "17.
|
|
60
|
-
"happy-dom": "20.
|
|
59
|
+
"globals": "17.5.0",
|
|
60
|
+
"happy-dom": "20.9.0",
|
|
61
61
|
"postcss-html": "1.8.1",
|
|
62
62
|
"postcss-scss": "4.0.9",
|
|
63
|
-
"prettier": "3.8.
|
|
63
|
+
"prettier": "3.8.3",
|
|
64
64
|
"sass-embedded": "1.99.0",
|
|
65
65
|
"storybook": "10.3.5",
|
|
66
|
-
"stylelint": "17.
|
|
66
|
+
"stylelint": "17.8.0",
|
|
67
67
|
"stylelint-config-recess-order": "7.7.0",
|
|
68
68
|
"stylelint-config-recommended-scss": "17.0.1",
|
|
69
69
|
"stylelint-config-recommended-vue": "1.6.1",
|
|
70
70
|
"stylelint-order": "8.1.1",
|
|
71
71
|
"stylelint-prettier": "5.0.3",
|
|
72
|
-
"typescript": "6.0.
|
|
73
|
-
"typescript-eslint": "8.58.
|
|
72
|
+
"typescript": "6.0.3",
|
|
73
|
+
"typescript-eslint": "8.58.2",
|
|
74
74
|
"vite": "8.0.8",
|
|
75
75
|
"vite-plugin-dts": "4.5.4",
|
|
76
76
|
"vite-plugin-static-copy": "4.0.1",
|
|
77
77
|
"vite-svg-loader": "5.1.1",
|
|
78
|
-
"vitest": "4.1.
|
|
78
|
+
"vitest": "4.1.4",
|
|
79
79
|
"vue-eslint-parser": "10.4.0",
|
|
80
80
|
"vue-linters-config": "0.5.7",
|
|
81
|
-
"vue-tsc": "3.2.
|
|
81
|
+
"vue-tsc": "3.2.7"
|
|
82
82
|
},
|
|
83
83
|
"peerDependencies": {
|
|
84
|
-
"vue": "3.6.0-beta.
|
|
84
|
+
"vue": "3.6.0-beta.10",
|
|
85
85
|
"vue-router": "5.0.4"
|
|
86
86
|
},
|
|
87
87
|
"engines": {
|