@grapesjs/studio-sdk-plugins 1.0.28 → 1.0.29
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/canvasAbsoluteMode/index.cjs.js +1 -1
- package/dist/canvasAbsoluteMode/index.es.js +98 -97
- package/dist/canvasAbsoluteMode/index.umd.js +1 -1
- package/dist/canvasFullSize/index.cjs.js +8 -7
- package/dist/canvasFullSize/index.es.js +145 -138
- package/dist/canvasFullSize/index.umd.js +9 -8
- package/dist/canvasFullSize/typesSchema.d.ts +5 -0
- package/dist/googleFontsAssetProvider/index.cjs.js +1 -1
- package/dist/googleFontsAssetProvider/index.es.js +11 -11
- package/dist/googleFontsAssetProvider/index.umd.js +1 -1
- package/dist/iconifyComponent/index.cjs.js +2 -2
- package/dist/iconifyComponent/index.es.js +13 -13
- package/dist/iconifyComponent/index.umd.js +2 -2
- package/dist/index.cjs.d.ts +1 -0
- package/dist/index.cjs.js +192 -95
- package/dist/index.d.ts +1 -0
- package/dist/index.es.d.ts +1 -0
- package/dist/index.es.js +7577 -7242
- package/dist/index.umd.js +192 -95
- package/dist/layoutSidebarButtons/index.cjs.js +1 -1
- package/dist/layoutSidebarButtons/index.es.js +156 -154
- package/dist/layoutSidebarButtons/index.umd.js +1 -1
- package/dist/presetPrintable/index.cjs.js +4 -4
- package/dist/presetPrintable/index.es.js +59 -59
- package/dist/presetPrintable/index.umd.js +1 -1
- package/dist/prosemirror/index.cjs.js +5 -5
- package/dist/prosemirror/index.es.js +100 -100
- package/dist/prosemirror/index.umd.js +1 -1
- package/dist/rteTinyMce/index.cjs.js +2 -2
- package/dist/rteTinyMce/index.es.js +10 -10
- package/dist/rteTinyMce/index.umd.js +1 -1
- package/dist/shapeDividerComponent/index.cjs.d.ts +3 -0
- package/dist/shapeDividerComponent/index.cjs.js +97 -0
- package/dist/shapeDividerComponent/index.d.ts +3 -0
- package/dist/shapeDividerComponent/index.es.d.ts +3 -0
- package/dist/shapeDividerComponent/index.es.js +427 -0
- package/dist/shapeDividerComponent/index.umd.js +97 -0
- package/dist/shapeDividerComponent/shared.d.ts +3 -0
- package/dist/shapeDividerComponent/types.d.ts +10 -0
- package/dist/shapeDividerComponent/typesSchema.d.ts +9 -0
- package/dist/swiperComponent/index.cjs.js +9 -9
- package/dist/swiperComponent/index.es.js +130 -122
- package/dist/swiperComponent/index.umd.js +5 -5
- package/dist/tableComponent/index.cjs.js +1 -1
- package/dist/tableComponent/index.es.js +9 -9
- package/dist/tableComponent/index.umd.js +1 -1
- package/dist/youtubeAssetProvider/index.cjs.js +1 -1
- package/dist/youtubeAssetProvider/index.es.js +34 -34
- package/dist/youtubeAssetProvider/index.umd.js +1 -1
- package/package.json +2 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const Q = "app.grapesjs.com", ee = "app-stage.grapesjs.com",
|
|
1
|
+
const Q = "app.grapesjs.com", ee = "app-stage.grapesjs.com", ae = "app2.grapesjs.com", le = "app-stage2.grapesjs.com", H = [
|
|
2
2
|
Q,
|
|
3
|
-
te,
|
|
4
|
-
ee,
|
|
5
3
|
ae,
|
|
4
|
+
ee,
|
|
5
|
+
le,
|
|
6
6
|
"localhost",
|
|
7
7
|
"127.0.0.1",
|
|
8
8
|
".local-credentialless.webcontainer.io",
|
|
@@ -11,19 +11,19 @@ const Q = "app.grapesjs.com", ee = "app-stage.grapesjs.com", te = "app2.grapesjs
|
|
|
11
11
|
// For stackblitz.com demos
|
|
12
12
|
"-sandpack.codesandbox.io"
|
|
13
13
|
// For Sandpack demos
|
|
14
|
-
],
|
|
14
|
+
], se = "license:check:start", ie = "license:check:end", ne = () => typeof window < "u", oe = ({ isDev: e, isStage: l }) => `${e ? "" : `https://${l ? ee : Q}`}/api`, re = () => {
|
|
15
15
|
const e = ne() && window.location.hostname;
|
|
16
16
|
return !!e && (H.includes(e) || H.some((l) => e.endsWith(l)));
|
|
17
|
-
},
|
|
18
|
-
async function
|
|
17
|
+
}, ce = (e) => e.replace(/[A-Z]+(?![a-z])|[A-Z]/g, (l, a) => (a ? "-" : "") + l.toLowerCase()), de = (e) => typeof e < "u";
|
|
18
|
+
async function pe({
|
|
19
19
|
path: e,
|
|
20
20
|
baseApiUrl: l,
|
|
21
21
|
method: a = "GET",
|
|
22
22
|
headers: s = {},
|
|
23
|
-
params:
|
|
23
|
+
params: n,
|
|
24
24
|
body: b
|
|
25
25
|
}) {
|
|
26
|
-
const f = `${l ||
|
|
26
|
+
const f = `${l || oe({ isDev: !1, isStage: !1 })}${e}`, d = {
|
|
27
27
|
method: a,
|
|
28
28
|
headers: {
|
|
29
29
|
"Content-Type": "application/json",
|
|
@@ -31,62 +31,62 @@ async function de({
|
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
33
|
b && (d.body = JSON.stringify(b));
|
|
34
|
-
const u =
|
|
34
|
+
const u = n ? new URLSearchParams(n).toString() : "", o = u ? `?${u}` : "", h = await fetch(`${f}${o}`, d);
|
|
35
35
|
if (!h.ok)
|
|
36
36
|
throw new Error(`HTTP error! status: ${h.status}`);
|
|
37
37
|
return h.json();
|
|
38
38
|
}
|
|
39
|
-
var
|
|
39
|
+
var x = /* @__PURE__ */ ((e) => (e.free = "free", e.startup = "startup", e.business = "business", e.enterprise = "enterprise", e))(x || {});
|
|
40
40
|
const G = {
|
|
41
|
-
[
|
|
42
|
-
[
|
|
43
|
-
[
|
|
44
|
-
[
|
|
41
|
+
[x.free]: 0,
|
|
42
|
+
[x.startup]: 10,
|
|
43
|
+
[x.business]: 20,
|
|
44
|
+
[x.enterprise]: 30
|
|
45
45
|
};
|
|
46
|
-
function
|
|
46
|
+
function ue(e) {
|
|
47
47
|
const l = e;
|
|
48
48
|
return l.init = (a) => (s) => e(s, a), l;
|
|
49
49
|
}
|
|
50
|
-
const
|
|
51
|
-
async function
|
|
50
|
+
const be = (e) => /* @__PURE__ */ ue(e);
|
|
51
|
+
async function fe({
|
|
52
52
|
editor: e,
|
|
53
53
|
plan: l,
|
|
54
54
|
pluginName: a,
|
|
55
55
|
licenseKey: s,
|
|
56
|
-
cleanup:
|
|
56
|
+
cleanup: n
|
|
57
57
|
}) {
|
|
58
58
|
let b = "", c = !1;
|
|
59
|
-
const f =
|
|
60
|
-
console.warn("Cleanup plugin:", a, "Reason:", o),
|
|
59
|
+
const f = re(), d = (o) => {
|
|
60
|
+
console.warn("Cleanup plugin:", a, "Reason:", o), n();
|
|
61
61
|
}, u = (o = {}) => {
|
|
62
62
|
var S;
|
|
63
|
-
const { error: h, sdkLicense: t } = o,
|
|
63
|
+
const { error: h, sdkLicense: t } = o, i = (S = o.plan) == null ? void 0 : S.category;
|
|
64
64
|
if (!(t || o.license) || h)
|
|
65
65
|
d(h || "Invalid license");
|
|
66
|
-
else if (
|
|
67
|
-
const O = G[l],
|
|
68
|
-
O >
|
|
66
|
+
else if (i) {
|
|
67
|
+
const O = G[l], R = G[i];
|
|
68
|
+
O > R && d({ pluginRequiredPlan: l, licensePlan: i });
|
|
69
69
|
}
|
|
70
70
|
};
|
|
71
|
-
e.on(
|
|
71
|
+
e.on(se, (o) => {
|
|
72
72
|
b = o == null ? void 0 : o.baseApiUrl, c = !0;
|
|
73
|
-
}), e.on(
|
|
73
|
+
}), e.on(ie, (o) => {
|
|
74
74
|
u(o);
|
|
75
75
|
}), setTimeout(async () => {
|
|
76
76
|
if (!c) {
|
|
77
77
|
if (f) return;
|
|
78
78
|
if (s) {
|
|
79
|
-
const o = await
|
|
79
|
+
const o = await he({ licenseKey: s, pluginName: a, baseApiUrl: b });
|
|
80
80
|
o && u(o);
|
|
81
81
|
} else
|
|
82
82
|
d("The `licenseKey` option not provided");
|
|
83
83
|
}
|
|
84
84
|
}, 2e3);
|
|
85
85
|
}
|
|
86
|
-
async function
|
|
86
|
+
async function he(e) {
|
|
87
87
|
const { licenseKey: l, pluginName: a, baseApiUrl: s } = e;
|
|
88
88
|
try {
|
|
89
|
-
return (await
|
|
89
|
+
return (await pe({
|
|
90
90
|
baseApiUrl: s,
|
|
91
91
|
path: `/sdk/${l || "na"}`,
|
|
92
92
|
method: "POST",
|
|
@@ -95,19 +95,19 @@ async function fe(e) {
|
|
|
95
95
|
pn: a
|
|
96
96
|
}
|
|
97
97
|
})).result || {};
|
|
98
|
-
} catch (
|
|
99
|
-
return console.error("Error during SDK license check:",
|
|
98
|
+
} catch (n) {
|
|
99
|
+
return console.error("Error during SDK license check:", n), !1;
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
const P = (e, l) => {
|
|
103
103
|
var a;
|
|
104
104
|
return !!((a = e == null ? void 0 : e.classList) != null && a.contains(l));
|
|
105
|
-
},
|
|
105
|
+
}, ve = (e, l = {}) => {
|
|
106
106
|
var b;
|
|
107
|
-
const a = {}, s = [],
|
|
107
|
+
const a = {}, s = [], n = [];
|
|
108
108
|
for (const c in e) {
|
|
109
109
|
const { value: f, ...d } = e[c];
|
|
110
|
-
s.push({ id: c, name: c, changeProp: !0, category: l.category, ...d }), a[c] = f, !
|
|
110
|
+
s.push({ id: c, name: c, changeProp: !0, category: l.category, ...d }), a[c] = f, !de(f) && n.push(c);
|
|
111
111
|
const { subTraits: u = {} } = d;
|
|
112
112
|
for (const o in d.subTraits)
|
|
113
113
|
(b = u[o]) == null || b.forEach((h) => {
|
|
@@ -117,31 +117,31 @@ const P = (e, l) => {
|
|
|
117
117
|
}
|
|
118
118
|
return {
|
|
119
119
|
propKeys: Object.keys(a),
|
|
120
|
-
propsNoValues:
|
|
120
|
+
propsNoValues: n,
|
|
121
121
|
props: a,
|
|
122
122
|
traits: s
|
|
123
123
|
};
|
|
124
|
-
},
|
|
124
|
+
}, me = (e, l) => {
|
|
125
125
|
l.forEach((a) => {
|
|
126
126
|
if (a.subTraits) {
|
|
127
|
-
const s = `${a.id || a.name}`,
|
|
128
|
-
e.on(
|
|
127
|
+
const s = `${a.id || a.name}`, n = a.changeProp ? `change:${s}` : `change:attributes:${s}`;
|
|
128
|
+
e.on(n, () => U(e, s)), U(e, s);
|
|
129
129
|
}
|
|
130
130
|
});
|
|
131
131
|
}, U = (e, l) => {
|
|
132
|
-
const a = e.getTrait(l), s = a.get("category"),
|
|
132
|
+
const a = e.getTrait(l), s = a.get("category"), n = a.get("subTraits") || {}, c = (Object.values(n).flat() || []).map((u) => u.id || u.name);
|
|
133
133
|
e.removeTrait(c);
|
|
134
|
-
const f =
|
|
134
|
+
const f = n[a.getValue()], d = e.getTraitIndex(l) + 1;
|
|
135
135
|
f && e.addTrait(
|
|
136
136
|
f.map((u) => ({ category: s, ...u })),
|
|
137
137
|
{ at: d }
|
|
138
138
|
);
|
|
139
|
-
},
|
|
139
|
+
}, ge = (e, l) => {
|
|
140
140
|
l.forEach((a) => {
|
|
141
|
-
const s =
|
|
141
|
+
const s = ce(a);
|
|
142
142
|
s !== a && e.has(s) && e.set({ [a]: e.get(s), [s]: void 0 });
|
|
143
143
|
});
|
|
144
|
-
}, m = "swiper", M = `${m}-slide`,
|
|
144
|
+
}, m = "swiper", M = `${m}-slide`, L = `${m}-wrapper`, k = `${m}-nav-prev`, D = `${m}-nav-next`, A = `${m}-pagination`, N = `${m}-scrollbar`, p = {
|
|
145
145
|
slider: `<svg viewBox="0 0 24 24">
|
|
146
146
|
<path d="M22 7.6c0-1-.5-1.6-1.3-1.6H3.4C2.5 6 2 6.7 2 7.6v9.8c0 1 .5 1.6 1.3 1.6h17.4c.8 0 1.3-.6 1.3-1.6V7.6zM21 18H3V7h18v11z" fill-rule="nonzero"/>
|
|
147
147
|
<path d="M4 12.5L6 14v-3zM20 12.5L18 14v-3z"/>
|
|
@@ -177,7 +177,7 @@ const P = (e, l) => {
|
|
|
177
177
|
add: `<svg viewBox="0 0 24 24">
|
|
178
178
|
<path d="M12 20a8 8 0 1 1 0-16 8 8 0 0 1 0 16m0-18A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2m1 5h-2v4H7v2h4v4h2v-4h4v-2h-4V7Z"/>
|
|
179
179
|
</svg>`
|
|
180
|
-
}, j = { id: "swiper-responsive", label: "Responsive", icon: p.responsive }, K = { id: "swiper-extra", label: "Extra", icon: p.extra },
|
|
180
|
+
}, j = { id: "swiper-responsive", label: "Responsive", icon: p.responsive }, K = { id: "swiper-extra", label: "Extra", icon: p.extra }, ye = {
|
|
181
181
|
actions: {
|
|
182
182
|
type: "radio",
|
|
183
183
|
label: !1,
|
|
@@ -230,10 +230,10 @@ const P = (e, l) => {
|
|
|
230
230
|
navigation: {
|
|
231
231
|
type: "checkbox",
|
|
232
232
|
label: "Navigation",
|
|
233
|
-
getValue: ({ component: e }) => !!e.findFirstType(
|
|
233
|
+
getValue: ({ component: e }) => !!e.findFirstType(k),
|
|
234
234
|
setValue: ({ component: e, value: l }) => {
|
|
235
235
|
var a, s;
|
|
236
|
-
l ? e.append([{ type:
|
|
236
|
+
l ? e.append([{ type: k }, { type: D }]) : ((a = e.findFirstType(k)) == null || a.remove(), (s = e.findFirstType(D)) == null || s.remove()), e.set({ navigation: l });
|
|
237
237
|
}
|
|
238
238
|
},
|
|
239
239
|
initialSlide: {
|
|
@@ -478,6 +478,14 @@ const P = (e, l) => {
|
|
|
478
478
|
value: !1,
|
|
479
479
|
subTraits: {
|
|
480
480
|
true: [
|
|
481
|
+
{
|
|
482
|
+
type: "checkbox",
|
|
483
|
+
name: "autoplayEditor",
|
|
484
|
+
label: "Autoplay in editor",
|
|
485
|
+
tip: "Allow autoplay to run while editing in the canvas. Note: this may make selecting and editing slides difficult as they will automatically change.",
|
|
486
|
+
changeProp: !0,
|
|
487
|
+
value: !1
|
|
488
|
+
},
|
|
481
489
|
{
|
|
482
490
|
type: "number",
|
|
483
491
|
name: "autoplayDelay",
|
|
@@ -533,10 +541,10 @@ const P = (e, l) => {
|
|
|
533
541
|
{ id: "progressbar", label: "Progressbar" },
|
|
534
542
|
{ id: "fraction", label: "Fraction" }
|
|
535
543
|
],
|
|
536
|
-
getValue: ({ component: e }) => e.findFirstType(
|
|
544
|
+
getValue: ({ component: e }) => e.findFirstType(A) ? e.get("pagination") || "bullets" : "none",
|
|
537
545
|
setValue: ({ component: e, value: l }) => {
|
|
538
|
-
const a = e.findFirstType(
|
|
539
|
-
a == null || a.remove(), l !== "none" && e.append({ type:
|
|
546
|
+
const a = e.findFirstType(A);
|
|
547
|
+
a == null || a.remove(), l !== "none" && e.append({ type: A }), e.set({ pagination: l });
|
|
540
548
|
},
|
|
541
549
|
subTraits: {
|
|
542
550
|
bullets: [
|
|
@@ -702,9 +710,9 @@ const P = (e, l) => {
|
|
|
702
710
|
tip: 'If enabled, the user will see the "grab" cursor when hover the slider',
|
|
703
711
|
value: !1
|
|
704
712
|
}
|
|
705
|
-
}, Z = "Slider", q = "swiper",
|
|
706
|
-
const { Components: a, Blocks: s, Commands:
|
|
707
|
-
const
|
|
713
|
+
}, Z = "Slider", q = "swiper", _ = `${q}-`, Se = (e, l) => {
|
|
714
|
+
const { Components: a, Blocks: s, Commands: n } = e, { block: b } = l, c = ve(ye), f = "core:preview", d = n.events, u = function(t) {
|
|
715
|
+
const i = this, E = window, S = i.__onLoad, O = i.__activeSlide, R = i.__inPreview, te = E._isEditor && !R ? t.autoplayEditor : !0, { cdnScript: $, cdnStyle: I, slidesPerView: F } = t || {}, r = (v) => isNaN(v) ? void 0 : parseFloat(v), z = () => {
|
|
708
716
|
const v = {
|
|
709
717
|
loop: t.loop,
|
|
710
718
|
speed: t.speed,
|
|
@@ -750,22 +758,22 @@ const P = (e, l) => {
|
|
|
750
758
|
slideShadows: t.cardsEffectSlideShadows
|
|
751
759
|
},
|
|
752
760
|
navigation: {
|
|
753
|
-
nextEl:
|
|
754
|
-
prevEl:
|
|
761
|
+
nextEl: i.querySelector(".swiper-button-next"),
|
|
762
|
+
prevEl: i.querySelector(".swiper-button-prev")
|
|
755
763
|
},
|
|
756
764
|
pagination: {
|
|
757
765
|
type: t.pagination || "bullets",
|
|
758
766
|
dynamicBullets: t.dynamicBullets,
|
|
759
767
|
clickable: t.clickableBullets,
|
|
760
768
|
progressbarOpposite: t.progressbarOpposite,
|
|
761
|
-
el:
|
|
769
|
+
el: i.querySelector(".swiper-pagination")
|
|
762
770
|
},
|
|
763
771
|
scrollbar: {
|
|
764
|
-
el:
|
|
772
|
+
el: i.querySelector(".swiper-scrollbar"),
|
|
765
773
|
draggable: t.scrollbarDraggable,
|
|
766
774
|
hide: t.scrollbarHide
|
|
767
775
|
},
|
|
768
|
-
autoplay: t.autoplay && {
|
|
776
|
+
autoplay: t.autoplay && te && {
|
|
769
777
|
delay: t.autoplayDelay,
|
|
770
778
|
disableOnInteraction: t.autoplayDisableOnInteraction,
|
|
771
779
|
pauseOnMouseEnter: t.autoplayPauseOnMouseEnter,
|
|
@@ -775,41 +783,41 @@ const P = (e, l) => {
|
|
|
775
783
|
}
|
|
776
784
|
};
|
|
777
785
|
if (t.tablet) {
|
|
778
|
-
const { tabletBreakpoint:
|
|
779
|
-
v.breakpoints[
|
|
786
|
+
const { tabletBreakpoint: C, tabletSlidesPerView: g } = t, T = r(C);
|
|
787
|
+
v.breakpoints[T] = {
|
|
780
788
|
slidesPerView: isNaN(g) ? g : r(g),
|
|
781
789
|
slidesPerGroup: r(t.tabletSlidesPerGroup),
|
|
782
790
|
spaceBetween: r(t.tabletSpaceBetween)
|
|
783
791
|
};
|
|
784
792
|
}
|
|
785
793
|
if (t.mobile) {
|
|
786
|
-
const { mobileBreakpoint:
|
|
787
|
-
v.breakpoints[
|
|
794
|
+
const { mobileBreakpoint: C, mobileSlidesPerView: g } = t, T = r(C);
|
|
795
|
+
v.breakpoints[T] = {
|
|
788
796
|
slidesPerView: isNaN(g) ? g : r(g),
|
|
789
797
|
slidesPerGroup: r(t.mobileSlidesPerGroup),
|
|
790
798
|
spaceBetween: r(t.mobileSpaceBetween)
|
|
791
799
|
};
|
|
792
800
|
}
|
|
793
|
-
S && !
|
|
794
|
-
const W = new
|
|
801
|
+
S && !R && (v.simulateTouch = !1), O && (v.initialSlide = O);
|
|
802
|
+
const W = new E.Swiper(i, v);
|
|
795
803
|
S == null || S(W);
|
|
796
804
|
};
|
|
797
|
-
if (
|
|
805
|
+
if (E.Swiper)
|
|
798
806
|
z();
|
|
799
807
|
else {
|
|
800
|
-
const { head: v } = document, W = Array.isArray($) ? [...$] : [$],
|
|
808
|
+
const { head: v } = document, W = Array.isArray($) ? [...$] : [$], C = Array.isArray(I) ? [...I] : [I], g = (w) => {
|
|
801
809
|
if (w.length) {
|
|
802
810
|
const y = document.createElement("link");
|
|
803
811
|
y.href = w.shift(), y.rel = "stylesheet", v.appendChild(y), g(w);
|
|
804
812
|
}
|
|
805
|
-
},
|
|
813
|
+
}, T = (w) => {
|
|
806
814
|
if (w.length) {
|
|
807
815
|
const y = document.createElement("script");
|
|
808
|
-
y.src = w.shift(), y.onerror = y.onload =
|
|
816
|
+
y.src = w.shift(), y.onerror = y.onload = T.bind(null, w), v.appendChild(y);
|
|
809
817
|
} else
|
|
810
818
|
z();
|
|
811
819
|
};
|
|
812
|
-
g(
|
|
820
|
+
g(C), T(W);
|
|
813
821
|
}
|
|
814
822
|
}, o = (t = 0) => ({
|
|
815
823
|
type: M,
|
|
@@ -830,13 +838,13 @@ const P = (e, l) => {
|
|
|
830
838
|
name: Z,
|
|
831
839
|
icon: p.slider,
|
|
832
840
|
classes: q,
|
|
833
|
-
draggable: (t,
|
|
841
|
+
draggable: (t, i) => !i.is(m),
|
|
834
842
|
components: [
|
|
835
843
|
{
|
|
836
|
-
type:
|
|
844
|
+
type: L,
|
|
837
845
|
components: [o(1), o(2), o(3)]
|
|
838
846
|
},
|
|
839
|
-
{ type:
|
|
847
|
+
{ type: A }
|
|
840
848
|
],
|
|
841
849
|
script: u,
|
|
842
850
|
cdnScript: l.cdnScript,
|
|
@@ -847,7 +855,7 @@ const P = (e, l) => {
|
|
|
847
855
|
}),
|
|
848
856
|
init() {
|
|
849
857
|
const { em: t } = this;
|
|
850
|
-
|
|
858
|
+
me(this, c.traits), ge(this, c.propKeys), this.listenTo(t, `${d.runCommand}${f}`, this.onPreviewOn), this.listenTo(t, `${d.stopCommand}${f}`, this.onPreviewOff);
|
|
851
859
|
},
|
|
852
860
|
onPreviewOn() {
|
|
853
861
|
this.__inPreview = !0, this.reloadSlider();
|
|
@@ -859,20 +867,20 @@ const P = (e, l) => {
|
|
|
859
867
|
this.trigger("rerender");
|
|
860
868
|
},
|
|
861
869
|
addSlide() {
|
|
862
|
-
const t = this.findFirstType(
|
|
870
|
+
const t = this.findFirstType(L);
|
|
863
871
|
t == null || t.append(this.getNewSlideComponentDef());
|
|
864
872
|
},
|
|
865
873
|
getNewSlideComponentDef() {
|
|
866
|
-
var
|
|
867
|
-
const t = ((
|
|
874
|
+
var i;
|
|
875
|
+
const t = ((i = this.findFirstType(L)) == null ? void 0 : i.components().length) || 0;
|
|
868
876
|
return {
|
|
869
877
|
type: M,
|
|
870
878
|
components: { type: "text", components: { type: "textnode", content: `Slide ${t + 1}` } }
|
|
871
879
|
};
|
|
872
880
|
},
|
|
873
881
|
toJSON(...t) {
|
|
874
|
-
const
|
|
875
|
-
return c.propsNoValues.forEach((
|
|
882
|
+
const i = h.prototype.toJSON.apply(this, t);
|
|
883
|
+
return c.propsNoValues.forEach((E) => delete i[E]), delete i["script-props"], i;
|
|
876
884
|
}
|
|
877
885
|
},
|
|
878
886
|
view: {
|
|
@@ -888,13 +896,13 @@ const P = (e, l) => {
|
|
|
888
896
|
},
|
|
889
897
|
onRender() {
|
|
890
898
|
const t = this.el;
|
|
891
|
-
t.__onLoad = (
|
|
899
|
+
t.__onLoad = (i) => i.on("slideChange", () => this.__activeSlide = i.activeIndex), t.__activeSlide = this.__activeSlide, t.__inPreview = this.model.__inPreview;
|
|
892
900
|
}
|
|
893
901
|
}
|
|
894
902
|
}), () => {
|
|
895
903
|
a.removeType(m), s.remove(m);
|
|
896
904
|
};
|
|
897
|
-
},
|
|
905
|
+
}, we = "Nav Prev", Pe = "Nav Next", B = `${_}button-prev`, V = `${_}button-next`, Ee = (e) => {
|
|
898
906
|
const { Components: l } = e, a = (s) => ({
|
|
899
907
|
type: "svg",
|
|
900
908
|
selectable: !1,
|
|
@@ -906,12 +914,12 @@ const P = (e, l) => {
|
|
|
906
914
|
attributes: { d: s, fill: "currentColor" }
|
|
907
915
|
}
|
|
908
916
|
});
|
|
909
|
-
return l.addType(
|
|
910
|
-
isComponent: (s) => P(s,
|
|
917
|
+
return l.addType(k, {
|
|
918
|
+
isComponent: (s) => P(s, B),
|
|
911
919
|
model: {
|
|
912
920
|
defaults: {
|
|
913
|
-
name:
|
|
914
|
-
classes:
|
|
921
|
+
name: we,
|
|
922
|
+
classes: B,
|
|
915
923
|
copyable: !1,
|
|
916
924
|
highlightable: !1,
|
|
917
925
|
droppable: !1,
|
|
@@ -921,39 +929,39 @@ const P = (e, l) => {
|
|
|
921
929
|
layerable: !1,
|
|
922
930
|
components: a("M0,22L22,0l2.1,2.1L4.2,22l19.9,19.9L22,44L0,22L0,22L0,22z"),
|
|
923
931
|
styles: `
|
|
924
|
-
.${
|
|
932
|
+
.${B} {
|
|
925
933
|
color: inherit;
|
|
926
934
|
}
|
|
927
|
-
.${
|
|
935
|
+
.${B}:after {
|
|
928
936
|
content: none;
|
|
929
937
|
}
|
|
930
938
|
`
|
|
931
939
|
}
|
|
932
940
|
}
|
|
933
|
-
}), l.addType(
|
|
934
|
-
extend:
|
|
935
|
-
isComponent: (s) => P(s,
|
|
941
|
+
}), l.addType(D, {
|
|
942
|
+
extend: k,
|
|
943
|
+
isComponent: (s) => P(s, V),
|
|
936
944
|
model: {
|
|
937
945
|
defaults: {
|
|
938
|
-
name:
|
|
939
|
-
classes:
|
|
946
|
+
name: Pe,
|
|
947
|
+
classes: V,
|
|
940
948
|
components: a("M27,22L27,22L5,44l-2.1-2.1L22.8,22L2.9,2.1L5,0L27,22L27,22z"),
|
|
941
949
|
styles: `
|
|
942
|
-
.${
|
|
950
|
+
.${V} {
|
|
943
951
|
color: inherit;
|
|
944
952
|
}
|
|
945
|
-
.${
|
|
953
|
+
.${V}:after {
|
|
946
954
|
content: none;
|
|
947
955
|
}
|
|
948
956
|
`
|
|
949
957
|
}
|
|
950
958
|
}
|
|
951
959
|
}), () => {
|
|
952
|
-
l.removeType(
|
|
960
|
+
l.removeType(k), l.removeType(D);
|
|
953
961
|
};
|
|
954
|
-
},
|
|
955
|
-
const { Components: l } = e, a = `${
|
|
956
|
-
return l.addType(
|
|
962
|
+
}, Te = (e) => {
|
|
963
|
+
const { Components: l } = e, a = `${_}pagination`;
|
|
964
|
+
return l.addType(A, {
|
|
957
965
|
isComponent: (s) => P(s, a),
|
|
958
966
|
model: {
|
|
959
967
|
defaults: {
|
|
@@ -977,15 +985,15 @@ const P = (e, l) => {
|
|
|
977
985
|
}
|
|
978
986
|
}
|
|
979
987
|
}), () => {
|
|
980
|
-
l.removeType(
|
|
988
|
+
l.removeType(A);
|
|
981
989
|
};
|
|
982
|
-
},
|
|
990
|
+
}, xe = "Scrollbar", Y = `${_}scrollbar`, Le = (e) => {
|
|
983
991
|
const { Components: l } = e;
|
|
984
992
|
return l.addType(N, {
|
|
985
993
|
isComponent: (a) => P(a, Y),
|
|
986
994
|
model: {
|
|
987
995
|
defaults: {
|
|
988
|
-
name:
|
|
996
|
+
name: xe,
|
|
989
997
|
classes: Y,
|
|
990
998
|
copyable: !1,
|
|
991
999
|
highlightable: !1,
|
|
@@ -1000,29 +1008,29 @@ const P = (e, l) => {
|
|
|
1000
1008
|
}), () => {
|
|
1001
1009
|
l.removeType(N);
|
|
1002
1010
|
};
|
|
1003
|
-
},
|
|
1011
|
+
}, ke = "Slide", X = `${_}slide`, Ae = (e) => {
|
|
1004
1012
|
const { Components: l } = e;
|
|
1005
1013
|
return l.addType(M, {
|
|
1006
1014
|
isComponent: (a) => P(a, X),
|
|
1007
1015
|
model: {
|
|
1008
1016
|
defaults: {
|
|
1009
|
-
name:
|
|
1017
|
+
name: ke,
|
|
1010
1018
|
classes: X,
|
|
1011
1019
|
icon: p.slider,
|
|
1012
|
-
draggable: (a, s) => s.is(
|
|
1020
|
+
draggable: (a, s) => s.is(L)
|
|
1013
1021
|
}
|
|
1014
1022
|
// TODO VIEW slide to this slide when selected
|
|
1015
1023
|
}
|
|
1016
1024
|
}), () => {
|
|
1017
1025
|
l.removeType(M);
|
|
1018
1026
|
};
|
|
1019
|
-
},
|
|
1027
|
+
}, _e = "Wrapper", J = `${_}wrapper`, Ce = (e) => {
|
|
1020
1028
|
const { Components: l } = e, { events: a } = l;
|
|
1021
|
-
return l.addType(
|
|
1029
|
+
return l.addType(L, {
|
|
1022
1030
|
isComponent: (s) => P(s, J),
|
|
1023
1031
|
model: {
|
|
1024
1032
|
defaults: {
|
|
1025
|
-
name:
|
|
1033
|
+
name: _e,
|
|
1026
1034
|
icon: p.slider,
|
|
1027
1035
|
classes: J,
|
|
1028
1036
|
copyable: !1,
|
|
@@ -1036,10 +1044,10 @@ const P = (e, l) => {
|
|
|
1036
1044
|
this.listenTo(s, "add remove", this.updateSlider);
|
|
1037
1045
|
},
|
|
1038
1046
|
updateSlider(s) {
|
|
1039
|
-
const
|
|
1040
|
-
if (
|
|
1041
|
-
const b =
|
|
1042
|
-
|
|
1047
|
+
const n = this.closestType(m);
|
|
1048
|
+
if (n) {
|
|
1049
|
+
const b = n.getView();
|
|
1050
|
+
n.reloadSlider(), this.em.once(a.scriptMount, () => {
|
|
1043
1051
|
setTimeout(() => {
|
|
1044
1052
|
var c;
|
|
1045
1053
|
return (c = b.getSwiper()) == null ? void 0 : c.slideTo(s.index());
|
|
@@ -1049,32 +1057,32 @@ const P = (e, l) => {
|
|
|
1049
1057
|
}
|
|
1050
1058
|
}
|
|
1051
1059
|
}), () => {
|
|
1052
|
-
l.removeType(
|
|
1060
|
+
l.removeType(L);
|
|
1053
1061
|
};
|
|
1054
|
-
},
|
|
1062
|
+
}, Ne = "swiperComponent", Me = x.startup, Oe = function(e, l = {}) {
|
|
1055
1063
|
const a = {
|
|
1056
1064
|
block: {},
|
|
1057
1065
|
cdnScript: "https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.js",
|
|
1058
1066
|
cdnStyle: "https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css",
|
|
1059
1067
|
...l
|
|
1060
1068
|
}, s = [
|
|
1061
|
-
|
|
1062
|
-
Pe(e),
|
|
1063
|
-
Ce(e),
|
|
1064
|
-
ke(e),
|
|
1069
|
+
Se(e, a),
|
|
1065
1070
|
Ee(e),
|
|
1066
|
-
|
|
1071
|
+
Ce(e),
|
|
1072
|
+
Ae(e),
|
|
1073
|
+
Te(e),
|
|
1074
|
+
Le(e)
|
|
1067
1075
|
];
|
|
1068
|
-
|
|
1076
|
+
fe({
|
|
1069
1077
|
editor: e,
|
|
1070
|
-
plan:
|
|
1078
|
+
plan: Me,
|
|
1071
1079
|
licenseKey: a.licenseKey,
|
|
1072
|
-
pluginName:
|
|
1080
|
+
pluginName: Ne,
|
|
1073
1081
|
cleanup: () => {
|
|
1074
|
-
s.forEach((
|
|
1082
|
+
s.forEach((n) => n());
|
|
1075
1083
|
}
|
|
1076
1084
|
});
|
|
1077
|
-
},
|
|
1085
|
+
}, Re = be(Oe);
|
|
1078
1086
|
export {
|
|
1079
|
-
|
|
1087
|
+
Re as default
|
|
1080
1088
|
};
|