@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.
- package/dist/accordionComponent/index.cjs.js +7 -7
- package/dist/accordionComponent/index.es.js +175 -162
- package/dist/accordionComponent/index.umd.js +7 -7
- package/dist/aiChat/index.cjs.js +64 -64
- package/dist/aiChat/index.es.js +5785 -5757
- package/dist/aiChat/index.js +64 -64
- package/dist/aiChat/index.umd.js +63 -63
- package/dist/animationComponent/index.cjs.js +3 -3
- package/dist/animationComponent/index.es.js +204 -191
- package/dist/animationComponent/index.umd.js +3 -3
- package/dist/canvasAbsoluteMode/index.cjs.js +1 -1
- package/dist/canvasAbsoluteMode/index.es.js +183 -170
- package/dist/canvasAbsoluteMode/index.umd.js +1 -1
- package/dist/canvasEmptyState/index.cjs.js +1 -1
- package/dist/canvasEmptyState/index.es.js +134 -121
- package/dist/canvasEmptyState/index.umd.js +1 -1
- package/dist/canvasFullSize/index.cjs.js +9 -9
- package/dist/canvasFullSize/index.es.js +165 -152
- package/dist/canvasFullSize/index.umd.js +9 -9
- package/dist/canvasGridMode/index.cjs.js +5 -5
- package/dist/canvasGridMode/index.es.js +245 -232
- package/dist/canvasGridMode/index.umd.js +4 -4
- package/dist/canvasScreenshot/index.cjs.js +1 -1
- package/dist/canvasScreenshot/index.es.js +155 -142
- package/dist/canvasScreenshot/index.umd.js +1 -1
- package/dist/dataSourceEjs/index.cjs.js +9 -9
- package/dist/dataSourceEjs/index.es.js +257 -244
- package/dist/dataSourceEjs/index.umd.js +9 -9
- package/dist/dataSourceHandlebars/index.cjs.js +8 -8
- package/dist/dataSourceHandlebars/index.es.js +216 -203
- package/dist/dataSourceHandlebars/index.umd.js +7 -7
- package/dist/dialogComponent/index.cjs.js +14 -14
- package/dist/dialogComponent/index.es.js +141 -128
- package/dist/dialogComponent/index.umd.js +14 -14
- package/dist/flexComponent/index.cjs.js +13 -13
- package/dist/flexComponent/index.es.js +484 -471
- package/dist/flexComponent/index.umd.js +13 -13
- package/dist/fsLightboxComponent/index.cjs.js +3 -3
- package/dist/fsLightboxComponent/index.es.js +173 -160
- package/dist/fsLightboxComponent/index.umd.js +3 -3
- package/dist/googleFontsAssetProvider/index.cjs.js +1 -1
- package/dist/googleFontsAssetProvider/index.es.js +160 -147
- package/dist/googleFontsAssetProvider/index.umd.js +1 -1
- package/dist/iconifyComponent/index.cjs.js +2 -2
- package/dist/iconifyComponent/index.es.js +196 -183
- package/dist/iconifyComponent/index.umd.js +2 -2
- package/dist/index.cjs.js +25 -25
- package/dist/index.es.js +121 -108
- package/dist/index.umd.js +18 -18
- package/dist/layoutSidebarButtons/index.cjs.js +1 -1
- package/dist/layoutSidebarButtons/index.es.js +157 -144
- package/dist/layoutSidebarButtons/index.umd.js +1 -1
- package/dist/lightGalleryComponent/index.cjs.js +1 -1
- package/dist/lightGalleryComponent/index.es.js +245 -232
- package/dist/lightGalleryComponent/index.umd.js +1 -1
- package/dist/linkImageComponent/index.cjs.js +2 -2
- package/dist/linkImageComponent/index.es.js +106 -93
- package/dist/linkImageComponent/index.umd.js +2 -2
- package/dist/listPagesComponent/index.cjs.js +5 -5
- package/dist/listPagesComponent/index.es.js +157 -144
- package/dist/listPagesComponent/index.umd.js +5 -5
- package/dist/presetPrintable/index.cjs.js +3 -3
- package/dist/presetPrintable/index.es.js +181 -168
- package/dist/presetPrintable/index.umd.js +3 -3
- package/dist/prosemirror/index.cjs.js +7 -7
- package/dist/prosemirror/index.es.js +385 -372
- package/dist/prosemirror/index.umd.js +8 -8
- package/dist/rendererReact/index.cjs.js +1 -1
- package/dist/rendererReact/index.es.js +200 -187
- 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 +118 -105
- package/dist/rteTinyMce/index.umd.js +2 -2
- package/dist/shapeDividerComponent/index.cjs.js +4 -4
- package/dist/shapeDividerComponent/index.es.js +129 -116
- package/dist/shapeDividerComponent/index.umd.js +4 -4
- package/dist/swiperComponent/index.cjs.js +9 -9
- package/dist/swiperComponent/index.es.js +203 -190
- package/dist/swiperComponent/index.umd.js +7 -7
- package/dist/tableComponent/index.cjs.js +1 -1
- package/dist/tableComponent/index.es.js +257 -244
- package/dist/tableComponent/index.umd.js +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/youtubeAssetProvider/index.cjs.js +1 -1
- package/dist/youtubeAssetProvider/index.es.js +121 -108
- package/dist/youtubeAssetProvider/index.umd.js +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
|
|
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
|
-
],
|
|
14
|
+
], V = "license:check:end", X = () => typeof window < "u", j = ({
|
|
15
15
|
isDev: t,
|
|
16
|
-
isStage:
|
|
16
|
+
isStage: e,
|
|
17
17
|
isPlatform: a
|
|
18
|
-
}) => `${t ? "" : `https://${
|
|
18
|
+
}) => `${t ? "" : `https://${e ? z : G}`}/${a ? "platform-api" : "api"}`, $ = () => {
|
|
19
19
|
const t = X() && window.location.hostname;
|
|
20
|
-
return !!t && (
|
|
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:
|
|
24
|
+
baseApiUrl: e,
|
|
25
25
|
method: a = "GET",
|
|
26
|
-
headers:
|
|
27
|
-
params:
|
|
28
|
-
body:
|
|
26
|
+
headers: r = {},
|
|
27
|
+
params: i,
|
|
28
|
+
body: o
|
|
29
29
|
}) {
|
|
30
|
-
const
|
|
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
|
-
...
|
|
34
|
+
...r
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
if (!
|
|
40
|
-
throw new Error(`HTTP error! status: ${
|
|
41
|
-
return
|
|
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
|
|
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
|
|
51
|
-
const
|
|
52
|
-
return
|
|
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__ */
|
|
55
|
-
async function
|
|
54
|
+
const W = (t) => /* @__PURE__ */ C(t);
|
|
55
|
+
async function _({
|
|
56
56
|
editor: t,
|
|
57
|
-
plan:
|
|
57
|
+
plan: e,
|
|
58
58
|
pluginName: a,
|
|
59
|
-
licenseKey:
|
|
60
|
-
onLicenseCheckResponse:
|
|
61
|
-
cleanup:
|
|
59
|
+
licenseKey: r,
|
|
60
|
+
onLicenseCheckResponse: i,
|
|
61
|
+
cleanup: o
|
|
62
62
|
}) {
|
|
63
|
-
let
|
|
64
|
-
const
|
|
65
|
-
console.warn("Cleanup plugin:", a, "Reason:",
|
|
66
|
-
},
|
|
67
|
-
var
|
|
68
|
-
const { error: c, sdkLicense:
|
|
69
|
-
if (!(
|
|
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
|
|
73
|
-
|
|
72
|
+
const E = L[e], M = L[h];
|
|
73
|
+
E > M && p({ pluginRequiredPlan: e, licensePlan: h });
|
|
74
74
|
}
|
|
75
75
|
};
|
|
76
|
-
t.
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
if (
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
|
|
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
|
-
|
|
92
|
-
|
|
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:
|
|
96
|
-
path: `/sdk/${
|
|
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 (
|
|
104
|
-
return console.error("Error during SDK license check:",
|
|
116
|
+
} catch (i) {
|
|
117
|
+
return console.error("Error during SDK license check:", i), !1;
|
|
105
118
|
}
|
|
106
119
|
}
|
|
107
|
-
const
|
|
108
|
-
var
|
|
109
|
-
const
|
|
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
|
-
},
|
|
113
|
-
isVisible: ({ component: 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 }) =>
|
|
118
|
-
},
|
|
119
|
-
isVisible: ({ component: t
|
|
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
|
|
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
|
-
},
|
|
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
|
-
},
|
|
127
|
-
const
|
|
139
|
+
}, tt = function(t) {
|
|
140
|
+
const e = this;
|
|
128
141
|
let a = null;
|
|
129
|
-
const
|
|
142
|
+
const r = () => {
|
|
130
143
|
a == null || a.disconnect(), a = null;
|
|
131
|
-
},
|
|
132
|
-
|
|
133
|
-
const
|
|
134
|
-
|
|
135
|
-
const
|
|
136
|
-
|
|
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 (!
|
|
139
|
-
|
|
151
|
+
if (!s || s === "none") {
|
|
152
|
+
o.animationName = "none", o.animationPlayState = "paused";
|
|
140
153
|
return;
|
|
141
154
|
}
|
|
142
|
-
if (!
|
|
143
|
-
|
|
155
|
+
if (!p) {
|
|
156
|
+
n();
|
|
144
157
|
return;
|
|
145
158
|
}
|
|
146
|
-
|
|
159
|
+
o.animationPlayState = "paused", a = new IntersectionObserver(
|
|
147
160
|
(c) => {
|
|
148
|
-
c.forEach((
|
|
149
|
-
|
|
161
|
+
c.forEach((f) => {
|
|
162
|
+
f.isIntersecting && (n(), !d && r());
|
|
150
163
|
});
|
|
151
164
|
},
|
|
152
|
-
{ threshold:
|
|
153
|
-
), a.observe(
|
|
165
|
+
{ threshold: m }
|
|
166
|
+
), a.observe(e);
|
|
154
167
|
});
|
|
155
168
|
};
|
|
156
|
-
|
|
157
|
-
},
|
|
158
|
-
const { Components: a, Blocks:
|
|
159
|
-
return a.addType(
|
|
160
|
-
block:
|
|
161
|
-
label:
|
|
162
|
-
media:
|
|
163
|
-
content: { type:
|
|
164
|
-
...
|
|
165
|
-
...
|
|
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:
|
|
183
|
+
name: p,
|
|
171
184
|
traits: [],
|
|
172
|
-
script:
|
|
173
|
-
animationUpdateEvent:
|
|
185
|
+
script: tt,
|
|
186
|
+
animationUpdateEvent: T,
|
|
174
187
|
"script-props": ["animationUpdateEvent"],
|
|
175
|
-
styles:
|
|
188
|
+
styles: l.map((n) => n.css).join(`
|
|
176
189
|
`)
|
|
177
190
|
},
|
|
178
191
|
init() {
|
|
179
|
-
const { em:
|
|
192
|
+
const { em: n } = this;
|
|
180
193
|
this.addStyle({
|
|
181
|
-
[
|
|
182
|
-
[
|
|
183
|
-
[
|
|
184
|
-
...
|
|
194
|
+
[u.name]: "fadeIn",
|
|
195
|
+
[u.duration]: "1s",
|
|
196
|
+
[u.fillMode]: "both",
|
|
197
|
+
...e.animationStyle,
|
|
185
198
|
...this.getStyle()
|
|
186
|
-
}), this.listenTo(
|
|
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 ||
|
|
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:
|
|
200
|
-
this.listenTo(
|
|
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
|
|
206
|
-
this.cmpSpots =
|
|
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
|
|
210
|
-
|
|
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(
|
|
226
|
+
this.el.dispatchEvent(new CustomEvent(T));
|
|
214
227
|
},
|
|
215
|
-
handleStyleChange(
|
|
216
|
-
Object.keys((c == null ? void 0 : c.style) || {}).some((
|
|
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
|
-
|
|
236
|
+
r.remove(y), a.removeType(y);
|
|
224
237
|
};
|
|
225
238
|
}, nt = function(t) {
|
|
226
|
-
const
|
|
227
|
-
let
|
|
228
|
-
const
|
|
229
|
-
|
|
230
|
-
},
|
|
231
|
-
|
|
232
|
-
const
|
|
233
|
-
Array.from(
|
|
234
|
-
|
|
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 (!
|
|
250
|
+
if (!m) {
|
|
238
251
|
c();
|
|
239
252
|
return;
|
|
240
253
|
}
|
|
241
|
-
|
|
242
|
-
(
|
|
243
|
-
|
|
244
|
-
h.isIntersecting ? (c(), !
|
|
245
|
-
|
|
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:
|
|
250
|
-
),
|
|
262
|
+
{ threshold: d }
|
|
263
|
+
), o.observe(e);
|
|
251
264
|
};
|
|
252
|
-
|
|
253
|
-
},
|
|
254
|
-
const { Components: a, Blocks:
|
|
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:
|
|
257
|
-
label:
|
|
258
|
-
media:
|
|
269
|
+
block: i ? {
|
|
270
|
+
label: o,
|
|
271
|
+
media: Z.animationGroup,
|
|
259
272
|
content: {
|
|
260
273
|
type: I,
|
|
261
274
|
components: [
|
|
262
|
-
{ type:
|
|
263
|
-
{ type:
|
|
264
|
-
{ type:
|
|
275
|
+
{ type: y },
|
|
276
|
+
{ type: y },
|
|
277
|
+
{ type: y }
|
|
265
278
|
]
|
|
266
279
|
},
|
|
267
|
-
...
|
|
268
|
-
...
|
|
280
|
+
...B,
|
|
281
|
+
...i
|
|
269
282
|
} : void 0,
|
|
270
283
|
model: {
|
|
271
284
|
defaults: {
|
|
272
|
-
name:
|
|
285
|
+
name: o,
|
|
273
286
|
emptyState: !0,
|
|
274
287
|
traits: [],
|
|
275
288
|
script: nt,
|
|
276
|
-
animationGroupUpdateEvent:
|
|
289
|
+
animationGroupUpdateEvent: w,
|
|
277
290
|
"script-props": ["animationGroupUpdateEvent"],
|
|
278
|
-
droppable:
|
|
291
|
+
droppable: q(y)
|
|
279
292
|
},
|
|
280
293
|
init() {
|
|
281
294
|
this.addStyle({
|
|
282
|
-
...
|
|
295
|
+
...e.animationGroupStyle,
|
|
283
296
|
...this.getStyle()
|
|
284
297
|
});
|
|
285
|
-
const
|
|
286
|
-
this.listenTo(
|
|
298
|
+
const l = this.components();
|
|
299
|
+
this.listenTo(l, "add remove", this.updateChildrenStaggerStyles), this.updateChildrenStaggerStyles();
|
|
287
300
|
},
|
|
288
301
|
updateChildrenStaggerStyles() {
|
|
289
|
-
this.components().forEach((
|
|
290
|
-
|
|
302
|
+
this.components().forEach((l, s) => {
|
|
303
|
+
l.is(y) && l.addStyle(
|
|
291
304
|
{
|
|
292
|
-
"--stagger-index":
|
|
293
|
-
[
|
|
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:
|
|
303
|
-
this.listenTo(
|
|
315
|
+
const { model: l } = this;
|
|
316
|
+
this.listenTo(l, "component:styleUpdate", this.handleStyleChange);
|
|
304
317
|
},
|
|
305
318
|
triggerAnimation() {
|
|
306
|
-
this.el.dispatchEvent(new CustomEvent(
|
|
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
|
-
|
|
329
|
+
r.remove(I), a.removeType(I);
|
|
317
330
|
};
|
|
318
|
-
},
|
|
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
|
-
],
|
|
997
|
-
var
|
|
998
|
-
const a = ((
|
|
999
|
-
|
|
1000
|
-
|
|
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
|
-
...
|
|
1019
|
+
...x,
|
|
1007
1020
|
name: "Type",
|
|
1008
|
-
property:
|
|
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
|
-
...
|
|
1028
|
+
...x,
|
|
1016
1029
|
name: "Duration",
|
|
1017
|
-
property:
|
|
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
|
-
...
|
|
1039
|
+
...x,
|
|
1027
1040
|
name: "Delay",
|
|
1028
|
-
property:
|
|
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
|
-
...
|
|
1050
|
+
...x,
|
|
1038
1051
|
name: "Iteration Count",
|
|
1039
|
-
property:
|
|
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
|
-
...
|
|
1061
|
+
...x,
|
|
1049
1062
|
name: "Timing",
|
|
1050
|
-
property:
|
|
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
|
-
...
|
|
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
|
-
...
|
|
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
|
-
...
|
|
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
|
-
...
|
|
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
|
-
}),
|
|
1131
|
+
}), _({
|
|
1119
1132
|
editor: t,
|
|
1120
|
-
licenseKey:
|
|
1121
|
-
plan:
|
|
1122
|
-
pluginName:
|
|
1133
|
+
licenseKey: e.licenseKey,
|
|
1134
|
+
plan: it,
|
|
1135
|
+
pluginName: ot,
|
|
1123
1136
|
cleanup: () => {
|
|
1124
|
-
|
|
1137
|
+
r.forEach((o) => o());
|
|
1125
1138
|
}
|
|
1126
1139
|
});
|
|
1127
|
-
},
|
|
1140
|
+
}, rt = W(st);
|
|
1128
1141
|
export {
|
|
1129
|
-
|
|
1142
|
+
rt as default
|
|
1130
1143
|
};
|