@grapesjs/studio-sdk-plugins 1.0.33-rc.1 → 1.0.33
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 +7 -7
- package/dist/accordionComponent/index.es.js +161 -156
- package/dist/accordionComponent/index.umd.js +9 -9
- package/dist/aiChat/chatManager.d.ts +15 -0
- package/dist/aiChat/clientTools.d.ts +3 -3
- package/dist/aiChat/clientToolsProcessors.d.ts +14 -1
- package/dist/aiChat/components/AiChatEmptyState.d.ts +4 -6
- package/dist/aiChat/components/AiChatError.d.ts +2 -1
- package/dist/aiChat/components/AiChatHeader.d.ts +2 -1
- package/dist/aiChat/components/AiChatInput/AssetsSection.d.ts +7 -0
- package/dist/aiChat/components/AiChatInput/AttachButton.d.ts +10 -0
- package/dist/aiChat/components/AiChatInput/ContextSection.d.ts +5 -0
- package/dist/aiChat/components/AiChatInput/DictateButton.d.ts +7 -0
- package/dist/aiChat/components/AiChatInput/TextAreaWithAutoResize.d.ts +6 -0
- package/dist/aiChat/components/AiChatInput/constants.d.ts +6 -0
- package/dist/aiChat/components/AiChatInput/hooks/useSpeechToText.d.ts +15 -0
- package/dist/aiChat/components/AiChatInput/index.d.ts +37 -0
- package/dist/aiChat/components/AiChatLoadingState.d.ts +2 -1
- package/dist/aiChat/components/AiChatMessage.d.ts +21 -9
- package/dist/aiChat/components/AiChatMessages.d.ts +5 -7
- package/dist/aiChat/components/AiChatMessagesStatus.d.ts +5 -0
- package/dist/aiChat/components/AiChatPanel.d.ts +2 -3
- package/dist/aiChat/components/AiChatProvider.d.ts +14 -0
- package/dist/aiChat/components/MemoizedMarkdown.d.ts +9 -0
- package/dist/aiChat/components/index.d.ts +24 -25
- package/dist/aiChat/components/utils.d.ts +12 -4
- package/dist/aiChat/index.cjs.d.ts +5 -0
- package/dist/aiChat/index.cjs.js +453 -0
- package/dist/aiChat/index.d.ts +4 -3
- package/dist/aiChat/index.es.d.ts +5 -0
- package/dist/aiChat/index.es.js +30930 -0
- package/dist/aiChat/index.js +453 -0
- package/dist/aiChat/index.umd.js +453 -0
- package/dist/aiChat/locales/en.d.ts +64 -0
- package/dist/aiChat/server/index.cjs.d.ts +4 -0
- package/dist/aiChat/server/index.cjs.js +309 -0
- package/dist/aiChat/server/index.d.ts +0 -50
- package/dist/aiChat/server/index.es.d.ts +4 -0
- package/dist/aiChat/server/index.es.js +876 -0
- package/dist/aiChat/server/index.js +309 -0
- package/dist/aiChat/server/index.umd.js +309 -0
- package/dist/aiChat/server/stream.d.ts +0 -6
- package/dist/aiChat/server/tools.d.ts +157 -51
- package/dist/aiChat/server/types.d.ts +108 -64
- package/dist/aiChat/types.d.ts +148 -108
- package/dist/aiChat/typesSchema.d.ts +238 -25
- package/dist/animationComponent/index.cjs.js +3 -3
- package/dist/animationComponent/index.es.js +174 -169
- package/dist/animationComponent/index.umd.js +3 -3
- package/dist/canvasAbsoluteMode/index.cjs.js +1 -1
- package/dist/canvasAbsoluteMode/index.es.js +161 -156
- package/dist/canvasAbsoluteMode/index.umd.js +1 -1
- package/dist/canvasEmptyState/index.cjs.js +1 -1
- package/dist/canvasEmptyState/index.es.js +113 -108
- package/dist/canvasEmptyState/index.umd.js +1 -1
- package/dist/canvasFullSize/index.cjs.js +9 -9
- package/dist/canvasFullSize/index.es.js +137 -132
- package/dist/canvasFullSize/index.umd.js +9 -9
- package/dist/canvasGridMode/index.cjs.js +4 -4
- package/dist/canvasGridMode/index.es.js +168 -163
- package/dist/canvasGridMode/index.umd.js +8 -8
- package/dist/canvasScreenshot/index.cjs.js +1 -1
- package/dist/canvasScreenshot/index.es.js +132 -127
- package/dist/canvasScreenshot/index.umd.js +1 -1
- package/dist/dataSourceEjs/index.cjs.js +5 -5
- package/dist/dataSourceEjs/index.es.js +151 -146
- package/dist/dataSourceEjs/index.umd.js +5 -5
- package/dist/dataSourceHandlebars/index.cjs.js +4 -4
- package/dist/dataSourceHandlebars/index.es.js +91 -86
- package/dist/dataSourceHandlebars/index.umd.js +5 -5
- package/dist/dialogComponent/index.cjs.js +16 -16
- package/dist/dialogComponent/index.es.js +117 -112
- package/dist/dialogComponent/index.umd.js +16 -16
- package/dist/flexComponent/index.cjs.js +11 -11
- package/dist/flexComponent/index.es.js +416 -411
- package/dist/flexComponent/index.umd.js +11 -11
- package/dist/fsLightboxComponent/index.cjs.js +3 -3
- package/dist/fsLightboxComponent/index.es.js +152 -147
- package/dist/fsLightboxComponent/index.umd.js +3 -3
- package/dist/googleFontsAssetProvider/index.cjs.js +1 -1
- package/dist/googleFontsAssetProvider/index.es.js +127 -122
- package/dist/googleFontsAssetProvider/index.umd.js +1 -1
- package/dist/iconifyComponent/index.cjs.js +2 -2
- package/dist/iconifyComponent/index.es.js +170 -165
- package/dist/iconifyComponent/index.umd.js +2 -2
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +27 -22
- package/dist/index.umd.js +1 -1
- package/dist/layoutSidebarButtons/index.cjs.js +1 -1
- package/dist/layoutSidebarButtons/index.es.js +156 -151
- package/dist/layoutSidebarButtons/index.umd.js +1 -1
- package/dist/lightGalleryComponent/index.cjs.js +1 -1
- package/dist/lightGalleryComponent/index.es.js +197 -192
- package/dist/lightGalleryComponent/index.umd.js +1 -1
- package/dist/linkImageComponent/index.cjs.js +2 -2
- package/dist/linkImageComponent/index.es.js +86 -81
- package/dist/linkImageComponent/index.umd.js +2 -2
- package/dist/listPagesComponent/index.cjs.js +5 -5
- package/dist/listPagesComponent/index.es.js +121 -116
- package/dist/listPagesComponent/index.umd.js +5 -5
- package/dist/presetPrintable/index.cjs.js +4 -4
- package/dist/presetPrintable/index.es.js +180 -175
- package/dist/presetPrintable/index.umd.js +4 -4
- package/dist/prosemirror/index.cjs.js +6 -6
- package/dist/prosemirror/index.es.js +128 -123
- package/dist/prosemirror/index.umd.js +8 -8
- package/dist/rendererReact/index.cjs.js +1 -1
- package/dist/rendererReact/index.es.js +127 -122
- 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 +160 -155
- package/dist/rteTinyMce/index.umd.js +2 -2
- package/dist/shapeDividerComponent/index.cjs.js +25 -25
- package/dist/shapeDividerComponent/index.es.js +127 -122
- package/dist/shapeDividerComponent/index.umd.js +25 -25
- package/dist/swiperComponent/index.cjs.js +9 -9
- package/dist/swiperComponent/index.es.js +197 -192
- package/dist/swiperComponent/index.umd.js +9 -9
- package/dist/tableComponent/index.cjs.js +1 -1
- package/dist/tableComponent/index.es.js +227 -222
- package/dist/tableComponent/index.umd.js +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/utils.d.ts +12 -1
- package/dist/youtubeAssetProvider/index.cjs.js +1 -1
- package/dist/youtubeAssetProvider/index.es.js +124 -119
- package/dist/youtubeAssetProvider/index.umd.js +1 -1
- package/package.json +5 -2
- package/dist/aiChat/components/AiChatInput.d.ts +0 -17
- package/dist/aiChat/server/stream-utils.d.ts +0 -16
|
@@ -1791,7 +1791,7 @@ function gs(n, e) {
|
|
|
1791
1791
|
t[r] = new fl(n, r, e[r]);
|
|
1792
1792
|
return t;
|
|
1793
1793
|
}
|
|
1794
|
-
let
|
|
1794
|
+
let Fr = class ys {
|
|
1795
1795
|
/**
|
|
1796
1796
|
@internal
|
|
1797
1797
|
*/
|
|
@@ -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 = B.from(e.nodes), t.marks = B.from(e.marks || {}), this.nodes =
|
|
2053
|
+
t.nodes = B.from(e.nodes), t.marks = B.from(e.marks || {}), this.nodes = Fr.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)
|
|
@@ -2063,11 +2063,11 @@ class hl {
|
|
|
2063
2063
|
throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");
|
|
2064
2064
|
this.linebreakReplacement = s;
|
|
2065
2065
|
}
|
|
2066
|
-
s.markSet = l == "_" ? null : l ?
|
|
2066
|
+
s.markSet = l == "_" ? null : l ? Lr(this, l.split(" ")) : l == "" || !s.inlineContent ? [] : null;
|
|
2067
2067
|
}
|
|
2068
2068
|
for (let i in this.marks) {
|
|
2069
2069
|
let s = this.marks[i], o = s.spec.excludes;
|
|
2070
|
-
s.excluded = o == null ? [s] : o == "" ? [] :
|
|
2070
|
+
s.excluded = o == null ? [s] : o == "" ? [] : Lr(this, o.split(" "));
|
|
2071
2071
|
}
|
|
2072
2072
|
this.nodeFromJSON = this.nodeFromJSON.bind(this), this.markFromJSON = this.markFromJSON.bind(this), this.topNodeType = this.nodes[this.spec.topNode || "doc"], this.cached.wrappings = /* @__PURE__ */ Object.create(null);
|
|
2073
2073
|
}
|
|
@@ -2080,7 +2080,7 @@ class hl {
|
|
|
2080
2080
|
node(e, t = null, r, i) {
|
|
2081
2081
|
if (typeof e == "string")
|
|
2082
2082
|
e = this.nodeType(e);
|
|
2083
|
-
else if (e instanceof
|
|
2083
|
+
else if (e instanceof Fr) {
|
|
2084
2084
|
if (e.schema != this)
|
|
2085
2085
|
throw new RangeError("Node type from different schema used (" + e.name + ")");
|
|
2086
2086
|
} else throw new RangeError("Invalid node type: " + e);
|
|
@@ -2124,7 +2124,7 @@ class hl {
|
|
|
2124
2124
|
return t;
|
|
2125
2125
|
}
|
|
2126
2126
|
}
|
|
2127
|
-
function
|
|
2127
|
+
function Lr(n, e) {
|
|
2128
2128
|
let t = [];
|
|
2129
2129
|
for (let r = 0; r < e.length; r++) {
|
|
2130
2130
|
let i = e[r], s = n.marks[i], o = s;
|
|
@@ -3355,7 +3355,7 @@ class $ extends J {
|
|
|
3355
3355
|
}
|
|
3356
3356
|
}
|
|
3357
3357
|
J.jsonID("replace", $);
|
|
3358
|
-
class
|
|
3358
|
+
class F extends J {
|
|
3359
3359
|
/**
|
|
3360
3360
|
Create a replace-around step with the given range and gap.
|
|
3361
3361
|
`insert` should be the point in the slice into which the content
|
|
@@ -3386,11 +3386,11 @@ class L extends J {
|
|
|
3386
3386
|
}
|
|
3387
3387
|
invert(e) {
|
|
3388
3388
|
let t = this.gapTo - this.gapFrom;
|
|
3389
|
-
return new
|
|
3389
|
+
return new F(this.from, this.from + this.slice.size + t, this.from + this.insert, this.from + this.insert + t, e.slice(this.from, this.to).removeBetween(this.gapFrom - this.from, this.gapTo - this.from), this.gapFrom - this.from, this.structure);
|
|
3390
3390
|
}
|
|
3391
3391
|
map(e) {
|
|
3392
3392
|
let t = e.mapResult(this.from, 1), r = e.mapResult(this.to, -1), i = this.from == this.gapFrom ? t.pos : e.map(this.gapFrom, -1), s = this.to == this.gapTo ? r.pos : e.map(this.gapTo, 1);
|
|
3393
|
-
return t.deletedAcross && r.deletedAcross || i < t.pos || s > r.pos ? null : new
|
|
3393
|
+
return t.deletedAcross && r.deletedAcross || i < t.pos || s > r.pos ? null : new F(t.pos, r.pos, i, s, this.slice, this.insert, this.structure);
|
|
3394
3394
|
}
|
|
3395
3395
|
toJSON() {
|
|
3396
3396
|
let e = {
|
|
@@ -3409,10 +3409,10 @@ class L extends J {
|
|
|
3409
3409
|
static fromJSON(e, t) {
|
|
3410
3410
|
if (typeof t.from != "number" || typeof t.to != "number" || typeof t.gapFrom != "number" || typeof t.gapTo != "number" || typeof t.insert != "number")
|
|
3411
3411
|
throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");
|
|
3412
|
-
return new
|
|
3412
|
+
return new F(t.from, t.to, t.gapFrom, t.gapTo, k.fromJSON(e, t.slice), t.insert, !!t.structure);
|
|
3413
3413
|
}
|
|
3414
3414
|
}
|
|
3415
|
-
J.jsonID("replaceAround",
|
|
3415
|
+
J.jsonID("replaceAround", F);
|
|
3416
3416
|
function Xn(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; )
|
|
@@ -3512,7 +3512,7 @@ function Ml(n, e, t) {
|
|
|
3512
3512
|
let d = y.empty, u = 0;
|
|
3513
3513
|
for (let p = s, m = !1; p > t; p--)
|
|
3514
3514
|
m || i.after(p + 1) < i.end(p) ? (m = !0, d = y.from(i.node(p).copy(d)), u++) : c++;
|
|
3515
|
-
n.step(new
|
|
3515
|
+
n.step(new F(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
3518
|
let i = Ol(n, e), s = i && Nl(r, e);
|
|
@@ -3548,7 +3548,7 @@ function Tl(n, e, t) {
|
|
|
3548
3548
|
r = y.from(t[o].type.create(t[o].attrs, r));
|
|
3549
3549
|
}
|
|
3550
3550
|
let i = e.start, s = e.end;
|
|
3551
|
-
n.step(new
|
|
3551
|
+
n.step(new F(i, s, i, s, new k(r, 0, 0), t.length, !0));
|
|
3552
3552
|
}
|
|
3553
3553
|
function Al(n, e, t, r, i) {
|
|
3554
3554
|
if (!r.isTextblock)
|
|
@@ -3564,7 +3564,7 @@ function Al(n, e, t, r, i) {
|
|
|
3564
3564
|
}
|
|
3565
3565
|
c === !1 && Ts(n, o, l, s), yr(n, n.mapping.slice(s).map(l, 1), r, void 0, c === null);
|
|
3566
3566
|
let f = n.mapping.slice(s), h = f.map(l, 1), d = f.map(l + o.nodeSize, 1);
|
|
3567
|
-
return n.step(new
|
|
3567
|
+
return n.step(new F(h, d, h + 1, d - 1, new k(y.from(r.create(a, null, o.marks)), 0, 0), 1, !0)), c === !0 && Ns(n, o, l, s), !1;
|
|
3568
3568
|
}
|
|
3569
3569
|
});
|
|
3570
3570
|
}
|
|
@@ -3602,7 +3602,7 @@ function El(n, e, t, r, i) {
|
|
|
3602
3602
|
return n.replaceWith(e, e + s.nodeSize, o);
|
|
3603
3603
|
if (!t.validContent(s.content))
|
|
3604
3604
|
throw new RangeError("Invalid content for node type " + t.name);
|
|
3605
|
-
n.step(new
|
|
3605
|
+
n.step(new F(e, e + s.nodeSize, e + 1, e + s.nodeSize - 1, new k(y.from(o), 0, 0), 1, !0));
|
|
3606
3606
|
}
|
|
3607
3607
|
function st(n, e, t = 1, r) {
|
|
3608
3608
|
let i = n.resolve(e), s = i.depth - t, o = r && r[r.length - 1] || i.parent;
|
|
@@ -3746,7 +3746,7 @@ class Vl {
|
|
|
3746
3746
|
for (; o && l && s.childCount == 1; )
|
|
3747
3747
|
s = s.firstChild.content, o--, l--;
|
|
3748
3748
|
let a = new k(s, o, l);
|
|
3749
|
-
return e > -1 ? new
|
|
3749
|
+
return e > -1 ? new F(r.pos, e, this.$to.pos, this.$to.end(), a, t) : a.size || r.pos != this.$to.pos ? new $(r.pos, i.pos, a) : null;
|
|
3750
3750
|
}
|
|
3751
3751
|
// Find a position on the start spine of `this.unplaced` that has
|
|
3752
3752
|
// content that can be moved somewhere on the frontier. Returns two
|
|
@@ -3887,15 +3887,15 @@ 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 Ll(n) {
|
|
3899
3899
|
return n.spec.defining || n.spec.definingForContent;
|
|
3900
3900
|
}
|
|
3901
3901
|
function Hl(n, e, t, r) {
|
|
@@ -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 = Ll(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)
|
|
@@ -4676,7 +4676,7 @@ function Xr(n, e, t) {
|
|
|
4676
4676
|
if (r < e)
|
|
4677
4677
|
return;
|
|
4678
4678
|
let i = n.steps[r];
|
|
4679
|
-
if (!(i instanceof $ || i instanceof
|
|
4679
|
+
if (!(i instanceof $ || i instanceof F))
|
|
4680
4680
|
return;
|
|
4681
4681
|
let s = n.mapping.maps[r], o;
|
|
4682
4682
|
s.forEach((l, a, c, f) => {
|
|
@@ -5168,7 +5168,7 @@ const Xl = (n, e, t) => {
|
|
|
5168
5168
|
let r = _l(n, t);
|
|
5169
5169
|
if (!r)
|
|
5170
5170
|
return !1;
|
|
5171
|
-
let i =
|
|
5171
|
+
let i = Fs(r);
|
|
5172
5172
|
if (!i)
|
|
5173
5173
|
return !1;
|
|
5174
5174
|
let s = i.nodeAfter;
|
|
@@ -5192,12 +5192,12 @@ const Xl = (n, e, t) => {
|
|
|
5192
5192
|
if (r.parent.isTextblock) {
|
|
5193
5193
|
if (t ? !t.endOfTextblock("forward", n) : r.parentOffset < r.parent.content.size)
|
|
5194
5194
|
return !1;
|
|
5195
|
-
s =
|
|
5195
|
+
s = Fs(r);
|
|
5196
5196
|
}
|
|
5197
5197
|
let o = s && s.nodeAfter;
|
|
5198
5198
|
return !o || !x.isSelectable(o) ? !1 : (e && e(n.tr.setSelection(x.create(n.doc, s.pos)).scrollIntoView()), !0);
|
|
5199
5199
|
};
|
|
5200
|
-
function
|
|
5200
|
+
function Fs(n) {
|
|
5201
5201
|
if (!n.parent.type.spec.isolating)
|
|
5202
5202
|
for (let e = n.depth - 1; e >= 0; e--) {
|
|
5203
5203
|
let t = n.node(e);
|
|
@@ -5221,7 +5221,7 @@ function xr(n) {
|
|
|
5221
5221
|
}
|
|
5222
5222
|
return null;
|
|
5223
5223
|
}
|
|
5224
|
-
const
|
|
5224
|
+
const Ls = (n, e) => {
|
|
5225
5225
|
let { $head: t, $anchor: r } = n.selection;
|
|
5226
5226
|
if (!t.parent.type.spec.code || !t.sameParent(r))
|
|
5227
5227
|
return !1;
|
|
@@ -5302,7 +5302,7 @@ function Js(n, e, t, r) {
|
|
|
5302
5302
|
for (let b = o.length - 1; b >= 0; b--)
|
|
5303
5303
|
p = y.from(o[b].create(null, p));
|
|
5304
5304
|
p = y.from(i.copy(p));
|
|
5305
|
-
let m = n.tr.step(new
|
|
5305
|
+
let m = n.tr.step(new F(e.pos - 1, u, e.pos, u, new k(p, 1, 0), o.length, !0)), g = m.doc.resolve(u + 2 * o.length);
|
|
5306
5306
|
g.nodeAfter && g.nodeAfter.type == i.type && yn(m.doc, g.pos) && m.join(g.pos), t(m.scrollIntoView());
|
|
5307
5307
|
}
|
|
5308
5308
|
return !0;
|
|
@@ -5322,7 +5322,7 @@ function Js(n, e, t, r) {
|
|
|
5322
5322
|
let b = y.empty;
|
|
5323
5323
|
for (let N = p.length - 1; N >= 0; N--)
|
|
5324
5324
|
b = y.from(p[N].copy(b));
|
|
5325
|
-
let w = n.tr.step(new
|
|
5325
|
+
let w = n.tr.step(new F(e.pos - p.length, e.pos + s.nodeSize, e.pos + g, e.pos + s.nodeSize - g, new k(b, p.length, 0), 0, !0));
|
|
5326
5326
|
t(w.scrollIntoView());
|
|
5327
5327
|
}
|
|
5328
5328
|
return !0;
|
|
@@ -5421,7 +5421,7 @@ function At(...n) {
|
|
|
5421
5421
|
let vn = At(Ps, Ul, Gl), ei = At(Ps, Xl, Yl);
|
|
5422
5422
|
const ye = {
|
|
5423
5423
|
Enter: At(Zl, Ql, Hs, ea),
|
|
5424
|
-
"Mod-Enter":
|
|
5424
|
+
"Mod-Enter": Ls,
|
|
5425
5425
|
Backspace: vn,
|
|
5426
5426
|
"Mod-Backspace": vn,
|
|
5427
5427
|
"Shift-Backspace": vn,
|
|
@@ -5897,7 +5897,7 @@ function Ca(n) {
|
|
|
5897
5897
|
function Vn(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
|
-
function
|
|
5900
|
+
function Fn(n) {
|
|
5901
5901
|
return new ut({ props: { handleKeyDown: _s(n) } });
|
|
5902
5902
|
}
|
|
5903
5903
|
function _s(n) {
|
|
@@ -5940,7 +5940,7 @@ function wa(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));
|
|
5943
|
-
n.step(new
|
|
5943
|
+
n.step(new F(e.start - (r ? 2 : 0), e.end, e.start, e.end, new k(s, 0, 0), t.length, !0));
|
|
5944
5944
|
let o = 0;
|
|
5945
5945
|
for (let f = 0; f < t.length; f++)
|
|
5946
5946
|
t[f].type == i && (o = f + 1);
|
|
@@ -5987,7 +5987,7 @@ function Zn(n) {
|
|
|
5987
5987
|
}
|
|
5988
5988
|
function Oa(n, e, t, r) {
|
|
5989
5989
|
let i = n.tr, s = r.end, o = r.$to.end(r.depth);
|
|
5990
|
-
s < o && (i.step(new
|
|
5990
|
+
s < o && (i.step(new F(s - 1, o, s, o, new k(y.from(t.create(null, r.parent.copy())), 1, 0), 1, !0)), r = new tn(i.doc.resolve(r.$from.pos), i.doc.resolve(o), r.depth));
|
|
5991
5991
|
const l = gn(r);
|
|
5992
5992
|
if (l == null)
|
|
5993
5993
|
return !1;
|
|
@@ -6006,7 +6006,7 @@ function Na(n, e, t) {
|
|
|
6006
6006
|
if (!c.canReplace(f + (l ? 0 : 1), f + 1, o.content.append(a ? y.empty : y.from(i))))
|
|
6007
6007
|
return !1;
|
|
6008
6008
|
let h = s.pos, d = h + o.nodeSize;
|
|
6009
|
-
return r.step(new
|
|
6009
|
+
return r.step(new F(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
6011
|
function Ta(n) {
|
|
6012
6012
|
return function(e, t) {
|
|
@@ -6021,7 +6021,7 @@ function Ta(n) {
|
|
|
6021
6021
|
return !1;
|
|
6022
6022
|
if (t) {
|
|
6023
6023
|
let c = a.lastChild && a.lastChild.type == l.type, f = y.from(c ? n.create() : null), h = new k(y.from(n.create(null, y.from(l.type.create(null, f)))), c ? 3 : 1, 0), d = s.start, u = s.end;
|
|
6024
|
-
t(e.tr.step(new
|
|
6024
|
+
t(e.tr.step(new F(d - (c ? 3 : 1), u, d, u, h, 1, !0)).scrollIntoView());
|
|
6025
6025
|
}
|
|
6026
6026
|
return !0;
|
|
6027
6027
|
};
|
|
@@ -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 = Dt(o)) {
|
|
6169
6169
|
if (o.nodeType != 1)
|
|
6170
6170
|
continue;
|
|
6171
|
-
let l = o, a = l == s.body, c = a ? Va(s) :
|
|
6171
|
+
let l = o, a = l == s.body, c = a ? Va(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 La(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);
|
|
@@ -6370,14 +6370,14 @@ function no(n, e, t) {
|
|
|
6370
6370
|
if (s == null && i && (t < 0 || i == te(r))) {
|
|
6371
6371
|
let a = r.childNodes[i - 1];
|
|
6372
6372
|
if (a.nodeType == 1)
|
|
6373
|
-
return
|
|
6373
|
+
return Ln(a.getBoundingClientRect(), !1);
|
|
6374
6374
|
}
|
|
6375
6375
|
if (s == null && i < te(r)) {
|
|
6376
6376
|
let a = r.childNodes[i];
|
|
6377
6377
|
if (a.nodeType == 1)
|
|
6378
|
-
return
|
|
6378
|
+
return Ln(a.getBoundingClientRect(), !0);
|
|
6379
6379
|
}
|
|
6380
|
-
return
|
|
6380
|
+
return Ln(r.getBoundingClientRect(), t >= 0);
|
|
6381
6381
|
}
|
|
6382
6382
|
if (s == null && i && (t < 0 || i == te(r))) {
|
|
6383
6383
|
let a = r.childNodes[i - 1], c = a.nodeType == 3 ? ge(a, te(a) - (o ? 0 : 1)) : a.nodeType == 1 && (a.nodeName != "BR" || !a.nextSibling) ? a : null;
|
|
@@ -6400,7 +6400,7 @@ function pt(n, e) {
|
|
|
6400
6400
|
let t = e ? n.left : n.right;
|
|
6401
6401
|
return { top: n.top, bottom: n.bottom, left: t, right: t };
|
|
6402
6402
|
}
|
|
6403
|
-
function
|
|
6403
|
+
function Ln(n, e) {
|
|
6404
6404
|
if (n.height == 0)
|
|
6405
6405
|
return n;
|
|
6406
6406
|
let t = e ? n.top : n.bottom;
|
|
@@ -6468,7 +6468,7 @@ let ai = null, ci = null, fi = !1;
|
|
|
6468
6468
|
function Ya(n, e, t) {
|
|
6469
6469
|
return ai == e && ci == t ? fi : (ai = e, ci = t, fi = t == "up" || t == "down" ? Ga(n, e, t) : Xa(n, e, t));
|
|
6470
6470
|
}
|
|
6471
|
-
const ne = 0, hi = 1,
|
|
6471
|
+
const ne = 0, hi = 1, Fe = 2, de = 3;
|
|
6472
6472
|
class Pt {
|
|
6473
6473
|
constructor(e, t, r, i) {
|
|
6474
6474
|
this.parent = e, this.children = t, this.dom = r, this.contentDOM = i, this.dirty = ne, r.pmViewDesc = this;
|
|
@@ -6778,19 +6778,19 @@ class Pt {
|
|
|
6778
6778
|
if (r == o ? e <= o && t >= r : e < o && t > r) {
|
|
6779
6779
|
let l = r + s.border, a = o - s.border;
|
|
6780
6780
|
if (e >= l && t <= a) {
|
|
6781
|
-
this.dirty = e == r || t == o ?
|
|
6781
|
+
this.dirty = e == r || t == o ? Fe : hi, e == l && t == a && (s.contentLost || s.dom.parentNode != this.contentDOM) ? s.dirty = de : s.markDirty(e - l, t - l);
|
|
6782
6782
|
return;
|
|
6783
6783
|
} else
|
|
6784
|
-
s.dirty = s.dom == s.contentDOM && s.dom.parentNode == this.contentDOM && !s.children.length ?
|
|
6784
|
+
s.dirty = s.dom == s.contentDOM && s.dom.parentNode == this.contentDOM && !s.children.length ? Fe : de;
|
|
6785
6785
|
}
|
|
6786
6786
|
r = o;
|
|
6787
6787
|
}
|
|
6788
|
-
this.dirty =
|
|
6788
|
+
this.dirty = Fe;
|
|
6789
6789
|
}
|
|
6790
6790
|
markParentsDirty() {
|
|
6791
6791
|
let e = 1;
|
|
6792
6792
|
for (let t = this.parent; t; t = t.parent, e++) {
|
|
6793
|
-
let r = e == 1 ?
|
|
6793
|
+
let r = e == 1 ? Fe : hi;
|
|
6794
6794
|
t.dirty < r && (t.dirty = r);
|
|
6795
6795
|
}
|
|
6796
6796
|
}
|
|
@@ -6968,7 +6968,7 @@ class Re extends Pt {
|
|
|
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 ==
|
|
6971
|
+
}), a.syncToMarks([], r, e), this.node.isTextblock && a.addTextblockHacks(), a.destroyRest(), (a.changed || this.dirty == Fe) && (o && this.protectLocalComposition(e, o), oo(this.contentDOM, this.children, e), ht && sc(this.dom));
|
|
6972
6972
|
}
|
|
6973
6973
|
localCompositionInfo(e, t) {
|
|
6974
6974
|
let { from: r, to: i } = e.state.selection;
|
|
@@ -7142,11 +7142,11 @@ const wt = function(n) {
|
|
|
7142
7142
|
n && (this.nodeName = n);
|
|
7143
7143
|
};
|
|
7144
7144
|
wt.prototype = /* @__PURE__ */ Object.create(null);
|
|
7145
|
-
const
|
|
7145
|
+
const Le = [new wt()];
|
|
7146
7146
|
function rr(n, e, t) {
|
|
7147
7147
|
if (n.length == 0)
|
|
7148
|
-
return
|
|
7149
|
-
let r = t ?
|
|
7148
|
+
return Le;
|
|
7149
|
+
let r = t ? Le[0] : new wt(), i = [r];
|
|
7150
7150
|
for (let s = 0; s < n.length; s++) {
|
|
7151
7151
|
let o = n[s].type.attrs;
|
|
7152
7152
|
if (o) {
|
|
@@ -7160,16 +7160,16 @@ function rr(n, e, t) {
|
|
|
7160
7160
|
return i;
|
|
7161
7161
|
}
|
|
7162
7162
|
function lo(n, e, t, r) {
|
|
7163
|
-
if (t ==
|
|
7163
|
+
if (t == Le && r == Le)
|
|
7164
7164
|
return e;
|
|
7165
7165
|
let i = e;
|
|
7166
7166
|
for (let s = 0; s < r.length; s++) {
|
|
7167
7167
|
let o = r[s], l = t[s];
|
|
7168
7168
|
if (s) {
|
|
7169
7169
|
let a;
|
|
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 =
|
|
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 = Le[0]), i = a;
|
|
7171
7171
|
}
|
|
7172
|
-
ec(i, l ||
|
|
7172
|
+
ec(i, l || Le[0], o);
|
|
7173
7173
|
}
|
|
7174
7174
|
return i;
|
|
7175
7175
|
}
|
|
@@ -7196,7 +7196,7 @@ function ec(n, e, t) {
|
|
|
7196
7196
|
}
|
|
7197
7197
|
}
|
|
7198
7198
|
function ao(n, e, t) {
|
|
7199
|
-
return lo(n, n,
|
|
7199
|
+
return lo(n, n, Le, rr(e, t, n.nodeType != 1));
|
|
7200
7200
|
}
|
|
7201
7201
|
function an(n, e) {
|
|
7202
7202
|
if (n.length != e.length)
|
|
@@ -7272,7 +7272,7 @@ class tc {
|
|
|
7272
7272
|
}
|
|
7273
7273
|
updateNodeAt(e, t, r, i, s) {
|
|
7274
7274
|
let o = this.top.children[i];
|
|
7275
|
-
return o.dirty == de && o.dom == o.contentDOM && (o.dirty =
|
|
7275
|
+
return o.dirty == de && o.dom == o.contentDOM && (o.dirty = Fe), o.update(e, t, r, s) ? (this.destroyBetween(this.index, i), this.index++, !0) : !1;
|
|
7276
7276
|
}
|
|
7277
7277
|
findIndexWithChild(e) {
|
|
7278
7278
|
for (; ; ) {
|
|
@@ -7304,7 +7304,7 @@ class tc {
|
|
|
7304
7304
|
if (!d && a.update(e, t, r, i))
|
|
7305
7305
|
return this.destroyBetween(this.index, l), a.dom != f && (this.changed = !0), this.index++, !0;
|
|
7306
7306
|
if (!d && (h = this.recreateWrapper(a, e, t, r, i, o)))
|
|
7307
|
-
return this.destroyBetween(this.index, l), this.top.children[this.index] = h, h.contentDOM && (h.dirty =
|
|
7307
|
+
return this.destroyBetween(this.index, l), this.top.children[this.index] = h, h.contentDOM && (h.dirty = Fe, h.updateChildren(i, o + 1), h.dirty = ne), this.changed = !0, this.index++, !0;
|
|
7308
7308
|
break;
|
|
7309
7309
|
}
|
|
7310
7310
|
}
|
|
@@ -8287,10 +8287,10 @@ function wo(n, e) {
|
|
|
8287
8287
|
clearTimeout(n.input.composingTimeout), e > -1 && (n.input.composingTimeout = setTimeout(() => fn(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 = Lc()); 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;
|
|
@@ -8309,7 +8309,7 @@ function Lc(n) {
|
|
|
8309
8309
|
}
|
|
8310
8310
|
return t || r;
|
|
8311
8311
|
}
|
|
8312
|
-
function
|
|
8312
|
+
function Lc() {
|
|
8313
8313
|
let n = document.createEvent("Event");
|
|
8314
8314
|
return n.initEvent("event", !0, !0), n.timeStamp;
|
|
8315
8315
|
}
|
|
@@ -9221,8 +9221,8 @@ function tf(n, e, t, r, i) {
|
|
|
9221
9221
|
if (Se && !n.state.selection.eq(Se)) {
|
|
9222
9222
|
if (W && re && n.input.lastKeyCode === 13 && Date.now() - 100 < n.input.lastKeyCodeTime && n.someProp("handleKeyDown", (Go) => Go(n, Ve(13, "Enter"))))
|
|
9223
9223
|
return;
|
|
9224
|
-
let
|
|
9225
|
-
M == "pointer" ?
|
|
9224
|
+
let Lt = n.state.tr.setSelection(Se);
|
|
9225
|
+
M == "pointer" ? Lt.setMeta("pointer", !0) : M == "key" && Lt.scrollIntoView(), s && Lt.setMeta("composition", s), n.dispatch(Lt);
|
|
9226
9226
|
}
|
|
9227
9227
|
return;
|
|
9228
9228
|
}
|
|
@@ -9263,25 +9263,25 @@ function tf(n, e, t, r, i) {
|
|
|
9263
9263
|
return M(n, Ve(13, "Enter"));
|
|
9264
9264
|
});
|
|
9265
9265
|
}, 20));
|
|
9266
|
-
let
|
|
9266
|
+
let L = p.start, R = p.endA, A, Q, xe;
|
|
9267
9267
|
if (w) {
|
|
9268
9268
|
if (m.pos == g.pos)
|
|
9269
|
-
_ && Ee <= 11 && m.parentOffset == 0 && (n.domObserver.suppressSelectionUpdates(), setTimeout(() => be(n), 20)), A = n.state.tr.delete(
|
|
9269
|
+
_ && Ee <= 11 && m.parentOffset == 0 && (n.domObserver.suppressSelectionUpdates(), setTimeout(() => be(n), 20)), A = n.state.tr.delete(L, R), Q = 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 && (xe = nf(m.parent.content.cut(m.parentOffset, g.parentOffset), b.parent.content.cut(b.parentOffset, p.endA - b.start())))
|
|
9273
9273
|
)
|
|
9274
|
-
A = n.state.tr, xe.type == "add" ? A.addMark(
|
|
9274
|
+
A = n.state.tr, xe.type == "add" ? A.addMark(L, R, xe.mark) : A.removeMark(L, R, xe.mark);
|
|
9275
9275
|
else if (m.parent.child(m.index()).isText && m.index() == g.index() - (g.textOffset ? 0 : 1)) {
|
|
9276
9276
|
let M = m.parent.textBetween(m.parentOffset, g.parentOffset);
|
|
9277
|
-
if (n.someProp("handleTextInput", (Se) => Se(n,
|
|
9277
|
+
if (n.someProp("handleTextInput", (Se) => Se(n, L, R, M)))
|
|
9278
9278
|
return;
|
|
9279
|
-
A = n.state.tr.insertText(M,
|
|
9279
|
+
A = n.state.tr.insertText(M, L, R);
|
|
9280
9280
|
}
|
|
9281
9281
|
}
|
|
9282
|
-
if (A || (A = n.state.tr.replace(
|
|
9282
|
+
if (A || (A = n.state.tr.replace(L, R, c.doc.slice(p.start - c.from, p.endB - c.from))), c.sel) {
|
|
9283
9283
|
let M = Ei(n, A.doc, c.sel);
|
|
9284
|
-
M && !(W && re && n.composing && M.empty && (p.start != p.endB || n.input.lastAndroidDelete < Date.now() - 100) && (M.head ==
|
|
9284
|
+
M && !(W && re && n.composing && M.empty && (p.start != p.endB || n.input.lastAndroidDelete < Date.now() - 100) && (M.head == L || M.head == A.mapping.map(R) - 1) || _ && M.empty && M.head == L) && A.setSelection(M);
|
|
9285
9285
|
}
|
|
9286
9286
|
Q && A.ensureMarks(Q), s && A.setMeta("composition", s), n.dispatch(A.scrollIntoView());
|
|
9287
9287
|
}
|
|
@@ -9432,13 +9432,13 @@ class of {
|
|
|
9432
9432
|
(l || t.handleDOMEvents != this._props.handleDOMEvents) && ar(this), this.editable = zi(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 && La(this);
|
|
9436
9436
|
if (o) {
|
|
9437
9437
|
this.domObserver.stop();
|
|
9438
9438
|
let u = h && (_ || W) && !this.composing && !i.selection.empty && !e.selection.empty && lf(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
9443
|
u || !(this.input.mouseDown && this.domObserver.currentSelection.eq(this.domSelectionRange()) && cc(this)) ? be(this, u) : (fo(this, e.selection), this.domObserver.setCurSelection()), this.domObserver.start();
|
|
9444
9444
|
}
|
|
@@ -9858,9 +9858,9 @@ function cf(n) {
|
|
|
9858
9858
|
});
|
|
9859
9859
|
break;
|
|
9860
9860
|
}
|
|
9861
|
-
const
|
|
9861
|
+
const L = i + N * e;
|
|
9862
9862
|
for (let R = 0; R < g; R++) {
|
|
9863
|
-
r[
|
|
9863
|
+
r[L + R] == 0 ? r[L + R] = f : (s || (s = [])).push({
|
|
9864
9864
|
type: "collision",
|
|
9865
9865
|
row: c,
|
|
9866
9866
|
pos: f,
|
|
@@ -9868,7 +9868,7 @@ function cf(n) {
|
|
|
9868
9868
|
});
|
|
9869
9869
|
const A = w && w[R];
|
|
9870
9870
|
if (A) {
|
|
9871
|
-
const Q = (
|
|
9871
|
+
const Q = (L + R) % e * 2, xe = o[Q];
|
|
9872
9872
|
xe == null || xe != A && o[Q + 1] == 1 ? (o[Q] = A, o[Q + 1] = 1) : xe == A && o[Q + 1]++;
|
|
9873
9873
|
}
|
|
9874
9874
|
}
|
|
@@ -9954,7 +9954,7 @@ function Vi(n, e) {
|
|
|
9954
9954
|
}
|
|
9955
9955
|
return s;
|
|
9956
9956
|
}
|
|
9957
|
-
function
|
|
9957
|
+
function Fi(n, e) {
|
|
9958
9958
|
const t = {};
|
|
9959
9959
|
n.attrs.colspan != 1 && (t.colspan = n.attrs.colspan), n.attrs.rowspan != 1 && (t.rowspan = n.attrs.rowspan), n.attrs.colwidth && (t["data-colwidth"] = n.attrs.colwidth.join(","));
|
|
9960
9960
|
for (const r in e) {
|
|
@@ -9999,7 +9999,7 @@ function uf(n) {
|
|
|
9999
9999
|
{ tag: "td", getAttrs: (r) => Vi(r, e) }
|
|
10000
10000
|
],
|
|
10001
10001
|
toDOM(r) {
|
|
10002
|
-
return ["td",
|
|
10002
|
+
return ["td", Fi(r, e), 0];
|
|
10003
10003
|
}
|
|
10004
10004
|
},
|
|
10005
10005
|
table_header: {
|
|
@@ -10011,7 +10011,7 @@ function uf(n) {
|
|
|
10011
10011
|
{ tag: "th", getAttrs: (r) => Vi(r, e) }
|
|
10012
10012
|
],
|
|
10013
10013
|
toDOM(r) {
|
|
10014
|
-
return ["th",
|
|
10014
|
+
return ["th", Fi(r, e), 0];
|
|
10015
10015
|
}
|
|
10016
10016
|
}
|
|
10017
10017
|
};
|
|
@@ -10442,7 +10442,7 @@ function Mf(n) {
|
|
|
10442
10442
|
return !0;
|
|
10443
10443
|
};
|
|
10444
10444
|
}
|
|
10445
|
-
function
|
|
10445
|
+
function Li(n, e, t) {
|
|
10446
10446
|
const r = e.map.cellsInRect({
|
|
10447
10447
|
left: 0,
|
|
10448
10448
|
top: 0,
|
|
@@ -10461,7 +10461,7 @@ function Rr(n, e) {
|
|
|
10461
10461
|
if (!Cn(t))
|
|
10462
10462
|
return !1;
|
|
10463
10463
|
if (r) {
|
|
10464
|
-
const i = ue(t.schema), s = zo(t), o = t.tr, l =
|
|
10464
|
+
const i = ue(t.schema), s = zo(t), o = t.tr, l = Li("row", s, i), a = Li(
|
|
10465
10465
|
"column",
|
|
10466
10466
|
s,
|
|
10467
10467
|
i
|
|
@@ -10998,10 +10998,10 @@ function Bf({
|
|
|
10998
10998
|
Vf(o, l, n, i);
|
|
10999
10999
|
},
|
|
11000
11000
|
mouseleave: (o) => {
|
|
11001
|
-
|
|
11001
|
+
Ff(o);
|
|
11002
11002
|
},
|
|
11003
11003
|
mousedown: (o, l) => {
|
|
11004
|
-
|
|
11004
|
+
Lf(o, l, e, t);
|
|
11005
11005
|
}
|
|
11006
11006
|
},
|
|
11007
11007
|
decorations: (o) => {
|
|
@@ -11050,11 +11050,11 @@ 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 Lf(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)
|
|
@@ -11234,10 +11234,10 @@ function Kf({
|
|
|
11234
11234
|
}
|
|
11235
11235
|
});
|
|
11236
11236
|
}
|
|
11237
|
-
const Vo = "app.grapesjs.com",
|
|
11237
|
+
const Vo = "app.grapesjs.com", Fo = "app-stage.grapesjs.com", jf = "app2.grapesjs.com", Uf = "app-stage2.grapesjs.com", Gi = [
|
|
11238
11238
|
Vo,
|
|
11239
11239
|
jf,
|
|
11240
|
-
|
|
11240
|
+
Fo,
|
|
11241
11241
|
Uf,
|
|
11242
11242
|
"localhost",
|
|
11243
11243
|
"127.0.0.1",
|
|
@@ -11247,7 +11247,11 @@ const Vo = "app.grapesjs.com", Lo = "app-stage.grapesjs.com", jf = "app2.grapesj
|
|
|
11247
11247
|
// For stackblitz.com demos
|
|
11248
11248
|
"-sandpack.codesandbox.io"
|
|
11249
11249
|
// For Sandpack demos
|
|
11250
|
-
], Gf = "license:check:start", _f = "license:check:end", Xf = () => typeof window < "u", Yf = ({
|
|
11250
|
+
], Gf = "license:check:start", _f = "license:check:end", Xf = () => typeof window < "u", Yf = ({
|
|
11251
|
+
isDev: n,
|
|
11252
|
+
isStage: e,
|
|
11253
|
+
isPlatform: t
|
|
11254
|
+
}) => `${n ? "" : `https://${e ? Fo : Vo}`}/${t ? "platform-api" : "api"}`, Zf = () => {
|
|
11251
11255
|
const n = Xf() && window.location.hostname;
|
|
11252
11256
|
return !!n && (Gi.includes(n) || Gi.some((e) => n.endsWith(e)));
|
|
11253
11257
|
};
|
|
@@ -11289,33 +11293,34 @@ async function nh({
|
|
|
11289
11293
|
plan: e,
|
|
11290
11294
|
pluginName: t,
|
|
11291
11295
|
licenseKey: r,
|
|
11292
|
-
|
|
11296
|
+
onLicenseCheckResponse: i,
|
|
11297
|
+
cleanup: s
|
|
11293
11298
|
}) {
|
|
11294
|
-
let
|
|
11295
|
-
const
|
|
11296
|
-
console.warn("Cleanup plugin:", t, "Reason:",
|
|
11297
|
-
},
|
|
11298
|
-
var
|
|
11299
|
-
const { error:
|
|
11300
|
-
if (!(
|
|
11301
|
-
|
|
11302
|
-
else if (
|
|
11303
|
-
const
|
|
11304
|
-
|
|
11299
|
+
let o = "", l = !1;
|
|
11300
|
+
const a = Zf(), c = (h) => {
|
|
11301
|
+
console.warn("Cleanup plugin:", t, "Reason:", h), s();
|
|
11302
|
+
}, f = (h = {}) => {
|
|
11303
|
+
var g;
|
|
11304
|
+
const { error: d, sdkLicense: u } = h, p = (g = h.plan) == null ? void 0 : g.category;
|
|
11305
|
+
if (!(u || h.license) || d)
|
|
11306
|
+
c(d || "Invalid license");
|
|
11307
|
+
else if (p) {
|
|
11308
|
+
const b = _i[e], w = _i[p];
|
|
11309
|
+
b > w && c({ pluginRequiredPlan: e, licensePlan: p });
|
|
11305
11310
|
}
|
|
11306
11311
|
};
|
|
11307
|
-
n.on(Gf, (
|
|
11308
|
-
|
|
11309
|
-
}), n.on(_f, (
|
|
11310
|
-
|
|
11312
|
+
n.on(Gf, (h) => {
|
|
11313
|
+
o = h == null ? void 0 : h.baseApiUrl, l = !0;
|
|
11314
|
+
}), n.on(_f, (h) => {
|
|
11315
|
+
i == null || i(h), f(h);
|
|
11311
11316
|
}), setTimeout(async () => {
|
|
11312
|
-
if (!
|
|
11313
|
-
if (
|
|
11317
|
+
if (!l) {
|
|
11318
|
+
if (a) return;
|
|
11314
11319
|
if (r) {
|
|
11315
|
-
const
|
|
11316
|
-
|
|
11320
|
+
const h = await rh({ licenseKey: r, pluginName: t, baseApiUrl: o });
|
|
11321
|
+
i == null || i(h), h && f(h);
|
|
11317
11322
|
} else
|
|
11318
|
-
|
|
11323
|
+
c("The `licenseKey` option not provided");
|
|
11319
11324
|
}
|
|
11320
11325
|
}, 2e3);
|
|
11321
11326
|
}
|
|
@@ -11390,7 +11395,7 @@ const Ot = (n) => {
|
|
|
11390
11395
|
return o && (l.style = `${t}: ${o}`), [r, l, 0];
|
|
11391
11396
|
}
|
|
11392
11397
|
};
|
|
11393
|
-
}, Xi = "data-gs-mrk-fs", oh = "data-gs-mrk-color", lh = "data-gs-mrk-bgcolor",
|
|
11398
|
+
}, Xi = "data-gs-mrk-fs", oh = "data-gs-mrk-color", lh = "data-gs-mrk-bgcolor", Lo = "data-gs-mrk-wrap", pn = "data-gs-ifrg", ke = "attrs", wn = {
|
|
11394
11399
|
[ke]: { default: "{}" }
|
|
11395
11400
|
}, oe = {
|
|
11396
11401
|
[ke]: { default: {} }
|
|
@@ -11572,7 +11577,7 @@ const Ot = (n) => {
|
|
|
11572
11577
|
em: gt(["em", "i"], (n) => ["em", ce(n)]),
|
|
11573
11578
|
underline: gt(["u"], (n) => ["u", ce(n), 0]),
|
|
11574
11579
|
strikethrough: gt(["s"], (n) => ["s", ce(n), 0]),
|
|
11575
|
-
wrapStyle: ch(
|
|
11580
|
+
wrapStyle: ch(Lo),
|
|
11576
11581
|
font_size: {
|
|
11577
11582
|
attrs: {
|
|
11578
11583
|
...wn,
|
|
@@ -11606,11 +11611,11 @@ const Ot = (n) => {
|
|
|
11606
11611
|
}, Yi = new hl({
|
|
11607
11612
|
nodes: ah,
|
|
11608
11613
|
marks: fh
|
|
11609
|
-
}),
|
|
11610
|
-
|
|
11614
|
+
}), Ft = /* @__PURE__ */ new WeakMap(), Ir = /* @__PURE__ */ new WeakMap(), hh = (n, e, t) => {
|
|
11615
|
+
Ft.set(n, { view: e, gjsView: t, initialDoc: e.state.doc }), Ir.set(e, { el: n, gjsView: t });
|
|
11611
11616
|
}, dh = (n, e) => {
|
|
11612
|
-
|
|
11613
|
-
}, Yt = (n) =>
|
|
11617
|
+
Ft.delete(n), Ir.delete(e);
|
|
11618
|
+
}, Yt = (n) => Ft.get(n), Ho = (n) => Ir.get(n), Zi = (n) => {
|
|
11614
11619
|
const e = Yt(n), t = e == null ? void 0 : e.view, r = e == null ? void 0 : e.initialDoc;
|
|
11615
11620
|
return !(t && r && r.eq(t.state.doc));
|
|
11616
11621
|
}, Kn = (n) => {
|
|
@@ -11648,7 +11653,7 @@ const $o = (n) => {
|
|
|
11648
11653
|
return t && Th(t) ? yh(n, e) : t ? $s(() => ({ type: n.schema.nodes.div }))(n, e) : !1;
|
|
11649
11654
|
}, gh = (n, e) => (t, r) => {
|
|
11650
11655
|
var l;
|
|
11651
|
-
const i = Wo(t), s =
|
|
11656
|
+
const i = Wo(t), s = Ft.get(n.el).view, o = (l = e.onEnter) == null ? void 0 : l.call(e, {
|
|
11652
11657
|
...n,
|
|
11653
11658
|
node: i,
|
|
11654
11659
|
commands: vr(s, n.editor, e),
|
|
@@ -11851,7 +11856,7 @@ const Oh = (n, e) => {
|
|
|
11851
11856
|
},
|
|
11852
11857
|
wrapStyle: () => {
|
|
11853
11858
|
const l = Kn(n), a = o.text.selected(), c = `i${e.Components._createId().slice(0, 4)}`;
|
|
11854
|
-
o.text.replaceHtml(`<span id="${c}" ${
|
|
11859
|
+
o.text.replaceHtml(`<span id="${c}" ${Lo}>${a}</span>`), l == null || l.trigger("disable"), setTimeout(() => {
|
|
11855
11860
|
const f = l == null ? void 0 : l.find(`#${c}`)[0];
|
|
11856
11861
|
f && e.select(f);
|
|
11857
11862
|
});
|
|
@@ -12046,7 +12051,7 @@ function es(n, e, t, r, i, s) {
|
|
|
12046
12051
|
}
|
|
12047
12052
|
return !1;
|
|
12048
12053
|
}
|
|
12049
|
-
const vh = new Be(/--$/, "—"), zh = new Be(/\.\.\.$/, "…"), Bh = new Be(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/, "“"), Ph = new Be(/"$/, "”"), Vh = new Be(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/, "‘"),
|
|
12054
|
+
const vh = new Be(/--$/, "—"), zh = new Be(/\.\.\.$/, "…"), Bh = new Be(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/, "“"), Ph = new Be(/"$/, "”"), Vh = new Be(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/, "‘"), Fh = new Be(/'$/, "’"), Lh = [Bh, Ph, Vh, Fh];
|
|
12050
12055
|
function zr(n, e, t = null, r) {
|
|
12051
12056
|
return new Be(n, (i, s, o, l) => {
|
|
12052
12057
|
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);
|
|
@@ -12086,7 +12091,7 @@ function qh(n, e) {
|
|
|
12086
12091
|
}));
|
|
12087
12092
|
}
|
|
12088
12093
|
function Kh(n) {
|
|
12089
|
-
const e =
|
|
12094
|
+
const e = Lh.concat(zh, vh);
|
|
12090
12095
|
let t;
|
|
12091
12096
|
return (t = n.nodes.blockquote) && e.push(Hh(t)), (t = n.nodes.orderedList) && e.push($h(t)), (t = n.nodes.bulletList) && e.push(Wh(t)), (t = n.nodes.codeBlock) && e.push(Jh(t)), (t = n.nodes.heading) && e.push(qh(t, 6)), Ih({ rules: e });
|
|
12092
12097
|
}
|
|
@@ -12126,7 +12131,7 @@ const jh = "rteProseMirror", Uh = rt.free, q = "rte:selectionchange", I = {
|
|
|
12126
12131
|
]
|
|
12127
12132
|
}), Gh = (n, e) => {
|
|
12128
12133
|
var a;
|
|
12129
|
-
const { editor: t, el: r } = n, i =
|
|
12134
|
+
const { editor: t, el: r } = n, i = Ft.get(r).view, s = vr(i, t, e), o = {
|
|
12130
12135
|
separator: {
|
|
12131
12136
|
type: "column",
|
|
12132
12137
|
style: { borderRightWidth: "1px", borderRightStyle: "solid", alignSelf: "stretch", margin: 3 }
|
|
@@ -12519,13 +12524,13 @@ const Xh = function(n, e = {}) {
|
|
|
12519
12524
|
Kf(),
|
|
12520
12525
|
Kh(c),
|
|
12521
12526
|
ga(),
|
|
12522
|
-
|
|
12527
|
+
Fn({
|
|
12523
12528
|
Tab: Hi(1),
|
|
12524
12529
|
"Shift-Tab": Hi(-1)
|
|
12525
12530
|
}),
|
|
12526
|
-
|
|
12531
|
+
Fn({
|
|
12527
12532
|
Enter: At(Hs, Ma(f.listItem), gh(d, t)),
|
|
12528
|
-
"Shift-Enter": At(
|
|
12533
|
+
"Shift-Enter": At(Ls, (w, N) => (N && N(w.tr.replaceSelectionWith(f.inlineBreak.create()).scrollIntoView()), !0)),
|
|
12529
12534
|
"Mod-z": Gs,
|
|
12530
12535
|
"Mod-y": Yn,
|
|
12531
12536
|
// On Windows
|
|
@@ -12536,7 +12541,7 @@ const Xh = function(n, e = {}) {
|
|
|
12536
12541
|
"Shift-Tab": Zn(f.listItem),
|
|
12537
12542
|
Tab: Ta(f.listItem)
|
|
12538
12543
|
}),
|
|
12539
|
-
|
|
12544
|
+
Fn(la)
|
|
12540
12545
|
]
|
|
12541
12546
|
})
|
|
12542
12547
|
}), m = new of(
|
|
@@ -12546,9 +12551,9 @@ const Xh = function(n, e = {}) {
|
|
|
12546
12551
|
state: p,
|
|
12547
12552
|
dispatchTransaction(w) {
|
|
12548
12553
|
var Q;
|
|
12549
|
-
const { state: N } = m,
|
|
12550
|
-
m.updateState(
|
|
12551
|
-
const A = !N.selection.eq(
|
|
12554
|
+
const { state: N } = m, L = N.apply(w), R = !N.doc.eq(L.doc);
|
|
12555
|
+
m.updateState(L);
|
|
12556
|
+
const A = !N.selection.eq(L.selection);
|
|
12552
12557
|
R && (uh(((Q = a == null ? void 0 : a.view) == null ? void 0 : Q.el) || l), m.focus()), (A || R) && n.trigger(q);
|
|
12553
12558
|
}
|
|
12554
12559
|
}
|