@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.
- package/dist/accordionComponent/index.cjs.js +7 -7
- package/dist/accordionComponent/index.es.js +161 -156
- package/dist/accordionComponent/index.umd.js +9 -9
- package/dist/aiChat/chatManager.d.ts +15 -0
- package/dist/aiChat/clientTools.d.ts +3 -3
- package/dist/aiChat/clientToolsProcessors.d.ts +14 -1
- package/dist/aiChat/components/AiChatEmptyState.d.ts +4 -6
- package/dist/aiChat/components/AiChatError.d.ts +2 -1
- package/dist/aiChat/components/AiChatHeader.d.ts +2 -1
- package/dist/aiChat/components/AiChatInput/AssetsSection.d.ts +7 -0
- package/dist/aiChat/components/AiChatInput/AttachButton.d.ts +10 -0
- package/dist/aiChat/components/AiChatInput/ContextSection.d.ts +5 -0
- package/dist/aiChat/components/AiChatInput/DictateButton.d.ts +7 -0
- package/dist/aiChat/components/AiChatInput/TextAreaWithAutoResize.d.ts +6 -0
- package/dist/aiChat/components/AiChatInput/constants.d.ts +6 -0
- package/dist/aiChat/components/AiChatInput/hooks/useSpeechToText.d.ts +15 -0
- package/dist/aiChat/components/AiChatInput/index.d.ts +37 -0
- package/dist/aiChat/components/AiChatLoadingState.d.ts +2 -1
- package/dist/aiChat/components/AiChatMessage.d.ts +21 -9
- package/dist/aiChat/components/AiChatMessages.d.ts +5 -7
- package/dist/aiChat/components/AiChatMessagesStatus.d.ts +5 -0
- package/dist/aiChat/components/AiChatPanel.d.ts +2 -3
- package/dist/aiChat/components/AiChatProvider.d.ts +14 -0
- package/dist/aiChat/components/MemoizedMarkdown.d.ts +9 -0
- package/dist/aiChat/components/index.d.ts +24 -25
- package/dist/aiChat/components/utils.d.ts +12 -4
- package/dist/aiChat/index.cjs.d.ts +5 -0
- package/dist/aiChat/index.cjs.js +453 -0
- package/dist/aiChat/index.d.ts +4 -3
- package/dist/aiChat/index.es.d.ts +5 -0
- package/dist/aiChat/index.es.js +30930 -0
- package/dist/aiChat/index.js +453 -0
- package/dist/aiChat/index.umd.js +453 -0
- package/dist/aiChat/locales/en.d.ts +64 -0
- package/dist/aiChat/server/index.cjs.d.ts +4 -0
- package/dist/aiChat/server/index.cjs.js +309 -0
- package/dist/aiChat/server/index.d.ts +0 -50
- package/dist/aiChat/server/index.es.d.ts +4 -0
- package/dist/aiChat/server/index.es.js +876 -0
- package/dist/aiChat/server/index.js +309 -0
- package/dist/aiChat/server/index.umd.js +309 -0
- package/dist/aiChat/server/stream.d.ts +0 -6
- package/dist/aiChat/server/tools.d.ts +157 -51
- package/dist/aiChat/server/types.d.ts +108 -64
- package/dist/aiChat/types.d.ts +148 -108
- package/dist/aiChat/typesSchema.d.ts +238 -25
- package/dist/animationComponent/index.cjs.js +3 -3
- package/dist/animationComponent/index.es.js +174 -169
- package/dist/animationComponent/index.umd.js +3 -3
- package/dist/canvasAbsoluteMode/index.cjs.js +1 -1
- package/dist/canvasAbsoluteMode/index.es.js +161 -156
- package/dist/canvasAbsoluteMode/index.umd.js +1 -1
- package/dist/canvasEmptyState/index.cjs.js +1 -1
- package/dist/canvasEmptyState/index.es.js +113 -108
- package/dist/canvasEmptyState/index.umd.js +1 -1
- package/dist/canvasFullSize/index.cjs.js +9 -9
- package/dist/canvasFullSize/index.es.js +137 -132
- package/dist/canvasFullSize/index.umd.js +9 -9
- package/dist/canvasGridMode/index.cjs.js +4 -4
- package/dist/canvasGridMode/index.es.js +168 -163
- package/dist/canvasGridMode/index.umd.js +8 -8
- package/dist/canvasScreenshot/index.cjs.js +1 -1
- package/dist/canvasScreenshot/index.es.js +132 -127
- package/dist/canvasScreenshot/index.umd.js +1 -1
- package/dist/dataSourceEjs/index.cjs.js +5 -5
- package/dist/dataSourceEjs/index.es.js +151 -146
- package/dist/dataSourceEjs/index.umd.js +5 -5
- package/dist/dataSourceHandlebars/index.cjs.js +4 -4
- package/dist/dataSourceHandlebars/index.es.js +91 -86
- package/dist/dataSourceHandlebars/index.umd.js +5 -5
- package/dist/dialogComponent/index.cjs.js +16 -16
- package/dist/dialogComponent/index.es.js +117 -112
- package/dist/dialogComponent/index.umd.js +16 -16
- package/dist/flexComponent/index.cjs.js +11 -11
- package/dist/flexComponent/index.es.js +416 -411
- package/dist/flexComponent/index.umd.js +11 -11
- package/dist/fsLightboxComponent/index.cjs.js +3 -3
- package/dist/fsLightboxComponent/index.es.js +152 -147
- package/dist/fsLightboxComponent/index.umd.js +3 -3
- package/dist/googleFontsAssetProvider/index.cjs.js +1 -1
- package/dist/googleFontsAssetProvider/index.es.js +127 -122
- package/dist/googleFontsAssetProvider/index.umd.js +1 -1
- package/dist/iconifyComponent/index.cjs.js +2 -2
- package/dist/iconifyComponent/index.es.js +170 -165
- package/dist/iconifyComponent/index.umd.js +2 -2
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +27 -22
- package/dist/index.umd.js +1 -1
- package/dist/layoutSidebarButtons/index.cjs.js +1 -1
- package/dist/layoutSidebarButtons/index.es.js +156 -151
- package/dist/layoutSidebarButtons/index.umd.js +1 -1
- package/dist/lightGalleryComponent/index.cjs.js +1 -1
- package/dist/lightGalleryComponent/index.es.js +197 -192
- package/dist/lightGalleryComponent/index.umd.js +1 -1
- package/dist/linkImageComponent/index.cjs.js +2 -2
- package/dist/linkImageComponent/index.es.js +86 -81
- package/dist/linkImageComponent/index.umd.js +2 -2
- package/dist/listPagesComponent/index.cjs.js +5 -5
- package/dist/listPagesComponent/index.es.js +121 -116
- package/dist/listPagesComponent/index.umd.js +5 -5
- package/dist/presetPrintable/index.cjs.js +4 -4
- package/dist/presetPrintable/index.es.js +180 -175
- package/dist/presetPrintable/index.umd.js +4 -4
- package/dist/prosemirror/index.cjs.js +6 -6
- package/dist/prosemirror/index.es.js +128 -123
- package/dist/prosemirror/index.umd.js +8 -8
- package/dist/rendererReact/index.cjs.js +1 -1
- package/dist/rendererReact/index.es.js +127 -122
- package/dist/rendererReact/index.js +1 -1
- package/dist/rendererReact/index.umd.js +1 -1
- package/dist/rteTinyMce/index.cjs.js +2 -2
- package/dist/rteTinyMce/index.es.js +160 -155
- package/dist/rteTinyMce/index.umd.js +2 -2
- package/dist/shapeDividerComponent/index.cjs.js +25 -25
- package/dist/shapeDividerComponent/index.es.js +127 -122
- package/dist/shapeDividerComponent/index.umd.js +25 -25
- package/dist/swiperComponent/index.cjs.js +9 -9
- package/dist/swiperComponent/index.es.js +197 -192
- package/dist/swiperComponent/index.umd.js +9 -9
- package/dist/tableComponent/index.cjs.js +1 -1
- package/dist/tableComponent/index.es.js +227 -222
- package/dist/tableComponent/index.umd.js +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/utils.d.ts +12 -1
- package/dist/youtubeAssetProvider/index.cjs.js +1 -1
- package/dist/youtubeAssetProvider/index.es.js +124 -119
- package/dist/youtubeAssetProvider/index.umd.js +1 -1
- package/package.json +5 -2
- package/dist/aiChat/components/AiChatInput.d.ts +0 -17
- package/dist/aiChat/server/stream-utils.d.ts +0 -16
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const
|
|
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
|
-
],
|
|
15
|
-
|
|
16
|
-
|
|
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
|
|
22
|
+
async function _({
|
|
19
23
|
path: t,
|
|
20
24
|
baseApiUrl: n,
|
|
21
|
-
method:
|
|
22
|
-
headers:
|
|
23
|
-
params:
|
|
24
|
-
body:
|
|
25
|
+
method: a = "GET",
|
|
26
|
+
headers: s = {},
|
|
27
|
+
params: o,
|
|
28
|
+
body: i
|
|
25
29
|
}) {
|
|
26
|
-
const
|
|
27
|
-
method:
|
|
30
|
+
const m = `${n || M({ isDev: !1, isStage: !1 })}${t}`, l = {
|
|
31
|
+
method: a,
|
|
28
32
|
headers: {
|
|
29
33
|
"Content-Type": "application/json",
|
|
30
|
-
...
|
|
34
|
+
...s
|
|
31
35
|
}
|
|
32
36
|
};
|
|
33
|
-
|
|
34
|
-
const
|
|
35
|
-
if (!
|
|
36
|
-
throw new Error(`HTTP error! status: ${
|
|
37
|
-
return
|
|
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
|
|
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
|
|
50
|
+
function $(t) {
|
|
47
51
|
const n = t;
|
|
48
|
-
return n.init = (
|
|
52
|
+
return n.init = (a) => (s) => t(s, a), n;
|
|
49
53
|
}
|
|
50
|
-
const W = (t) => /* @__PURE__ */
|
|
54
|
+
const W = (t) => /* @__PURE__ */ $(t);
|
|
51
55
|
async function Y({
|
|
52
56
|
editor: t,
|
|
53
57
|
plan: n,
|
|
54
|
-
pluginName:
|
|
55
|
-
licenseKey:
|
|
58
|
+
pluginName: a,
|
|
59
|
+
licenseKey: s,
|
|
60
|
+
onLicenseCheckResponse: o,
|
|
56
61
|
cleanup: i
|
|
57
62
|
}) {
|
|
58
|
-
let
|
|
59
|
-
const
|
|
60
|
-
console.warn("Cleanup plugin:",
|
|
61
|
-
},
|
|
62
|
-
var
|
|
63
|
-
const { error:
|
|
64
|
-
if (!(
|
|
65
|
-
|
|
66
|
-
else if (
|
|
67
|
-
const
|
|
68
|
-
|
|
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(
|
|
72
|
-
|
|
73
|
-
}), t.on(
|
|
74
|
-
|
|
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 (
|
|
78
|
-
if (
|
|
79
|
-
const
|
|
80
|
-
|
|
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
|
-
|
|
87
|
+
p("The `licenseKey` option not provided");
|
|
83
88
|
}
|
|
84
89
|
}, 2e3);
|
|
85
90
|
}
|
|
86
|
-
async function
|
|
87
|
-
const { licenseKey: n, pluginName:
|
|
91
|
+
async function H(t) {
|
|
92
|
+
const { licenseKey: n, pluginName: a, baseApiUrl: s } = t;
|
|
88
93
|
try {
|
|
89
|
-
return (await
|
|
90
|
-
baseApiUrl:
|
|
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:
|
|
100
|
+
pn: a
|
|
96
101
|
}
|
|
97
102
|
})).result || {};
|
|
98
|
-
} catch (
|
|
99
|
-
return console.error("Error during SDK license check:",
|
|
103
|
+
} catch (o) {
|
|
104
|
+
return console.error("Error during SDK license check:", o), !1;
|
|
100
105
|
}
|
|
101
106
|
}
|
|
102
|
-
const
|
|
103
|
-
var
|
|
104
|
-
const g = "animation", I = "animation-group",
|
|
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
|
-
},
|
|
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 }) =>
|
|
113
|
-
},
|
|
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
|
|
116
|
-
return
|
|
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
|
-
},
|
|
126
|
+
}, Q = function(t) {
|
|
122
127
|
const n = this;
|
|
123
|
-
let
|
|
124
|
-
const
|
|
125
|
-
|
|
126
|
-
},
|
|
127
|
-
|
|
128
|
-
const
|
|
129
|
-
|
|
130
|
-
const
|
|
131
|
-
|
|
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 (!
|
|
134
|
-
|
|
138
|
+
if (!m || m === "none") {
|
|
139
|
+
i.animationName = "none", i.animationPlayState = "paused";
|
|
135
140
|
return;
|
|
136
141
|
}
|
|
137
142
|
if (!l) {
|
|
138
|
-
|
|
143
|
+
e();
|
|
139
144
|
return;
|
|
140
145
|
}
|
|
141
|
-
|
|
142
|
-
(
|
|
143
|
-
|
|
144
|
-
d.isIntersecting && (
|
|
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:
|
|
148
|
-
),
|
|
152
|
+
{ threshold: p }
|
|
153
|
+
), a.observe(n);
|
|
149
154
|
});
|
|
150
155
|
};
|
|
151
|
-
n.addEventListener(t.animationUpdateEvent,
|
|
152
|
-
},
|
|
153
|
-
const { Components:
|
|
154
|
-
return
|
|
155
|
-
block:
|
|
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
|
-
...
|
|
160
|
-
...
|
|
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:
|
|
168
|
-
animationUpdateEvent:
|
|
172
|
+
script: Q,
|
|
173
|
+
animationUpdateEvent: D,
|
|
169
174
|
"script-props": ["animationUpdateEvent"],
|
|
170
|
-
styles:
|
|
175
|
+
styles: r.map((e) => e.css).join(`
|
|
171
176
|
`)
|
|
172
177
|
},
|
|
173
178
|
init() {
|
|
174
|
-
const { em:
|
|
179
|
+
const { em: e } = this;
|
|
175
180
|
this.addStyle({
|
|
176
|
-
[
|
|
177
|
-
[
|
|
178
|
-
[
|
|
181
|
+
[f.name]: "fadeIn",
|
|
182
|
+
[f.duration]: "1s",
|
|
183
|
+
[f.fillMode]: "both",
|
|
179
184
|
...n.animationStyle,
|
|
180
185
|
...this.getStyle()
|
|
181
|
-
}), this.listenTo(
|
|
186
|
+
}), this.listenTo(e, m.mount, (c) => {
|
|
182
187
|
var h;
|
|
183
|
-
if (
|
|
184
|
-
((h = this.parent()) == null ? void 0 : h.get("type")) !== I ||
|
|
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:
|
|
195
|
-
this.listenTo(
|
|
199
|
+
const { model: e } = this;
|
|
200
|
+
this.listenTo(e, m.styleUpdate, this.handleStyleChange);
|
|
196
201
|
},
|
|
197
202
|
onAnimationStart() {
|
|
198
|
-
var
|
|
199
|
-
if ((
|
|
200
|
-
const
|
|
201
|
-
this.cmpSpots =
|
|
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
|
|
205
|
-
|
|
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(
|
|
213
|
+
this.el.dispatchEvent(new CustomEvent(D));
|
|
209
214
|
},
|
|
210
|
-
handleStyleChange(
|
|
211
|
-
Object.keys((
|
|
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
|
-
|
|
223
|
+
s.remove(g), a.removeType(g);
|
|
219
224
|
};
|
|
220
|
-
},
|
|
221
|
-
const n = this,
|
|
222
|
-
let
|
|
223
|
-
const
|
|
224
|
-
|
|
225
|
-
},
|
|
226
|
-
|
|
227
|
-
const l = getComputedStyle(n),
|
|
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(
|
|
234
|
+
d instanceof HTMLElement && typeof d.dispatchEvent == "function" && d.dispatchEvent(new CustomEvent(E, { bubbles: !1 }));
|
|
230
235
|
});
|
|
231
236
|
};
|
|
232
|
-
if (!
|
|
233
|
-
|
|
237
|
+
if (!p) {
|
|
238
|
+
c();
|
|
234
239
|
return;
|
|
235
240
|
}
|
|
236
|
-
|
|
241
|
+
i = new IntersectionObserver(
|
|
237
242
|
(d) => {
|
|
238
243
|
d.forEach((h) => {
|
|
239
|
-
h.isIntersecting ? (
|
|
240
|
-
|
|
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:
|
|
245
|
-
),
|
|
249
|
+
{ threshold: u }
|
|
250
|
+
), i.observe(n);
|
|
246
251
|
};
|
|
247
|
-
n.addEventListener(t.animationGroupUpdateEvent,
|
|
248
|
-
},
|
|
249
|
-
const { Components:
|
|
250
|
-
return
|
|
251
|
-
block:
|
|
252
|
-
label:
|
|
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
|
-
...
|
|
263
|
-
...
|
|
267
|
+
...Z,
|
|
268
|
+
...o
|
|
264
269
|
} : void 0,
|
|
265
270
|
model: {
|
|
266
271
|
defaults: {
|
|
267
|
-
name:
|
|
272
|
+
name: i,
|
|
268
273
|
emptyState: !0,
|
|
269
274
|
traits: [],
|
|
270
|
-
script:
|
|
271
|
-
animationGroupUpdateEvent:
|
|
275
|
+
script: nt,
|
|
276
|
+
animationGroupUpdateEvent: E,
|
|
272
277
|
"script-props": ["animationGroupUpdateEvent"],
|
|
273
|
-
droppable:
|
|
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
|
|
281
|
-
this.listenTo(
|
|
285
|
+
const r = this.components();
|
|
286
|
+
this.listenTo(r, "add remove", this.updateChildrenStaggerStyles), this.updateChildrenStaggerStyles();
|
|
282
287
|
},
|
|
283
288
|
updateChildrenStaggerStyles() {
|
|
284
|
-
this.components().forEach((
|
|
285
|
-
|
|
289
|
+
this.components().forEach((r, m) => {
|
|
290
|
+
r.is(g) && r.addStyle(
|
|
286
291
|
{
|
|
287
|
-
"--stagger-index":
|
|
288
|
-
[
|
|
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:
|
|
298
|
-
this.listenTo(
|
|
302
|
+
const { model: r } = this;
|
|
303
|
+
this.listenTo(r, "component:styleUpdate", this.handleStyleChange);
|
|
299
304
|
},
|
|
300
305
|
triggerAnimation() {
|
|
301
|
-
this.el.dispatchEvent(new CustomEvent(
|
|
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
|
-
|
|
316
|
+
s.remove(I), a.removeType(I);
|
|
312
317
|
};
|
|
313
|
-
},
|
|
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
|
-
],
|
|
992
|
-
var
|
|
993
|
-
const
|
|
994
|
-
|
|
995
|
-
|
|
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:
|
|
1008
|
+
property: f.name,
|
|
1004
1009
|
type: "select",
|
|
1005
1010
|
full: !0,
|
|
1006
1011
|
default: "fadeIn",
|
|
1007
|
-
options:
|
|
1012
|
+
options: a
|
|
1008
1013
|
},
|
|
1009
1014
|
{
|
|
1010
1015
|
...S,
|
|
1011
1016
|
name: "Duration",
|
|
1012
|
-
property:
|
|
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:
|
|
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:
|
|
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:
|
|
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
|
-
...
|
|
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
|
-
...
|
|
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
|
-
...
|
|
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
|
-
...
|
|
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:
|
|
1117
|
-
pluginName:
|
|
1121
|
+
plan: ot,
|
|
1122
|
+
pluginName: at,
|
|
1118
1123
|
cleanup: () => {
|
|
1119
|
-
|
|
1124
|
+
s.forEach((i) => i());
|
|
1120
1125
|
}
|
|
1121
1126
|
});
|
|
1122
|
-
},
|
|
1127
|
+
}, st = W(it);
|
|
1123
1128
|
export {
|
|
1124
|
-
|
|
1129
|
+
st as default
|
|
1125
1130
|
};
|