@grapesjs/studio-sdk-plugins 1.0.36 → 1.0.37
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 +4 -4
- package/dist/accordionComponent/index.es.js +83 -70
- package/dist/accordionComponent/index.umd.js +4 -4
- package/dist/aiChat/clientToolsProcessors.d.ts +1 -2
- package/dist/aiChat/components/utils.d.ts +1 -0
- package/dist/aiChat/components/utilsTw.d.ts +11 -0
- package/dist/aiChat/index.cjs.js +70 -70
- package/dist/aiChat/index.es.js +8627 -8161
- package/dist/aiChat/index.js +70 -70
- package/dist/aiChat/index.umd.js +70 -70
- package/dist/aiChat/projectGeneration.d.ts +17 -0
- package/dist/animationComponent/index.cjs.js +3 -3
- package/dist/animationComponent/index.es.js +55 -42
- package/dist/animationComponent/index.umd.js +3 -3
- package/dist/canvasAbsoluteMode/index.cjs.js +1 -1
- package/dist/canvasAbsoluteMode/index.es.js +67 -54
- package/dist/canvasAbsoluteMode/index.umd.js +1 -1
- package/dist/canvasEmptyState/index.cjs.js +1 -1
- package/dist/canvasEmptyState/index.es.js +59 -46
- package/dist/canvasEmptyState/index.umd.js +1 -1
- package/dist/canvasFullSize/index.cjs.js +4 -4
- package/dist/canvasFullSize/index.es.js +59 -46
- package/dist/canvasFullSize/index.umd.js +4 -4
- package/dist/canvasGridMode/index.cjs.js +2 -2
- package/dist/canvasGridMode/index.es.js +70 -57
- package/dist/canvasGridMode/index.umd.js +4 -4
- package/dist/canvasScreenshot/index.cjs.js +1 -1
- package/dist/canvasScreenshot/index.es.js +37 -24
- package/dist/canvasScreenshot/index.umd.js +1 -1
- package/dist/dataSourceEjs/index.cjs.js +3 -3
- package/dist/dataSourceEjs/index.es.js +51 -38
- package/dist/dataSourceEjs/index.umd.js +3 -3
- package/dist/dataSourceHandlebars/index.cjs.js +2 -2
- package/dist/dataSourceHandlebars/index.es.js +50 -37
- package/dist/dataSourceHandlebars/index.umd.js +6 -6
- package/dist/dialogComponent/index.cjs.js +9 -9
- package/dist/dialogComponent/index.es.js +58 -45
- package/dist/dialogComponent/index.umd.js +3 -3
- package/dist/flexComponent/index.cjs.js +6 -6
- package/dist/flexComponent/index.es.js +82 -69
- package/dist/flexComponent/index.umd.js +6 -6
- package/dist/fsLightboxComponent/index.cjs.js +2 -2
- package/dist/fsLightboxComponent/index.es.js +70 -57
- package/dist/fsLightboxComponent/index.umd.js +2 -2
- package/dist/googleFontsAssetProvider/index.cjs.js +1 -1
- package/dist/googleFontsAssetProvider/index.es.js +84 -71
- package/dist/googleFontsAssetProvider/index.umd.js +1 -1
- package/dist/iconifyComponent/index.cjs.js +2 -2
- package/dist/iconifyComponent/index.es.js +82 -69
- package/dist/iconifyComponent/index.umd.js +2 -2
- package/dist/index.cjs.js +36 -36
- package/dist/index.es.js +843 -830
- package/dist/index.umd.js +36 -36
- package/dist/layoutSidebarButtons/index.cjs.js +1 -1
- package/dist/layoutSidebarButtons/index.es.js +81 -68
- package/dist/layoutSidebarButtons/index.umd.js +1 -1
- package/dist/lightGalleryComponent/index.cjs.js +1 -1
- package/dist/lightGalleryComponent/index.es.js +86 -73
- package/dist/lightGalleryComponent/index.umd.js +1 -1
- package/dist/linkImageComponent/index.cjs.js +2 -2
- package/dist/linkImageComponent/index.es.js +70 -57
- package/dist/linkImageComponent/index.umd.js +2 -2
- package/dist/listPagesComponent/index.cjs.js +3 -3
- package/dist/listPagesComponent/index.es.js +49 -36
- package/dist/listPagesComponent/index.umd.js +3 -3
- package/dist/presetPrintable/index.cjs.js +3 -3
- package/dist/presetPrintable/index.es.js +130 -117
- package/dist/presetPrintable/index.umd.js +3 -3
- package/dist/prosemirror/index.cjs.js +1 -1
- package/dist/prosemirror/index.es.js +96 -83
- package/dist/prosemirror/index.umd.js +1 -1
- package/dist/rendererReact/index.cjs.js +1 -1
- package/dist/rendererReact/index.es.js +143 -131
- package/dist/rendererReact/index.js +1 -1
- package/dist/rendererReact/index.umd.js +1 -1
- package/dist/rteTinyMce/index.cjs.js +2 -2
- package/dist/rteTinyMce/index.es.js +74 -61
- package/dist/rteTinyMce/index.umd.js +2 -2
- package/dist/shapeDividerComponent/index.cjs.js +3 -3
- package/dist/shapeDividerComponent/index.es.js +33 -20
- package/dist/shapeDividerComponent/index.umd.js +3 -3
- package/dist/swiperComponent/index.cjs.js +5 -5
- package/dist/swiperComponent/index.es.js +105 -92
- package/dist/swiperComponent/index.umd.js +5 -5
- package/dist/tableComponent/index.cjs.js +1 -1
- package/dist/tableComponent/index.es.js +163 -150
- package/dist/tableComponent/index.umd.js +1 -1
- package/dist/youtubeAssetProvider/index.cjs.js +1 -1
- package/dist/youtubeAssetProvider/index.es.js +36 -23
- package/dist/youtubeAssetProvider/index.umd.js +1 -1
- package/package.json +2 -2
|
@@ -1,41 +1,54 @@
|
|
|
1
|
-
const te = "app.grapesjs.com", ae = "app-stage.grapesjs.com", le = "app2.grapesjs.com",
|
|
1
|
+
const te = "app.grapesjs.com", ae = "app-stage.grapesjs.com", le = "app2.grapesjs.com", oe = "app-stage2.grapesjs.com", U = [
|
|
2
2
|
te,
|
|
3
3
|
le,
|
|
4
4
|
ae,
|
|
5
|
-
|
|
5
|
+
oe,
|
|
6
6
|
"localhost",
|
|
7
7
|
"127.0.0.1",
|
|
8
8
|
".local-credentialless.webcontainer.io",
|
|
9
9
|
// For stackblitz.com demos
|
|
10
10
|
".local.webcontainer.io",
|
|
11
11
|
// For stackblitz.com demos
|
|
12
|
-
"-sandpack.codesandbox.io"
|
|
12
|
+
"-sandpack.codesandbox.io",
|
|
13
13
|
// For Sandpack demos
|
|
14
|
-
|
|
14
|
+
".claudemcpcontent.com",
|
|
15
|
+
// For Claude mcp app
|
|
16
|
+
".web-sandbox.oaiusercontent.com"
|
|
17
|
+
// For OpenAI mcp app
|
|
18
|
+
], se = "license:check:end", ie = () => typeof window < "u", ne = ({
|
|
15
19
|
isDev: e,
|
|
16
20
|
isStage: l,
|
|
17
21
|
isPlatform: a
|
|
18
22
|
}) => `${e ? "" : `https://${l ? ae : te}`}/${a ? "platform-api" : "api"}`, re = () => {
|
|
19
|
-
|
|
23
|
+
if (!ie()) return "";
|
|
24
|
+
const { hostname: e } = window.location;
|
|
25
|
+
if (e) return e;
|
|
26
|
+
try {
|
|
27
|
+
return window.parent.location.hostname || "";
|
|
28
|
+
} catch {
|
|
29
|
+
return "";
|
|
30
|
+
}
|
|
31
|
+
}, ce = () => {
|
|
32
|
+
const e = re();
|
|
20
33
|
return !!e && (U.includes(e) || U.some((l) => e.endsWith(l)));
|
|
21
|
-
},
|
|
22
|
-
async function
|
|
34
|
+
}, de = (e) => e.replace(/[A-Z]+(?![a-z])|[A-Z]/g, (l, a) => (a ? "-" : "") + l.toLowerCase()), pe = (e) => typeof e < "u";
|
|
35
|
+
async function ue({
|
|
23
36
|
path: e,
|
|
24
37
|
baseApiUrl: l,
|
|
25
38
|
method: a = "GET",
|
|
26
|
-
headers:
|
|
27
|
-
params:
|
|
39
|
+
headers: o = {},
|
|
40
|
+
params: s,
|
|
28
41
|
body: f
|
|
29
42
|
}) {
|
|
30
43
|
const d = `${l || ne({ isDev: !1, isStage: !1 })}${e}`, p = {
|
|
31
44
|
method: a,
|
|
32
45
|
headers: {
|
|
33
46
|
"Content-Type": "application/json",
|
|
34
|
-
...
|
|
47
|
+
...o
|
|
35
48
|
}
|
|
36
49
|
};
|
|
37
50
|
f && (p.body = JSON.stringify(f));
|
|
38
|
-
const b =
|
|
51
|
+
const b = s ? new URLSearchParams(s).toString() : "", g = b ? `?${b}` : "", i = await fetch(`${d}${g}`, p);
|
|
39
52
|
if (!i.ok)
|
|
40
53
|
throw new Error(`HTTP error! status: ${i.status}`);
|
|
41
54
|
return i.json();
|
|
@@ -47,17 +60,17 @@ const j = {
|
|
|
47
60
|
[x.business]: 20,
|
|
48
61
|
[x.enterprise]: 30
|
|
49
62
|
};
|
|
50
|
-
function
|
|
63
|
+
function be(e) {
|
|
51
64
|
const l = e;
|
|
52
|
-
return l.init = (a) => (
|
|
65
|
+
return l.init = (a) => (o) => e(o, a), l;
|
|
53
66
|
}
|
|
54
|
-
const
|
|
55
|
-
async function
|
|
67
|
+
const fe = (e) => /* @__PURE__ */ be(e);
|
|
68
|
+
async function ge({
|
|
56
69
|
editor: e,
|
|
57
70
|
plan: l,
|
|
58
71
|
pluginName: a,
|
|
59
|
-
licenseKey:
|
|
60
|
-
onLicenseCheckResponse:
|
|
72
|
+
licenseKey: o,
|
|
73
|
+
onLicenseCheckResponse: s,
|
|
61
74
|
cleanup: f
|
|
62
75
|
}) {
|
|
63
76
|
let c = "", d;
|
|
@@ -75,13 +88,13 @@ async function fe({
|
|
|
75
88
|
};
|
|
76
89
|
e.Commands.has(q.settings) && (d = e.runCommand(q.settings), c = (d == null ? void 0 : d.baseUrl) || "");
|
|
77
90
|
const g = (i) => {
|
|
78
|
-
|
|
91
|
+
s == null || s(i), i && b(i);
|
|
79
92
|
};
|
|
80
93
|
if (!d) {
|
|
81
94
|
e.onReady(async () => {
|
|
82
|
-
if (!
|
|
83
|
-
if (
|
|
84
|
-
const i = await
|
|
95
|
+
if (!ce())
|
|
96
|
+
if (o) {
|
|
97
|
+
const i = await ve({ licenseKey: o, pluginName: a, baseApiUrl: c });
|
|
85
98
|
g(i);
|
|
86
99
|
} else
|
|
87
100
|
p("The `licenseKey` option not provided");
|
|
@@ -89,23 +102,23 @@ async function fe({
|
|
|
89
102
|
return;
|
|
90
103
|
}
|
|
91
104
|
if (d.licensePlan || d.licenseError) {
|
|
92
|
-
const i =
|
|
105
|
+
const i = he(d);
|
|
93
106
|
g(i);
|
|
94
107
|
return;
|
|
95
108
|
}
|
|
96
|
-
e.on(
|
|
109
|
+
e.on(se, (i) => g(i));
|
|
97
110
|
}
|
|
98
|
-
const
|
|
111
|
+
const he = (e) => ({
|
|
99
112
|
sdkLicense: e.license,
|
|
100
113
|
license: e.license,
|
|
101
114
|
error: e.licenseError,
|
|
102
115
|
plan: e.licensePlan
|
|
103
116
|
});
|
|
104
|
-
async function
|
|
105
|
-
const { licenseKey: l, pluginName: a, baseApiUrl:
|
|
117
|
+
async function ve(e) {
|
|
118
|
+
const { licenseKey: l, pluginName: a, baseApiUrl: o } = e;
|
|
106
119
|
try {
|
|
107
|
-
return (await
|
|
108
|
-
baseApiUrl:
|
|
120
|
+
return (await ue({
|
|
121
|
+
baseApiUrl: o,
|
|
109
122
|
path: `/sdk/${l || "na"}`,
|
|
110
123
|
method: "POST",
|
|
111
124
|
params: {
|
|
@@ -113,19 +126,19 @@ async function he(e) {
|
|
|
113
126
|
pn: a
|
|
114
127
|
}
|
|
115
128
|
})).result || {};
|
|
116
|
-
} catch (
|
|
117
|
-
return console.error("Error during SDK license check:",
|
|
129
|
+
} catch (s) {
|
|
130
|
+
return console.error("Error during SDK license check:", s), !1;
|
|
118
131
|
}
|
|
119
132
|
}
|
|
120
133
|
const E = (e, l) => {
|
|
121
134
|
var a;
|
|
122
135
|
return !!((a = e == null ? void 0 : e.classList) != null && a.contains(l));
|
|
123
|
-
},
|
|
136
|
+
}, ye = (e, l = {}) => {
|
|
124
137
|
var f;
|
|
125
|
-
const a = {},
|
|
138
|
+
const a = {}, o = [], s = [];
|
|
126
139
|
for (const c in e) {
|
|
127
140
|
const { value: d, ...p } = e[c];
|
|
128
|
-
|
|
141
|
+
o.push({ id: c, name: c, changeProp: !0, category: l.category, ...p }), a[c] = d, !pe(d) && s.push(c);
|
|
129
142
|
const { subTraits: b = {} } = p;
|
|
130
143
|
for (const g in p.subTraits)
|
|
131
144
|
(f = b[g]) == null || f.forEach((i) => {
|
|
@@ -135,29 +148,29 @@ const E = (e, l) => {
|
|
|
135
148
|
}
|
|
136
149
|
return {
|
|
137
150
|
propKeys: Object.keys(a),
|
|
138
|
-
propsNoValues:
|
|
151
|
+
propsNoValues: s,
|
|
139
152
|
props: a,
|
|
140
|
-
traits:
|
|
153
|
+
traits: o
|
|
141
154
|
};
|
|
142
|
-
},
|
|
155
|
+
}, we = (e, l) => {
|
|
143
156
|
l.forEach((a) => {
|
|
144
157
|
if (a.subTraits) {
|
|
145
|
-
const
|
|
146
|
-
e.on(
|
|
158
|
+
const o = `${a.id || a.name}`, s = a.changeProp ? `change:${o}` : `change:attributes:${o}`;
|
|
159
|
+
e.on(s, () => Z(e, o)), Z(e, o);
|
|
147
160
|
}
|
|
148
161
|
});
|
|
149
162
|
}, Z = (e, l) => {
|
|
150
|
-
const a = e.getTrait(l),
|
|
163
|
+
const a = e.getTrait(l), o = a.get("category"), s = a.get("subTraits") || {}, c = (Object.values(s).flat() || []).map((b) => b.id || b.name);
|
|
151
164
|
e.removeTrait(c);
|
|
152
|
-
const d =
|
|
165
|
+
const d = s[a.getValue()], p = e.getTraitIndex(l) + 1;
|
|
153
166
|
d && e.addTrait(
|
|
154
|
-
d.map((b) => ({ category:
|
|
167
|
+
d.map((b) => ({ category: o, ...b })),
|
|
155
168
|
{ at: p }
|
|
156
169
|
);
|
|
157
|
-
},
|
|
170
|
+
}, me = (e, l) => {
|
|
158
171
|
l.forEach((a) => {
|
|
159
|
-
const
|
|
160
|
-
|
|
172
|
+
const o = de(a);
|
|
173
|
+
o !== a && e.has(o) && e.set({ [a]: e.get(o), [o]: void 0 });
|
|
161
174
|
});
|
|
162
175
|
}, v = "swiper", O = `${v}-slide`, L = `${v}-wrapper`, A = `${v}-nav-prev`, I = `${v}-nav-next`, k = `${v}-pagination`, M = `${v}-scrollbar`, u = {
|
|
163
176
|
slider: `<svg viewBox="0 0 24 24">
|
|
@@ -195,7 +208,7 @@ const E = (e, l) => {
|
|
|
195
208
|
add: `<svg viewBox="0 0 24 24">
|
|
196
209
|
<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"/>
|
|
197
210
|
</svg>`
|
|
198
|
-
}, K = { id: "swiper-responsive", label: "Responsive", icon: u.responsive }, Y = { id: "swiper-extra", label: "Extra", icon: u.extra },
|
|
211
|
+
}, K = { id: "swiper-responsive", label: "Responsive", icon: u.responsive }, Y = { id: "swiper-extra", label: "Extra", icon: u.extra }, Se = {
|
|
199
212
|
actions: {
|
|
200
213
|
type: "radio",
|
|
201
214
|
label: !1,
|
|
@@ -207,8 +220,8 @@ const E = (e, l) => {
|
|
|
207
220
|
{ id: "a", label: "Add new slide", icon: u.add }
|
|
208
221
|
],
|
|
209
222
|
setValue: ({ component: e, value: l }) => {
|
|
210
|
-
var
|
|
211
|
-
const a = (
|
|
223
|
+
var o;
|
|
224
|
+
const a = (o = e.getView()) == null ? void 0 : o.getSwiper();
|
|
212
225
|
switch (l) {
|
|
213
226
|
case "r":
|
|
214
227
|
e.reloadSlider();
|
|
@@ -250,8 +263,8 @@ const E = (e, l) => {
|
|
|
250
263
|
label: "Navigation",
|
|
251
264
|
getValue: ({ component: e }) => !!e.findFirstType(A),
|
|
252
265
|
setValue: ({ component: e, value: l }) => {
|
|
253
|
-
var a,
|
|
254
|
-
l ? e.append([{ type: A }, { type: I }]) : ((a = e.findFirstType(A)) == null || a.remove(), (
|
|
266
|
+
var a, o;
|
|
267
|
+
l ? e.append([{ type: A }, { type: I }]) : ((a = e.findFirstType(A)) == null || a.remove(), (o = e.findFirstType(I)) == null || o.remove()), e.set({ navigation: l });
|
|
255
268
|
}
|
|
256
269
|
},
|
|
257
270
|
initialSlide: {
|
|
@@ -728,8 +741,8 @@ const E = (e, l) => {
|
|
|
728
741
|
tip: 'If enabled, the user will see the "grab" cursor when hover the slider',
|
|
729
742
|
value: !1
|
|
730
743
|
}
|
|
731
|
-
}, X = "Slider", z = "swiper", R = `${z}-`,
|
|
732
|
-
const { Components: a, Blocks:
|
|
744
|
+
}, X = "Slider", z = "swiper", R = `${z}-`, Pe = (e, l) => {
|
|
745
|
+
const { Components: a, Blocks: o, Commands: s } = e, { block: f } = l, c = ye(Se), d = "core:preview", p = s.events, b = function(t) {
|
|
733
746
|
const n = this, w = window, N = n.__onLoad, _ = n.__activeSlide, B = n.__inPreview, $ = w._isEditor && !B ? t.autoplayEditor : !0, { cdnScript: G, cdnStyle: F, slidesPerView: C } = t || {}, r = (m) => isNaN(m) ? void 0 : parseFloat(m), H = () => {
|
|
734
747
|
const m = n.parentElement;
|
|
735
748
|
m && (m.style.minWidth = "0");
|
|
@@ -875,7 +888,7 @@ const E = (e, l) => {
|
|
|
875
888
|
}),
|
|
876
889
|
init() {
|
|
877
890
|
const { em: t } = this;
|
|
878
|
-
|
|
891
|
+
we(this, c.traits), me(this, c.propKeys), this.listenTo(t, `${p.runCommand}${d}`, this.onPreviewOn), this.listenTo(t, `${p.stopCommand}${d}`, this.onPreviewOff);
|
|
879
892
|
},
|
|
880
893
|
onPreviewOn() {
|
|
881
894
|
this.__inPreview = !0, this.reloadSlider();
|
|
@@ -920,10 +933,10 @@ const E = (e, l) => {
|
|
|
920
933
|
}
|
|
921
934
|
}
|
|
922
935
|
}), () => {
|
|
923
|
-
a.removeType(v),
|
|
936
|
+
a.removeType(v), o.remove(v);
|
|
924
937
|
};
|
|
925
|
-
},
|
|
926
|
-
const { Components: l } = e, a = (
|
|
938
|
+
}, Ee = "Nav Prev", Te = "Nav Next", D = `${R}button-prev`, V = `${R}button-next`, xe = (e) => {
|
|
939
|
+
const { Components: l } = e, a = (o) => ({
|
|
927
940
|
type: "svg",
|
|
928
941
|
selectable: !1,
|
|
929
942
|
hoverable: !1,
|
|
@@ -931,14 +944,14 @@ const E = (e, l) => {
|
|
|
931
944
|
components: {
|
|
932
945
|
type: "svg-in",
|
|
933
946
|
tagName: "path",
|
|
934
|
-
attributes: { d:
|
|
947
|
+
attributes: { d: o, fill: "currentColor" }
|
|
935
948
|
}
|
|
936
949
|
});
|
|
937
950
|
return l.addType(A, {
|
|
938
|
-
isComponent: (
|
|
951
|
+
isComponent: (o) => E(o, D),
|
|
939
952
|
model: {
|
|
940
953
|
defaults: {
|
|
941
|
-
name:
|
|
954
|
+
name: Ee,
|
|
942
955
|
classes: D,
|
|
943
956
|
copyable: !1,
|
|
944
957
|
highlightable: !1,
|
|
@@ -960,10 +973,10 @@ const E = (e, l) => {
|
|
|
960
973
|
}
|
|
961
974
|
}), l.addType(I, {
|
|
962
975
|
extend: A,
|
|
963
|
-
isComponent: (
|
|
976
|
+
isComponent: (o) => E(o, V),
|
|
964
977
|
model: {
|
|
965
978
|
defaults: {
|
|
966
|
-
name:
|
|
979
|
+
name: Te,
|
|
967
980
|
classes: V,
|
|
968
981
|
components: a("M27,22L27,22L5,44l-2.1-2.1L22.8,22L2.9,2.1L5,0L27,22L27,22z"),
|
|
969
982
|
styles: `
|
|
@@ -979,10 +992,10 @@ const E = (e, l) => {
|
|
|
979
992
|
}), () => {
|
|
980
993
|
l.removeType(A), l.removeType(I);
|
|
981
994
|
};
|
|
982
|
-
},
|
|
995
|
+
}, Le = (e) => {
|
|
983
996
|
const { Components: l } = e, a = `${R}pagination`;
|
|
984
997
|
return l.addType(k, {
|
|
985
|
-
isComponent: (
|
|
998
|
+
isComponent: (o) => E(o, a),
|
|
986
999
|
model: {
|
|
987
1000
|
defaults: {
|
|
988
1001
|
name: "Pagination",
|
|
@@ -1007,13 +1020,13 @@ const E = (e, l) => {
|
|
|
1007
1020
|
}), () => {
|
|
1008
1021
|
l.removeType(k);
|
|
1009
1022
|
};
|
|
1010
|
-
},
|
|
1023
|
+
}, Ae = "Scrollbar", J = `${R}scrollbar`, ke = (e) => {
|
|
1011
1024
|
const { Components: l } = e;
|
|
1012
1025
|
return l.addType(M, {
|
|
1013
1026
|
isComponent: (a) => E(a, J),
|
|
1014
1027
|
model: {
|
|
1015
1028
|
defaults: {
|
|
1016
|
-
name:
|
|
1029
|
+
name: Ae,
|
|
1017
1030
|
classes: J,
|
|
1018
1031
|
copyable: !1,
|
|
1019
1032
|
highlightable: !1,
|
|
@@ -1028,49 +1041,49 @@ const E = (e, l) => {
|
|
|
1028
1041
|
}), () => {
|
|
1029
1042
|
l.removeType(M);
|
|
1030
1043
|
};
|
|
1031
|
-
},
|
|
1044
|
+
}, Re = "Slide", Q = `${R}slide`, Ne = (e) => {
|
|
1032
1045
|
const { Components: l } = e;
|
|
1033
1046
|
return l.addType(O, {
|
|
1034
1047
|
isComponent: (a) => E(a, Q),
|
|
1035
1048
|
model: {
|
|
1036
1049
|
defaults: {
|
|
1037
|
-
name:
|
|
1050
|
+
name: Re,
|
|
1038
1051
|
classes: Q,
|
|
1039
1052
|
icon: u.slider,
|
|
1040
|
-
draggable: (a,
|
|
1053
|
+
draggable: (a, o) => o.is(L)
|
|
1041
1054
|
}
|
|
1042
1055
|
// TODO VIEW slide to this slide when selected
|
|
1043
1056
|
}
|
|
1044
1057
|
}), () => {
|
|
1045
1058
|
l.removeType(O);
|
|
1046
1059
|
};
|
|
1047
|
-
},
|
|
1060
|
+
}, _e = "Wrapper", ee = `${R}wrapper`, Me = (e) => {
|
|
1048
1061
|
const { Components: l } = e, { events: a } = l;
|
|
1049
1062
|
return l.addType(L, {
|
|
1050
|
-
isComponent: (
|
|
1063
|
+
isComponent: (o) => E(o, ee),
|
|
1051
1064
|
model: {
|
|
1052
1065
|
defaults: {
|
|
1053
|
-
name:
|
|
1066
|
+
name: _e,
|
|
1054
1067
|
icon: u.slider,
|
|
1055
1068
|
classes: ee,
|
|
1056
1069
|
copyable: !1,
|
|
1057
1070
|
removable: !1,
|
|
1058
1071
|
draggable: !1,
|
|
1059
1072
|
highlightable: !1,
|
|
1060
|
-
droppable: (
|
|
1073
|
+
droppable: (o) => o.is(O)
|
|
1061
1074
|
},
|
|
1062
1075
|
init() {
|
|
1063
|
-
const
|
|
1064
|
-
this.listenTo(
|
|
1076
|
+
const o = this.components();
|
|
1077
|
+
this.listenTo(o, "add remove", this.updateSlider);
|
|
1065
1078
|
},
|
|
1066
|
-
updateSlider(
|
|
1067
|
-
const
|
|
1068
|
-
if (
|
|
1069
|
-
const f =
|
|
1070
|
-
|
|
1079
|
+
updateSlider(o) {
|
|
1080
|
+
const s = this.closestType(v);
|
|
1081
|
+
if (s) {
|
|
1082
|
+
const f = s.getView();
|
|
1083
|
+
s.reloadSlider(), this.em.once(a.scriptMount, () => {
|
|
1071
1084
|
setTimeout(() => {
|
|
1072
1085
|
var c;
|
|
1073
|
-
return (c = f.getSwiper()) == null ? void 0 : c.slideTo(
|
|
1086
|
+
return (c = f.getSwiper()) == null ? void 0 : c.slideTo(o.index());
|
|
1074
1087
|
}, 100);
|
|
1075
1088
|
});
|
|
1076
1089
|
}
|
|
@@ -1079,30 +1092,30 @@ const E = (e, l) => {
|
|
|
1079
1092
|
}), () => {
|
|
1080
1093
|
l.removeType(L);
|
|
1081
1094
|
};
|
|
1082
|
-
},
|
|
1095
|
+
}, Oe = "swiperComponent", Be = x.startup, De = function(e, l = {}) {
|
|
1083
1096
|
const a = {
|
|
1084
1097
|
block: {},
|
|
1085
1098
|
cdnScript: "https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.js",
|
|
1086
1099
|
cdnStyle: "https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css",
|
|
1087
1100
|
...l
|
|
1088
|
-
},
|
|
1089
|
-
|
|
1090
|
-
Te(e),
|
|
1091
|
-
_e(e),
|
|
1092
|
-
Re(e),
|
|
1101
|
+
}, o = [
|
|
1102
|
+
Pe(e, a),
|
|
1093
1103
|
xe(e),
|
|
1094
|
-
|
|
1104
|
+
Me(e),
|
|
1105
|
+
Ne(e),
|
|
1106
|
+
Le(e),
|
|
1107
|
+
ke(e)
|
|
1095
1108
|
];
|
|
1096
|
-
|
|
1109
|
+
ge({
|
|
1097
1110
|
editor: e,
|
|
1098
|
-
plan:
|
|
1111
|
+
plan: Be,
|
|
1099
1112
|
licenseKey: a.licenseKey,
|
|
1100
|
-
pluginName:
|
|
1113
|
+
pluginName: Oe,
|
|
1101
1114
|
cleanup: () => {
|
|
1102
|
-
|
|
1115
|
+
o.forEach((s) => s());
|
|
1103
1116
|
}
|
|
1104
1117
|
});
|
|
1105
|
-
},
|
|
1118
|
+
}, Ve = fe(De);
|
|
1106
1119
|
export {
|
|
1107
|
-
|
|
1120
|
+
Ve as default
|
|
1108
1121
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(T,x){typeof exports=="object"&&typeof module<"u"?module.exports=x():typeof define=="function"&&define.amd?define(x):(T=typeof globalThis<"u"?globalThis:T||self,T.StudioSdkPlugins_swiperComponent=x())})(this,function(){"use strict";const T="app.grapesjs.com",x="app-stage.grapesjs.com",U=[T,"app2.grapesjs.com",x,"app-stage2.grapesjs.com","localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],le="license:check:end",oe=()=>typeof window<"u",se=({isDev:e,isStage:l,isPlatform:a})=>`${e?"":`https://${l?x:T}`}/${a?"platform-api":"api"}`,ie=()=>{const
|
|
1
|
+
(function(T,x){typeof exports=="object"&&typeof module<"u"?module.exports=x():typeof define=="function"&&define.amd?define(x):(T=typeof globalThis<"u"?globalThis:T||self,T.StudioSdkPlugins_swiperComponent=x())})(this,function(){"use strict";const T="app.grapesjs.com",x="app-stage.grapesjs.com",U=[T,"app2.grapesjs.com",x,"app-stage2.grapesjs.com","localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io",".claudemcpcontent.com",".web-sandbox.oaiusercontent.com"],le="license:check:end",oe=()=>typeof window<"u",se=({isDev:e,isStage:l,isPlatform:a})=>`${e?"":`https://${l?x:T}`}/${a?"platform-api":"api"}`,ie=()=>{if(!oe())return"";const{hostname:e}=window.location;if(e)return e;try{return window.parent.location.hostname||""}catch{return""}},ne=()=>{const e=ie();return!!e&&(U.includes(e)||U.some(l=>e.endsWith(l)))},re=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(l,a)=>(a?"-":"")+l.toLowerCase()),ce=e=>typeof e<"u";async function de({path:e,baseApiUrl:l,method:a="GET",headers:o={},params:s,body:f}){const d=`${l||se({isDev:!1,isStage:!1})}${e}`,u={method:a,headers:{"Content-Type":"application/json",...o}};f&&(u.body=JSON.stringify(f));const b=s?new URLSearchParams(s).toString():"",h=b?`?${b}`:"",i=await fetch(`${d}${h}`,u);if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);return i.json()}var A=(e=>(e.free="free",e.startup="startup",e.business="business",e.enterprise="enterprise",e))(A||{}),F=(e=>(e.toastAdd="studio:toastAdd",e.toastRemove="studio:toastRemove",e.dialogOpen="studio:dialogOpen",e.dialogClose="studio:dialogClose",e.dialogExportCode="studio:dialogExportCode",e.dialogImportCode="studio:dialogImportCode",e.sidebarLeftSet="studio:sidebarLeft:set",e.sidebarLeftGet="studio:sidebarLeft:get",e.sidebarLeftToggle="studio:sidebarLeft:toggle",e.sidebarRightSet="studio:sidebarRight:set",e.sidebarRightGet="studio:sidebarRight:get",e.sidebarRightToggle="studio:sidebarRight:toggle",e.sidebarTopSet="studio:sidebarTop:set",e.sidebarTopGet="studio:sidebarTop:get",e.sidebarTopToggle="studio:sidebarTop:toggle",e.sidebarBottomSet="studio:sidebarBottom:set",e.sidebarBottomGet="studio:sidebarBottom:get",e.sidebarBottomToggle="studio:sidebarBottom:toggle",e.symbolAdd="studio:symbolAdd",e.symbolDetach="studio:symbolDetach",e.symbolOverride="studio:symbolOverride",e.symbolPropagateStyles="studio:propagateStyles",e.getPagesConfig="studio:getPagesConfig",e.setPagesConfig="studio:setPagesConfig",e.getPageSettings="studio:getPageSettings",e.setPageSettings="studio:setPageSettings",e.clearPage="studio:clearPage",e.projectFiles="studio:projectFiles",e.validateCode="studio:validateCode",e.canvasReload="studio:canvasReload",e.getBlocksPanel="studio:getBlocksPanel",e.setBlocksPanel="studio:setBlocksPanel",e.getStateContextMenu="studio:getStateContextMenu",e.setStateContextMenu="studio:setStateContextMenu",e.contextMenuComponent="studio:contextMenuComponent",e.layoutAdd="studio:layoutAdd",e.layoutRemove="studio:layoutRemove",e.layoutToggle="studio:layoutToggle",e.layoutUpdate="studio:layoutUpdate",e.layoutGet="studio:layoutGet",e.layoutConfigGet="studio:layoutConfigGet",e.layoutConfigSet="studio:layoutConfigSet",e.layoutComponentAdd="studio:layoutComponentAdd",e.layoutComponentGet="studio:layoutComponentGet",e.layoutComponentRemove="studio:layoutComponentRemove",e.layoutComponentRender="studio:layoutComponentRender",e.getStateTheme="studio:getStateTheme",e.setStateTheme="studio:setStateTheme",e.settings="studio:settings",e.assetProviderGet="studio:assetProviderGet",e.assetProviderAdd="studio:assetProviderAdd",e.assetProviderRemove="studio:assetProviderRemove",e.fontGet="studio:fontGet",e.fontAdd="studio:fontAdd",e.fontRemove="studio:fontRemove",e.fontManagerOpen="studio:fontManagerOpen",e.menuFontLoad="studio:menuFontLoad",e.toggleStateDataSource="studio:toggleStateDataSource",e.getStateDataSource="studio:getStateDataSource",e.dataSourceSetGlobalData="studio:dataSourceSetGlobalData",e.dataSourceSetImporter="studio:dataSourceSetImporter",e.dataSourceSetExporter="studio:dataSourceSetExporter",e.setDragAbsolute="studio:setDragAbsolute",e))(F||{});const Z={[A.free]:0,[A.startup]:10,[A.business]:20,[A.enterprise]:30};function pe(e){const l=e;return l.init=a=>o=>e(o,a),l}const ue=e=>pe(e);async function be({editor:e,plan:l,pluginName:a,licenseKey:o,onLicenseCheckResponse:s,cleanup:f}){let c="",d;const u=i=>{console.warn("Cleanup plugin:",a,"Reason:",i),f()},b=(i={})=>{var B;const{error:t,sdkLicense:n}=i,w=(B=i.plan)==null?void 0:B.category;if(!(n||i.license)||t)u(t||"Invalid license");else if(w){const G=Z[l],W=Z[w];G>W&&u({pluginRequiredPlan:l,licensePlan:w})}};e.Commands.has(F.settings)&&(d=e.runCommand(F.settings),c=(d==null?void 0:d.baseUrl)||"");const h=i=>{s==null||s(i),i&&b(i)};if(!d){e.onReady(async()=>{if(!ne())if(o){const i=await ge({licenseKey:o,pluginName:a,baseApiUrl:c});h(i)}else u("The `licenseKey` option not provided")});return}if(d.licensePlan||d.licenseError){const i=fe(d);h(i);return}e.on(le,i=>h(i))}const fe=e=>({sdkLicense:e.license,license:e.license,error:e.licenseError,plan:e.licensePlan});async function ge(e){const{licenseKey:l,pluginName:a,baseApiUrl:o}=e;try{return(await de({baseApiUrl:o,path:`/sdk/${l||"na"}`,method:"POST",params:{d:window.location.hostname,pn:a}})).result||{}}catch(s){return console.error("Error during SDK license check:",s),!1}}const P=(e,l)=>{var a;return!!((a=e==null?void 0:e.classList)!=null&&a.contains(l))},he=(e,l={})=>{var f;const a={},o=[],s=[];for(const c in e){const{value:d,...u}=e[c];o.push({id:c,name:c,changeProp:!0,category:l.category,...u}),a[c]=d,!ce(d)&&s.push(c);const{subTraits:b={}}=u;for(const h in u.subTraits)(f=b[h])==null||f.forEach(i=>{const t=i.id||i.name;a[t]=i.value})}return{propKeys:Object.keys(a),propsNoValues:s,props:a,traits:o}},ve=(e,l)=>{l.forEach(a=>{if(a.subTraits){const o=`${a.id||a.name}`,s=a.changeProp?`change:${o}`:`change:attributes:${o}`;e.on(s,()=>K(e,o)),K(e,o)}})},K=(e,l)=>{const a=e.getTrait(l),o=a.get("category"),s=a.get("subTraits")||{},c=(Object.values(s).flat()||[]).map(b=>b.id||b.name);e.removeTrait(c);const d=s[a.getValue()],u=e.getTraitIndex(l)+1;d&&e.addTrait(d.map(b=>({category:o,...b})),{at:u})},ye=(e,l)=>{l.forEach(a=>{const o=re(a);o!==a&&e.has(o)&&e.set({[a]:e.get(o),[o]:void 0})})},g="swiper",M=`${g}-slide`,L=`${g}-wrapper`,k=`${g}-nav-prev`,I=`${g}-nav-next`,R=`${g}-pagination`,O=`${g}-scrollbar`,p={slider:`<svg viewBox="0 0 24 24">
|
|
2
2
|
<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"/>
|
|
3
3
|
<path d="M4 12.5L6 14v-3zM20 12.5L18 14v-3z"/>
|
|
4
4
|
</svg>`,effect:`<svg viewBox="0 0 24 24">
|
|
@@ -21,25 +21,25 @@
|
|
|
21
21
|
<path d="M2 12c0 5 4 9 9 9 2.4 0 4.7-1 6.4-2.6l-1.5-1.5A6.7 6.7 0 0 1 11 19a7 7 0 1 1 7-7h-3l4 4h.1l3.9-4h-3a9 9 0 0 0-18 0Z"/>
|
|
22
22
|
</svg>`,prev:'<svg viewBox="0 0 24 24"><path d="M15.4 16.6 10.8 12l4.6-4.6L14 6l-6 6 6 6 1.4-1.4Z"/></svg>',next:'<svg viewBox="0 0 24 24"><path d="m8.6 16.6 4.6-4.6-4.6-4.6L10 6l6 6-6 6-1.4-1.4Z"/></svg>',add:`<svg viewBox="0 0 24 24">
|
|
23
23
|
<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"/>
|
|
24
|
-
</svg>`},Y={id:"swiper-responsive",label:"Responsive",icon:p.responsive},X={id:"swiper-extra",label:"Extra",icon:p.extra},ye={actions:{type:"radio",label:!1,labelToTitle:!0,options:[{id:"r",label:"Reload slider",icon:p.reload},{id:"p",label:"Previous slide",icon:p.prev},{id:"n",label:"Next slide",icon:p.next},{id:"a",label:"Add new slide",icon:p.add}],setValue:({component:e,value:l})=>{var o;const a=(o=e.getView())==null?void 0:o.getSwiper();switch(l){case"r":e.reloadSlider();break;case"p":a==null||a.slidePrev();break;case"n":a==null||a.slideNext();break;case"a":e.addSlide();break}}},vertical:{type:"checkbox",label:"Vertical",value:!1},loop:{type:"checkbox",label:"Loop",value:!1},freeMode:{type:"checkbox",label:"Free mode",value:!1},autoHeight:{type:"checkbox",label:"Auto height",value:!1},navigation:{type:"checkbox",label:"Navigation",getValue:({component:e})=>!!e.findFirstType(k),setValue:({component:e,value:l})=>{var a,o;l?e.append([{type:k},{type:I}]):((a=e.findFirstType(k))==null||a.remove(),(o=e.findFirstType(I))==null||o.remove()),e.set({navigation:l})}},initialSlide:{type:"number",label:"Initial slide",min:0,value:"0"},speed:{type:"number",label:"Speed",tip:"Transition duration (in ms)",step:500,min:0,value:300},effect:{category:{id:"swiper-effect",label:"Effects",icon:p.effect},type:"select",label:"Effect Type",value:"slide",options:[{id:"slide",label:"Slide"},{id:"fade",label:"Fade"},{id:"cube",label:"Cube"},{id:"coverflow",label:"Coverflow"},{id:"flip",label:"Flip"},{id:"cards",label:"Cards"}],subTraits:{slide:[{type:"number",name:"slidesPerView",label:"Slides per view",changeProp:!0,min:1,value:1},{type:"number",name:"slidesPerGroup",label:"Slides per group",tip:"Numbers of slides for group sliding",changeProp:!0,min:1,value:1},{type:"number",name:"spaceBetween",label:"Space between",tip:"Distance between slides in px",changeProp:!0,min:0,value:0},{type:"number",name:"slidesOffsetBefore",label:"Slides offset before",tip:"Add additional slide offset in the beginning of the container (in px, before all slides)",changeProp:!0,min:0,value:0},{type:"number",name:"slidesOffsetAfter",label:"Slides offset after",tip:"Add additional slide offset in the end of the container (in px, after all slides)",changeProp:!0,min:0,value:0},{type:"checkbox",name:"centeredSlides",label:"Centered slides",tip:"If enabled, the active slide will be centered",changeProp:!0,value:!1}],fade:[{type:"checkbox",name:"crossFade",tip:"Enables slides cross fade",label:"Cross fade",changeProp:!0,value:!1}],cube:[{type:"checkbox",name:"cubeEffectShadow",label:"Shadow",changeProp:!0,value:!0},{type:"checkbox",name:"cubeEffectSlideShadows",label:"Slide shadows",changeProp:!0,value:!0},{type:"number",name:"cubeEffectShadowOffset",label:"Shadow offset",changeProp:!0,value:20},{type:"number",name:"cubeEffectShadowScale",label:"Shadow scale",changeProp:!0,value:.94}],coverflow:[{type:"number",name:"coverflowEffectDepth",tip:"Depth offset in px (slides translate in Z axis)",label:"Depth",changeProp:!0,min:0,value:100},{type:"number",name:"coverflowEffectModifier",tip:"Effect multiplier",label:"Modifier",changeProp:!0,step:.1,min:0,value:1},{type:"number",name:"coverflowEffectRotate",tip:"Slide rotate in degrees",label:"Rotate",changeProp:!0,min:0,value:50},{type:"number",name:"coverflowEffectScale",tip:"Slide scale effect",label:"Scale",changeProp:!0,min:0,step:.1,value:1},{type:"number",name:"coverflowEffectStretch",tip:"Stretch space between slides (in px)",label:"Stretch",changeProp:!0,min:0,value:0},{type:"checkbox",name:"coverflowEffectSlideShadows",tip:"Enables slides shadows",label:"Slide shadow",changeProp:!0,value:!0}],flip:[{type:"checkbox",name:"flipEffectLimitRotation",tip:"Limit edge slides rotation",label:"Limit rotation",changeProp:!0,value:!0},{type:"checkbox",name:"flipEffectSlideShadows",tip:"Enables slides shadows",label:"Slide shadows",changeProp:!0,value:!0}],cards:[{type:"number",name:"cardsEffectPerSlideOffset",tip:"Offset distance per slide (in px)",label:"Slide offset",changeProp:!0,min:0,value:8},{type:"number",name:"cardsEffectPerSlideRotate",tip:"Rotate angle per slide (in degrees)",label:"Slide rotate",changeProp:!0,min:0,value:2},{type:"checkbox",name:"cardsEffectRotate",tip:"Enables cards rotation",label:"Rotate",changeProp:!0,value:!0},{type:"checkbox",name:"cardsEffectSlideShadows",tip:"Enables slides shadows",label:"Slide shadows",changeProp:!0,value:!0}]}},autoplay:{category:{id:"swiper-autoplay",label:"Autoplay",icon:p.autoplay},type:"checkbox",label:"Enable Autoplay",value:!1,subTraits:{true:[{type:"checkbox",name:"autoplayEditor",label:"Autoplay in editor",tip:"Allow autoplay to run while editing in the canvas. Note: this may make selecting and editing slides difficult as they will automatically change.",changeProp:!0,value:!1},{type:"number",name:"autoplayDelay",label:"Delay",changeProp:!0,value:3e3},{type:"checkbox",name:"autoplayDisableOnInteraction",label:"Disable on interaction",changeProp:!0,value:!0},{type:"checkbox",name:"autoplayWaitForTransition",label:"Wait for transition",changeProp:!0,value:!0},{type:"checkbox",name:"autoplayPauseOnMouseEnter",label:"Pause on mouse enter",changeProp:!0,value:!1},{type:"checkbox",name:"autoplayReverseDirection",label:"Reverse direction",changeProp:!0,value:!1},{type:"checkbox",name:"autoplayStopOnLastSlide",label:"Stop on last slide",changeProp:!0,value:!1}]}},pagination:{category:{id:"swiper-pagination",label:"Pagination",icon:p.pagination},type:"select",label:"Pagination Type",options:[{id:"none",label:"None"},{id:"bullets",label:"Bullets"},{id:"progressbar",label:"Progressbar"},{id:"fraction",label:"Fraction"}],getValue:({component:e})=>e.findFirstType(R)?e.get("pagination")||"bullets":"none",setValue:({component:e,value:l})=>{const a=e.findFirstType(R);a==null||a.remove(),l!=="none"&&e.append({type:R}),e.set({pagination:l})},subTraits:{bullets:[{type:"checkbox",name:"dynamicBullets",label:"Dynamic bullets",changeProp:!0,value:!1},{type:"checkbox",name:"clickableBullets",label:"Clickable bullets",changeProp:!0,value:!0}],progressbar:[{type:"checkbox",name:"progressbarOpposite",label:"Progress opposite",changeProp:!0,value:!1}]}},scrollbar:{category:{id:"swiper-scrollbar",label:"Scrollbar",icon:p.scrollbar},type:"checkbox",label:"Enable Scrollbar",getValue:({component:e})=>!!e.findFirstType(O),setValue:({component:e,value:l})=>{const a=e.findFirstType(O);a==null||a.remove(),l&&e.append({type:O}),e.set({scrollbar:l})},subTraits:{false:[],true:[{type:"checkbox",name:"scrollbarDraggable",label:"Draggable",changeProp:!0,value:!1},{type:"checkbox",name:"scrollbarHide",label:"Hide",tip:"Hide scrollbar automatically after user interaction",changeProp:!0,value:!0}]}},parallax:{category:{id:"swiper-parallax",label:"Parallax",icon:p.parallax},type:"checkbox",label:"Enable Parallax",value:!1},mobile:{category:Y,type:"checkbox",label:"Enable mobile breakpoint",value:!1,subTraits:{true:[{type:"number",name:"mobileBreakpoint",label:"Mobile breakpoint",tip:"Slide values below will be applied when the screen width is greater than this value",changeProp:!0,min:1,value:460},{type:"number",name:"mobileSlidesPerView",label:"Slides per view",changeProp:!0,min:1,value:1},{type:"number",name:"mobileSlidesPerGroup",label:"Slides per group",changeProp:!0,min:1,value:1},{type:"number",name:"mobileSpaceBetween",label:"Space between",changeProp:!0,min:0,value:0}]}},tablet:{category:Y,type:"checkbox",label:"Enable tablet breakpoint",value:!1,subTraits:{true:[{type:"number",name:"tabletBreakpoint",label:"Tablet breakpoint",tip:"Slide values below will be applied when the screen width is greater than this value",changeProp:!0,min:1,value:991},{type:"number",name:"tabletSlidesPerView",label:"Slides per view",changeProp:!0,min:1,value:1},{type:"number",name:"tabletSlidesPerGroup",label:"Slides per group",changeProp:!0,min:1,value:1},{type:"number",name:"tabletSpaceBetween",label:"Space between",changeProp:!0,min:0,value:0}]}},allowTouchMove:{category:X,type:"checkbox",label:"Allow touch move",tip:"Allow touch interactions",value:!0},grabCursor:{category:X,type:"checkbox",label:"Grab cursor",tip:'If enabled, the user will see the "grab" cursor when hover the slider',value:!1}},J="Slider",C="swiper",_=`${C}-`,we=(e,l)=>{const{Components:a,Blocks:o,Commands:s}=e,{block:f}=l,c=ge(ye),d="core:preview",u=s.events,b=function(t){const n=this,w=window,D=n.__onLoad,B=n.__activeSlide,G=n.__inPreview,W=w._isEditor&&!G?t.autoplayEditor:!0,{cdnScript:q,cdnStyle:z,slidesPerView:H}=t||{},r=m=>isNaN(m)?void 0:parseFloat(m),ae=()=>{const m=n.parentElement;m&&(m.style.minWidth="0");const E={loop:t.loop,speed:t.speed,initialSlide:t.initialSlide,direction:t.vertical?"vertical":"horizontal",effect:t.effect,freeMode:t.freeMode,parallax:t.parallax,autoHeight:t.autoHeight,allowTouchMove:t.allowTouchMove,grabCursor:t.grabCursor,simulateTouch:!0,breakpoints:{},slidesPerView:isNaN(H)?H:r(H),slidesPerGroup:r(t.slidesPerGroup),spaceBetween:r(t.spaceBetween),slidesOffsetBefore:r(t.slidesOffsetBefore),slidesOffsetAfter:r(t.slidesOffsetAfter),centeredSlides:t.centeredSlides,fadeEffect:{crossFade:t.crossFade},cubeEffect:{shadow:t.cubeEffectShadow,slideShadows:t.cubeEffectSlideShadows,shadowOffset:r(t.cubeEffectShadowOffset),shadowScale:r(t.cubeEffectShadowScale)},coverflowEffect:{depth:r(t.coverflowEffectDepth),modifier:r(t.coverflowEffectModifier),rotate:r(t.coverflowEffectRotate),scale:r(t.coverflowEffectScale),stretch:r(t.coverflowEffectStretch),slideShadows:t.coverflowEffectSlideShadows},flipEffect:{limitRotation:t.flipEffectLimitRotation,slideShadows:t.flipEffectSlideShadows},cardsEffect:{perSlideOffset:r(t.cardsEffectPerSlideOffset),perSlideRotate:r(t.cardsEffectPerSlideRotate),rotate:t.cardsEffectRotate,slideShadows:t.cardsEffectSlideShadows},navigation:{nextEl:n.querySelector(".swiper-button-next"),prevEl:n.querySelector(".swiper-button-prev")},pagination:{type:t.pagination||"bullets",dynamicBullets:t.dynamicBullets,clickable:t.clickableBullets,progressbarOpposite:t.progressbarOpposite,el:n.querySelector(".swiper-pagination")},scrollbar:{el:n.querySelector(".swiper-scrollbar"),draggable:t.scrollbarDraggable,hide:t.scrollbarHide},autoplay:t.autoplay&&W&&{delay:t.autoplayDelay,disableOnInteraction:t.autoplayDisableOnInteraction,pauseOnMouseEnter:t.autoplayPauseOnMouseEnter,reverseDirection:t.autoplayReverseDirection,stopOnLastSlide:t.autoplayStopOnLastSlide,waitForTransition:t.autoplayWaitForTransition}};if(t.tablet){const{tabletBreakpoint:N,tabletSlidesPerView:y}=t,v=r(N);E.breakpoints[v]={slidesPerView:isNaN(y)?y:r(y),slidesPerGroup:r(t.tabletSlidesPerGroup),spaceBetween:r(t.tabletSpaceBetween)}}if(t.mobile){const{mobileBreakpoint:N,mobileSlidesPerView:y}=t,v=r(N);E.breakpoints[v]={slidesPerView:isNaN(y)?y:r(y),slidesPerGroup:r(t.mobileSlidesPerGroup),spaceBetween:r(t.mobileSpaceBetween)}}D&&!G&&(E.simulateTouch=!1),B&&(E.initialSlide=B);const j=new w.Swiper(n,E);D==null||D(j)};if(w.Swiper)ae();else{const{head:m}=document,E=Array.isArray(q)?[...q]:[q],j=Array.isArray(z)?[...z]:[z],N=v=>{if(v.length){const S=document.createElement("link");S.href=v.shift(),S.rel="stylesheet",m.prepend(S),N(v)}},y=v=>{if(v.length){const S=document.createElement("script");S.src=v.shift(),S.onerror=S.onload=y.bind(null,v),m.appendChild(S)}else ae()};N(j),y(E)}},h=(t=0)=>({type:M,style:{padding:"50px"},components:{type:"text",components:{type:"textnode",content:`Slide ${t}`}}}),i=a.getType("default").model;return a.addType(g,{block:f&&{label:J,media:p.slider,category:"Extra",select:!0,...l.block},isComponent:t=>P(t,C),model:{defaults:()=>({name:J,icon:p.slider,classes:C,draggable:(t,n)=>!n.is(g),components:[{type:L,components:[h(1),h(2),h(3)]},{type:R}],script:b,cdnScript:l.cdnScript,cdnStyle:l.cdnStyle,"script-props":["cdnScript","cdnStyle",...c.propKeys],...c.props,traits:[...c.traits]}),init(){const{em:t}=this;he(this,c.traits),ve(this,c.propKeys),this.listenTo(t,`${u.runCommand}${d}`,this.onPreviewOn),this.listenTo(t,`${u.stopCommand}${d}`,this.onPreviewOff)},onPreviewOn(){this.__inPreview=!0,this.reloadSlider()},onPreviewOff(){this.__inPreview=!1,this.reloadSlider()},reloadSlider(){this.trigger("rerender")},addSlide(){const t=this.findFirstType(L);t==null||t.append(this.getNewSlideComponentDef())},getNewSlideComponentDef(){var n;const t=((n=this.findFirstType(L))==null?void 0:n.components().length)||0;return{type:M,components:{type:"text",components:{type:"textnode",content:`Slide ${t+1}`}}}},toJSON(...t){const n=i.prototype.toJSON.apply(this,t);return c.propsNoValues.forEach(w=>delete n[w]),delete n["script-props"],n}},view:{init(){this.listenTo(this.model,a.events.scriptUnmount,this.destroySwiper)},getSwiper(){return this.el.swiper},destroySwiper(){var t;(t=this.getSwiper())==null||t.destroy()},onRender(){const t=this.el;t.__onLoad=n=>n.on("slideChange",()=>this.__activeSlide=n.activeIndex),t.__activeSlide=this.__activeSlide,t.__inPreview=this.model.__inPreview}}}),()=>{a.removeType(g),o.remove(g)}},me="Nav Prev",Se="Nav Next",V=`${_}button-prev`,$=`${_}button-next`,Pe=e=>{const{Components:l}=e,a=o=>({type:"svg",selectable:!1,hoverable:!1,attributes:{viewBox:"0 0 27 44"},components:{type:"svg-in",tagName:"path",attributes:{d:o,fill:"currentColor"}}});return l.addType(k,{isComponent:o=>P(o,V),model:{defaults:{name:me,classes:V,copyable:!1,highlightable:!1,droppable:!1,draggable:!1,selectable:!1,hoverable:!1,layerable:!1,components:a("M0,22L22,0l2.1,2.1L4.2,22l19.9,19.9L22,44L0,22L0,22L0,22z"),styles:`
|
|
24
|
+
</svg>`},Y={id:"swiper-responsive",label:"Responsive",icon:p.responsive},X={id:"swiper-extra",label:"Extra",icon:p.extra},we={actions:{type:"radio",label:!1,labelToTitle:!0,options:[{id:"r",label:"Reload slider",icon:p.reload},{id:"p",label:"Previous slide",icon:p.prev},{id:"n",label:"Next slide",icon:p.next},{id:"a",label:"Add new slide",icon:p.add}],setValue:({component:e,value:l})=>{var o;const a=(o=e.getView())==null?void 0:o.getSwiper();switch(l){case"r":e.reloadSlider();break;case"p":a==null||a.slidePrev();break;case"n":a==null||a.slideNext();break;case"a":e.addSlide();break}}},vertical:{type:"checkbox",label:"Vertical",value:!1},loop:{type:"checkbox",label:"Loop",value:!1},freeMode:{type:"checkbox",label:"Free mode",value:!1},autoHeight:{type:"checkbox",label:"Auto height",value:!1},navigation:{type:"checkbox",label:"Navigation",getValue:({component:e})=>!!e.findFirstType(k),setValue:({component:e,value:l})=>{var a,o;l?e.append([{type:k},{type:I}]):((a=e.findFirstType(k))==null||a.remove(),(o=e.findFirstType(I))==null||o.remove()),e.set({navigation:l})}},initialSlide:{type:"number",label:"Initial slide",min:0,value:"0"},speed:{type:"number",label:"Speed",tip:"Transition duration (in ms)",step:500,min:0,value:300},effect:{category:{id:"swiper-effect",label:"Effects",icon:p.effect},type:"select",label:"Effect Type",value:"slide",options:[{id:"slide",label:"Slide"},{id:"fade",label:"Fade"},{id:"cube",label:"Cube"},{id:"coverflow",label:"Coverflow"},{id:"flip",label:"Flip"},{id:"cards",label:"Cards"}],subTraits:{slide:[{type:"number",name:"slidesPerView",label:"Slides per view",changeProp:!0,min:1,value:1},{type:"number",name:"slidesPerGroup",label:"Slides per group",tip:"Numbers of slides for group sliding",changeProp:!0,min:1,value:1},{type:"number",name:"spaceBetween",label:"Space between",tip:"Distance between slides in px",changeProp:!0,min:0,value:0},{type:"number",name:"slidesOffsetBefore",label:"Slides offset before",tip:"Add additional slide offset in the beginning of the container (in px, before all slides)",changeProp:!0,min:0,value:0},{type:"number",name:"slidesOffsetAfter",label:"Slides offset after",tip:"Add additional slide offset in the end of the container (in px, after all slides)",changeProp:!0,min:0,value:0},{type:"checkbox",name:"centeredSlides",label:"Centered slides",tip:"If enabled, the active slide will be centered",changeProp:!0,value:!1}],fade:[{type:"checkbox",name:"crossFade",tip:"Enables slides cross fade",label:"Cross fade",changeProp:!0,value:!1}],cube:[{type:"checkbox",name:"cubeEffectShadow",label:"Shadow",changeProp:!0,value:!0},{type:"checkbox",name:"cubeEffectSlideShadows",label:"Slide shadows",changeProp:!0,value:!0},{type:"number",name:"cubeEffectShadowOffset",label:"Shadow offset",changeProp:!0,value:20},{type:"number",name:"cubeEffectShadowScale",label:"Shadow scale",changeProp:!0,value:.94}],coverflow:[{type:"number",name:"coverflowEffectDepth",tip:"Depth offset in px (slides translate in Z axis)",label:"Depth",changeProp:!0,min:0,value:100},{type:"number",name:"coverflowEffectModifier",tip:"Effect multiplier",label:"Modifier",changeProp:!0,step:.1,min:0,value:1},{type:"number",name:"coverflowEffectRotate",tip:"Slide rotate in degrees",label:"Rotate",changeProp:!0,min:0,value:50},{type:"number",name:"coverflowEffectScale",tip:"Slide scale effect",label:"Scale",changeProp:!0,min:0,step:.1,value:1},{type:"number",name:"coverflowEffectStretch",tip:"Stretch space between slides (in px)",label:"Stretch",changeProp:!0,min:0,value:0},{type:"checkbox",name:"coverflowEffectSlideShadows",tip:"Enables slides shadows",label:"Slide shadow",changeProp:!0,value:!0}],flip:[{type:"checkbox",name:"flipEffectLimitRotation",tip:"Limit edge slides rotation",label:"Limit rotation",changeProp:!0,value:!0},{type:"checkbox",name:"flipEffectSlideShadows",tip:"Enables slides shadows",label:"Slide shadows",changeProp:!0,value:!0}],cards:[{type:"number",name:"cardsEffectPerSlideOffset",tip:"Offset distance per slide (in px)",label:"Slide offset",changeProp:!0,min:0,value:8},{type:"number",name:"cardsEffectPerSlideRotate",tip:"Rotate angle per slide (in degrees)",label:"Slide rotate",changeProp:!0,min:0,value:2},{type:"checkbox",name:"cardsEffectRotate",tip:"Enables cards rotation",label:"Rotate",changeProp:!0,value:!0},{type:"checkbox",name:"cardsEffectSlideShadows",tip:"Enables slides shadows",label:"Slide shadows",changeProp:!0,value:!0}]}},autoplay:{category:{id:"swiper-autoplay",label:"Autoplay",icon:p.autoplay},type:"checkbox",label:"Enable Autoplay",value:!1,subTraits:{true:[{type:"checkbox",name:"autoplayEditor",label:"Autoplay in editor",tip:"Allow autoplay to run while editing in the canvas. Note: this may make selecting and editing slides difficult as they will automatically change.",changeProp:!0,value:!1},{type:"number",name:"autoplayDelay",label:"Delay",changeProp:!0,value:3e3},{type:"checkbox",name:"autoplayDisableOnInteraction",label:"Disable on interaction",changeProp:!0,value:!0},{type:"checkbox",name:"autoplayWaitForTransition",label:"Wait for transition",changeProp:!0,value:!0},{type:"checkbox",name:"autoplayPauseOnMouseEnter",label:"Pause on mouse enter",changeProp:!0,value:!1},{type:"checkbox",name:"autoplayReverseDirection",label:"Reverse direction",changeProp:!0,value:!1},{type:"checkbox",name:"autoplayStopOnLastSlide",label:"Stop on last slide",changeProp:!0,value:!1}]}},pagination:{category:{id:"swiper-pagination",label:"Pagination",icon:p.pagination},type:"select",label:"Pagination Type",options:[{id:"none",label:"None"},{id:"bullets",label:"Bullets"},{id:"progressbar",label:"Progressbar"},{id:"fraction",label:"Fraction"}],getValue:({component:e})=>e.findFirstType(R)?e.get("pagination")||"bullets":"none",setValue:({component:e,value:l})=>{const a=e.findFirstType(R);a==null||a.remove(),l!=="none"&&e.append({type:R}),e.set({pagination:l})},subTraits:{bullets:[{type:"checkbox",name:"dynamicBullets",label:"Dynamic bullets",changeProp:!0,value:!1},{type:"checkbox",name:"clickableBullets",label:"Clickable bullets",changeProp:!0,value:!0}],progressbar:[{type:"checkbox",name:"progressbarOpposite",label:"Progress opposite",changeProp:!0,value:!1}]}},scrollbar:{category:{id:"swiper-scrollbar",label:"Scrollbar",icon:p.scrollbar},type:"checkbox",label:"Enable Scrollbar",getValue:({component:e})=>!!e.findFirstType(O),setValue:({component:e,value:l})=>{const a=e.findFirstType(O);a==null||a.remove(),l&&e.append({type:O}),e.set({scrollbar:l})},subTraits:{false:[],true:[{type:"checkbox",name:"scrollbarDraggable",label:"Draggable",changeProp:!0,value:!1},{type:"checkbox",name:"scrollbarHide",label:"Hide",tip:"Hide scrollbar automatically after user interaction",changeProp:!0,value:!0}]}},parallax:{category:{id:"swiper-parallax",label:"Parallax",icon:p.parallax},type:"checkbox",label:"Enable Parallax",value:!1},mobile:{category:Y,type:"checkbox",label:"Enable mobile breakpoint",value:!1,subTraits:{true:[{type:"number",name:"mobileBreakpoint",label:"Mobile breakpoint",tip:"Slide values below will be applied when the screen width is greater than this value",changeProp:!0,min:1,value:460},{type:"number",name:"mobileSlidesPerView",label:"Slides per view",changeProp:!0,min:1,value:1},{type:"number",name:"mobileSlidesPerGroup",label:"Slides per group",changeProp:!0,min:1,value:1},{type:"number",name:"mobileSpaceBetween",label:"Space between",changeProp:!0,min:0,value:0}]}},tablet:{category:Y,type:"checkbox",label:"Enable tablet breakpoint",value:!1,subTraits:{true:[{type:"number",name:"tabletBreakpoint",label:"Tablet breakpoint",tip:"Slide values below will be applied when the screen width is greater than this value",changeProp:!0,min:1,value:991},{type:"number",name:"tabletSlidesPerView",label:"Slides per view",changeProp:!0,min:1,value:1},{type:"number",name:"tabletSlidesPerGroup",label:"Slides per group",changeProp:!0,min:1,value:1},{type:"number",name:"tabletSpaceBetween",label:"Space between",changeProp:!0,min:0,value:0}]}},allowTouchMove:{category:X,type:"checkbox",label:"Allow touch move",tip:"Allow touch interactions",value:!0},grabCursor:{category:X,type:"checkbox",label:"Grab cursor",tip:'If enabled, the user will see the "grab" cursor when hover the slider',value:!1}},J="Slider",C="swiper",_=`${C}-`,me=(e,l)=>{const{Components:a,Blocks:o,Commands:s}=e,{block:f}=l,c=he(we),d="core:preview",u=s.events,b=function(t){const n=this,w=window,D=n.__onLoad,B=n.__activeSlide,G=n.__inPreview,W=w._isEditor&&!G?t.autoplayEditor:!0,{cdnScript:q,cdnStyle:z,slidesPerView:H}=t||{},r=m=>isNaN(m)?void 0:parseFloat(m),ae=()=>{const m=n.parentElement;m&&(m.style.minWidth="0");const E={loop:t.loop,speed:t.speed,initialSlide:t.initialSlide,direction:t.vertical?"vertical":"horizontal",effect:t.effect,freeMode:t.freeMode,parallax:t.parallax,autoHeight:t.autoHeight,allowTouchMove:t.allowTouchMove,grabCursor:t.grabCursor,simulateTouch:!0,breakpoints:{},slidesPerView:isNaN(H)?H:r(H),slidesPerGroup:r(t.slidesPerGroup),spaceBetween:r(t.spaceBetween),slidesOffsetBefore:r(t.slidesOffsetBefore),slidesOffsetAfter:r(t.slidesOffsetAfter),centeredSlides:t.centeredSlides,fadeEffect:{crossFade:t.crossFade},cubeEffect:{shadow:t.cubeEffectShadow,slideShadows:t.cubeEffectSlideShadows,shadowOffset:r(t.cubeEffectShadowOffset),shadowScale:r(t.cubeEffectShadowScale)},coverflowEffect:{depth:r(t.coverflowEffectDepth),modifier:r(t.coverflowEffectModifier),rotate:r(t.coverflowEffectRotate),scale:r(t.coverflowEffectScale),stretch:r(t.coverflowEffectStretch),slideShadows:t.coverflowEffectSlideShadows},flipEffect:{limitRotation:t.flipEffectLimitRotation,slideShadows:t.flipEffectSlideShadows},cardsEffect:{perSlideOffset:r(t.cardsEffectPerSlideOffset),perSlideRotate:r(t.cardsEffectPerSlideRotate),rotate:t.cardsEffectRotate,slideShadows:t.cardsEffectSlideShadows},navigation:{nextEl:n.querySelector(".swiper-button-next"),prevEl:n.querySelector(".swiper-button-prev")},pagination:{type:t.pagination||"bullets",dynamicBullets:t.dynamicBullets,clickable:t.clickableBullets,progressbarOpposite:t.progressbarOpposite,el:n.querySelector(".swiper-pagination")},scrollbar:{el:n.querySelector(".swiper-scrollbar"),draggable:t.scrollbarDraggable,hide:t.scrollbarHide},autoplay:t.autoplay&&W&&{delay:t.autoplayDelay,disableOnInteraction:t.autoplayDisableOnInteraction,pauseOnMouseEnter:t.autoplayPauseOnMouseEnter,reverseDirection:t.autoplayReverseDirection,stopOnLastSlide:t.autoplayStopOnLastSlide,waitForTransition:t.autoplayWaitForTransition}};if(t.tablet){const{tabletBreakpoint:N,tabletSlidesPerView:y}=t,v=r(N);E.breakpoints[v]={slidesPerView:isNaN(y)?y:r(y),slidesPerGroup:r(t.tabletSlidesPerGroup),spaceBetween:r(t.tabletSpaceBetween)}}if(t.mobile){const{mobileBreakpoint:N,mobileSlidesPerView:y}=t,v=r(N);E.breakpoints[v]={slidesPerView:isNaN(y)?y:r(y),slidesPerGroup:r(t.mobileSlidesPerGroup),spaceBetween:r(t.mobileSpaceBetween)}}D&&!G&&(E.simulateTouch=!1),B&&(E.initialSlide=B);const j=new w.Swiper(n,E);D==null||D(j)};if(w.Swiper)ae();else{const{head:m}=document,E=Array.isArray(q)?[...q]:[q],j=Array.isArray(z)?[...z]:[z],N=v=>{if(v.length){const S=document.createElement("link");S.href=v.shift(),S.rel="stylesheet",m.prepend(S),N(v)}},y=v=>{if(v.length){const S=document.createElement("script");S.src=v.shift(),S.onerror=S.onload=y.bind(null,v),m.appendChild(S)}else ae()};N(j),y(E)}},h=(t=0)=>({type:M,style:{padding:"50px"},components:{type:"text",components:{type:"textnode",content:`Slide ${t}`}}}),i=a.getType("default").model;return a.addType(g,{block:f&&{label:J,media:p.slider,category:"Extra",select:!0,...l.block},isComponent:t=>P(t,C),model:{defaults:()=>({name:J,icon:p.slider,classes:C,draggable:(t,n)=>!n.is(g),components:[{type:L,components:[h(1),h(2),h(3)]},{type:R}],script:b,cdnScript:l.cdnScript,cdnStyle:l.cdnStyle,"script-props":["cdnScript","cdnStyle",...c.propKeys],...c.props,traits:[...c.traits]}),init(){const{em:t}=this;ve(this,c.traits),ye(this,c.propKeys),this.listenTo(t,`${u.runCommand}${d}`,this.onPreviewOn),this.listenTo(t,`${u.stopCommand}${d}`,this.onPreviewOff)},onPreviewOn(){this.__inPreview=!0,this.reloadSlider()},onPreviewOff(){this.__inPreview=!1,this.reloadSlider()},reloadSlider(){this.trigger("rerender")},addSlide(){const t=this.findFirstType(L);t==null||t.append(this.getNewSlideComponentDef())},getNewSlideComponentDef(){var n;const t=((n=this.findFirstType(L))==null?void 0:n.components().length)||0;return{type:M,components:{type:"text",components:{type:"textnode",content:`Slide ${t+1}`}}}},toJSON(...t){const n=i.prototype.toJSON.apply(this,t);return c.propsNoValues.forEach(w=>delete n[w]),delete n["script-props"],n}},view:{init(){this.listenTo(this.model,a.events.scriptUnmount,this.destroySwiper)},getSwiper(){return this.el.swiper},destroySwiper(){var t;(t=this.getSwiper())==null||t.destroy()},onRender(){const t=this.el;t.__onLoad=n=>n.on("slideChange",()=>this.__activeSlide=n.activeIndex),t.__activeSlide=this.__activeSlide,t.__inPreview=this.model.__inPreview}}}),()=>{a.removeType(g),o.remove(g)}},Se="Nav Prev",Pe="Nav Next",V=`${_}button-prev`,$=`${_}button-next`,Ee=e=>{const{Components:l}=e,a=o=>({type:"svg",selectable:!1,hoverable:!1,attributes:{viewBox:"0 0 27 44"},components:{type:"svg-in",tagName:"path",attributes:{d:o,fill:"currentColor"}}});return l.addType(k,{isComponent:o=>P(o,V),model:{defaults:{name:Se,classes:V,copyable:!1,highlightable:!1,droppable:!1,draggable:!1,selectable:!1,hoverable:!1,layerable:!1,components:a("M0,22L22,0l2.1,2.1L4.2,22l19.9,19.9L22,44L0,22L0,22L0,22z"),styles:`
|
|
25
25
|
.${V} {
|
|
26
26
|
color: inherit;
|
|
27
27
|
}
|
|
28
28
|
.${V}:after {
|
|
29
29
|
content: none;
|
|
30
30
|
}
|
|
31
|
-
`}}}),l.addType(I,{extend:k,isComponent:o=>P(o,$),model:{defaults:{name:
|
|
31
|
+
`}}}),l.addType(I,{extend:k,isComponent:o=>P(o,$),model:{defaults:{name:Pe,classes:$,components:a("M27,22L27,22L5,44l-2.1-2.1L22.8,22L2.9,2.1L5,0L27,22L27,22z"),styles:`
|
|
32
32
|
.${$} {
|
|
33
33
|
color: inherit;
|
|
34
34
|
}
|
|
35
35
|
.${$}:after {
|
|
36
36
|
content: none;
|
|
37
37
|
}
|
|
38
|
-
`}}}),()=>{l.removeType(k),l.removeType(I)}},
|
|
38
|
+
`}}}),()=>{l.removeType(k),l.removeType(I)}},Te=e=>{const{Components:l}=e,a=`${_}pagination`;return l.addType(R,{isComponent:o=>P(o,a),model:{defaults:{name:"Pagination",classes:a,copyable:!1,highlightable:!1,droppable:!1,draggable:!1,selectable:!1,hoverable:!1,layerable:!1,styles:`
|
|
39
39
|
.${a}-bullet-active {
|
|
40
40
|
background-color: currentColor;
|
|
41
41
|
}
|
|
42
42
|
.${a}-progressbar-fill {
|
|
43
43
|
--swiper-pagination-color: currentColor;
|
|
44
44
|
}
|
|
45
|
-
`}}}),()=>{l.removeType(R)}},
|
|
45
|
+
`}}}),()=>{l.removeType(R)}},xe="Scrollbar",Q=`${_}scrollbar`,Ae=e=>{const{Components:l}=e;return l.addType(O,{isComponent:a=>P(a,Q),model:{defaults:{name:xe,classes:Q,copyable:!1,highlightable:!1,removable:!1,selectable:!1,hoverable:!1,layerable:!1,droppable:!1,draggable:!1}}}),()=>{l.removeType(O)}},Le="Slide",ee=`${_}slide`,ke=e=>{const{Components:l}=e;return l.addType(M,{isComponent:a=>P(a,ee),model:{defaults:{name:Le,classes:ee,icon:p.slider,draggable:(a,o)=>o.is(L)}}}),()=>{l.removeType(M)}},Re="Wrapper",te=`${_}wrapper`,_e=e=>{const{Components:l}=e,{events:a}=l;return l.addType(L,{isComponent:o=>P(o,te),model:{defaults:{name:Re,icon:p.slider,classes:te,copyable:!1,removable:!1,draggable:!1,highlightable:!1,droppable:o=>o.is(M)},init(){const o=this.components();this.listenTo(o,"add remove",this.updateSlider)},updateSlider(o){const s=this.closestType(g);if(s){const f=s.getView();s.reloadSlider(),this.em.once(a.scriptMount,()=>{setTimeout(()=>{var c;return(c=f.getSwiper())==null?void 0:c.slideTo(o.index())},100)})}}}}),()=>{l.removeType(L)}},Ne="swiperComponent",Me=A.startup;return ue(function(e,l={}){const a={block:{},cdnScript:"https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.js",cdnStyle:"https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css",...l},o=[me(e,a),Ee(e),_e(e),ke(e),Te(e),Ae(e)];be({editor:e,plan:Me,licenseKey:a.licenseKey,pluginName:Ne,cleanup:()=>{o.forEach(s=>s())}})})});
|