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