@grapesjs/studio-sdk-plugins 1.0.28-rc.2 → 1.0.28
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 +8 -8
- package/dist/accordionComponent/index.es.js +71 -69
- package/dist/accordionComponent/index.umd.js +6 -6
- package/dist/animationComponent/index.cjs.js +3 -3
- package/dist/animationComponent/index.es.js +48 -46
- package/dist/animationComponent/index.umd.js +3 -3
- package/dist/canvasAbsoluteMode/index.cjs.js +1 -1
- package/dist/canvasAbsoluteMode/index.es.js +86 -84
- package/dist/canvasAbsoluteMode/index.umd.js +1 -1
- package/dist/canvasEmptyState/index.cjs.js +1 -1
- package/dist/canvasEmptyState/index.es.js +68 -66
- package/dist/canvasEmptyState/index.umd.js +1 -1
- package/dist/canvasFullSize/index.cjs.js +3 -3
- package/dist/canvasFullSize/index.es.js +52 -50
- package/dist/canvasFullSize/index.umd.js +7 -7
- package/dist/canvasGridMode/index.cjs.js +5 -5
- package/dist/canvasGridMode/index.es.js +191 -189
- package/dist/canvasGridMode/index.umd.js +2 -2
- package/dist/dataSourceEjs/index.cjs.js +3 -3
- package/dist/dataSourceEjs/index.es.js +32 -30
- package/dist/dataSourceEjs/index.umd.js +3 -3
- package/dist/dataSourceHandlebars/index.cjs.js +4 -4
- package/dist/dataSourceHandlebars/index.es.js +31 -29
- package/dist/dataSourceHandlebars/index.umd.js +2 -2
- package/dist/dialogComponent/index.cjs.js +3 -3
- package/dist/dialogComponent/index.es.js +32 -30
- package/dist/dialogComponent/index.umd.js +4 -4
- package/dist/flexComponent/index.cjs.js +6 -6
- package/dist/flexComponent/index.es.js +74 -72
- package/dist/flexComponent/index.umd.js +7 -7
- package/dist/fsLightboxComponent/index.cjs.js +2 -2
- package/dist/fsLightboxComponent/index.es.js +40 -38
- package/dist/fsLightboxComponent/index.umd.js +2 -2
- package/dist/googleFontsAssetProvider/index.cjs.js +1 -1
- package/dist/googleFontsAssetProvider/index.es.js +70 -68
- package/dist/googleFontsAssetProvider/index.umd.js +1 -1
- package/dist/iconifyComponent/index.cjs.js +2 -2
- package/dist/iconifyComponent/index.es.js +56 -54
- package/dist/iconifyComponent/index.umd.js +2 -2
- package/dist/index.cjs.js +43 -43
- package/dist/index.es.js +1442 -1440
- package/dist/index.umd.js +43 -43
- package/dist/layoutSidebarButtons/index.cjs.js +1 -1
- package/dist/layoutSidebarButtons/index.es.js +29 -27
- package/dist/layoutSidebarButtons/index.umd.js +1 -1
- package/dist/lightGalleryComponent/index.cjs.js +1 -1
- package/dist/lightGalleryComponent/index.es.js +90 -88
- package/dist/lightGalleryComponent/index.umd.js +1 -1
- package/dist/linkImageComponent/index.cjs.js +2 -2
- package/dist/linkImageComponent/index.es.js +20 -18
- package/dist/linkImageComponent/index.umd.js +2 -2
- package/dist/listPagesComponent/index.cjs.js +4 -4
- package/dist/listPagesComponent/index.es.js +42 -40
- package/dist/listPagesComponent/index.umd.js +4 -4
- package/dist/presetPrintable/index.cjs.js +3 -3
- package/dist/presetPrintable/index.es.js +156 -154
- package/dist/presetPrintable/index.umd.js +3 -3
- package/dist/prosemirror/index.cjs.js +7 -7
- package/dist/prosemirror/index.es.js +165 -163
- package/dist/prosemirror/index.umd.js +7 -7
- package/dist/rendererReact/index.cjs.js +1 -1
- package/dist/rendererReact/index.es.js +101 -99
- 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 +54 -52
- package/dist/rteTinyMce/index.umd.js +2 -2
- package/dist/swiperComponent/index.cjs.js +7 -7
- package/dist/swiperComponent/index.es.js +60 -58
- package/dist/swiperComponent/index.umd.js +9 -9
- package/dist/tableComponent/index.cjs.js +1 -1
- package/dist/tableComponent/index.es.js +80 -78
- package/dist/tableComponent/index.umd.js +1 -1
- package/dist/youtubeAssetProvider/index.cjs.js +1 -1
- package/dist/youtubeAssetProvider/index.es.js +66 -64
- package/dist/youtubeAssetProvider/index.umd.js +1 -1
- package/package.json +1 -1
|
@@ -652,7 +652,7 @@ function rs(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 } = jo(t, n);
|
|
656
656
|
return We(s, ss(n, o, l, e, r));
|
|
657
657
|
}
|
|
658
658
|
else return We(s, Qt(n, e, r));
|
|
@@ -691,7 +691,7 @@ function Qt(n, e, t) {
|
|
|
691
691
|
}
|
|
692
692
|
return St(e, null, t, r), new y(r);
|
|
693
693
|
}
|
|
694
|
-
function
|
|
694
|
+
function jo(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));
|
|
@@ -942,12 +942,12 @@ class Nt {
|
|
|
942
942
|
return o;
|
|
943
943
|
}
|
|
944
944
|
else
|
|
945
|
-
vr.set(e, r = new
|
|
945
|
+
vr.set(e, r = new Uo());
|
|
946
946
|
let i = r.elts[r.i] = Nt.resolve(e, t);
|
|
947
947
|
return r.i = (r.i + 1) % Go, i;
|
|
948
948
|
}
|
|
949
949
|
}
|
|
950
|
-
class
|
|
950
|
+
class Uo {
|
|
951
951
|
constructor() {
|
|
952
952
|
this.elts = [], this.i = 0;
|
|
953
953
|
}
|
|
@@ -1407,7 +1407,7 @@ function ls(n, e) {
|
|
|
1407
1407
|
e = n[t].type.name + "(" + e + ")";
|
|
1408
1408
|
return e;
|
|
1409
1409
|
}
|
|
1410
|
-
class
|
|
1410
|
+
class Ue {
|
|
1411
1411
|
/**
|
|
1412
1412
|
@internal
|
|
1413
1413
|
*/
|
|
@@ -1420,7 +1420,7 @@ class je {
|
|
|
1420
1420
|
static parse(e, t) {
|
|
1421
1421
|
let r = new Xo(e, t);
|
|
1422
1422
|
if (r.next == null)
|
|
1423
|
-
return
|
|
1423
|
+
return Ue.empty;
|
|
1424
1424
|
let i = as(r);
|
|
1425
1425
|
r.next && r.err("Unexpected trailing text");
|
|
1426
1426
|
let s = rl(nl(i));
|
|
@@ -1569,7 +1569,7 @@ class je {
|
|
|
1569
1569
|
`);
|
|
1570
1570
|
}
|
|
1571
1571
|
}
|
|
1572
|
-
|
|
1572
|
+
Ue.empty = new Ue(!0);
|
|
1573
1573
|
class Xo {
|
|
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();
|
|
@@ -1732,7 +1732,7 @@ function rl(n) {
|
|
|
1732
1732
|
});
|
|
1733
1733
|
});
|
|
1734
1734
|
});
|
|
1735
|
-
let s = e[r.join(",")] = new
|
|
1735
|
+
let s = e[r.join(",")] = new Ue(r.indexOf(n.length - 1) > -1);
|
|
1736
1736
|
for (let o = 0; o < i.length; o++) {
|
|
1737
1737
|
let l = i[o][1].sort(cs);
|
|
1738
1738
|
s.next.push({ type: i[o][0], next: e[l.join(",")] || t(l) });
|
|
@@ -1815,7 +1815,7 @@ let Vr = class ps {
|
|
|
1815
1815
|
True for node types that allow no content.
|
|
1816
1816
|
*/
|
|
1817
1817
|
get isLeaf() {
|
|
1818
|
-
return this.contentMatch ==
|
|
1818
|
+
return this.contentMatch == Ue.empty;
|
|
1819
1819
|
}
|
|
1820
1820
|
/**
|
|
1821
1821
|
True when this node is an atom, i.e. when it does not have
|
|
@@ -2056,7 +2056,7 @@ class ll {
|
|
|
2056
2056
|
if (i in this.marks)
|
|
2057
2057
|
throw new RangeError(i + " can not be both a node and a mark");
|
|
2058
2058
|
let s = this.nodes[i], o = s.spec.content || "", l = s.spec.marks;
|
|
2059
|
-
if (s.contentMatch = r[o] || (r[o] =
|
|
2059
|
+
if (s.contentMatch = r[o] || (r[o] = Ue.parse(o, this.nodes)), s.inlineContent = s.contentMatch.inlineContent, s.spec.linebreakReplacement) {
|
|
2060
2060
|
if (this.linebreakReplacement)
|
|
2061
2061
|
throw new RangeError("Multiple linebreak nodes defined");
|
|
2062
2062
|
if (!s.isInline || !s.isLeaf)
|
|
@@ -2684,7 +2684,7 @@ class Ye {
|
|
|
2684
2684
|
@internal
|
|
2685
2685
|
*/
|
|
2686
2686
|
serializeNodeInner(e, t) {
|
|
2687
|
-
let { dom: r, contentDOM: i } =
|
|
2687
|
+
let { dom: r, contentDOM: i } = jt(wn(t), this.nodes[e.type.name](e), null, e.attrs);
|
|
2688
2688
|
if (i) {
|
|
2689
2689
|
if (e.isLeaf)
|
|
2690
2690
|
throw new RangeError("Content hole not allowed in a leaf node spec");
|
|
@@ -2712,10 +2712,10 @@ class Ye {
|
|
|
2712
2712
|
*/
|
|
2713
2713
|
serializeMark(e, t, r = {}) {
|
|
2714
2714
|
let i = this.marks[e.type.name];
|
|
2715
|
-
return i &&
|
|
2715
|
+
return i && jt(wn(r), i(e, t), null, e.attrs);
|
|
2716
2716
|
}
|
|
2717
2717
|
static renderSpec(e, t, r = null, i) {
|
|
2718
|
-
return
|
|
2718
|
+
return jt(e, t, r, i);
|
|
2719
2719
|
}
|
|
2720
2720
|
/**
|
|
2721
2721
|
Build a serializer using the [`toDOM`](https://prosemirror.net/docs/ref/#model.NodeSpec.toDOM)
|
|
@@ -2771,7 +2771,7 @@ function pl(n) {
|
|
|
2771
2771
|
}
|
|
2772
2772
|
return t(n), e;
|
|
2773
2773
|
}
|
|
2774
|
-
function
|
|
2774
|
+
function jt(n, e, t, r) {
|
|
2775
2775
|
if (typeof e == "string")
|
|
2776
2776
|
return { dom: n.createTextNode(e) };
|
|
2777
2777
|
if (e.nodeType != null)
|
|
@@ -2801,7 +2801,7 @@ function Ut(n, e, t, r) {
|
|
|
2801
2801
|
throw new RangeError("Content hole must be the only child of its parent node");
|
|
2802
2802
|
return { dom: a, contentDOM: a };
|
|
2803
2803
|
} else {
|
|
2804
|
-
let { dom: u, contentDOM: p } =
|
|
2804
|
+
let { dom: u, contentDOM: p } = jt(n, d, t, r);
|
|
2805
2805
|
if (a.appendChild(u), p) {
|
|
2806
2806
|
if (l)
|
|
2807
2807
|
throw new RangeError("Multiple content holes");
|
|
@@ -2821,8 +2821,8 @@ function qr(n) {
|
|
|
2821
2821
|
function gl(n) {
|
|
2822
2822
|
return (n - (n & ys)) / bs;
|
|
2823
2823
|
}
|
|
2824
|
-
const xs = 1, ks = 2,
|
|
2825
|
-
class
|
|
2824
|
+
const xs = 1, ks = 2, Ut = 4, Ss = 8;
|
|
2825
|
+
class jn {
|
|
2826
2826
|
/**
|
|
2827
2827
|
@internal
|
|
2828
2828
|
*/
|
|
@@ -2841,13 +2841,13 @@ class Un {
|
|
|
2841
2841
|
Tells you whether the token before the mapped position was deleted.
|
|
2842
2842
|
*/
|
|
2843
2843
|
get deletedBefore() {
|
|
2844
|
-
return (this.delInfo & (xs |
|
|
2844
|
+
return (this.delInfo & (xs | Ut)) > 0;
|
|
2845
2845
|
}
|
|
2846
2846
|
/**
|
|
2847
2847
|
True when the token after the mapped position was deleted.
|
|
2848
2848
|
*/
|
|
2849
2849
|
get deletedAfter() {
|
|
2850
|
-
return (this.delInfo & (ks |
|
|
2850
|
+
return (this.delInfo & (ks | Ut)) > 0;
|
|
2851
2851
|
}
|
|
2852
2852
|
/**
|
|
2853
2853
|
Tells whether any of the steps mapped through deletes across the
|
|
@@ -2855,7 +2855,7 @@ class Un {
|
|
|
2855
2855
|
position).
|
|
2856
2856
|
*/
|
|
2857
2857
|
get deletedAcross() {
|
|
2858
|
-
return (this.delInfo &
|
|
2858
|
+
return (this.delInfo & Ut) > 0;
|
|
2859
2859
|
}
|
|
2860
2860
|
}
|
|
2861
2861
|
class G {
|
|
@@ -2898,12 +2898,12 @@ class G {
|
|
|
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 : ml(l / 3, e - a), m = e == a ? ks : e == h ? xs :
|
|
2902
|
-
return (t < 0 ? e != a : e != h) && (m |= Ss), new
|
|
2901
|
+
let p = e == (t < 0 ? a : h) ? null : ml(l / 3, e - a), m = e == a ? ks : e == h ? xs : Ut;
|
|
2902
|
+
return (t < 0 ? e != a : e != h) && (m |= Ss), new jn(u, m, p);
|
|
2903
2903
|
}
|
|
2904
2904
|
i += f - c;
|
|
2905
2905
|
}
|
|
2906
|
-
return r ? e + i : new
|
|
2906
|
+
return r ? e + i : new jn(e + i, 0, null);
|
|
2907
2907
|
}
|
|
2908
2908
|
/**
|
|
2909
2909
|
@internal
|
|
@@ -3059,7 +3059,7 @@ class it {
|
|
|
3059
3059
|
}
|
|
3060
3060
|
i |= l.delInfo, e = l.pos;
|
|
3061
3061
|
}
|
|
3062
|
-
return r ? e : new
|
|
3062
|
+
return r ? e : new jn(e, i, null);
|
|
3063
3063
|
}
|
|
3064
3064
|
}
|
|
3065
3065
|
const Mn = /* @__PURE__ */ Object.create(null);
|
|
@@ -3317,7 +3317,7 @@ class H extends W {
|
|
|
3317
3317
|
super(), this.from = e, this.to = t, this.slice = r, this.structure = i;
|
|
3318
3318
|
}
|
|
3319
3319
|
apply(e) {
|
|
3320
|
-
return this.structure &&
|
|
3320
|
+
return this.structure && Un(e, this.from, this.to) ? R.fail("Structure replace would overwrite content") : R.fromReplace(e, this.from, this.to, this.slice);
|
|
3321
3321
|
}
|
|
3322
3322
|
getMap() {
|
|
3323
3323
|
return new G([this.from, this.to - this.from, this.slice.size]);
|
|
@@ -3366,7 +3366,7 @@ class F extends W {
|
|
|
3366
3366
|
super(), this.from = e, this.to = t, this.gapFrom = r, this.gapTo = i, this.slice = s, this.insert = o, this.structure = l;
|
|
3367
3367
|
}
|
|
3368
3368
|
apply(e) {
|
|
3369
|
-
if (this.structure && (
|
|
3369
|
+
if (this.structure && (Un(e, this.from, this.gapFrom) || Un(e, this.gapTo, this.to)))
|
|
3370
3370
|
return R.fail("Structure gap-replace would overwrite content");
|
|
3371
3371
|
let t = e.slice(this.gapFrom, this.gapTo);
|
|
3372
3372
|
if (t.openStart || t.openEnd)
|
|
@@ -3413,7 +3413,7 @@ class F extends W {
|
|
|
3413
3413
|
}
|
|
3414
3414
|
}
|
|
3415
3415
|
W.jsonID("replaceAround", F);
|
|
3416
|
-
function
|
|
3416
|
+
function Un(n, e, t) {
|
|
3417
3417
|
let r = n.resolve(e), i = t - e, s = r.depth;
|
|
3418
3418
|
for (; i > 0 && s > 0 && r.indexAfter(s) == r.node(s).childCount; )
|
|
3419
3419
|
s--, i--;
|
|
@@ -4462,16 +4462,16 @@ class Es {
|
|
|
4462
4462
|
this.$from = e, this.$to = t;
|
|
4463
4463
|
}
|
|
4464
4464
|
}
|
|
4465
|
-
let
|
|
4466
|
-
function
|
|
4467
|
-
!
|
|
4465
|
+
let jr = !1;
|
|
4466
|
+
function Ur(n) {
|
|
4467
|
+
!jr && !n.parent.inlineContent && (jr = !0, console.warn("TextSelection endpoint not pointing into a node with inline content (" + n.parent.type.name + ")"));
|
|
4468
4468
|
}
|
|
4469
4469
|
class C extends S {
|
|
4470
4470
|
/**
|
|
4471
4471
|
Construct a text selection between the given points.
|
|
4472
4472
|
*/
|
|
4473
4473
|
constructor(e, t = e) {
|
|
4474
|
-
|
|
4474
|
+
Ur(e), Ur(t), super(e, t);
|
|
4475
4475
|
}
|
|
4476
4476
|
/**
|
|
4477
4477
|
Returns a resolved position if this is a cursor selection (an
|
|
@@ -5164,7 +5164,7 @@ function Kl(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
|
|
5167
|
+
const jl = (n, e, t) => {
|
|
5168
5168
|
let r = Kl(n, t);
|
|
5169
5169
|
if (!r)
|
|
5170
5170
|
return !1;
|
|
@@ -5185,7 +5185,7 @@ const Ul = (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
|
+
}, Ul = (n, e, t) => {
|
|
5189
5189
|
let { $head: r, empty: i } = n.selection, s = r;
|
|
5190
5190
|
if (!i)
|
|
5191
5191
|
return !1;
|
|
@@ -5418,7 +5418,7 @@ function At(...n) {
|
|
|
5418
5418
|
return !1;
|
|
5419
5419
|
};
|
|
5420
5420
|
}
|
|
5421
|
-
let En = At(vs, Jl, ql), Zr = At(vs,
|
|
5421
|
+
let En = At(vs, Jl, ql), Zr = At(vs, jl, Ul);
|
|
5422
5422
|
const ge = {
|
|
5423
5423
|
Enter: At(Gl, _l, Ps, Xl),
|
|
5424
5424
|
"Mod-Enter": Vs,
|
|
@@ -5898,9 +5898,9 @@ function zn(n, e, t = !0) {
|
|
|
5898
5898
|
return e.altKey && (n = "Alt-" + n), e.ctrlKey && (n = "Ctrl-" + n), e.metaKey && (n = "Meta-" + n), t && e.shiftKey && (n = "Shift-" + n), n;
|
|
5899
5899
|
}
|
|
5900
5900
|
function Bn(n) {
|
|
5901
|
-
return new ut({ props: { handleKeyDown:
|
|
5901
|
+
return new ut({ props: { handleKeyDown: js(n) } });
|
|
5902
5902
|
}
|
|
5903
|
-
function
|
|
5903
|
+
function js(n) {
|
|
5904
5904
|
let e = ba(n);
|
|
5905
5905
|
return function(t, r) {
|
|
5906
5906
|
let i = ma(r), s, o = e[zn(i, r)];
|
|
@@ -6134,9 +6134,9 @@ function Ea(n, e, t) {
|
|
|
6134
6134
|
return { node: r.startContainer, offset: Math.min(te(r.startContainer), r.startOffset) };
|
|
6135
6135
|
}
|
|
6136
6136
|
}
|
|
6137
|
-
const ae = typeof navigator < "u" ? navigator : null, ri = typeof document < "u" ? document : null, ze = ae && ae.userAgent || "", Yn = /Edge\/(\d+)/.exec(ze),
|
|
6137
|
+
const ae = typeof navigator < "u" ? navigator : null, ri = typeof document < "u" ? document : null, ze = ae && ae.userAgent || "", Yn = /Edge\/(\d+)/.exec(ze), Us = /MSIE \d/.exec(ze), Zn = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ze), U = !!(Us || Zn || Yn), Ee = Us ? document.documentMode : Zn ? +Zn[1] : Yn ? +Yn[1] : 0, se = !U && /gecko\/(\d+)/i.test(ze);
|
|
6138
6138
|
se && +(/Firefox\/(\d+)/.exec(ze) || [0, 0])[1];
|
|
6139
|
-
const Qn = !
|
|
6139
|
+
const Qn = !U && /Chrome\/(\d+)/.exec(ze), $ = !!Qn, Gs = Qn ? +Qn[1] : 0, J = !U && !!ae && /Apple Computer/.test(ae.vendor), ht = J && (/Mobile\/\w+/.test(ze) || !!ae && ae.maxTouchPoints > 2), ee = ht || (ae ? /Mac/.test(ae.platform) : !1), Ra = ae ? /Win/.test(ae.platform) : !1, re = /Android \d/.test(ze), Bt = !!ri && "webkitFontSmoothing" in ri.documentElement.style, Ia = Bt ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
|
|
6140
6140
|
function va(n) {
|
|
6141
6141
|
let e = n.defaultView && n.defaultView.visualViewport;
|
|
6142
6142
|
return e ? {
|
|
@@ -6448,7 +6448,7 @@ function qa(n, e, t) {
|
|
|
6448
6448
|
});
|
|
6449
6449
|
}
|
|
6450
6450
|
const Ka = /[\u0590-\u08ac]/;
|
|
6451
|
-
function
|
|
6451
|
+
function ja(n, e, t) {
|
|
6452
6452
|
let { $head: r } = e.selection;
|
|
6453
6453
|
if (!r.parent.isTextblock)
|
|
6454
6454
|
return !1;
|
|
@@ -6465,8 +6465,8 @@ function Ua(n, e, t) {
|
|
|
6465
6465
|
}) : r.pos == r.start() || r.pos == r.end();
|
|
6466
6466
|
}
|
|
6467
6467
|
let oi = null, li = null, ai = !1;
|
|
6468
|
-
function
|
|
6469
|
-
return oi == e && li == t ? ai : (oi = e, li = t, ai = t == "up" || t == "down" ? qa(n, e, t) :
|
|
6468
|
+
function Ua(n, e, t) {
|
|
6469
|
+
return oi == e && li == t ? ai : (oi = e, li = t, ai = t == "up" || t == "down" ? qa(n, e, t) : ja(n, e, t));
|
|
6470
6470
|
}
|
|
6471
6471
|
const ne = 0, ci = 1, Fe = 2, ce = 3;
|
|
6472
6472
|
class Vt {
|
|
@@ -7569,7 +7569,7 @@ function ic(n) {
|
|
|
7569
7569
|
if (!e)
|
|
7570
7570
|
return;
|
|
7571
7571
|
let r = n.cursorWrapper.dom, i = r.nodeName == "IMG";
|
|
7572
|
-
i ? t.setStart(r.parentNode, P(r) + 1) : t.setStart(r, 0), t.collapse(!0), e.removeAllRanges(), e.addRange(t), !i && !n.state.selection.visible &&
|
|
7572
|
+
i ? t.setStart(r.parentNode, P(r) + 1) : t.setStart(r, 0), t.collapse(!0), e.removeAllRanges(), e.addRange(t), !i && !n.state.selection.visible && U && Ee <= 11 && (r.disabled = !0, r.disabled = !1);
|
|
7573
7573
|
}
|
|
7574
7574
|
function lo(n, e) {
|
|
7575
7575
|
if (e instanceof k) {
|
|
@@ -8332,7 +8332,7 @@ function Vc(n, e) {
|
|
|
8332
8332
|
t.parentNode && t.parentNode.removeChild(t), n.focus();
|
|
8333
8333
|
}, 50);
|
|
8334
8334
|
}
|
|
8335
|
-
const Et =
|
|
8335
|
+
const Et = U && Ee < 15 || ht && Ia < 604;
|
|
8336
8336
|
q.copy = K.cut = (n, e) => {
|
|
8337
8337
|
let t = e, r = n.state.selection, i = t.type == "cut";
|
|
8338
8338
|
if (r.empty)
|
|
@@ -8483,7 +8483,7 @@ class fn {
|
|
|
8483
8483
|
}
|
|
8484
8484
|
map(e, t, r, i) {
|
|
8485
8485
|
let { pos: s, deleted: o } = e.mapResult(t.from + i, this.side < 0 ? -1 : 1);
|
|
8486
|
-
return o ? null : new
|
|
8486
|
+
return o ? null : new j(s - r, s - r, this);
|
|
8487
8487
|
}
|
|
8488
8488
|
valid() {
|
|
8489
8489
|
return !0;
|
|
@@ -8501,7 +8501,7 @@ class Ie {
|
|
|
8501
8501
|
}
|
|
8502
8502
|
map(e, t, r, i) {
|
|
8503
8503
|
let s = e.map(t.from + i, this.spec.inclusiveStart ? -1 : 1) - r, o = e.map(t.to + i, this.spec.inclusiveEnd ? 1 : -1) - r;
|
|
8504
|
-
return s >= o ? null : new
|
|
8504
|
+
return s >= o ? null : new j(s, o, this);
|
|
8505
8505
|
}
|
|
8506
8506
|
valid(e, t) {
|
|
8507
8507
|
return t.from < t.to;
|
|
@@ -8524,7 +8524,7 @@ class wr {
|
|
|
8524
8524
|
if (s.deleted)
|
|
8525
8525
|
return null;
|
|
8526
8526
|
let o = e.mapResult(t.to + i, -1);
|
|
8527
|
-
return o.deleted || o.pos <= s.pos ? null : new
|
|
8527
|
+
return o.deleted || o.pos <= s.pos ? null : new j(s.pos - r, o.pos - r, this);
|
|
8528
8528
|
}
|
|
8529
8529
|
valid(e, t) {
|
|
8530
8530
|
let { index: r, offset: i } = e.content.findIndex(t.from), s;
|
|
@@ -8536,7 +8536,7 @@ class wr {
|
|
|
8536
8536
|
destroy() {
|
|
8537
8537
|
}
|
|
8538
8538
|
}
|
|
8539
|
-
class
|
|
8539
|
+
class j {
|
|
8540
8540
|
/**
|
|
8541
8541
|
@internal
|
|
8542
8542
|
*/
|
|
@@ -8547,7 +8547,7 @@ class U {
|
|
|
8547
8547
|
@internal
|
|
8548
8548
|
*/
|
|
8549
8549
|
copy(e, t) {
|
|
8550
|
-
return new
|
|
8550
|
+
return new j(e, t, this.type);
|
|
8551
8551
|
}
|
|
8552
8552
|
/**
|
|
8553
8553
|
@internal
|
|
@@ -8570,14 +8570,14 @@ class U {
|
|
|
8570
8570
|
widget's current document position.
|
|
8571
8571
|
*/
|
|
8572
8572
|
static widget(e, t, r) {
|
|
8573
|
-
return new
|
|
8573
|
+
return new j(e, e, new fn(t, r));
|
|
8574
8574
|
}
|
|
8575
8575
|
/**
|
|
8576
8576
|
Creates an inline decoration, which adds the given attributes to
|
|
8577
8577
|
each inline node between `from` and `to`.
|
|
8578
8578
|
*/
|
|
8579
8579
|
static inline(e, t, r, i) {
|
|
8580
|
-
return new
|
|
8580
|
+
return new j(e, t, new Ie(r, i));
|
|
8581
8581
|
}
|
|
8582
8582
|
/**
|
|
8583
8583
|
Creates a node decoration. `from` and `to` should point precisely
|
|
@@ -8585,7 +8585,7 @@ class U {
|
|
|
8585
8585
|
node, will receive the given attributes.
|
|
8586
8586
|
*/
|
|
8587
8587
|
static node(e, t, r, i) {
|
|
8588
|
-
return new
|
|
8588
|
+
return new j(e, t, new wr(r, i));
|
|
8589
8589
|
}
|
|
8590
8590
|
/**
|
|
8591
8591
|
The spec provided when creating this decoration. Can be useful
|
|
@@ -8662,7 +8662,7 @@ class A {
|
|
|
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 ? Lc(this.children, o || [], e, t, r, i, s) : o ? new A(o.sort(
|
|
8665
|
+
return this.children.length ? Lc(this.children, o || [], e, t, r, i, s) : o ? new A(o.sort(je), tt) : L;
|
|
8666
8666
|
}
|
|
8667
8667
|
/**
|
|
8668
8668
|
Add the given array of decorations to the ones in the set,
|
|
@@ -8686,7 +8686,7 @@ class A {
|
|
|
8686
8686
|
let o = Oo(s ? To(t) : t, -r);
|
|
8687
8687
|
for (let l = 0; l < o.length; l++)
|
|
8688
8688
|
o[l].type.valid(e, o[l]) || o.splice(l--, 1);
|
|
8689
|
-
return new A(o.length ? this.local.concat(o).sort(
|
|
8689
|
+
return new A(o.length ? this.local.concat(o).sort(je) : this.local, i || this.children);
|
|
8690
8690
|
}
|
|
8691
8691
|
/**
|
|
8692
8692
|
Create a new set that contains the decorations in this set, minus
|
|
@@ -8735,7 +8735,7 @@ class A {
|
|
|
8735
8735
|
}
|
|
8736
8736
|
}
|
|
8737
8737
|
if (i) {
|
|
8738
|
-
let l = new A(i.sort(
|
|
8738
|
+
let l = new A(i.sort(je), tt);
|
|
8739
8739
|
return r ? new Oe([l, r]) : l;
|
|
8740
8740
|
}
|
|
8741
8741
|
return r || L;
|
|
@@ -8821,7 +8821,7 @@ class Oe {
|
|
|
8821
8821
|
t.push(s[o]);
|
|
8822
8822
|
}
|
|
8823
8823
|
}
|
|
8824
|
-
return t ? Mr(r ? t : t.sort(
|
|
8824
|
+
return t ? Mr(r ? t : t.sort(je)) : tt;
|
|
8825
8825
|
}
|
|
8826
8826
|
// Create a group for the given array of decoration sets, or return
|
|
8827
8827
|
// a single set when possible.
|
|
@@ -8887,7 +8887,7 @@ function Lc(n, e, t, r, i, s, o) {
|
|
|
8887
8887
|
l.splice(d, 0, f.children[h], f.children[h + 1], f.children[h + 2]);
|
|
8888
8888
|
}
|
|
8889
8889
|
}
|
|
8890
|
-
return new A(e.sort(
|
|
8890
|
+
return new A(e.sort(je), l);
|
|
8891
8891
|
}
|
|
8892
8892
|
function Oo(n, e) {
|
|
8893
8893
|
if (!e || !n.length)
|
|
@@ -8895,7 +8895,7 @@ function Oo(n, e) {
|
|
|
8895
8895
|
let t = [];
|
|
8896
8896
|
for (let r = 0; r < n.length; r++) {
|
|
8897
8897
|
let i = n[r];
|
|
8898
|
-
t.push(new
|
|
8898
|
+
t.push(new j(i.from + e, i.to + e, i.type));
|
|
8899
8899
|
}
|
|
8900
8900
|
return t;
|
|
8901
8901
|
}
|
|
@@ -8936,12 +8936,12 @@ function hn(n, e, t, r) {
|
|
|
8936
8936
|
f != L && i.push(a, a + l.nodeSize, f);
|
|
8937
8937
|
}
|
|
8938
8938
|
});
|
|
8939
|
-
let o = Oo(s ? To(n) : n, -t).sort(
|
|
8939
|
+
let o = Oo(s ? To(n) : n, -t).sort(je);
|
|
8940
8940
|
for (let l = 0; l < o.length; l++)
|
|
8941
8941
|
o[l].type.valid(e, o[l]) || (r.onRemove && r.onRemove(o[l].spec), o.splice(l--, 1));
|
|
8942
8942
|
return o.length || i.length ? new A(o, i) : L;
|
|
8943
8943
|
}
|
|
8944
|
-
function
|
|
8944
|
+
function je(n, e) {
|
|
8945
8945
|
return n.from - e.from || n.to - e.to;
|
|
8946
8946
|
}
|
|
8947
8947
|
function Mr(n) {
|
|
@@ -8963,7 +8963,7 @@ function Mr(n) {
|
|
|
8963
8963
|
return e;
|
|
8964
8964
|
}
|
|
8965
8965
|
function Mi(n, e, t) {
|
|
8966
|
-
for (; e < n.length &&
|
|
8966
|
+
for (; e < n.length && je(t, n[e]) > 0; )
|
|
8967
8967
|
e++;
|
|
8968
8968
|
n.splice(e, 0, t);
|
|
8969
8969
|
}
|
|
@@ -8981,7 +8981,7 @@ const $c = {
|
|
|
8981
8981
|
attributes: !0,
|
|
8982
8982
|
attributeOldValue: !0,
|
|
8983
8983
|
subtree: !0
|
|
8984
|
-
}, Wc =
|
|
8984
|
+
}, Wc = U && Ee <= 11;
|
|
8985
8985
|
class Jc {
|
|
8986
8986
|
constructor() {
|
|
8987
8987
|
this.anchorNode = null, this.anchorOffset = 0, this.focusNode = null, this.focusOffset = 0;
|
|
@@ -9001,7 +9001,7 @@ class qc {
|
|
|
9001
9001
|
this.view = e, this.handleDOMChange = t, this.queue = [], this.flushingSoon = -1, this.observer = null, this.currentSelection = new Jc(), 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
|
+
U && 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
|
}), Wc && (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);
|
|
@@ -9042,7 +9042,7 @@ class qc {
|
|
|
9042
9042
|
if (gi(this.view)) {
|
|
9043
9043
|
if (this.suppressingSelectionUpdates)
|
|
9044
9044
|
return be(this.view);
|
|
9045
|
-
if (
|
|
9045
|
+
if (U && Ee <= 11 && !this.view.state.selection.empty) {
|
|
9046
9046
|
let e = this.view.domSelectionRange();
|
|
9047
9047
|
if (e.focusNode && _e(e.focusNode, e.focusOffset, e.anchorNode, e.anchorOffset))
|
|
9048
9048
|
return this.flushSoon();
|
|
@@ -9098,7 +9098,7 @@ class qc {
|
|
|
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 || Uc(e, h) != u) && d.remove();
|
|
9102
9102
|
}
|
|
9103
9103
|
}
|
|
9104
9104
|
}
|
|
@@ -9120,7 +9120,7 @@ class qc {
|
|
|
9120
9120
|
if (r.contentDOM && r.contentDOM != r.dom && !r.contentDOM.contains(e.target))
|
|
9121
9121
|
return { from: r.posBefore, to: r.posAfter };
|
|
9122
9122
|
let i = e.previousSibling, s = e.nextSibling;
|
|
9123
|
-
if (
|
|
9123
|
+
if (U && Ee <= 11 && e.addedNodes.length)
|
|
9124
9124
|
for (let f = 0; f < e.addedNodes.length; f++) {
|
|
9125
9125
|
let { previousSibling: h, nextSibling: d } = e.addedNodes[f];
|
|
9126
9126
|
(!h || Array.prototype.indexOf.call(e.addedNodes, h) < 0) && (i = h), (!d || Array.prototype.indexOf.call(e.addedNodes, d) < 0) && (s = d);
|
|
@@ -9150,7 +9150,7 @@ function Ti(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 jc(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 Uc(n, e) {
|
|
|
9162
9162
|
}
|
|
9163
9163
|
return n.dom.addEventListener("beforeinput", r, !0), document.execCommand("indent"), n.dom.removeEventListener("beforeinput", r, !0), t ? Ti(n, t) : null;
|
|
9164
9164
|
}
|
|
9165
|
-
function
|
|
9165
|
+
function Uc(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)
|
|
@@ -9248,7 +9248,7 @@ function Yc(n, e, t, r, i) {
|
|
|
9248
9248
|
}
|
|
9249
9249
|
return;
|
|
9250
9250
|
}
|
|
9251
|
-
n.state.selection.from < n.state.selection.to && p.start == p.endB && n.state.selection instanceof C && (p.start > n.state.selection.from && p.start <= n.state.selection.from + 2 && n.state.selection.from >= c.from ? p.start = n.state.selection.from : p.endA < n.state.selection.to && p.endA >= n.state.selection.to - 2 && n.state.selection.to <= c.to && (p.endB += n.state.selection.to - p.endA, p.endA = n.state.selection.to)),
|
|
9251
|
+
n.state.selection.from < n.state.selection.to && p.start == p.endB && n.state.selection instanceof C && (p.start > n.state.selection.from && p.start <= n.state.selection.from + 2 && n.state.selection.from >= c.from ? p.start = n.state.selection.from : p.endA < n.state.selection.to && p.endA >= n.state.selection.to - 2 && n.state.selection.to <= c.to && (p.endB += n.state.selection.to - p.endA, p.endA = n.state.selection.to)), U && Ee <= 11 && p.endB == p.start + 1 && p.endA == p.start && p.start > c.from && c.doc.textBetween(p.start - c.from - 1, p.start - c.from + 1) == " " && (p.start--, p.endA--, p.endB--);
|
|
9252
9252
|
let m = c.doc.resolveNoCache(p.start - c.from), g = c.doc.resolveNoCache(p.endB - c.from), b = f.resolve(p.start), w = m.sameParent(g) && m.parent.inlineContent && b.end() >= p.endA, M;
|
|
9253
9253
|
if ((ht && n.input.lastIOSEnter > Date.now() - 225 && (!w || i.some((O) => O.nodeName == "DIV" || O.nodeName == "P")) || !w && m.pos < c.doc.content.size && !m.sameParent(g) && (M = S.findFrom(c.doc.resolve(m.pos + 1), 1, !0)) && M.head == g.pos) && n.someProp("handleKeyDown", (O) => O(n, Pe(13, "Enter")))) {
|
|
9254
9254
|
n.input.lastIOSEnter = 0;
|
|
@@ -9266,7 +9266,7 @@ function Yc(n, e, t, r, i) {
|
|
|
9266
9266
|
let T = p.start, I = p.endA, D, Y, ke;
|
|
9267
9267
|
if (w) {
|
|
9268
9268
|
if (m.pos == g.pos)
|
|
9269
|
-
|
|
9269
|
+
U && Ee <= 11 && m.parentOffset == 0 && (n.domObserver.suppressSelectionUpdates(), setTimeout(() => be(n), 20)), D = n.state.tr.delete(T, I), Y = f.resolve(p.start).marksAcross(f.resolve(p.endA));
|
|
9270
9270
|
else if (
|
|
9271
9271
|
// Adding or removing a mark
|
|
9272
9272
|
p.endA == p.endB && (ke = Zc(m.parent.content.cut(m.parentOffset, g.parentOffset), b.parent.content.cut(b.parentOffset, p.endA - b.start())))
|
|
@@ -9281,7 +9281,7 @@ function Yc(n, e, t, r, i) {
|
|
|
9281
9281
|
}
|
|
9282
9282
|
if (D || (D = n.state.tr.replace(T, I, c.doc.slice(p.start - c.from, p.endB - c.from))), c.sel) {
|
|
9283
9283
|
let O = Ai(n, D.doc, c.sel);
|
|
9284
|
-
O && !($ && re && n.composing && O.empty && (p.start != p.endB || n.input.lastAndroidDelete < Date.now() - 100) && (O.head == T || O.head == D.mapping.map(I) - 1) ||
|
|
9284
|
+
O && !($ && re && n.composing && O.empty && (p.start != p.endB || n.input.lastAndroidDelete < Date.now() - 100) && (O.head == T || O.head == D.mapping.map(I) - 1) || U && O.empty && O.head == T) && D.setSelection(O);
|
|
9285
9285
|
}
|
|
9286
9286
|
Y && D.ensureMarks(Y), s && D.setMeta("composition", s), n.dispatch(D.scrollIntoView());
|
|
9287
9287
|
}
|
|
@@ -9435,7 +9435,7 @@ class tf {
|
|
|
9435
9435
|
let d = f == "preserve" && o && this.dom.style.overflowAnchor == null && Ba(this);
|
|
9436
9436
|
if (o) {
|
|
9437
9437
|
this.domObserver.stop();
|
|
9438
|
-
let u = h && (
|
|
9438
|
+
let u = h && (U || $) && !this.composing && !i.selection.empty && !e.selection.empty && nf(i.selection, e.selection);
|
|
9439
9439
|
if (h) {
|
|
9440
9440
|
let p = $ ? this.trackWrites = this.domSelectionRange().focusNode : null;
|
|
9441
9441
|
this.composing && (this.input.compositionNode = zc(this)), (s || !this.docView.update(e.doc, c, a, this)) && (this.docView.updateOuterDeco(c), this.docView.destroy(), this.docView = fi(e.doc, c, a, this.dom, this)), p && !this.trackWrites && (u = !0);
|
|
@@ -9508,7 +9508,7 @@ class tf {
|
|
|
9508
9508
|
Query whether the view has focus.
|
|
9509
9509
|
*/
|
|
9510
9510
|
hasFocus() {
|
|
9511
|
-
if (
|
|
9511
|
+
if (U) {
|
|
9512
9512
|
let e = this.root.activeElement;
|
|
9513
9513
|
if (e == this.dom)
|
|
9514
9514
|
return !0;
|
|
@@ -9626,7 +9626,7 @@ class tf {
|
|
|
9626
9626
|
pass a different state.
|
|
9627
9627
|
*/
|
|
9628
9628
|
endOfTextblock(e, t) {
|
|
9629
|
-
return
|
|
9629
|
+
return Ua(this, t || this.state, e);
|
|
9630
9630
|
}
|
|
9631
9631
|
/**
|
|
9632
9632
|
Run the editor's paste logic with the given HTML string. The
|
|
@@ -9681,7 +9681,7 @@ class tf {
|
|
|
9681
9681
|
*/
|
|
9682
9682
|
domSelectionRange() {
|
|
9683
9683
|
let e = this.domSelection();
|
|
9684
|
-
return e ? J && this.root.nodeType === 11 && Da(this.dom.ownerDocument) == this.dom &&
|
|
9684
|
+
return e ? J && this.root.nodeType === 11 && Da(this.dom.ownerDocument) == this.dom && jc(this, e) || e : { focusNode: null, focusOffset: 0, anchorNode: null, anchorOffset: 0 };
|
|
9685
9685
|
}
|
|
9686
9686
|
/**
|
|
9687
9687
|
@internal
|
|
@@ -9696,12 +9696,12 @@ function Ei(n) {
|
|
|
9696
9696
|
if (typeof t == "function" && (t = t(n.state)), t)
|
|
9697
9697
|
for (let r in t)
|
|
9698
9698
|
r == "class" ? e.class += " " + t[r] : r == "style" ? e.style = (e.style ? e.style + ";" : "") + t[r] : !e[r] && r != "contenteditable" && r != "nodeName" && (e[r] = String(t[r]));
|
|
9699
|
-
}), e.translate || (e.translate = "no"), [
|
|
9699
|
+
}), e.translate || (e.translate = "no"), [j.node(0, n.state.doc.content.size, e)];
|
|
9700
9700
|
}
|
|
9701
9701
|
function Ri(n) {
|
|
9702
9702
|
if (n.markCursor) {
|
|
9703
9703
|
let e = document.createElement("img");
|
|
9704
|
-
e.className = "ProseMirror-separator", e.setAttribute("mark-placeholder", "true"), e.setAttribute("alt", ""), n.cursorWrapper = { dom: e, deco:
|
|
9704
|
+
e.className = "ProseMirror-separator", e.setAttribute("mark-placeholder", "true"), e.setAttribute("alt", ""), n.cursorWrapper = { dom: e, deco: j.widget(n.state.selection.from, e, { raw: !0, marks: n.markCursor }) };
|
|
9705
9705
|
} else
|
|
9706
9706
|
n.cursorWrapper = null;
|
|
9707
9707
|
}
|
|
@@ -10268,7 +10268,7 @@ function uf(n) {
|
|
|
10268
10268
|
const e = [];
|
|
10269
10269
|
return n.selection.forEachCell((t, r) => {
|
|
10270
10270
|
e.push(
|
|
10271
|
-
|
|
10271
|
+
j.node(r, r + t.nodeSize, { class: "selectedCell" })
|
|
10272
10272
|
);
|
|
10273
10273
|
}), A.create(n.doc, e);
|
|
10274
10274
|
}
|
|
@@ -10751,7 +10751,7 @@ function $i(n, e, t, r, i) {
|
|
|
10751
10751
|
)
|
|
10752
10752
|
), e(h);
|
|
10753
10753
|
}
|
|
10754
|
-
var Nf =
|
|
10754
|
+
var Nf = js({
|
|
10755
10755
|
ArrowLeft: qt("horiz", -1),
|
|
10756
10756
|
ArrowRight: qt("horiz", 1),
|
|
10757
10757
|
ArrowUp: qt("vert", -1),
|
|
@@ -11179,14 +11179,14 @@ function Hf(n, e) {
|
|
|
11179
11179
|
if ((a == o.width - 1 || o.map[f] != o.map[f + 1]) && (c == 0 || o.map[f] != o.map[f - o.width])) {
|
|
11180
11180
|
const h = o.map[f], d = l + h + s.nodeAt(h).nodeSize - 1, u = document.createElement("div");
|
|
11181
11181
|
u.className = "column-resize-handle", (t = _.getState(n)) != null && t.dragging && r.push(
|
|
11182
|
-
|
|
11182
|
+
j.node(
|
|
11183
11183
|
l + h,
|
|
11184
11184
|
l + h + s.nodeAt(h).nodeSize,
|
|
11185
11185
|
{
|
|
11186
11186
|
class: "column-resize-dragging"
|
|
11187
11187
|
}
|
|
11188
11188
|
)
|
|
11189
|
-
), r.push(
|
|
11189
|
+
), r.push(j.widget(d, u));
|
|
11190
11190
|
}
|
|
11191
11191
|
}
|
|
11192
11192
|
return A.create(n.doc, r);
|
|
@@ -11234,9 +11234,11 @@ function $f({
|
|
|
11234
11234
|
}
|
|
11235
11235
|
});
|
|
11236
11236
|
}
|
|
11237
|
-
const zo = "app.grapesjs.com", Bo = "app-stage.grapesjs.com",
|
|
11237
|
+
const zo = "app.grapesjs.com", Bo = "app-stage.grapesjs.com", Wf = "app2.grapesjs.com", Jf = "app-stage2.grapesjs.com", ji = [
|
|
11238
11238
|
zo,
|
|
11239
|
+
Wf,
|
|
11239
11240
|
Bo,
|
|
11241
|
+
Jf,
|
|
11240
11242
|
"localhost",
|
|
11241
11243
|
"127.0.0.1",
|
|
11242
11244
|
".local-credentialless.webcontainer.io",
|
|
@@ -11245,11 +11247,11 @@ const zo = "app.grapesjs.com", Bo = "app-stage.grapesjs.com", Ui = [
|
|
|
11245
11247
|
// For stackblitz.com demos
|
|
11246
11248
|
"-sandpack.codesandbox.io"
|
|
11247
11249
|
// For Sandpack demos
|
|
11248
|
-
],
|
|
11249
|
-
const n =
|
|
11250
|
-
return !!n && (
|
|
11250
|
+
], qf = "license:check:start", Kf = "license:check:end", jf = () => typeof window < "u", Uf = ({ isDev: n, isStage: e }) => `${n ? "" : `https://${e ? Bo : zo}`}/api`, Gf = () => {
|
|
11251
|
+
const n = jf() && window.location.hostname;
|
|
11252
|
+
return !!n && (ji.includes(n) || ji.some((e) => n.endsWith(e)));
|
|
11251
11253
|
};
|
|
11252
|
-
async function
|
|
11254
|
+
async function _f({
|
|
11253
11255
|
path: n,
|
|
11254
11256
|
baseApiUrl: e,
|
|
11255
11257
|
method: t = "GET",
|
|
@@ -11257,7 +11259,7 @@ async function jf({
|
|
|
11257
11259
|
params: i,
|
|
11258
11260
|
body: s
|
|
11259
11261
|
}) {
|
|
11260
|
-
const l = `${e ||
|
|
11262
|
+
const l = `${e || Uf({ isDev: !1, isStage: !1 })}${n}`, a = {
|
|
11261
11263
|
method: t,
|
|
11262
11264
|
headers: {
|
|
11263
11265
|
"Content-Type": "application/json",
|
|
@@ -11271,18 +11273,18 @@ async function jf({
|
|
|
11271
11273
|
return h.json();
|
|
11272
11274
|
}
|
|
11273
11275
|
var rt = /* @__PURE__ */ ((n) => (n.free = "free", n.startup = "startup", n.business = "business", n.enterprise = "enterprise", n))(rt || {}), dn = /* @__PURE__ */ ((n) => (n.toastAdd = "studio:toastAdd", n.toastRemove = "studio:toastRemove", n.dialogOpen = "studio:dialogOpen", n.dialogClose = "studio:dialogClose", 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.projectFiles = "studio:projectFiles", 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.getStateTheme = "studio:getStateTheme", n.setStateTheme = "studio:setStateTheme", 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))(dn || {});
|
|
11274
|
-
const
|
|
11276
|
+
const Ui = {
|
|
11275
11277
|
[rt.free]: 0,
|
|
11276
11278
|
[rt.startup]: 10,
|
|
11277
11279
|
[rt.business]: 20,
|
|
11278
11280
|
[rt.enterprise]: 30
|
|
11279
11281
|
};
|
|
11280
|
-
function
|
|
11282
|
+
function Xf(n) {
|
|
11281
11283
|
const e = n;
|
|
11282
11284
|
return e.init = (t) => (r) => n(r, t), e;
|
|
11283
11285
|
}
|
|
11284
|
-
const
|
|
11285
|
-
async function
|
|
11286
|
+
const Yf = (n) => /* @__PURE__ */ Xf(n);
|
|
11287
|
+
async function Zf({
|
|
11286
11288
|
editor: n,
|
|
11287
11289
|
plan: e,
|
|
11288
11290
|
pluginName: t,
|
|
@@ -11290,7 +11292,7 @@ async function Xf({
|
|
|
11290
11292
|
cleanup: i
|
|
11291
11293
|
}) {
|
|
11292
11294
|
let s = "", o = !1;
|
|
11293
|
-
const l =
|
|
11295
|
+
const l = Gf(), a = (f) => {
|
|
11294
11296
|
console.warn("Cleanup plugin:", t, "Reason:", f), i();
|
|
11295
11297
|
}, c = (f = {}) => {
|
|
11296
11298
|
var m;
|
|
@@ -11298,29 +11300,29 @@ async function Xf({
|
|
|
11298
11300
|
if (!(d || f.license) || h)
|
|
11299
11301
|
a(h || "Invalid license");
|
|
11300
11302
|
else if (u) {
|
|
11301
|
-
const g =
|
|
11303
|
+
const g = Ui[e], b = Ui[u];
|
|
11302
11304
|
g > b && a({ pluginRequiredPlan: e, licensePlan: u });
|
|
11303
11305
|
}
|
|
11304
11306
|
};
|
|
11305
|
-
n.on(
|
|
11307
|
+
n.on(qf, (f) => {
|
|
11306
11308
|
s = f == null ? void 0 : f.baseApiUrl, o = !0;
|
|
11307
|
-
}), n.on(
|
|
11309
|
+
}), n.on(Kf, (f) => {
|
|
11308
11310
|
c(f);
|
|
11309
11311
|
}), setTimeout(async () => {
|
|
11310
11312
|
if (!o) {
|
|
11311
11313
|
if (l) return;
|
|
11312
11314
|
if (r) {
|
|
11313
|
-
const f = await
|
|
11315
|
+
const f = await Qf({ licenseKey: r, pluginName: t, baseApiUrl: s });
|
|
11314
11316
|
f && c(f);
|
|
11315
11317
|
} else
|
|
11316
11318
|
a("The `licenseKey` option not provided");
|
|
11317
11319
|
}
|
|
11318
11320
|
}, 2e3);
|
|
11319
11321
|
}
|
|
11320
|
-
async function
|
|
11322
|
+
async function Qf(n) {
|
|
11321
11323
|
const { licenseKey: e, pluginName: t, baseApiUrl: r } = n;
|
|
11322
11324
|
try {
|
|
11323
|
-
return (await
|
|
11325
|
+
return (await _f({
|
|
11324
11326
|
baseApiUrl: r,
|
|
11325
11327
|
path: `/sdk/${e || "na"}`,
|
|
11326
11328
|
method: "POST",
|
|
@@ -11333,7 +11335,7 @@ async function Yf(n) {
|
|
|
11333
11335
|
return console.error("Error during SDK license check:", i), !1;
|
|
11334
11336
|
}
|
|
11335
11337
|
}
|
|
11336
|
-
const
|
|
11338
|
+
const eh = (n, e) => {
|
|
11337
11339
|
if (!e) return () => {
|
|
11338
11340
|
};
|
|
11339
11341
|
const t = "keydown", r = (s) => {
|
|
@@ -11344,7 +11346,7 @@ const Zf = (n, e) => {
|
|
|
11344
11346
|
document.addEventListener(t, r), n.on(n.events.destroy, i);
|
|
11345
11347
|
}), i;
|
|
11346
11348
|
};
|
|
11347
|
-
function
|
|
11349
|
+
function th(n, e) {
|
|
11348
11350
|
if (!e) return () => {
|
|
11349
11351
|
};
|
|
11350
11352
|
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 = {}) => {
|
|
@@ -11370,7 +11372,7 @@ const Ot = (n) => {
|
|
|
11370
11372
|
[xe]: { default: {} }
|
|
11371
11373
|
}, Dr = (n) => ({
|
|
11372
11374
|
[xe]: JSON.stringify(Ot(n))
|
|
11373
|
-
}), ue = (n) => ({ attrs: Ot(n) }), mt = (n) => (e) => [n, e.attrs.attrs, 0], ye = (n) => n.attrs[xe] ? JSON.parse(n.attrs[xe]) : {},
|
|
11375
|
+
}), ue = (n) => ({ attrs: Ot(n) }), mt = (n) => (e) => [n, e.attrs.attrs, 0], ye = (n) => n.attrs[xe] ? JSON.parse(n.attrs[xe]) : {}, nh = {
|
|
11374
11376
|
doc: {
|
|
11375
11377
|
content: "block+"
|
|
11376
11378
|
},
|
|
@@ -11526,7 +11528,7 @@ const Ot = (n) => {
|
|
|
11526
11528
|
getAttrs: Dr
|
|
11527
11529
|
})),
|
|
11528
11530
|
toDOM: e
|
|
11529
|
-
}),
|
|
11531
|
+
}), rh = (n) => ({
|
|
11530
11532
|
attrs: { ...Ar },
|
|
11531
11533
|
parseDOM: [
|
|
11532
11534
|
{
|
|
@@ -11540,13 +11542,13 @@ const Ot = (n) => {
|
|
|
11540
11542
|
[n]: !0
|
|
11541
11543
|
}, 0];
|
|
11542
11544
|
}
|
|
11543
|
-
}),
|
|
11545
|
+
}), ih = {
|
|
11544
11546
|
strong: gt(["strong", "b"], (n) => ["b", ye(n)]),
|
|
11545
11547
|
link: gt(["a"], (n) => ["a", ye(n), 0]),
|
|
11546
11548
|
em: gt(["em", "i"], (n) => ["em", ye(n)]),
|
|
11547
11549
|
underline: gt(["u"], (n) => ["u", ye(n), 0]),
|
|
11548
11550
|
strikethrough: gt(["s"], (n) => ["s", ye(n), 0]),
|
|
11549
|
-
wrapStyle:
|
|
11551
|
+
wrapStyle: rh(Vo),
|
|
11550
11552
|
font_size: {
|
|
11551
11553
|
attrs: {
|
|
11552
11554
|
...Ar,
|
|
@@ -11570,17 +11572,17 @@ const Ot = (n) => {
|
|
|
11570
11572
|
}
|
|
11571
11573
|
}
|
|
11572
11574
|
}, Xi = new ll({
|
|
11573
|
-
nodes:
|
|
11574
|
-
marks:
|
|
11575
|
-
}), Ft = /* @__PURE__ */ new WeakMap(), Er = /* @__PURE__ */ new WeakMap(),
|
|
11575
|
+
nodes: nh,
|
|
11576
|
+
marks: ih
|
|
11577
|
+
}), Ft = /* @__PURE__ */ new WeakMap(), Er = /* @__PURE__ */ new WeakMap(), sh = (n, e, t) => {
|
|
11576
11578
|
Ft.set(n, { view: e, gjsView: t }), Er.set(e, { el: n, gjsView: t });
|
|
11577
|
-
},
|
|
11579
|
+
}, oh = (n, e) => {
|
|
11578
11580
|
Ft.delete(n), Er.delete(e);
|
|
11579
11581
|
}, Wn = (n) => Ft.get(n), Po = (n) => Er.get(n), Jn = (n) => {
|
|
11580
11582
|
var e, t;
|
|
11581
11583
|
return (t = (e = Po(n)) == null ? void 0 : e.gjsView) == null ? void 0 : t.model;
|
|
11582
|
-
},
|
|
11583
|
-
function
|
|
11584
|
+
}, lh = (n) => n.dispatchEvent(new CustomEvent("input"));
|
|
11585
|
+
function ah(n) {
|
|
11584
11586
|
const e = (t) => {
|
|
11585
11587
|
if (t.tagName === "SPAN" && t.hasAttribute(un)) {
|
|
11586
11588
|
if (t.getAttribute("style")) {
|
|
@@ -11598,10 +11600,10 @@ function oh(n) {
|
|
|
11598
11600
|
};
|
|
11599
11601
|
e(n);
|
|
11600
11602
|
}
|
|
11601
|
-
const
|
|
11603
|
+
const ch = (n, e) => {
|
|
11602
11604
|
const t = Fo(n);
|
|
11603
|
-
return t &&
|
|
11604
|
-
},
|
|
11605
|
+
return t && xh(t) ? hh(n, e) : t ? Fs(() => ({ type: n.schema.nodes.div }))(n, e) : !1;
|
|
11606
|
+
}, fh = (n, e) => (t, r) => {
|
|
11605
11607
|
var l;
|
|
11606
11608
|
const i = Fo(t), s = Ft.get(n.el).view, o = (l = e.onEnter) == null ? void 0 : l.call(e, {
|
|
11607
11609
|
...n,
|
|
@@ -11609,7 +11611,7 @@ const lh = (n, e) => {
|
|
|
11609
11611
|
commands: Rr(s, n.editor, e),
|
|
11610
11612
|
proseMirror: { view: s, dispatch: r }
|
|
11611
11613
|
});
|
|
11612
|
-
return o !== void 0 ? o :
|
|
11614
|
+
return o !== void 0 ? o : ch(t, r);
|
|
11613
11615
|
};
|
|
11614
11616
|
function Fo(n) {
|
|
11615
11617
|
const e = n.selection.$from;
|
|
@@ -11619,13 +11621,13 @@ function Fo(n) {
|
|
|
11619
11621
|
}
|
|
11620
11622
|
return e.node(e.depth);
|
|
11621
11623
|
}
|
|
11622
|
-
function
|
|
11624
|
+
function hh(n, e) {
|
|
11623
11625
|
const { selection: t, schema: r, tr: i } = n;
|
|
11624
11626
|
i.split(t.from, 1);
|
|
11625
11627
|
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 : [], []);
|
|
11626
11628
|
return i.replaceRangeWith(s, s + c + 2, d), i.setSelection(C.create(i.doc, s + 1)), e == null || e(i.scrollIntoView()), !0;
|
|
11627
11629
|
}
|
|
11628
|
-
function
|
|
11630
|
+
function dh(n, e, t) {
|
|
11629
11631
|
const { state: r, dispatch: i } = n, { selection: s, tr: o } = r, l = (a, c, f) => {
|
|
11630
11632
|
const h = {};
|
|
11631
11633
|
return a.split(";").forEach((d) => {
|
|
@@ -11678,7 +11680,7 @@ const yt = (n, e) => {
|
|
|
11678
11680
|
s.marks.some((o) => o.type === e) && (i = !0);
|
|
11679
11681
|
}), i;
|
|
11680
11682
|
};
|
|
11681
|
-
function
|
|
11683
|
+
function uh(n) {
|
|
11682
11684
|
var h, d;
|
|
11683
11685
|
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;
|
|
11684
11686
|
try {
|
|
@@ -11688,7 +11690,7 @@ function hh(n) {
|
|
|
11688
11690
|
console.error("Error applying link mark:", u);
|
|
11689
11691
|
}
|
|
11690
11692
|
}
|
|
11691
|
-
function
|
|
11693
|
+
function ph(n, e) {
|
|
11692
11694
|
const { state: t, dispatch: r } = n, { selection: i, tr: s } = t;
|
|
11693
11695
|
if (i.empty) return;
|
|
11694
11696
|
const o = t.schema.marks.font_size;
|
|
@@ -11710,11 +11712,11 @@ const He = (n, e) => {
|
|
|
11710
11712
|
node: o
|
|
11711
11713
|
};
|
|
11712
11714
|
}
|
|
11713
|
-
},
|
|
11715
|
+
}, mh = (n) => (n || "").split(";").map((e) => e.split(":")).reduce(
|
|
11714
11716
|
(e, [t, r]) => (t = t.replace(/-./g, (i) => i.toUpperCase()[1]).trim(), e[t] = `${r}`.trim(), e),
|
|
11715
11717
|
{}
|
|
11716
11718
|
);
|
|
11717
|
-
function
|
|
11719
|
+
function gh(...n) {
|
|
11718
11720
|
return (e, t) => {
|
|
11719
11721
|
const r = (o) => {
|
|
11720
11722
|
e = e.apply(o), t == null || t(o);
|
|
@@ -11722,7 +11724,7 @@ function ph(...n) {
|
|
|
11722
11724
|
return n.reduce((o, l) => o || l(e, r), !1) && i !== void 0 && i(e, t);
|
|
11723
11725
|
};
|
|
11724
11726
|
}
|
|
11725
|
-
const
|
|
11727
|
+
const yh = (n, e) => {
|
|
11726
11728
|
const { state: t, dispatch: r } = n;
|
|
11727
11729
|
if (e != null && e.event) {
|
|
11728
11730
|
const { event: i } = e, s = n.posAtCoords({ left: i.clientX, top: i.clientY });
|
|
@@ -11730,19 +11732,19 @@ const mh = (n, e) => {
|
|
|
11730
11732
|
} else
|
|
11731
11733
|
Ls(t, r);
|
|
11732
11734
|
setTimeout(() => setTimeout(() => n.focus()));
|
|
11733
|
-
}, hr = (n) => n.isBlock, Lo = (n) => n.type.name === "inlineFragment",
|
|
11735
|
+
}, hr = (n) => n.isBlock, Lo = (n) => n.type.name === "inlineFragment", bh = (n) => hr(n) && !Lo(n), Ho = (n) => n.type.name === "bulletList", $o = (n) => n.type.name === "orderedList", xh = (n) => n.type.name === "heading", kh = (n) => Ho(n) || $o(n), Yi = (n, e) => {
|
|
11734
11736
|
var s, o;
|
|
11735
11737
|
const t = (s = He(n, (l) => l.type === e)) == null ? void 0 : s.node, r = n.state.schema.nodes.listItem;
|
|
11736
11738
|
let i;
|
|
11737
|
-
return t ? i = _n(r) : (o = He(n,
|
|
11739
|
+
return t ? i = _n(r) : (o = He(n, kh)) != null && o.node ? i = gh(_n(r), ti(e)) : i = ti(e), i(n.state, n.dispatch);
|
|
11738
11740
|
}, Wo = (n, e) => {
|
|
11739
11741
|
const { selection: t } = n.state;
|
|
11740
11742
|
return [...t.$from.marks(), ...t.$to.marks()].find((r) => r.type.name === e);
|
|
11741
|
-
},
|
|
11743
|
+
}, Sh = (n) => {
|
|
11742
11744
|
var o;
|
|
11743
|
-
const { view: e, prop: t, editor: r, propCSS: i } = n, s = (o = He(e,
|
|
11745
|
+
const { view: e, prop: t, editor: r, propCSS: i } = n, s = (o = He(e, bh)) == null ? void 0 : o.node;
|
|
11744
11746
|
if (s) {
|
|
11745
|
-
const l = s.attrs.attrs || {}, a =
|
|
11747
|
+
const l = s.attrs.attrs || {}, a = mh(l.style);
|
|
11746
11748
|
if (t in a)
|
|
11747
11749
|
return a[t] || "";
|
|
11748
11750
|
if (l.id) {
|
|
@@ -11751,7 +11753,7 @@ const mh = (n, e) => {
|
|
|
11751
11753
|
}
|
|
11752
11754
|
}
|
|
11753
11755
|
return "";
|
|
11754
|
-
},
|
|
11756
|
+
}, Ch = (n) => {
|
|
11755
11757
|
const { view: e, prop: t, markName: r, editor: i, propCSS: s } = n, o = Wo(e, r);
|
|
11756
11758
|
if (o) {
|
|
11757
11759
|
const l = o.attrs;
|
|
@@ -11832,16 +11834,16 @@ const mh = (n, e) => {
|
|
|
11832
11834
|
const u = (m = (p = Po(n)) == null ? void 0 : p.gjsView) == null ? void 0 : m.el;
|
|
11833
11835
|
u && u.contentEditable !== "true" && (u.contentEditable = "true"), n.focus();
|
|
11834
11836
|
};
|
|
11835
|
-
a != null && a.is("link") ? (a.addAttributes({ href: f, target: h }), d()) : c ? (a == null || a.addAttributes({ [c.getName()]: f }), d()) :
|
|
11837
|
+
a != null && a.is("link") ? (a.addAttributes({ href: f, target: h }), d()) : c ? (a == null || a.addAttributes({ [c.getName()]: f }), d()) : uh({ view: n, href: f, target: h, options: t });
|
|
11836
11838
|
}
|
|
11837
11839
|
},
|
|
11838
11840
|
alignText: {
|
|
11839
|
-
get: () =>
|
|
11840
|
-
set: (l) =>
|
|
11841
|
+
get: () => Sh({ view: n, editor: e, prop: "textAlign", propCSS: "text-align" }),
|
|
11842
|
+
set: (l) => dh(n, l.value, !0)
|
|
11841
11843
|
},
|
|
11842
11844
|
fontSize: {
|
|
11843
|
-
get: () =>
|
|
11844
|
-
set: (l) =>
|
|
11845
|
+
get: () => Ch({ view: n, editor: e, markName: "font_size", prop: "size", propCSS: "font-size" }),
|
|
11846
|
+
set: (l) => ph(n, l.value)
|
|
11845
11847
|
},
|
|
11846
11848
|
image: {
|
|
11847
11849
|
open() {
|
|
@@ -11912,10 +11914,10 @@ class Be {
|
|
|
11912
11914
|
rule's effect, or null to indicate the input was not handled.
|
|
11913
11915
|
*/
|
|
11914
11916
|
constructor(e, t, r = {}) {
|
|
11915
|
-
this.match = e, this.match = e, this.handler = typeof t == "string" ?
|
|
11917
|
+
this.match = e, this.match = e, this.handler = typeof t == "string" ? wh(t) : t, this.undoable = r.undoable !== !1, this.inCode = r.inCode || !1;
|
|
11916
11918
|
}
|
|
11917
11919
|
}
|
|
11918
|
-
function
|
|
11920
|
+
function wh(n) {
|
|
11919
11921
|
return function(e, t, r, i) {
|
|
11920
11922
|
let s = n;
|
|
11921
11923
|
if (t[1]) {
|
|
@@ -11927,8 +11929,8 @@ function Sh(n) {
|
|
|
11927
11929
|
return e.tr.insertText(s, r, i);
|
|
11928
11930
|
};
|
|
11929
11931
|
}
|
|
11930
|
-
const
|
|
11931
|
-
function
|
|
11932
|
+
const Mh = 500;
|
|
11933
|
+
function Oh({ rules: n }) {
|
|
11932
11934
|
let e = new ut({
|
|
11933
11935
|
state: {
|
|
11934
11936
|
init() {
|
|
@@ -11959,7 +11961,7 @@ function wh({ rules: n }) {
|
|
|
11959
11961
|
function Zi(n, e, t, r, i, s) {
|
|
11960
11962
|
if (n.composing)
|
|
11961
11963
|
return !1;
|
|
11962
|
-
let o = n.state, l = o.doc.resolve(e), a = l.parent.textBetween(Math.max(0, l.parentOffset -
|
|
11964
|
+
let o = n.state, l = o.doc.resolve(e), a = l.parent.textBetween(Math.max(0, l.parentOffset - Mh), l.parentOffset, null, "") + r;
|
|
11963
11965
|
for (let c = 0; c < i.length; c++) {
|
|
11964
11966
|
let f = i[c];
|
|
11965
11967
|
if (l.parent.type.spec.code) {
|
|
@@ -11973,7 +11975,7 @@ function Zi(n, e, t, r, i, s) {
|
|
|
11973
11975
|
}
|
|
11974
11976
|
return !1;
|
|
11975
11977
|
}
|
|
11976
|
-
const
|
|
11978
|
+
const Nh = new Be(/--$/, "—"), Th = new Be(/\.\.\.$/, "…"), Ah = new Be(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/, "“"), Dh = new Be(/"$/, "”"), Eh = new Be(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/, "‘"), Rh = new Be(/'$/, "’"), Ih = [Ah, Dh, Eh, Rh];
|
|
11977
11979
|
function Ir(n, e, t = null, r) {
|
|
11978
11980
|
return new Be(n, (i, s, o, l) => {
|
|
11979
11981
|
let a = t instanceof Function ? t(s) : t, c = i.tr.delete(o, l), f = c.doc.resolve(o), h = f.blockRange(), d = h && Cs(h, e, a);
|
|
@@ -11990,10 +11992,10 @@ function Jo(n, e, t = null) {
|
|
|
11990
11992
|
return l.node(-1).canReplaceWith(l.index(-1), l.indexAfter(-1), e) ? r.tr.delete(s, o).setBlockType(s, s, e, a) : null;
|
|
11991
11993
|
});
|
|
11992
11994
|
}
|
|
11993
|
-
function
|
|
11995
|
+
function vh(n) {
|
|
11994
11996
|
return Ir(/^\s*>\s$/, n);
|
|
11995
11997
|
}
|
|
11996
|
-
function
|
|
11998
|
+
function zh(n) {
|
|
11997
11999
|
return Ir(
|
|
11998
12000
|
/^(\d+)\.\s$/,
|
|
11999
12001
|
n,
|
|
@@ -12001,23 +12003,23 @@ function Ih(n) {
|
|
|
12001
12003
|
(e, t) => t.childCount + t.attrs.order == +e[1]
|
|
12002
12004
|
);
|
|
12003
12005
|
}
|
|
12004
|
-
function
|
|
12006
|
+
function Bh(n) {
|
|
12005
12007
|
return Ir(/^\s*([-+*])\s$/, n);
|
|
12006
12008
|
}
|
|
12007
|
-
function
|
|
12009
|
+
function Vh(n) {
|
|
12008
12010
|
return Jo(/^```$/, n);
|
|
12009
12011
|
}
|
|
12010
|
-
function
|
|
12012
|
+
function Ph(n, e) {
|
|
12011
12013
|
return Jo(new RegExp("^(#{1," + e + "})\\s$"), n, (t) => ({
|
|
12012
12014
|
level: t[1].length
|
|
12013
12015
|
}));
|
|
12014
12016
|
}
|
|
12015
|
-
function
|
|
12016
|
-
const e =
|
|
12017
|
+
function Fh(n) {
|
|
12018
|
+
const e = Ih.concat(Th, Nh);
|
|
12017
12019
|
let t;
|
|
12018
|
-
return (t = n.nodes.blockquote) && e.push(
|
|
12020
|
+
return (t = n.nodes.blockquote) && e.push(vh(t)), (t = n.nodes.orderedList) && e.push(zh(t)), (t = n.nodes.bulletList) && e.push(Bh(t)), (t = n.nodes.codeBlock) && e.push(Vh(t)), (t = n.nodes.heading) && e.push(Ph(t, 6)), Oh({ rules: e });
|
|
12019
12021
|
}
|
|
12020
|
-
const
|
|
12022
|
+
const Lh = "rteProseMirror", Hh = rt.free, Q = "rte:selectionchange", Z = {
|
|
12021
12023
|
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>',
|
|
12022
12024
|
italic: '<svg viewBox="0 0 24 24"><path d="M10,4V7H12.21L8.79,15H6V18H14V15H11.79L15.21,7H18V4H10Z" /></svg>',
|
|
12023
12025
|
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>',
|
|
@@ -12030,7 +12032,7 @@ const Ph = "rteProseMirror", Fh = rt.free, Q = "rte:selectionchange", Z = {
|
|
|
12030
12032
|
alignTextCenter: '<svg viewBox="0 0 24 24"><path d="M3,3H21V5H3V3M7,7H17V9H7V7M3,11H21V13H3V11M7,15H17V17H7V15M3,19H21V21H3V19Z" /></svg>',
|
|
12031
12033
|
alignTextRight: '<svg viewBox="0 0 24 24"><path d="M3,3H21V5H3V3M9,7H21V9H9V7M3,11H21V13H3V11M9,15H21V17H9V15M3,19H21V21H3V19Z" /></svg>',
|
|
12032
12034
|
alignTextJustify: '<svg viewBox="0 0 24 24"><path d="M3,3H21V5H3V3M3,7H21V9H3V7M3,11H21V13H3V11M3,15H21V17H3V15M3,19H21V21H3V19Z" /></svg>'
|
|
12033
|
-
},
|
|
12035
|
+
}, $h = (n, e) => {
|
|
12034
12036
|
var a;
|
|
12035
12037
|
const { editor: t, el: r } = n, i = Ft.get(r).view, s = Rr(i, t, e), o = {
|
|
12036
12038
|
separator: {
|
|
@@ -12307,7 +12309,7 @@ const Ph = "rteProseMirror", Fh = rt.free, Q = "rte:selectionchange", Z = {
|
|
|
12307
12309
|
items: l
|
|
12308
12310
|
})) || l;
|
|
12309
12311
|
};
|
|
12310
|
-
class
|
|
12312
|
+
class Wh {
|
|
12311
12313
|
constructor(e, t, r) {
|
|
12312
12314
|
this.editor = r, this.node = e, this.dom = document.createElement("img"), this.view = t, Object.keys(e.attrs.attrs).forEach((i) => {
|
|
12313
12315
|
this.dom.setAttribute(i, e.attrs.attrs[i]);
|
|
@@ -12329,7 +12331,7 @@ class Hh {
|
|
|
12329
12331
|
this.dom.style.outline = "";
|
|
12330
12332
|
}
|
|
12331
12333
|
}
|
|
12332
|
-
const
|
|
12334
|
+
const Jh = function(n, e = {}) {
|
|
12333
12335
|
const t = {
|
|
12334
12336
|
plugins: (l) => l.plugins,
|
|
12335
12337
|
...e
|
|
@@ -12349,14 +12351,14 @@ const $h = function(n, e = {}) {
|
|
|
12349
12351
|
plugins: [
|
|
12350
12352
|
Rf(),
|
|
12351
12353
|
$f(),
|
|
12352
|
-
|
|
12354
|
+
Fh(c),
|
|
12353
12355
|
da(),
|
|
12354
12356
|
Bn({
|
|
12355
12357
|
Tab: Fi(1),
|
|
12356
12358
|
"Shift-Tab": Fi(-1)
|
|
12357
12359
|
}),
|
|
12358
12360
|
Bn({
|
|
12359
|
-
Enter: At(Ps, ka(f.listItem),
|
|
12361
|
+
Enter: At(Ps, ka(f.listItem), fh(d, t)),
|
|
12360
12362
|
"Shift-Enter": At(Vs, (w, M) => (M && M(w.tr.replaceSelectionWith(f.inlineBreak.create()).scrollIntoView()), !0)),
|
|
12361
12363
|
"Mod-z": Ks,
|
|
12362
12364
|
"Mod-y": Gn,
|
|
@@ -12381,18 +12383,18 @@ const $h = function(n, e = {}) {
|
|
|
12381
12383
|
const { state: M } = m, T = M.apply(w), I = !M.doc.eq(T.doc);
|
|
12382
12384
|
m.updateState(T);
|
|
12383
12385
|
const D = !M.selection.eq(T.selection);
|
|
12384
|
-
I && (
|
|
12386
|
+
I && (lh(((Y = a == null ? void 0 : a.view) == null ? void 0 : Y.el) || l), m.focus()), (D || I) && n.trigger(Q);
|
|
12385
12387
|
}
|
|
12386
12388
|
}
|
|
12387
12389
|
);
|
|
12388
12390
|
return l.__rteView = m, m.setProps({
|
|
12389
12391
|
nodeViews: {
|
|
12390
12392
|
image(w) {
|
|
12391
|
-
return new
|
|
12393
|
+
return new Wh(w, m, n);
|
|
12392
12394
|
}
|
|
12393
12395
|
}
|
|
12394
12396
|
}), m;
|
|
12395
|
-
}, i = (l) =>
|
|
12397
|
+
}, i = (l) => $h(l, t);
|
|
12396
12398
|
n.setCustomRte({
|
|
12397
12399
|
// Use Studio SDK toolbar
|
|
12398
12400
|
toolbar: i,
|
|
@@ -12402,13 +12404,13 @@ const $h = function(n, e = {}) {
|
|
|
12402
12404
|
const f = Wn(l);
|
|
12403
12405
|
if (f) return f;
|
|
12404
12406
|
const h = r(l, c);
|
|
12405
|
-
return
|
|
12407
|
+
return sh(l, h, c.view), yh(h, c), h;
|
|
12406
12408
|
},
|
|
12407
12409
|
disable(l) {
|
|
12408
12410
|
var c;
|
|
12409
12411
|
const a = (c = Wn(l)) == null ? void 0 : c.view;
|
|
12410
12412
|
if (a)
|
|
12411
|
-
return
|
|
12413
|
+
return oh(l, a), a.destroy(), { forceSync: !0 };
|
|
12412
12414
|
},
|
|
12413
12415
|
getContent(l) {
|
|
12414
12416
|
var c;
|
|
@@ -12417,22 +12419,22 @@ const $h = function(n, e = {}) {
|
|
|
12417
12419
|
const { schema: f, doc: h } = a.state, d = document.createElement("div"), u = Ye.fromSchema(f).serializeFragment(h.content);
|
|
12418
12420
|
return u.childNodes.forEach((p) => {
|
|
12419
12421
|
p.nodeType === Node.ELEMENT_NODE && p.innerHTML === "" && (p.innerHTML = "<br/>");
|
|
12420
|
-
}), d.appendChild(u),
|
|
12422
|
+
}), d.appendChild(u), ah(d), l.classList.remove("ProseMirror-focused"), d.innerHTML;
|
|
12421
12423
|
}
|
|
12422
12424
|
return l.innerHTML;
|
|
12423
12425
|
}
|
|
12424
12426
|
});
|
|
12425
|
-
const s =
|
|
12426
|
-
|
|
12427
|
+
const s = th(n, t.enableOnClick), o = eh(n, t.disableOnEsc);
|
|
12428
|
+
Zf({
|
|
12427
12429
|
editor: n,
|
|
12428
12430
|
licenseKey: t.licenseKey,
|
|
12429
|
-
plan:
|
|
12430
|
-
pluginName:
|
|
12431
|
+
plan: Hh,
|
|
12432
|
+
pluginName: Lh,
|
|
12431
12433
|
cleanup: () => {
|
|
12432
12434
|
n.RichTextEditor.customRte = void 0, s(), o();
|
|
12433
12435
|
}
|
|
12434
12436
|
});
|
|
12435
|
-
},
|
|
12437
|
+
}, qh = Yf(Jh);
|
|
12436
12438
|
export {
|
|
12437
|
-
|
|
12439
|
+
qh as default
|
|
12438
12440
|
};
|