@grapesjs/studio-sdk-plugins 1.0.35 → 1.0.36
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 +175 -162
- package/dist/accordionComponent/index.umd.js +7 -7
- package/dist/aiChat/index.cjs.js +64 -64
- package/dist/aiChat/index.es.js +5785 -5757
- package/dist/aiChat/index.js +64 -64
- package/dist/aiChat/index.umd.js +63 -63
- package/dist/animationComponent/index.cjs.js +3 -3
- package/dist/animationComponent/index.es.js +204 -191
- package/dist/animationComponent/index.umd.js +3 -3
- package/dist/canvasAbsoluteMode/index.cjs.js +1 -1
- package/dist/canvasAbsoluteMode/index.es.js +183 -170
- package/dist/canvasAbsoluteMode/index.umd.js +1 -1
- package/dist/canvasEmptyState/index.cjs.js +1 -1
- package/dist/canvasEmptyState/index.es.js +134 -121
- package/dist/canvasEmptyState/index.umd.js +1 -1
- package/dist/canvasFullSize/index.cjs.js +9 -9
- package/dist/canvasFullSize/index.es.js +165 -152
- package/dist/canvasFullSize/index.umd.js +9 -9
- package/dist/canvasGridMode/index.cjs.js +5 -5
- package/dist/canvasGridMode/index.es.js +245 -232
- package/dist/canvasGridMode/index.umd.js +4 -4
- package/dist/canvasScreenshot/index.cjs.js +1 -1
- package/dist/canvasScreenshot/index.es.js +155 -142
- package/dist/canvasScreenshot/index.umd.js +1 -1
- package/dist/dataSourceEjs/index.cjs.js +9 -9
- package/dist/dataSourceEjs/index.es.js +257 -244
- package/dist/dataSourceEjs/index.umd.js +9 -9
- package/dist/dataSourceHandlebars/index.cjs.js +8 -8
- package/dist/dataSourceHandlebars/index.es.js +216 -203
- package/dist/dataSourceHandlebars/index.umd.js +7 -7
- package/dist/dialogComponent/index.cjs.js +14 -14
- package/dist/dialogComponent/index.es.js +141 -128
- package/dist/dialogComponent/index.umd.js +14 -14
- package/dist/flexComponent/index.cjs.js +13 -13
- package/dist/flexComponent/index.es.js +484 -471
- package/dist/flexComponent/index.umd.js +13 -13
- package/dist/fsLightboxComponent/index.cjs.js +3 -3
- package/dist/fsLightboxComponent/index.es.js +173 -160
- package/dist/fsLightboxComponent/index.umd.js +3 -3
- package/dist/googleFontsAssetProvider/index.cjs.js +1 -1
- package/dist/googleFontsAssetProvider/index.es.js +160 -147
- package/dist/googleFontsAssetProvider/index.umd.js +1 -1
- package/dist/iconifyComponent/index.cjs.js +2 -2
- package/dist/iconifyComponent/index.es.js +196 -183
- package/dist/iconifyComponent/index.umd.js +2 -2
- package/dist/index.cjs.js +25 -25
- package/dist/index.es.js +121 -108
- package/dist/index.umd.js +18 -18
- package/dist/layoutSidebarButtons/index.cjs.js +1 -1
- package/dist/layoutSidebarButtons/index.es.js +157 -144
- package/dist/layoutSidebarButtons/index.umd.js +1 -1
- package/dist/lightGalleryComponent/index.cjs.js +1 -1
- package/dist/lightGalleryComponent/index.es.js +245 -232
- package/dist/lightGalleryComponent/index.umd.js +1 -1
- package/dist/linkImageComponent/index.cjs.js +2 -2
- package/dist/linkImageComponent/index.es.js +106 -93
- package/dist/linkImageComponent/index.umd.js +2 -2
- package/dist/listPagesComponent/index.cjs.js +5 -5
- package/dist/listPagesComponent/index.es.js +157 -144
- package/dist/listPagesComponent/index.umd.js +5 -5
- package/dist/presetPrintable/index.cjs.js +3 -3
- package/dist/presetPrintable/index.es.js +181 -168
- package/dist/presetPrintable/index.umd.js +3 -3
- package/dist/prosemirror/index.cjs.js +7 -7
- package/dist/prosemirror/index.es.js +385 -372
- package/dist/prosemirror/index.umd.js +8 -8
- package/dist/rendererReact/index.cjs.js +1 -1
- package/dist/rendererReact/index.es.js +200 -187
- 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 +118 -105
- package/dist/rteTinyMce/index.umd.js +2 -2
- package/dist/shapeDividerComponent/index.cjs.js +4 -4
- package/dist/shapeDividerComponent/index.es.js +129 -116
- package/dist/shapeDividerComponent/index.umd.js +4 -4
- package/dist/swiperComponent/index.cjs.js +9 -9
- package/dist/swiperComponent/index.es.js +203 -190
- package/dist/swiperComponent/index.umd.js +7 -7
- package/dist/tableComponent/index.cjs.js +1 -1
- package/dist/tableComponent/index.es.js +257 -244
- package/dist/tableComponent/index.umd.js +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/youtubeAssetProvider/index.cjs.js +1 -1
- package/dist/youtubeAssetProvider/index.es.js +121 -108
- package/dist/youtubeAssetProvider/index.umd.js +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const
|
|
2
|
-
ee,
|
|
3
|
-
ae,
|
|
1
|
+
const te = "app.grapesjs.com", ae = "app-stage.grapesjs.com", le = "app2.grapesjs.com", se = "app-stage2.grapesjs.com", U = [
|
|
4
2
|
te,
|
|
5
3
|
le,
|
|
4
|
+
ae,
|
|
5
|
+
se,
|
|
6
6
|
"localhost",
|
|
7
7
|
"127.0.0.1",
|
|
8
8
|
".local-credentialless.webcontainer.io",
|
|
@@ -11,37 +11,37 @@ const ee = "app.grapesjs.com", te = "app-stage.grapesjs.com", ae = "app2.grapesj
|
|
|
11
11
|
// For stackblitz.com demos
|
|
12
12
|
"-sandpack.codesandbox.io"
|
|
13
13
|
// For Sandpack demos
|
|
14
|
-
],
|
|
14
|
+
], oe = "license:check:end", ie = () => typeof window < "u", ne = ({
|
|
15
15
|
isDev: e,
|
|
16
16
|
isStage: l,
|
|
17
17
|
isPlatform: a
|
|
18
|
-
}) => `${e ? "" : `https://${l ?
|
|
19
|
-
const e =
|
|
20
|
-
return !!e && (
|
|
18
|
+
}) => `${e ? "" : `https://${l ? ae : te}`}/${a ? "platform-api" : "api"}`, re = () => {
|
|
19
|
+
const e = ie() && window.location.hostname;
|
|
20
|
+
return !!e && (U.includes(e) || U.some((l) => e.endsWith(l)));
|
|
21
21
|
}, ce = (e) => e.replace(/[A-Z]+(?![a-z])|[A-Z]/g, (l, a) => (a ? "-" : "") + l.toLowerCase()), de = (e) => typeof e < "u";
|
|
22
22
|
async function pe({
|
|
23
23
|
path: e,
|
|
24
24
|
baseApiUrl: l,
|
|
25
25
|
method: a = "GET",
|
|
26
|
-
headers:
|
|
27
|
-
params:
|
|
26
|
+
headers: s = {},
|
|
27
|
+
params: o,
|
|
28
28
|
body: f
|
|
29
29
|
}) {
|
|
30
|
-
const
|
|
30
|
+
const d = `${l || ne({ isDev: !1, isStage: !1 })}${e}`, p = {
|
|
31
31
|
method: a,
|
|
32
32
|
headers: {
|
|
33
33
|
"Content-Type": "application/json",
|
|
34
|
-
...
|
|
34
|
+
...s
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
|
-
f && (
|
|
38
|
-
const
|
|
39
|
-
if (!
|
|
40
|
-
throw new Error(`HTTP error! status: ${
|
|
41
|
-
return
|
|
37
|
+
f && (p.body = JSON.stringify(f));
|
|
38
|
+
const b = o ? new URLSearchParams(o).toString() : "", g = b ? `?${b}` : "", i = await fetch(`${d}${g}`, p);
|
|
39
|
+
if (!i.ok)
|
|
40
|
+
throw new Error(`HTTP error! status: ${i.status}`);
|
|
41
|
+
return i.json();
|
|
42
42
|
}
|
|
43
|
-
var x = /* @__PURE__ */ ((e) => (e.free = "free", e.startup = "startup", e.business = "business", e.enterprise = "enterprise", e))(x || {});
|
|
44
|
-
const
|
|
43
|
+
var x = /* @__PURE__ */ ((e) => (e.free = "free", e.startup = "startup", e.business = "business", e.enterprise = "enterprise", e))(x || {}), q = /* @__PURE__ */ ((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))(q || {});
|
|
44
|
+
const j = {
|
|
45
45
|
[x.free]: 0,
|
|
46
46
|
[x.startup]: 10,
|
|
47
47
|
[x.business]: 20,
|
|
@@ -49,50 +49,63 @@ const U = {
|
|
|
49
49
|
};
|
|
50
50
|
function ue(e) {
|
|
51
51
|
const l = e;
|
|
52
|
-
return l.init = (a) => (
|
|
52
|
+
return l.init = (a) => (s) => e(s, a), l;
|
|
53
53
|
}
|
|
54
54
|
const be = (e) => /* @__PURE__ */ ue(e);
|
|
55
55
|
async function fe({
|
|
56
56
|
editor: e,
|
|
57
57
|
plan: l,
|
|
58
58
|
pluginName: a,
|
|
59
|
-
licenseKey:
|
|
60
|
-
onLicenseCheckResponse:
|
|
59
|
+
licenseKey: s,
|
|
60
|
+
onLicenseCheckResponse: o,
|
|
61
61
|
cleanup: f
|
|
62
62
|
}) {
|
|
63
|
-
let c = "",
|
|
64
|
-
const
|
|
65
|
-
console.warn("Cleanup plugin:", a, "Reason:",
|
|
66
|
-
},
|
|
67
|
-
var
|
|
68
|
-
const { error: t, sdkLicense:
|
|
69
|
-
if (!(
|
|
70
|
-
|
|
71
|
-
else if (
|
|
72
|
-
const B =
|
|
73
|
-
B >
|
|
63
|
+
let c = "", d;
|
|
64
|
+
const p = (i) => {
|
|
65
|
+
console.warn("Cleanup plugin:", a, "Reason:", i), f();
|
|
66
|
+
}, b = (i = {}) => {
|
|
67
|
+
var _;
|
|
68
|
+
const { error: t, sdkLicense: n } = i, w = (_ = i.plan) == null ? void 0 : _.category;
|
|
69
|
+
if (!(n || i.license) || t)
|
|
70
|
+
p(t || "Invalid license");
|
|
71
|
+
else if (w) {
|
|
72
|
+
const B = j[l], $ = j[w];
|
|
73
|
+
B > $ && p({ pluginRequiredPlan: l, licensePlan: w });
|
|
74
74
|
}
|
|
75
75
|
};
|
|
76
|
-
e.
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
if (
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
|
|
76
|
+
e.Commands.has(q.settings) && (d = e.runCommand(q.settings), c = (d == null ? void 0 : d.baseUrl) || "");
|
|
77
|
+
const g = (i) => {
|
|
78
|
+
o == null || o(i), i && b(i);
|
|
79
|
+
};
|
|
80
|
+
if (!d) {
|
|
81
|
+
e.onReady(async () => {
|
|
82
|
+
if (!re())
|
|
83
|
+
if (s) {
|
|
84
|
+
const i = await he({ licenseKey: s, pluginName: a, baseApiUrl: c });
|
|
85
|
+
g(i);
|
|
86
|
+
} else
|
|
87
|
+
p("The `licenseKey` option not provided");
|
|
88
|
+
});
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
if (d.licensePlan || d.licenseError) {
|
|
92
|
+
const i = ge(d);
|
|
93
|
+
g(i);
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
e.on(oe, (i) => g(i));
|
|
90
97
|
}
|
|
98
|
+
const ge = (e) => ({
|
|
99
|
+
sdkLicense: e.license,
|
|
100
|
+
license: e.license,
|
|
101
|
+
error: e.licenseError,
|
|
102
|
+
plan: e.licensePlan
|
|
103
|
+
});
|
|
91
104
|
async function he(e) {
|
|
92
|
-
const { licenseKey: l, pluginName: a, baseApiUrl:
|
|
105
|
+
const { licenseKey: l, pluginName: a, baseApiUrl: s } = e;
|
|
93
106
|
try {
|
|
94
107
|
return (await pe({
|
|
95
|
-
baseApiUrl:
|
|
108
|
+
baseApiUrl: s,
|
|
96
109
|
path: `/sdk/${l || "na"}`,
|
|
97
110
|
method: "POST",
|
|
98
111
|
params: {
|
|
@@ -100,8 +113,8 @@ async function he(e) {
|
|
|
100
113
|
pn: a
|
|
101
114
|
}
|
|
102
115
|
})).result || {};
|
|
103
|
-
} catch (
|
|
104
|
-
return console.error("Error during SDK license check:",
|
|
116
|
+
} catch (o) {
|
|
117
|
+
return console.error("Error during SDK license check:", o), !1;
|
|
105
118
|
}
|
|
106
119
|
}
|
|
107
120
|
const E = (e, l) => {
|
|
@@ -109,44 +122,44 @@ const E = (e, l) => {
|
|
|
109
122
|
return !!((a = e == null ? void 0 : e.classList) != null && a.contains(l));
|
|
110
123
|
}, ve = (e, l = {}) => {
|
|
111
124
|
var f;
|
|
112
|
-
const a = {},
|
|
125
|
+
const a = {}, s = [], o = [];
|
|
113
126
|
for (const c in e) {
|
|
114
|
-
const { value:
|
|
115
|
-
|
|
116
|
-
const { subTraits:
|
|
117
|
-
for (const
|
|
118
|
-
(f =
|
|
119
|
-
const t =
|
|
120
|
-
a[t] =
|
|
127
|
+
const { value: d, ...p } = e[c];
|
|
128
|
+
s.push({ id: c, name: c, changeProp: !0, category: l.category, ...p }), a[c] = d, !de(d) && o.push(c);
|
|
129
|
+
const { subTraits: b = {} } = p;
|
|
130
|
+
for (const g in p.subTraits)
|
|
131
|
+
(f = b[g]) == null || f.forEach((i) => {
|
|
132
|
+
const t = i.id || i.name;
|
|
133
|
+
a[t] = i.value;
|
|
121
134
|
});
|
|
122
135
|
}
|
|
123
136
|
return {
|
|
124
137
|
propKeys: Object.keys(a),
|
|
125
|
-
propsNoValues:
|
|
138
|
+
propsNoValues: o,
|
|
126
139
|
props: a,
|
|
127
|
-
traits:
|
|
140
|
+
traits: s
|
|
128
141
|
};
|
|
129
|
-
},
|
|
142
|
+
}, ye = (e, l) => {
|
|
130
143
|
l.forEach((a) => {
|
|
131
144
|
if (a.subTraits) {
|
|
132
|
-
const
|
|
133
|
-
e.on(
|
|
145
|
+
const s = `${a.id || a.name}`, o = a.changeProp ? `change:${s}` : `change:attributes:${s}`;
|
|
146
|
+
e.on(o, () => Z(e, s)), Z(e, s);
|
|
134
147
|
}
|
|
135
148
|
});
|
|
136
|
-
},
|
|
137
|
-
const a = e.getTrait(l),
|
|
149
|
+
}, Z = (e, l) => {
|
|
150
|
+
const a = e.getTrait(l), s = a.get("category"), o = a.get("subTraits") || {}, c = (Object.values(o).flat() || []).map((b) => b.id || b.name);
|
|
138
151
|
e.removeTrait(c);
|
|
139
|
-
const
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
{ at:
|
|
152
|
+
const d = o[a.getValue()], p = e.getTraitIndex(l) + 1;
|
|
153
|
+
d && e.addTrait(
|
|
154
|
+
d.map((b) => ({ category: s, ...b })),
|
|
155
|
+
{ at: p }
|
|
143
156
|
);
|
|
144
|
-
},
|
|
157
|
+
}, we = (e, l) => {
|
|
145
158
|
l.forEach((a) => {
|
|
146
|
-
const
|
|
147
|
-
|
|
159
|
+
const s = ce(a);
|
|
160
|
+
s !== a && e.has(s) && e.set({ [a]: e.get(s), [s]: void 0 });
|
|
148
161
|
});
|
|
149
|
-
}, v = "swiper", O = `${v}-slide`,
|
|
162
|
+
}, v = "swiper", O = `${v}-slide`, L = `${v}-wrapper`, A = `${v}-nav-prev`, I = `${v}-nav-next`, k = `${v}-pagination`, M = `${v}-scrollbar`, u = {
|
|
150
163
|
slider: `<svg viewBox="0 0 24 24">
|
|
151
164
|
<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"/>
|
|
152
165
|
<path d="M4 12.5L6 14v-3zM20 12.5L18 14v-3z"/>
|
|
@@ -182,20 +195,20 @@ const E = (e, l) => {
|
|
|
182
195
|
add: `<svg viewBox="0 0 24 24">
|
|
183
196
|
<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"/>
|
|
184
197
|
</svg>`
|
|
185
|
-
}, K = { id: "swiper-responsive", label: "Responsive", icon:
|
|
198
|
+
}, K = { id: "swiper-responsive", label: "Responsive", icon: u.responsive }, Y = { id: "swiper-extra", label: "Extra", icon: u.extra }, me = {
|
|
186
199
|
actions: {
|
|
187
200
|
type: "radio",
|
|
188
201
|
label: !1,
|
|
189
202
|
labelToTitle: !0,
|
|
190
203
|
options: [
|
|
191
|
-
{ id: "r", label: "Reload slider", icon:
|
|
192
|
-
{ id: "p", label: "Previous slide", icon:
|
|
193
|
-
{ id: "n", label: "Next slide", icon:
|
|
194
|
-
{ id: "a", label: "Add new slide", icon:
|
|
204
|
+
{ id: "r", label: "Reload slider", icon: u.reload },
|
|
205
|
+
{ id: "p", label: "Previous slide", icon: u.prev },
|
|
206
|
+
{ id: "n", label: "Next slide", icon: u.next },
|
|
207
|
+
{ id: "a", label: "Add new slide", icon: u.add }
|
|
195
208
|
],
|
|
196
209
|
setValue: ({ component: e, value: l }) => {
|
|
197
|
-
var
|
|
198
|
-
const a = (
|
|
210
|
+
var s;
|
|
211
|
+
const a = (s = e.getView()) == null ? void 0 : s.getSwiper();
|
|
199
212
|
switch (l) {
|
|
200
213
|
case "r":
|
|
201
214
|
e.reloadSlider();
|
|
@@ -235,10 +248,10 @@ const E = (e, l) => {
|
|
|
235
248
|
navigation: {
|
|
236
249
|
type: "checkbox",
|
|
237
250
|
label: "Navigation",
|
|
238
|
-
getValue: ({ component: e }) => !!e.findFirstType(
|
|
251
|
+
getValue: ({ component: e }) => !!e.findFirstType(A),
|
|
239
252
|
setValue: ({ component: e, value: l }) => {
|
|
240
|
-
var a,
|
|
241
|
-
l ? e.append([{ type:
|
|
253
|
+
var a, s;
|
|
254
|
+
l ? e.append([{ type: A }, { type: I }]) : ((a = e.findFirstType(A)) == null || a.remove(), (s = e.findFirstType(I)) == null || s.remove()), e.set({ navigation: l });
|
|
242
255
|
}
|
|
243
256
|
},
|
|
244
257
|
initialSlide: {
|
|
@@ -256,7 +269,7 @@ const E = (e, l) => {
|
|
|
256
269
|
value: 300
|
|
257
270
|
},
|
|
258
271
|
effect: {
|
|
259
|
-
category: { id: "swiper-effect", label: "Effects", icon:
|
|
272
|
+
category: { id: "swiper-effect", label: "Effects", icon: u.effect },
|
|
260
273
|
type: "select",
|
|
261
274
|
label: "Effect Type",
|
|
262
275
|
value: "slide",
|
|
@@ -477,7 +490,7 @@ const E = (e, l) => {
|
|
|
477
490
|
}
|
|
478
491
|
},
|
|
479
492
|
autoplay: {
|
|
480
|
-
category: { id: "swiper-autoplay", label: "Autoplay", icon:
|
|
493
|
+
category: { id: "swiper-autoplay", label: "Autoplay", icon: u.autoplay },
|
|
481
494
|
type: "checkbox",
|
|
482
495
|
label: "Enable Autoplay",
|
|
483
496
|
value: !1,
|
|
@@ -537,7 +550,7 @@ const E = (e, l) => {
|
|
|
537
550
|
}
|
|
538
551
|
},
|
|
539
552
|
pagination: {
|
|
540
|
-
category: { id: "swiper-pagination", label: "Pagination", icon:
|
|
553
|
+
category: { id: "swiper-pagination", label: "Pagination", icon: u.pagination },
|
|
541
554
|
type: "select",
|
|
542
555
|
label: "Pagination Type",
|
|
543
556
|
options: [
|
|
@@ -580,7 +593,7 @@ const E = (e, l) => {
|
|
|
580
593
|
}
|
|
581
594
|
},
|
|
582
595
|
scrollbar: {
|
|
583
|
-
category: { id: "swiper-scrollbar", label: "Scrollbar", icon:
|
|
596
|
+
category: { id: "swiper-scrollbar", label: "Scrollbar", icon: u.scrollbar },
|
|
584
597
|
type: "checkbox",
|
|
585
598
|
label: "Enable Scrollbar",
|
|
586
599
|
getValue: ({ component: e }) => !!e.findFirstType(M),
|
|
@@ -610,7 +623,7 @@ const E = (e, l) => {
|
|
|
610
623
|
}
|
|
611
624
|
},
|
|
612
625
|
parallax: {
|
|
613
|
-
category: { id: "swiper-parallax", label: "Parallax", icon:
|
|
626
|
+
category: { id: "swiper-parallax", label: "Parallax", icon: u.parallax },
|
|
614
627
|
type: "checkbox",
|
|
615
628
|
label: "Enable Parallax",
|
|
616
629
|
value: !1
|
|
@@ -702,24 +715,24 @@ const E = (e, l) => {
|
|
|
702
715
|
}
|
|
703
716
|
},
|
|
704
717
|
allowTouchMove: {
|
|
705
|
-
category:
|
|
718
|
+
category: Y,
|
|
706
719
|
type: "checkbox",
|
|
707
720
|
label: "Allow touch move",
|
|
708
721
|
tip: "Allow touch interactions",
|
|
709
722
|
value: !0
|
|
710
723
|
},
|
|
711
724
|
grabCursor: {
|
|
712
|
-
category:
|
|
725
|
+
category: Y,
|
|
713
726
|
type: "checkbox",
|
|
714
727
|
label: "Grab cursor",
|
|
715
728
|
tip: 'If enabled, the user will see the "grab" cursor when hover the slider',
|
|
716
729
|
value: !1
|
|
717
730
|
}
|
|
718
|
-
},
|
|
719
|
-
const { Components: a, Blocks:
|
|
720
|
-
const
|
|
721
|
-
const
|
|
722
|
-
|
|
731
|
+
}, X = "Slider", z = "swiper", R = `${z}-`, Se = (e, l) => {
|
|
732
|
+
const { Components: a, Blocks: s, Commands: o } = e, { block: f } = l, c = ve(me), d = "core:preview", p = o.events, b = function(t) {
|
|
733
|
+
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
|
+
const m = n.parentElement;
|
|
735
|
+
m && (m.style.minWidth = "0");
|
|
723
736
|
const P = {
|
|
724
737
|
loop: t.loop,
|
|
725
738
|
speed: t.speed,
|
|
@@ -733,7 +746,7 @@ const E = (e, l) => {
|
|
|
733
746
|
grabCursor: t.grabCursor,
|
|
734
747
|
simulateTouch: !0,
|
|
735
748
|
breakpoints: {},
|
|
736
|
-
slidesPerView: isNaN(
|
|
749
|
+
slidesPerView: isNaN(C) ? C : r(C),
|
|
737
750
|
slidesPerGroup: r(t.slidesPerGroup),
|
|
738
751
|
spaceBetween: r(t.spaceBetween),
|
|
739
752
|
slidesOffsetBefore: r(t.slidesOffsetBefore),
|
|
@@ -765,22 +778,22 @@ const E = (e, l) => {
|
|
|
765
778
|
slideShadows: t.cardsEffectSlideShadows
|
|
766
779
|
},
|
|
767
780
|
navigation: {
|
|
768
|
-
nextEl:
|
|
769
|
-
prevEl:
|
|
781
|
+
nextEl: n.querySelector(".swiper-button-next"),
|
|
782
|
+
prevEl: n.querySelector(".swiper-button-prev")
|
|
770
783
|
},
|
|
771
784
|
pagination: {
|
|
772
785
|
type: t.pagination || "bullets",
|
|
773
786
|
dynamicBullets: t.dynamicBullets,
|
|
774
787
|
clickable: t.clickableBullets,
|
|
775
788
|
progressbarOpposite: t.progressbarOpposite,
|
|
776
|
-
el:
|
|
789
|
+
el: n.querySelector(".swiper-pagination")
|
|
777
790
|
},
|
|
778
791
|
scrollbar: {
|
|
779
|
-
el:
|
|
792
|
+
el: n.querySelector(".swiper-scrollbar"),
|
|
780
793
|
draggable: t.scrollbarDraggable,
|
|
781
794
|
hide: t.scrollbarHide
|
|
782
795
|
},
|
|
783
|
-
autoplay: t.autoplay &&
|
|
796
|
+
autoplay: t.autoplay && $ && {
|
|
784
797
|
delay: t.autoplayDelay,
|
|
785
798
|
disableOnInteraction: t.autoplayDisableOnInteraction,
|
|
786
799
|
pauseOnMouseEnter: t.autoplayPauseOnMouseEnter,
|
|
@@ -790,51 +803,51 @@ const E = (e, l) => {
|
|
|
790
803
|
}
|
|
791
804
|
};
|
|
792
805
|
if (t.tablet) {
|
|
793
|
-
const { tabletBreakpoint: T, tabletSlidesPerView:
|
|
806
|
+
const { tabletBreakpoint: T, tabletSlidesPerView: y } = t, h = r(T);
|
|
794
807
|
P.breakpoints[h] = {
|
|
795
|
-
slidesPerView: isNaN(
|
|
808
|
+
slidesPerView: isNaN(y) ? y : r(y),
|
|
796
809
|
slidesPerGroup: r(t.tabletSlidesPerGroup),
|
|
797
810
|
spaceBetween: r(t.tabletSpaceBetween)
|
|
798
811
|
};
|
|
799
812
|
}
|
|
800
813
|
if (t.mobile) {
|
|
801
|
-
const { mobileBreakpoint: T, mobileSlidesPerView:
|
|
814
|
+
const { mobileBreakpoint: T, mobileSlidesPerView: y } = t, h = r(T);
|
|
802
815
|
P.breakpoints[h] = {
|
|
803
|
-
slidesPerView: isNaN(
|
|
816
|
+
slidesPerView: isNaN(y) ? y : r(y),
|
|
804
817
|
slidesPerGroup: r(t.mobileSlidesPerGroup),
|
|
805
818
|
spaceBetween: r(t.mobileSpaceBetween)
|
|
806
819
|
};
|
|
807
820
|
}
|
|
808
|
-
N && !B && (P.simulateTouch = !1),
|
|
809
|
-
const
|
|
810
|
-
N == null || N(
|
|
821
|
+
N && !B && (P.simulateTouch = !1), _ && (P.initialSlide = _);
|
|
822
|
+
const W = new w.Swiper(n, P);
|
|
823
|
+
N == null || N(W);
|
|
811
824
|
};
|
|
812
|
-
if (
|
|
825
|
+
if (w.Swiper)
|
|
813
826
|
H();
|
|
814
827
|
else {
|
|
815
|
-
const { head:
|
|
828
|
+
const { head: m } = document, P = Array.isArray(G) ? [...G] : [G], W = Array.isArray(F) ? [...F] : [F], T = (h) => {
|
|
816
829
|
if (h.length) {
|
|
817
|
-
const
|
|
818
|
-
|
|
830
|
+
const S = document.createElement("link");
|
|
831
|
+
S.href = h.shift(), S.rel = "stylesheet", m.prepend(S), T(h);
|
|
819
832
|
}
|
|
820
|
-
},
|
|
833
|
+
}, y = (h) => {
|
|
821
834
|
if (h.length) {
|
|
822
|
-
const
|
|
823
|
-
|
|
835
|
+
const S = document.createElement("script");
|
|
836
|
+
S.src = h.shift(), S.onerror = S.onload = y.bind(null, h), m.appendChild(S);
|
|
824
837
|
} else
|
|
825
838
|
H();
|
|
826
839
|
};
|
|
827
|
-
T(
|
|
840
|
+
T(W), y(P);
|
|
828
841
|
}
|
|
829
|
-
},
|
|
842
|
+
}, g = (t = 0) => ({
|
|
830
843
|
type: O,
|
|
831
844
|
style: { padding: "50px" },
|
|
832
845
|
components: { type: "text", components: { type: "textnode", content: `Slide ${t}` } }
|
|
833
|
-
}),
|
|
846
|
+
}), i = a.getType("default").model;
|
|
834
847
|
return a.addType(v, {
|
|
835
848
|
block: f && {
|
|
836
|
-
label:
|
|
837
|
-
media:
|
|
849
|
+
label: X,
|
|
850
|
+
media: u.slider,
|
|
838
851
|
category: "Extra",
|
|
839
852
|
select: !0,
|
|
840
853
|
...l.block
|
|
@@ -842,18 +855,18 @@ const E = (e, l) => {
|
|
|
842
855
|
isComponent: (t) => E(t, z),
|
|
843
856
|
model: {
|
|
844
857
|
defaults: () => ({
|
|
845
|
-
name:
|
|
846
|
-
icon:
|
|
858
|
+
name: X,
|
|
859
|
+
icon: u.slider,
|
|
847
860
|
classes: z,
|
|
848
|
-
draggable: (t,
|
|
861
|
+
draggable: (t, n) => !n.is(v),
|
|
849
862
|
components: [
|
|
850
863
|
{
|
|
851
|
-
type:
|
|
852
|
-
components: [
|
|
864
|
+
type: L,
|
|
865
|
+
components: [g(1), g(2), g(3)]
|
|
853
866
|
},
|
|
854
867
|
{ type: k }
|
|
855
868
|
],
|
|
856
|
-
script:
|
|
869
|
+
script: b,
|
|
857
870
|
cdnScript: l.cdnScript,
|
|
858
871
|
cdnStyle: l.cdnStyle,
|
|
859
872
|
"script-props": ["cdnScript", "cdnStyle", ...c.propKeys],
|
|
@@ -862,7 +875,7 @@ const E = (e, l) => {
|
|
|
862
875
|
}),
|
|
863
876
|
init() {
|
|
864
877
|
const { em: t } = this;
|
|
865
|
-
|
|
878
|
+
ye(this, c.traits), we(this, c.propKeys), this.listenTo(t, `${p.runCommand}${d}`, this.onPreviewOn), this.listenTo(t, `${p.stopCommand}${d}`, this.onPreviewOff);
|
|
866
879
|
},
|
|
867
880
|
onPreviewOn() {
|
|
868
881
|
this.__inPreview = !0, this.reloadSlider();
|
|
@@ -874,20 +887,20 @@ const E = (e, l) => {
|
|
|
874
887
|
this.trigger("rerender");
|
|
875
888
|
},
|
|
876
889
|
addSlide() {
|
|
877
|
-
const t = this.findFirstType(
|
|
890
|
+
const t = this.findFirstType(L);
|
|
878
891
|
t == null || t.append(this.getNewSlideComponentDef());
|
|
879
892
|
},
|
|
880
893
|
getNewSlideComponentDef() {
|
|
881
|
-
var
|
|
882
|
-
const t = ((
|
|
894
|
+
var n;
|
|
895
|
+
const t = ((n = this.findFirstType(L)) == null ? void 0 : n.components().length) || 0;
|
|
883
896
|
return {
|
|
884
897
|
type: O,
|
|
885
898
|
components: { type: "text", components: { type: "textnode", content: `Slide ${t + 1}` } }
|
|
886
899
|
};
|
|
887
900
|
},
|
|
888
901
|
toJSON(...t) {
|
|
889
|
-
const
|
|
890
|
-
return c.propsNoValues.forEach((
|
|
902
|
+
const n = i.prototype.toJSON.apply(this, t);
|
|
903
|
+
return c.propsNoValues.forEach((w) => delete n[w]), delete n["script-props"], n;
|
|
891
904
|
}
|
|
892
905
|
},
|
|
893
906
|
view: {
|
|
@@ -903,14 +916,14 @@ const E = (e, l) => {
|
|
|
903
916
|
},
|
|
904
917
|
onRender() {
|
|
905
918
|
const t = this.el;
|
|
906
|
-
t.__onLoad = (
|
|
919
|
+
t.__onLoad = (n) => n.on("slideChange", () => this.__activeSlide = n.activeIndex), t.__activeSlide = this.__activeSlide, t.__inPreview = this.model.__inPreview;
|
|
907
920
|
}
|
|
908
921
|
}
|
|
909
922
|
}), () => {
|
|
910
|
-
a.removeType(v),
|
|
923
|
+
a.removeType(v), s.remove(v);
|
|
911
924
|
};
|
|
912
|
-
},
|
|
913
|
-
const { Components: l } = e, a = (
|
|
925
|
+
}, Pe = "Nav Prev", Ee = "Nav Next", D = `${R}button-prev`, V = `${R}button-next`, Te = (e) => {
|
|
926
|
+
const { Components: l } = e, a = (s) => ({
|
|
914
927
|
type: "svg",
|
|
915
928
|
selectable: !1,
|
|
916
929
|
hoverable: !1,
|
|
@@ -918,15 +931,15 @@ const E = (e, l) => {
|
|
|
918
931
|
components: {
|
|
919
932
|
type: "svg-in",
|
|
920
933
|
tagName: "path",
|
|
921
|
-
attributes: { d:
|
|
934
|
+
attributes: { d: s, fill: "currentColor" }
|
|
922
935
|
}
|
|
923
936
|
});
|
|
924
|
-
return l.addType(
|
|
925
|
-
isComponent: (
|
|
937
|
+
return l.addType(A, {
|
|
938
|
+
isComponent: (s) => E(s, D),
|
|
926
939
|
model: {
|
|
927
940
|
defaults: {
|
|
928
|
-
name:
|
|
929
|
-
classes:
|
|
941
|
+
name: Pe,
|
|
942
|
+
classes: D,
|
|
930
943
|
copyable: !1,
|
|
931
944
|
highlightable: !1,
|
|
932
945
|
droppable: !1,
|
|
@@ -936,40 +949,40 @@ const E = (e, l) => {
|
|
|
936
949
|
layerable: !1,
|
|
937
950
|
components: a("M0,22L22,0l2.1,2.1L4.2,22l19.9,19.9L22,44L0,22L0,22L0,22z"),
|
|
938
951
|
styles: `
|
|
939
|
-
.${
|
|
952
|
+
.${D} {
|
|
940
953
|
color: inherit;
|
|
941
954
|
}
|
|
942
|
-
.${
|
|
955
|
+
.${D}:after {
|
|
943
956
|
content: none;
|
|
944
957
|
}
|
|
945
958
|
`
|
|
946
959
|
}
|
|
947
960
|
}
|
|
948
|
-
}), l.addType(
|
|
949
|
-
extend:
|
|
950
|
-
isComponent: (
|
|
961
|
+
}), l.addType(I, {
|
|
962
|
+
extend: A,
|
|
963
|
+
isComponent: (s) => E(s, V),
|
|
951
964
|
model: {
|
|
952
965
|
defaults: {
|
|
953
|
-
name:
|
|
954
|
-
classes:
|
|
966
|
+
name: Ee,
|
|
967
|
+
classes: V,
|
|
955
968
|
components: a("M27,22L27,22L5,44l-2.1-2.1L22.8,22L2.9,2.1L5,0L27,22L27,22z"),
|
|
956
969
|
styles: `
|
|
957
|
-
.${
|
|
970
|
+
.${V} {
|
|
958
971
|
color: inherit;
|
|
959
972
|
}
|
|
960
|
-
.${
|
|
973
|
+
.${V}:after {
|
|
961
974
|
content: none;
|
|
962
975
|
}
|
|
963
976
|
`
|
|
964
977
|
}
|
|
965
978
|
}
|
|
966
979
|
}), () => {
|
|
967
|
-
l.removeType(
|
|
980
|
+
l.removeType(A), l.removeType(I);
|
|
968
981
|
};
|
|
969
|
-
},
|
|
970
|
-
const { Components: l } = e, a = `${
|
|
982
|
+
}, xe = (e) => {
|
|
983
|
+
const { Components: l } = e, a = `${R}pagination`;
|
|
971
984
|
return l.addType(k, {
|
|
972
|
-
isComponent: (
|
|
985
|
+
isComponent: (s) => E(s, a),
|
|
973
986
|
model: {
|
|
974
987
|
defaults: {
|
|
975
988
|
name: "Pagination",
|
|
@@ -994,14 +1007,14 @@ const E = (e, l) => {
|
|
|
994
1007
|
}), () => {
|
|
995
1008
|
l.removeType(k);
|
|
996
1009
|
};
|
|
997
|
-
},
|
|
1010
|
+
}, Le = "Scrollbar", J = `${R}scrollbar`, Ae = (e) => {
|
|
998
1011
|
const { Components: l } = e;
|
|
999
1012
|
return l.addType(M, {
|
|
1000
|
-
isComponent: (a) => E(a,
|
|
1013
|
+
isComponent: (a) => E(a, J),
|
|
1001
1014
|
model: {
|
|
1002
1015
|
defaults: {
|
|
1003
|
-
name:
|
|
1004
|
-
classes:
|
|
1016
|
+
name: Le,
|
|
1017
|
+
classes: J,
|
|
1005
1018
|
copyable: !1,
|
|
1006
1019
|
highlightable: !1,
|
|
1007
1020
|
removable: !1,
|
|
@@ -1015,81 +1028,81 @@ const E = (e, l) => {
|
|
|
1015
1028
|
}), () => {
|
|
1016
1029
|
l.removeType(M);
|
|
1017
1030
|
};
|
|
1018
|
-
},
|
|
1031
|
+
}, ke = "Slide", Q = `${R}slide`, Re = (e) => {
|
|
1019
1032
|
const { Components: l } = e;
|
|
1020
1033
|
return l.addType(O, {
|
|
1021
|
-
isComponent: (a) => E(a,
|
|
1034
|
+
isComponent: (a) => E(a, Q),
|
|
1022
1035
|
model: {
|
|
1023
1036
|
defaults: {
|
|
1024
|
-
name:
|
|
1025
|
-
classes:
|
|
1026
|
-
icon:
|
|
1027
|
-
draggable: (a,
|
|
1037
|
+
name: ke,
|
|
1038
|
+
classes: Q,
|
|
1039
|
+
icon: u.slider,
|
|
1040
|
+
draggable: (a, s) => s.is(L)
|
|
1028
1041
|
}
|
|
1029
1042
|
// TODO VIEW slide to this slide when selected
|
|
1030
1043
|
}
|
|
1031
1044
|
}), () => {
|
|
1032
1045
|
l.removeType(O);
|
|
1033
1046
|
};
|
|
1034
|
-
},
|
|
1047
|
+
}, Ne = "Wrapper", ee = `${R}wrapper`, _e = (e) => {
|
|
1035
1048
|
const { Components: l } = e, { events: a } = l;
|
|
1036
|
-
return l.addType(
|
|
1037
|
-
isComponent: (
|
|
1049
|
+
return l.addType(L, {
|
|
1050
|
+
isComponent: (s) => E(s, ee),
|
|
1038
1051
|
model: {
|
|
1039
1052
|
defaults: {
|
|
1040
|
-
name:
|
|
1041
|
-
icon:
|
|
1042
|
-
classes:
|
|
1053
|
+
name: Ne,
|
|
1054
|
+
icon: u.slider,
|
|
1055
|
+
classes: ee,
|
|
1043
1056
|
copyable: !1,
|
|
1044
1057
|
removable: !1,
|
|
1045
1058
|
draggable: !1,
|
|
1046
1059
|
highlightable: !1,
|
|
1047
|
-
droppable: (
|
|
1060
|
+
droppable: (s) => s.is(O)
|
|
1048
1061
|
},
|
|
1049
1062
|
init() {
|
|
1050
|
-
const
|
|
1051
|
-
this.listenTo(
|
|
1063
|
+
const s = this.components();
|
|
1064
|
+
this.listenTo(s, "add remove", this.updateSlider);
|
|
1052
1065
|
},
|
|
1053
|
-
updateSlider(
|
|
1054
|
-
const
|
|
1055
|
-
if (
|
|
1056
|
-
const f =
|
|
1057
|
-
|
|
1066
|
+
updateSlider(s) {
|
|
1067
|
+
const o = this.closestType(v);
|
|
1068
|
+
if (o) {
|
|
1069
|
+
const f = o.getView();
|
|
1070
|
+
o.reloadSlider(), this.em.once(a.scriptMount, () => {
|
|
1058
1071
|
setTimeout(() => {
|
|
1059
1072
|
var c;
|
|
1060
|
-
return (c = f.getSwiper()) == null ? void 0 : c.slideTo(
|
|
1073
|
+
return (c = f.getSwiper()) == null ? void 0 : c.slideTo(s.index());
|
|
1061
1074
|
}, 100);
|
|
1062
1075
|
});
|
|
1063
1076
|
}
|
|
1064
1077
|
}
|
|
1065
1078
|
}
|
|
1066
1079
|
}), () => {
|
|
1067
|
-
l.removeType(
|
|
1080
|
+
l.removeType(L);
|
|
1068
1081
|
};
|
|
1069
|
-
},
|
|
1082
|
+
}, Me = "swiperComponent", Oe = x.startup, Be = function(e, l = {}) {
|
|
1070
1083
|
const a = {
|
|
1071
1084
|
block: {},
|
|
1072
1085
|
cdnScript: "https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.js",
|
|
1073
1086
|
cdnStyle: "https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css",
|
|
1074
1087
|
...l
|
|
1075
|
-
},
|
|
1088
|
+
}, s = [
|
|
1076
1089
|
Se(e, a),
|
|
1077
|
-
Ee(e),
|
|
1078
|
-
Ne(e),
|
|
1079
|
-
ke(e),
|
|
1080
1090
|
Te(e),
|
|
1091
|
+
_e(e),
|
|
1092
|
+
Re(e),
|
|
1093
|
+
xe(e),
|
|
1081
1094
|
Ae(e)
|
|
1082
1095
|
];
|
|
1083
1096
|
fe({
|
|
1084
1097
|
editor: e,
|
|
1085
|
-
plan:
|
|
1098
|
+
plan: Oe,
|
|
1086
1099
|
licenseKey: a.licenseKey,
|
|
1087
|
-
pluginName:
|
|
1100
|
+
pluginName: Me,
|
|
1088
1101
|
cleanup: () => {
|
|
1089
|
-
|
|
1102
|
+
s.forEach((o) => o());
|
|
1090
1103
|
}
|
|
1091
1104
|
});
|
|
1092
|
-
},
|
|
1105
|
+
}, De = be(Be);
|
|
1093
1106
|
export {
|
|
1094
|
-
|
|
1107
|
+
De as default
|
|
1095
1108
|
};
|