@grapesjs/studio-sdk-plugins 1.0.33-rc.1 → 1.0.33

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 (130) hide show
  1. package/dist/accordionComponent/index.cjs.js +7 -7
  2. package/dist/accordionComponent/index.es.js +161 -156
  3. package/dist/accordionComponent/index.umd.js +9 -9
  4. package/dist/aiChat/chatManager.d.ts +15 -0
  5. package/dist/aiChat/clientTools.d.ts +3 -3
  6. package/dist/aiChat/clientToolsProcessors.d.ts +14 -1
  7. package/dist/aiChat/components/AiChatEmptyState.d.ts +4 -6
  8. package/dist/aiChat/components/AiChatError.d.ts +2 -1
  9. package/dist/aiChat/components/AiChatHeader.d.ts +2 -1
  10. package/dist/aiChat/components/AiChatInput/AssetsSection.d.ts +7 -0
  11. package/dist/aiChat/components/AiChatInput/AttachButton.d.ts +10 -0
  12. package/dist/aiChat/components/AiChatInput/ContextSection.d.ts +5 -0
  13. package/dist/aiChat/components/AiChatInput/DictateButton.d.ts +7 -0
  14. package/dist/aiChat/components/AiChatInput/TextAreaWithAutoResize.d.ts +6 -0
  15. package/dist/aiChat/components/AiChatInput/constants.d.ts +6 -0
  16. package/dist/aiChat/components/AiChatInput/hooks/useSpeechToText.d.ts +15 -0
  17. package/dist/aiChat/components/AiChatInput/index.d.ts +37 -0
  18. package/dist/aiChat/components/AiChatLoadingState.d.ts +2 -1
  19. package/dist/aiChat/components/AiChatMessage.d.ts +21 -9
  20. package/dist/aiChat/components/AiChatMessages.d.ts +5 -7
  21. package/dist/aiChat/components/AiChatMessagesStatus.d.ts +5 -0
  22. package/dist/aiChat/components/AiChatPanel.d.ts +2 -3
  23. package/dist/aiChat/components/AiChatProvider.d.ts +14 -0
  24. package/dist/aiChat/components/MemoizedMarkdown.d.ts +9 -0
  25. package/dist/aiChat/components/index.d.ts +24 -25
  26. package/dist/aiChat/components/utils.d.ts +12 -4
  27. package/dist/aiChat/index.cjs.d.ts +5 -0
  28. package/dist/aiChat/index.cjs.js +453 -0
  29. package/dist/aiChat/index.d.ts +4 -3
  30. package/dist/aiChat/index.es.d.ts +5 -0
  31. package/dist/aiChat/index.es.js +30930 -0
  32. package/dist/aiChat/index.js +453 -0
  33. package/dist/aiChat/index.umd.js +453 -0
  34. package/dist/aiChat/locales/en.d.ts +64 -0
  35. package/dist/aiChat/server/index.cjs.d.ts +4 -0
  36. package/dist/aiChat/server/index.cjs.js +309 -0
  37. package/dist/aiChat/server/index.d.ts +0 -50
  38. package/dist/aiChat/server/index.es.d.ts +4 -0
  39. package/dist/aiChat/server/index.es.js +876 -0
  40. package/dist/aiChat/server/index.js +309 -0
  41. package/dist/aiChat/server/index.umd.js +309 -0
  42. package/dist/aiChat/server/stream.d.ts +0 -6
  43. package/dist/aiChat/server/tools.d.ts +157 -51
  44. package/dist/aiChat/server/types.d.ts +108 -64
  45. package/dist/aiChat/types.d.ts +148 -108
  46. package/dist/aiChat/typesSchema.d.ts +238 -25
  47. package/dist/animationComponent/index.cjs.js +3 -3
  48. package/dist/animationComponent/index.es.js +174 -169
  49. package/dist/animationComponent/index.umd.js +3 -3
  50. package/dist/canvasAbsoluteMode/index.cjs.js +1 -1
  51. package/dist/canvasAbsoluteMode/index.es.js +161 -156
  52. package/dist/canvasAbsoluteMode/index.umd.js +1 -1
  53. package/dist/canvasEmptyState/index.cjs.js +1 -1
  54. package/dist/canvasEmptyState/index.es.js +113 -108
  55. package/dist/canvasEmptyState/index.umd.js +1 -1
  56. package/dist/canvasFullSize/index.cjs.js +9 -9
  57. package/dist/canvasFullSize/index.es.js +137 -132
  58. package/dist/canvasFullSize/index.umd.js +9 -9
  59. package/dist/canvasGridMode/index.cjs.js +4 -4
  60. package/dist/canvasGridMode/index.es.js +168 -163
  61. package/dist/canvasGridMode/index.umd.js +8 -8
  62. package/dist/canvasScreenshot/index.cjs.js +1 -1
  63. package/dist/canvasScreenshot/index.es.js +132 -127
  64. package/dist/canvasScreenshot/index.umd.js +1 -1
  65. package/dist/dataSourceEjs/index.cjs.js +5 -5
  66. package/dist/dataSourceEjs/index.es.js +151 -146
  67. package/dist/dataSourceEjs/index.umd.js +5 -5
  68. package/dist/dataSourceHandlebars/index.cjs.js +4 -4
  69. package/dist/dataSourceHandlebars/index.es.js +91 -86
  70. package/dist/dataSourceHandlebars/index.umd.js +5 -5
  71. package/dist/dialogComponent/index.cjs.js +16 -16
  72. package/dist/dialogComponent/index.es.js +117 -112
  73. package/dist/dialogComponent/index.umd.js +16 -16
  74. package/dist/flexComponent/index.cjs.js +11 -11
  75. package/dist/flexComponent/index.es.js +416 -411
  76. package/dist/flexComponent/index.umd.js +11 -11
  77. package/dist/fsLightboxComponent/index.cjs.js +3 -3
  78. package/dist/fsLightboxComponent/index.es.js +152 -147
  79. package/dist/fsLightboxComponent/index.umd.js +3 -3
  80. package/dist/googleFontsAssetProvider/index.cjs.js +1 -1
  81. package/dist/googleFontsAssetProvider/index.es.js +127 -122
  82. package/dist/googleFontsAssetProvider/index.umd.js +1 -1
  83. package/dist/iconifyComponent/index.cjs.js +2 -2
  84. package/dist/iconifyComponent/index.es.js +170 -165
  85. package/dist/iconifyComponent/index.umd.js +2 -2
  86. package/dist/index.cjs.js +1 -1
  87. package/dist/index.es.js +27 -22
  88. package/dist/index.umd.js +1 -1
  89. package/dist/layoutSidebarButtons/index.cjs.js +1 -1
  90. package/dist/layoutSidebarButtons/index.es.js +156 -151
  91. package/dist/layoutSidebarButtons/index.umd.js +1 -1
  92. package/dist/lightGalleryComponent/index.cjs.js +1 -1
  93. package/dist/lightGalleryComponent/index.es.js +197 -192
  94. package/dist/lightGalleryComponent/index.umd.js +1 -1
  95. package/dist/linkImageComponent/index.cjs.js +2 -2
  96. package/dist/linkImageComponent/index.es.js +86 -81
  97. package/dist/linkImageComponent/index.umd.js +2 -2
  98. package/dist/listPagesComponent/index.cjs.js +5 -5
  99. package/dist/listPagesComponent/index.es.js +121 -116
  100. package/dist/listPagesComponent/index.umd.js +5 -5
  101. package/dist/presetPrintable/index.cjs.js +4 -4
  102. package/dist/presetPrintable/index.es.js +180 -175
  103. package/dist/presetPrintable/index.umd.js +4 -4
  104. package/dist/prosemirror/index.cjs.js +6 -6
  105. package/dist/prosemirror/index.es.js +128 -123
  106. package/dist/prosemirror/index.umd.js +8 -8
  107. package/dist/rendererReact/index.cjs.js +1 -1
  108. package/dist/rendererReact/index.es.js +127 -122
  109. package/dist/rendererReact/index.js +1 -1
  110. package/dist/rendererReact/index.umd.js +1 -1
  111. package/dist/rteTinyMce/index.cjs.js +2 -2
  112. package/dist/rteTinyMce/index.es.js +160 -155
  113. package/dist/rteTinyMce/index.umd.js +2 -2
  114. package/dist/shapeDividerComponent/index.cjs.js +25 -25
  115. package/dist/shapeDividerComponent/index.es.js +127 -122
  116. package/dist/shapeDividerComponent/index.umd.js +25 -25
  117. package/dist/swiperComponent/index.cjs.js +9 -9
  118. package/dist/swiperComponent/index.es.js +197 -192
  119. package/dist/swiperComponent/index.umd.js +9 -9
  120. package/dist/tableComponent/index.cjs.js +1 -1
  121. package/dist/tableComponent/index.es.js +227 -222
  122. package/dist/tableComponent/index.umd.js +1 -1
  123. package/dist/types.d.ts +1 -1
  124. package/dist/utils.d.ts +12 -1
  125. package/dist/youtubeAssetProvider/index.cjs.js +1 -1
  126. package/dist/youtubeAssetProvider/index.es.js +124 -119
  127. package/dist/youtubeAssetProvider/index.umd.js +1 -1
  128. package/package.json +5 -2
  129. package/dist/aiChat/components/AiChatInput.d.ts +0 -17
  130. package/dist/aiChat/server/stream-utils.d.ts +0 -16
@@ -1,7 +1,7 @@
1
- const Q = "app.grapesjs.com", ee = "app-stage.grapesjs.com", ae = "app2.grapesjs.com", le = "app-stage2.grapesjs.com", H = [
2
- Q,
3
- ae,
1
+ const ee = "app.grapesjs.com", te = "app-stage.grapesjs.com", ae = "app2.grapesjs.com", le = "app-stage2.grapesjs.com", G = [
4
2
  ee,
3
+ ae,
4
+ te,
5
5
  le,
6
6
  "localhost",
7
7
  "127.0.0.1",
@@ -11,83 +11,88 @@ const Q = "app.grapesjs.com", ee = "app-stage.grapesjs.com", ae = "app2.grapesjs
11
11
  // For stackblitz.com demos
12
12
  "-sandpack.codesandbox.io"
13
13
  // For Sandpack demos
14
- ], se = "license:check:start", ne = "license:check:end", ie = () => typeof window < "u", oe = ({ isDev: e, isStage: l }) => `${e ? "" : `https://${l ? ee : Q}`}/api`, re = () => {
15
- const e = ie() && window.location.hostname;
16
- return !!e && (H.includes(e) || H.some((l) => e.endsWith(l)));
14
+ ], ie = "license:check:start", se = "license:check:end", ne = () => typeof window < "u", oe = ({
15
+ isDev: e,
16
+ isStage: l,
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)));
17
21
  }, ce = (e) => e.replace(/[A-Z]+(?![a-z])|[A-Z]/g, (l, a) => (a ? "-" : "") + l.toLowerCase()), de = (e) => typeof e < "u";
18
22
  async function pe({
19
23
  path: e,
20
24
  baseApiUrl: l,
21
25
  method: a = "GET",
22
- headers: s = {},
23
- params: i,
24
- body: b
26
+ headers: i = {},
27
+ params: s,
28
+ body: f
25
29
  }) {
26
- const f = `${l || oe({ isDev: !1, isStage: !1 })}${e}`, d = {
30
+ const u = `${l || oe({ isDev: !1, isStage: !1 })}${e}`, b = {
27
31
  method: a,
28
32
  headers: {
29
33
  "Content-Type": "application/json",
30
- ...s
34
+ ...i
31
35
  }
32
36
  };
33
- b && (d.body = JSON.stringify(b));
34
- const u = i ? new URLSearchParams(i).toString() : "", o = u ? `?${u}` : "", h = await fetch(`${f}${o}`, d);
35
- if (!h.ok)
36
- throw new Error(`HTTP error! status: ${h.status}`);
37
- return h.json();
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();
38
42
  }
39
- var L = /* @__PURE__ */ ((e) => (e.free = "free", e.startup = "startup", e.business = "business", e.enterprise = "enterprise", e))(L || {});
40
- const G = {
41
- [L.free]: 0,
42
- [L.startup]: 10,
43
- [L.business]: 20,
44
- [L.enterprise]: 30
43
+ var x = /* @__PURE__ */ ((e) => (e.free = "free", e.startup = "startup", e.business = "business", e.enterprise = "enterprise", e))(x || {});
44
+ const U = {
45
+ [x.free]: 0,
46
+ [x.startup]: 10,
47
+ [x.business]: 20,
48
+ [x.enterprise]: 30
45
49
  };
46
50
  function ue(e) {
47
51
  const l = e;
48
- return l.init = (a) => (s) => e(s, a), l;
52
+ return l.init = (a) => (i) => e(i, a), l;
49
53
  }
50
54
  const be = (e) => /* @__PURE__ */ ue(e);
51
55
  async function fe({
52
56
  editor: e,
53
57
  plan: l,
54
58
  pluginName: a,
55
- licenseKey: s,
56
- cleanup: i
59
+ licenseKey: i,
60
+ onLicenseCheckResponse: s,
61
+ cleanup: f
57
62
  }) {
58
- let b = "", c = !1;
59
- const f = re(), d = (o) => {
60
- console.warn("Cleanup plugin:", a, "Reason:", o), i();
61
- }, u = (o = {}) => {
62
- var w;
63
- const { error: h, sdkLicense: t } = o, n = (w = o.plan) == null ? void 0 : w.category;
64
- if (!(t || o.license) || h)
65
- d(h || "Invalid license");
66
- else if (n) {
67
- const O = G[l], R = G[n];
68
- O > R && d({ pluginRequiredPlan: l, licensePlan: n });
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 });
69
74
  }
70
75
  };
71
- e.on(se, (o) => {
72
- b = o == null ? void 0 : o.baseApiUrl, c = !0;
73
- }), e.on(ne, (o) => {
74
- u(o);
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);
75
80
  }), setTimeout(async () => {
76
- if (!c) {
77
- if (f) return;
78
- if (s) {
79
- const o = await he({ licenseKey: s, pluginName: a, baseApiUrl: b });
80
- o && u(o);
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);
81
86
  } else
82
87
  d("The `licenseKey` option not provided");
83
88
  }
84
89
  }, 2e3);
85
90
  }
86
91
  async function he(e) {
87
- const { licenseKey: l, pluginName: a, baseApiUrl: s } = e;
92
+ const { licenseKey: l, pluginName: a, baseApiUrl: i } = e;
88
93
  try {
89
94
  return (await pe({
90
- baseApiUrl: s,
95
+ baseApiUrl: i,
91
96
  path: `/sdk/${l || "na"}`,
92
97
  method: "POST",
93
98
  params: {
@@ -95,53 +100,53 @@ async function he(e) {
95
100
  pn: a
96
101
  }
97
102
  })).result || {};
98
- } catch (i) {
99
- return console.error("Error during SDK license check:", i), !1;
103
+ } catch (s) {
104
+ return console.error("Error during SDK license check:", s), !1;
100
105
  }
101
106
  }
102
107
  const E = (e, l) => {
103
108
  var a;
104
109
  return !!((a = e == null ? void 0 : e.classList) != null && a.contains(l));
105
110
  }, ve = (e, l = {}) => {
106
- var b;
107
- const a = {}, s = [], i = [];
111
+ var f;
112
+ const a = {}, i = [], s = [];
108
113
  for (const c in e) {
109
- const { value: f, ...d } = e[c];
110
- s.push({ id: c, name: c, changeProp: !0, category: l.category, ...d }), a[c] = f, !de(f) && i.push(c);
111
- const { subTraits: u = {} } = d;
112
- for (const o in d.subTraits)
113
- (b = u[o]) == null || b.forEach((h) => {
114
- const t = h.id || h.name;
115
- a[t] = h.value;
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;
116
121
  });
117
122
  }
118
123
  return {
119
124
  propKeys: Object.keys(a),
120
- propsNoValues: i,
125
+ propsNoValues: s,
121
126
  props: a,
122
- traits: s
127
+ traits: i
123
128
  };
124
129
  }, me = (e, l) => {
125
130
  l.forEach((a) => {
126
131
  if (a.subTraits) {
127
- const s = `${a.id || a.name}`, i = a.changeProp ? `change:${s}` : `change:attributes:${s}`;
128
- e.on(i, () => U(e, s)), U(e, s);
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);
129
134
  }
130
135
  });
131
- }, U = (e, l) => {
132
- const a = e.getTrait(l), s = a.get("category"), i = a.get("subTraits") || {}, c = (Object.values(i).flat() || []).map((u) => u.id || u.name);
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);
133
138
  e.removeTrait(c);
134
- const f = i[a.getValue()], d = e.getTraitIndex(l) + 1;
135
- f && e.addTrait(
136
- f.map((u) => ({ category: s, ...u })),
137
- { at: d }
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 }
138
143
  );
139
144
  }, ge = (e, l) => {
140
145
  l.forEach((a) => {
141
- const s = ce(a);
142
- s !== a && e.has(s) && e.set({ [a]: e.get(s), [s]: void 0 });
146
+ const i = ce(a);
147
+ i !== a && e.has(i) && e.set({ [a]: e.get(i), [i]: void 0 });
143
148
  });
144
- }, m = "swiper", M = `${m}-slide`, k = `${m}-wrapper`, A = `${m}-nav-prev`, D = `${m}-nav-next`, _ = `${m}-pagination`, C = `${m}-scrollbar`, p = {
149
+ }, v = "swiper", O = `${v}-slide`, A = `${v}-wrapper`, L = `${v}-nav-prev`, $ = `${v}-nav-next`, k = `${v}-pagination`, M = `${v}-scrollbar`, p = {
145
150
  slider: `<svg viewBox="0 0 24 24">
146
151
  <path d="M22 7.6c0-1-.5-1.6-1.3-1.6H3.4C2.5 6 2 6.7 2 7.6v9.8c0 1 .5 1.6 1.3 1.6h17.4c.8 0 1.3-.6 1.3-1.6V7.6zM21 18H3V7h18v11z" fill-rule="nonzero"/>
147
152
  <path d="M4 12.5L6 14v-3zM20 12.5L18 14v-3z"/>
@@ -177,7 +182,7 @@ const E = (e, l) => {
177
182
  add: `<svg viewBox="0 0 24 24">
178
183
  <path d="M12 20a8 8 0 1 1 0-16 8 8 0 0 1 0 16m0-18A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2m1 5h-2v4H7v2h4v4h2v-4h4v-2h-4V7Z"/>
179
184
  </svg>`
180
- }, j = { id: "swiper-responsive", label: "Responsive", icon: p.responsive }, K = { id: "swiper-extra", label: "Extra", icon: p.extra }, ye = {
185
+ }, K = { id: "swiper-responsive", label: "Responsive", icon: p.responsive }, Z = { id: "swiper-extra", label: "Extra", icon: p.extra }, ye = {
181
186
  actions: {
182
187
  type: "radio",
183
188
  label: !1,
@@ -189,8 +194,8 @@ const E = (e, l) => {
189
194
  { id: "a", label: "Add new slide", icon: p.add }
190
195
  ],
191
196
  setValue: ({ component: e, value: l }) => {
192
- var s;
193
- const a = (s = e.getView()) == null ? void 0 : s.getSwiper();
197
+ var i;
198
+ const a = (i = e.getView()) == null ? void 0 : i.getSwiper();
194
199
  switch (l) {
195
200
  case "r":
196
201
  e.reloadSlider();
@@ -230,10 +235,10 @@ const E = (e, l) => {
230
235
  navigation: {
231
236
  type: "checkbox",
232
237
  label: "Navigation",
233
- getValue: ({ component: e }) => !!e.findFirstType(A),
238
+ getValue: ({ component: e }) => !!e.findFirstType(L),
234
239
  setValue: ({ component: e, value: l }) => {
235
- var a, s;
236
- l ? e.append([{ type: A }, { type: D }]) : ((a = e.findFirstType(A)) == null || a.remove(), (s = e.findFirstType(D)) == null || s.remove()), e.set({ navigation: 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 });
237
242
  }
238
243
  },
239
244
  initialSlide: {
@@ -541,10 +546,10 @@ const E = (e, l) => {
541
546
  { id: "progressbar", label: "Progressbar" },
542
547
  { id: "fraction", label: "Fraction" }
543
548
  ],
544
- getValue: ({ component: e }) => e.findFirstType(_) ? e.get("pagination") || "bullets" : "none",
549
+ getValue: ({ component: e }) => e.findFirstType(k) ? e.get("pagination") || "bullets" : "none",
545
550
  setValue: ({ component: e, value: l }) => {
546
- const a = e.findFirstType(_);
547
- a == null || a.remove(), l !== "none" && e.append({ type: _ }), e.set({ pagination: l });
551
+ const a = e.findFirstType(k);
552
+ a == null || a.remove(), l !== "none" && e.append({ type: k }), e.set({ pagination: l });
548
553
  },
549
554
  subTraits: {
550
555
  bullets: [
@@ -578,10 +583,10 @@ const E = (e, l) => {
578
583
  category: { id: "swiper-scrollbar", label: "Scrollbar", icon: p.scrollbar },
579
584
  type: "checkbox",
580
585
  label: "Enable Scrollbar",
581
- getValue: ({ component: e }) => !!e.findFirstType(C),
586
+ getValue: ({ component: e }) => !!e.findFirstType(M),
582
587
  setValue: ({ component: e, value: l }) => {
583
- const a = e.findFirstType(C);
584
- a == null || a.remove(), l && e.append({ type: C }), e.set({ scrollbar: l });
588
+ const a = e.findFirstType(M);
589
+ a == null || a.remove(), l && e.append({ type: M }), e.set({ scrollbar: l });
585
590
  },
586
591
  subTraits: {
587
592
  false: [],
@@ -611,7 +616,7 @@ const E = (e, l) => {
611
616
  value: !1
612
617
  },
613
618
  mobile: {
614
- category: j,
619
+ category: K,
615
620
  type: "checkbox",
616
621
  label: "Enable mobile breakpoint",
617
622
  value: !1,
@@ -654,7 +659,7 @@ const E = (e, l) => {
654
659
  }
655
660
  },
656
661
  tablet: {
657
- category: j,
662
+ category: K,
658
663
  type: "checkbox",
659
664
  label: "Enable tablet breakpoint",
660
665
  value: !1,
@@ -697,24 +702,24 @@ const E = (e, l) => {
697
702
  }
698
703
  },
699
704
  allowTouchMove: {
700
- category: K,
705
+ category: Z,
701
706
  type: "checkbox",
702
707
  label: "Allow touch move",
703
708
  tip: "Allow touch interactions",
704
709
  value: !0
705
710
  },
706
711
  grabCursor: {
707
- category: K,
712
+ category: Z,
708
713
  type: "checkbox",
709
714
  label: "Grab cursor",
710
715
  tip: 'If enabled, the user will see the "grab" cursor when hover the slider',
711
716
  value: !1
712
717
  }
713
- }, Z = "Slider", q = "swiper", N = `${q}-`, Se = (e, l) => {
714
- const { Components: a, Blocks: s, Commands: i } = e, { block: b } = l, c = ve(ye), f = "core:preview", d = i.events, u = function(t) {
715
- const n = this, T = window, w = n.__onLoad, O = n.__activeSlide, R = n.__inPreview, te = T._isEditor && !R ? t.autoplayEditor : !0, { cdnScript: $, cdnStyle: I, slidesPerView: W } = t || {}, r = (y) => isNaN(y) ? void 0 : parseFloat(y), z = () => {
716
- const y = n.parentElement;
717
- y && (y.style.minWidth = "0");
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");
718
723
  const P = {
719
724
  loop: t.loop,
720
725
  speed: t.speed,
@@ -728,7 +733,7 @@ const E = (e, l) => {
728
733
  grabCursor: t.grabCursor,
729
734
  simulateTouch: !0,
730
735
  breakpoints: {},
731
- slidesPerView: isNaN(W) ? W : r(W),
736
+ slidesPerView: isNaN(F) ? F : r(F),
732
737
  slidesPerGroup: r(t.slidesPerGroup),
733
738
  spaceBetween: r(t.spaceBetween),
734
739
  slidesOffsetBefore: r(t.slidesOffsetBefore),
@@ -760,22 +765,22 @@ const E = (e, l) => {
760
765
  slideShadows: t.cardsEffectSlideShadows
761
766
  },
762
767
  navigation: {
763
- nextEl: n.querySelector(".swiper-button-next"),
764
- prevEl: n.querySelector(".swiper-button-prev")
768
+ nextEl: o.querySelector(".swiper-button-next"),
769
+ prevEl: o.querySelector(".swiper-button-prev")
765
770
  },
766
771
  pagination: {
767
772
  type: t.pagination || "bullets",
768
773
  dynamicBullets: t.dynamicBullets,
769
774
  clickable: t.clickableBullets,
770
775
  progressbarOpposite: t.progressbarOpposite,
771
- el: n.querySelector(".swiper-pagination")
776
+ el: o.querySelector(".swiper-pagination")
772
777
  },
773
778
  scrollbar: {
774
- el: n.querySelector(".swiper-scrollbar"),
779
+ el: o.querySelector(".swiper-scrollbar"),
775
780
  draggable: t.scrollbarDraggable,
776
781
  hide: t.scrollbarHide
777
782
  },
778
- autoplay: t.autoplay && te && {
783
+ autoplay: t.autoplay && R && {
779
784
  delay: t.autoplayDelay,
780
785
  disableOnInteraction: t.autoplayDisableOnInteraction,
781
786
  pauseOnMouseEnter: t.autoplayPauseOnMouseEnter,
@@ -785,70 +790,70 @@ const E = (e, l) => {
785
790
  }
786
791
  };
787
792
  if (t.tablet) {
788
- const { tabletBreakpoint: x, tabletSlidesPerView: g } = t, v = r(x);
789
- P.breakpoints[v] = {
793
+ const { tabletBreakpoint: T, tabletSlidesPerView: g } = t, h = r(T);
794
+ P.breakpoints[h] = {
790
795
  slidesPerView: isNaN(g) ? g : r(g),
791
796
  slidesPerGroup: r(t.tabletSlidesPerGroup),
792
797
  spaceBetween: r(t.tabletSpaceBetween)
793
798
  };
794
799
  }
795
800
  if (t.mobile) {
796
- const { mobileBreakpoint: x, mobileSlidesPerView: g } = t, v = r(x);
797
- P.breakpoints[v] = {
801
+ const { mobileBreakpoint: T, mobileSlidesPerView: g } = t, h = r(T);
802
+ P.breakpoints[h] = {
798
803
  slidesPerView: isNaN(g) ? g : r(g),
799
804
  slidesPerGroup: r(t.mobileSlidesPerGroup),
800
805
  spaceBetween: r(t.mobileSpaceBetween)
801
806
  };
802
807
  }
803
- w && !R && (P.simulateTouch = !1), O && (P.initialSlide = O);
804
- const F = new T.Swiper(n, P);
805
- w == null || w(F);
808
+ N && !B && (P.simulateTouch = !1), C && (P.initialSlide = C);
809
+ const q = new y.Swiper(o, P);
810
+ N == null || N(q);
806
811
  };
807
- if (T.Swiper)
808
- z();
812
+ if (y.Swiper)
813
+ H();
809
814
  else {
810
- const { head: y } = document, P = Array.isArray($) ? [...$] : [$], F = Array.isArray(I) ? [...I] : [I], x = (v) => {
811
- if (v.length) {
812
- const S = document.createElement("link");
813
- S.href = v.shift(), S.rel = "stylesheet", y.prepend(S), x(v);
815
+ const { head: S } = document, P = Array.isArray(I) ? [...I] : [I], q = Array.isArray(W) ? [...W] : [W], T = (h) => {
816
+ if (h.length) {
817
+ const w = document.createElement("link");
818
+ w.href = h.shift(), w.rel = "stylesheet", S.prepend(w), T(h);
814
819
  }
815
- }, g = (v) => {
816
- if (v.length) {
817
- const S = document.createElement("script");
818
- S.src = v.shift(), S.onerror = S.onload = g.bind(null, v), y.appendChild(S);
820
+ }, g = (h) => {
821
+ 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);
819
824
  } else
820
- z();
825
+ H();
821
826
  };
822
- x(F), g(P);
827
+ T(q), g(P);
823
828
  }
824
- }, o = (t = 0) => ({
825
- type: M,
829
+ }, m = (t = 0) => ({
830
+ type: O,
826
831
  style: { padding: "50px" },
827
832
  components: { type: "text", components: { type: "textnode", content: `Slide ${t}` } }
828
- }), h = a.getType("default").model;
829
- return a.addType(m, {
830
- block: b && {
831
- label: Z,
833
+ }), n = a.getType("default").model;
834
+ return a.addType(v, {
835
+ block: f && {
836
+ label: Y,
832
837
  media: p.slider,
833
838
  category: "Extra",
834
839
  select: !0,
835
840
  ...l.block
836
841
  },
837
- isComponent: (t) => E(t, q),
842
+ isComponent: (t) => E(t, z),
838
843
  model: {
839
844
  defaults: () => ({
840
- name: Z,
845
+ name: Y,
841
846
  icon: p.slider,
842
- classes: q,
843
- draggable: (t, n) => !n.is(m),
847
+ classes: z,
848
+ draggable: (t, o) => !o.is(v),
844
849
  components: [
845
850
  {
846
- type: k,
847
- components: [o(1), o(2), o(3)]
851
+ type: A,
852
+ components: [m(1), m(2), m(3)]
848
853
  },
849
- { type: _ }
854
+ { type: k }
850
855
  ],
851
- script: u,
856
+ script: d,
852
857
  cdnScript: l.cdnScript,
853
858
  cdnStyle: l.cdnStyle,
854
859
  "script-props": ["cdnScript", "cdnStyle", ...c.propKeys],
@@ -857,7 +862,7 @@ const E = (e, l) => {
857
862
  }),
858
863
  init() {
859
864
  const { em: t } = this;
860
- me(this, c.traits), ge(this, c.propKeys), this.listenTo(t, `${d.runCommand}${f}`, this.onPreviewOn), this.listenTo(t, `${d.stopCommand}${f}`, this.onPreviewOff);
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);
861
866
  },
862
867
  onPreviewOn() {
863
868
  this.__inPreview = !0, this.reloadSlider();
@@ -869,20 +874,20 @@ const E = (e, l) => {
869
874
  this.trigger("rerender");
870
875
  },
871
876
  addSlide() {
872
- const t = this.findFirstType(k);
877
+ const t = this.findFirstType(A);
873
878
  t == null || t.append(this.getNewSlideComponentDef());
874
879
  },
875
880
  getNewSlideComponentDef() {
876
- var n;
877
- const t = ((n = this.findFirstType(k)) == null ? void 0 : n.components().length) || 0;
881
+ var o;
882
+ const t = ((o = this.findFirstType(A)) == null ? void 0 : o.components().length) || 0;
878
883
  return {
879
- type: M,
884
+ type: O,
880
885
  components: { type: "text", components: { type: "textnode", content: `Slide ${t + 1}` } }
881
886
  };
882
887
  },
883
888
  toJSON(...t) {
884
- const n = h.prototype.toJSON.apply(this, t);
885
- return c.propsNoValues.forEach((T) => delete n[T]), delete n["script-props"], n;
889
+ const o = n.prototype.toJSON.apply(this, t);
890
+ return c.propsNoValues.forEach((y) => delete o[y]), delete o["script-props"], o;
886
891
  }
887
892
  },
888
893
  view: {
@@ -898,14 +903,14 @@ const E = (e, l) => {
898
903
  },
899
904
  onRender() {
900
905
  const t = this.el;
901
- t.__onLoad = (n) => n.on("slideChange", () => this.__activeSlide = n.activeIndex), t.__activeSlide = this.__activeSlide, t.__inPreview = this.model.__inPreview;
906
+ t.__onLoad = (o) => o.on("slideChange", () => this.__activeSlide = o.activeIndex), t.__activeSlide = this.__activeSlide, t.__inPreview = this.model.__inPreview;
902
907
  }
903
908
  }
904
909
  }), () => {
905
- a.removeType(m), s.remove(m);
910
+ a.removeType(v), i.remove(v);
906
911
  };
907
- }, we = "Nav Prev", Pe = "Nav Next", B = `${N}button-prev`, V = `${N}button-next`, Ee = (e) => {
908
- const { Components: l } = e, a = (s) => ({
912
+ }, we = "Nav Prev", Pe = "Nav Next", V = `${_}button-prev`, D = `${_}button-next`, Ee = (e) => {
913
+ const { Components: l } = e, a = (i) => ({
909
914
  type: "svg",
910
915
  selectable: !1,
911
916
  hoverable: !1,
@@ -913,15 +918,15 @@ const E = (e, l) => {
913
918
  components: {
914
919
  type: "svg-in",
915
920
  tagName: "path",
916
- attributes: { d: s, fill: "currentColor" }
921
+ attributes: { d: i, fill: "currentColor" }
917
922
  }
918
923
  });
919
- return l.addType(A, {
920
- isComponent: (s) => E(s, B),
924
+ return l.addType(L, {
925
+ isComponent: (i) => E(i, V),
921
926
  model: {
922
927
  defaults: {
923
928
  name: we,
924
- classes: B,
929
+ classes: V,
925
930
  copyable: !1,
926
931
  highlightable: !1,
927
932
  droppable: !1,
@@ -931,40 +936,40 @@ const E = (e, l) => {
931
936
  layerable: !1,
932
937
  components: a("M0,22L22,0l2.1,2.1L4.2,22l19.9,19.9L22,44L0,22L0,22L0,22z"),
933
938
  styles: `
934
- .${B} {
939
+ .${V} {
935
940
  color: inherit;
936
941
  }
937
- .${B}:after {
942
+ .${V}:after {
938
943
  content: none;
939
944
  }
940
945
  `
941
946
  }
942
947
  }
943
- }), l.addType(D, {
944
- extend: A,
945
- isComponent: (s) => E(s, V),
948
+ }), l.addType($, {
949
+ extend: L,
950
+ isComponent: (i) => E(i, D),
946
951
  model: {
947
952
  defaults: {
948
953
  name: Pe,
949
- classes: V,
954
+ classes: D,
950
955
  components: a("M27,22L27,22L5,44l-2.1-2.1L22.8,22L2.9,2.1L5,0L27,22L27,22z"),
951
956
  styles: `
952
- .${V} {
957
+ .${D} {
953
958
  color: inherit;
954
959
  }
955
- .${V}:after {
960
+ .${D}:after {
956
961
  content: none;
957
962
  }
958
963
  `
959
964
  }
960
965
  }
961
966
  }), () => {
962
- l.removeType(A), l.removeType(D);
967
+ l.removeType(L), l.removeType($);
963
968
  };
964
969
  }, Te = (e) => {
965
- const { Components: l } = e, a = `${N}pagination`;
966
- return l.addType(_, {
967
- isComponent: (s) => E(s, a),
970
+ const { Components: l } = e, a = `${_}pagination`;
971
+ return l.addType(k, {
972
+ isComponent: (i) => E(i, a),
968
973
  model: {
969
974
  defaults: {
970
975
  name: "Pagination",
@@ -987,16 +992,16 @@ const E = (e, l) => {
987
992
  }
988
993
  }
989
994
  }), () => {
990
- l.removeType(_);
995
+ l.removeType(k);
991
996
  };
992
- }, xe = "Scrollbar", Y = `${N}scrollbar`, Le = (e) => {
997
+ }, xe = "Scrollbar", X = `${_}scrollbar`, Ae = (e) => {
993
998
  const { Components: l } = e;
994
- return l.addType(C, {
995
- isComponent: (a) => E(a, Y),
999
+ return l.addType(M, {
1000
+ isComponent: (a) => E(a, X),
996
1001
  model: {
997
1002
  defaults: {
998
1003
  name: xe,
999
- classes: Y,
1004
+ classes: X,
1000
1005
  copyable: !1,
1001
1006
  highlightable: !1,
1002
1007
  removable: !1,
@@ -1008,72 +1013,72 @@ const E = (e, l) => {
1008
1013
  }
1009
1014
  }
1010
1015
  }), () => {
1011
- l.removeType(C);
1016
+ l.removeType(M);
1012
1017
  };
1013
- }, ke = "Slide", X = `${N}slide`, Ae = (e) => {
1018
+ }, Le = "Slide", J = `${_}slide`, ke = (e) => {
1014
1019
  const { Components: l } = e;
1015
- return l.addType(M, {
1016
- isComponent: (a) => E(a, X),
1020
+ return l.addType(O, {
1021
+ isComponent: (a) => E(a, J),
1017
1022
  model: {
1018
1023
  defaults: {
1019
- name: ke,
1020
- classes: X,
1024
+ name: Le,
1025
+ classes: J,
1021
1026
  icon: p.slider,
1022
- draggable: (a, s) => s.is(k)
1027
+ draggable: (a, i) => i.is(A)
1023
1028
  }
1024
1029
  // TODO VIEW slide to this slide when selected
1025
1030
  }
1026
1031
  }), () => {
1027
- l.removeType(M);
1032
+ l.removeType(O);
1028
1033
  };
1029
- }, _e = "Wrapper", J = `${N}wrapper`, Ne = (e) => {
1034
+ }, _e = "Wrapper", Q = `${_}wrapper`, Ne = (e) => {
1030
1035
  const { Components: l } = e, { events: a } = l;
1031
- return l.addType(k, {
1032
- isComponent: (s) => E(s, J),
1036
+ return l.addType(A, {
1037
+ isComponent: (i) => E(i, Q),
1033
1038
  model: {
1034
1039
  defaults: {
1035
1040
  name: _e,
1036
1041
  icon: p.slider,
1037
- classes: J,
1042
+ classes: Q,
1038
1043
  copyable: !1,
1039
1044
  removable: !1,
1040
1045
  draggable: !1,
1041
1046
  highlightable: !1,
1042
- droppable: (s) => s.is(M)
1047
+ droppable: (i) => i.is(O)
1043
1048
  },
1044
1049
  init() {
1045
- const s = this.components();
1046
- this.listenTo(s, "add remove", this.updateSlider);
1050
+ const i = this.components();
1051
+ this.listenTo(i, "add remove", this.updateSlider);
1047
1052
  },
1048
- updateSlider(s) {
1049
- const i = this.closestType(m);
1050
- if (i) {
1051
- const b = i.getView();
1052
- i.reloadSlider(), this.em.once(a.scriptMount, () => {
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, () => {
1053
1058
  setTimeout(() => {
1054
1059
  var c;
1055
- return (c = b.getSwiper()) == null ? void 0 : c.slideTo(s.index());
1060
+ return (c = f.getSwiper()) == null ? void 0 : c.slideTo(i.index());
1056
1061
  }, 100);
1057
1062
  });
1058
1063
  }
1059
1064
  }
1060
1065
  }
1061
1066
  }), () => {
1062
- l.removeType(k);
1067
+ l.removeType(A);
1063
1068
  };
1064
- }, Ce = "swiperComponent", Me = L.startup, Oe = function(e, l = {}) {
1069
+ }, Ce = "swiperComponent", Me = x.startup, Oe = function(e, l = {}) {
1065
1070
  const a = {
1066
1071
  block: {},
1067
1072
  cdnScript: "https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.js",
1068
1073
  cdnStyle: "https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css",
1069
1074
  ...l
1070
- }, s = [
1075
+ }, i = [
1071
1076
  Se(e, a),
1072
1077
  Ee(e),
1073
1078
  Ne(e),
1074
- Ae(e),
1079
+ ke(e),
1075
1080
  Te(e),
1076
- Le(e)
1081
+ Ae(e)
1077
1082
  ];
1078
1083
  fe({
1079
1084
  editor: e,
@@ -1081,10 +1086,10 @@ const E = (e, l) => {
1081
1086
  licenseKey: a.licenseKey,
1082
1087
  pluginName: Ce,
1083
1088
  cleanup: () => {
1084
- s.forEach((i) => i());
1089
+ i.forEach((s) => s());
1085
1090
  }
1086
1091
  });
1087
- }, Re = be(Oe);
1092
+ }, Be = be(Oe);
1088
1093
  export {
1089
- Re as default
1094
+ Be as default
1090
1095
  };