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