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