@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.
Files changed (88) hide show
  1. package/dist/accordionComponent/index.cjs.js +7 -7
  2. package/dist/accordionComponent/index.es.js +175 -162
  3. package/dist/accordionComponent/index.umd.js +7 -7
  4. package/dist/aiChat/index.cjs.js +64 -64
  5. package/dist/aiChat/index.es.js +5785 -5757
  6. package/dist/aiChat/index.js +64 -64
  7. package/dist/aiChat/index.umd.js +63 -63
  8. package/dist/animationComponent/index.cjs.js +3 -3
  9. package/dist/animationComponent/index.es.js +204 -191
  10. package/dist/animationComponent/index.umd.js +3 -3
  11. package/dist/canvasAbsoluteMode/index.cjs.js +1 -1
  12. package/dist/canvasAbsoluteMode/index.es.js +183 -170
  13. package/dist/canvasAbsoluteMode/index.umd.js +1 -1
  14. package/dist/canvasEmptyState/index.cjs.js +1 -1
  15. package/dist/canvasEmptyState/index.es.js +134 -121
  16. package/dist/canvasEmptyState/index.umd.js +1 -1
  17. package/dist/canvasFullSize/index.cjs.js +9 -9
  18. package/dist/canvasFullSize/index.es.js +165 -152
  19. package/dist/canvasFullSize/index.umd.js +9 -9
  20. package/dist/canvasGridMode/index.cjs.js +5 -5
  21. package/dist/canvasGridMode/index.es.js +245 -232
  22. package/dist/canvasGridMode/index.umd.js +4 -4
  23. package/dist/canvasScreenshot/index.cjs.js +1 -1
  24. package/dist/canvasScreenshot/index.es.js +155 -142
  25. package/dist/canvasScreenshot/index.umd.js +1 -1
  26. package/dist/dataSourceEjs/index.cjs.js +9 -9
  27. package/dist/dataSourceEjs/index.es.js +257 -244
  28. package/dist/dataSourceEjs/index.umd.js +9 -9
  29. package/dist/dataSourceHandlebars/index.cjs.js +8 -8
  30. package/dist/dataSourceHandlebars/index.es.js +216 -203
  31. package/dist/dataSourceHandlebars/index.umd.js +7 -7
  32. package/dist/dialogComponent/index.cjs.js +14 -14
  33. package/dist/dialogComponent/index.es.js +141 -128
  34. package/dist/dialogComponent/index.umd.js +14 -14
  35. package/dist/flexComponent/index.cjs.js +13 -13
  36. package/dist/flexComponent/index.es.js +484 -471
  37. package/dist/flexComponent/index.umd.js +13 -13
  38. package/dist/fsLightboxComponent/index.cjs.js +3 -3
  39. package/dist/fsLightboxComponent/index.es.js +173 -160
  40. package/dist/fsLightboxComponent/index.umd.js +3 -3
  41. package/dist/googleFontsAssetProvider/index.cjs.js +1 -1
  42. package/dist/googleFontsAssetProvider/index.es.js +160 -147
  43. package/dist/googleFontsAssetProvider/index.umd.js +1 -1
  44. package/dist/iconifyComponent/index.cjs.js +2 -2
  45. package/dist/iconifyComponent/index.es.js +196 -183
  46. package/dist/iconifyComponent/index.umd.js +2 -2
  47. package/dist/index.cjs.js +25 -25
  48. package/dist/index.es.js +121 -108
  49. package/dist/index.umd.js +18 -18
  50. package/dist/layoutSidebarButtons/index.cjs.js +1 -1
  51. package/dist/layoutSidebarButtons/index.es.js +157 -144
  52. package/dist/layoutSidebarButtons/index.umd.js +1 -1
  53. package/dist/lightGalleryComponent/index.cjs.js +1 -1
  54. package/dist/lightGalleryComponent/index.es.js +245 -232
  55. package/dist/lightGalleryComponent/index.umd.js +1 -1
  56. package/dist/linkImageComponent/index.cjs.js +2 -2
  57. package/dist/linkImageComponent/index.es.js +106 -93
  58. package/dist/linkImageComponent/index.umd.js +2 -2
  59. package/dist/listPagesComponent/index.cjs.js +5 -5
  60. package/dist/listPagesComponent/index.es.js +157 -144
  61. package/dist/listPagesComponent/index.umd.js +5 -5
  62. package/dist/presetPrintable/index.cjs.js +3 -3
  63. package/dist/presetPrintable/index.es.js +181 -168
  64. package/dist/presetPrintable/index.umd.js +3 -3
  65. package/dist/prosemirror/index.cjs.js +7 -7
  66. package/dist/prosemirror/index.es.js +385 -372
  67. package/dist/prosemirror/index.umd.js +8 -8
  68. package/dist/rendererReact/index.cjs.js +1 -1
  69. package/dist/rendererReact/index.es.js +200 -187
  70. package/dist/rendererReact/index.js +1 -1
  71. package/dist/rendererReact/index.umd.js +1 -1
  72. package/dist/rteTinyMce/index.cjs.js +2 -2
  73. package/dist/rteTinyMce/index.es.js +118 -105
  74. package/dist/rteTinyMce/index.umd.js +2 -2
  75. package/dist/shapeDividerComponent/index.cjs.js +4 -4
  76. package/dist/shapeDividerComponent/index.es.js +129 -116
  77. package/dist/shapeDividerComponent/index.umd.js +4 -4
  78. package/dist/swiperComponent/index.cjs.js +9 -9
  79. package/dist/swiperComponent/index.es.js +203 -190
  80. package/dist/swiperComponent/index.umd.js +7 -7
  81. package/dist/tableComponent/index.cjs.js +1 -1
  82. package/dist/tableComponent/index.es.js +257 -244
  83. package/dist/tableComponent/index.umd.js +1 -1
  84. package/dist/types.d.ts +1 -1
  85. package/dist/youtubeAssetProvider/index.cjs.js +1 -1
  86. package/dist/youtubeAssetProvider/index.es.js +121 -108
  87. package/dist/youtubeAssetProvider/index.umd.js +1 -1
  88. package/package.json +1 -1
@@ -1,8 +1,8 @@
1
- const ee = "app.grapesjs.com", te = "app-stage.grapesjs.com", ae = "app2.grapesjs.com", le = "app-stage2.grapesjs.com", G = [
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
- ], ie = "license:check:start", se = "license:check:end", ne = () => typeof window < "u", oe = ({
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 ? te : ee}`}/${a ? "platform-api" : "api"}`, re = () => {
19
- const e = ne() && window.location.hostname;
20
- return !!e && (G.includes(e) || G.some((l) => e.endsWith(l)));
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: i = {},
27
- params: s,
26
+ headers: s = {},
27
+ params: o,
28
28
  body: f
29
29
  }) {
30
- const u = `${l || oe({ isDev: !1, isStage: !1 })}${e}`, b = {
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
- ...i
34
+ ...s
35
35
  }
36
36
  };
37
- f && (b.body = JSON.stringify(f));
38
- const d = s ? new URLSearchParams(s).toString() : "", m = d ? `?${d}` : "", n = await fetch(`${u}${m}`, b);
39
- if (!n.ok)
40
- throw new Error(`HTTP error! status: ${n.status}`);
41
- return n.json();
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 U = {
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) => (i) => e(i, a), l;
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: i,
60
- onLicenseCheckResponse: s,
59
+ licenseKey: s,
60
+ onLicenseCheckResponse: o,
61
61
  cleanup: f
62
62
  }) {
63
- let c = "", u = !1;
64
- const b = re(), d = (n) => {
65
- console.warn("Cleanup plugin:", a, "Reason:", n), f();
66
- }, m = (n = {}) => {
67
- var C;
68
- const { error: t, sdkLicense: o } = n, y = (C = n.plan) == null ? void 0 : C.category;
69
- if (!(o || n.license) || t)
70
- d(t || "Invalid license");
71
- else if (y) {
72
- const B = U[l], R = U[y];
73
- B > R && d({ pluginRequiredPlan: l, licensePlan: y });
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.on(ie, (n) => {
77
- c = n == null ? void 0 : n.baseApiUrl, u = !0;
78
- }), e.on(se, (n) => {
79
- s == null || s(n), m(n);
80
- }), setTimeout(async () => {
81
- if (!u) {
82
- if (b) return;
83
- if (i) {
84
- const n = await he({ licenseKey: i, pluginName: a, baseApiUrl: c });
85
- s == null || s(n), n && m(n);
86
- } else
87
- d("The `licenseKey` option not provided");
88
- }
89
- }, 2e3);
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: i } = e;
105
+ const { licenseKey: l, pluginName: a, baseApiUrl: s } = e;
93
106
  try {
94
107
  return (await pe({
95
- baseApiUrl: i,
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 (s) {
104
- return console.error("Error during SDK license check:", s), !1;
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 = {}, i = [], s = [];
125
+ const a = {}, s = [], o = [];
113
126
  for (const c in e) {
114
- const { value: u, ...b } = e[c];
115
- i.push({ id: c, name: c, changeProp: !0, category: l.category, ...b }), a[c] = u, !de(u) && s.push(c);
116
- const { subTraits: d = {} } = b;
117
- for (const m in b.subTraits)
118
- (f = d[m]) == null || f.forEach((n) => {
119
- const t = n.id || n.name;
120
- a[t] = n.value;
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: s,
138
+ propsNoValues: o,
126
139
  props: a,
127
- traits: i
140
+ traits: s
128
141
  };
129
- }, me = (e, l) => {
142
+ }, ye = (e, l) => {
130
143
  l.forEach((a) => {
131
144
  if (a.subTraits) {
132
- const i = `${a.id || a.name}`, s = a.changeProp ? `change:${i}` : `change:attributes:${i}`;
133
- e.on(s, () => j(e, i)), j(e, i);
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
- }, j = (e, l) => {
137
- const a = e.getTrait(l), i = a.get("category"), s = a.get("subTraits") || {}, c = (Object.values(s).flat() || []).map((d) => d.id || d.name);
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 u = s[a.getValue()], b = e.getTraitIndex(l) + 1;
140
- u && e.addTrait(
141
- u.map((d) => ({ category: i, ...d })),
142
- { at: b }
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
- }, ge = (e, l) => {
157
+ }, we = (e, l) => {
145
158
  l.forEach((a) => {
146
- const i = ce(a);
147
- i !== a && e.has(i) && e.set({ [a]: e.get(i), [i]: void 0 });
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`, A = `${v}-wrapper`, L = `${v}-nav-prev`, $ = `${v}-nav-next`, k = `${v}-pagination`, M = `${v}-scrollbar`, p = {
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: p.responsive }, Z = { id: "swiper-extra", label: "Extra", icon: p.extra }, ye = {
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: p.reload },
192
- { id: "p", label: "Previous slide", icon: p.prev },
193
- { id: "n", label: "Next slide", icon: p.next },
194
- { id: "a", label: "Add new slide", icon: p.add }
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 i;
198
- const a = (i = e.getView()) == null ? void 0 : i.getSwiper();
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(L),
251
+ getValue: ({ component: e }) => !!e.findFirstType(A),
239
252
  setValue: ({ component: e, value: l }) => {
240
- var a, i;
241
- l ? e.append([{ type: L }, { type: $ }]) : ((a = e.findFirstType(L)) == null || a.remove(), (i = e.findFirstType($)) == null || i.remove()), e.set({ navigation: l });
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: p.effect },
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: p.autoplay },
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: p.pagination },
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: p.scrollbar },
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: p.parallax },
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: Z,
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: Z,
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
- }, Y = "Slider", z = "swiper", _ = `${z}-`, Se = (e, l) => {
719
- const { Components: a, Blocks: i, Commands: s } = e, { block: f } = l, c = ve(ye), u = "core:preview", b = s.events, d = function(t) {
720
- const o = this, y = window, N = o.__onLoad, C = o.__activeSlide, B = o.__inPreview, R = y._isEditor && !B ? t.autoplayEditor : !0, { cdnScript: I, cdnStyle: W, slidesPerView: F } = t || {}, r = (S) => isNaN(S) ? void 0 : parseFloat(S), H = () => {
721
- const S = o.parentElement;
722
- S && (S.style.minWidth = "0");
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(F) ? F : r(F),
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: o.querySelector(".swiper-button-next"),
769
- prevEl: o.querySelector(".swiper-button-prev")
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: o.querySelector(".swiper-pagination")
789
+ el: n.querySelector(".swiper-pagination")
777
790
  },
778
791
  scrollbar: {
779
- el: o.querySelector(".swiper-scrollbar"),
792
+ el: n.querySelector(".swiper-scrollbar"),
780
793
  draggable: t.scrollbarDraggable,
781
794
  hide: t.scrollbarHide
782
795
  },
783
- autoplay: t.autoplay && R && {
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: g } = t, h = r(T);
806
+ const { tabletBreakpoint: T, tabletSlidesPerView: y } = t, h = r(T);
794
807
  P.breakpoints[h] = {
795
- slidesPerView: isNaN(g) ? g : r(g),
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: g } = t, h = r(T);
814
+ const { mobileBreakpoint: T, mobileSlidesPerView: y } = t, h = r(T);
802
815
  P.breakpoints[h] = {
803
- slidesPerView: isNaN(g) ? g : r(g),
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), C && (P.initialSlide = C);
809
- const q = new y.Swiper(o, P);
810
- N == null || N(q);
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 (y.Swiper)
825
+ if (w.Swiper)
813
826
  H();
814
827
  else {
815
- const { head: S } = document, P = Array.isArray(I) ? [...I] : [I], q = Array.isArray(W) ? [...W] : [W], T = (h) => {
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 w = document.createElement("link");
818
- w.href = h.shift(), w.rel = "stylesheet", S.prepend(w), T(h);
830
+ const S = document.createElement("link");
831
+ S.href = h.shift(), S.rel = "stylesheet", m.prepend(S), T(h);
819
832
  }
820
- }, g = (h) => {
833
+ }, y = (h) => {
821
834
  if (h.length) {
822
- const w = document.createElement("script");
823
- w.src = h.shift(), w.onerror = w.onload = g.bind(null, h), S.appendChild(w);
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(q), g(P);
840
+ T(W), y(P);
828
841
  }
829
- }, m = (t = 0) => ({
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
- }), n = a.getType("default").model;
846
+ }), i = a.getType("default").model;
834
847
  return a.addType(v, {
835
848
  block: f && {
836
- label: Y,
837
- media: p.slider,
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: Y,
846
- icon: p.slider,
858
+ name: X,
859
+ icon: u.slider,
847
860
  classes: z,
848
- draggable: (t, o) => !o.is(v),
861
+ draggable: (t, n) => !n.is(v),
849
862
  components: [
850
863
  {
851
- type: A,
852
- components: [m(1), m(2), m(3)]
864
+ type: L,
865
+ components: [g(1), g(2), g(3)]
853
866
  },
854
867
  { type: k }
855
868
  ],
856
- script: d,
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
- me(this, c.traits), ge(this, c.propKeys), this.listenTo(t, `${b.runCommand}${u}`, this.onPreviewOn), this.listenTo(t, `${b.stopCommand}${u}`, this.onPreviewOff);
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(A);
890
+ const t = this.findFirstType(L);
878
891
  t == null || t.append(this.getNewSlideComponentDef());
879
892
  },
880
893
  getNewSlideComponentDef() {
881
- var o;
882
- const t = ((o = this.findFirstType(A)) == null ? void 0 : o.components().length) || 0;
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 o = n.prototype.toJSON.apply(this, t);
890
- return c.propsNoValues.forEach((y) => delete o[y]), delete o["script-props"], o;
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 = (o) => o.on("slideChange", () => this.__activeSlide = o.activeIndex), t.__activeSlide = this.__activeSlide, t.__inPreview = this.model.__inPreview;
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), i.remove(v);
923
+ a.removeType(v), s.remove(v);
911
924
  };
912
- }, we = "Nav Prev", Pe = "Nav Next", V = `${_}button-prev`, D = `${_}button-next`, Ee = (e) => {
913
- const { Components: l } = e, a = (i) => ({
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: i, fill: "currentColor" }
934
+ attributes: { d: s, fill: "currentColor" }
922
935
  }
923
936
  });
924
- return l.addType(L, {
925
- isComponent: (i) => E(i, V),
937
+ return l.addType(A, {
938
+ isComponent: (s) => E(s, D),
926
939
  model: {
927
940
  defaults: {
928
- name: we,
929
- classes: V,
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
- .${V} {
952
+ .${D} {
940
953
  color: inherit;
941
954
  }
942
- .${V}:after {
955
+ .${D}:after {
943
956
  content: none;
944
957
  }
945
958
  `
946
959
  }
947
960
  }
948
- }), l.addType($, {
949
- extend: L,
950
- isComponent: (i) => E(i, D),
961
+ }), l.addType(I, {
962
+ extend: A,
963
+ isComponent: (s) => E(s, V),
951
964
  model: {
952
965
  defaults: {
953
- name: Pe,
954
- classes: D,
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
- .${D} {
970
+ .${V} {
958
971
  color: inherit;
959
972
  }
960
- .${D}:after {
973
+ .${V}:after {
961
974
  content: none;
962
975
  }
963
976
  `
964
977
  }
965
978
  }
966
979
  }), () => {
967
- l.removeType(L), l.removeType($);
980
+ l.removeType(A), l.removeType(I);
968
981
  };
969
- }, Te = (e) => {
970
- const { Components: l } = e, a = `${_}pagination`;
982
+ }, xe = (e) => {
983
+ const { Components: l } = e, a = `${R}pagination`;
971
984
  return l.addType(k, {
972
- isComponent: (i) => E(i, a),
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
- }, xe = "Scrollbar", X = `${_}scrollbar`, Ae = (e) => {
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, X),
1013
+ isComponent: (a) => E(a, J),
1001
1014
  model: {
1002
1015
  defaults: {
1003
- name: xe,
1004
- classes: X,
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
- }, Le = "Slide", J = `${_}slide`, ke = (e) => {
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, J),
1034
+ isComponent: (a) => E(a, Q),
1022
1035
  model: {
1023
1036
  defaults: {
1024
- name: Le,
1025
- classes: J,
1026
- icon: p.slider,
1027
- draggable: (a, i) => i.is(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
- }, _e = "Wrapper", Q = `${_}wrapper`, Ne = (e) => {
1047
+ }, Ne = "Wrapper", ee = `${R}wrapper`, _e = (e) => {
1035
1048
  const { Components: l } = e, { events: a } = l;
1036
- return l.addType(A, {
1037
- isComponent: (i) => E(i, Q),
1049
+ return l.addType(L, {
1050
+ isComponent: (s) => E(s, ee),
1038
1051
  model: {
1039
1052
  defaults: {
1040
- name: _e,
1041
- icon: p.slider,
1042
- classes: Q,
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: (i) => i.is(O)
1060
+ droppable: (s) => s.is(O)
1048
1061
  },
1049
1062
  init() {
1050
- const i = this.components();
1051
- this.listenTo(i, "add remove", this.updateSlider);
1063
+ const s = this.components();
1064
+ this.listenTo(s, "add remove", this.updateSlider);
1052
1065
  },
1053
- updateSlider(i) {
1054
- const s = this.closestType(v);
1055
- if (s) {
1056
- const f = s.getView();
1057
- s.reloadSlider(), this.em.once(a.scriptMount, () => {
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(i.index());
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(A);
1080
+ l.removeType(L);
1068
1081
  };
1069
- }, Ce = "swiperComponent", Me = x.startup, Oe = function(e, l = {}) {
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
- }, i = [
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: Me,
1098
+ plan: Oe,
1086
1099
  licenseKey: a.licenseKey,
1087
- pluginName: Ce,
1100
+ pluginName: Me,
1088
1101
  cleanup: () => {
1089
- i.forEach((s) => s());
1102
+ s.forEach((o) => o());
1090
1103
  }
1091
1104
  });
1092
- }, Be = be(Oe);
1105
+ }, De = be(Be);
1093
1106
  export {
1094
- Be as default
1107
+ De as default
1095
1108
  };