@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 P = "app.grapesjs.com", z = "app-stage.grapesjs.com", O = "app2.grapesjs.com", V = "app-stage2.grapesjs.com", A = [
2
- P,
3
- O,
1
+ const G = "app.grapesjs.com", z = "app-stage.grapesjs.com", F = "app2.grapesjs.com", N = "app-stage2.grapesjs.com", D = [
2
+ G,
3
+ F,
4
4
  z,
5
- V,
5
+ N,
6
6
  "localhost",
7
7
  "127.0.0.1",
8
8
  ".local-credentialless.webcontainer.io",
@@ -11,182 +11,195 @@ const P = "app.grapesjs.com", z = "app-stage.grapesjs.com", O = "app2.grapesjs.c
11
11
  // For stackblitz.com demos
12
12
  "-sandpack.codesandbox.io"
13
13
  // For Sandpack demos
14
- ], B = "license:check:start", F = "license:check:end", X = () => typeof window < "u", M = ({
14
+ ], V = "license:check:end", X = () => typeof window < "u", j = ({
15
15
  isDev: t,
16
- isStage: n,
16
+ isStage: e,
17
17
  isPlatform: a
18
- }) => `${t ? "" : `https://${n ? z : P}`}/${a ? "platform-api" : "api"}`, j = () => {
18
+ }) => `${t ? "" : `https://${e ? z : G}`}/${a ? "platform-api" : "api"}`, $ = () => {
19
19
  const t = X() && window.location.hostname;
20
- return !!t && (A.includes(t) || A.some((n) => t.endsWith(n)));
20
+ return !!t && (D.includes(t) || D.some((e) => t.endsWith(e)));
21
21
  };
22
- async function _({
22
+ async function Y({
23
23
  path: t,
24
- baseApiUrl: n,
24
+ baseApiUrl: e,
25
25
  method: a = "GET",
26
- headers: s = {},
27
- params: o,
28
- body: i
26
+ headers: r = {},
27
+ params: i,
28
+ body: o
29
29
  }) {
30
- const m = `${n || M({ isDev: !1, isStage: !1 })}${t}`, l = {
30
+ const s = `${e || j({ isDev: !1, isStage: !1 })}${t}`, p = {
31
31
  method: a,
32
32
  headers: {
33
33
  "Content-Type": "application/json",
34
- ...s
34
+ ...r
35
35
  }
36
36
  };
37
- i && (l.body = JSON.stringify(i));
38
- const p = o ? new URLSearchParams(o).toString() : "", u = p ? `?${p}` : "", e = await fetch(`${m}${u}`, l);
39
- if (!e.ok)
40
- throw new Error(`HTTP error! status: ${e.status}`);
41
- return e.json();
37
+ o && (p.body = JSON.stringify(o));
38
+ const m = i ? new URLSearchParams(i).toString() : "", d = m ? `?${m}` : "", n = await fetch(`${s}${d}`, p);
39
+ if (!n.ok)
40
+ throw new Error(`HTTP error! status: ${n.status}`);
41
+ return n.json();
42
42
  }
43
- var b = /* @__PURE__ */ ((t) => (t.free = "free", t.startup = "startup", t.business = "business", t.enterprise = "enterprise", t))(b || {});
44
- const C = {
43
+ var b = /* @__PURE__ */ ((t) => (t.free = "free", t.startup = "startup", t.business = "business", t.enterprise = "enterprise", t))(b || {}), P = /* @__PURE__ */ ((t) => (t.toastAdd = "studio:toastAdd", t.toastRemove = "studio:toastRemove", t.dialogOpen = "studio:dialogOpen", t.dialogClose = "studio:dialogClose", t.dialogExportCode = "studio:dialogExportCode", t.dialogImportCode = "studio:dialogImportCode", t.sidebarLeftSet = "studio:sidebarLeft:set", t.sidebarLeftGet = "studio:sidebarLeft:get", t.sidebarLeftToggle = "studio:sidebarLeft:toggle", t.sidebarRightSet = "studio:sidebarRight:set", t.sidebarRightGet = "studio:sidebarRight:get", t.sidebarRightToggle = "studio:sidebarRight:toggle", t.sidebarTopSet = "studio:sidebarTop:set", t.sidebarTopGet = "studio:sidebarTop:get", t.sidebarTopToggle = "studio:sidebarTop:toggle", t.sidebarBottomSet = "studio:sidebarBottom:set", t.sidebarBottomGet = "studio:sidebarBottom:get", t.sidebarBottomToggle = "studio:sidebarBottom:toggle", t.symbolAdd = "studio:symbolAdd", t.symbolDetach = "studio:symbolDetach", t.symbolOverride = "studio:symbolOverride", t.symbolPropagateStyles = "studio:propagateStyles", t.getPagesConfig = "studio:getPagesConfig", t.setPagesConfig = "studio:setPagesConfig", t.getPageSettings = "studio:getPageSettings", t.setPageSettings = "studio:setPageSettings", t.clearPage = "studio:clearPage", t.projectFiles = "studio:projectFiles", t.validateCode = "studio:validateCode", t.canvasReload = "studio:canvasReload", t.getBlocksPanel = "studio:getBlocksPanel", t.setBlocksPanel = "studio:setBlocksPanel", t.getStateContextMenu = "studio:getStateContextMenu", t.setStateContextMenu = "studio:setStateContextMenu", t.contextMenuComponent = "studio:contextMenuComponent", t.layoutAdd = "studio:layoutAdd", t.layoutRemove = "studio:layoutRemove", t.layoutToggle = "studio:layoutToggle", t.layoutUpdate = "studio:layoutUpdate", t.layoutGet = "studio:layoutGet", t.layoutConfigGet = "studio:layoutConfigGet", t.layoutConfigSet = "studio:layoutConfigSet", t.layoutComponentAdd = "studio:layoutComponentAdd", t.layoutComponentGet = "studio:layoutComponentGet", t.layoutComponentRemove = "studio:layoutComponentRemove", t.layoutComponentRender = "studio:layoutComponentRender", t.getStateTheme = "studio:getStateTheme", t.setStateTheme = "studio:setStateTheme", t.settings = "studio:settings", t.assetProviderGet = "studio:assetProviderGet", t.assetProviderAdd = "studio:assetProviderAdd", t.assetProviderRemove = "studio:assetProviderRemove", t.fontGet = "studio:fontGet", t.fontAdd = "studio:fontAdd", t.fontRemove = "studio:fontRemove", t.fontManagerOpen = "studio:fontManagerOpen", t.menuFontLoad = "studio:menuFontLoad", t.toggleStateDataSource = "studio:toggleStateDataSource", t.getStateDataSource = "studio:getStateDataSource", t.dataSourceSetGlobalData = "studio:dataSourceSetGlobalData", t.dataSourceSetImporter = "studio:dataSourceSetImporter", t.dataSourceSetExporter = "studio:dataSourceSetExporter", t.setDragAbsolute = "studio:setDragAbsolute", t))(P || {});
44
+ const L = {
45
45
  [b.free]: 0,
46
46
  [b.startup]: 10,
47
47
  [b.business]: 20,
48
48
  [b.enterprise]: 30
49
49
  };
50
- function $(t) {
51
- const n = t;
52
- return n.init = (a) => (s) => t(s, a), n;
50
+ function C(t) {
51
+ const e = t;
52
+ return e.init = (a) => (r) => t(r, a), e;
53
53
  }
54
- const W = (t) => /* @__PURE__ */ $(t);
55
- async function Y({
54
+ const W = (t) => /* @__PURE__ */ C(t);
55
+ async function _({
56
56
  editor: t,
57
- plan: n,
57
+ plan: e,
58
58
  pluginName: a,
59
- licenseKey: s,
60
- onLicenseCheckResponse: o,
61
- cleanup: i
59
+ licenseKey: r,
60
+ onLicenseCheckResponse: i,
61
+ cleanup: o
62
62
  }) {
63
- let r = "", m = !1;
64
- const l = j(), p = (e) => {
65
- console.warn("Cleanup plugin:", a, "Reason:", e), i();
66
- }, u = (e = {}) => {
67
- var k;
68
- const { error: c, sdkLicense: d } = e, h = (k = e.plan) == null ? void 0 : k.category;
69
- if (!(d || e.license) || c)
63
+ let l = "", s;
64
+ const p = (n) => {
65
+ console.warn("Cleanup plugin:", a, "Reason:", n), o();
66
+ }, m = (n = {}) => {
67
+ var R;
68
+ const { error: c, sdkLicense: f } = n, h = (R = n.plan) == null ? void 0 : R.category;
69
+ if (!(f || n.license) || c)
70
70
  p(c || "Invalid license");
71
71
  else if (h) {
72
- const U = C[n], G = C[h];
73
- U > G && p({ pluginRequiredPlan: n, licensePlan: h });
72
+ const E = L[e], M = L[h];
73
+ E > M && p({ pluginRequiredPlan: e, licensePlan: h });
74
74
  }
75
75
  };
76
- t.on(B, (e) => {
77
- r = e == null ? void 0 : e.baseApiUrl, m = !0;
78
- }), t.on(F, (e) => {
79
- o == null || o(e), u(e);
80
- }), setTimeout(async () => {
81
- if (!m) {
82
- if (l) return;
83
- if (s) {
84
- const e = await H({ licenseKey: s, pluginName: a, baseApiUrl: r });
85
- o == null || o(e), e && u(e);
86
- } else
87
- p("The `licenseKey` option not provided");
88
- }
89
- }, 2e3);
76
+ t.Commands.has(P.settings) && (s = t.runCommand(P.settings), l = (s == null ? void 0 : s.baseUrl) || "");
77
+ const d = (n) => {
78
+ i == null || i(n), n && m(n);
79
+ };
80
+ if (!s) {
81
+ t.onReady(async () => {
82
+ if (!$())
83
+ if (r) {
84
+ const n = await K({ licenseKey: r, pluginName: a, baseApiUrl: l });
85
+ d(n);
86
+ } else
87
+ p("The `licenseKey` option not provided");
88
+ });
89
+ return;
90
+ }
91
+ if (s.licensePlan || s.licenseError) {
92
+ const n = H(s);
93
+ d(n);
94
+ return;
95
+ }
96
+ t.on(V, (n) => d(n));
90
97
  }
91
- async function H(t) {
92
- const { licenseKey: n, pluginName: a, baseApiUrl: s } = t;
98
+ const H = (t) => ({
99
+ sdkLicense: t.license,
100
+ license: t.license,
101
+ error: t.licenseError,
102
+ plan: t.licensePlan
103
+ });
104
+ async function K(t) {
105
+ const { licenseKey: e, pluginName: a, baseApiUrl: r } = t;
93
106
  try {
94
- return (await _({
95
- baseApiUrl: s,
96
- path: `/sdk/${n || "na"}`,
107
+ return (await Y({
108
+ baseApiUrl: r,
109
+ path: `/sdk/${e || "na"}`,
97
110
  method: "POST",
98
111
  params: {
99
112
  d: window.location.hostname,
100
113
  pn: a
101
114
  }
102
115
  })).result || {};
103
- } catch (o) {
104
- return console.error("Error during SDK license check:", o), !1;
116
+ } catch (i) {
117
+ return console.error("Error during SDK license check:", i), !1;
105
118
  }
106
119
  }
107
- const K = (...t) => (n) => t.some((a) => n.is(a));
108
- var f = /* @__PURE__ */ ((t) => (t.name = "animation-name", t.duration = "animation-duration", t.delay = "animation-delay", t.iterationCount = "animation-iteration-count", t.timingFunction = "animation-timing-function", t.fillMode = "animation-fill-mode", t))(f || {}), v = /* @__PURE__ */ ((t) => (t.onScroll = "--animation-on-scroll", t.threshold = "--animation-threshold", t.repeat = "--animation-repeat", t))(v || {});
109
- const g = "animation", I = "animation-group", D = "animation:update", E = "animation-group:update", Z = {
120
+ const q = (...t) => (e) => t.some((a) => e.is(a));
121
+ var u = /* @__PURE__ */ ((t) => (t.name = "animation-name", t.duration = "animation-duration", t.delay = "animation-delay", t.iterationCount = "animation-iteration-count", t.timingFunction = "animation-timing-function", t.fillMode = "animation-fill-mode", t))(u || {}), v = /* @__PURE__ */ ((t) => (t.onScroll = "--animation-on-scroll", t.threshold = "--animation-threshold", t.repeat = "--animation-repeat", t))(v || {});
122
+ const y = "animation", I = "animation-group", T = "animation:update", w = "animation-group:update", B = {
110
123
  category: { id: "animations", label: "Animations" },
111
124
  select: !0
112
- }, w = (t) => (t == null ? void 0 : t.getType()) === g, x = (t) => (t == null ? void 0 : t.getType()) === I, R = (t) => w(t) || x(t), S = {
113
- isVisible: ({ component: t }) => w(t)
114
- }, q = {
115
- isVisible: ({ component: t }) => x(t)
125
+ }, k = (t) => (t == null ? void 0 : t.getType()) === y, A = (t) => (t == null ? void 0 : t.getType()) === I, O = (t) => k(t) || A(t), x = {
126
+ isVisible: ({ component: t }) => k(t)
116
127
  }, J = {
117
- isVisible: ({ component: t }) => w(t) && x(t == null ? void 0 : t.parent()) ? !1 : R(t)
118
- }, L = {
119
- isVisible: ({ component: t, sector: n }) => {
128
+ isVisible: ({ component: t }) => A(t)
129
+ }, Q = {
130
+ isVisible: ({ component: t }) => k(t) && A(t == null ? void 0 : t.parent()) ? !1 : O(t)
131
+ }, S = {
132
+ isVisible: ({ component: t, sector: e }) => {
120
133
  var a;
121
- return w(t) && x(t == null ? void 0 : t.parent()) ? !1 : R(t) && ((a = n.getProperty(v.onScroll)) == null ? void 0 : a.getValue()) === "true";
134
+ return k(t) && A(t == null ? void 0 : t.parent()) ? !1 : O(t) && ((a = e.getProperty(v.onScroll)) == null ? void 0 : a.getValue()) === "true";
122
135
  }
123
- }, N = {
136
+ }, Z = {
124
137
  animation: '<svg viewBox="0 0 24 24"><path fill="currentColor" d="M16.5 14a6.5 6.5 0 1 0 0-13 6.5 6.5 0 0 0 0 13"/><path fill="currentColor" d="M17.14 15.98a8.5 8.5 0 0 1-9.12-9.12 6.5 6.5 0 1 0 9.12 9.12"/><path fill="currentColor" d="M12.64 20.48a8.5 8.5 0 0 1-9.12-9.12 6.5 6.5 0 1 0 9.12 9.12"/></svg>',
125
138
  animationGroup: '<svg viewBox="0 0 24 24"><path d="M4 2a2 2 0 0 0-2 2v10h2V4h10V2H4m4 4a2 2 0 0 0-2 2v10h2V8h10V6H8m4 4a2 2 0 0 0-2 2v8c0 1.1.9 2 2 2h8a2 2 0 0 0 2-2v-8a2 2 0 0 0-2-2h-8Z"/></svg>'
126
- }, Q = function(t) {
127
- const n = this;
139
+ }, tt = function(t) {
140
+ const e = this;
128
141
  let a = null;
129
- const s = () => {
142
+ const r = () => {
130
143
  a == null || a.disconnect(), a = null;
131
- }, o = () => {
132
- s();
133
- const i = n.style;
134
- i.animationName = "", requestAnimationFrame(() => {
135
- const r = getComputedStyle(n), m = r.getPropertyValue("animation-name").trim(), l = r.getPropertyValue("--animation-on-scroll").trim() !== "false", p = parseFloat(r.getPropertyValue("--animation-threshold").trim()) || 0.2, u = r.getPropertyValue("--animation-repeat").trim() === "true", e = () => {
136
- i.animationName = "none", n.offsetWidth, i.animationName = m, i.animationPlayState = "running";
144
+ }, i = () => {
145
+ r();
146
+ const o = e.style;
147
+ o.animationName = "", requestAnimationFrame(() => {
148
+ const l = getComputedStyle(e), s = l.getPropertyValue("animation-name").trim(), p = l.getPropertyValue("--animation-on-scroll").trim() !== "false", m = parseFloat(l.getPropertyValue("--animation-threshold").trim()) || 0.2, d = l.getPropertyValue("--animation-repeat").trim() === "true", n = () => {
149
+ o.animationName = "none", e.offsetWidth, o.animationName = s, o.animationPlayState = "running";
137
150
  };
138
- if (!m || m === "none") {
139
- i.animationName = "none", i.animationPlayState = "paused";
151
+ if (!s || s === "none") {
152
+ o.animationName = "none", o.animationPlayState = "paused";
140
153
  return;
141
154
  }
142
- if (!l) {
143
- e();
155
+ if (!p) {
156
+ n();
144
157
  return;
145
158
  }
146
- i.animationPlayState = "paused", a = new IntersectionObserver(
159
+ o.animationPlayState = "paused", a = new IntersectionObserver(
147
160
  (c) => {
148
- c.forEach((d) => {
149
- d.isIntersecting && (e(), !u && s());
161
+ c.forEach((f) => {
162
+ f.isIntersecting && (n(), !d && r());
150
163
  });
151
164
  },
152
- { threshold: p }
153
- ), a.observe(n);
165
+ { threshold: m }
166
+ ), a.observe(e);
154
167
  });
155
168
  };
156
- n.addEventListener(t.animationUpdateEvent, o), o();
157
- }, tt = (t, n) => {
158
- const { Components: a, Blocks: s, Canvas: o } = t, { block: i = {}, animationList: r = [] } = n, m = t.Components.events, l = "Animation", p = Object.values(v), u = Object.values(f);
159
- return a.addType(g, {
160
- block: i ? {
161
- label: l,
162
- media: N.animation,
163
- content: { type: g },
164
- ...Z,
165
- ...i
169
+ e.addEventListener(t.animationUpdateEvent, i), i();
170
+ }, et = (t, e) => {
171
+ const { Components: a, Blocks: r, Canvas: i } = t, { block: o = {}, animationList: l = [] } = e, s = t.Components.events, p = "Animation", m = Object.values(v), d = Object.values(u);
172
+ return a.addType(y, {
173
+ block: o ? {
174
+ label: p,
175
+ media: Z.animation,
176
+ content: { type: y },
177
+ ...B,
178
+ ...o
166
179
  } : void 0,
167
180
  model: {
168
181
  defaults: {
169
182
  emptyState: !0,
170
- name: l,
183
+ name: p,
171
184
  traits: [],
172
- script: Q,
173
- animationUpdateEvent: D,
185
+ script: tt,
186
+ animationUpdateEvent: T,
174
187
  "script-props": ["animationUpdateEvent"],
175
- styles: r.map((e) => e.css).join(`
188
+ styles: l.map((n) => n.css).join(`
176
189
  `)
177
190
  },
178
191
  init() {
179
- const { em: e } = this;
192
+ const { em: n } = this;
180
193
  this.addStyle({
181
- [f.name]: "fadeIn",
182
- [f.duration]: "1s",
183
- [f.fillMode]: "both",
184
- ...n.animationStyle,
194
+ [u.name]: "fadeIn",
195
+ [u.duration]: "1s",
196
+ [u.fillMode]: "both",
197
+ ...e.animationStyle,
185
198
  ...this.getStyle()
186
- }), this.listenTo(e, m.mount, (c) => {
199
+ }), this.listenTo(n, s.mount, (c) => {
187
200
  var h;
188
201
  if (c !== this) return;
189
- ((h = this.parent()) == null ? void 0 : h.get("type")) !== I || p.forEach((y) => this.removeStyle(y));
202
+ ((h = this.parent()) == null ? void 0 : h.get("type")) !== I || m.forEach((g) => this.removeStyle(g));
190
203
  });
191
204
  }
192
205
  },
@@ -196,101 +209,101 @@ const g = "animation", I = "animation-group", D = "animation:update", E = "anima
196
209
  animationend: "onAnimationEnd"
197
210
  }),
198
211
  init() {
199
- const { model: e } = this;
200
- this.listenTo(e, m.styleUpdate, this.handleStyleChange);
212
+ const { model: n } = this;
213
+ this.listenTo(n, s.styleUpdate, this.handleStyleChange);
201
214
  },
202
215
  onAnimationStart() {
203
216
  var c;
204
217
  if ((c = this.cmpSpots) != null && c.length) return;
205
- const e = o.getSpots({ component: this.model });
206
- this.cmpSpots = e, o.removeSpots(e), this.el.ownerDocument.body.style.overflowX = "hidden";
218
+ const n = i.getSpots({ component: this.model });
219
+ this.cmpSpots = n, i.removeSpots(n), this.el.ownerDocument.body.style.overflowX = "hidden";
207
220
  },
208
221
  onAnimationEnd() {
209
- const e = this.cmpSpots || [];
210
- o.spots.add(e), this.cmpSpots = [], this.el.ownerDocument.body.style.overflowX = "";
222
+ const n = this.cmpSpots || [];
223
+ i.spots.add(n), this.cmpSpots = [], this.el.ownerDocument.body.style.overflowX = "";
211
224
  },
212
225
  triggerAnimation() {
213
- this.el.dispatchEvent(new CustomEvent(D));
226
+ this.el.dispatchEvent(new CustomEvent(T));
214
227
  },
215
- handleStyleChange(e, c) {
216
- Object.keys((c == null ? void 0 : c.style) || {}).some((y) => u.includes(y) || p.includes(y)) && this.triggerAnimation();
228
+ handleStyleChange(n, c) {
229
+ Object.keys((c == null ? void 0 : c.style) || {}).some((g) => d.includes(g) || m.includes(g)) && this.triggerAnimation();
217
230
  },
218
231
  onRender() {
219
232
  this.triggerAnimation();
220
233
  }
221
234
  }
222
235
  }), () => {
223
- s.remove(g), a.removeType(g);
236
+ r.remove(y), a.removeType(y);
224
237
  };
225
238
  }, nt = function(t) {
226
- const n = this, a = "--animation-on-scroll", s = "--animation-threshold", o = "--animation-repeat";
227
- let i = null;
228
- const r = () => {
229
- i == null || i.disconnect(), i = null;
230
- }, m = () => {
231
- r();
232
- const l = getComputedStyle(n), p = l.getPropertyValue(a).trim() !== "false", u = parseFloat(l.getPropertyValue(s).trim()) || 0.2, e = l.getPropertyValue(o).trim() === "true", c = () => {
233
- Array.from(n.children).forEach((d) => {
234
- d instanceof HTMLElement && typeof d.dispatchEvent == "function" && d.dispatchEvent(new CustomEvent(E, { bubbles: !1 }));
239
+ const e = this, a = "--animation-on-scroll", r = "--animation-threshold", i = "--animation-repeat";
240
+ let o = null;
241
+ const l = () => {
242
+ o == null || o.disconnect(), o = null;
243
+ }, s = () => {
244
+ l();
245
+ const p = getComputedStyle(e), m = p.getPropertyValue(a).trim() !== "false", d = parseFloat(p.getPropertyValue(r).trim()) || 0.2, n = p.getPropertyValue(i).trim() === "true", c = () => {
246
+ Array.from(e.children).forEach((f) => {
247
+ f instanceof HTMLElement && typeof f.dispatchEvent == "function" && f.dispatchEvent(new CustomEvent(w, { bubbles: !1 }));
235
248
  });
236
249
  };
237
- if (!p) {
250
+ if (!m) {
238
251
  c();
239
252
  return;
240
253
  }
241
- i = new IntersectionObserver(
242
- (d) => {
243
- d.forEach((h) => {
244
- h.isIntersecting ? (c(), !e && r()) : e && Array.from(n.children).forEach((y) => {
245
- y instanceof HTMLElement && getComputedStyle(y).getPropertyValue(a).trim() !== "false" && (y.style.opacity = "0", y.style.animationPlayState = "paused");
254
+ o = new IntersectionObserver(
255
+ (f) => {
256
+ f.forEach((h) => {
257
+ h.isIntersecting ? (c(), !n && l()) : n && Array.from(e.children).forEach((g) => {
258
+ g instanceof HTMLElement && getComputedStyle(g).getPropertyValue(a).trim() !== "false" && (g.style.opacity = "0", g.style.animationPlayState = "paused");
246
259
  });
247
260
  });
248
261
  },
249
- { threshold: u }
250
- ), i.observe(n);
262
+ { threshold: d }
263
+ ), o.observe(e);
251
264
  };
252
- n.addEventListener(t.animationGroupUpdateEvent, m), m();
253
- }, et = (t, n) => {
254
- const { Components: a, Blocks: s } = t, { blockGroup: o = {} } = n, i = "Animation Group";
265
+ e.addEventListener(t.animationGroupUpdateEvent, s), s();
266
+ }, at = (t, e) => {
267
+ const { Components: a, Blocks: r } = t, { blockGroup: i = {} } = e, o = "Animation Group";
255
268
  return a.addType(I, {
256
- block: o ? {
257
- label: i,
258
- media: N.animationGroup,
269
+ block: i ? {
270
+ label: o,
271
+ media: Z.animationGroup,
259
272
  content: {
260
273
  type: I,
261
274
  components: [
262
- { type: g },
263
- { type: g },
264
- { type: g }
275
+ { type: y },
276
+ { type: y },
277
+ { type: y }
265
278
  ]
266
279
  },
267
- ...Z,
268
- ...o
280
+ ...B,
281
+ ...i
269
282
  } : void 0,
270
283
  model: {
271
284
  defaults: {
272
- name: i,
285
+ name: o,
273
286
  emptyState: !0,
274
287
  traits: [],
275
288
  script: nt,
276
- animationGroupUpdateEvent: E,
289
+ animationGroupUpdateEvent: w,
277
290
  "script-props": ["animationGroupUpdateEvent"],
278
- droppable: K(g)
291
+ droppable: q(y)
279
292
  },
280
293
  init() {
281
294
  this.addStyle({
282
- ...n.animationGroupStyle,
295
+ ...e.animationGroupStyle,
283
296
  ...this.getStyle()
284
297
  });
285
- const r = this.components();
286
- this.listenTo(r, "add remove", this.updateChildrenStaggerStyles), this.updateChildrenStaggerStyles();
298
+ const l = this.components();
299
+ this.listenTo(l, "add remove", this.updateChildrenStaggerStyles), this.updateChildrenStaggerStyles();
287
300
  },
288
301
  updateChildrenStaggerStyles() {
289
- this.components().forEach((r, m) => {
290
- r.is(g) && r.addStyle(
302
+ this.components().forEach((l, s) => {
303
+ l.is(y) && l.addStyle(
291
304
  {
292
- "--stagger-index": m.toString(),
293
- [f.delay]: "calc(var(--stagger-index, 0) * var(--stagger-delay, 0.3s))"
305
+ "--stagger-index": s.toString(),
306
+ [u.delay]: "calc(var(--stagger-index, 0) * var(--stagger-delay, 0.3s))"
294
307
  },
295
308
  { partial: !0 }
296
309
  );
@@ -299,11 +312,11 @@ const g = "animation", I = "animation-group", D = "animation:update", E = "anima
299
312
  },
300
313
  view: {
301
314
  init() {
302
- const { model: r } = this;
303
- this.listenTo(r, "component:styleUpdate", this.handleStyleChange);
315
+ const { model: l } = this;
316
+ this.listenTo(l, "component:styleUpdate", this.handleStyleChange);
304
317
  },
305
318
  triggerAnimation() {
306
- this.el.dispatchEvent(new CustomEvent(E));
319
+ this.el.dispatchEvent(new CustomEvent(w));
307
320
  },
308
321
  handleStyleChange() {
309
322
  this.triggerAnimation(), this.model.updateChildrenStaggerStyles();
@@ -313,9 +326,9 @@ const g = "animation", I = "animation-group", D = "animation:update", E = "anima
313
326
  }
314
327
  }
315
328
  }), () => {
316
- s.remove(I), a.removeType(I);
329
+ r.remove(I), a.removeType(I);
317
330
  };
318
- }, at = "animationComponent", ot = b.startup, T = [
331
+ }, ot = "animationComponent", it = b.startup, U = [
319
332
  {
320
333
  id: "flash",
321
334
  name: "Flash",
@@ -993,28 +1006,28 @@ const g = "animation", I = "animation-group", D = "animation:update", E = "anima
993
1006
  }
994
1007
  }`
995
1008
  }
996
- ], it = function(t, n = {}) {
997
- var o;
998
- const a = ((o = n.animations) == null ? void 0 : o.call(n, { items: T })) || T, s = [
999
- tt(t, { ...n, animationList: a }),
1000
- et(t, n)
1009
+ ], st = function(t, e = {}) {
1010
+ var i;
1011
+ const a = ((i = e.animations) == null ? void 0 : i.call(e, { items: U })) || U, r = [
1012
+ et(t, { ...e, animationList: a }),
1013
+ at(t, e)
1001
1014
  ];
1002
1015
  t.Styles.addSector("animation", {
1003
1016
  name: "Animation",
1004
1017
  properties: [
1005
1018
  {
1006
- ...S,
1019
+ ...x,
1007
1020
  name: "Type",
1008
- property: f.name,
1021
+ property: u.name,
1009
1022
  type: "select",
1010
1023
  full: !0,
1011
1024
  default: "fadeIn",
1012
1025
  options: a
1013
1026
  },
1014
1027
  {
1015
- ...S,
1028
+ ...x,
1016
1029
  name: "Duration",
1017
- property: f.duration,
1030
+ property: u.duration,
1018
1031
  type: "number",
1019
1032
  units: ["s"],
1020
1033
  min: 0.1,
@@ -1023,9 +1036,9 @@ const g = "animation", I = "animation-group", D = "animation:update", E = "anima
1023
1036
  default: "1s"
1024
1037
  },
1025
1038
  {
1026
- ...S,
1039
+ ...x,
1027
1040
  name: "Delay",
1028
- property: f.delay,
1041
+ property: u.delay,
1029
1042
  type: "number",
1030
1043
  units: ["s"],
1031
1044
  min: 0,
@@ -1034,9 +1047,9 @@ const g = "animation", I = "animation-group", D = "animation:update", E = "anima
1034
1047
  default: "1s"
1035
1048
  },
1036
1049
  {
1037
- ...S,
1050
+ ...x,
1038
1051
  name: "Iteration Count",
1039
- property: f.iterationCount,
1052
+ property: u.iterationCount,
1040
1053
  type: "select",
1041
1054
  default: "1",
1042
1055
  options: [
@@ -1045,9 +1058,9 @@ const g = "animation", I = "animation-group", D = "animation:update", E = "anima
1045
1058
  ]
1046
1059
  },
1047
1060
  {
1048
- ...S,
1061
+ ...x,
1049
1062
  name: "Timing",
1050
- property: f.timingFunction,
1063
+ property: u.timingFunction,
1051
1064
  type: "select",
1052
1065
  default: "ease",
1053
1066
  options: [
@@ -1059,7 +1072,7 @@ const g = "animation", I = "animation-group", D = "animation:update", E = "anima
1059
1072
  ]
1060
1073
  },
1061
1074
  {
1062
- ...q,
1075
+ ...J,
1063
1076
  name: "Stagger Delay",
1064
1077
  property: "--stagger-delay",
1065
1078
  type: "slider",
@@ -1070,7 +1083,7 @@ const g = "animation", I = "animation-group", D = "animation:update", E = "anima
1070
1083
  default: "0.3s"
1071
1084
  },
1072
1085
  {
1073
- ...J,
1086
+ ...Q,
1074
1087
  name: "Animate on Scroll",
1075
1088
  property: v.onScroll,
1076
1089
  type: "radio",
@@ -1087,7 +1100,7 @@ const g = "animation", I = "animation-group", D = "animation:update", E = "anima
1087
1100
  ]
1088
1101
  },
1089
1102
  {
1090
- ...L,
1103
+ ...S,
1091
1104
  name: "Scroll Threshold",
1092
1105
  property: v.threshold,
1093
1106
  type: "number",
@@ -1098,7 +1111,7 @@ const g = "animation", I = "animation-group", D = "animation:update", E = "anima
1098
1111
  default: "0.2"
1099
1112
  },
1100
1113
  {
1101
- ...L,
1114
+ ...S,
1102
1115
  name: "Repeat on Scroll",
1103
1116
  property: v.repeat,
1104
1117
  type: "radio",
@@ -1115,16 +1128,16 @@ const g = "animation", I = "animation-group", D = "animation:update", E = "anima
1115
1128
  ]
1116
1129
  }
1117
1130
  ]
1118
- }), Y({
1131
+ }), _({
1119
1132
  editor: t,
1120
- licenseKey: n.licenseKey,
1121
- plan: ot,
1122
- pluginName: at,
1133
+ licenseKey: e.licenseKey,
1134
+ plan: it,
1135
+ pluginName: ot,
1123
1136
  cleanup: () => {
1124
- s.forEach((i) => i());
1137
+ r.forEach((o) => o());
1125
1138
  }
1126
1139
  });
1127
- }, st = W(it);
1140
+ }, rt = W(st);
1128
1141
  export {
1129
- st as default
1142
+ rt as default
1130
1143
  };