@grapesjs/studio-sdk-plugins 1.0.38 → 1.0.39-rc.1
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/accordionComponent/index.cjs.js +5 -5
- package/dist/accordionComponent/index.es.js +70 -67
- package/dist/accordionComponent/index.js +39 -0
- package/dist/accordionComponent/index.umd.js +4 -4
- package/dist/aiChat/components/AiChatHeader.d.ts +4 -5
- package/dist/aiChat/components/AiChatInput/index.d.ts +4 -5
- package/dist/aiChat/components/AiChatMessage.d.ts +7 -8
- package/dist/aiChat/components/index.d.ts +1 -1
- package/dist/aiChat/components/utils.d.ts +1 -1
- package/dist/aiChat/index.cjs.js +10 -376
- package/dist/aiChat/index.es.js +4569 -28851
- package/dist/aiChat/index.js +10 -376
- package/dist/aiChat/index.umd.js +11 -377
- package/dist/aiChat/server/index.cjs.d.ts +0 -1
- package/dist/aiChat/server/index.cjs.js +45 -45
- package/dist/aiChat/server/index.d.ts +0 -1
- package/dist/aiChat/server/index.es.d.ts +0 -1
- package/dist/aiChat/server/index.es.js +371 -427
- package/dist/aiChat/server/index.js +45 -45
- package/dist/aiChat/server/index.umd.js +41 -41
- package/dist/aiChat/server/stream.test.d.ts +1 -0
- package/dist/aiChat/types.d.ts +18 -4
- package/dist/aiChat/typesSchema.d.ts +13 -0
- package/dist/animationComponent/index.cjs.js +3 -3
- package/dist/animationComponent/index.es.js +49 -46
- package/dist/animationComponent/index.js +519 -0
- package/dist/animationComponent/index.umd.js +3 -3
- package/dist/canvasAbsoluteMode/index.cjs.js +1 -1
- package/dist/canvasAbsoluteMode/index.es.js +115 -112
- package/dist/canvasAbsoluteMode/index.js +1 -0
- package/dist/canvasAbsoluteMode/index.umd.js +1 -1
- package/dist/canvasEmptyState/index.cjs.js +1 -1
- package/dist/canvasEmptyState/index.es.js +71 -68
- package/dist/canvasEmptyState/index.js +1 -0
- package/dist/canvasEmptyState/index.umd.js +1 -1
- package/dist/canvasFullSize/index.cjs.js +3 -3
- package/dist/canvasFullSize/index.es.js +69 -66
- package/dist/canvasFullSize/index.js +10 -0
- package/dist/canvasFullSize/index.umd.js +4 -4
- package/dist/canvasGridMode/index.cjs.js +7 -7
- package/dist/canvasGridMode/index.es.js +142 -139
- package/dist/canvasGridMode/index.js +26 -0
- package/dist/canvasGridMode/index.umd.js +7 -7
- package/dist/canvasScreenshot/index.cjs.js +1 -1
- package/dist/canvasScreenshot/index.es.js +78 -75
- package/dist/canvasScreenshot/index.js +1 -0
- package/dist/canvasScreenshot/index.umd.js +1 -1
- package/dist/dataSourceEjs/EjsExporter.d.ts +1 -1
- package/dist/dataSourceEjs/index.cjs.js +3 -3
- package/dist/dataSourceEjs/index.es.js +40 -37
- package/dist/dataSourceEjs/index.js +21 -0
- package/dist/dataSourceEjs/index.umd.js +3 -3
- package/dist/dataSourceHandlebars/HandlebarsExporter.d.ts +2 -2
- package/dist/dataSourceHandlebars/constants.d.ts +1 -1
- package/dist/dataSourceHandlebars/index.cjs.js +4 -4
- package/dist/dataSourceHandlebars/index.es.js +58 -55
- package/dist/dataSourceHandlebars/index.js +10 -0
- package/dist/dataSourceHandlebars/index.umd.js +2 -2
- package/dist/dialogComponent/index.cjs.js +11 -11
- package/dist/dialogComponent/index.es.js +72 -69
- package/dist/dialogComponent/index.js +59 -0
- package/dist/dialogComponent/index.umd.js +11 -11
- package/dist/flexComponent/index.cjs.js +6 -6
- package/dist/flexComponent/index.es.js +151 -142
- package/dist/flexComponent/index.js +33 -0
- package/dist/flexComponent/index.umd.js +8 -8
- package/dist/flexComponent/typesSchema.d.ts +1 -1
- package/dist/fsLightboxComponent/index.cjs.js +3 -3
- package/dist/fsLightboxComponent/index.es.js +93 -90
- package/dist/fsLightboxComponent/index.js +6 -0
- package/dist/fsLightboxComponent/index.umd.js +3 -3
- package/dist/googleFontsAssetProvider/index.cjs.js +1 -1
- package/dist/googleFontsAssetProvider/index.es.js +112 -109
- package/dist/googleFontsAssetProvider/index.js +1 -0
- package/dist/googleFontsAssetProvider/index.umd.js +1 -1
- package/dist/googleFontsAssetProvider/utils.d.ts +1 -1
- package/dist/iconifyComponent/index.cjs.js +2 -2
- package/dist/iconifyComponent/index.es.js +80 -77
- package/dist/iconifyComponent/index.js +3 -0
- package/dist/iconifyComponent/index.umd.js +2 -2
- package/dist/index.cjs.d.ts +1 -0
- package/dist/index.cjs.js +970 -82
- package/dist/index.d.ts +1 -0
- package/dist/index.es.d.ts +1 -0
- package/dist/index.es.js +7422 -6145
- package/dist/index.umd.js +975 -87
- package/dist/layoutSidebarButtons/index.cjs.js +1 -1
- package/dist/layoutSidebarButtons/index.es.js +95 -92
- package/dist/layoutSidebarButtons/index.js +1 -0
- package/dist/layoutSidebarButtons/index.umd.js +1 -1
- package/dist/lightGalleryComponent/index.cjs.js +1 -1
- package/dist/lightGalleryComponent/index.es.js +164 -161
- package/dist/lightGalleryComponent/index.js +1 -0
- package/dist/lightGalleryComponent/index.umd.js +1 -1
- package/dist/lightGalleryComponent/utils.d.ts +1 -1
- package/dist/linkImageComponent/index.cjs.js +2 -2
- package/dist/linkImageComponent/index.es.js +60 -57
- package/dist/linkImageComponent/index.js +12 -0
- package/dist/linkImageComponent/index.umd.js +2 -2
- package/dist/listPagesComponent/index.cjs.js +4 -4
- package/dist/listPagesComponent/index.es.js +57 -54
- package/dist/listPagesComponent/index.js +11 -0
- package/dist/listPagesComponent/index.umd.js +4 -4
- package/dist/listPagesComponent/utils.d.ts +1 -1
- package/dist/presetBlockLibrary/blocks.d.ts +6 -0
- package/dist/presetBlockLibrary/blocks.test.d.ts +2 -0
- package/dist/presetBlockLibrary/emailBlocks.d.ts +53 -0
- package/dist/presetBlockLibrary/index.cjs.d.ts +3 -0
- package/dist/presetBlockLibrary/index.cjs.js +889 -0
- package/dist/presetBlockLibrary/index.d.ts +3 -0
- package/dist/presetBlockLibrary/index.es.d.ts +3 -0
- package/dist/presetBlockLibrary/index.es.js +1408 -0
- package/dist/presetBlockLibrary/index.js +889 -0
- package/dist/presetBlockLibrary/index.test.d.ts +1 -0
- package/dist/presetBlockLibrary/index.umd.js +889 -0
- package/dist/presetBlockLibrary/shared.d.ts +3 -0
- package/dist/presetBlockLibrary/types.d.ts +24 -0
- package/dist/presetBlockLibrary/typesSchema.d.ts +47 -0
- package/dist/presetPrintable/index.cjs.js +3 -3
- package/dist/presetPrintable/index.es.js +133 -130
- package/dist/presetPrintable/index.js +32 -0
- package/dist/presetPrintable/index.umd.js +4 -4
- package/dist/prosemirror/index.cjs.js +8 -8
- package/dist/prosemirror/index.es.js +552 -549
- package/dist/prosemirror/index.js +10 -0
- package/dist/prosemirror/index.umd.js +9 -9
- package/dist/prosemirror/toolbar.d.ts +2 -2
- package/dist/prosemirror/types.d.ts +5 -5
- package/dist/rendererReact/index.cjs.js +1 -1
- package/dist/rendererReact/index.es.js +137 -134
- package/dist/rendererReact/index.js +1 -1
- package/dist/rendererReact/index.umd.js +1 -1
- package/dist/rteTinyMce/index.cjs.js +2 -2
- package/dist/rteTinyMce/index.es.js +74 -71
- package/dist/rteTinyMce/index.js +104 -0
- package/dist/rteTinyMce/index.umd.js +2 -2
- package/dist/shapeDividerComponent/index.cjs.js +4 -4
- package/dist/shapeDividerComponent/index.es.js +91 -88
- package/dist/shapeDividerComponent/index.js +97 -0
- package/dist/shapeDividerComponent/index.umd.js +4 -4
- package/dist/swiperComponent/index.cjs.js +7 -7
- package/dist/swiperComponent/index.es.js +95 -92
- package/dist/swiperComponent/index.js +45 -0
- package/dist/swiperComponent/index.umd.js +5 -5
- package/dist/tableComponent/index.cjs.js +1 -1
- package/dist/tableComponent/index.es.js +181 -178
- package/dist/tableComponent/index.js +1 -0
- package/dist/tableComponent/index.umd.js +1 -1
- package/dist/tableComponent/types.d.ts +3 -3
- package/dist/types.d.ts +14 -14
- package/dist/utils.d.ts +3 -2
- package/dist/utilsDataSources.d.ts +1 -1
- package/dist/youtubeAssetProvider/index.cjs.js +1 -1
- package/dist/youtubeAssetProvider/index.es.js +90 -87
- package/dist/youtubeAssetProvider/index.js +1 -0
- package/dist/youtubeAssetProvider/index.umd.js +1 -1
- package/package.json +182 -34
- package/dist/aiChat/server/models.d.ts +0 -15
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
function
|
|
1
|
+
function z(n) {
|
|
2
2
|
this.content = n;
|
|
3
3
|
}
|
|
4
|
-
|
|
5
|
-
constructor:
|
|
4
|
+
z.prototype = {
|
|
5
|
+
constructor: z,
|
|
6
6
|
find: function(n) {
|
|
7
7
|
for (var e = 0; e < this.content.length; e += 2)
|
|
8
8
|
if (this.content[e] === n) return e;
|
|
@@ -21,7 +21,7 @@ B.prototype = {
|
|
|
21
21
|
// given, the key of the binding will be replaced with that key.
|
|
22
22
|
update: function(n, e, t) {
|
|
23
23
|
var r = t && t != n ? this.remove(t) : this, i = r.find(n), s = r.content.slice();
|
|
24
|
-
return i == -1 ? s.push(t || n, e) : (s[i + 1] = e, t && (s[i] = t)), new
|
|
24
|
+
return i == -1 ? s.push(t || n, e) : (s[i + 1] = e, t && (s[i] = t)), new z(s);
|
|
25
25
|
},
|
|
26
26
|
// :: (string) → OrderedMap
|
|
27
27
|
// Return a map with the given key removed, if it existed.
|
|
@@ -29,25 +29,25 @@ B.prototype = {
|
|
|
29
29
|
var e = this.find(n);
|
|
30
30
|
if (e == -1) return this;
|
|
31
31
|
var t = this.content.slice();
|
|
32
|
-
return t.splice(e, 2), new
|
|
32
|
+
return t.splice(e, 2), new z(t);
|
|
33
33
|
},
|
|
34
34
|
// :: (string, any) → OrderedMap
|
|
35
35
|
// Add a new key to the start of the map.
|
|
36
36
|
addToStart: function(n, e) {
|
|
37
|
-
return new
|
|
37
|
+
return new z([n, e].concat(this.remove(n).content));
|
|
38
38
|
},
|
|
39
39
|
// :: (string, any) → OrderedMap
|
|
40
40
|
// Add a new key to the end of the map.
|
|
41
41
|
addToEnd: function(n, e) {
|
|
42
42
|
var t = this.remove(n).content.slice();
|
|
43
|
-
return t.push(n, e), new
|
|
43
|
+
return t.push(n, e), new z(t);
|
|
44
44
|
},
|
|
45
45
|
// :: (string, string, any) → OrderedMap
|
|
46
46
|
// Add a key after the given key. If `place` is not found, the new
|
|
47
47
|
// key is added to the end.
|
|
48
48
|
addBefore: function(n, e, t) {
|
|
49
49
|
var r = this.remove(e), i = r.content.slice(), s = r.find(n);
|
|
50
|
-
return i.splice(s == -1 ? i.length : s, 0, e, t), new
|
|
50
|
+
return i.splice(s == -1 ? i.length : s, 0, e, t), new z(i);
|
|
51
51
|
},
|
|
52
52
|
// :: ((key: string, value: any))
|
|
53
53
|
// Call the given function for each key/value pair in the map, in
|
|
@@ -60,20 +60,20 @@ B.prototype = {
|
|
|
60
60
|
// Create a new map by prepending the keys in this map that don't
|
|
61
61
|
// appear in `map` before the keys in `map`.
|
|
62
62
|
prepend: function(n) {
|
|
63
|
-
return n =
|
|
63
|
+
return n = z.from(n), n.size ? new z(n.content.concat(this.subtract(n).content)) : this;
|
|
64
64
|
},
|
|
65
65
|
// :: (union<Object, OrderedMap>) → OrderedMap
|
|
66
66
|
// Create a new map by appending the keys in this map that don't
|
|
67
67
|
// appear in `map` after the keys in `map`.
|
|
68
68
|
append: function(n) {
|
|
69
|
-
return n =
|
|
69
|
+
return n = z.from(n), n.size ? new z(this.subtract(n).content.concat(n.content)) : this;
|
|
70
70
|
},
|
|
71
71
|
// :: (union<Object, OrderedMap>) → OrderedMap
|
|
72
72
|
// Create a map containing all the keys in this map that don't
|
|
73
73
|
// appear in `map`.
|
|
74
74
|
subtract: function(n) {
|
|
75
75
|
var e = this;
|
|
76
|
-
n =
|
|
76
|
+
n = z.from(n);
|
|
77
77
|
for (var t = 0; t < n.content.length; t += 2)
|
|
78
78
|
e = e.remove(n.content[t]);
|
|
79
79
|
return e;
|
|
@@ -92,11 +92,11 @@ B.prototype = {
|
|
|
92
92
|
return this.content.length >> 1;
|
|
93
93
|
}
|
|
94
94
|
};
|
|
95
|
-
|
|
96
|
-
if (n instanceof
|
|
95
|
+
z.from = function(n) {
|
|
96
|
+
if (n instanceof z) return n;
|
|
97
97
|
var e = [];
|
|
98
98
|
if (n) for (var t in n) e.push(t, n[t]);
|
|
99
|
-
return new
|
|
99
|
+
return new z(e);
|
|
100
100
|
};
|
|
101
101
|
function ns(n, e, t) {
|
|
102
102
|
for (let r = 0; ; r++) {
|
|
@@ -635,7 +635,7 @@ function ss(n, e, t, r) {
|
|
|
635
635
|
let l = ss(o.content, e - s - 1, t);
|
|
636
636
|
return l && n.replaceChild(i, o.copy(l));
|
|
637
637
|
}
|
|
638
|
-
function
|
|
638
|
+
function Xo(n, e, t) {
|
|
639
639
|
if (t.openStart > n.depth)
|
|
640
640
|
throw new en("Inserted content deeper than insertion position");
|
|
641
641
|
if (n.depth - t.openStart != e.depth - t.openEnd)
|
|
@@ -652,7 +652,7 @@ function ls(n, e, t, r) {
|
|
|
652
652
|
let o = n.parent, l = o.content;
|
|
653
653
|
return We(o, l.cut(0, n.parentOffset).append(t.content).append(l.cut(e.parentOffset)));
|
|
654
654
|
} else {
|
|
655
|
-
let { start: o, end: l } =
|
|
655
|
+
let { start: o, end: l } = Yo(t, n);
|
|
656
656
|
return We(s, cs(n, o, l, e, r));
|
|
657
657
|
}
|
|
658
658
|
else return We(s, tn(n, e, r));
|
|
@@ -691,7 +691,7 @@ function tn(n, e, t) {
|
|
|
691
691
|
}
|
|
692
692
|
return Ct(e, null, t, r), new y(r);
|
|
693
693
|
}
|
|
694
|
-
function
|
|
694
|
+
function Yo(n, e) {
|
|
695
695
|
let t = e.depth - n.openStart, i = e.node(t).copy(n.content);
|
|
696
696
|
for (let s = t - 1; s >= 0; s--)
|
|
697
697
|
i = e.node(s).copy(y.from(i));
|
|
@@ -934,7 +934,7 @@ class Tt {
|
|
|
934
934
|
@internal
|
|
935
935
|
*/
|
|
936
936
|
static resolveCached(e, t) {
|
|
937
|
-
let r =
|
|
937
|
+
let r = zr.get(e);
|
|
938
938
|
if (r)
|
|
939
939
|
for (let s = 0; s < r.elts.length; s++) {
|
|
940
940
|
let o = r.elts[s];
|
|
@@ -942,17 +942,17 @@ class Tt {
|
|
|
942
942
|
return o;
|
|
943
943
|
}
|
|
944
944
|
else
|
|
945
|
-
|
|
945
|
+
zr.set(e, r = new Zo());
|
|
946
946
|
let i = r.elts[r.i] = Tt.resolve(e, t);
|
|
947
|
-
return r.i = (r.i + 1) %
|
|
947
|
+
return r.i = (r.i + 1) % Qo, i;
|
|
948
948
|
}
|
|
949
949
|
}
|
|
950
|
-
class
|
|
950
|
+
class Zo {
|
|
951
951
|
constructor() {
|
|
952
952
|
this.elts = [], this.i = 0;
|
|
953
953
|
}
|
|
954
954
|
}
|
|
955
|
-
const
|
|
955
|
+
const Qo = 12, zr = /* @__PURE__ */ new WeakMap();
|
|
956
956
|
class nn {
|
|
957
957
|
/**
|
|
958
958
|
Construct a node range. `$from` and `$to` should point into the
|
|
@@ -993,7 +993,7 @@ class nn {
|
|
|
993
993
|
return this.$to.indexAfter(this.depth);
|
|
994
994
|
}
|
|
995
995
|
}
|
|
996
|
-
const
|
|
996
|
+
const el = /* @__PURE__ */ Object.create(null);
|
|
997
997
|
let Je = class Gn {
|
|
998
998
|
/**
|
|
999
999
|
@internal
|
|
@@ -1112,7 +1112,7 @@ let Je = class Gn {
|
|
|
1112
1112
|
attributes, and marks.
|
|
1113
1113
|
*/
|
|
1114
1114
|
hasMarkup(e, t, r) {
|
|
1115
|
-
return this.type == e && Qt(this.attrs, t || e.defaultAttrs ||
|
|
1115
|
+
return this.type == e && Qt(this.attrs, t || e.defaultAttrs || el) && O.sameSet(this.marks, r || O.none);
|
|
1116
1116
|
}
|
|
1117
1117
|
/**
|
|
1118
1118
|
Create a new node with the same markup as this node, containing
|
|
@@ -1155,7 +1155,7 @@ let Je = class Gn {
|
|
|
1155
1155
|
[`ReplaceError`](https://prosemirror.net/docs/ref/#model.ReplaceError) is thrown.
|
|
1156
1156
|
*/
|
|
1157
1157
|
replace(e, t, r) {
|
|
1158
|
-
return
|
|
1158
|
+
return Xo(this.resolve(e), this.resolve(t), r);
|
|
1159
1159
|
}
|
|
1160
1160
|
/**
|
|
1161
1161
|
Find the node directly after the given position.
|
|
@@ -1418,13 +1418,13 @@ class Ue {
|
|
|
1418
1418
|
@internal
|
|
1419
1419
|
*/
|
|
1420
1420
|
static parse(e, t) {
|
|
1421
|
-
let r = new
|
|
1421
|
+
let r = new tl(e, t);
|
|
1422
1422
|
if (r.next == null)
|
|
1423
1423
|
return Ue.empty;
|
|
1424
1424
|
let i = hs(r);
|
|
1425
1425
|
r.next && r.err("Unexpected trailing text");
|
|
1426
|
-
let s = ll(
|
|
1427
|
-
return
|
|
1426
|
+
let s = al(ll(i));
|
|
1427
|
+
return cl(s, r), s;
|
|
1428
1428
|
}
|
|
1429
1429
|
/**
|
|
1430
1430
|
Match a node type, returning a match after that node if
|
|
@@ -1570,7 +1570,7 @@ class Ue {
|
|
|
1570
1570
|
}
|
|
1571
1571
|
}
|
|
1572
1572
|
Ue.empty = new Ue(!0);
|
|
1573
|
-
class
|
|
1573
|
+
class tl {
|
|
1574
1574
|
constructor(e, t) {
|
|
1575
1575
|
this.string = e, this.nodeTypes = t, this.inline = null, this.pos = 0, this.tokens = e.split(/\s*(?=\b|\W|$)/), this.tokens[this.tokens.length - 1] == "" && this.tokens.pop(), this.tokens[0] == "" && this.tokens.shift();
|
|
1576
1576
|
}
|
|
@@ -1587,19 +1587,19 @@ class el {
|
|
|
1587
1587
|
function hs(n) {
|
|
1588
1588
|
let e = [];
|
|
1589
1589
|
do
|
|
1590
|
-
e.push(
|
|
1590
|
+
e.push(nl(n));
|
|
1591
1591
|
while (n.eat("|"));
|
|
1592
1592
|
return e.length == 1 ? e[0] : { type: "choice", exprs: e };
|
|
1593
1593
|
}
|
|
1594
|
-
function
|
|
1594
|
+
function nl(n) {
|
|
1595
1595
|
let e = [];
|
|
1596
1596
|
do
|
|
1597
|
-
e.push(
|
|
1597
|
+
e.push(rl(n));
|
|
1598
1598
|
while (n.next && n.next != ")" && n.next != "|");
|
|
1599
1599
|
return e.length == 1 ? e[0] : { type: "seq", exprs: e };
|
|
1600
1600
|
}
|
|
1601
|
-
function
|
|
1602
|
-
let e =
|
|
1601
|
+
function rl(n) {
|
|
1602
|
+
let e = ol(n);
|
|
1603
1603
|
for (; ; )
|
|
1604
1604
|
if (n.eat("+"))
|
|
1605
1605
|
e = { type: "plus", expr: e };
|
|
@@ -1608,7 +1608,7 @@ function nl(n) {
|
|
|
1608
1608
|
else if (n.eat("?"))
|
|
1609
1609
|
e = { type: "opt", expr: e };
|
|
1610
1610
|
else if (n.eat("{"))
|
|
1611
|
-
e =
|
|
1611
|
+
e = il(n, e);
|
|
1612
1612
|
else
|
|
1613
1613
|
break;
|
|
1614
1614
|
return e;
|
|
@@ -1618,11 +1618,11 @@ function Pr(n) {
|
|
|
1618
1618
|
let e = Number(n.next);
|
|
1619
1619
|
return n.pos++, e;
|
|
1620
1620
|
}
|
|
1621
|
-
function
|
|
1621
|
+
function il(n, e) {
|
|
1622
1622
|
let t = Pr(n), r = t;
|
|
1623
1623
|
return n.eat(",") && (n.next != "}" ? r = Pr(n) : r = -1), n.eat("}") || n.err("Unclosed braced range"), { type: "range", min: t, max: r, expr: e };
|
|
1624
1624
|
}
|
|
1625
|
-
function
|
|
1625
|
+
function sl(n, e) {
|
|
1626
1626
|
let t = n.nodeTypes, r = t[e];
|
|
1627
1627
|
if (r)
|
|
1628
1628
|
return [r];
|
|
@@ -1633,18 +1633,18 @@ function il(n, e) {
|
|
|
1633
1633
|
}
|
|
1634
1634
|
return i.length == 0 && n.err("No node type or group '" + e + "' found"), i;
|
|
1635
1635
|
}
|
|
1636
|
-
function
|
|
1636
|
+
function ol(n) {
|
|
1637
1637
|
if (n.eat("(")) {
|
|
1638
1638
|
let e = hs(n);
|
|
1639
1639
|
return n.eat(")") || n.err("Missing closing paren"), e;
|
|
1640
1640
|
} else if (/\W/.test(n.next))
|
|
1641
1641
|
n.err("Unexpected token '" + n.next + "'");
|
|
1642
1642
|
else {
|
|
1643
|
-
let e =
|
|
1643
|
+
let e = sl(n, n.next).map((t) => (n.inline == null ? n.inline = t.isInline : n.inline != t.isInline && n.err("Mixing inline and block content"), { type: "name", value: t }));
|
|
1644
1644
|
return n.pos++, e.length == 1 ? e[0] : { type: "choice", exprs: e };
|
|
1645
1645
|
}
|
|
1646
1646
|
}
|
|
1647
|
-
function
|
|
1647
|
+
function ll(n) {
|
|
1648
1648
|
let e = [[]];
|
|
1649
1649
|
return i(s(n, 0), t()), e;
|
|
1650
1650
|
function t() {
|
|
@@ -1715,7 +1715,7 @@ function Vr(n, e) {
|
|
|
1715
1715
|
}
|
|
1716
1716
|
}
|
|
1717
1717
|
}
|
|
1718
|
-
function
|
|
1718
|
+
function al(n) {
|
|
1719
1719
|
let e = /* @__PURE__ */ Object.create(null);
|
|
1720
1720
|
return t(Vr(n, 0));
|
|
1721
1721
|
function t(r) {
|
|
@@ -1740,7 +1740,7 @@ function ll(n) {
|
|
|
1740
1740
|
return s;
|
|
1741
1741
|
}
|
|
1742
1742
|
}
|
|
1743
|
-
function
|
|
1743
|
+
function cl(n, e) {
|
|
1744
1744
|
for (let t = 0, r = [n]; t < r.length; t++) {
|
|
1745
1745
|
let i = r[t], s = !i.validEnd, o = [];
|
|
1746
1746
|
for (let l = 0; l < i.next.length; l++) {
|
|
@@ -1788,7 +1788,7 @@ function gs(n, e) {
|
|
|
1788
1788
|
let t = /* @__PURE__ */ Object.create(null);
|
|
1789
1789
|
if (e)
|
|
1790
1790
|
for (let r in e)
|
|
1791
|
-
t[r] = new
|
|
1791
|
+
t[r] = new hl(n, r, e[r]);
|
|
1792
1792
|
return t;
|
|
1793
1793
|
}
|
|
1794
1794
|
let Lr = class ys {
|
|
@@ -1970,7 +1970,7 @@ let Lr = class ys {
|
|
|
1970
1970
|
return r;
|
|
1971
1971
|
}
|
|
1972
1972
|
};
|
|
1973
|
-
function
|
|
1973
|
+
function fl(n, e, t) {
|
|
1974
1974
|
let r = t.split("|");
|
|
1975
1975
|
return (i) => {
|
|
1976
1976
|
let s = i === null ? "null" : typeof i;
|
|
@@ -1978,9 +1978,9 @@ function cl(n, e, t) {
|
|
|
1978
1978
|
throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${n}, got ${s}`);
|
|
1979
1979
|
};
|
|
1980
1980
|
}
|
|
1981
|
-
class
|
|
1981
|
+
class hl {
|
|
1982
1982
|
constructor(e, t, r) {
|
|
1983
|
-
this.hasDefault = Object.prototype.hasOwnProperty.call(r, "default"), this.default = r.default, this.validate = typeof r.validate == "string" ?
|
|
1983
|
+
this.hasDefault = Object.prototype.hasOwnProperty.call(r, "default"), this.default = r.default, this.validate = typeof r.validate == "string" ? fl(e, t, r.validate) : r.validate;
|
|
1984
1984
|
}
|
|
1985
1985
|
get isRequired() {
|
|
1986
1986
|
return !this.hasDefault;
|
|
@@ -2041,7 +2041,7 @@ class mn {
|
|
|
2041
2041
|
return this.excluded.indexOf(e) > -1;
|
|
2042
2042
|
}
|
|
2043
2043
|
}
|
|
2044
|
-
class
|
|
2044
|
+
class dl {
|
|
2045
2045
|
/**
|
|
2046
2046
|
Construct a schema from a schema [specification](https://prosemirror.net/docs/ref/#model.SchemaSpec).
|
|
2047
2047
|
*/
|
|
@@ -2050,7 +2050,7 @@ class hl {
|
|
|
2050
2050
|
let t = this.spec = {};
|
|
2051
2051
|
for (let i in e)
|
|
2052
2052
|
t[i] = e[i];
|
|
2053
|
-
t.nodes =
|
|
2053
|
+
t.nodes = z.from(e.nodes), t.marks = z.from(e.marks || {}), this.nodes = Lr.compile(this.spec.nodes, this), this.marks = mn.compile(this.spec.marks, this);
|
|
2054
2054
|
let r = /* @__PURE__ */ Object.create(null);
|
|
2055
2055
|
for (let i in this.nodes) {
|
|
2056
2056
|
if (i in this.marks)
|
|
@@ -2140,10 +2140,10 @@ function Fr(n, e) {
|
|
|
2140
2140
|
}
|
|
2141
2141
|
return t;
|
|
2142
2142
|
}
|
|
2143
|
-
function
|
|
2143
|
+
function ul(n) {
|
|
2144
2144
|
return n.tag != null;
|
|
2145
2145
|
}
|
|
2146
|
-
function
|
|
2146
|
+
function pl(n) {
|
|
2147
2147
|
return n.style != null;
|
|
2148
2148
|
}
|
|
2149
2149
|
class Ge {
|
|
@@ -2155,9 +2155,9 @@ class Ge {
|
|
|
2155
2155
|
this.schema = e, this.rules = t, this.tags = [], this.styles = [];
|
|
2156
2156
|
let r = this.matchedStyles = [];
|
|
2157
2157
|
t.forEach((i) => {
|
|
2158
|
-
if (
|
|
2158
|
+
if (ul(i))
|
|
2159
2159
|
this.tags.push(i);
|
|
2160
|
-
else if (
|
|
2160
|
+
else if (pl(i)) {
|
|
2161
2161
|
let s = /[^=]*/.exec(i.style)[0];
|
|
2162
2162
|
r.indexOf(s) < 0 && r.push(s), this.styles.push(i);
|
|
2163
2163
|
}
|
|
@@ -2193,7 +2193,7 @@ class Ge {
|
|
|
2193
2193
|
matchTag(e, t, r) {
|
|
2194
2194
|
for (let i = r ? this.tags.indexOf(r) + 1 : 0; i < this.tags.length; i++) {
|
|
2195
2195
|
let s = this.tags[i];
|
|
2196
|
-
if (
|
|
2196
|
+
if (yl(e, s.tag) && (s.namespace === void 0 || e.namespaceURI == s.namespace) && (!s.context || t.matchesContext(s.context))) {
|
|
2197
2197
|
if (s.getAttrs) {
|
|
2198
2198
|
let o = s.getAttrs(e);
|
|
2199
2199
|
if (o === !1)
|
|
@@ -2294,7 +2294,7 @@ const bs = {
|
|
|
2294
2294
|
table: !0,
|
|
2295
2295
|
tfoot: !0,
|
|
2296
2296
|
ul: !0
|
|
2297
|
-
},
|
|
2297
|
+
}, ml = {
|
|
2298
2298
|
head: !0,
|
|
2299
2299
|
noscript: !0,
|
|
2300
2300
|
object: !0,
|
|
@@ -2371,9 +2371,9 @@ class $r {
|
|
|
2371
2371
|
// none is found, the element's content nodes are added directly.
|
|
2372
2372
|
addElement(e, t, r) {
|
|
2373
2373
|
let i = e.nodeName.toLowerCase(), s;
|
|
2374
|
-
ks.hasOwnProperty(i) && this.parser.normalizeLists &&
|
|
2374
|
+
ks.hasOwnProperty(i) && this.parser.normalizeLists && gl(e);
|
|
2375
2375
|
let o = this.options.ruleFromNode && this.options.ruleFromNode(e) || (s = this.parser.matchTag(e, this, r));
|
|
2376
|
-
if (o ? o.ignore :
|
|
2376
|
+
if (o ? o.ignore : ml.hasOwnProperty(i))
|
|
2377
2377
|
this.findInside(e), this.ignoreFallback(e, t);
|
|
2378
2378
|
else if (!o || o.skip || o.closeParent) {
|
|
2379
2379
|
o && o.closeParent ? this.open = Math.max(0, this.open - 1) : o && o.skip.nodeType && (e = o.skip);
|
|
@@ -2602,13 +2602,13 @@ class $r {
|
|
|
2602
2602
|
}
|
|
2603
2603
|
}
|
|
2604
2604
|
}
|
|
2605
|
-
function
|
|
2605
|
+
function gl(n) {
|
|
2606
2606
|
for (let e = n.firstChild, t = null; e; e = e.nextSibling) {
|
|
2607
2607
|
let r = e.nodeType == 1 ? e.nodeName.toLowerCase() : null;
|
|
2608
2608
|
r && ks.hasOwnProperty(r) && t ? (t.appendChild(e), e = t) : r == "li" ? t = e : r && (t = null);
|
|
2609
2609
|
}
|
|
2610
2610
|
}
|
|
2611
|
-
function
|
|
2611
|
+
function yl(n, e) {
|
|
2612
2612
|
return (n.matches || n.msMatchesSelector || n.webkitMatchesSelector || n.mozMatchesSelector).call(n, e);
|
|
2613
2613
|
}
|
|
2614
2614
|
function Wr(n) {
|
|
@@ -2751,11 +2751,11 @@ function Nn(n) {
|
|
|
2751
2751
|
return n.document || window.document;
|
|
2752
2752
|
}
|
|
2753
2753
|
const Kr = /* @__PURE__ */ new WeakMap();
|
|
2754
|
-
function
|
|
2754
|
+
function bl(n) {
|
|
2755
2755
|
let e = Kr.get(n);
|
|
2756
|
-
return e === void 0 && Kr.set(n, e =
|
|
2756
|
+
return e === void 0 && Kr.set(n, e = kl(n)), e;
|
|
2757
2757
|
}
|
|
2758
|
-
function
|
|
2758
|
+
function kl(n) {
|
|
2759
2759
|
let e = null;
|
|
2760
2760
|
function t(r) {
|
|
2761
2761
|
if (r && typeof r == "object")
|
|
@@ -2781,7 +2781,7 @@ function Ut(n, e, t, r) {
|
|
|
2781
2781
|
let i = e[0], s;
|
|
2782
2782
|
if (typeof i != "string")
|
|
2783
2783
|
throw new RangeError("Invalid array passed to renderSpec");
|
|
2784
|
-
if (r && (s =
|
|
2784
|
+
if (r && (s = bl(r)) && s.indexOf(e) > -1)
|
|
2785
2785
|
throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");
|
|
2786
2786
|
let o = i.indexOf(" ");
|
|
2787
2787
|
o > 0 && (t = i.slice(0, o), i = i.slice(o + 1));
|
|
@@ -2812,13 +2812,13 @@ function Ut(n, e, t, r) {
|
|
|
2812
2812
|
return { dom: a, contentDOM: l };
|
|
2813
2813
|
}
|
|
2814
2814
|
const xs = 65535, Ss = Math.pow(2, 16);
|
|
2815
|
-
function
|
|
2815
|
+
function xl(n, e) {
|
|
2816
2816
|
return n + e * Ss;
|
|
2817
2817
|
}
|
|
2818
2818
|
function jr(n) {
|
|
2819
2819
|
return n & xs;
|
|
2820
2820
|
}
|
|
2821
|
-
function
|
|
2821
|
+
function Sl(n) {
|
|
2822
2822
|
return (n - (n & xs)) / Ss;
|
|
2823
2823
|
}
|
|
2824
2824
|
const Cs = 1, ws = 2, Gt = 4, Ms = 8;
|
|
@@ -2876,7 +2876,7 @@ class X {
|
|
|
2876
2876
|
if (!this.inverted)
|
|
2877
2877
|
for (let i = 0; i < r; i++)
|
|
2878
2878
|
t += this.ranges[i * 3 + 2] - this.ranges[i * 3 + 1];
|
|
2879
|
-
return this.ranges[r * 3] + t +
|
|
2879
|
+
return this.ranges[r * 3] + t + Sl(e);
|
|
2880
2880
|
}
|
|
2881
2881
|
mapResult(e, t = 1) {
|
|
2882
2882
|
return this._map(e, t, !1);
|
|
@@ -2898,7 +2898,7 @@ class X {
|
|
|
2898
2898
|
let d = c ? e == a ? -1 : e == h ? 1 : t : t, u = a + i + (d < 0 ? 0 : f);
|
|
2899
2899
|
if (r)
|
|
2900
2900
|
return u;
|
|
2901
|
-
let p = e == (t < 0 ? a : h) ? null :
|
|
2901
|
+
let p = e == (t < 0 ? a : h) ? null : xl(l / 3, e - a), m = e == a ? ws : e == h ? Cs : Gt;
|
|
2902
2902
|
return (t < 0 ? e != a : e != h) && (m |= Ms), new _n(u, m, p);
|
|
2903
2903
|
}
|
|
2904
2904
|
i += f - c;
|
|
@@ -3427,7 +3427,7 @@ function Xn(n, e, t) {
|
|
|
3427
3427
|
}
|
|
3428
3428
|
return !1;
|
|
3429
3429
|
}
|
|
3430
|
-
function
|
|
3430
|
+
function Cl(n, e, t, r) {
|
|
3431
3431
|
let i = [], s = [], o, l;
|
|
3432
3432
|
n.doc.nodesBetween(e, t, (a, c, f) => {
|
|
3433
3433
|
if (!a.isInline)
|
|
@@ -3441,7 +3441,7 @@ function Sl(n, e, t, r) {
|
|
|
3441
3441
|
}
|
|
3442
3442
|
}), i.forEach((a) => n.step(a)), s.forEach((a) => n.step(a));
|
|
3443
3443
|
}
|
|
3444
|
-
function
|
|
3444
|
+
function wl(n, e, t, r) {
|
|
3445
3445
|
let i = [], s = 0;
|
|
3446
3446
|
n.doc.nodesBetween(e, t, (o, l) => {
|
|
3447
3447
|
if (!o.isInline)
|
|
@@ -3491,7 +3491,7 @@ function yr(n, e, t, r = t.contentMatch, i = !0) {
|
|
|
3491
3491
|
for (let a = o.length - 1; a >= 0; a--)
|
|
3492
3492
|
n.step(o[a]);
|
|
3493
3493
|
}
|
|
3494
|
-
function
|
|
3494
|
+
function Ml(n, e, t) {
|
|
3495
3495
|
return (e == 0 || n.canReplace(e, n.childCount)) && (t == n.childCount || n.canReplace(0, t));
|
|
3496
3496
|
}
|
|
3497
3497
|
function gn(n) {
|
|
@@ -3500,12 +3500,12 @@ function gn(n) {
|
|
|
3500
3500
|
let i = n.$from.node(r), s = n.$from.index(r), o = n.$to.indexAfter(r);
|
|
3501
3501
|
if (r < n.depth && i.canReplace(s, o, t))
|
|
3502
3502
|
return r;
|
|
3503
|
-
if (r == 0 || i.type.spec.isolating || !
|
|
3503
|
+
if (r == 0 || i.type.spec.isolating || !Ml(i, s, o))
|
|
3504
3504
|
break;
|
|
3505
3505
|
}
|
|
3506
3506
|
return null;
|
|
3507
3507
|
}
|
|
3508
|
-
function
|
|
3508
|
+
function Ol(n, e, t) {
|
|
3509
3509
|
let { $from: r, $to: i, depth: s } = e, o = r.before(s + 1), l = i.after(s + 1), a = o, c = l, f = y.empty, h = 0;
|
|
3510
3510
|
for (let p = s, m = !1; p > t; p--)
|
|
3511
3511
|
m || r.index(p) > 0 ? (m = !0, f = y.from(r.node(p).copy(f)), h++) : a--;
|
|
@@ -3515,20 +3515,20 @@ function Ml(n, e, t) {
|
|
|
3515
3515
|
n.step(new L(a, c, o, l, new k(f.append(d), h, u), f.size - h, !0));
|
|
3516
3516
|
}
|
|
3517
3517
|
function Os(n, e, t = null, r = n) {
|
|
3518
|
-
let i =
|
|
3518
|
+
let i = Nl(n, e), s = i && Tl(r, e);
|
|
3519
3519
|
return s ? i.map(Ur).concat({ type: e, attrs: t }).concat(s.map(Ur)) : null;
|
|
3520
3520
|
}
|
|
3521
3521
|
function Ur(n) {
|
|
3522
3522
|
return { type: n, attrs: null };
|
|
3523
3523
|
}
|
|
3524
|
-
function
|
|
3524
|
+
function Nl(n, e) {
|
|
3525
3525
|
let { parent: t, startIndex: r, endIndex: i } = n, s = t.contentMatchAt(r).findWrapping(e);
|
|
3526
3526
|
if (!s)
|
|
3527
3527
|
return null;
|
|
3528
3528
|
let o = s.length ? s[0] : e;
|
|
3529
3529
|
return t.canReplaceWith(r, i, o) ? s : null;
|
|
3530
3530
|
}
|
|
3531
|
-
function
|
|
3531
|
+
function Tl(n, e) {
|
|
3532
3532
|
let { parent: t, startIndex: r, endIndex: i } = n, s = t.child(r), o = e.contentMatch.findWrapping(s.type);
|
|
3533
3533
|
if (!o)
|
|
3534
3534
|
return null;
|
|
@@ -3537,7 +3537,7 @@ function Nl(n, e) {
|
|
|
3537
3537
|
a = a.matchType(t.child(c).type);
|
|
3538
3538
|
return !a || !a.validEnd ? null : o;
|
|
3539
3539
|
}
|
|
3540
|
-
function
|
|
3540
|
+
function Al(n, e, t) {
|
|
3541
3541
|
let r = y.empty;
|
|
3542
3542
|
for (let o = t.length - 1; o >= 0; o--) {
|
|
3543
3543
|
if (r.size) {
|
|
@@ -3550,13 +3550,13 @@ function Tl(n, e, t) {
|
|
|
3550
3550
|
let i = e.start, s = e.end;
|
|
3551
3551
|
n.step(new L(i, s, i, s, new k(r, 0, 0), t.length, !0));
|
|
3552
3552
|
}
|
|
3553
|
-
function
|
|
3553
|
+
function Dl(n, e, t, r, i) {
|
|
3554
3554
|
if (!r.isTextblock)
|
|
3555
3555
|
throw new RangeError("Type given to setBlockType should be a textblock");
|
|
3556
3556
|
let s = n.steps.length;
|
|
3557
3557
|
n.doc.nodesBetween(e, t, (o, l) => {
|
|
3558
3558
|
let a = typeof i == "function" ? i(o) : i;
|
|
3559
|
-
if (o.isTextblock && !o.hasMarkup(r, a) &&
|
|
3559
|
+
if (o.isTextblock && !o.hasMarkup(r, a) && El(n.doc, n.mapping.slice(s).map(l), r)) {
|
|
3560
3560
|
let c = null;
|
|
3561
3561
|
if (r.schema.linebreakReplacement) {
|
|
3562
3562
|
let u = r.whitespace == "pre", p = !!r.contentMatch.matchType(r.schema.linebreakReplacement);
|
|
@@ -3588,11 +3588,11 @@ function Ts(n, e, t, r) {
|
|
|
3588
3588
|
}
|
|
3589
3589
|
});
|
|
3590
3590
|
}
|
|
3591
|
-
function
|
|
3591
|
+
function El(n, e, t) {
|
|
3592
3592
|
let r = n.resolve(e), i = r.index();
|
|
3593
3593
|
return r.parent.canReplaceWith(i, i + 1, t);
|
|
3594
3594
|
}
|
|
3595
|
-
function
|
|
3595
|
+
function Rl(n, e, t, r, i) {
|
|
3596
3596
|
let s = n.doc.nodeAt(e);
|
|
3597
3597
|
if (!s)
|
|
3598
3598
|
throw new RangeError("No node at given position");
|
|
@@ -3621,7 +3621,7 @@ function st(n, e, t = 1, r) {
|
|
|
3621
3621
|
let l = i.indexAfter(s), a = r && r[0];
|
|
3622
3622
|
return i.node(s).canReplaceWith(l, l, a ? a.type : i.node(s + 1).type);
|
|
3623
3623
|
}
|
|
3624
|
-
function
|
|
3624
|
+
function Il(n, e, t = 1, r) {
|
|
3625
3625
|
let i = n.doc.resolve(e), s = y.empty, o = y.empty;
|
|
3626
3626
|
for (let l = i.depth, a = i.depth - t, c = t - 1; l > a; l--, c--) {
|
|
3627
3627
|
s = y.from(i.node(l).copy(s));
|
|
@@ -3632,9 +3632,9 @@ function Rl(n, e, t = 1, r) {
|
|
|
3632
3632
|
}
|
|
3633
3633
|
function yn(n, e) {
|
|
3634
3634
|
let t = n.resolve(e), r = t.index();
|
|
3635
|
-
return
|
|
3635
|
+
return Bl(t.nodeBefore, t.nodeAfter) && t.parent.canReplace(r, r + 1);
|
|
3636
3636
|
}
|
|
3637
|
-
function
|
|
3637
|
+
function vl(n, e) {
|
|
3638
3638
|
e.content.size || n.type.compatibleContent(e.type);
|
|
3639
3639
|
let t = n.contentMatchAt(n.childCount), { linebreakReplacement: r } = n.type.schema;
|
|
3640
3640
|
for (let i = 0; i < e.childCount; i++) {
|
|
@@ -3644,8 +3644,8 @@ function Il(n, e) {
|
|
|
3644
3644
|
}
|
|
3645
3645
|
return t.validEnd;
|
|
3646
3646
|
}
|
|
3647
|
-
function
|
|
3648
|
-
return !!(n && e && !n.isLeaf &&
|
|
3647
|
+
function Bl(n, e) {
|
|
3648
|
+
return !!(n && e && !n.isLeaf && vl(n, e));
|
|
3649
3649
|
}
|
|
3650
3650
|
function zl(n, e, t) {
|
|
3651
3651
|
let r = null, { linebreakReplacement: i } = n.doc.type.schema, s = n.doc.resolve(e - t), o = s.node().type;
|
|
@@ -3666,7 +3666,7 @@ function zl(n, e, t) {
|
|
|
3666
3666
|
}
|
|
3667
3667
|
return n;
|
|
3668
3668
|
}
|
|
3669
|
-
function
|
|
3669
|
+
function Pl(n, e, t) {
|
|
3670
3670
|
let r = n.resolve(e);
|
|
3671
3671
|
if (r.parent.canReplaceWith(r.index(), r.index(), t))
|
|
3672
3672
|
return e;
|
|
@@ -3688,7 +3688,7 @@ function Bl(n, e, t) {
|
|
|
3688
3688
|
}
|
|
3689
3689
|
return null;
|
|
3690
3690
|
}
|
|
3691
|
-
function
|
|
3691
|
+
function Vl(n, e, t) {
|
|
3692
3692
|
let r = n.resolve(e);
|
|
3693
3693
|
if (!t.content.size)
|
|
3694
3694
|
return e;
|
|
@@ -3713,12 +3713,12 @@ function br(n, e, t = e, r = k.empty) {
|
|
|
3713
3713
|
if (e == t && !r.size)
|
|
3714
3714
|
return null;
|
|
3715
3715
|
let i = n.resolve(e), s = n.resolve(t);
|
|
3716
|
-
return As(i, s, r) ? new $(e, t, r) : new
|
|
3716
|
+
return As(i, s, r) ? new $(e, t, r) : new Ll(i, s, r).fit();
|
|
3717
3717
|
}
|
|
3718
3718
|
function As(n, e, t) {
|
|
3719
3719
|
return !t.openStart && !t.openEnd && n.start() == e.start() && n.parent.canReplace(n.index(), e.index(), t.content);
|
|
3720
3720
|
}
|
|
3721
|
-
class
|
|
3721
|
+
class Ll {
|
|
3722
3722
|
constructor(e, t, r) {
|
|
3723
3723
|
this.$from = e, this.$to = t, this.unplaced = r, this.frontier = [], this.placed = y.empty;
|
|
3724
3724
|
for (let i = 0; i <= e.depth; i++) {
|
|
@@ -3887,18 +3887,18 @@ function Dn(n, e, t, r, i) {
|
|
|
3887
3887
|
if (o == s.childCount && !t.compatibleContent(s.type))
|
|
3888
3888
|
return null;
|
|
3889
3889
|
let l = r.fillBefore(s.content, !0, o);
|
|
3890
|
-
return l && !
|
|
3890
|
+
return l && !Fl(t, s.content, o) ? l : null;
|
|
3891
3891
|
}
|
|
3892
|
-
function
|
|
3892
|
+
function Fl(n, e, t) {
|
|
3893
3893
|
for (let r = t; r < e.childCount; r++)
|
|
3894
3894
|
if (!n.allowsMarks(e.child(r).marks))
|
|
3895
3895
|
return !0;
|
|
3896
3896
|
return !1;
|
|
3897
3897
|
}
|
|
3898
|
-
function
|
|
3898
|
+
function Hl(n) {
|
|
3899
3899
|
return n.spec.defining || n.spec.definingForContent;
|
|
3900
3900
|
}
|
|
3901
|
-
function
|
|
3901
|
+
function $l(n, e, t, r) {
|
|
3902
3902
|
if (!r.size)
|
|
3903
3903
|
return n.deleteRange(e, t);
|
|
3904
3904
|
let i = n.doc.resolve(e), s = n.doc.resolve(t);
|
|
@@ -3922,7 +3922,7 @@ function Hl(n, e, t, r) {
|
|
|
3922
3922
|
d = p.content;
|
|
3923
3923
|
}
|
|
3924
3924
|
for (let d = f - 1; d >= 0; d--) {
|
|
3925
|
-
let u = c[d], p =
|
|
3925
|
+
let u = c[d], p = Hl(u.type);
|
|
3926
3926
|
if (p && !u.sameMarkup(i.node(Math.abs(l) - 1)))
|
|
3927
3927
|
f = d;
|
|
3928
3928
|
else if (p || !u.type.isTextblock)
|
|
@@ -3956,14 +3956,14 @@ function Es(n, e, t, r, i) {
|
|
|
3956
3956
|
}
|
|
3957
3957
|
return n;
|
|
3958
3958
|
}
|
|
3959
|
-
function
|
|
3959
|
+
function Wl(n, e, t, r) {
|
|
3960
3960
|
if (!r.isInline && e == t && n.doc.resolve(e).parent.content.size) {
|
|
3961
|
-
let i =
|
|
3961
|
+
let i = Pl(n.doc, e, r.type);
|
|
3962
3962
|
i != null && (e = t = i);
|
|
3963
3963
|
}
|
|
3964
3964
|
n.replaceRange(e, t, new k(y.from(r), 0, 0));
|
|
3965
3965
|
}
|
|
3966
|
-
function
|
|
3966
|
+
function Jl(n, e, t) {
|
|
3967
3967
|
let r = n.doc.resolve(e), i = n.doc.resolve(t), s = Rs(r, i);
|
|
3968
3968
|
for (let o = 0; o < s.length; o++) {
|
|
3969
3969
|
let l = s[o], a = o == s.length - 1;
|
|
@@ -4159,7 +4159,7 @@ class Is {
|
|
|
4159
4159
|
control over what happens.
|
|
4160
4160
|
*/
|
|
4161
4161
|
replaceRange(e, t, r) {
|
|
4162
|
-
return
|
|
4162
|
+
return $l(this, e, t, r), this;
|
|
4163
4163
|
}
|
|
4164
4164
|
/**
|
|
4165
4165
|
Replace the given range with a node, but use `from` and `to` as
|
|
@@ -4171,14 +4171,14 @@ class Is {
|
|
|
4171
4171
|
that parent node.
|
|
4172
4172
|
*/
|
|
4173
4173
|
replaceRangeWith(e, t, r) {
|
|
4174
|
-
return
|
|
4174
|
+
return Wl(this, e, t, r), this;
|
|
4175
4175
|
}
|
|
4176
4176
|
/**
|
|
4177
4177
|
Delete the given range, expanding it to cover fully covered
|
|
4178
4178
|
parent nodes until a valid replace is found.
|
|
4179
4179
|
*/
|
|
4180
4180
|
deleteRange(e, t) {
|
|
4181
|
-
return
|
|
4181
|
+
return Jl(this, e, t), this;
|
|
4182
4182
|
}
|
|
4183
4183
|
/**
|
|
4184
4184
|
Split the content in the given range off from its parent, if there
|
|
@@ -4188,7 +4188,7 @@ class Is {
|
|
|
4188
4188
|
sure the lift is valid.
|
|
4189
4189
|
*/
|
|
4190
4190
|
lift(e, t) {
|
|
4191
|
-
return
|
|
4191
|
+
return Ol(this, e, t), this;
|
|
4192
4192
|
}
|
|
4193
4193
|
/**
|
|
4194
4194
|
Join the blocks around the given position. If depth is 2, their
|
|
@@ -4203,21 +4203,21 @@ class Is {
|
|
|
4203
4203
|
probably be computed with [`findWrapping`](https://prosemirror.net/docs/ref/#transform.findWrapping).
|
|
4204
4204
|
*/
|
|
4205
4205
|
wrap(e, t) {
|
|
4206
|
-
return
|
|
4206
|
+
return Al(this, e, t), this;
|
|
4207
4207
|
}
|
|
4208
4208
|
/**
|
|
4209
4209
|
Set the type of all textblocks (partly) between `from` and `to` to
|
|
4210
4210
|
the given node type with the given attributes.
|
|
4211
4211
|
*/
|
|
4212
4212
|
setBlockType(e, t = e, r, i = null) {
|
|
4213
|
-
return
|
|
4213
|
+
return Dl(this, e, t, r, i), this;
|
|
4214
4214
|
}
|
|
4215
4215
|
/**
|
|
4216
4216
|
Change the type, attributes, and/or marks of the node at `pos`.
|
|
4217
4217
|
When `type` isn't given, the existing node type is preserved,
|
|
4218
4218
|
*/
|
|
4219
4219
|
setNodeMarkup(e, t, r = null, i) {
|
|
4220
|
-
return
|
|
4220
|
+
return Rl(this, e, t, r, i), this;
|
|
4221
4221
|
}
|
|
4222
4222
|
/**
|
|
4223
4223
|
Set a single attribute on a given node to a new value.
|
|
@@ -4261,13 +4261,13 @@ class Is {
|
|
|
4261
4261
|
use after the split.
|
|
4262
4262
|
*/
|
|
4263
4263
|
split(e, t = 1, r) {
|
|
4264
|
-
return
|
|
4264
|
+
return Il(this, e, t, r), this;
|
|
4265
4265
|
}
|
|
4266
4266
|
/**
|
|
4267
4267
|
Add the given mark to the inline content between `from` and `to`.
|
|
4268
4268
|
*/
|
|
4269
4269
|
addMark(e, t, r) {
|
|
4270
|
-
return
|
|
4270
|
+
return Cl(this, e, t, r), this;
|
|
4271
4271
|
}
|
|
4272
4272
|
/**
|
|
4273
4273
|
Remove marks from inline nodes between `from` and `to`. When
|
|
@@ -4276,7 +4276,7 @@ class Is {
|
|
|
4276
4276
|
remove all marks of any type.
|
|
4277
4277
|
*/
|
|
4278
4278
|
removeMark(e, t, r) {
|
|
4279
|
-
return
|
|
4279
|
+
return wl(this, e, t, r), this;
|
|
4280
4280
|
}
|
|
4281
4281
|
/**
|
|
4282
4282
|
Removes all marks and nodes from the content of the node at
|
|
@@ -4642,11 +4642,11 @@ class Z extends S {
|
|
|
4642
4642
|
return e instanceof Z;
|
|
4643
4643
|
}
|
|
4644
4644
|
getBookmark() {
|
|
4645
|
-
return
|
|
4645
|
+
return ql;
|
|
4646
4646
|
}
|
|
4647
4647
|
}
|
|
4648
4648
|
S.jsonID("all", Z);
|
|
4649
|
-
const
|
|
4649
|
+
const ql = {
|
|
4650
4650
|
map() {
|
|
4651
4651
|
return this;
|
|
4652
4652
|
},
|
|
@@ -4684,7 +4684,7 @@ function Xr(n, e, t) {
|
|
|
4684
4684
|
}), n.setSelection(S.near(n.doc.resolve(o), t));
|
|
4685
4685
|
}
|
|
4686
4686
|
const Yr = 1, Jt = 2, Zr = 4;
|
|
4687
|
-
class
|
|
4687
|
+
class Kl extends Is {
|
|
4688
4688
|
/**
|
|
4689
4689
|
@internal
|
|
4690
4690
|
*/
|
|
@@ -4843,7 +4843,7 @@ class St {
|
|
|
4843
4843
|
this.name = e, this.init = Qr(t.init, r), this.apply = Qr(t.apply, r);
|
|
4844
4844
|
}
|
|
4845
4845
|
}
|
|
4846
|
-
const
|
|
4846
|
+
const jl = [
|
|
4847
4847
|
new St("doc", {
|
|
4848
4848
|
init(n) {
|
|
4849
4849
|
return n.doc || n.schema.topNodeType.createAndFill();
|
|
@@ -4879,7 +4879,7 @@ const Kl = [
|
|
|
4879
4879
|
];
|
|
4880
4880
|
class Rn {
|
|
4881
4881
|
constructor(e, t) {
|
|
4882
|
-
this.schema = e, this.plugins = [], this.pluginsByKey = /* @__PURE__ */ Object.create(null), this.fields =
|
|
4882
|
+
this.schema = e, this.plugins = [], this.pluginsByKey = /* @__PURE__ */ Object.create(null), this.fields = jl.slice(), t && t.forEach((r) => {
|
|
4883
4883
|
if (this.pluginsByKey[r.key])
|
|
4884
4884
|
throw new RangeError("Adding different instances of a keyed plugin (" + r.key + ")");
|
|
4885
4885
|
this.plugins.push(r), this.pluginsByKey[r.key] = r, r.spec.state && this.fields.push(new St(r.key, r.spec.state, r));
|
|
@@ -4972,7 +4972,7 @@ class nt {
|
|
|
4972
4972
|
Start a [transaction](https://prosemirror.net/docs/ref/#state.Transaction) from this state.
|
|
4973
4973
|
*/
|
|
4974
4974
|
get tr() {
|
|
4975
|
-
return new
|
|
4975
|
+
return new Kl(this);
|
|
4976
4976
|
}
|
|
4977
4977
|
/**
|
|
4978
4978
|
Create a new state.
|
|
@@ -5051,10 +5051,10 @@ class nt {
|
|
|
5051
5051
|
}), s;
|
|
5052
5052
|
}
|
|
5053
5053
|
}
|
|
5054
|
-
function
|
|
5054
|
+
function Bs(n, e, t) {
|
|
5055
5055
|
for (let r in n) {
|
|
5056
5056
|
let i = n[r];
|
|
5057
|
-
i instanceof Function ? i = i.bind(e) : r == "handleDOMEvents" && (i =
|
|
5057
|
+
i instanceof Function ? i = i.bind(e) : r == "handleDOMEvents" && (i = Bs(i, e, {})), t[r] = i;
|
|
5058
5058
|
}
|
|
5059
5059
|
return t;
|
|
5060
5060
|
}
|
|
@@ -5063,7 +5063,7 @@ class pt {
|
|
|
5063
5063
|
Create a plugin.
|
|
5064
5064
|
*/
|
|
5065
5065
|
constructor(e) {
|
|
5066
|
-
this.spec = e, this.props = {}, e.props &&
|
|
5066
|
+
this.spec = e, this.props = {}, e.props && Bs(e.props, this, this.props), this.key = e.key ? e.key.key : zs("plugin");
|
|
5067
5067
|
}
|
|
5068
5068
|
/**
|
|
5069
5069
|
Extract the plugin's state field from an editor state.
|
|
@@ -5073,15 +5073,15 @@ class pt {
|
|
|
5073
5073
|
}
|
|
5074
5074
|
}
|
|
5075
5075
|
const In = /* @__PURE__ */ Object.create(null);
|
|
5076
|
-
function
|
|
5076
|
+
function zs(n) {
|
|
5077
5077
|
return n in In ? n + "$" + ++In[n] : (In[n] = 0, n + "$");
|
|
5078
5078
|
}
|
|
5079
|
-
class
|
|
5079
|
+
class Bt {
|
|
5080
5080
|
/**
|
|
5081
5081
|
Create a plugin key.
|
|
5082
5082
|
*/
|
|
5083
5083
|
constructor(e = "key") {
|
|
5084
|
-
this.key =
|
|
5084
|
+
this.key = zs(e);
|
|
5085
5085
|
}
|
|
5086
5086
|
/**
|
|
5087
5087
|
Get the active plugin with this key, if any, from an editor
|
|
@@ -5098,12 +5098,12 @@ class zt {
|
|
|
5098
5098
|
}
|
|
5099
5099
|
}
|
|
5100
5100
|
const Ps = (n, e) => n.selection.empty ? !1 : (e && e(n.tr.deleteSelection().scrollIntoView()), !0);
|
|
5101
|
-
function
|
|
5101
|
+
function Ul(n, e) {
|
|
5102
5102
|
let { $cursor: t } = n.selection;
|
|
5103
5103
|
return !t || (e ? !e.endOfTextblock("backward", n) : t.parentOffset > 0) ? null : t;
|
|
5104
5104
|
}
|
|
5105
|
-
const
|
|
5106
|
-
let r =
|
|
5105
|
+
const Gl = (n, e, t) => {
|
|
5106
|
+
let r = Ul(n, t);
|
|
5107
5107
|
if (!r)
|
|
5108
5108
|
return !1;
|
|
5109
5109
|
let i = Vs(r);
|
|
@@ -5138,7 +5138,7 @@ function ft(n, e, t = !1) {
|
|
|
5138
5138
|
}
|
|
5139
5139
|
return !1;
|
|
5140
5140
|
}
|
|
5141
|
-
const
|
|
5141
|
+
const _l = (n, e, t) => {
|
|
5142
5142
|
let { $head: r, empty: i } = n.selection, s = r;
|
|
5143
5143
|
if (!i)
|
|
5144
5144
|
return !1;
|
|
@@ -5160,12 +5160,12 @@ function Vs(n) {
|
|
|
5160
5160
|
}
|
|
5161
5161
|
return null;
|
|
5162
5162
|
}
|
|
5163
|
-
function
|
|
5163
|
+
function Xl(n, e) {
|
|
5164
5164
|
let { $cursor: t } = n.selection;
|
|
5165
5165
|
return !t || (e ? !e.endOfTextblock("forward", n) : t.parentOffset < t.parent.content.size) ? null : t;
|
|
5166
5166
|
}
|
|
5167
|
-
const
|
|
5168
|
-
let r =
|
|
5167
|
+
const Yl = (n, e, t) => {
|
|
5168
|
+
let r = Xl(n, t);
|
|
5169
5169
|
if (!r)
|
|
5170
5170
|
return !1;
|
|
5171
5171
|
let i = Ls(r);
|
|
@@ -5185,7 +5185,7 @@ const Xl = (n, e, t) => {
|
|
|
5185
5185
|
}
|
|
5186
5186
|
}
|
|
5187
5187
|
return s.isAtom && i.depth == r.depth - 1 ? (e && e(n.tr.delete(i.pos, i.pos + s.nodeSize).scrollIntoView()), !0) : !1;
|
|
5188
|
-
},
|
|
5188
|
+
}, Zl = (n, e, t) => {
|
|
5189
5189
|
let { $head: r, empty: i } = n.selection, s = r;
|
|
5190
5190
|
if (!i)
|
|
5191
5191
|
return !1;
|
|
@@ -5208,7 +5208,7 @@ function Ls(n) {
|
|
|
5208
5208
|
}
|
|
5209
5209
|
return null;
|
|
5210
5210
|
}
|
|
5211
|
-
const
|
|
5211
|
+
const Ql = (n, e) => {
|
|
5212
5212
|
let { $head: t, $anchor: r } = n.selection;
|
|
5213
5213
|
return !t.parent.type.spec.code || !t.sameParent(r) ? !1 : (e && e(n.tr.insertText(`
|
|
5214
5214
|
`).scrollIntoView()), !0);
|
|
@@ -5233,7 +5233,7 @@ const Fs = (n, e) => {
|
|
|
5233
5233
|
a.setSelection(S.near(a.doc.resolve(l), 1)), e(a.scrollIntoView());
|
|
5234
5234
|
}
|
|
5235
5235
|
return !0;
|
|
5236
|
-
},
|
|
5236
|
+
}, ea = (n, e) => {
|
|
5237
5237
|
let t = n.selection, { $from: r, $to: i } = t;
|
|
5238
5238
|
if (t instanceof Z || r.parent.inlineContent || i.parent.inlineContent)
|
|
5239
5239
|
return !1;
|
|
@@ -5286,14 +5286,14 @@ function $s(n) {
|
|
|
5286
5286
|
return t && t(f.scrollIntoView()), !0;
|
|
5287
5287
|
};
|
|
5288
5288
|
}
|
|
5289
|
-
const
|
|
5290
|
-
function
|
|
5289
|
+
const ta = $s(), Ws = (n, e) => (e && e(n.tr.setSelection(new Z(n.doc))), !0);
|
|
5290
|
+
function na(n, e, t) {
|
|
5291
5291
|
let r = e.nodeBefore, i = e.nodeAfter, s = e.index();
|
|
5292
5292
|
return !r || !i || !r.type.compatibleContent(i.type) ? !1 : !r.content.size && e.parent.canReplace(s - 1, s) ? (t && t(n.tr.delete(e.pos - r.nodeSize, e.pos).scrollIntoView()), !0) : !e.parent.canReplace(s, s + 1) || !(i.isTextblock || yn(n.doc, e.pos)) ? !1 : (t && t(n.tr.join(e.pos).scrollIntoView()), !0);
|
|
5293
5293
|
}
|
|
5294
5294
|
function Js(n, e, t, r) {
|
|
5295
5295
|
let i = e.nodeBefore, s = e.nodeAfter, o, l, a = i.type.spec.isolating || s.type.spec.isolating;
|
|
5296
|
-
if (!a &&
|
|
5296
|
+
if (!a && na(n, e, t))
|
|
5297
5297
|
return !0;
|
|
5298
5298
|
let c = !a && e.parent.canReplace(e.index(), e.index() + 1);
|
|
5299
5299
|
if (c && (o = (l = i.contentMatchAt(i.childCount)).findWrapping(s.type)) && l.matchType(o[0] || s.type).validEnd) {
|
|
@@ -5341,8 +5341,8 @@ function qs(n) {
|
|
|
5341
5341
|
return i.node(s).isTextblock ? (t && t(e.tr.setSelection(C.create(e.doc, n < 0 ? i.start(s) : i.end(s)))), !0) : !1;
|
|
5342
5342
|
};
|
|
5343
5343
|
}
|
|
5344
|
-
const
|
|
5345
|
-
function
|
|
5344
|
+
const ra = qs(-1), ia = qs(1);
|
|
5345
|
+
function sa(n, e = null) {
|
|
5346
5346
|
return function(t, r) {
|
|
5347
5347
|
let i = !1;
|
|
5348
5348
|
for (let s = 0; s < t.selection.ranges.length && !i; s++) {
|
|
@@ -5372,7 +5372,7 @@ function ia(n, e = null) {
|
|
|
5372
5372
|
return !0;
|
|
5373
5373
|
};
|
|
5374
5374
|
}
|
|
5375
|
-
function
|
|
5375
|
+
function oa(n, e, t, r) {
|
|
5376
5376
|
for (let i = 0; i < e.length; i++) {
|
|
5377
5377
|
let { $from: s, $to: o } = e[i], l = s.depth == 0 ? n.inlineContent && n.type.allowsMarkType(t) : !1;
|
|
5378
5378
|
if (n.nodesBetween(s.pos, o.pos, (a, c) => {
|
|
@@ -5388,7 +5388,7 @@ function Pe(n, e = null, t) {
|
|
|
5388
5388
|
let r = t !== !1;
|
|
5389
5389
|
return function(i, s) {
|
|
5390
5390
|
let { empty: o, $cursor: l, ranges: a } = i.selection;
|
|
5391
|
-
if (o && !l || !
|
|
5391
|
+
if (o && !l || !oa(i.doc, a, n, r))
|
|
5392
5392
|
return !1;
|
|
5393
5393
|
if (s)
|
|
5394
5394
|
if (l)
|
|
@@ -5418,9 +5418,9 @@ function Dt(...n) {
|
|
|
5418
5418
|
return !1;
|
|
5419
5419
|
};
|
|
5420
5420
|
}
|
|
5421
|
-
let vn = Dt(Ps,
|
|
5421
|
+
let vn = Dt(Ps, Gl, _l), ei = Dt(Ps, Yl, Zl);
|
|
5422
5422
|
const ye = {
|
|
5423
|
-
Enter: Dt(
|
|
5423
|
+
Enter: Dt(Ql, ea, Hs, ta),
|
|
5424
5424
|
"Mod-Enter": Fs,
|
|
5425
5425
|
Backspace: vn,
|
|
5426
5426
|
"Mod-Backspace": vn,
|
|
@@ -5435,12 +5435,12 @@ const ye = {
|
|
|
5435
5435
|
"Ctrl-Alt-Backspace": ye["Mod-Delete"],
|
|
5436
5436
|
"Alt-Delete": ye["Mod-Delete"],
|
|
5437
5437
|
"Alt-d": ye["Mod-Delete"],
|
|
5438
|
-
"Ctrl-a":
|
|
5439
|
-
"Ctrl-e":
|
|
5438
|
+
"Ctrl-a": ra,
|
|
5439
|
+
"Ctrl-e": ia
|
|
5440
5440
|
};
|
|
5441
5441
|
for (let n in ye)
|
|
5442
5442
|
Ks[n] = ye[n];
|
|
5443
|
-
const
|
|
5443
|
+
const la = typeof navigator < "u" ? /Mac|iP(hone|[oa]d)/.test(navigator.platform) : typeof os < "u" && os.platform ? os.platform() == "darwin" : !1, aa = la ? Ks : ye;
|
|
5444
5444
|
var ln = 200, v = function() {
|
|
5445
5445
|
};
|
|
5446
5446
|
v.prototype.append = function(e) {
|
|
@@ -5450,7 +5450,7 @@ v.prototype.prepend = function(e) {
|
|
|
5450
5450
|
return e.length ? v.from(e).append(this) : this;
|
|
5451
5451
|
};
|
|
5452
5452
|
v.prototype.appendInner = function(e) {
|
|
5453
|
-
return new
|
|
5453
|
+
return new ca(this, e);
|
|
5454
5454
|
};
|
|
5455
5455
|
v.prototype.slice = function(e, t) {
|
|
5456
5456
|
return e === void 0 && (e = 0), t === void 0 && (t = this.length), e >= t ? v.empty : this.sliceInner(Math.max(0, e), Math.min(this.length, t));
|
|
@@ -5505,7 +5505,7 @@ var js = /* @__PURE__ */ function(n) {
|
|
|
5505
5505
|
}, Object.defineProperties(e.prototype, t), e;
|
|
5506
5506
|
}(v);
|
|
5507
5507
|
v.empty = new js([]);
|
|
5508
|
-
var
|
|
5508
|
+
var ca = /* @__PURE__ */ function(n) {
|
|
5509
5509
|
function e(t, r) {
|
|
5510
5510
|
n.call(this), this.left = t, this.right = r, this.length = t.length + r.length, this.depth = Math.max(t.depth, r.depth) + 1;
|
|
5511
5511
|
}
|
|
@@ -5538,7 +5538,7 @@ var aa = /* @__PURE__ */ function(n) {
|
|
|
5538
5538
|
return this.left.depth >= Math.max(this.right.depth, r.depth) + 1 ? new e(this.left, new e(this.right, r)) : new e(this, r);
|
|
5539
5539
|
}, e;
|
|
5540
5540
|
}(v);
|
|
5541
|
-
const
|
|
5541
|
+
const fa = 500;
|
|
5542
5542
|
class ie {
|
|
5543
5543
|
constructor(e, t) {
|
|
5544
5544
|
this.items = e, this.eventCount = t;
|
|
@@ -5580,7 +5580,7 @@ class ie {
|
|
|
5580
5580
|
(u = a && a.merge(d)) && (d = u, f ? s.pop() : l = l.slice(0, l.length - 1)), s.push(d), t && (o++, t = void 0), i || (a = d);
|
|
5581
5581
|
}
|
|
5582
5582
|
let c = o - r.depth;
|
|
5583
|
-
return c >
|
|
5583
|
+
return c > da && (l = ha(l, c), o -= c), new ie(l.append(s), o);
|
|
5584
5584
|
}
|
|
5585
5585
|
remapping(e, t) {
|
|
5586
5586
|
let r = new it();
|
|
@@ -5620,7 +5620,7 @@ class ie {
|
|
|
5620
5620
|
for (let d = t; d < o; d++)
|
|
5621
5621
|
c.push(new ae(s.maps[d]));
|
|
5622
5622
|
let f = this.items.slice(0, i).append(c).append(r), h = new ie(f, l);
|
|
5623
|
-
return h.emptyItemCount() >
|
|
5623
|
+
return h.emptyItemCount() > fa && (h = h.compress(this.items.length - r.length)), h;
|
|
5624
5624
|
}
|
|
5625
5625
|
emptyItemCount() {
|
|
5626
5626
|
let e = 0;
|
|
@@ -5652,7 +5652,7 @@ class ie {
|
|
|
5652
5652
|
}
|
|
5653
5653
|
}
|
|
5654
5654
|
ie.empty = new ie(v.empty, 0);
|
|
5655
|
-
function
|
|
5655
|
+
function ha(n, e) {
|
|
5656
5656
|
let t;
|
|
5657
5657
|
return n.forEach((r, i) => {
|
|
5658
5658
|
if (r.selection && e-- == 0)
|
|
@@ -5676,23 +5676,23 @@ class we {
|
|
|
5676
5676
|
this.done = e, this.undone = t, this.prevRanges = r, this.prevTime = i, this.prevComposition = s;
|
|
5677
5677
|
}
|
|
5678
5678
|
}
|
|
5679
|
-
const
|
|
5680
|
-
function
|
|
5679
|
+
const da = 20;
|
|
5680
|
+
function ua(n, e, t, r) {
|
|
5681
5681
|
let i = t.getMeta(qe), s;
|
|
5682
5682
|
if (i)
|
|
5683
5683
|
return i.historyState;
|
|
5684
|
-
t.getMeta(
|
|
5684
|
+
t.getMeta(ga) && (n = new we(n.done, n.undone, null, 0, -1));
|
|
5685
5685
|
let o = t.getMeta("appendedTransaction");
|
|
5686
5686
|
if (t.steps.length == 0)
|
|
5687
5687
|
return n;
|
|
5688
5688
|
if (o && o.getMeta(qe))
|
|
5689
5689
|
return o.getMeta(qe).redo ? new we(n.done.addTransform(t, void 0, r, _t(e)), n.undone, ti(t.mapping.maps), n.prevTime, n.prevComposition) : new we(n.done, n.undone.addTransform(t, void 0, r, _t(e)), null, n.prevTime, n.prevComposition);
|
|
5690
5690
|
if (t.getMeta("addToHistory") !== !1 && !(o && o.getMeta("addToHistory") === !1)) {
|
|
5691
|
-
let l = t.getMeta("composition"), a = n.prevTime == 0 || !o && n.prevComposition != l && (n.prevTime < (t.time || 0) - r.newGroupDelay || !
|
|
5691
|
+
let l = t.getMeta("composition"), a = n.prevTime == 0 || !o && n.prevComposition != l && (n.prevTime < (t.time || 0) - r.newGroupDelay || !pa(t, n.prevRanges)), c = o ? Bn(n.prevRanges, t.mapping) : ti(t.mapping.maps);
|
|
5692
5692
|
return new we(n.done.addTransform(t, a ? e.selection.getBookmark() : void 0, r, _t(e)), ie.empty, c, t.time, l ?? n.prevComposition);
|
|
5693
|
-
} else return (s = t.getMeta("rebased")) ? new we(n.done.rebased(t, s), n.undone.rebased(t, s),
|
|
5693
|
+
} else return (s = t.getMeta("rebased")) ? new we(n.done.rebased(t, s), n.undone.rebased(t, s), Bn(n.prevRanges, t.mapping), n.prevTime, n.prevComposition) : new we(n.done.addMaps(t.mapping.maps), n.undone.addMaps(t.mapping.maps), Bn(n.prevRanges, t.mapping), n.prevTime, n.prevComposition);
|
|
5694
5694
|
}
|
|
5695
|
-
function
|
|
5695
|
+
function pa(n, e) {
|
|
5696
5696
|
if (!e)
|
|
5697
5697
|
return !1;
|
|
5698
5698
|
if (!n.docChanged)
|
|
@@ -5709,7 +5709,7 @@ function ti(n) {
|
|
|
5709
5709
|
n[t].forEach((r, i, s, o) => e.push(s, o));
|
|
5710
5710
|
return e;
|
|
5711
5711
|
}
|
|
5712
|
-
function
|
|
5712
|
+
function Bn(n, e) {
|
|
5713
5713
|
if (!n)
|
|
5714
5714
|
return null;
|
|
5715
5715
|
let t = [];
|
|
@@ -5719,28 +5719,28 @@ function zn(n, e) {
|
|
|
5719
5719
|
}
|
|
5720
5720
|
return t;
|
|
5721
5721
|
}
|
|
5722
|
-
function
|
|
5722
|
+
function ma(n, e, t) {
|
|
5723
5723
|
let r = _t(e), i = qe.get(e).spec.config, s = (t ? n.undone : n.done).popEvent(e, r);
|
|
5724
5724
|
if (!s)
|
|
5725
5725
|
return null;
|
|
5726
5726
|
let o = s.selection.resolve(s.transform.doc), l = (t ? n.done : n.undone).addTransform(s.transform, e.selection.getBookmark(), i, r), a = new we(t ? l : s.remaining, t ? s.remaining : l, null, 0, -1);
|
|
5727
5727
|
return s.transform.setSelection(o).setMeta(qe, { redo: t, historyState: a });
|
|
5728
5728
|
}
|
|
5729
|
-
let
|
|
5729
|
+
let zn = !1, ni = null;
|
|
5730
5730
|
function _t(n) {
|
|
5731
5731
|
let e = n.plugins;
|
|
5732
5732
|
if (ni != e) {
|
|
5733
|
-
|
|
5733
|
+
zn = !1, ni = e;
|
|
5734
5734
|
for (let t = 0; t < e.length; t++)
|
|
5735
5735
|
if (e[t].spec.historyPreserveItems) {
|
|
5736
|
-
|
|
5736
|
+
zn = !0;
|
|
5737
5737
|
break;
|
|
5738
5738
|
}
|
|
5739
5739
|
}
|
|
5740
|
-
return
|
|
5740
|
+
return zn;
|
|
5741
5741
|
}
|
|
5742
|
-
const qe = new
|
|
5743
|
-
function
|
|
5742
|
+
const qe = new Bt("history"), ga = new Bt("closeHistory");
|
|
5743
|
+
function ya(n = {}) {
|
|
5744
5744
|
return n = {
|
|
5745
5745
|
depth: n.depth || 100,
|
|
5746
5746
|
newGroupDelay: n.newGroupDelay || 500
|
|
@@ -5751,7 +5751,7 @@ function ga(n = {}) {
|
|
|
5751
5751
|
return new we(ie.empty, ie.empty, null, 0, -1);
|
|
5752
5752
|
},
|
|
5753
5753
|
apply(e, t, r) {
|
|
5754
|
-
return
|
|
5754
|
+
return ua(t, r, e, n);
|
|
5755
5755
|
}
|
|
5756
5756
|
},
|
|
5757
5757
|
config: n,
|
|
@@ -5771,7 +5771,7 @@ function Us(n, e) {
|
|
|
5771
5771
|
if (!i || (n ? i.undone : i.done).eventCount == 0)
|
|
5772
5772
|
return !1;
|
|
5773
5773
|
if (r) {
|
|
5774
|
-
let s =
|
|
5774
|
+
let s = ma(i, t, n);
|
|
5775
5775
|
s && r(e ? s.scrollIntoView() : s);
|
|
5776
5776
|
}
|
|
5777
5777
|
return !0;
|
|
@@ -5856,18 +5856,18 @@ var ve = {
|
|
|
5856
5856
|
220: "|",
|
|
5857
5857
|
221: "}",
|
|
5858
5858
|
222: '"'
|
|
5859
|
-
},
|
|
5859
|
+
}, ba = typeof navigator < "u" && /Mac/.test(navigator.platform), ka = typeof navigator < "u" && /MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);
|
|
5860
5860
|
for (var P = 0; P < 10; P++) ve[48 + P] = ve[96 + P] = String(P);
|
|
5861
5861
|
for (var P = 1; P <= 24; P++) ve[P + 111] = "F" + P;
|
|
5862
5862
|
for (var P = 65; P <= 90; P++)
|
|
5863
5863
|
ve[P] = String.fromCharCode(P + 32), an[P] = String.fromCharCode(P);
|
|
5864
5864
|
for (var Pn in ve) an.hasOwnProperty(Pn) || (an[Pn] = ve[Pn]);
|
|
5865
|
-
function
|
|
5866
|
-
var e =
|
|
5865
|
+
function xa(n) {
|
|
5866
|
+
var e = ba && n.metaKey && n.shiftKey && !n.ctrlKey && !n.altKey || ka && n.shiftKey && n.key && n.key.length == 1 || n.key == "Unidentified", t = !e && n.key || (n.shiftKey ? an : ve)[n.keyCode] || n.key || "Unidentified";
|
|
5867
5867
|
return t == "Esc" && (t = "Escape"), t == "Del" && (t = "Delete"), t == "Left" && (t = "ArrowLeft"), t == "Up" && (t = "ArrowUp"), t == "Right" && (t = "ArrowRight"), t == "Down" && (t = "ArrowDown"), t;
|
|
5868
5868
|
}
|
|
5869
|
-
const
|
|
5870
|
-
function
|
|
5869
|
+
const Sa = typeof navigator < "u" ? /Mac|iP(hone|[oa]d)/.test(navigator.platform) : !1;
|
|
5870
|
+
function Ca(n) {
|
|
5871
5871
|
let e = n.split(/-(?!$)/), t = e[e.length - 1];
|
|
5872
5872
|
t == "Space" && (t = " ");
|
|
5873
5873
|
let r, i, s, o;
|
|
@@ -5882,16 +5882,16 @@ function Sa(n) {
|
|
|
5882
5882
|
else if (/^s(hift)?$/i.test(a))
|
|
5883
5883
|
s = !0;
|
|
5884
5884
|
else if (/^mod$/i.test(a))
|
|
5885
|
-
|
|
5885
|
+
Sa ? o = !0 : i = !0;
|
|
5886
5886
|
else
|
|
5887
5887
|
throw new Error("Unrecognized modifier name: " + a);
|
|
5888
5888
|
}
|
|
5889
5889
|
return r && (t = "Alt-" + t), i && (t = "Ctrl-" + t), o && (t = "Meta-" + t), s && (t = "Shift-" + t), t;
|
|
5890
5890
|
}
|
|
5891
|
-
function
|
|
5891
|
+
function wa(n) {
|
|
5892
5892
|
let e = /* @__PURE__ */ Object.create(null);
|
|
5893
5893
|
for (let t in n)
|
|
5894
|
-
e[
|
|
5894
|
+
e[Ca(t)] = n[t];
|
|
5895
5895
|
return e;
|
|
5896
5896
|
}
|
|
5897
5897
|
function Vn(n, e, t = !0) {
|
|
@@ -5901,9 +5901,9 @@ function Ln(n) {
|
|
|
5901
5901
|
return new pt({ props: { handleKeyDown: _s(n) } });
|
|
5902
5902
|
}
|
|
5903
5903
|
function _s(n) {
|
|
5904
|
-
let e =
|
|
5904
|
+
let e = wa(n);
|
|
5905
5905
|
return function(t, r) {
|
|
5906
|
-
let i =
|
|
5906
|
+
let i = xa(r), s, o = e[Vn(i, r)];
|
|
5907
5907
|
if (o && o(t.state, t.dispatch, t))
|
|
5908
5908
|
return !0;
|
|
5909
5909
|
if (i.length == 1 && i != " ") {
|
|
@@ -5933,10 +5933,10 @@ function ri(n, e = null) {
|
|
|
5933
5933
|
a = new nn(f, f, o.depth), o.endIndex < o.parent.childCount && (o = new nn(i, t.doc.resolve(s.end(o.depth)), o.depth)), l = !0;
|
|
5934
5934
|
}
|
|
5935
5935
|
let c = Os(a, n, e, o);
|
|
5936
|
-
return c ? (r && r(
|
|
5936
|
+
return c ? (r && r(Ma(t.tr, o, c, l, n).scrollIntoView()), !0) : !1;
|
|
5937
5937
|
};
|
|
5938
5938
|
}
|
|
5939
|
-
function
|
|
5939
|
+
function Ma(n, e, t, r, i) {
|
|
5940
5940
|
let s = y.empty;
|
|
5941
5941
|
for (let f = t.length - 1; f >= 0; f--)
|
|
5942
5942
|
s = y.from(t[f].type.create(t[f].attrs, s));
|
|
@@ -5949,7 +5949,7 @@ function wa(n, e, t, r, i) {
|
|
|
5949
5949
|
!d && st(n.doc, a, l) && (n.split(a, l), a += 2 * l), a += c.child(f).nodeSize;
|
|
5950
5950
|
return n;
|
|
5951
5951
|
}
|
|
5952
|
-
function
|
|
5952
|
+
function Oa(n, e) {
|
|
5953
5953
|
return function(t, r) {
|
|
5954
5954
|
let { $from: i, $to: s, node: o } = t.selection;
|
|
5955
5955
|
if (o && o.isBlock || i.depth < 2 || !i.sameParent(s))
|
|
@@ -5982,10 +5982,10 @@ function Ma(n, e) {
|
|
|
5982
5982
|
function Zn(n) {
|
|
5983
5983
|
return function(e, t) {
|
|
5984
5984
|
let { $from: r, $to: i } = e.selection, s = r.blockRange(i, (o) => o.childCount > 0 && o.firstChild.type == n);
|
|
5985
|
-
return s ? t ? r.node(s.depth - 1).type == n ?
|
|
5985
|
+
return s ? t ? r.node(s.depth - 1).type == n ? Na(e, t, n, s) : Ta(e, t, s) : !0 : !1;
|
|
5986
5986
|
};
|
|
5987
5987
|
}
|
|
5988
|
-
function
|
|
5988
|
+
function Na(n, e, t, r) {
|
|
5989
5989
|
let i = n.tr, s = r.end, o = r.$to.end(r.depth);
|
|
5990
5990
|
s < o && (i.step(new L(s - 1, o, s, o, new k(y.from(t.create(null, r.parent.copy())), 1, 0), 1, !0)), r = new nn(i.doc.resolve(r.$from.pos), i.doc.resolve(o), r.depth));
|
|
5991
5991
|
const l = gn(r);
|
|
@@ -5995,7 +5995,7 @@ function Oa(n, e, t, r) {
|
|
|
5995
5995
|
let a = i.mapping.map(s, -1) - 1;
|
|
5996
5996
|
return yn(i.doc, a) && i.join(a), e(i.scrollIntoView()), !0;
|
|
5997
5997
|
}
|
|
5998
|
-
function
|
|
5998
|
+
function Ta(n, e, t) {
|
|
5999
5999
|
let r = n.tr, i = t.parent;
|
|
6000
6000
|
for (let u = t.end, p = t.endIndex - 1, m = t.startIndex; p > m; p--)
|
|
6001
6001
|
u -= i.child(p).nodeSize, r.delete(u - 1, u + 1);
|
|
@@ -6008,7 +6008,7 @@ function Na(n, e, t) {
|
|
|
6008
6008
|
let h = s.pos, d = h + o.nodeSize;
|
|
6009
6009
|
return r.step(new L(h - (l ? 1 : 0), d + (a ? 1 : 0), h + 1, d - 1, new k((l ? y.empty : y.from(i.copy(y.empty))).append(a ? y.empty : y.from(i.copy(y.empty))), l ? 0 : 1, a ? 0 : 1), l ? 0 : 1)), e(r.scrollIntoView()), !0;
|
|
6010
6010
|
}
|
|
6011
|
-
function
|
|
6011
|
+
function Aa(n) {
|
|
6012
6012
|
return function(e, t) {
|
|
6013
6013
|
let { $from: r, $to: i } = e.selection, s = r.blockRange(i, (c) => c.childCount > 0 && c.firstChild.type == n);
|
|
6014
6014
|
if (!s)
|
|
@@ -6038,18 +6038,18 @@ let Qn = null;
|
|
|
6038
6038
|
const ge = function(n, e, t) {
|
|
6039
6039
|
let r = Qn || (Qn = document.createRange());
|
|
6040
6040
|
return r.setEnd(n, t ?? n.nodeValue.length), r.setStart(n, e || 0), r;
|
|
6041
|
-
},
|
|
6041
|
+
}, Da = function() {
|
|
6042
6042
|
Qn = null;
|
|
6043
6043
|
}, _e = function(n, e, t, r) {
|
|
6044
6044
|
return t && (ii(n, e, t, r, -1) || ii(n, e, t, r, 1));
|
|
6045
|
-
},
|
|
6045
|
+
}, Ea = /^(img|br|input|textarea|hr)$/i;
|
|
6046
6046
|
function ii(n, e, t, r, i) {
|
|
6047
6047
|
for (; ; ) {
|
|
6048
6048
|
if (n == t && e == r)
|
|
6049
6049
|
return !0;
|
|
6050
6050
|
if (e == (i < 0 ? 0 : te(n))) {
|
|
6051
6051
|
let s = n.parentNode;
|
|
6052
|
-
if (!s || s.nodeType != 1 ||
|
|
6052
|
+
if (!s || s.nodeType != 1 || zt(n) || Ea.test(n.nodeName) || n.contentEditable == "false")
|
|
6053
6053
|
return !1;
|
|
6054
6054
|
e = V(n) + (i < 0 ? 0 : 1), n = s;
|
|
6055
6055
|
} else if (n.nodeType == 1) {
|
|
@@ -6063,7 +6063,7 @@ function ii(n, e, t, r, i) {
|
|
|
6063
6063
|
function te(n) {
|
|
6064
6064
|
return n.nodeType == 3 ? n.nodeValue.length : n.childNodes.length;
|
|
6065
6065
|
}
|
|
6066
|
-
function
|
|
6066
|
+
function Ra(n, e) {
|
|
6067
6067
|
for (; ; ) {
|
|
6068
6068
|
if (n.nodeType == 3 && e)
|
|
6069
6069
|
return n;
|
|
@@ -6071,13 +6071,13 @@ function Ea(n, e) {
|
|
|
6071
6071
|
if (n.contentEditable == "false")
|
|
6072
6072
|
return null;
|
|
6073
6073
|
n = n.childNodes[e - 1], e = te(n);
|
|
6074
|
-
} else if (n.parentNode && !
|
|
6074
|
+
} else if (n.parentNode && !zt(n))
|
|
6075
6075
|
e = V(n), n = n.parentNode;
|
|
6076
6076
|
else
|
|
6077
6077
|
return null;
|
|
6078
6078
|
}
|
|
6079
6079
|
}
|
|
6080
|
-
function
|
|
6080
|
+
function Ia(n, e) {
|
|
6081
6081
|
for (; ; ) {
|
|
6082
6082
|
if (n.nodeType == 3 && e < n.nodeValue.length)
|
|
6083
6083
|
return n;
|
|
@@ -6085,13 +6085,13 @@ function Ra(n, e) {
|
|
|
6085
6085
|
if (n.contentEditable == "false")
|
|
6086
6086
|
return null;
|
|
6087
6087
|
n = n.childNodes[e], e = 0;
|
|
6088
|
-
} else if (n.parentNode && !
|
|
6088
|
+
} else if (n.parentNode && !zt(n))
|
|
6089
6089
|
e = V(n) + 1, n = n.parentNode;
|
|
6090
6090
|
else
|
|
6091
6091
|
return null;
|
|
6092
6092
|
}
|
|
6093
6093
|
}
|
|
6094
|
-
function
|
|
6094
|
+
function va(n, e, t) {
|
|
6095
6095
|
for (let r = e == 0, i = e == te(n); r || i; ) {
|
|
6096
6096
|
if (n == t)
|
|
6097
6097
|
return !0;
|
|
@@ -6101,7 +6101,7 @@ function Ia(n, e, t) {
|
|
|
6101
6101
|
r = r && s == 0, i = i && s == te(n);
|
|
6102
6102
|
}
|
|
6103
6103
|
}
|
|
6104
|
-
function
|
|
6104
|
+
function zt(n) {
|
|
6105
6105
|
let e;
|
|
6106
6106
|
for (let t = n; t && !(e = t.pmViewDesc); t = t.parentNode)
|
|
6107
6107
|
;
|
|
@@ -6114,7 +6114,7 @@ function Ve(n, e) {
|
|
|
6114
6114
|
let t = document.createEvent("Event");
|
|
6115
6115
|
return t.initEvent("keydown", !0, !0), t.keyCode = n, t.key = t.code = e, t;
|
|
6116
6116
|
}
|
|
6117
|
-
function
|
|
6117
|
+
function Ba(n) {
|
|
6118
6118
|
let e = n.activeElement;
|
|
6119
6119
|
for (; e && e.shadowRoot; )
|
|
6120
6120
|
e = e.shadowRoot.activeElement;
|
|
@@ -6134,10 +6134,10 @@ function za(n, e, t) {
|
|
|
6134
6134
|
return { node: r.startContainer, offset: Math.min(te(r.startContainer), r.startOffset) };
|
|
6135
6135
|
}
|
|
6136
6136
|
}
|
|
6137
|
-
const he = typeof navigator < "u" ? navigator : null, si = typeof document < "u" ? document : null,
|
|
6138
|
-
se && +(/Firefox\/(\d+)/.exec(
|
|
6139
|
-
const nr = !_ && /Chrome\/(\d+)/.exec(
|
|
6140
|
-
function
|
|
6137
|
+
const he = typeof navigator < "u" ? navigator : null, si = typeof document < "u" ? document : null, Be = he && he.userAgent || "", er = /Edge\/(\d+)/.exec(Be), Xs = /MSIE \d/.exec(Be), tr = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Be), _ = !!(Xs || tr || er), Ee = Xs ? document.documentMode : tr ? +tr[1] : er ? +er[1] : 0, se = !_ && /gecko\/(\d+)/i.test(Be);
|
|
6138
|
+
se && +(/Firefox\/(\d+)/.exec(Be) || [0, 0])[1];
|
|
6139
|
+
const nr = !_ && /Chrome\/(\d+)/.exec(Be), W = !!nr, Ys = nr ? +nr[1] : 0, K = !_ && !!he && /Apple Computer/.test(he.vendor), ht = K && (/Mobile\/\w+/.test(Be) || !!he && he.maxTouchPoints > 2), ee = ht || (he ? /Mac/.test(he.platform) : !1), Pa = he ? /Win/.test(he.platform) : !1, re = /Android \d/.test(Be), Pt = !!si && "webkitFontSmoothing" in si.documentElement.style, Va = Pt ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
|
|
6140
|
+
function La(n) {
|
|
6141
6141
|
let e = n.defaultView && n.defaultView.visualViewport;
|
|
6142
6142
|
return e ? {
|
|
6143
6143
|
left: 0,
|
|
@@ -6154,7 +6154,7 @@ function Va(n) {
|
|
|
6154
6154
|
function pe(n, e) {
|
|
6155
6155
|
return typeof n == "number" ? n : n[e];
|
|
6156
6156
|
}
|
|
6157
|
-
function
|
|
6157
|
+
function Fa(n) {
|
|
6158
6158
|
let e = n.getBoundingClientRect(), t = e.width / n.offsetWidth || 1, r = e.height / n.offsetHeight || 1;
|
|
6159
6159
|
return {
|
|
6160
6160
|
left: e.left,
|
|
@@ -6168,7 +6168,7 @@ function oi(n, e, t) {
|
|
|
6168
6168
|
for (let o = t || n.dom; o; o = Et(o)) {
|
|
6169
6169
|
if (o.nodeType != 1)
|
|
6170
6170
|
continue;
|
|
6171
|
-
let l = o, a = l == s.body, c = a ?
|
|
6171
|
+
let l = o, a = l == s.body, c = a ? La(s) : Fa(l), f = 0, h = 0;
|
|
6172
6172
|
if (e.top < c.top + pe(r, "top") ? h = -(c.top - e.top + pe(i, "top")) : e.bottom > c.bottom - pe(r, "bottom") && (h = e.bottom - e.top > c.bottom - c.top ? e.top + pe(i, "top") - c.top : e.bottom - c.bottom + pe(i, "bottom")), e.left < c.left + pe(r, "left") ? f = -(c.left - e.left + pe(i, "left")) : e.right > c.right - pe(r, "right") && (f = e.right - c.right + pe(i, "right")), f || h)
|
|
6173
6173
|
if (a)
|
|
6174
6174
|
s.defaultView.scrollBy(f, h);
|
|
@@ -6182,7 +6182,7 @@ function oi(n, e, t) {
|
|
|
6182
6182
|
break;
|
|
6183
6183
|
}
|
|
6184
6184
|
}
|
|
6185
|
-
function
|
|
6185
|
+
function Ha(n) {
|
|
6186
6186
|
let e = n.dom.getBoundingClientRect(), t = Math.max(0, e.top), r, i;
|
|
6187
6187
|
for (let s = (e.left + e.right) / 2, o = t + 1; o < Math.min(innerHeight, e.bottom); o += 5) {
|
|
6188
6188
|
let l = n.root.elementFromPoint(s, o);
|
|
@@ -6202,7 +6202,7 @@ function Zs(n) {
|
|
|
6202
6202
|
;
|
|
6203
6203
|
return e;
|
|
6204
6204
|
}
|
|
6205
|
-
function
|
|
6205
|
+
function $a({ refDOM: n, refTop: e, stack: t }) {
|
|
6206
6206
|
let r = n ? n.getBoundingClientRect().top : 0;
|
|
6207
6207
|
Qs(t, r == 0 ? 0 : r - e);
|
|
6208
6208
|
}
|
|
@@ -6213,7 +6213,7 @@ function Qs(n, e) {
|
|
|
6213
6213
|
}
|
|
6214
6214
|
}
|
|
6215
6215
|
let Ze = null;
|
|
6216
|
-
function
|
|
6216
|
+
function Wa(n) {
|
|
6217
6217
|
if (n.setActive)
|
|
6218
6218
|
return n.setActive();
|
|
6219
6219
|
if (Ze)
|
|
@@ -6251,9 +6251,9 @@ function eo(n, e) {
|
|
|
6251
6251
|
!t && (e.left >= p.right && e.top >= p.top || e.left >= p.left && e.top >= p.bottom) && (s = h + 1);
|
|
6252
6252
|
}
|
|
6253
6253
|
}
|
|
6254
|
-
return !t && a && (t = a, i = c, r = 0), t && t.nodeType == 3 ?
|
|
6254
|
+
return !t && a && (t = a, i = c, r = 0), t && t.nodeType == 3 ? Ja(t, i) : !t || r && t.nodeType == 1 ? { node: n, offset: s } : eo(t, i);
|
|
6255
6255
|
}
|
|
6256
|
-
function
|
|
6256
|
+
function Ja(n, e) {
|
|
6257
6257
|
let t = n.nodeValue.length, r = document.createRange();
|
|
6258
6258
|
for (let i = 0; i < t; i++) {
|
|
6259
6259
|
r.setEnd(n, i + 1), r.setStart(n, i);
|
|
@@ -6266,11 +6266,11 @@ function Wa(n, e) {
|
|
|
6266
6266
|
function Sr(n, e) {
|
|
6267
6267
|
return n.left >= e.left - 1 && n.left <= e.right + 1 && n.top >= e.top - 1 && n.top <= e.bottom + 1;
|
|
6268
6268
|
}
|
|
6269
|
-
function
|
|
6269
|
+
function qa(n, e) {
|
|
6270
6270
|
let t = n.parentNode;
|
|
6271
6271
|
return t && /^li$/i.test(t.nodeName) && e.left < n.getBoundingClientRect().left ? t : n;
|
|
6272
6272
|
}
|
|
6273
|
-
function
|
|
6273
|
+
function Ka(n, e, t) {
|
|
6274
6274
|
let { node: r, offset: i } = eo(e, t), s = -1;
|
|
6275
6275
|
if (r.nodeType == 1 && !r.firstChild) {
|
|
6276
6276
|
let o = r.getBoundingClientRect();
|
|
@@ -6278,7 +6278,7 @@ function qa(n, e, t) {
|
|
|
6278
6278
|
}
|
|
6279
6279
|
return n.docView.posFromDOM(r, i, s);
|
|
6280
6280
|
}
|
|
6281
|
-
function
|
|
6281
|
+
function ja(n, e, t, r) {
|
|
6282
6282
|
let i = -1;
|
|
6283
6283
|
for (let s = e, o = !1; s != n.dom; ) {
|
|
6284
6284
|
let l = n.docView.nearestDesc(s, !0);
|
|
@@ -6311,7 +6311,7 @@ function to(n, e, t) {
|
|
|
6311
6311
|
}
|
|
6312
6312
|
return n;
|
|
6313
6313
|
}
|
|
6314
|
-
function
|
|
6314
|
+
function Ua(n, e) {
|
|
6315
6315
|
let t = n.dom.ownerDocument, r, i = 0, s = za(t, e.left, e.top);
|
|
6316
6316
|
s && ({ node: r, offset: i } = s);
|
|
6317
6317
|
let o = (n.root.elementFromPoint ? n.root : t).elementFromPoint(e.left, e.top), l;
|
|
@@ -6323,15 +6323,15 @@ function ja(n, e) {
|
|
|
6323
6323
|
if (K)
|
|
6324
6324
|
for (let c = o; r && c; c = Et(c))
|
|
6325
6325
|
c.draggable && (r = void 0);
|
|
6326
|
-
if (o =
|
|
6326
|
+
if (o = qa(o, e), r) {
|
|
6327
6327
|
if (se && r.nodeType == 1 && (i = Math.min(i, r.childNodes.length), i < r.childNodes.length)) {
|
|
6328
6328
|
let f = r.childNodes[i], h;
|
|
6329
6329
|
f.nodeName == "IMG" && (h = f.getBoundingClientRect()).right <= e.left && h.bottom > e.top && i++;
|
|
6330
6330
|
}
|
|
6331
6331
|
let c;
|
|
6332
|
-
Pt && i && r.nodeType == 1 && (c = r.childNodes[i - 1]).nodeType == 1 && c.contentEditable == "false" && c.getBoundingClientRect().top >= e.top && i--, r == n.dom && i == r.childNodes.length - 1 && r.lastChild.nodeType == 1 && e.top > r.lastChild.getBoundingClientRect().bottom ? l = n.state.doc.content.size : (i == 0 || r.nodeType != 1 || r.childNodes[i - 1].nodeName != "BR") && (l =
|
|
6332
|
+
Pt && i && r.nodeType == 1 && (c = r.childNodes[i - 1]).nodeType == 1 && c.contentEditable == "false" && c.getBoundingClientRect().top >= e.top && i--, r == n.dom && i == r.childNodes.length - 1 && r.lastChild.nodeType == 1 && e.top > r.lastChild.getBoundingClientRect().bottom ? l = n.state.doc.content.size : (i == 0 || r.nodeType != 1 || r.childNodes[i - 1].nodeName != "BR") && (l = ja(n, r, i, e));
|
|
6333
6333
|
}
|
|
6334
|
-
l == null && (l =
|
|
6334
|
+
l == null && (l = Ka(n, o, e));
|
|
6335
6335
|
let a = n.docView.nearestDesc(o, !0);
|
|
6336
6336
|
return { pos: l, inside: a ? a.posAtStart - a.border : -1 };
|
|
6337
6337
|
}
|
|
@@ -6347,11 +6347,11 @@ function Ce(n, e) {
|
|
|
6347
6347
|
}
|
|
6348
6348
|
return Array.prototype.find.call(t, li) || n.getBoundingClientRect();
|
|
6349
6349
|
}
|
|
6350
|
-
const
|
|
6350
|
+
const Ga = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;
|
|
6351
6351
|
function no(n, e, t) {
|
|
6352
6352
|
let { node: r, offset: i, atom: s } = n.docView.domFromPos(e, t < 0 ? -1 : 1), o = Pt || se;
|
|
6353
6353
|
if (r.nodeType == 3)
|
|
6354
|
-
if (o && (
|
|
6354
|
+
if (o && (Ga.test(r.nodeValue) || (t < 0 ? !i : i == r.nodeValue.length))) {
|
|
6355
6355
|
let a = Ce(ge(r, i, i), t);
|
|
6356
6356
|
if (se && i && /\s/.test(r.nodeValue[i - 1]) && i < r.nodeValue.length) {
|
|
6357
6357
|
let c = Ce(ge(r, i - 1, i - 1), -1);
|
|
@@ -6415,7 +6415,7 @@ function ro(n, e, t) {
|
|
|
6415
6415
|
r != e && n.updateState(r), i != n.dom && i && i.focus();
|
|
6416
6416
|
}
|
|
6417
6417
|
}
|
|
6418
|
-
function
|
|
6418
|
+
function _a(n, e, t) {
|
|
6419
6419
|
let r = e.selection, i = t == "up" ? r.$from : r.$to;
|
|
6420
6420
|
return ro(n, e, () => {
|
|
6421
6421
|
let { node: s } = n.docView.domFromPos(i.pos, t == "up" ? -1 : 1);
|
|
@@ -6447,13 +6447,13 @@ function Ga(n, e, t) {
|
|
|
6447
6447
|
return !0;
|
|
6448
6448
|
});
|
|
6449
6449
|
}
|
|
6450
|
-
const
|
|
6451
|
-
function
|
|
6450
|
+
const Xa = /[\u0590-\u08ac]/;
|
|
6451
|
+
function Ya(n, e, t) {
|
|
6452
6452
|
let { $head: r } = e.selection;
|
|
6453
6453
|
if (!r.parent.isTextblock)
|
|
6454
6454
|
return !1;
|
|
6455
6455
|
let i = r.parentOffset, s = !i, o = i == r.parent.content.size, l = n.domSelection();
|
|
6456
|
-
return l ? !
|
|
6456
|
+
return l ? !Xa.test(r.parent.textContent) || !l.modify ? t == "left" || t == "backward" ? s : o : ro(n, e, () => {
|
|
6457
6457
|
let { focusNode: a, focusOffset: c, anchorNode: f, anchorOffset: h } = n.domSelectionRange(), d = l.caretBidiLevel;
|
|
6458
6458
|
l.modify("move", t, "character");
|
|
6459
6459
|
let u = r.depth ? n.docView.domAfterPos(r.before()) : n.dom, { focusNode: p, focusOffset: m } = n.domSelectionRange(), g = p && !u.contains(p.nodeType == 1 ? p : p.parentNode) || a == p && c == m;
|
|
@@ -6465,8 +6465,8 @@ function Xa(n, e, t) {
|
|
|
6465
6465
|
}) : r.pos == r.start() || r.pos == r.end();
|
|
6466
6466
|
}
|
|
6467
6467
|
let ai = null, ci = null, fi = !1;
|
|
6468
|
-
function
|
|
6469
|
-
return ai == e && ci == t ? fi : (ai = e, ci = t, fi = t == "up" || t == "down" ?
|
|
6468
|
+
function Za(n, e, t) {
|
|
6469
|
+
return ai == e && ci == t ? fi : (ai = e, ci = t, fi = t == "up" || t == "down" ? _a(n, e, t) : Ya(n, e, t));
|
|
6470
6470
|
}
|
|
6471
6471
|
const ne = 0, hi = 1, Le = 2, de = 3;
|
|
6472
6472
|
class Vt {
|
|
@@ -6844,7 +6844,7 @@ class io extends Vt {
|
|
|
6844
6844
|
return this.widget.type.side;
|
|
6845
6845
|
}
|
|
6846
6846
|
}
|
|
6847
|
-
class
|
|
6847
|
+
class Qa extends Vt {
|
|
6848
6848
|
constructor(e, t, r, i) {
|
|
6849
6849
|
super(e, [], t, null), this.textDOM = r, this.text = i;
|
|
6850
6850
|
}
|
|
@@ -6925,7 +6925,7 @@ class Re extends Vt {
|
|
|
6925
6925
|
} else f || ({ dom: f, contentDOM: h } = Ye.renderSpec(document, t.type.spec.toDOM(t), null, t.attrs));
|
|
6926
6926
|
!h && !t.isText && f.nodeName != "BR" && (f.hasAttribute("contenteditable") || (f.contentEditable = "false"), t.type.spec.draggable && (f.draggable = !0));
|
|
6927
6927
|
let d = f;
|
|
6928
|
-
return f = ao(f, r, t), c ? a = new
|
|
6928
|
+
return f = ao(f, r, t), c ? a = new ec(e, t, r, i, f, h || null, d, c, s, o + 1) : t.isText ? new xn(e, t, r, i, f, d, s) : new Re(e, t, r, i, f, h || null, d, s, o + 1);
|
|
6929
6929
|
}
|
|
6930
6930
|
parseRule() {
|
|
6931
6931
|
if (this.node.type.spec.reparseInView)
|
|
@@ -6961,14 +6961,14 @@ class Re extends Vt {
|
|
|
6961
6961
|
// separate step, syncs the DOM inside `this.contentDOM` to
|
|
6962
6962
|
// `this.children`.
|
|
6963
6963
|
updateChildren(e, t) {
|
|
6964
|
-
let r = this.node.inlineContent, i = t, s = e.composing ? this.localCompositionInfo(e, t) : null, o = s && s.pos > -1 ? s : null, l = s && s.pos < 0, a = new
|
|
6965
|
-
|
|
6964
|
+
let r = this.node.inlineContent, i = t, s = e.composing ? this.localCompositionInfo(e, t) : null, o = s && s.pos > -1 ? s : null, l = s && s.pos < 0, a = new nc(this, o && o.node, e);
|
|
6965
|
+
sc(this.node, this.innerDeco, (c, f, h) => {
|
|
6966
6966
|
c.spec.marks ? a.syncToMarks(c.spec.marks, r, e) : c.type.side >= 0 && !h && a.syncToMarks(f == this.node.childCount ? O.none : this.node.child(f).marks, r, e), a.placeWidget(c, e, i);
|
|
6967
6967
|
}, (c, f, h, d) => {
|
|
6968
6968
|
a.syncToMarks(c.marks, r, e);
|
|
6969
6969
|
let u;
|
|
6970
6970
|
a.findNodeMatch(c, f, h, d) || l && e.state.selection.from > i && e.state.selection.to < i + c.nodeSize && (u = a.findIndexWithChild(s.node)) > -1 && a.updateNodeAt(c, f, h, u, e) || a.updateNextNode(c, f, h, e, d, i) || a.addNode(c, f, h, e, i), i += c.nodeSize;
|
|
6971
|
-
}), a.syncToMarks([], r, e), this.node.isTextblock && a.addTextblockHacks(), a.destroyRest(), (a.changed || this.dirty == Le) && (o && this.protectLocalComposition(e, o), oo(this.contentDOM, this.children, e), ht &&
|
|
6971
|
+
}), a.syncToMarks([], r, e), this.node.isTextblock && a.addTextblockHacks(), a.destroyRest(), (a.changed || this.dirty == Le) && (o && this.protectLocalComposition(e, o), oo(this.contentDOM, this.children, e), ht && oc(this.dom));
|
|
6972
6972
|
}
|
|
6973
6973
|
localCompositionInfo(e, t) {
|
|
6974
6974
|
let { from: r, to: i } = e.state.selection;
|
|
@@ -6978,7 +6978,7 @@ class Re extends Vt {
|
|
|
6978
6978
|
if (!s || !this.dom.contains(s.parentNode))
|
|
6979
6979
|
return null;
|
|
6980
6980
|
if (this.node.inlineContent) {
|
|
6981
|
-
let o = s.nodeValue, l =
|
|
6981
|
+
let o = s.nodeValue, l = lc(this.node.content, o, r - t, i - t);
|
|
6982
6982
|
return l < 0 ? null : { node: s, pos: l, text: o };
|
|
6983
6983
|
} else
|
|
6984
6984
|
return { node: s, pos: -1, text: "" };
|
|
@@ -6994,7 +6994,7 @@ class Re extends Vt {
|
|
|
6994
6994
|
s.parentNode.removeChild(s.nextSibling);
|
|
6995
6995
|
s.pmViewDesc && (s.pmViewDesc = void 0);
|
|
6996
6996
|
}
|
|
6997
|
-
let o = new
|
|
6997
|
+
let o = new Qa(this, s, t, i);
|
|
6998
6998
|
e.input.compositionNodes.push(o), this.children = ir(this.children, r, r + i.length, e, o);
|
|
6999
6999
|
}
|
|
7000
7000
|
// If this desc must be updated to match the given node decoration,
|
|
@@ -7085,7 +7085,7 @@ class so extends Vt {
|
|
|
7085
7085
|
return this.dom.nodeName == "IMG";
|
|
7086
7086
|
}
|
|
7087
7087
|
}
|
|
7088
|
-
class
|
|
7088
|
+
class ec extends Re {
|
|
7089
7089
|
constructor(e, t, r, i, s, o, l, a, c, f) {
|
|
7090
7090
|
super(e, t, r, i, s, o, l, c, f), this.spec = a;
|
|
7091
7091
|
}
|
|
@@ -7169,11 +7169,11 @@ function lo(n, e, t, r) {
|
|
|
7169
7169
|
let a;
|
|
7170
7170
|
l && l.nodeName == o.nodeName && i != n && (a = i.parentNode) && a.nodeName.toLowerCase() == o.nodeName || (a = document.createElement(o.nodeName), a.pmIsDeco = !0, a.appendChild(i), l = Fe[0]), i = a;
|
|
7171
7171
|
}
|
|
7172
|
-
|
|
7172
|
+
tc(i, l || Fe[0], o);
|
|
7173
7173
|
}
|
|
7174
7174
|
return i;
|
|
7175
7175
|
}
|
|
7176
|
-
function
|
|
7176
|
+
function tc(n, e, t) {
|
|
7177
7177
|
for (let r in e)
|
|
7178
7178
|
r != "class" && r != "style" && r != "nodeName" && !(r in t) && n.removeAttribute(r);
|
|
7179
7179
|
for (let r in t)
|
|
@@ -7210,9 +7210,9 @@ function ui(n) {
|
|
|
7210
7210
|
let e = n.nextSibling;
|
|
7211
7211
|
return n.parentNode.removeChild(n), e;
|
|
7212
7212
|
}
|
|
7213
|
-
class
|
|
7213
|
+
class nc {
|
|
7214
7214
|
constructor(e, t, r) {
|
|
7215
|
-
this.lock = t, this.view = r, this.index = 0, this.stack = [], this.changed = !1, this.top = e, this.preMatch =
|
|
7215
|
+
this.lock = t, this.view = r, this.index = 0, this.stack = [], this.changed = !1, this.top = e, this.preMatch = rc(e.node.content, e);
|
|
7216
7216
|
}
|
|
7217
7217
|
// Destroy and remove the children between the given indices in
|
|
7218
7218
|
// `this.top`.
|
|
@@ -7360,7 +7360,7 @@ class tc {
|
|
|
7360
7360
|
return this.lock && (e == this.lock || e.nodeType == 1 && e.contains(this.lock.parentNode));
|
|
7361
7361
|
}
|
|
7362
7362
|
}
|
|
7363
|
-
function
|
|
7363
|
+
function rc(n, e) {
|
|
7364
7364
|
let t = e, r = t.children.length, i = n.childCount, s = /* @__PURE__ */ new Map(), o = [];
|
|
7365
7365
|
e: for (; i > 0; ) {
|
|
7366
7366
|
let l;
|
|
@@ -7387,10 +7387,10 @@ function nc(n, e) {
|
|
|
7387
7387
|
}
|
|
7388
7388
|
return { index: i, matched: s, matches: o.reverse() };
|
|
7389
7389
|
}
|
|
7390
|
-
function
|
|
7390
|
+
function ic(n, e) {
|
|
7391
7391
|
return n.type.side - e.type.side;
|
|
7392
7392
|
}
|
|
7393
|
-
function
|
|
7393
|
+
function sc(n, e, t, r) {
|
|
7394
7394
|
let i = e.locals(n), s = 0;
|
|
7395
7395
|
if (i.length == 0) {
|
|
7396
7396
|
for (let c = 0; c < n.childCount; c++) {
|
|
@@ -7408,7 +7408,7 @@ function ic(n, e, t, r) {
|
|
|
7408
7408
|
}
|
|
7409
7409
|
if (f)
|
|
7410
7410
|
if (h) {
|
|
7411
|
-
h.sort(
|
|
7411
|
+
h.sort(ic);
|
|
7412
7412
|
for (let g = 0; g < h.length; g++)
|
|
7413
7413
|
t(h[g], c, !!a);
|
|
7414
7414
|
} else
|
|
@@ -7438,13 +7438,13 @@ function ic(n, e, t, r) {
|
|
|
7438
7438
|
r(d, m, e.forChild(s, d), u), s = p;
|
|
7439
7439
|
}
|
|
7440
7440
|
}
|
|
7441
|
-
function
|
|
7441
|
+
function oc(n) {
|
|
7442
7442
|
if (n.nodeName == "UL" || n.nodeName == "OL") {
|
|
7443
7443
|
let e = n.style.cssText;
|
|
7444
7444
|
n.style.cssText = e + "; list-style: square !important", window.getComputedStyle(n).listStyle, n.style.cssText = e;
|
|
7445
7445
|
}
|
|
7446
7446
|
}
|
|
7447
|
-
function
|
|
7447
|
+
function lc(n, e, t, r) {
|
|
7448
7448
|
for (let i = 0, s = 0; i < n.childCount && s <= r; ) {
|
|
7449
7449
|
let o = n.child(i++), l = s;
|
|
7450
7450
|
if (s += o.nodeSize, !o.isText)
|
|
@@ -7488,7 +7488,7 @@ function Cr(n, e = null) {
|
|
|
7488
7488
|
for (a = o; i && !i.node; )
|
|
7489
7489
|
i = i.parent;
|
|
7490
7490
|
let h = i.node;
|
|
7491
|
-
if (i && h.isAtom && x.isSelectable(h) && i.parent && !(h.isInline &&
|
|
7491
|
+
if (i && h.isAtom && x.isSelectable(h) && i.parent && !(h.isInline && va(t.focusNode, t.focusOffset, i.dom))) {
|
|
7492
7492
|
let d = i.posBefore;
|
|
7493
7493
|
c = new x(o == d ? l : r.resolve(d));
|
|
7494
7494
|
}
|
|
@@ -7528,10 +7528,10 @@ function be(n, e = !1) {
|
|
|
7528
7528
|
}
|
|
7529
7529
|
}
|
|
7530
7530
|
if (n.domObserver.disconnectSelection(), n.cursorWrapper)
|
|
7531
|
-
|
|
7531
|
+
cc(n);
|
|
7532
7532
|
else {
|
|
7533
7533
|
let { anchor: r, head: i } = t, s, o;
|
|
7534
|
-
pi && !(t instanceof C) && (t.$from.parent.inlineContent || (s = mi(n, t.from)), !t.empty && !t.$from.parent.inlineContent && (o = mi(n, t.to))), n.docView.setSelection(r, i, n, e), pi && (s && gi(s), o && gi(o)), t.visible ? n.dom.classList.remove("ProseMirror-hideselection") : (n.dom.classList.add("ProseMirror-hideselection"), "onselectionchange" in document &&
|
|
7534
|
+
pi && !(t instanceof C) && (t.$from.parent.inlineContent || (s = mi(n, t.from)), !t.empty && !t.$from.parent.inlineContent && (o = mi(n, t.to))), n.docView.setSelection(r, i, n, e), pi && (s && gi(s), o && gi(o)), t.visible ? n.dom.classList.remove("ProseMirror-hideselection") : (n.dom.classList.add("ProseMirror-hideselection"), "onselectionchange" in document && ac(n));
|
|
7535
7535
|
}
|
|
7536
7536
|
n.domObserver.setCurSelection(), n.domObserver.connectSelection();
|
|
7537
7537
|
}
|
|
@@ -7554,7 +7554,7 @@ function Hn(n) {
|
|
|
7554
7554
|
function gi(n) {
|
|
7555
7555
|
n.contentEditable = "false", n.wasDraggable && (n.draggable = !0, n.wasDraggable = null);
|
|
7556
7556
|
}
|
|
7557
|
-
function
|
|
7557
|
+
function ac(n) {
|
|
7558
7558
|
let e = n.dom.ownerDocument;
|
|
7559
7559
|
e.removeEventListener("selectionchange", n.input.hideSelectionGuard);
|
|
7560
7560
|
let t = n.domSelectionRange(), r = t.anchorNode, i = t.anchorOffset;
|
|
@@ -7564,7 +7564,7 @@ function lc(n) {
|
|
|
7564
7564
|
}, 20));
|
|
7565
7565
|
});
|
|
7566
7566
|
}
|
|
7567
|
-
function
|
|
7567
|
+
function cc(n) {
|
|
7568
7568
|
let e = n.domSelection(), t = document.createRange();
|
|
7569
7569
|
if (!e)
|
|
7570
7570
|
return;
|
|
@@ -7597,7 +7597,7 @@ function ho(n) {
|
|
|
7597
7597
|
return !1;
|
|
7598
7598
|
}
|
|
7599
7599
|
}
|
|
7600
|
-
function
|
|
7600
|
+
function fc(n) {
|
|
7601
7601
|
let e = n.docView.domFromPos(n.state.selection.anchor, 0), t = n.domSelectionRange();
|
|
7602
7602
|
return _e(e.node, e.offset, t.anchorNode, t.anchorOffset);
|
|
7603
7603
|
}
|
|
@@ -7646,9 +7646,9 @@ function Ot(n, e) {
|
|
|
7646
7646
|
return t && t.size == 0 && (e < 0 || n.nextSibling || n.nodeName != "BR");
|
|
7647
7647
|
}
|
|
7648
7648
|
function Qe(n, e) {
|
|
7649
|
-
return e < 0 ?
|
|
7649
|
+
return e < 0 ? hc(n) : dc(n);
|
|
7650
7650
|
}
|
|
7651
|
-
function
|
|
7651
|
+
function hc(n) {
|
|
7652
7652
|
let e = n.domSelectionRange(), t = e.focusNode, r = e.focusOffset;
|
|
7653
7653
|
if (!t)
|
|
7654
7654
|
return;
|
|
@@ -7684,7 +7684,7 @@ function fc(n) {
|
|
|
7684
7684
|
}
|
|
7685
7685
|
o ? or(n, t, r) : i && or(n, i, s);
|
|
7686
7686
|
}
|
|
7687
|
-
function
|
|
7687
|
+
function dc(n) {
|
|
7688
7688
|
let e = n.domSelectionRange(), t = e.focusNode, r = e.focusOffset;
|
|
7689
7689
|
if (!t)
|
|
7690
7690
|
return;
|
|
@@ -7720,8 +7720,8 @@ function uo(n) {
|
|
|
7720
7720
|
let e = n.pmViewDesc;
|
|
7721
7721
|
return e && e.node && e.node.isBlock;
|
|
7722
7722
|
}
|
|
7723
|
-
function
|
|
7724
|
-
for (; n && e == n.childNodes.length && !
|
|
7723
|
+
function uc(n, e) {
|
|
7724
|
+
for (; n && e == n.childNodes.length && !zt(n); )
|
|
7725
7725
|
e = V(n) + 1, n = n.parentNode;
|
|
7726
7726
|
for (; n && e < n.childNodes.length; ) {
|
|
7727
7727
|
let t = n.childNodes[e];
|
|
@@ -7732,8 +7732,8 @@ function dc(n, e) {
|
|
|
7732
7732
|
n = t, e = 0;
|
|
7733
7733
|
}
|
|
7734
7734
|
}
|
|
7735
|
-
function
|
|
7736
|
-
for (; n && !e && !
|
|
7735
|
+
function pc(n, e) {
|
|
7736
|
+
for (; n && !e && !zt(n); )
|
|
7737
7737
|
e = V(n), n = n.parentNode;
|
|
7738
7738
|
for (; n && e; ) {
|
|
7739
7739
|
let t = n.childNodes[e - 1];
|
|
@@ -7747,7 +7747,7 @@ function uc(n, e) {
|
|
|
7747
7747
|
function or(n, e, t) {
|
|
7748
7748
|
if (e.nodeType != 3) {
|
|
7749
7749
|
let s, o;
|
|
7750
|
-
(o =
|
|
7750
|
+
(o = uc(e, t)) ? (e = o, t = 0) : (s = pc(e, t)) && (e = s, t = s.nodeValue.length);
|
|
7751
7751
|
}
|
|
7752
7752
|
let r = n.domSelection();
|
|
7753
7753
|
if (!r)
|
|
@@ -7764,7 +7764,7 @@ function or(n, e, t) {
|
|
|
7764
7764
|
}
|
|
7765
7765
|
function xi(n, e) {
|
|
7766
7766
|
let t = n.state.doc.resolve(e);
|
|
7767
|
-
if (!(W ||
|
|
7767
|
+
if (!(W || Pa) && t.parent.inlineContent) {
|
|
7768
7768
|
let i = n.coordsAtPos(e);
|
|
7769
7769
|
if (e > t.start()) {
|
|
7770
7770
|
let s = n.coordsAtPos(e - 1), o = (s.top + s.bottom) / 2;
|
|
@@ -7815,7 +7815,7 @@ function Ci(n, e) {
|
|
|
7815
7815
|
function wi(n, e, t) {
|
|
7816
7816
|
n.domObserver.stop(), e.contentEditable = t, n.domObserver.start();
|
|
7817
7817
|
}
|
|
7818
|
-
function
|
|
7818
|
+
function mc(n) {
|
|
7819
7819
|
if (!K || n.state.selection.$head.parentOffset > 0)
|
|
7820
7820
|
return !1;
|
|
7821
7821
|
let { focusNode: e, focusOffset: t } = n.domSelectionRange();
|
|
@@ -7825,12 +7825,12 @@ function pc(n) {
|
|
|
7825
7825
|
}
|
|
7826
7826
|
return !1;
|
|
7827
7827
|
}
|
|
7828
|
-
function
|
|
7828
|
+
function gc(n) {
|
|
7829
7829
|
let e = "";
|
|
7830
7830
|
return n.ctrlKey && (e += "c"), n.metaKey && (e += "m"), n.altKey && (e += "a"), n.shiftKey && (e += "s"), e;
|
|
7831
7831
|
}
|
|
7832
|
-
function
|
|
7833
|
-
let t = e.keyCode, r =
|
|
7832
|
+
function yc(n, e) {
|
|
7833
|
+
let t = e.keyCode, r = gc(e);
|
|
7834
7834
|
if (t == 8 || ee && t == 72 && r == "c")
|
|
7835
7835
|
return Ci(n, -1) || Qe(n, -1);
|
|
7836
7836
|
if (t == 46 && !e.shiftKey || ee && t == 68 && r == "c")
|
|
@@ -7847,7 +7847,7 @@ function gc(n, e) {
|
|
|
7847
7847
|
if (t == 38 || ee && t == 80 && r == "c")
|
|
7848
7848
|
return Si(n, -1, r) || Qe(n, -1);
|
|
7849
7849
|
if (t == 40 || ee && t == 78 && r == "c")
|
|
7850
|
-
return
|
|
7850
|
+
return mc(n) || Si(n, 1, r) || Qe(n, 1);
|
|
7851
7851
|
if (r == (ee ? "m" : "c") && (t == 66 || t == 73 || t == 89 || t == 90))
|
|
7852
7852
|
return !0;
|
|
7853
7853
|
}
|
|
@@ -7905,7 +7905,7 @@ function mo(n, e, t, r, i) {
|
|
|
7905
7905
|
} else
|
|
7906
7906
|
n.someProp("transformPastedHTML", (h) => {
|
|
7907
7907
|
t = h(t, n);
|
|
7908
|
-
}), o =
|
|
7908
|
+
}), o = Sc(t), Pt && Cc(o);
|
|
7909
7909
|
let c = o && o.querySelector("[data-pm-slice]"), f = c && /^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice") || "");
|
|
7910
7910
|
if (f && f[3])
|
|
7911
7911
|
for (let h = +f[3]; h > 0; h--) {
|
|
@@ -7920,11 +7920,11 @@ function mo(n, e, t, r, i) {
|
|
|
7920
7920
|
preserveWhitespace: !!(a || f),
|
|
7921
7921
|
context: i,
|
|
7922
7922
|
ruleFromNode(d) {
|
|
7923
|
-
return d.nodeName == "BR" && !d.nextSibling && d.parentNode && !
|
|
7923
|
+
return d.nodeName == "BR" && !d.nextSibling && d.parentNode && !bc.test(d.parentNode.nodeName) ? { ignore: !0 } : null;
|
|
7924
7924
|
}
|
|
7925
7925
|
})), f)
|
|
7926
|
-
l =
|
|
7927
|
-
else if (l = k.maxOpen(
|
|
7926
|
+
l = wc(Mi(l, +f[1], +f[2]), f[4]);
|
|
7927
|
+
else if (l = k.maxOpen(kc(l.content, i), !0), l.openStart || l.openEnd) {
|
|
7928
7928
|
let h = 0, d = 0;
|
|
7929
7929
|
for (let u = l.content.firstChild; h < l.openStart && !u.type.spec.isolating; h++, u = u.firstChild)
|
|
7930
7930
|
;
|
|
@@ -7936,8 +7936,8 @@ function mo(n, e, t, r, i) {
|
|
|
7936
7936
|
l = h(l, n);
|
|
7937
7937
|
}), l;
|
|
7938
7938
|
}
|
|
7939
|
-
const
|
|
7940
|
-
function
|
|
7939
|
+
const bc = /^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;
|
|
7940
|
+
function kc(n, e) {
|
|
7941
7941
|
if (n.childCount < 2)
|
|
7942
7942
|
return n;
|
|
7943
7943
|
for (let t = e.depth; t >= 0; t--) {
|
|
@@ -8003,27 +8003,27 @@ function xo() {
|
|
|
8003
8003
|
return Oi || (Oi = document.implementation.createHTMLDocument("title"));
|
|
8004
8004
|
}
|
|
8005
8005
|
let $n = null;
|
|
8006
|
-
function
|
|
8006
|
+
function xc(n) {
|
|
8007
8007
|
let e = window.trustedTypes;
|
|
8008
8008
|
return e ? ($n || ($n = e.createPolicy("ProseMirrorClipboard", { createHTML: (t) => t })), $n.createHTML(n)) : n;
|
|
8009
8009
|
}
|
|
8010
|
-
function
|
|
8010
|
+
function Sc(n) {
|
|
8011
8011
|
let e = /^(\s*<meta [^>]*>)*/.exec(n);
|
|
8012
8012
|
e && (n = n.slice(e[0].length));
|
|
8013
8013
|
let t = xo().createElement("div"), r = /<([a-z][^>\s]+)/i.exec(n), i;
|
|
8014
|
-
if ((i = r && ko[r[1].toLowerCase()]) && (n = i.map((s) => "<" + s + ">").join("") + n + i.map((s) => "</" + s + ">").reverse().join("")), t.innerHTML =
|
|
8014
|
+
if ((i = r && ko[r[1].toLowerCase()]) && (n = i.map((s) => "<" + s + ">").join("") + n + i.map((s) => "</" + s + ">").reverse().join("")), t.innerHTML = xc(n), i)
|
|
8015
8015
|
for (let s = 0; s < i.length; s++)
|
|
8016
8016
|
t = t.querySelector(i[s]) || t;
|
|
8017
8017
|
return t;
|
|
8018
8018
|
}
|
|
8019
|
-
function
|
|
8019
|
+
function Cc(n) {
|
|
8020
8020
|
let e = n.querySelectorAll(W ? "span:not([class]):not([style])" : "span.Apple-converted-space");
|
|
8021
8021
|
for (let t = 0; t < e.length; t++) {
|
|
8022
8022
|
let r = e[t];
|
|
8023
8023
|
r.childNodes.length == 1 && r.textContent == " " && r.parentNode && r.parentNode.replaceChild(n.ownerDocument.createTextNode(" "), r);
|
|
8024
8024
|
}
|
|
8025
8025
|
}
|
|
8026
|
-
function
|
|
8026
|
+
function wc(n, e) {
|
|
8027
8027
|
if (!n.size)
|
|
8028
8028
|
return n;
|
|
8029
8029
|
let t = n.content.firstChild.type.schema, r;
|
|
@@ -8041,25 +8041,25 @@ function Cc(n, e) {
|
|
|
8041
8041
|
}
|
|
8042
8042
|
return new k(i, s, o);
|
|
8043
8043
|
}
|
|
8044
|
-
const j = {}, U = {},
|
|
8045
|
-
class
|
|
8044
|
+
const j = {}, U = {}, Mc = { touchstart: !0, touchmove: !0 };
|
|
8045
|
+
class Oc {
|
|
8046
8046
|
constructor() {
|
|
8047
8047
|
this.shiftKey = !1, this.mouseDown = null, this.lastKeyCode = null, this.lastKeyCodeTime = 0, this.lastClick = { time: 0, x: 0, y: 0, type: "" }, this.lastSelectionOrigin = null, this.lastSelectionTime = 0, this.lastIOSEnter = 0, this.lastIOSEnterFallbackTimeout = -1, this.lastFocus = 0, this.lastTouch = 0, this.lastAndroidDelete = 0, this.composing = !1, this.compositionNode = null, this.composingTimeout = -1, this.compositionNodes = [], this.compositionEndedAt = -2e8, this.compositionID = 1, this.compositionPendingChanges = 0, this.domChangeCount = 0, this.eventHandlers = /* @__PURE__ */ Object.create(null), this.hideSelectionGuard = null;
|
|
8048
8048
|
}
|
|
8049
8049
|
}
|
|
8050
|
-
function
|
|
8050
|
+
function Nc(n) {
|
|
8051
8051
|
for (let e in j) {
|
|
8052
8052
|
let t = j[e];
|
|
8053
8053
|
n.dom.addEventListener(e, n.input.eventHandlers[e] = (r) => {
|
|
8054
|
-
|
|
8055
|
-
},
|
|
8054
|
+
Ac(n, r) && !Mr(n, r) && (n.editable || !(r.type in U)) && t(n, r);
|
|
8055
|
+
}, Mc[e] ? { passive: !0 } : void 0);
|
|
8056
8056
|
}
|
|
8057
8057
|
K && n.dom.addEventListener("input", () => null), ar(n);
|
|
8058
8058
|
}
|
|
8059
8059
|
function De(n, e) {
|
|
8060
8060
|
n.input.lastSelectionOrigin = e, n.input.lastSelectionTime = Date.now();
|
|
8061
8061
|
}
|
|
8062
|
-
function
|
|
8062
|
+
function Tc(n) {
|
|
8063
8063
|
n.domObserver.stop();
|
|
8064
8064
|
for (let e in n.input.eventHandlers)
|
|
8065
8065
|
n.dom.removeEventListener(e, n.input.eventHandlers[e]);
|
|
@@ -8077,7 +8077,7 @@ function Mr(n, e) {
|
|
|
8077
8077
|
return r ? r(n, e) || e.defaultPrevented : !1;
|
|
8078
8078
|
});
|
|
8079
8079
|
}
|
|
8080
|
-
function
|
|
8080
|
+
function Ac(n, e) {
|
|
8081
8081
|
if (!e.bubbles)
|
|
8082
8082
|
return !0;
|
|
8083
8083
|
if (e.defaultPrevented)
|
|
@@ -8087,7 +8087,7 @@ function Tc(n, e) {
|
|
|
8087
8087
|
return !1;
|
|
8088
8088
|
return !0;
|
|
8089
8089
|
}
|
|
8090
|
-
function
|
|
8090
|
+
function Dc(n, e) {
|
|
8091
8091
|
!Mr(n, e) && j[e.type] && (n.editable || !(e.type in U)) && j[e.type](n, e);
|
|
8092
8092
|
}
|
|
8093
8093
|
U.keydown = (n, e) => {
|
|
@@ -8098,7 +8098,7 @@ U.keydown = (n, e) => {
|
|
|
8098
8098
|
n.input.lastIOSEnter = r, n.input.lastIOSEnterFallbackTimeout = setTimeout(() => {
|
|
8099
8099
|
n.input.lastIOSEnter == r && (n.someProp("handleKeyDown", (i) => i(n, Ve(13, "Enter"))), n.input.lastIOSEnter = 0);
|
|
8100
8100
|
}, 200);
|
|
8101
|
-
} else n.someProp("handleKeyDown", (r) => r(n, t)) ||
|
|
8101
|
+
} else n.someProp("handleKeyDown", (r) => r(n, t)) || yc(n, t) ? t.preventDefault() : De(n, "key");
|
|
8102
8102
|
};
|
|
8103
8103
|
U.keyup = (n, e) => {
|
|
8104
8104
|
e.keyCode == 16 && (n.input.shiftKey = !1);
|
|
@@ -8120,7 +8120,7 @@ U.keypress = (n, e) => {
|
|
|
8120
8120
|
function Sn(n) {
|
|
8121
8121
|
return { left: n.clientX, top: n.clientY };
|
|
8122
8122
|
}
|
|
8123
|
-
function
|
|
8123
|
+
function Ec(n, e) {
|
|
8124
8124
|
let t = e.x - n.clientX, r = e.y - n.clientY;
|
|
8125
8125
|
return t * t + r * r < 100;
|
|
8126
8126
|
}
|
|
@@ -8139,13 +8139,13 @@ function lt(n, e, t) {
|
|
|
8139
8139
|
let r = n.state.tr.setSelection(e);
|
|
8140
8140
|
r.setMeta("pointer", !0), n.dispatch(r);
|
|
8141
8141
|
}
|
|
8142
|
-
function
|
|
8142
|
+
function Rc(n, e) {
|
|
8143
8143
|
if (e == -1)
|
|
8144
8144
|
return !1;
|
|
8145
8145
|
let t = n.state.doc.resolve(e), r = t.nodeAfter;
|
|
8146
8146
|
return r && r.isAtom && x.isSelectable(r) ? (lt(n, new x(t)), !0) : !1;
|
|
8147
8147
|
}
|
|
8148
|
-
function
|
|
8148
|
+
function Ic(n, e) {
|
|
8149
8149
|
if (e == -1)
|
|
8150
8150
|
return !1;
|
|
8151
8151
|
let t = n.state.selection, r, i;
|
|
@@ -8160,16 +8160,16 @@ function Rc(n, e) {
|
|
|
8160
8160
|
}
|
|
8161
8161
|
return i != null ? (lt(n, x.create(n.state.doc, i)), !0) : !1;
|
|
8162
8162
|
}
|
|
8163
|
-
function
|
|
8164
|
-
return Or(n, "handleClickOn", e, t, r) || n.someProp("handleClick", (s) => s(n, e, r)) || (i ?
|
|
8163
|
+
function vc(n, e, t, r, i) {
|
|
8164
|
+
return Or(n, "handleClickOn", e, t, r) || n.someProp("handleClick", (s) => s(n, e, r)) || (i ? Ic(n, t) : Rc(n, t));
|
|
8165
8165
|
}
|
|
8166
|
-
function
|
|
8166
|
+
function Bc(n, e, t, r) {
|
|
8167
8167
|
return Or(n, "handleDoubleClickOn", e, t, r) || n.someProp("handleDoubleClick", (i) => i(n, e, r));
|
|
8168
8168
|
}
|
|
8169
8169
|
function zc(n, e, t, r) {
|
|
8170
|
-
return Or(n, "handleTripleClickOn", e, t, r) || n.someProp("handleTripleClick", (i) => i(n, e, r)) ||
|
|
8170
|
+
return Or(n, "handleTripleClickOn", e, t, r) || n.someProp("handleTripleClick", (i) => i(n, e, r)) || Pc(n, t, r);
|
|
8171
8171
|
}
|
|
8172
|
-
function
|
|
8172
|
+
function Pc(n, e, t) {
|
|
8173
8173
|
if (t.button != 0)
|
|
8174
8174
|
return !1;
|
|
8175
8175
|
let r = n.state.doc;
|
|
@@ -8195,11 +8195,11 @@ j.mousedown = (n, e) => {
|
|
|
8195
8195
|
let t = e;
|
|
8196
8196
|
n.input.shiftKey = t.shiftKey;
|
|
8197
8197
|
let r = Nr(n), i = Date.now(), s = "singleClick";
|
|
8198
|
-
i - n.input.lastClick.time < 500 &&
|
|
8198
|
+
i - n.input.lastClick.time < 500 && Ec(t, n.input.lastClick) && !t[So] && (n.input.lastClick.type == "singleClick" ? s = "doubleClick" : n.input.lastClick.type == "doubleClick" && (s = "tripleClick")), n.input.lastClick = { time: i, x: t.clientX, y: t.clientY, type: s };
|
|
8199
8199
|
let o = n.posAtCoords(Sn(t));
|
|
8200
|
-
o && (s == "singleClick" ? (n.input.mouseDown && n.input.mouseDown.done(), n.input.mouseDown = new
|
|
8200
|
+
o && (s == "singleClick" ? (n.input.mouseDown && n.input.mouseDown.done(), n.input.mouseDown = new Vc(n, o, t, !!r)) : (s == "doubleClick" ? Bc : zc)(n, o.pos, o.inside, t) ? t.preventDefault() : De(n, "pointer"));
|
|
8201
8201
|
};
|
|
8202
|
-
class
|
|
8202
|
+
class Vc {
|
|
8203
8203
|
constructor(e, t, r, i) {
|
|
8204
8204
|
this.view = e, this.pos = t, this.event = r, this.flushed = i, this.delayedSelectionSync = !1, this.mightDrag = null, this.startDoc = e.state.doc, this.selectNode = !!r[So], this.allowDefault = r.shiftKey;
|
|
8205
8205
|
let s, o;
|
|
@@ -8228,7 +8228,7 @@ class Pc {
|
|
|
8228
8228
|
if (this.done(), !this.view.dom.contains(e.target))
|
|
8229
8229
|
return;
|
|
8230
8230
|
let t = this.pos;
|
|
8231
|
-
this.view.state.doc != this.startDoc && (t = this.view.posAtCoords(Sn(e))), this.updateAllowDefault(e), this.allowDefault || !t ? De(this.view, "pointer") :
|
|
8231
|
+
this.view.state.doc != this.startDoc && (t = this.view.posAtCoords(Sn(e))), this.updateAllowDefault(e), this.allowDefault || !t ? De(this.view, "pointer") : vc(this.view, t.pos, t.inside, e, this.selectNode) ? e.preventDefault() : e.button == 0 && (this.flushed || // Safari ignores clicks on draggable elements
|
|
8232
8232
|
K && this.mightDrag && !this.mightDrag.node.isAtom || // Chrome will sometimes treat a node selection as a
|
|
8233
8233
|
// cursor, but still report that the node is selected
|
|
8234
8234
|
// when asked through getSelection. You'll then get a
|
|
@@ -8255,7 +8255,7 @@ j.contextmenu = (n) => Nr(n);
|
|
|
8255
8255
|
function Co(n, e) {
|
|
8256
8256
|
return n.composing ? !0 : K && Math.abs(e.timeStamp - n.input.compositionEndedAt) < 500 ? (n.input.compositionEndedAt = -2e8, !0) : !1;
|
|
8257
8257
|
}
|
|
8258
|
-
const
|
|
8258
|
+
const Lc = re ? 5e3 : -1;
|
|
8259
8259
|
U.compositionstart = U.compositionupdate = (n) => {
|
|
8260
8260
|
if (!n.composing) {
|
|
8261
8261
|
n.domObserver.flush();
|
|
@@ -8278,7 +8278,7 @@ U.compositionstart = U.compositionupdate = (n) => {
|
|
|
8278
8278
|
}
|
|
8279
8279
|
n.input.composing = !0;
|
|
8280
8280
|
}
|
|
8281
|
-
wo(n,
|
|
8281
|
+
wo(n, Lc);
|
|
8282
8282
|
};
|
|
8283
8283
|
U.compositionend = (n, e) => {
|
|
8284
8284
|
n.composing && (n.input.composing = !1, n.input.compositionEndedAt = e.timeStamp, n.input.compositionPendingChanges = n.domObserver.pendingRecords().length ? n.input.compositionID : 0, n.input.compositionNode = null, n.input.compositionPendingChanges && Promise.resolve().then(() => n.domObserver.flush()), n.input.compositionID++, wo(n, 20));
|
|
@@ -8287,14 +8287,14 @@ function wo(n, e) {
|
|
|
8287
8287
|
clearTimeout(n.input.composingTimeout), e > -1 && (n.input.composingTimeout = setTimeout(() => hn(n), e));
|
|
8288
8288
|
}
|
|
8289
8289
|
function Mo(n) {
|
|
8290
|
-
for (n.composing && (n.input.composing = !1, n.input.compositionEndedAt =
|
|
8290
|
+
for (n.composing && (n.input.composing = !1, n.input.compositionEndedAt = Hc()); n.input.compositionNodes.length > 0; )
|
|
8291
8291
|
n.input.compositionNodes.pop().markParentsDirty();
|
|
8292
8292
|
}
|
|
8293
|
-
function
|
|
8293
|
+
function Fc(n) {
|
|
8294
8294
|
let e = n.domSelectionRange();
|
|
8295
8295
|
if (!e.focusNode)
|
|
8296
8296
|
return null;
|
|
8297
|
-
let t =
|
|
8297
|
+
let t = Ra(e.focusNode, e.focusOffset), r = Ia(e.focusNode, e.focusOffset);
|
|
8298
8298
|
if (t && r && t != r) {
|
|
8299
8299
|
let i = r.pmViewDesc, s = n.domObserver.lastChangedTextNode;
|
|
8300
8300
|
if (t == s || r == s)
|
|
@@ -8309,7 +8309,7 @@ function Lc(n) {
|
|
|
8309
8309
|
}
|
|
8310
8310
|
return t || r;
|
|
8311
8311
|
}
|
|
8312
|
-
function
|
|
8312
|
+
function Hc() {
|
|
8313
8313
|
let n = document.createEvent("Event");
|
|
8314
8314
|
return n.initEvent("event", !0, !0), n.timeStamp;
|
|
8315
8315
|
}
|
|
@@ -8322,7 +8322,7 @@ function hn(n, e = !1) {
|
|
|
8322
8322
|
return !1;
|
|
8323
8323
|
}
|
|
8324
8324
|
}
|
|
8325
|
-
function
|
|
8325
|
+
function $c(n, e) {
|
|
8326
8326
|
if (!n.dom.parentNode)
|
|
8327
8327
|
return;
|
|
8328
8328
|
let t = n.dom.parentNode.appendChild(document.createElement("div"));
|
|
@@ -8332,18 +8332,18 @@ function Hc(n, e) {
|
|
|
8332
8332
|
t.parentNode && t.parentNode.removeChild(t), n.focus();
|
|
8333
8333
|
}, 50);
|
|
8334
8334
|
}
|
|
8335
|
-
const Rt = _ && Ee < 15 || ht &&
|
|
8335
|
+
const Rt = _ && Ee < 15 || ht && Va < 604;
|
|
8336
8336
|
j.copy = U.cut = (n, e) => {
|
|
8337
8337
|
let t = e, r = n.state.selection, i = t.type == "cut";
|
|
8338
8338
|
if (r.empty)
|
|
8339
8339
|
return;
|
|
8340
8340
|
let s = Rt ? null : t.clipboardData, o = r.content(), { dom: l, text: a } = po(n, o);
|
|
8341
|
-
s ? (t.preventDefault(), s.clearData(), s.setData("text/html", l.innerHTML), s.setData("text/plain", a)) :
|
|
8341
|
+
s ? (t.preventDefault(), s.clearData(), s.setData("text/html", l.innerHTML), s.setData("text/plain", a)) : $c(n, l), i && n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent", "cut"));
|
|
8342
8342
|
};
|
|
8343
|
-
function
|
|
8343
|
+
function Wc(n) {
|
|
8344
8344
|
return n.openStart == 0 && n.openEnd == 0 && n.content.childCount == 1 ? n.content.firstChild : null;
|
|
8345
8345
|
}
|
|
8346
|
-
function
|
|
8346
|
+
function Jc(n, e) {
|
|
8347
8347
|
if (!n.dom.parentNode)
|
|
8348
8348
|
return;
|
|
8349
8349
|
let t = n.input.shiftKey || n.state.selection.$from.parent.type.spec.code, r = n.dom.parentNode.appendChild(document.createElement(t ? "textarea" : "div"));
|
|
@@ -8359,7 +8359,7 @@ function It(n, e, t, r, i) {
|
|
|
8359
8359
|
return !0;
|
|
8360
8360
|
if (!s)
|
|
8361
8361
|
return !1;
|
|
8362
|
-
let o =
|
|
8362
|
+
let o = Wc(s), l = o ? n.state.tr.replaceSelectionWith(o, r) : n.state.tr.replaceSelection(s);
|
|
8363
8363
|
return n.dispatch(l.scrollIntoView().setMeta("paste", !0).setMeta("uiEvent", "paste")), !0;
|
|
8364
8364
|
}
|
|
8365
8365
|
function Oo(n) {
|
|
@@ -8374,7 +8374,7 @@ U.paste = (n, e) => {
|
|
|
8374
8374
|
if (n.composing && !re)
|
|
8375
8375
|
return;
|
|
8376
8376
|
let r = Rt ? null : t.clipboardData, i = n.input.shiftKey && n.input.lastKeyCode != 45;
|
|
8377
|
-
r && It(n, Oo(r), r.getData("text/html"), i, t) ? t.preventDefault() :
|
|
8377
|
+
r && It(n, Oo(r), r.getData("text/html"), i, t) ? t.preventDefault() : Jc(n, t);
|
|
8378
8378
|
};
|
|
8379
8379
|
class No {
|
|
8380
8380
|
constructor(e, t, r) {
|
|
@@ -8424,7 +8424,7 @@ U.drop = (n, e) => {
|
|
|
8424
8424
|
if (!o)
|
|
8425
8425
|
return;
|
|
8426
8426
|
t.preventDefault();
|
|
8427
|
-
let a = o ?
|
|
8427
|
+
let a = o ? Vl(n.state.doc, s.pos, o) : s.pos;
|
|
8428
8428
|
a == null && (a = s.pos);
|
|
8429
8429
|
let c = n.state.tr;
|
|
8430
8430
|
if (l) {
|
|
@@ -8662,7 +8662,7 @@ class T {
|
|
|
8662
8662
|
let a = this.local[l].map(e, r, i);
|
|
8663
8663
|
a && a.type.valid(t, a) ? (o || (o = [])).push(a) : s.onRemove && s.onRemove(this.local[l].spec);
|
|
8664
8664
|
}
|
|
8665
|
-
return this.children.length ?
|
|
8665
|
+
return this.children.length ? qc(this.children, o || [], e, t, r, i, s) : o ? new T(o.sort(je), tt) : H;
|
|
8666
8666
|
}
|
|
8667
8667
|
/**
|
|
8668
8668
|
Add the given array of decorations to the ones in the set,
|
|
@@ -8840,7 +8840,7 @@ class Oe {
|
|
|
8840
8840
|
this.members[t].forEachSet(e);
|
|
8841
8841
|
}
|
|
8842
8842
|
}
|
|
8843
|
-
function
|
|
8843
|
+
function qc(n, e, t, r, i, s, o) {
|
|
8844
8844
|
let l = n.slice();
|
|
8845
8845
|
for (let c = 0, f = s; c < t.maps.length; c++) {
|
|
8846
8846
|
let h = 0;
|
|
@@ -8876,7 +8876,7 @@ function Jc(n, e, t, r, i, s, o) {
|
|
|
8876
8876
|
a = !0;
|
|
8877
8877
|
}
|
|
8878
8878
|
if (a) {
|
|
8879
|
-
let c =
|
|
8879
|
+
let c = Kc(l, n, e, t, i, s, o), f = un(c, r, 0, o);
|
|
8880
8880
|
e = f.local;
|
|
8881
8881
|
for (let h = 0; h < l.length; h += 3)
|
|
8882
8882
|
l[h + 1] < 0 && (l.splice(h, 3), h -= 3);
|
|
@@ -8899,7 +8899,7 @@ function Ao(n, e) {
|
|
|
8899
8899
|
}
|
|
8900
8900
|
return t;
|
|
8901
8901
|
}
|
|
8902
|
-
function
|
|
8902
|
+
function Kc(n, e, t, r, i, s, o) {
|
|
8903
8903
|
function l(a, c) {
|
|
8904
8904
|
for (let f = 0; f < a.local.length; f++) {
|
|
8905
8905
|
let h = a.local[f].map(r, i, c);
|
|
@@ -8974,15 +8974,15 @@ function Wn(n) {
|
|
|
8974
8974
|
r && r != H && e.push(r);
|
|
8975
8975
|
}), n.cursorWrapper && e.push(T.create(n.state.doc, [n.cursorWrapper.deco])), Oe.from(e);
|
|
8976
8976
|
}
|
|
8977
|
-
const
|
|
8977
|
+
const jc = {
|
|
8978
8978
|
childList: !0,
|
|
8979
8979
|
characterData: !0,
|
|
8980
8980
|
characterDataOldValue: !0,
|
|
8981
8981
|
attributes: !0,
|
|
8982
8982
|
attributeOldValue: !0,
|
|
8983
8983
|
subtree: !0
|
|
8984
|
-
},
|
|
8985
|
-
class
|
|
8984
|
+
}, Uc = _ && Ee <= 11;
|
|
8985
|
+
class Gc {
|
|
8986
8986
|
constructor() {
|
|
8987
8987
|
this.anchorNode = null, this.anchorOffset = 0, this.focusNode = null, this.focusOffset = 0;
|
|
8988
8988
|
}
|
|
@@ -8996,13 +8996,13 @@ class Uc {
|
|
|
8996
8996
|
return e.anchorNode == this.anchorNode && e.anchorOffset == this.anchorOffset && e.focusNode == this.focusNode && e.focusOffset == this.focusOffset;
|
|
8997
8997
|
}
|
|
8998
8998
|
}
|
|
8999
|
-
class
|
|
8999
|
+
class _c {
|
|
9000
9000
|
constructor(e, t) {
|
|
9001
|
-
this.view = e, this.handleDOMChange = t, this.queue = [], this.flushingSoon = -1, this.observer = null, this.currentSelection = new
|
|
9001
|
+
this.view = e, this.handleDOMChange = t, this.queue = [], this.flushingSoon = -1, this.observer = null, this.currentSelection = new Gc(), this.onCharData = null, this.suppressingSelectionUpdates = !1, this.lastChangedTextNode = null, this.observer = window.MutationObserver && new window.MutationObserver((r) => {
|
|
9002
9002
|
for (let i = 0; i < r.length; i++)
|
|
9003
9003
|
this.queue.push(r[i]);
|
|
9004
9004
|
_ && Ee <= 11 && r.some((i) => i.type == "childList" && i.removedNodes.length || i.type == "characterData" && i.oldValue.length > i.target.nodeValue.length) ? this.flushSoon() : this.flush();
|
|
9005
|
-
}),
|
|
9005
|
+
}), Uc && (this.onCharData = (r) => {
|
|
9006
9006
|
this.queue.push({ target: r.target, type: "characterData", oldValue: r.prevValue }), this.flushSoon();
|
|
9007
9007
|
}), this.onSelectionChange = this.onSelectionChange.bind(this);
|
|
9008
9008
|
}
|
|
@@ -9015,7 +9015,7 @@ class Gc {
|
|
|
9015
9015
|
this.flushingSoon > -1 && (window.clearTimeout(this.flushingSoon), this.flushingSoon = -1, this.flush());
|
|
9016
9016
|
}
|
|
9017
9017
|
start() {
|
|
9018
|
-
this.observer && (this.observer.takeRecords(), this.observer.observe(this.view.dom,
|
|
9018
|
+
this.observer && (this.observer.takeRecords(), this.observer.observe(this.view.dom, jc)), this.onCharData && this.view.dom.addEventListener("DOMCharacterDataModified", this.onCharData), this.connectSelection();
|
|
9019
9019
|
}
|
|
9020
9020
|
stop() {
|
|
9021
9021
|
if (this.observer) {
|
|
@@ -9098,12 +9098,12 @@ class Gc {
|
|
|
9098
9098
|
let { focusNode: h } = this.currentSelection;
|
|
9099
9099
|
for (let d of f) {
|
|
9100
9100
|
let u = d.parentNode;
|
|
9101
|
-
u && u.nodeName == "LI" && (!h ||
|
|
9101
|
+
u && u.nodeName == "LI" && (!h || Zc(e, h) != u) && d.remove();
|
|
9102
9102
|
}
|
|
9103
9103
|
}
|
|
9104
9104
|
}
|
|
9105
9105
|
let c = null;
|
|
9106
|
-
s < 0 && i && e.input.lastFocus > Date.now() - 200 && Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 && kn(r) && (c = Cr(e)) && c.eq(S.near(e.state.doc.resolve(0), 1)) ? (e.input.lastFocus = 0, be(e), this.currentSelection.set(r), e.scrollToSelection()) : (s > -1 || i) && (s > -1 && (e.docView.markDirty(s, o),
|
|
9106
|
+
s < 0 && i && e.input.lastFocus > Date.now() - 200 && Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 && kn(r) && (c = Cr(e)) && c.eq(S.near(e.state.doc.resolve(0), 1)) ? (e.input.lastFocus = 0, be(e), this.currentSelection.set(r), e.scrollToSelection()) : (s > -1 || i) && (s > -1 && (e.docView.markDirty(s, o), Xc(e)), this.handleDOMChange(s, o, l, a), e.docView && e.docView.dirty ? e.updateState(e.state) : this.currentSelection.eq(r) || be(e), this.currentSelection.set(r));
|
|
9107
9107
|
}
|
|
9108
9108
|
registerMutation(e, t) {
|
|
9109
9109
|
if (t.indexOf(e.target) > -1)
|
|
@@ -9139,7 +9139,7 @@ class Gc {
|
|
|
9139
9139
|
}
|
|
9140
9140
|
}
|
|
9141
9141
|
let Ti = /* @__PURE__ */ new WeakMap(), Ai = !1;
|
|
9142
|
-
function
|
|
9142
|
+
function Xc(n) {
|
|
9143
9143
|
if (!Ti.has(n) && (Ti.set(n, null), ["normal", "nowrap", "pre-line"].indexOf(getComputedStyle(n.dom).whiteSpace) !== -1)) {
|
|
9144
9144
|
if (n.requiresGeckoHackNode = se, Ai)
|
|
9145
9145
|
return;
|
|
@@ -9150,7 +9150,7 @@ function Di(n, e) {
|
|
|
9150
9150
|
let t = e.startContainer, r = e.startOffset, i = e.endContainer, s = e.endOffset, o = n.domAtPos(n.state.selection.anchor);
|
|
9151
9151
|
return _e(o.node, o.offset, i, s) && ([t, r, i, s] = [i, s, t, r]), { anchorNode: t, anchorOffset: r, focusNode: i, focusOffset: s };
|
|
9152
9152
|
}
|
|
9153
|
-
function
|
|
9153
|
+
function Yc(n, e) {
|
|
9154
9154
|
if (e.getComposedRanges) {
|
|
9155
9155
|
let i = e.getComposedRanges(n.root)[0];
|
|
9156
9156
|
if (i)
|
|
@@ -9162,7 +9162,7 @@ function Xc(n, e) {
|
|
|
9162
9162
|
}
|
|
9163
9163
|
return n.dom.addEventListener("beforeinput", r, !0), document.execCommand("indent"), n.dom.removeEventListener("beforeinput", r, !0), t ? Di(n, t) : null;
|
|
9164
9164
|
}
|
|
9165
|
-
function
|
|
9165
|
+
function Zc(n, e) {
|
|
9166
9166
|
for (let t = e.parentNode; t && t != n.dom; t = t.parentNode) {
|
|
9167
9167
|
let r = n.docView.nearestDesc(t, !0);
|
|
9168
9168
|
if (r && r.node.isBlock)
|
|
@@ -9170,7 +9170,7 @@ function Yc(n, e) {
|
|
|
9170
9170
|
}
|
|
9171
9171
|
return null;
|
|
9172
9172
|
}
|
|
9173
|
-
function
|
|
9173
|
+
function Qc(n, e, t) {
|
|
9174
9174
|
let { node: r, fromOffset: i, toOffset: s, from: o, to: l } = n.docView.parseRange(e, t), a = n.domSelectionRange(), c, f = a.anchorNode;
|
|
9175
9175
|
if (f && n.dom.contains(f.nodeType == 1 ? f : f.parentNode) && (c = [{ node: f, offset: a.anchorOffset }], kn(a) || c.push({ node: a.focusNode, offset: a.focusOffset })), W && n.input.lastKeyCode === 8)
|
|
9176
9176
|
for (let g = s; g > i; g--) {
|
|
@@ -9190,7 +9190,7 @@ function Zc(n, e, t) {
|
|
|
9190
9190
|
to: s,
|
|
9191
9191
|
preserveWhitespace: u.parent.type.whitespace == "pre" ? "full" : !0,
|
|
9192
9192
|
findPositions: c,
|
|
9193
|
-
ruleFromNode:
|
|
9193
|
+
ruleFromNode: ef,
|
|
9194
9194
|
context: u
|
|
9195
9195
|
});
|
|
9196
9196
|
if (c && c[0].pos != null) {
|
|
@@ -9199,7 +9199,7 @@ function Zc(n, e, t) {
|
|
|
9199
9199
|
}
|
|
9200
9200
|
return { doc: m, sel: p, from: o, to: l };
|
|
9201
9201
|
}
|
|
9202
|
-
function
|
|
9202
|
+
function ef(n) {
|
|
9203
9203
|
let e = n.pmViewDesc;
|
|
9204
9204
|
if (e)
|
|
9205
9205
|
return e.parseRule();
|
|
@@ -9213,13 +9213,13 @@ function Qc(n) {
|
|
|
9213
9213
|
return { ignore: !0 };
|
|
9214
9214
|
return null;
|
|
9215
9215
|
}
|
|
9216
|
-
const
|
|
9217
|
-
function
|
|
9216
|
+
const tf = /^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;
|
|
9217
|
+
function nf(n, e, t, r, i) {
|
|
9218
9218
|
let s = n.input.compositionPendingChanges || (n.composing ? n.input.compositionID : 0);
|
|
9219
9219
|
if (n.input.compositionPendingChanges = 0, e < 0) {
|
|
9220
9220
|
let M = n.input.lastSelectionTime > Date.now() - 50 ? n.input.lastSelectionOrigin : null, Se = Cr(n, M);
|
|
9221
9221
|
if (Se && !n.state.selection.eq(Se)) {
|
|
9222
|
-
if (W && re && n.input.lastKeyCode === 13 && Date.now() - 100 < n.input.lastKeyCodeTime && n.someProp("handleKeyDown", (
|
|
9222
|
+
if (W && re && n.input.lastKeyCode === 13 && Date.now() - 100 < n.input.lastKeyCodeTime && n.someProp("handleKeyDown", (_o) => _o(n, Ve(13, "Enter"))))
|
|
9223
9223
|
return;
|
|
9224
9224
|
let Ht = n.state.tr.setSelection(Se);
|
|
9225
9225
|
M == "pointer" ? Ht.setMeta("pointer", !0) : M == "key" && Ht.scrollIntoView(), s && Ht.setMeta("composition", s), n.dispatch(Ht);
|
|
@@ -9228,10 +9228,10 @@ function tf(n, e, t, r, i) {
|
|
|
9228
9228
|
}
|
|
9229
9229
|
let o = n.state.doc.resolve(e), l = o.sharedDepth(t);
|
|
9230
9230
|
e = o.before(l + 1), t = n.state.doc.resolve(t).after(l + 1);
|
|
9231
|
-
let a = n.state.selection, c =
|
|
9231
|
+
let a = n.state.selection, c = Qc(n, e, t), f = n.state.doc, h = f.slice(c.from, c.to), d, u;
|
|
9232
9232
|
n.input.lastKeyCode === 8 && Date.now() - 100 < n.input.lastKeyCodeTime ? (d = n.state.selection.to, u = "end") : (d = n.state.selection.from, u = "start"), n.input.lastKeyCode = null;
|
|
9233
|
-
let p =
|
|
9234
|
-
if (p && n.input.domChangeCount++, (ht && n.input.lastIOSEnter > Date.now() - 225 || re) && i.some((M) => M.nodeType == 1 && !
|
|
9233
|
+
let p = of(h.content, c.doc.content, c.from, d, u);
|
|
9234
|
+
if (p && n.input.domChangeCount++, (ht && n.input.lastIOSEnter > Date.now() - 225 || re) && i.some((M) => M.nodeType == 1 && !tf.test(M.nodeName)) && (!p || p.endA >= p.endB) && n.someProp("handleKeyDown", (M) => M(n, Ve(13, "Enter")))) {
|
|
9235
9235
|
n.input.lastIOSEnter = 0;
|
|
9236
9236
|
return;
|
|
9237
9237
|
}
|
|
@@ -9254,7 +9254,7 @@ function tf(n, e, t, r, i) {
|
|
|
9254
9254
|
n.input.lastIOSEnter = 0;
|
|
9255
9255
|
return;
|
|
9256
9256
|
}
|
|
9257
|
-
if (n.state.selection.anchor > p.start &&
|
|
9257
|
+
if (n.state.selection.anchor > p.start && sf(f, p.start, p.endA, m, g) && n.someProp("handleKeyDown", (M) => M(n, Ve(8, "Backspace")))) {
|
|
9258
9258
|
re && W && n.domObserver.suppressSelectionUpdates();
|
|
9259
9259
|
return;
|
|
9260
9260
|
}
|
|
@@ -9269,7 +9269,7 @@ function tf(n, e, t, r, i) {
|
|
|
9269
9269
|
_ && Ee <= 11 && m.parentOffset == 0 && (n.domObserver.suppressSelectionUpdates(), setTimeout(() => be(n), 20)), A = n.state.tr.delete(F, R), Q = f.resolve(p.start).marksAcross(f.resolve(p.endA));
|
|
9270
9270
|
else if (
|
|
9271
9271
|
// Adding or removing a mark
|
|
9272
|
-
p.endA == p.endB && (xe =
|
|
9272
|
+
p.endA == p.endB && (xe = rf(m.parent.content.cut(m.parentOffset, g.parentOffset), b.parent.content.cut(b.parentOffset, p.endA - b.start())))
|
|
9273
9273
|
)
|
|
9274
9274
|
A = n.state.tr, xe.type == "add" ? A.addMark(F, R, xe.mark) : A.removeMark(F, R, xe.mark);
|
|
9275
9275
|
else if (m.parent.child(m.index()).isText && m.index() == g.index() - (g.textOffset ? 0 : 1)) {
|
|
@@ -9288,7 +9288,7 @@ function tf(n, e, t, r, i) {
|
|
|
9288
9288
|
function Ei(n, e, t) {
|
|
9289
9289
|
return Math.max(t.anchor, t.head) > e.content.size ? null : wr(n, e.resolve(t.anchor), e.resolve(t.head));
|
|
9290
9290
|
}
|
|
9291
|
-
function
|
|
9291
|
+
function rf(n, e) {
|
|
9292
9292
|
let t = n.firstChild.marks, r = e.firstChild.marks, i = t, s = r, o, l, a;
|
|
9293
9293
|
for (let f = 0; f < r.length; f++)
|
|
9294
9294
|
i = r[f].removeFromSet(i);
|
|
@@ -9306,7 +9306,7 @@ function nf(n, e) {
|
|
|
9306
9306
|
if (y.from(c).eq(n))
|
|
9307
9307
|
return { mark: l, type: o };
|
|
9308
9308
|
}
|
|
9309
|
-
function
|
|
9309
|
+
function sf(n, e, t, r, i) {
|
|
9310
9310
|
if (
|
|
9311
9311
|
// The content must have shrunk
|
|
9312
9312
|
t - e <= i.pos - r.pos || // newEnd must point directly at or after the end of the block that newStart points into
|
|
@@ -9334,7 +9334,7 @@ function Jn(n, e, t) {
|
|
|
9334
9334
|
}
|
|
9335
9335
|
return i;
|
|
9336
9336
|
}
|
|
9337
|
-
function
|
|
9337
|
+
function of(n, e, t, r, i) {
|
|
9338
9338
|
let s = n.findDiffStart(e, t);
|
|
9339
9339
|
if (s == null)
|
|
9340
9340
|
return null;
|
|
@@ -9358,7 +9358,7 @@ function Ri(n) {
|
|
|
9358
9358
|
let e = n.charCodeAt(0), t = n.charCodeAt(1);
|
|
9359
9359
|
return e >= 56320 && e <= 57343 && t >= 55296 && t <= 56319;
|
|
9360
9360
|
}
|
|
9361
|
-
class
|
|
9361
|
+
class lf {
|
|
9362
9362
|
/**
|
|
9363
9363
|
Create a view. `place` may be a DOM node that the editor should
|
|
9364
9364
|
be appended to, a function that will place it into the document,
|
|
@@ -9367,7 +9367,7 @@ class of {
|
|
|
9367
9367
|
added to the document.
|
|
9368
9368
|
*/
|
|
9369
9369
|
constructor(e, t) {
|
|
9370
|
-
this._root = null, this.focused = !1, this.trackWrites = null, this.mounted = !1, this.markCursor = null, this.cursorWrapper = null, this.lastSelectedViewDesc = void 0, this.input = new
|
|
9370
|
+
this._root = null, this.focused = !1, this.trackWrites = null, this.mounted = !1, this.markCursor = null, this.cursorWrapper = null, this.lastSelectedViewDesc = void 0, this.input = new Oc(), this.prevDirectPlugins = [], this.pluginViews = [], this.requiresGeckoHackNode = !1, this.dragging = null, this._props = t, this.state = t.state, this.directPlugins = t.plugins || [], this.directPlugins.forEach(Pi), this.dispatch = this.dispatch.bind(this), this.dom = e && e.mount || document.createElement("div"), e && (e.appendChild ? e.appendChild(this.dom) : typeof e == "function" ? e(this.dom) : e.mount && (this.mounted = !0)), this.editable = Bi(this), vi(this), this.nodeViews = zi(this), this.docView = di(this.state.doc, Ii(this), Wn(this), this.dom, this), this.domObserver = new _c(this, (r, i, s, o) => nf(this, r, i, s, o)), this.domObserver.start(), Nc(this), this.updatePluginViews();
|
|
9371
9371
|
}
|
|
9372
9372
|
/**
|
|
9373
9373
|
Holds `true` when a
|
|
@@ -9426,23 +9426,23 @@ class of {
|
|
|
9426
9426
|
e.storedMarks && this.composing && (Mo(this), o = !0), this.state = e;
|
|
9427
9427
|
let l = i.plugins != e.plugins || this._props.plugins != t.plugins;
|
|
9428
9428
|
if (l || this._props.plugins != t.plugins || this._props.nodeViews != t.nodeViews) {
|
|
9429
|
-
let u =
|
|
9430
|
-
|
|
9429
|
+
let u = zi(this);
|
|
9430
|
+
cf(u, this.nodeViews) && (this.nodeViews = u, s = !0);
|
|
9431
9431
|
}
|
|
9432
|
-
(l || t.handleDOMEvents != this._props.handleDOMEvents) && ar(this), this.editable =
|
|
9432
|
+
(l || t.handleDOMEvents != this._props.handleDOMEvents) && ar(this), this.editable = Bi(this), vi(this);
|
|
9433
9433
|
let a = Wn(this), c = Ii(this), f = i.plugins != e.plugins && !i.doc.eq(e.doc) ? "reset" : e.scrollToSelection > i.scrollToSelection ? "to selection" : "preserve", h = s || !this.docView.matchesNode(e.doc, c, a);
|
|
9434
9434
|
(h || !e.selection.eq(i.selection)) && (o = !0);
|
|
9435
|
-
let d = f == "preserve" && o && this.dom.style.overflowAnchor == null &&
|
|
9435
|
+
let d = f == "preserve" && o && this.dom.style.overflowAnchor == null && Ha(this);
|
|
9436
9436
|
if (o) {
|
|
9437
9437
|
this.domObserver.stop();
|
|
9438
|
-
let u = h && (_ || W) && !this.composing && !i.selection.empty && !e.selection.empty &&
|
|
9438
|
+
let u = h && (_ || W) && !this.composing && !i.selection.empty && !e.selection.empty && af(i.selection, e.selection);
|
|
9439
9439
|
if (h) {
|
|
9440
9440
|
let p = W ? this.trackWrites = this.domSelectionRange().focusNode : null;
|
|
9441
|
-
this.composing && (this.input.compositionNode =
|
|
9441
|
+
this.composing && (this.input.compositionNode = Fc(this)), (s || !this.docView.update(e.doc, c, a, this)) && (this.docView.updateOuterDeco(c), this.docView.destroy(), this.docView = di(e.doc, c, a, this.dom, this)), p && !this.trackWrites && (u = !0);
|
|
9442
9442
|
}
|
|
9443
|
-
u || !(this.input.mouseDown && this.domObserver.currentSelection.eq(this.domSelectionRange()) &&
|
|
9443
|
+
u || !(this.input.mouseDown && this.domObserver.currentSelection.eq(this.domSelectionRange()) && fc(this)) ? be(this, u) : (fo(this, e.selection), this.domObserver.setCurSelection()), this.domObserver.start();
|
|
9444
9444
|
}
|
|
9445
|
-
this.updatePluginViews(i), !((r = this.dragging) === null || r === void 0) && r.node && !i.doc.eq(e.doc) && this.updateDraggedNode(this.dragging, i), f == "reset" ? this.dom.scrollTop = 0 : f == "to selection" ? this.scrollToSelection() : d &&
|
|
9445
|
+
this.updatePluginViews(i), !((r = this.dragging) === null || r === void 0) && r.node && !i.doc.eq(e.doc) && this.updateDraggedNode(this.dragging, i), f == "reset" ? this.dom.scrollTop = 0 : f == "to selection" ? this.scrollToSelection() : d && $a(d);
|
|
9446
9446
|
}
|
|
9447
9447
|
/**
|
|
9448
9448
|
@internal
|
|
@@ -9527,7 +9527,7 @@ class of {
|
|
|
9527
9527
|
Focus the editor.
|
|
9528
9528
|
*/
|
|
9529
9529
|
focus() {
|
|
9530
|
-
this.domObserver.stop(), this.editable &&
|
|
9530
|
+
this.domObserver.stop(), this.editable && Wa(this.dom), be(this), this.domObserver.start();
|
|
9531
9531
|
}
|
|
9532
9532
|
/**
|
|
9533
9533
|
Get the document root in which the editor exists. This will
|
|
@@ -9561,7 +9561,7 @@ class of {
|
|
|
9561
9561
|
the top level, not in any node.
|
|
9562
9562
|
*/
|
|
9563
9563
|
posAtCoords(e) {
|
|
9564
|
-
return
|
|
9564
|
+
return Ua(this, e);
|
|
9565
9565
|
}
|
|
9566
9566
|
/**
|
|
9567
9567
|
Returns the viewport rectangle at a given document position.
|
|
@@ -9626,7 +9626,7 @@ class of {
|
|
|
9626
9626
|
pass a different state.
|
|
9627
9627
|
*/
|
|
9628
9628
|
endOfTextblock(e, t) {
|
|
9629
|
-
return
|
|
9629
|
+
return Za(this, t || this.state, e);
|
|
9630
9630
|
}
|
|
9631
9631
|
/**
|
|
9632
9632
|
Run the editor's paste logic with the given HTML string. The
|
|
@@ -9647,7 +9647,7 @@ class of {
|
|
|
9647
9647
|
views](https://prosemirror.net/docs/ref/#view.NodeView).
|
|
9648
9648
|
*/
|
|
9649
9649
|
destroy() {
|
|
9650
|
-
this.docView && (
|
|
9650
|
+
this.docView && (Tc(this), this.destroyPluginViews(), this.mounted ? (this.docView.update(this.state.doc, [], Wn(this), this), this.dom.textContent = "") : this.dom.parentNode && this.dom.parentNode.removeChild(this.dom), this.docView.destroy(), this.docView = null, Da());
|
|
9651
9651
|
}
|
|
9652
9652
|
/**
|
|
9653
9653
|
This is true when the view has been
|
|
@@ -9661,7 +9661,7 @@ class of {
|
|
|
9661
9661
|
Used for testing.
|
|
9662
9662
|
*/
|
|
9663
9663
|
dispatchEvent(e) {
|
|
9664
|
-
return
|
|
9664
|
+
return Dc(this, e);
|
|
9665
9665
|
}
|
|
9666
9666
|
/**
|
|
9667
9667
|
Dispatch a transaction. Will call
|
|
@@ -9681,7 +9681,7 @@ class of {
|
|
|
9681
9681
|
*/
|
|
9682
9682
|
domSelectionRange() {
|
|
9683
9683
|
let e = this.domSelection();
|
|
9684
|
-
return e ? K && this.root.nodeType === 11 &&
|
|
9684
|
+
return e ? K && this.root.nodeType === 11 && Ba(this.dom.ownerDocument) == this.dom && Yc(this, e) || e : { focusNode: null, focusOffset: 0, anchorNode: null, anchorOffset: 0 };
|
|
9685
9685
|
}
|
|
9686
9686
|
/**
|
|
9687
9687
|
@internal
|
|
@@ -9705,14 +9705,14 @@ function vi(n) {
|
|
|
9705
9705
|
} else
|
|
9706
9706
|
n.cursorWrapper = null;
|
|
9707
9707
|
}
|
|
9708
|
-
function
|
|
9708
|
+
function Bi(n) {
|
|
9709
9709
|
return !n.someProp("editable", (e) => e(n.state) === !1);
|
|
9710
9710
|
}
|
|
9711
|
-
function
|
|
9711
|
+
function af(n, e) {
|
|
9712
9712
|
let t = Math.min(n.$anchor.sharedDepth(n.head), e.$anchor.sharedDepth(e.head));
|
|
9713
9713
|
return n.$anchor.start(t) != e.$anchor.start(t);
|
|
9714
9714
|
}
|
|
9715
|
-
function
|
|
9715
|
+
function zi(n) {
|
|
9716
9716
|
let e = /* @__PURE__ */ Object.create(null);
|
|
9717
9717
|
function t(r) {
|
|
9718
9718
|
for (let i in r)
|
|
@@ -9720,7 +9720,7 @@ function Bi(n) {
|
|
|
9720
9720
|
}
|
|
9721
9721
|
return n.someProp("nodeViews", t), n.someProp("markViews", t), e;
|
|
9722
9722
|
}
|
|
9723
|
-
function
|
|
9723
|
+
function cf(n, e) {
|
|
9724
9724
|
let t = 0, r = 0;
|
|
9725
9725
|
for (let i in n) {
|
|
9726
9726
|
if (n[i] != e[i])
|
|
@@ -9829,13 +9829,13 @@ var D = class {
|
|
|
9829
9829
|
}
|
|
9830
9830
|
// Find the table map for the given table node.
|
|
9831
9831
|
static get(n) {
|
|
9832
|
-
return cr(n) || fr(n,
|
|
9832
|
+
return cr(n) || fr(n, ff(n));
|
|
9833
9833
|
}
|
|
9834
9834
|
};
|
|
9835
|
-
function
|
|
9835
|
+
function ff(n) {
|
|
9836
9836
|
if (n.type.spec.tableRole != "table")
|
|
9837
9837
|
throw new RangeError("Not a table node: " + n.type.name);
|
|
9838
|
-
const e =
|
|
9838
|
+
const e = hf(n), t = n.childCount, r = [];
|
|
9839
9839
|
let i = 0, s = null;
|
|
9840
9840
|
const o = [];
|
|
9841
9841
|
for (let c = 0, f = e * t; c < f; c++)
|
|
@@ -9885,9 +9885,9 @@ function cf(n) {
|
|
|
9885
9885
|
let a = !1;
|
|
9886
9886
|
for (let c = 0; !a && c < o.length; c += 2)
|
|
9887
9887
|
o[c] != null && o[c + 1] < t && (a = !0);
|
|
9888
|
-
return a &&
|
|
9888
|
+
return a && df(l, o, n), l;
|
|
9889
9889
|
}
|
|
9890
|
-
function
|
|
9890
|
+
function hf(n) {
|
|
9891
9891
|
let e = -1, t = !1;
|
|
9892
9892
|
for (let r = 0; r < n.childCount; r++) {
|
|
9893
9893
|
const i = n.child(r);
|
|
@@ -9908,7 +9908,7 @@ function ff(n) {
|
|
|
9908
9908
|
}
|
|
9909
9909
|
return e;
|
|
9910
9910
|
}
|
|
9911
|
-
function
|
|
9911
|
+
function df(n, e, t) {
|
|
9912
9912
|
n.problems || (n.problems = []);
|
|
9913
9913
|
const r = {};
|
|
9914
9914
|
for (let i = 0; i < n.map.length; i++) {
|
|
@@ -9923,7 +9923,7 @@ function hf(n, e, t) {
|
|
|
9923
9923
|
const a = o.attrs;
|
|
9924
9924
|
for (let c = 0; c < a.colspan; c++) {
|
|
9925
9925
|
const f = (i + c) % n.width, h = e[f * 2];
|
|
9926
|
-
h != null && (!a.colwidth || a.colwidth[c] != h) && ((l || (l =
|
|
9926
|
+
h != null && (!a.colwidth || a.colwidth[c] != h) && ((l || (l = uf(a)))[c] = h);
|
|
9927
9927
|
}
|
|
9928
9928
|
l && n.problems.unshift({
|
|
9929
9929
|
type: "colwidth mismatch",
|
|
@@ -9932,7 +9932,7 @@ function hf(n, e, t) {
|
|
|
9932
9932
|
});
|
|
9933
9933
|
}
|
|
9934
9934
|
}
|
|
9935
|
-
function
|
|
9935
|
+
function uf(n) {
|
|
9936
9936
|
if (n.colwidth)
|
|
9937
9937
|
return n.colwidth.slice();
|
|
9938
9938
|
const e = [];
|
|
@@ -9963,7 +9963,7 @@ function Li(n, e) {
|
|
|
9963
9963
|
}
|
|
9964
9964
|
return t;
|
|
9965
9965
|
}
|
|
9966
|
-
function
|
|
9966
|
+
function pf(n) {
|
|
9967
9967
|
const e = n.cellAttributes || {}, t = {
|
|
9968
9968
|
colspan: { default: 1 },
|
|
9969
9969
|
rowspan: { default: 1 },
|
|
@@ -10027,7 +10027,7 @@ function ue(n) {
|
|
|
10027
10027
|
}
|
|
10028
10028
|
return e;
|
|
10029
10029
|
}
|
|
10030
|
-
var Ne = new
|
|
10030
|
+
var Ne = new Bt("selectingCells");
|
|
10031
10031
|
function Lt(n) {
|
|
10032
10032
|
for (let e = n.depth - 1; e > 0; e--)
|
|
10033
10033
|
if (n.node(e).type.spec.tableRole == "row")
|
|
@@ -10047,12 +10047,12 @@ function Dr(n) {
|
|
|
10047
10047
|
return e.$anchorCell.pos > e.$headCell.pos ? e.$anchorCell : e.$headCell;
|
|
10048
10048
|
if ("node" in e && e.node && e.node.type.spec.tableRole == "cell")
|
|
10049
10049
|
return e.$anchor;
|
|
10050
|
-
const t = Lt(e.$head) ||
|
|
10050
|
+
const t = Lt(e.$head) || mf(e.$head);
|
|
10051
10051
|
if (t)
|
|
10052
10052
|
return t;
|
|
10053
10053
|
throw new RangeError(`No cell found around position ${e.head}`);
|
|
10054
10054
|
}
|
|
10055
|
-
function
|
|
10055
|
+
function mf(n) {
|
|
10056
10056
|
for (let e = n.nodeAfter, t = n.pos; e; e = e.firstChild, t++) {
|
|
10057
10057
|
const r = e.type.spec.tableRole;
|
|
10058
10058
|
if (r == "cell" || r == "header_cell")
|
|
@@ -10067,7 +10067,7 @@ function pf(n) {
|
|
|
10067
10067
|
function hr(n) {
|
|
10068
10068
|
return n.parent.type.spec.tableRole == "row" && !!n.nodeAfter;
|
|
10069
10069
|
}
|
|
10070
|
-
function
|
|
10070
|
+
function gf(n) {
|
|
10071
10071
|
return n.node(0).resolve(n.pos + n.nodeAfter.nodeSize);
|
|
10072
10072
|
}
|
|
10073
10073
|
function Er(n, e) {
|
|
@@ -10081,7 +10081,7 @@ function dt(n, e, t = 1) {
|
|
|
10081
10081
|
const r = { ...n, colspan: n.colspan - t };
|
|
10082
10082
|
return r.colwidth && (r.colwidth = r.colwidth.slice(), r.colwidth.splice(e, t), r.colwidth.some((i) => i > 0) || (r.colwidth = null)), r;
|
|
10083
10083
|
}
|
|
10084
|
-
var
|
|
10084
|
+
var B = class me extends S {
|
|
10085
10085
|
// A table selection is identified by its anchor and head cells. The
|
|
10086
10086
|
// positions given to this constructor should point _before_ two
|
|
10087
10087
|
// cells in the same table. They may be the same, to select a single
|
|
@@ -10245,12 +10245,12 @@ var z = class me extends S {
|
|
|
10245
10245
|
return new me(e.resolve(t), e.resolve(r));
|
|
10246
10246
|
}
|
|
10247
10247
|
getBookmark() {
|
|
10248
|
-
return new
|
|
10248
|
+
return new yf(this.$anchorCell.pos, this.$headCell.pos);
|
|
10249
10249
|
}
|
|
10250
10250
|
};
|
|
10251
|
-
|
|
10252
|
-
S.jsonID("cell",
|
|
10253
|
-
var
|
|
10251
|
+
B.prototype.visible = !1;
|
|
10252
|
+
S.jsonID("cell", B);
|
|
10253
|
+
var yf = class Io {
|
|
10254
10254
|
constructor(e, t) {
|
|
10255
10255
|
this.anchor = e, this.head = t;
|
|
10256
10256
|
}
|
|
@@ -10259,11 +10259,11 @@ var gf = class Io {
|
|
|
10259
10259
|
}
|
|
10260
10260
|
resolve(e) {
|
|
10261
10261
|
const t = e.resolve(this.anchor), r = e.resolve(this.head);
|
|
10262
|
-
return t.parent.type.spec.tableRole == "row" && r.parent.type.spec.tableRole == "row" && t.index() < t.parent.childCount && r.index() < r.parent.childCount && Er(t, r) ? new
|
|
10262
|
+
return t.parent.type.spec.tableRole == "row" && r.parent.type.spec.tableRole == "row" && t.index() < t.parent.childCount && r.index() < r.parent.childCount && Er(t, r) ? new B(t, r) : S.near(r, 1);
|
|
10263
10263
|
}
|
|
10264
10264
|
};
|
|
10265
|
-
function
|
|
10266
|
-
if (!(n.selection instanceof
|
|
10265
|
+
function bf(n) {
|
|
10266
|
+
if (!(n.selection instanceof B))
|
|
10267
10267
|
return null;
|
|
10268
10268
|
const e = [];
|
|
10269
10269
|
return n.selection.forEachCell((t, r) => {
|
|
@@ -10272,7 +10272,7 @@ function yf(n) {
|
|
|
10272
10272
|
);
|
|
10273
10273
|
}), T.create(n.doc, e);
|
|
10274
10274
|
}
|
|
10275
|
-
function
|
|
10275
|
+
function kf({ $from: n, $to: e }) {
|
|
10276
10276
|
if (n.pos == e.pos || n.pos < e.pos - 6)
|
|
10277
10277
|
return !1;
|
|
10278
10278
|
let t = n.pos, r = e.pos, i = n.depth;
|
|
@@ -10282,7 +10282,7 @@ function bf({ $from: n, $to: e }) {
|
|
|
10282
10282
|
;
|
|
10283
10283
|
return t == r && /row|table/.test(n.node(i).type.spec.tableRole);
|
|
10284
10284
|
}
|
|
10285
|
-
function
|
|
10285
|
+
function xf({ $from: n, $to: e }) {
|
|
10286
10286
|
let t, r;
|
|
10287
10287
|
for (let i = n.depth; i > 0; i--) {
|
|
10288
10288
|
const s = n.node(i);
|
|
@@ -10300,23 +10300,23 @@ function kf({ $from: n, $to: e }) {
|
|
|
10300
10300
|
}
|
|
10301
10301
|
return t !== r && e.parentOffset === 0;
|
|
10302
10302
|
}
|
|
10303
|
-
function
|
|
10303
|
+
function Sf(n, e, t) {
|
|
10304
10304
|
const r = (e || n).selection, i = (e || n).doc;
|
|
10305
10305
|
let s, o;
|
|
10306
10306
|
if (r instanceof x && (o = r.node.type.spec.tableRole)) {
|
|
10307
10307
|
if (o == "cell" || o == "header_cell")
|
|
10308
|
-
s =
|
|
10308
|
+
s = B.create(i, r.from);
|
|
10309
10309
|
else if (o == "row") {
|
|
10310
10310
|
const l = i.resolve(r.from + 1);
|
|
10311
|
-
s =
|
|
10311
|
+
s = B.rowSelection(l, l);
|
|
10312
10312
|
} else if (!t) {
|
|
10313
10313
|
const l = D.get(r.node), a = r.from + 1, c = a + l.map[l.width * l.height - 1];
|
|
10314
|
-
s =
|
|
10314
|
+
s = B.create(i, a + 1, c);
|
|
10315
10315
|
}
|
|
10316
|
-
} else r instanceof C &&
|
|
10316
|
+
} else r instanceof C && kf(r) ? s = C.create(i, r.from) : r instanceof C && xf(r) && (s = C.create(i, r.$from.start(), r.$from.end()));
|
|
10317
10317
|
return s && (e || (e = n.tr)).setSelection(s), e;
|
|
10318
10318
|
}
|
|
10319
|
-
var
|
|
10319
|
+
var Cf = new Bt("fix-tables");
|
|
10320
10320
|
function vo(n, e, t, r) {
|
|
10321
10321
|
const i = n.childCount, s = e.childCount;
|
|
10322
10322
|
e:
|
|
@@ -10330,14 +10330,14 @@ function vo(n, e, t, r) {
|
|
|
10330
10330
|
r(a, t), l < i && n.child(l).sameMarkup(a) ? vo(n.child(l), a, t + 1, r) : a.nodesBetween(0, a.content.size, r, t + 1), t += a.nodeSize;
|
|
10331
10331
|
}
|
|
10332
10332
|
}
|
|
10333
|
-
function
|
|
10333
|
+
function wf(n, e) {
|
|
10334
10334
|
let t;
|
|
10335
10335
|
const r = (i, s) => {
|
|
10336
|
-
i.type.spec.tableRole == "table" && (t =
|
|
10336
|
+
i.type.spec.tableRole == "table" && (t = Mf(n, i, s, t));
|
|
10337
10337
|
};
|
|
10338
10338
|
return e ? e.doc != n.doc && vo(e.doc, n.doc, 0, r) : n.doc.descendants(r), t;
|
|
10339
10339
|
}
|
|
10340
|
-
function
|
|
10340
|
+
function Mf(n, e, t, r) {
|
|
10341
10341
|
const i = D.get(e);
|
|
10342
10342
|
if (!i.problems)
|
|
10343
10343
|
return r;
|
|
@@ -10397,21 +10397,21 @@ function wf(n, e, t, r) {
|
|
|
10397
10397
|
}
|
|
10398
10398
|
c = h;
|
|
10399
10399
|
}
|
|
10400
|
-
return r.setMeta(
|
|
10400
|
+
return r.setMeta(Cf, { fixTables: !0 });
|
|
10401
10401
|
}
|
|
10402
|
-
function
|
|
10402
|
+
function Bo(n) {
|
|
10403
10403
|
const e = n.selection, t = Dr(n), r = t.node(-1), i = t.start(-1), s = D.get(r);
|
|
10404
|
-
return { ...e instanceof
|
|
10404
|
+
return { ...e instanceof B ? s.rectBetween(
|
|
10405
10405
|
e.$anchorCell.pos - i,
|
|
10406
10406
|
e.$headCell.pos - i
|
|
10407
10407
|
) : s.findCell(t.pos - i), tableStart: i, map: s, table: r };
|
|
10408
10408
|
}
|
|
10409
|
-
function
|
|
10409
|
+
function Of(n) {
|
|
10410
10410
|
return function(e, t) {
|
|
10411
10411
|
if (!Cn(e))
|
|
10412
10412
|
return !1;
|
|
10413
10413
|
if (t) {
|
|
10414
|
-
const r = ue(e.schema), i =
|
|
10414
|
+
const r = ue(e.schema), i = Bo(e), s = e.tr, o = i.map.cellsInRect(
|
|
10415
10415
|
n == "column" ? {
|
|
10416
10416
|
left: i.left,
|
|
10417
10417
|
top: 0,
|
|
@@ -10457,11 +10457,11 @@ function Fi(n, e, t) {
|
|
|
10457
10457
|
return !0;
|
|
10458
10458
|
}
|
|
10459
10459
|
function Rr(n, e) {
|
|
10460
|
-
return e = e || { useDeprecatedLogic: !1 }, e.useDeprecatedLogic ?
|
|
10460
|
+
return e = e || { useDeprecatedLogic: !1 }, e.useDeprecatedLogic ? Of(n) : function(t, r) {
|
|
10461
10461
|
if (!Cn(t))
|
|
10462
10462
|
return !1;
|
|
10463
10463
|
if (r) {
|
|
10464
|
-
const i = ue(t.schema), s =
|
|
10464
|
+
const i = ue(t.schema), s = Bo(t), o = t.tr, l = Fi("row", s, i), a = Fi(
|
|
10465
10465
|
"column",
|
|
10466
10466
|
s,
|
|
10467
10467
|
i
|
|
@@ -10493,7 +10493,7 @@ Rr("column", {
|
|
|
10493
10493
|
Rr("cell", {
|
|
10494
10494
|
useDeprecatedLogic: !0
|
|
10495
10495
|
});
|
|
10496
|
-
function
|
|
10496
|
+
function Nf(n, e) {
|
|
10497
10497
|
if (e < 0) {
|
|
10498
10498
|
const t = n.nodeBefore;
|
|
10499
10499
|
if (t)
|
|
@@ -10521,13 +10521,13 @@ function Hi(n) {
|
|
|
10521
10521
|
return function(e, t) {
|
|
10522
10522
|
if (!Cn(e))
|
|
10523
10523
|
return !1;
|
|
10524
|
-
const r =
|
|
10524
|
+
const r = Nf(Dr(e), n);
|
|
10525
10525
|
if (r == null)
|
|
10526
10526
|
return !1;
|
|
10527
10527
|
if (t) {
|
|
10528
10528
|
const i = e.doc.resolve(r);
|
|
10529
10529
|
t(
|
|
10530
|
-
e.tr.setSelection(C.between(i,
|
|
10530
|
+
e.tr.setSelection(C.between(i, gf(i))).scrollIntoView()
|
|
10531
10531
|
);
|
|
10532
10532
|
}
|
|
10533
10533
|
return !0;
|
|
@@ -10535,7 +10535,7 @@ function Hi(n) {
|
|
|
10535
10535
|
}
|
|
10536
10536
|
function qt(n, e) {
|
|
10537
10537
|
const t = n.selection;
|
|
10538
|
-
if (!(t instanceof
|
|
10538
|
+
if (!(t instanceof B))
|
|
10539
10539
|
return !1;
|
|
10540
10540
|
if (e) {
|
|
10541
10541
|
const r = n.tr, i = ue(n.schema).cell.createAndFill().content;
|
|
@@ -10549,7 +10549,7 @@ function qt(n, e) {
|
|
|
10549
10549
|
}
|
|
10550
10550
|
return !0;
|
|
10551
10551
|
}
|
|
10552
|
-
function
|
|
10552
|
+
function Tf(n) {
|
|
10553
10553
|
if (!n.size)
|
|
10554
10554
|
return null;
|
|
10555
10555
|
let { content: e, openStart: t, openEnd: r } = n;
|
|
@@ -10574,9 +10574,9 @@ function Nf(n) {
|
|
|
10574
10574
|
);
|
|
10575
10575
|
else
|
|
10576
10576
|
return null;
|
|
10577
|
-
return
|
|
10577
|
+
return Af(o, l);
|
|
10578
10578
|
}
|
|
10579
|
-
function
|
|
10579
|
+
function Af(n, e) {
|
|
10580
10580
|
const t = [];
|
|
10581
10581
|
for (let i = 0; i < e.length; i++) {
|
|
10582
10582
|
const s = e[i];
|
|
@@ -10602,7 +10602,7 @@ function dr(n, e) {
|
|
|
10602
10602
|
const t = n.createAndFill();
|
|
10603
10603
|
return new Is(t).replace(0, t.content.size, e).doc;
|
|
10604
10604
|
}
|
|
10605
|
-
function
|
|
10605
|
+
function Df({ width: n, height: e, rows: t }, r, i) {
|
|
10606
10606
|
if (n != r) {
|
|
10607
10607
|
const s = [], o = [];
|
|
10608
10608
|
for (let l = 0; l < t.length; l++) {
|
|
@@ -10644,7 +10644,7 @@ function Af({ width: n, height: e, rows: t }, r, i) {
|
|
|
10644
10644
|
}
|
|
10645
10645
|
return { width: n, height: e, rows: t };
|
|
10646
10646
|
}
|
|
10647
|
-
function
|
|
10647
|
+
function Ef(n, e, t, r, i, s, o) {
|
|
10648
10648
|
const l = n.doc.type.schema, a = ue(l);
|
|
10649
10649
|
let c, f;
|
|
10650
10650
|
if (i > e.width)
|
|
@@ -10735,7 +10735,7 @@ function Ji(n, e, t, r, i) {
|
|
|
10735
10735
|
throw new Error("No table found");
|
|
10736
10736
|
o = D.get(s), d = h.mapping.maps.length;
|
|
10737
10737
|
}
|
|
10738
|
-
|
|
10738
|
+
Ef(h, o, s, t, c, f, d) && u(), $i(h, o, s, t, a, c, l, d) && u(), $i(h, o, s, t, a, c, f, d) && u(), Wi(h, o, s, t, l, f, a, d) && u(), Wi(h, o, s, t, l, f, c, d) && u();
|
|
10739
10739
|
for (let p = l; p < f; p++) {
|
|
10740
10740
|
const m = o.positionAt(p, a, s), g = o.positionAt(p, c, s);
|
|
10741
10741
|
h.replace(
|
|
@@ -10745,13 +10745,13 @@ function Ji(n, e, t, r, i) {
|
|
|
10745
10745
|
);
|
|
10746
10746
|
}
|
|
10747
10747
|
u(), h.setSelection(
|
|
10748
|
-
new
|
|
10748
|
+
new B(
|
|
10749
10749
|
h.doc.resolve(t + o.positionAt(l, a, s)),
|
|
10750
10750
|
h.doc.resolve(t + o.positionAt(f - 1, c - 1, s))
|
|
10751
10751
|
)
|
|
10752
10752
|
), e(h);
|
|
10753
10753
|
}
|
|
10754
|
-
var
|
|
10754
|
+
var Rf = _s({
|
|
10755
10755
|
ArrowLeft: Kt("horiz", -1),
|
|
10756
10756
|
ArrowRight: Kt("horiz", 1),
|
|
10757
10757
|
ArrowUp: Kt("vert", -1),
|
|
@@ -10773,7 +10773,7 @@ function Kt(n, e) {
|
|
|
10773
10773
|
if (!i)
|
|
10774
10774
|
return !1;
|
|
10775
10775
|
const s = t.selection;
|
|
10776
|
-
if (s instanceof
|
|
10776
|
+
if (s instanceof B)
|
|
10777
10777
|
return Xt(
|
|
10778
10778
|
t,
|
|
10779
10779
|
r,
|
|
@@ -10781,7 +10781,7 @@ function Kt(n, e) {
|
|
|
10781
10781
|
);
|
|
10782
10782
|
if (n != "horiz" && !s.empty)
|
|
10783
10783
|
return !1;
|
|
10784
|
-
const o =
|
|
10784
|
+
const o = zo(i, n, e);
|
|
10785
10785
|
if (o == null)
|
|
10786
10786
|
return !1;
|
|
10787
10787
|
if (n == "horiz")
|
|
@@ -10803,32 +10803,32 @@ function jt(n, e) {
|
|
|
10803
10803
|
return !1;
|
|
10804
10804
|
const s = t.selection;
|
|
10805
10805
|
let o;
|
|
10806
|
-
if (s instanceof
|
|
10806
|
+
if (s instanceof B)
|
|
10807
10807
|
o = s;
|
|
10808
10808
|
else {
|
|
10809
|
-
const a =
|
|
10809
|
+
const a = zo(i, n, e);
|
|
10810
10810
|
if (a == null)
|
|
10811
10811
|
return !1;
|
|
10812
|
-
o = new
|
|
10812
|
+
o = new B(t.doc.resolve(a));
|
|
10813
10813
|
}
|
|
10814
10814
|
const l = Ro(o.$headCell, n, e);
|
|
10815
10815
|
return l ? Xt(
|
|
10816
10816
|
t,
|
|
10817
10817
|
r,
|
|
10818
|
-
new
|
|
10818
|
+
new B(o.$anchorCell, l)
|
|
10819
10819
|
) : !1;
|
|
10820
10820
|
};
|
|
10821
10821
|
}
|
|
10822
|
-
function
|
|
10822
|
+
function If(n, e) {
|
|
10823
10823
|
const t = n.state.doc, r = Lt(t.resolve(e));
|
|
10824
|
-
return r ? (n.dispatch(n.state.tr.setSelection(new
|
|
10824
|
+
return r ? (n.dispatch(n.state.tr.setSelection(new B(r))), !0) : !1;
|
|
10825
10825
|
}
|
|
10826
|
-
function
|
|
10826
|
+
function vf(n, e, t) {
|
|
10827
10827
|
if (!Cn(n.state))
|
|
10828
10828
|
return !1;
|
|
10829
|
-
let r =
|
|
10829
|
+
let r = Tf(t);
|
|
10830
10830
|
const i = n.state.selection;
|
|
10831
|
-
if (i instanceof
|
|
10831
|
+
if (i instanceof B) {
|
|
10832
10832
|
r || (r = {
|
|
10833
10833
|
width: 1,
|
|
10834
10834
|
height: 1,
|
|
@@ -10842,7 +10842,7 @@ function If(n, e, t) {
|
|
|
10842
10842
|
i.$anchorCell.pos - o,
|
|
10843
10843
|
i.$headCell.pos - o
|
|
10844
10844
|
);
|
|
10845
|
-
return r =
|
|
10845
|
+
return r = Df(r, l.right - l.left, l.bottom - l.top), Ji(n.state, n.dispatch, o, l, r), !0;
|
|
10846
10846
|
} else if (r) {
|
|
10847
10847
|
const s = Dr(n.state), o = s.start(-1);
|
|
10848
10848
|
return Ji(
|
|
@@ -10855,13 +10855,13 @@ function If(n, e, t) {
|
|
|
10855
10855
|
} else
|
|
10856
10856
|
return !1;
|
|
10857
10857
|
}
|
|
10858
|
-
function
|
|
10858
|
+
function Bf(n, e) {
|
|
10859
10859
|
var t;
|
|
10860
10860
|
if (e.ctrlKey || e.metaKey)
|
|
10861
10861
|
return;
|
|
10862
10862
|
const r = qi(n, e.target);
|
|
10863
10863
|
let i;
|
|
10864
|
-
if (e.shiftKey && n.state.selection instanceof
|
|
10864
|
+
if (e.shiftKey && n.state.selection instanceof B)
|
|
10865
10865
|
s(n.state.selection.$anchorCell, e), e.preventDefault();
|
|
10866
10866
|
else if (e.shiftKey && r && (i = Lt(n.state.selection.$anchor)) != null && ((t = qn(n, e)) == null ? void 0 : t.pos) != i.pos)
|
|
10867
10867
|
s(i, e), e.preventDefault();
|
|
@@ -10875,7 +10875,7 @@ function vf(n, e) {
|
|
|
10875
10875
|
f = a;
|
|
10876
10876
|
else
|
|
10877
10877
|
return;
|
|
10878
|
-
const d = new
|
|
10878
|
+
const d = new B(a, f);
|
|
10879
10879
|
if (h || !n.state.selection.eq(d)) {
|
|
10880
10880
|
const u = n.state.tr.setSelection(d);
|
|
10881
10881
|
h && u.setMeta(Ne, a.pos), n.dispatch(u);
|
|
@@ -10895,7 +10895,7 @@ function vf(n, e) {
|
|
|
10895
10895
|
}
|
|
10896
10896
|
n.root.addEventListener("mouseup", o), n.root.addEventListener("dragstart", o), n.root.addEventListener("mousemove", l);
|
|
10897
10897
|
}
|
|
10898
|
-
function
|
|
10898
|
+
function zo(n, e, t) {
|
|
10899
10899
|
if (!(n.state.selection instanceof C))
|
|
10900
10900
|
return null;
|
|
10901
10901
|
const { $head: r } = n.state.selection;
|
|
@@ -10966,10 +10966,10 @@ function ur(n, e, t, r, i, s) {
|
|
|
10966
10966
|
a ? (t.style.width = l + "px", t.style.minWidth = "") : (t.style.width = "", t.style.minWidth = l + "px");
|
|
10967
10967
|
}
|
|
10968
10968
|
}
|
|
10969
|
-
var Y = new
|
|
10969
|
+
var Y = new Bt(
|
|
10970
10970
|
"tableColumnResizing"
|
|
10971
10971
|
);
|
|
10972
|
-
function
|
|
10972
|
+
function Pf({
|
|
10973
10973
|
handleWidth: n = 5,
|
|
10974
10974
|
cellMinWidth: e = 25,
|
|
10975
10975
|
defaultCellMinWidth: t = 100,
|
|
@@ -10982,7 +10982,7 @@ function Bf({
|
|
|
10982
10982
|
init(o, l) {
|
|
10983
10983
|
var a, c;
|
|
10984
10984
|
const f = (c = (a = s.spec) == null ? void 0 : a.props) == null ? void 0 : c.nodeViews, h = ue(l.schema).table.name;
|
|
10985
|
-
return r && f && (f[h] = (d, u) => new r(d, t, u)), new
|
|
10985
|
+
return r && f && (f[h] = (d, u) => new r(d, t, u)), new Vf(-1, !1);
|
|
10986
10986
|
},
|
|
10987
10987
|
apply(o, l) {
|
|
10988
10988
|
return l.apply(o);
|
|
@@ -10995,26 +10995,26 @@ function Bf({
|
|
|
10995
10995
|
},
|
|
10996
10996
|
handleDOMEvents: {
|
|
10997
10997
|
mousemove: (o, l) => {
|
|
10998
|
-
|
|
10998
|
+
Lf(o, l, n, i);
|
|
10999
10999
|
},
|
|
11000
11000
|
mouseleave: (o) => {
|
|
11001
|
-
|
|
11001
|
+
Ff(o);
|
|
11002
11002
|
},
|
|
11003
11003
|
mousedown: (o, l) => {
|
|
11004
|
-
|
|
11004
|
+
Hf(o, l, e, t);
|
|
11005
11005
|
}
|
|
11006
11006
|
},
|
|
11007
11007
|
decorations: (o) => {
|
|
11008
11008
|
const l = Y.getState(o);
|
|
11009
11009
|
if (l && l.activeHandle > -1)
|
|
11010
|
-
return
|
|
11010
|
+
return Kf(o, l.activeHandle);
|
|
11011
11011
|
},
|
|
11012
11012
|
nodeViews: {}
|
|
11013
11013
|
}
|
|
11014
11014
|
});
|
|
11015
11015
|
return s;
|
|
11016
11016
|
}
|
|
11017
|
-
var
|
|
11017
|
+
var Vf = class Yt {
|
|
11018
11018
|
constructor(e, t) {
|
|
11019
11019
|
this.activeHandle = e, this.dragging = t;
|
|
11020
11020
|
}
|
|
@@ -11031,10 +11031,10 @@ var Pf = class Yt {
|
|
|
11031
11031
|
return t;
|
|
11032
11032
|
}
|
|
11033
11033
|
};
|
|
11034
|
-
function
|
|
11034
|
+
function Lf(n, e, t, r) {
|
|
11035
11035
|
const i = Y.getState(n.state);
|
|
11036
11036
|
if (i && !i.dragging) {
|
|
11037
|
-
const s =
|
|
11037
|
+
const s = Wf(e.target);
|
|
11038
11038
|
let o = -1;
|
|
11039
11039
|
if (s) {
|
|
11040
11040
|
const { left: l, right: a } = s.getBoundingClientRect();
|
|
@@ -11050,16 +11050,16 @@ function Vf(n, e, t, r) {
|
|
|
11050
11050
|
}
|
|
11051
11051
|
}
|
|
11052
11052
|
}
|
|
11053
|
-
function
|
|
11053
|
+
function Ff(n) {
|
|
11054
11054
|
const e = Y.getState(n.state);
|
|
11055
11055
|
e && e.activeHandle > -1 && !e.dragging && Po(n, -1);
|
|
11056
11056
|
}
|
|
11057
|
-
function
|
|
11057
|
+
function Hf(n, e, t, r) {
|
|
11058
11058
|
var i;
|
|
11059
11059
|
const s = (i = n.dom.ownerDocument.defaultView) != null ? i : window, o = Y.getState(n.state);
|
|
11060
11060
|
if (!o || o.activeHandle == -1 || o.dragging)
|
|
11061
11061
|
return !1;
|
|
11062
|
-
const l = n.state.doc.nodeAt(o.activeHandle), a =
|
|
11062
|
+
const l = n.state.doc.nodeAt(o.activeHandle), a = $f(n, o.activeHandle, l.attrs);
|
|
11063
11063
|
n.dispatch(
|
|
11064
11064
|
n.state.tr.setMeta(Y, {
|
|
11065
11065
|
setDragging: { startX: e.clientX, startWidth: a }
|
|
@@ -11068,7 +11068,7 @@ function Ff(n, e, t, r) {
|
|
|
11068
11068
|
function c(h) {
|
|
11069
11069
|
s.removeEventListener("mouseup", c), s.removeEventListener("mousemove", f);
|
|
11070
11070
|
const d = Y.getState(n.state);
|
|
11071
|
-
d != null && d.dragging && (
|
|
11071
|
+
d != null && d.dragging && (Jf(
|
|
11072
11072
|
n,
|
|
11073
11073
|
d.activeHandle,
|
|
11074
11074
|
ji(d.dragging, h, t)
|
|
@@ -11097,7 +11097,7 @@ function Ff(n, e, t, r) {
|
|
|
11097
11097
|
r
|
|
11098
11098
|
), s.addEventListener("mouseup", c), s.addEventListener("mousemove", f), e.preventDefault(), !0;
|
|
11099
11099
|
}
|
|
11100
|
-
function
|
|
11100
|
+
function $f(n, e, { colspan: t, colwidth: r }) {
|
|
11101
11101
|
const i = r && r[r.length - 1];
|
|
11102
11102
|
if (i)
|
|
11103
11103
|
return i;
|
|
@@ -11108,7 +11108,7 @@ function Hf(n, e, { colspan: t, colwidth: r }) {
|
|
|
11108
11108
|
r[c] && (l -= r[c], a--);
|
|
11109
11109
|
return l / a;
|
|
11110
11110
|
}
|
|
11111
|
-
function
|
|
11111
|
+
function Wf(n) {
|
|
11112
11112
|
for (; n && n.nodeName != "TD" && n.nodeName != "TH"; )
|
|
11113
11113
|
n = n.classList && n.classList.contains("ProseMirror") ? null : n.parentNode;
|
|
11114
11114
|
return n;
|
|
@@ -11137,7 +11137,7 @@ function Po(n, e) {
|
|
|
11137
11137
|
n.state.tr.setMeta(Y, { setHandle: e })
|
|
11138
11138
|
);
|
|
11139
11139
|
}
|
|
11140
|
-
function
|
|
11140
|
+
function Jf(n, e, t) {
|
|
11141
11141
|
const r = n.state.doc.resolve(e), i = r.node(-1), s = D.get(i), o = r.start(-1), l = s.colCount(r.pos - o) + r.nodeAfter.attrs.colspan - 1, a = n.state.tr;
|
|
11142
11142
|
for (let c = 0; c < s.height; c++) {
|
|
11143
11143
|
const f = c * s.width + l;
|
|
@@ -11146,7 +11146,7 @@ function Wf(n, e, t) {
|
|
|
11146
11146
|
const h = s.map[f], d = i.nodeAt(h).attrs, u = d.colspan == 1 ? 0 : l - s.colCount(h);
|
|
11147
11147
|
if (d.colwidth && d.colwidth[u] == t)
|
|
11148
11148
|
continue;
|
|
11149
|
-
const p = d.colwidth ? d.colwidth.slice() :
|
|
11149
|
+
const p = d.colwidth ? d.colwidth.slice() : qf(d.colspan);
|
|
11150
11150
|
p[u] = t, a.setNodeMarkup(o + h, null, { ...d, colwidth: p });
|
|
11151
11151
|
}
|
|
11152
11152
|
a.docChanged && n.dispatch(a);
|
|
@@ -11165,10 +11165,10 @@ function Ui(n, e, t, r) {
|
|
|
11165
11165
|
t
|
|
11166
11166
|
);
|
|
11167
11167
|
}
|
|
11168
|
-
function
|
|
11168
|
+
function qf(n) {
|
|
11169
11169
|
return Array(n).fill(0);
|
|
11170
11170
|
}
|
|
11171
|
-
function
|
|
11171
|
+
function Kf(n, e) {
|
|
11172
11172
|
var t;
|
|
11173
11173
|
const r = [], i = n.doc.resolve(e), s = i.node(-1);
|
|
11174
11174
|
if (!s)
|
|
@@ -11191,7 +11191,7 @@ function qf(n, e) {
|
|
|
11191
11191
|
}
|
|
11192
11192
|
return T.create(n.doc, r);
|
|
11193
11193
|
}
|
|
11194
|
-
function
|
|
11194
|
+
function jf({
|
|
11195
11195
|
allowTableNodeSelection: n = !1
|
|
11196
11196
|
} = {}) {
|
|
11197
11197
|
return new pt({
|
|
@@ -11214,31 +11214,31 @@ function Kf({
|
|
|
11214
11214
|
}
|
|
11215
11215
|
},
|
|
11216
11216
|
props: {
|
|
11217
|
-
decorations:
|
|
11217
|
+
decorations: bf,
|
|
11218
11218
|
handleDOMEvents: {
|
|
11219
|
-
mousedown:
|
|
11219
|
+
mousedown: Bf
|
|
11220
11220
|
},
|
|
11221
11221
|
createSelectionBetween(e) {
|
|
11222
11222
|
return Ne.getState(e.state) != null ? e.state.selection : null;
|
|
11223
11223
|
},
|
|
11224
|
-
handleTripleClick:
|
|
11225
|
-
handleKeyDown:
|
|
11226
|
-
handlePaste:
|
|
11224
|
+
handleTripleClick: If,
|
|
11225
|
+
handleKeyDown: Rf,
|
|
11226
|
+
handlePaste: vf
|
|
11227
11227
|
},
|
|
11228
11228
|
appendTransaction(e, t, r) {
|
|
11229
|
-
return
|
|
11229
|
+
return Sf(
|
|
11230
11230
|
r,
|
|
11231
|
-
|
|
11231
|
+
wf(r, t),
|
|
11232
11232
|
n
|
|
11233
11233
|
);
|
|
11234
11234
|
}
|
|
11235
11235
|
});
|
|
11236
11236
|
}
|
|
11237
|
-
const Vo = "app.grapesjs.com", Lo = "app-stage.grapesjs.com",
|
|
11237
|
+
const Vo = "app.grapesjs.com", Lo = "app-stage.grapesjs.com", Uf = "app2.grapesjs.com", Gf = "app-stage2.grapesjs.com", Gi = [
|
|
11238
11238
|
Vo,
|
|
11239
|
-
jf,
|
|
11240
|
-
Lo,
|
|
11241
11239
|
Uf,
|
|
11240
|
+
Lo,
|
|
11241
|
+
Gf,
|
|
11242
11242
|
"localhost",
|
|
11243
11243
|
"127.0.0.1",
|
|
11244
11244
|
".local-credentialless.webcontainer.io",
|
|
@@ -11251,12 +11251,12 @@ const Vo = "app.grapesjs.com", Lo = "app-stage.grapesjs.com", jf = "app2.grapesj
|
|
|
11251
11251
|
// For Claude mcp app
|
|
11252
11252
|
".web-sandbox.oaiusercontent.com"
|
|
11253
11253
|
// For OpenAI mcp app
|
|
11254
|
-
],
|
|
11254
|
+
], _f = "license:check:end", Xf = () => typeof window < "u", Yf = ({
|
|
11255
11255
|
isDev: n,
|
|
11256
11256
|
isStage: e,
|
|
11257
11257
|
isPlatform: t
|
|
11258
|
-
}) => `${n ? "" : `https://${e ? Lo : Vo}`}/${t ? "platform-api" : "api"}`,
|
|
11259
|
-
if (!
|
|
11258
|
+
}) => `${n ? "" : `https://${e ? Lo : Vo}`}/${t ? "platform-api" : "api"}`, Zf = () => {
|
|
11259
|
+
if (!Xf()) return "";
|
|
11260
11260
|
const { hostname: n } = window.location;
|
|
11261
11261
|
if (n) return n;
|
|
11262
11262
|
try {
|
|
@@ -11264,11 +11264,11 @@ const Vo = "app.grapesjs.com", Lo = "app-stage.grapesjs.com", jf = "app2.grapesj
|
|
|
11264
11264
|
} catch {
|
|
11265
11265
|
return "";
|
|
11266
11266
|
}
|
|
11267
|
-
},
|
|
11268
|
-
const n =
|
|
11267
|
+
}, Qf = () => {
|
|
11268
|
+
const n = Zf();
|
|
11269
11269
|
return !!n && (Gi.includes(n) || Gi.some((e) => n.endsWith(e)));
|
|
11270
11270
|
};
|
|
11271
|
-
async function
|
|
11271
|
+
async function eh({
|
|
11272
11272
|
path: n,
|
|
11273
11273
|
baseApiUrl: e,
|
|
11274
11274
|
method: t = "GET",
|
|
@@ -11276,7 +11276,7 @@ async function Qf({
|
|
|
11276
11276
|
params: i,
|
|
11277
11277
|
body: s
|
|
11278
11278
|
}) {
|
|
11279
|
-
const l = `${e ||
|
|
11279
|
+
const l = `${e || Yf({ isDev: !1, isStage: !1 })}${n}`, a = {
|
|
11280
11280
|
method: t,
|
|
11281
11281
|
headers: {
|
|
11282
11282
|
"Content-Type": "application/json",
|
|
@@ -11289,19 +11289,22 @@ async function Qf({
|
|
|
11289
11289
|
throw new Error(`HTTP error! status: ${h.status}`);
|
|
11290
11290
|
return h.json();
|
|
11291
11291
|
}
|
|
11292
|
-
var rt = /* @__PURE__ */ ((n) => (n.free = "free", n.startup = "startup", n.business = "business", n.enterprise = "enterprise", n))(rt || {}), ut = /* @__PURE__ */ ((n) => (n.toastAdd = "studio:toastAdd", n.toastRemove = "studio:toastRemove", n.dialogOpen = "studio:dialogOpen", n.dialogClose = "studio:dialogClose", n.dialogExportCode = "studio:dialogExportCode", n.dialogImportCode = "studio:dialogImportCode", n.openEditCode = "studio:openEditCode", n.sidebarLeftSet = "studio:sidebarLeft:set", n.sidebarLeftGet = "studio:sidebarLeft:get", n.sidebarLeftToggle = "studio:sidebarLeft:toggle", n.sidebarRightSet = "studio:sidebarRight:set", n.sidebarRightGet = "studio:sidebarRight:get", n.sidebarRightToggle = "studio:sidebarRight:toggle", n.sidebarTopSet = "studio:sidebarTop:set", n.sidebarTopGet = "studio:sidebarTop:get", n.sidebarTopToggle = "studio:sidebarTop:toggle", n.sidebarBottomSet = "studio:sidebarBottom:set", n.sidebarBottomGet = "studio:sidebarBottom:get", n.sidebarBottomToggle = "studio:sidebarBottom:toggle", n.symbolAdd = "studio:symbolAdd", n.symbolDetach = "studio:symbolDetach", n.symbolOverride = "studio:symbolOverride", n.symbolPropagateStyles = "studio:propagateStyles", n.getPagesConfig = "studio:getPagesConfig", n.setPagesConfig = "studio:setPagesConfig", n.getPageSettings = "studio:getPageSettings", n.setPageSettings = "studio:setPageSettings", n.clearPage = "studio:clearPage", n.projectFiles = "studio:projectFiles", n.validateCode = "studio:validateCode", n.canvasReload = "studio:canvasReload", n.getBlocksPanel = "studio:getBlocksPanel", n.setBlocksPanel = "studio:setBlocksPanel", n.getStateContextMenu = "studio:getStateContextMenu", n.setStateContextMenu = "studio:setStateContextMenu", n.contextMenuComponent = "studio:contextMenuComponent", n.layoutAdd = "studio:layoutAdd", n.layoutRemove = "studio:layoutRemove", n.layoutToggle = "studio:layoutToggle", n.layoutUpdate = "studio:layoutUpdate", n.layoutGet = "studio:layoutGet", n.layoutConfigGet = "studio:layoutConfigGet", n.layoutConfigSet = "studio:layoutConfigSet", n.layoutComponentAdd = "studio:layoutComponentAdd", n.layoutComponentGet = "studio:layoutComponentGet", n.layoutComponentRemove = "studio:layoutComponentRemove", n.layoutComponentRender = "studio:layoutComponentRender", n.getStateTheme = "studio:getStateTheme", n.setStateTheme = "studio:setStateTheme", n.settings = "studio:settings", n.assetProviderGet = "studio:assetProviderGet", n.assetProviderAdd = "studio:assetProviderAdd", n.assetProviderRemove = "studio:assetProviderRemove", n.fontGet = "studio:fontGet", n.fontAdd = "studio:fontAdd", n.fontRemove = "studio:fontRemove", n.fontManagerOpen = "studio:fontManagerOpen", n.menuFontLoad = "studio:menuFontLoad", n.toggleStateDataSource = "studio:toggleStateDataSource", n.getStateDataSource = "studio:getStateDataSource", n.dataSourceSetGlobalData = "studio:dataSourceSetGlobalData", n.dataSourceSetImporter = "studio:dataSourceSetImporter", n.dataSourceSetExporter = "studio:dataSourceSetExporter", n.setDragAbsolute = "studio:setDragAbsolute", n))(ut || {});
|
|
11292
|
+
var rt = /* @__PURE__ */ ((n) => (n.free = "free", n.startup = "startup", n.business = "business", n.enterprise = "enterprise", n))(rt || {}), ut = /* @__PURE__ */ ((n) => (n.toastAdd = "studio:toastAdd", n.toastRemove = "studio:toastRemove", n.dialogOpen = "studio:dialogOpen", n.dialogClose = "studio:dialogClose", n.dialogExportCode = "studio:dialogExportCode", n.dialogImportCode = "studio:dialogImportCode", n.openEditCode = "studio:openEditCode", n.openBlocks = "studio:openBlocks", n.appendComponent = "studio:appendComponent", n.sidebarLeftSet = "studio:sidebarLeft:set", n.sidebarLeftGet = "studio:sidebarLeft:get", n.sidebarLeftToggle = "studio:sidebarLeft:toggle", n.sidebarRightSet = "studio:sidebarRight:set", n.sidebarRightGet = "studio:sidebarRight:get", n.sidebarRightToggle = "studio:sidebarRight:toggle", n.sidebarTopSet = "studio:sidebarTop:set", n.sidebarTopGet = "studio:sidebarTop:get", n.sidebarTopToggle = "studio:sidebarTop:toggle", n.sidebarBottomSet = "studio:sidebarBottom:set", n.sidebarBottomGet = "studio:sidebarBottom:get", n.sidebarBottomToggle = "studio:sidebarBottom:toggle", n.symbolAdd = "studio:symbolAdd", n.symbolDetach = "studio:symbolDetach", n.symbolOverride = "studio:symbolOverride", n.symbolPropagateStyles = "studio:propagateStyles", n.getPagesConfig = "studio:getPagesConfig", n.setPagesConfig = "studio:setPagesConfig", n.getPageSettings = "studio:getPageSettings", n.setPageSettings = "studio:setPageSettings", n.clearPage = "studio:clearPage", n.projectFiles = "studio:projectFiles", n.validateCode = "studio:validateCode", n.canvasReload = "studio:canvasReload", n.getBlocksPanel = "studio:getBlocksPanel", n.setBlocksPanel = "studio:setBlocksPanel", n.getStateContextMenu = "studio:getStateContextMenu", n.setStateContextMenu = "studio:setStateContextMenu", n.contextMenuComponent = "studio:contextMenuComponent", n.layoutAdd = "studio:layoutAdd", n.layoutRemove = "studio:layoutRemove", n.layoutToggle = "studio:layoutToggle", n.layoutUpdate = "studio:layoutUpdate", n.layoutGet = "studio:layoutGet", n.layoutConfigGet = "studio:layoutConfigGet", n.layoutConfigSet = "studio:layoutConfigSet", n.layoutComponentAdd = "studio:layoutComponentAdd", n.layoutComponentGet = "studio:layoutComponentGet", n.layoutComponentRemove = "studio:layoutComponentRemove", n.layoutComponentRender = "studio:layoutComponentRender", n.getStateTheme = "studio:getStateTheme", n.setStateTheme = "studio:setStateTheme", n.settings = "studio:settings", n.assetProviderGet = "studio:assetProviderGet", n.assetProviderAdd = "studio:assetProviderAdd", n.assetProviderRemove = "studio:assetProviderRemove", n.fontGet = "studio:fontGet", n.fontAdd = "studio:fontAdd", n.fontRemove = "studio:fontRemove", n.fontManagerOpen = "studio:fontManagerOpen", n.menuFontLoad = "studio:menuFontLoad", n.toggleStateDataSource = "studio:toggleStateDataSource", n.getStateDataSource = "studio:getStateDataSource", n.dataSourceSetGlobalData = "studio:dataSourceSetGlobalData", n.dataSourceSetImporter = "studio:dataSourceSetImporter", n.dataSourceSetExporter = "studio:dataSourceSetExporter", n.setDragAbsolute = "studio:setDragAbsolute", n))(ut || {});
|
|
11293
11293
|
const _i = {
|
|
11294
11294
|
[rt.free]: 0,
|
|
11295
11295
|
[rt.startup]: 10,
|
|
11296
11296
|
[rt.business]: 20,
|
|
11297
11297
|
[rt.enterprise]: 30
|
|
11298
11298
|
};
|
|
11299
|
-
function
|
|
11300
|
-
const
|
|
11301
|
-
return
|
|
11302
|
-
|
|
11303
|
-
|
|
11304
|
-
|
|
11299
|
+
function th(n, e) {
|
|
11300
|
+
const t = n;
|
|
11301
|
+
return t.init = (r) => {
|
|
11302
|
+
const i = (s) => n(s, r);
|
|
11303
|
+
return i.__gjsPluginId = e, i;
|
|
11304
|
+
}, t;
|
|
11305
|
+
}
|
|
11306
|
+
const nh = (n, e) => /* @__PURE__ */ th(n, e);
|
|
11307
|
+
async function rh({
|
|
11305
11308
|
editor: n,
|
|
11306
11309
|
plan: e,
|
|
11307
11310
|
pluginName: t,
|
|
@@ -11311,7 +11314,7 @@ async function nh({
|
|
|
11311
11314
|
}) {
|
|
11312
11315
|
let o = "", l;
|
|
11313
11316
|
const a = (h) => {
|
|
11314
|
-
console.warn("Cleanup plugin:", t, "Reason:", h), s();
|
|
11317
|
+
console.warn("Cleanup plugin:", t, "Reason:", h), s(n, t);
|
|
11315
11318
|
}, c = (h = {}) => {
|
|
11316
11319
|
var g;
|
|
11317
11320
|
const { error: d, sdkLicense: u } = h, p = (g = h.plan) == null ? void 0 : g.category;
|
|
@@ -11328,9 +11331,9 @@ async function nh({
|
|
|
11328
11331
|
};
|
|
11329
11332
|
if (!l) {
|
|
11330
11333
|
n.onReady(async () => {
|
|
11331
|
-
if (!
|
|
11334
|
+
if (!Qf())
|
|
11332
11335
|
if (r) {
|
|
11333
|
-
const h = await
|
|
11336
|
+
const h = await sh({ licenseKey: r, pluginName: t, baseApiUrl: o });
|
|
11334
11337
|
f(h);
|
|
11335
11338
|
} else
|
|
11336
11339
|
a("The `licenseKey` option not provided");
|
|
@@ -11338,22 +11341,22 @@ async function nh({
|
|
|
11338
11341
|
return;
|
|
11339
11342
|
}
|
|
11340
11343
|
if (l.licensePlan || l.licenseError) {
|
|
11341
|
-
const h =
|
|
11344
|
+
const h = ih(l);
|
|
11342
11345
|
f(h);
|
|
11343
11346
|
return;
|
|
11344
11347
|
}
|
|
11345
|
-
n.on(
|
|
11348
|
+
n.on(_f, (h) => f(h));
|
|
11346
11349
|
}
|
|
11347
|
-
const
|
|
11350
|
+
const ih = (n) => ({
|
|
11348
11351
|
sdkLicense: n.license,
|
|
11349
11352
|
license: n.license,
|
|
11350
11353
|
error: n.licenseError,
|
|
11351
11354
|
plan: n.licensePlan
|
|
11352
11355
|
});
|
|
11353
|
-
async function
|
|
11356
|
+
async function sh(n) {
|
|
11354
11357
|
const { licenseKey: e, pluginName: t, baseApiUrl: r } = n;
|
|
11355
11358
|
try {
|
|
11356
|
-
return (await
|
|
11359
|
+
return (await eh({
|
|
11357
11360
|
baseApiUrl: r,
|
|
11358
11361
|
path: `/sdk/${e || "na"}`,
|
|
11359
11362
|
method: "POST",
|
|
@@ -11366,7 +11369,7 @@ async function ih(n) {
|
|
|
11366
11369
|
return console.error("Error during SDK license check:", i), !1;
|
|
11367
11370
|
}
|
|
11368
11371
|
}
|
|
11369
|
-
const
|
|
11372
|
+
const oh = (n, e) => {
|
|
11370
11373
|
if (!e) return () => {
|
|
11371
11374
|
};
|
|
11372
11375
|
const t = "keydown", r = (s) => {
|
|
@@ -11377,7 +11380,7 @@ const sh = (n, e) => {
|
|
|
11377
11380
|
document.addEventListener(t, r), n.on(n.events.destroy, i);
|
|
11378
11381
|
}), i;
|
|
11379
11382
|
};
|
|
11380
|
-
function
|
|
11383
|
+
function lh(n, e) {
|
|
11381
11384
|
if (!e) return () => {
|
|
11382
11385
|
};
|
|
11383
11386
|
const t = n.Components.events, r = (f) => n.getSelectedAll().includes(f), i = (f) => f.isInstanceOf("text") && !f.isChildOf("text"), s = (f) => f.isChildOf("text"), o = (f) => n.getEditing() === f, l = (f, h = {}) => {
|
|
@@ -11421,13 +11424,13 @@ const Nt = (n) => {
|
|
|
11421
11424
|
return o && (l.style = `${t}: ${o}`), [r, l, 0];
|
|
11422
11425
|
}
|
|
11423
11426
|
};
|
|
11424
|
-
}, Xi = "data-gs-mrk-fs",
|
|
11427
|
+
}, Xi = "data-gs-mrk-fs", ah = "data-gs-mrk-color", ch = "data-gs-mrk-bgcolor", Fo = "data-gs-mrk-wrap", pn = "data-gs-ifrg", ke = "attrs", wn = {
|
|
11425
11428
|
[ke]: { default: "{}" }
|
|
11426
11429
|
}, oe = {
|
|
11427
11430
|
[ke]: { default: {} }
|
|
11428
11431
|
}, Mn = (n) => ({
|
|
11429
11432
|
[ke]: JSON.stringify(Nt(n))
|
|
11430
|
-
}), le = (n) => ({ attrs: Nt(n) }), gt = (n) => (e) => [n, e.attrs.attrs, 0], ce = (n) => n.attrs[ke] ? JSON.parse(n.attrs[ke]) : {},
|
|
11433
|
+
}), le = (n) => ({ attrs: Nt(n) }), gt = (n) => (e) => [n, e.attrs.attrs, 0], ce = (n) => n.attrs[ke] ? JSON.parse(n.attrs[ke]) : {}, fh = {
|
|
11431
11434
|
doc: {
|
|
11432
11435
|
content: "block+"
|
|
11433
11436
|
},
|
|
@@ -11531,7 +11534,7 @@ const Nt = (n) => {
|
|
|
11531
11534
|
return [e ? `h${e}` : "div", n.attrs, 0];
|
|
11532
11535
|
}
|
|
11533
11536
|
},
|
|
11534
|
-
...
|
|
11537
|
+
...pf({
|
|
11535
11538
|
tableGroup: "block",
|
|
11536
11539
|
cellContent: "block+",
|
|
11537
11540
|
cellAttributes: {
|
|
@@ -11583,7 +11586,7 @@ const Nt = (n) => {
|
|
|
11583
11586
|
getAttrs: Mn
|
|
11584
11587
|
})),
|
|
11585
11588
|
toDOM: e
|
|
11586
|
-
}),
|
|
11589
|
+
}), hh = (n) => ({
|
|
11587
11590
|
attrs: { ...wn },
|
|
11588
11591
|
parseDOM: [
|
|
11589
11592
|
{
|
|
@@ -11597,13 +11600,13 @@ const Nt = (n) => {
|
|
|
11597
11600
|
[n]: !0
|
|
11598
11601
|
}, 0];
|
|
11599
11602
|
}
|
|
11600
|
-
}),
|
|
11603
|
+
}), dh = {
|
|
11601
11604
|
strong: yt(["strong", "b"], (n) => ["b", ce(n)]),
|
|
11602
11605
|
link: yt(["a"], (n) => ["a", ce(n), 0]),
|
|
11603
11606
|
em: yt(["em", "i"], (n) => ["em", ce(n)]),
|
|
11604
11607
|
underline: yt(["u"], (n) => ["u", ce(n), 0]),
|
|
11605
11608
|
strikethrough: yt(["s"], (n) => ["s", ce(n), 0]),
|
|
11606
|
-
wrapStyle:
|
|
11609
|
+
wrapStyle: hh(Fo),
|
|
11607
11610
|
font_size: {
|
|
11608
11611
|
attrs: {
|
|
11609
11612
|
...wn,
|
|
@@ -11627,19 +11630,19 @@ const Nt = (n) => {
|
|
|
11627
11630
|
}
|
|
11628
11631
|
},
|
|
11629
11632
|
color: pr({
|
|
11630
|
-
key:
|
|
11633
|
+
key: ah,
|
|
11631
11634
|
cssProperty: "color"
|
|
11632
11635
|
}),
|
|
11633
11636
|
bgColor: pr({
|
|
11634
|
-
key:
|
|
11637
|
+
key: ch,
|
|
11635
11638
|
cssProperty: "background-color"
|
|
11636
11639
|
})
|
|
11637
|
-
}, Yi = new
|
|
11638
|
-
nodes:
|
|
11639
|
-
marks:
|
|
11640
|
-
}), Ft = /* @__PURE__ */ new WeakMap(), Ir = /* @__PURE__ */ new WeakMap(),
|
|
11640
|
+
}, Yi = new dl({
|
|
11641
|
+
nodes: fh,
|
|
11642
|
+
marks: dh
|
|
11643
|
+
}), Ft = /* @__PURE__ */ new WeakMap(), Ir = /* @__PURE__ */ new WeakMap(), uh = (n, e, t) => {
|
|
11641
11644
|
Ft.set(n, { view: e, gjsView: t, initialDoc: e.state.doc }), Ir.set(e, { el: n, gjsView: t });
|
|
11642
|
-
},
|
|
11645
|
+
}, ph = (n, e) => {
|
|
11643
11646
|
Ft.delete(n), Ir.delete(e);
|
|
11644
11647
|
}, Zt = (n) => Ft.get(n), Ho = (n) => Ir.get(n), Zi = (n) => {
|
|
11645
11648
|
const e = Zt(n), t = e == null ? void 0 : e.view, r = e == null ? void 0 : e.initialDoc;
|
|
@@ -11647,8 +11650,8 @@ const Nt = (n) => {
|
|
|
11647
11650
|
}, Kn = (n) => {
|
|
11648
11651
|
var e, t;
|
|
11649
11652
|
return (t = (e = Ho(n)) == null ? void 0 : e.gjsView) == null ? void 0 : t.model;
|
|
11650
|
-
},
|
|
11651
|
-
function
|
|
11653
|
+
}, mh = (n) => n.dispatchEvent(new CustomEvent("input"));
|
|
11654
|
+
function gh(n) {
|
|
11652
11655
|
const e = (t) => {
|
|
11653
11656
|
if (t.tagName === "SPAN" && t.hasAttribute(pn)) {
|
|
11654
11657
|
if (t.getAttribute("style")) {
|
|
@@ -11674,10 +11677,10 @@ const $o = (n) => {
|
|
|
11674
11677
|
} else
|
|
11675
11678
|
$o(e);
|
|
11676
11679
|
});
|
|
11677
|
-
},
|
|
11680
|
+
}, yh = (n, e) => {
|
|
11678
11681
|
const t = Wo(n);
|
|
11679
|
-
return t &&
|
|
11680
|
-
},
|
|
11682
|
+
return t && Dh(t) ? kh(n, e) : t ? $s(() => ({ type: n.schema.nodes.div }))(n, e) : !1;
|
|
11683
|
+
}, bh = (n, e) => (t, r) => {
|
|
11681
11684
|
var l;
|
|
11682
11685
|
const i = Wo(t), s = Ft.get(n.el).view, o = (l = e.onEnter) == null ? void 0 : l.call(e, {
|
|
11683
11686
|
...n,
|
|
@@ -11685,7 +11688,7 @@ const $o = (n) => {
|
|
|
11685
11688
|
commands: vr(s, n.editor, e),
|
|
11686
11689
|
proseMirror: { view: s, dispatch: r }
|
|
11687
11690
|
});
|
|
11688
|
-
return o !== void 0 ? o :
|
|
11691
|
+
return o !== void 0 ? o : yh(t, r);
|
|
11689
11692
|
};
|
|
11690
11693
|
function Wo(n) {
|
|
11691
11694
|
const e = n.selection.$from;
|
|
@@ -11695,13 +11698,13 @@ function Wo(n) {
|
|
|
11695
11698
|
}
|
|
11696
11699
|
return e.node(e.depth);
|
|
11697
11700
|
}
|
|
11698
|
-
function
|
|
11701
|
+
function kh(n, e) {
|
|
11699
11702
|
const { selection: t, schema: r, tr: i } = n;
|
|
11700
11703
|
i.split(t.from, 1);
|
|
11701
11704
|
const s = t.from + 1, o = i.doc.nodeAt(s), l = { ...o.attrs.attrs, id: void 0 }, a = o.textContent.length > 0, c = o.textContent.length || 0, f = o.textContent || " ", h = r.text(f), d = r.nodes.div.create(l, a ? h : [], []);
|
|
11702
11705
|
return i.replaceRangeWith(s, s + c + 2, d), i.setSelection(C.create(i.doc, s + 1)), e == null || e(i.scrollIntoView()), !0;
|
|
11703
11706
|
}
|
|
11704
|
-
function
|
|
11707
|
+
function xh(n, e, t) {
|
|
11705
11708
|
const { state: r, dispatch: i } = n, { selection: s, tr: o } = r, l = (a, c, f) => {
|
|
11706
11709
|
const h = {};
|
|
11707
11710
|
return a.split(";").forEach((d) => {
|
|
@@ -11754,7 +11757,7 @@ const bt = (n, e) => {
|
|
|
11754
11757
|
s.marks.some((o) => o.type === e) && (i = !0);
|
|
11755
11758
|
}), i;
|
|
11756
11759
|
};
|
|
11757
|
-
function
|
|
11760
|
+
function Sh(n) {
|
|
11758
11761
|
var h, d;
|
|
11759
11762
|
const { view: e, href: t, options: r, target: i = "_blank" } = n, { state: s, dispatch: o } = e, { schema: l, selection: a, tr: c } = s, f = l.marks.link;
|
|
11760
11763
|
try {
|
|
@@ -11764,7 +11767,7 @@ function xh(n) {
|
|
|
11764
11767
|
console.error("Error applying link mark:", u);
|
|
11765
11768
|
}
|
|
11766
11769
|
}
|
|
11767
|
-
function
|
|
11770
|
+
function Ch(n, e) {
|
|
11768
11771
|
const { state: t, dispatch: r } = n, { selection: i, tr: s } = t;
|
|
11769
11772
|
if (i.empty) return;
|
|
11770
11773
|
const o = t.schema.marks.font_size;
|
|
@@ -11774,7 +11777,7 @@ function Sh(n, e) {
|
|
|
11774
11777
|
}
|
|
11775
11778
|
s.addMark(i.from, i.to, o.create({ size: e })), r(s.scrollIntoView());
|
|
11776
11779
|
}
|
|
11777
|
-
function
|
|
11780
|
+
function wh(n, e) {
|
|
11778
11781
|
const { state: t, dispatch: r } = n, { selection: i, tr: s } = t;
|
|
11779
11782
|
if (i.empty) return;
|
|
11780
11783
|
const o = t.schema.marks.color;
|
|
@@ -11784,7 +11787,7 @@ function Ch(n, e) {
|
|
|
11784
11787
|
}
|
|
11785
11788
|
s.addMark(i.from, i.to, o.create({ value: e })), r(s.scrollIntoView());
|
|
11786
11789
|
}
|
|
11787
|
-
function
|
|
11790
|
+
function Mh(n, e) {
|
|
11788
11791
|
const { state: t, dispatch: r } = n, { selection: i, tr: s } = t;
|
|
11789
11792
|
if (i.empty) return;
|
|
11790
11793
|
const o = t.schema.marks.bgColor;
|
|
@@ -11806,11 +11809,11 @@ const He = (n, e) => {
|
|
|
11806
11809
|
node: o
|
|
11807
11810
|
};
|
|
11808
11811
|
}
|
|
11809
|
-
},
|
|
11812
|
+
}, Oh = (n) => (n || "").split(";").map((e) => e.split(":")).reduce(
|
|
11810
11813
|
(e, [t, r]) => (t = t.replace(/-./g, (i) => i.toUpperCase()[1]).trim(), e[t] = `${r}`.trim(), e),
|
|
11811
11814
|
{}
|
|
11812
11815
|
);
|
|
11813
|
-
function
|
|
11816
|
+
function Nh(...n) {
|
|
11814
11817
|
return (e, t) => {
|
|
11815
11818
|
const r = (o) => {
|
|
11816
11819
|
e = e.apply(o), t == null || t(o);
|
|
@@ -11818,7 +11821,7 @@ function Oh(...n) {
|
|
|
11818
11821
|
return n.reduce((o, l) => o || l(e, r), !1) && i !== void 0 && i(e, t);
|
|
11819
11822
|
};
|
|
11820
11823
|
}
|
|
11821
|
-
const
|
|
11824
|
+
const Th = (n, e) => {
|
|
11822
11825
|
const { state: t, dispatch: r } = n;
|
|
11823
11826
|
if (e != null && e.event) {
|
|
11824
11827
|
const { event: i } = e, s = n.posAtCoords({ left: i.clientX, top: i.clientY });
|
|
@@ -11826,19 +11829,19 @@ const Nh = (n, e) => {
|
|
|
11826
11829
|
} else
|
|
11827
11830
|
Ws(t, r);
|
|
11828
11831
|
setTimeout(() => setTimeout(() => n.focus()));
|
|
11829
|
-
}, mr = (n) => n.isBlock, Jo = (n) => n.type.name === "inlineFragment",
|
|
11832
|
+
}, mr = (n) => n.isBlock, Jo = (n) => n.type.name === "inlineFragment", Ah = (n) => mr(n) && !Jo(n), qo = (n) => n.type.name === "bulletList", Ko = (n) => n.type.name === "orderedList", Dh = (n) => n.type.name === "heading", Eh = (n) => qo(n) || Ko(n), Qi = (n, e) => {
|
|
11830
11833
|
var s, o;
|
|
11831
11834
|
const t = (s = He(n, (l) => l.type === e)) == null ? void 0 : s.node, r = n.state.schema.nodes.listItem;
|
|
11832
11835
|
let i;
|
|
11833
|
-
return t ? i = Zn(r) : (o = He(n,
|
|
11836
|
+
return t ? i = Zn(r) : (o = He(n, Eh)) != null && o.node ? i = Nh(Zn(r), ri(e)) : i = ri(e), i(n.state, n.dispatch);
|
|
11834
11837
|
}, jo = (n, e) => {
|
|
11835
11838
|
const { selection: t } = n.state;
|
|
11836
11839
|
return [...t.$from.marks(), ...t.$to.marks()].find((r) => r.type.name === e);
|
|
11837
|
-
},
|
|
11840
|
+
}, Rh = (n) => {
|
|
11838
11841
|
var o;
|
|
11839
|
-
const { view: e, prop: t, editor: r, propCSS: i } = n, s = (o = He(e,
|
|
11842
|
+
const { view: e, prop: t, editor: r, propCSS: i } = n, s = (o = He(e, Ah)) == null ? void 0 : o.node;
|
|
11840
11843
|
if (s) {
|
|
11841
|
-
const l = s.attrs.attrs || {}, a =
|
|
11844
|
+
const l = s.attrs.attrs || {}, a = Oh(l.style);
|
|
11842
11845
|
if (t in a)
|
|
11843
11846
|
return a[t] || "";
|
|
11844
11847
|
if (l.id) {
|
|
@@ -11928,24 +11931,24 @@ const Nh = (n, e) => {
|
|
|
11928
11931
|
const u = (m = (p = Ho(n)) == null ? void 0 : p.gjsView) == null ? void 0 : m.el;
|
|
11929
11932
|
u && u.contentEditable !== "true" && (u.contentEditable = "true"), n.focus();
|
|
11930
11933
|
};
|
|
11931
|
-
a != null && a.is("link") ? (a.addAttributes({ href: f, target: h }), d()) : c ? (a == null || a.addAttributes({ [c.getName()]: f }), d()) :
|
|
11934
|
+
a != null && a.is("link") ? (a.addAttributes({ href: f, target: h }), d()) : c ? (a == null || a.addAttributes({ [c.getName()]: f }), d()) : Sh({ view: n, href: f, target: h, options: t });
|
|
11932
11935
|
}
|
|
11933
11936
|
},
|
|
11934
11937
|
alignText: {
|
|
11935
|
-
get: () =>
|
|
11936
|
-
set: (l) =>
|
|
11938
|
+
get: () => Rh({ view: n, editor: e, prop: "textAlign", propCSS: "text-align" }),
|
|
11939
|
+
set: (l) => xh(n, l.value, !0)
|
|
11937
11940
|
},
|
|
11938
11941
|
fontSize: {
|
|
11939
11942
|
get: () => jn({ view: n, editor: e, markName: "font_size", prop: "size", propCSS: "font-size" }),
|
|
11940
|
-
set: (l) =>
|
|
11943
|
+
set: (l) => Ch(n, l.value)
|
|
11941
11944
|
},
|
|
11942
11945
|
color: {
|
|
11943
11946
|
get: () => jn({ view: n, editor: e, markName: "color", prop: "value", propCSS: "color" }),
|
|
11944
|
-
set: (l) =>
|
|
11947
|
+
set: (l) => wh(n, l.value)
|
|
11945
11948
|
},
|
|
11946
11949
|
bgColor: {
|
|
11947
11950
|
get: () => jn({ view: n, editor: e, markName: "bgColor", prop: "value", propCSS: "background-color" }),
|
|
11948
|
-
set: (l) =>
|
|
11951
|
+
set: (l) => Mh(n, l.value)
|
|
11949
11952
|
},
|
|
11950
11953
|
image: {
|
|
11951
11954
|
open() {
|
|
@@ -11974,7 +11977,7 @@ const Nh = (n, e) => {
|
|
|
11974
11977
|
set: ({ value: l }) => {
|
|
11975
11978
|
var f;
|
|
11976
11979
|
const { state: a } = n, c = (f = He(n, mr)) == null ? void 0 : f.node;
|
|
11977
|
-
|
|
11980
|
+
sa(a.schema.nodes.heading, {
|
|
11978
11981
|
attrs: c == null ? void 0 : c.attrs.attrs,
|
|
11979
11982
|
level: l ? parseInt(l, 10) : 0
|
|
11980
11983
|
})(a, r);
|
|
@@ -11997,7 +12000,7 @@ const Nh = (n, e) => {
|
|
|
11997
12000
|
};
|
|
11998
12001
|
return o;
|
|
11999
12002
|
};
|
|
12000
|
-
class
|
|
12003
|
+
class ze {
|
|
12001
12004
|
// :: (RegExp, union<string, (state: EditorState, match: [string], start: number, end: number) → ?Transaction>)
|
|
12002
12005
|
/**
|
|
12003
12006
|
Create an input rule. The rule applies when the user typed
|
|
@@ -12016,10 +12019,10 @@ class Be {
|
|
|
12016
12019
|
rule's effect, or null to indicate the input was not handled.
|
|
12017
12020
|
*/
|
|
12018
12021
|
constructor(e, t, r = {}) {
|
|
12019
|
-
this.match = e, this.match = e, this.handler = typeof t == "string" ?
|
|
12022
|
+
this.match = e, this.match = e, this.handler = typeof t == "string" ? Ih(t) : t, this.undoable = r.undoable !== !1, this.inCode = r.inCode || !1;
|
|
12020
12023
|
}
|
|
12021
12024
|
}
|
|
12022
|
-
function
|
|
12025
|
+
function Ih(n) {
|
|
12023
12026
|
return function(e, t, r, i) {
|
|
12024
12027
|
let s = n;
|
|
12025
12028
|
if (t[1]) {
|
|
@@ -12031,8 +12034,8 @@ function Rh(n) {
|
|
|
12031
12034
|
return e.tr.insertText(s, r, i);
|
|
12032
12035
|
};
|
|
12033
12036
|
}
|
|
12034
|
-
const
|
|
12035
|
-
function
|
|
12037
|
+
const vh = 500;
|
|
12038
|
+
function Bh({ rules: n }) {
|
|
12036
12039
|
let e = new pt({
|
|
12037
12040
|
state: {
|
|
12038
12041
|
init() {
|
|
@@ -12063,7 +12066,7 @@ function vh({ rules: n }) {
|
|
|
12063
12066
|
function es(n, e, t, r, i, s) {
|
|
12064
12067
|
if (n.composing)
|
|
12065
12068
|
return !1;
|
|
12066
|
-
let o = n.state, l = o.doc.resolve(e), a = l.parent.textBetween(Math.max(0, l.parentOffset -
|
|
12069
|
+
let o = n.state, l = o.doc.resolve(e), a = l.parent.textBetween(Math.max(0, l.parentOffset - vh), l.parentOffset, null, "") + r;
|
|
12067
12070
|
for (let c = 0; c < i.length; c++) {
|
|
12068
12071
|
let f = i[c];
|
|
12069
12072
|
if (l.parent.type.spec.code) {
|
|
@@ -12077,9 +12080,9 @@ function es(n, e, t, r, i, s) {
|
|
|
12077
12080
|
}
|
|
12078
12081
|
return !1;
|
|
12079
12082
|
}
|
|
12080
|
-
const zh = new
|
|
12081
|
-
function
|
|
12082
|
-
return new
|
|
12083
|
+
const zh = new ze(/--$/, "—"), Ph = new ze(/\.\.\.$/, "…"), Vh = new ze(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/, "“"), Lh = new ze(/"$/, "”"), Fh = new ze(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/, "‘"), Hh = new ze(/'$/, "’"), $h = [Vh, Lh, Fh, Hh];
|
|
12084
|
+
function Br(n, e, t = null, r) {
|
|
12085
|
+
return new ze(n, (i, s, o, l) => {
|
|
12083
12086
|
let a = t instanceof Function ? t(s) : t, c = i.tr.delete(o, l), f = c.doc.resolve(o), h = f.blockRange(), d = h && Os(h, e, a);
|
|
12084
12087
|
if (!d)
|
|
12085
12088
|
return null;
|
|
@@ -12089,39 +12092,39 @@ function zr(n, e, t = null, r) {
|
|
|
12089
12092
|
});
|
|
12090
12093
|
}
|
|
12091
12094
|
function Uo(n, e, t = null) {
|
|
12092
|
-
return new
|
|
12095
|
+
return new ze(n, (r, i, s, o) => {
|
|
12093
12096
|
let l = r.doc.resolve(s), a = t instanceof Function ? t(i) : t;
|
|
12094
12097
|
return l.node(-1).canReplaceWith(l.index(-1), l.indexAfter(-1), e) ? r.tr.delete(s, o).setBlockType(s, s, e, a) : null;
|
|
12095
12098
|
});
|
|
12096
12099
|
}
|
|
12097
|
-
function $h(n) {
|
|
12098
|
-
return zr(/^\s*>\s$/, n);
|
|
12099
|
-
}
|
|
12100
12100
|
function Wh(n) {
|
|
12101
|
-
return
|
|
12101
|
+
return Br(/^\s*>\s$/, n);
|
|
12102
|
+
}
|
|
12103
|
+
function Jh(n) {
|
|
12104
|
+
return Br(
|
|
12102
12105
|
/^(\d+)\.\s$/,
|
|
12103
12106
|
n,
|
|
12104
12107
|
(e) => ({ order: +e[1] }),
|
|
12105
12108
|
(e, t) => t.childCount + t.attrs.order == +e[1]
|
|
12106
12109
|
);
|
|
12107
12110
|
}
|
|
12108
|
-
function Jh(n) {
|
|
12109
|
-
return zr(/^\s*([-+*])\s$/, n);
|
|
12110
|
-
}
|
|
12111
12111
|
function qh(n) {
|
|
12112
|
+
return Br(/^\s*([-+*])\s$/, n);
|
|
12113
|
+
}
|
|
12114
|
+
function Kh(n) {
|
|
12112
12115
|
return Uo(/^```$/, n);
|
|
12113
12116
|
}
|
|
12114
|
-
function
|
|
12117
|
+
function jh(n, e) {
|
|
12115
12118
|
return Uo(new RegExp("^(#{1," + e + "})\\s$"), n, (t) => ({
|
|
12116
12119
|
level: t[1].length
|
|
12117
12120
|
}));
|
|
12118
12121
|
}
|
|
12119
|
-
function
|
|
12120
|
-
const e =
|
|
12122
|
+
function Uh(n) {
|
|
12123
|
+
const e = $h.concat(Ph, zh);
|
|
12121
12124
|
let t;
|
|
12122
|
-
return (t = n.nodes.blockquote) && e.push(
|
|
12125
|
+
return (t = n.nodes.blockquote) && e.push(Wh(t)), (t = n.nodes.orderedList) && e.push(Jh(t)), (t = n.nodes.bulletList) && e.push(qh(t)), (t = n.nodes.codeBlock) && e.push(Kh(t)), (t = n.nodes.heading) && e.push(jh(t, 6)), Bh({ rules: e });
|
|
12123
12126
|
}
|
|
12124
|
-
const
|
|
12127
|
+
const Go = "rteProseMirror", Gh = rt.free, q = "rte:selectionchange", I = {
|
|
12125
12128
|
bold: '<svg viewBox="0 0 24 24"><path d="M13.5,15.5H10V12.5H13.5A1.5,1.5 0 0,1 15,14A1.5,1.5 0 0,1 13.5,15.5M10,6.5H13A1.5,1.5 0 0,1 14.5,8A1.5,1.5 0 0,1 13,9.5H10M15.6,10.79C16.57,10.11 17.25,9 17.25,8C17.25,5.74 15.5,4 13.25,4H7V18H14.04C16.14,18 17.75,16.3 17.75,14.21C17.75,12.69 16.89,11.39 15.6,10.79Z" /></svg>',
|
|
12126
12129
|
italic: '<svg viewBox="0 0 24 24"><path d="M10,4V7H12.21L8.79,15H6V18H14V15H11.79L15.21,7H18V4H10Z" /></svg>',
|
|
12127
12130
|
underline: '<svg viewBox="0 0 24 24"><path d="M5,21H19V19H5V21M12,17A6,6 0 0,0 18,11V3H15.5V11A3.5,3.5 0 0,1 12,14.5A3.5,3.5 0 0,1 8.5,11V3H6V11A6,6 0 0,0 12,17Z" /></svg>',
|
|
@@ -12546,16 +12549,16 @@ const Yh = function(n, e = {}) {
|
|
|
12546
12549
|
editor: n,
|
|
12547
12550
|
Plugin: pt,
|
|
12548
12551
|
plugins: [
|
|
12549
|
-
|
|
12550
|
-
|
|
12551
|
-
|
|
12552
|
-
|
|
12552
|
+
Pf(),
|
|
12553
|
+
jf(),
|
|
12554
|
+
Uh(c),
|
|
12555
|
+
ya(),
|
|
12553
12556
|
Ln({
|
|
12554
12557
|
Tab: Hi(1),
|
|
12555
12558
|
"Shift-Tab": Hi(-1)
|
|
12556
12559
|
}),
|
|
12557
12560
|
Ln({
|
|
12558
|
-
Enter: Dt(Hs,
|
|
12561
|
+
Enter: Dt(Hs, Oa(f.listItem), bh(d, t)),
|
|
12559
12562
|
"Shift-Enter": Dt(Fs, (w, N) => (N && N(w.tr.replaceSelectionWith(f.inlineBreak.create()).scrollIntoView()), !0)),
|
|
12560
12563
|
"Mod-z": Gs,
|
|
12561
12564
|
"Mod-y": Yn,
|
|
@@ -12565,12 +12568,12 @@ const Yh = function(n, e = {}) {
|
|
|
12565
12568
|
"Mod-b": Pe(h.strong),
|
|
12566
12569
|
"Mod-i": Pe(h.em),
|
|
12567
12570
|
"Shift-Tab": Zn(f.listItem),
|
|
12568
|
-
Tab:
|
|
12571
|
+
Tab: Aa(f.listItem)
|
|
12569
12572
|
}),
|
|
12570
|
-
Ln(
|
|
12573
|
+
Ln(aa)
|
|
12571
12574
|
]
|
|
12572
12575
|
})
|
|
12573
|
-
}), m = new
|
|
12576
|
+
}), m = new lf(
|
|
12574
12577
|
// this mounts the editor on the element instead of creating its own container
|
|
12575
12578
|
{ mount: l },
|
|
12576
12579
|
{
|
|
@@ -12580,7 +12583,7 @@ const Yh = function(n, e = {}) {
|
|
|
12580
12583
|
const { state: N } = m, F = N.apply(w), R = !N.doc.eq(F.doc);
|
|
12581
12584
|
m.updateState(F);
|
|
12582
12585
|
const A = !N.selection.eq(F.selection);
|
|
12583
|
-
R && (
|
|
12586
|
+
R && (mh(((Q = a == null ? void 0 : a.view) == null ? void 0 : Q.el) || l), m.focus()), (A || R) && n.trigger(q);
|
|
12584
12587
|
}
|
|
12585
12588
|
}
|
|
12586
12589
|
);
|
|
@@ -12601,13 +12604,13 @@ const Yh = function(n, e = {}) {
|
|
|
12601
12604
|
const f = Zt(l);
|
|
12602
12605
|
if (f) return f;
|
|
12603
12606
|
const h = r(l, c);
|
|
12604
|
-
return
|
|
12607
|
+
return uh(l, h, c.view), Th(h, c), h;
|
|
12605
12608
|
},
|
|
12606
12609
|
disable(l) {
|
|
12607
12610
|
const a = Zt(l), c = a == null ? void 0 : a.view;
|
|
12608
12611
|
if (c) {
|
|
12609
12612
|
const f = Zi(l);
|
|
12610
|
-
return
|
|
12613
|
+
return ph(l, c), f || n.once(n.RichTextEditor.events.disable, () => {
|
|
12611
12614
|
a.gjsView.model.trigger("rerender");
|
|
12612
12615
|
}), c.destroy(), { forceSync: f };
|
|
12613
12616
|
}
|
|
@@ -12623,22 +12626,22 @@ const Yh = function(n, e = {}) {
|
|
|
12623
12626
|
return m.childNodes.forEach((g) => {
|
|
12624
12627
|
var b;
|
|
12625
12628
|
g.nodeType === Node.ELEMENT_NODE && (g.innerHTML === "" ? g.innerHTML = "<br/>" : ((b = g.lastChild) == null ? void 0 : b.nodeName) === "BR" && g.appendChild(document.createElement("br")));
|
|
12626
|
-
}), p.appendChild(m),
|
|
12629
|
+
}), p.appendChild(m), gh(p), l.classList.remove("ProseMirror-focused"), p.innerHTML;
|
|
12627
12630
|
}
|
|
12628
12631
|
return l.innerHTML;
|
|
12629
12632
|
}
|
|
12630
12633
|
});
|
|
12631
|
-
const s =
|
|
12632
|
-
|
|
12634
|
+
const s = lh(n, t.enableOnClick), o = oh(n, t.disableOnEsc);
|
|
12635
|
+
rh({
|
|
12633
12636
|
editor: n,
|
|
12634
12637
|
licenseKey: t.licenseKey,
|
|
12635
12638
|
plan: Gh,
|
|
12636
|
-
pluginName:
|
|
12639
|
+
pluginName: Go,
|
|
12637
12640
|
cleanup: () => {
|
|
12638
12641
|
n.RichTextEditor.customRte = void 0, s(), o();
|
|
12639
12642
|
}
|
|
12640
12643
|
});
|
|
12641
|
-
}, Zh =
|
|
12644
|
+
}, Zh = nh(Yh, Go);
|
|
12642
12645
|
export {
|
|
12643
12646
|
Zh as default
|
|
12644
12647
|
};
|