@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.
- package/dist/accordionComponent/index.cjs.js +7 -7
- package/dist/accordionComponent/index.es.js +185 -159
- package/dist/accordionComponent/index.umd.js +7 -7
- package/dist/aiChat/clientToolsProcessors.d.ts +1 -2
- package/dist/aiChat/components/utils.d.ts +1 -0
- package/dist/aiChat/components/utilsTw.d.ts +11 -0
- package/dist/aiChat/index.cjs.js +75 -75
- package/dist/aiChat/index.es.js +9122 -8628
- package/dist/aiChat/index.js +75 -75
- package/dist/aiChat/index.umd.js +75 -75
- package/dist/aiChat/projectGeneration.d.ts +17 -0
- package/dist/animationComponent/index.cjs.js +3 -3
- package/dist/animationComponent/index.es.js +221 -195
- package/dist/animationComponent/index.umd.js +3 -3
- package/dist/canvasAbsoluteMode/index.cjs.js +1 -1
- package/dist/canvasAbsoluteMode/index.es.js +199 -173
- package/dist/canvasAbsoluteMode/index.umd.js +1 -1
- package/dist/canvasEmptyState/index.cjs.js +1 -1
- package/dist/canvasEmptyState/index.es.js +149 -123
- package/dist/canvasEmptyState/index.umd.js +1 -1
- package/dist/canvasFullSize/index.cjs.js +9 -9
- package/dist/canvasFullSize/index.es.js +186 -160
- package/dist/canvasFullSize/index.umd.js +9 -9
- package/dist/canvasGridMode/index.cjs.js +5 -5
- package/dist/canvasGridMode/index.es.js +263 -237
- package/dist/canvasGridMode/index.umd.js +2 -2
- package/dist/canvasScreenshot/index.cjs.js +1 -1
- package/dist/canvasScreenshot/index.es.js +168 -142
- package/dist/canvasScreenshot/index.umd.js +1 -1
- package/dist/dataSourceEjs/index.cjs.js +9 -9
- package/dist/dataSourceEjs/index.es.js +271 -245
- package/dist/dataSourceEjs/index.umd.js +9 -9
- package/dist/dataSourceHandlebars/index.cjs.js +8 -8
- package/dist/dataSourceHandlebars/index.es.js +232 -206
- package/dist/dataSourceHandlebars/index.umd.js +8 -8
- package/dist/dialogComponent/index.cjs.js +14 -14
- package/dist/dialogComponent/index.es.js +157 -131
- package/dist/dialogComponent/index.umd.js +14 -14
- package/dist/flexComponent/index.cjs.js +13 -13
- package/dist/flexComponent/index.es.js +497 -471
- package/dist/flexComponent/index.umd.js +13 -13
- package/dist/fsLightboxComponent/index.cjs.js +3 -3
- package/dist/fsLightboxComponent/index.es.js +189 -163
- package/dist/fsLightboxComponent/index.umd.js +3 -3
- package/dist/googleFontsAssetProvider/index.cjs.js +1 -1
- package/dist/googleFontsAssetProvider/index.es.js +175 -149
- package/dist/googleFontsAssetProvider/index.umd.js +1 -1
- package/dist/iconifyComponent/index.cjs.js +2 -2
- package/dist/iconifyComponent/index.es.js +207 -181
- package/dist/iconifyComponent/index.umd.js +2 -2
- package/dist/index.cjs.js +36 -36
- package/dist/index.es.js +917 -891
- package/dist/index.umd.js +36 -36
- package/dist/layoutSidebarButtons/index.cjs.js +1 -1
- package/dist/layoutSidebarButtons/index.es.js +192 -166
- package/dist/layoutSidebarButtons/index.umd.js +1 -1
- package/dist/lightGalleryComponent/index.cjs.js +1 -1
- package/dist/lightGalleryComponent/index.es.js +265 -239
- package/dist/lightGalleryComponent/index.umd.js +1 -1
- package/dist/linkImageComponent/index.cjs.js +2 -2
- package/dist/linkImageComponent/index.es.js +121 -95
- package/dist/linkImageComponent/index.umd.js +2 -2
- package/dist/listPagesComponent/index.cjs.js +5 -5
- package/dist/listPagesComponent/index.es.js +171 -145
- package/dist/listPagesComponent/index.umd.js +5 -5
- package/dist/presetPrintable/index.cjs.js +3 -3
- package/dist/presetPrintable/index.es.js +227 -201
- package/dist/presetPrintable/index.umd.js +3 -3
- package/dist/prosemirror/index.cjs.js +7 -7
- package/dist/prosemirror/index.es.js +457 -431
- package/dist/prosemirror/index.umd.js +8 -8
- package/dist/rendererReact/index.cjs.js +1 -1
- package/dist/rendererReact/index.es.js +248 -223
- 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 +150 -124
- package/dist/rteTinyMce/index.umd.js +2 -2
- package/dist/shapeDividerComponent/index.cjs.js +4 -4
- package/dist/shapeDividerComponent/index.es.js +143 -117
- package/dist/shapeDividerComponent/index.umd.js +4 -4
- package/dist/swiperComponent/index.cjs.js +9 -9
- package/dist/swiperComponent/index.es.js +218 -192
- package/dist/swiperComponent/index.umd.js +7 -7
- package/dist/tableComponent/index.cjs.js +1 -1
- package/dist/tableComponent/index.es.js +275 -249
- 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 +134 -108
- package/dist/youtubeAssetProvider/index.umd.js +1 -1
- package/package.json +2 -2
|
@@ -1,192 +1,218 @@
|
|
|
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",
|
|
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
|
-
|
|
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:
|
|
20
|
+
isStage: e,
|
|
17
21
|
isPlatform: a
|
|
18
|
-
}) => `${t ? "" : `https://${
|
|
19
|
-
|
|
20
|
-
|
|
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:
|
|
37
|
+
baseApiUrl: e,
|
|
25
38
|
method: a = "GET",
|
|
26
|
-
headers:
|
|
27
|
-
params:
|
|
28
|
-
body:
|
|
39
|
+
headers: r = {},
|
|
40
|
+
params: i,
|
|
41
|
+
body: o
|
|
29
42
|
}) {
|
|
30
|
-
const
|
|
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
|
-
...
|
|
47
|
+
...r
|
|
35
48
|
}
|
|
36
49
|
};
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
if (!
|
|
40
|
-
throw new Error(`HTTP error! status: ${
|
|
41
|
-
return
|
|
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
|
|
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
|
|
51
|
-
const
|
|
52
|
-
return
|
|
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__ */
|
|
55
|
-
async function
|
|
67
|
+
const W = (t) => /* @__PURE__ */ H(t);
|
|
68
|
+
async function _({
|
|
56
69
|
editor: t,
|
|
57
|
-
plan:
|
|
70
|
+
plan: e,
|
|
58
71
|
pluginName: a,
|
|
59
|
-
licenseKey:
|
|
60
|
-
onLicenseCheckResponse:
|
|
61
|
-
cleanup:
|
|
72
|
+
licenseKey: r,
|
|
73
|
+
onLicenseCheckResponse: i,
|
|
74
|
+
cleanup: o
|
|
62
75
|
}) {
|
|
63
|
-
let
|
|
64
|
-
const
|
|
65
|
-
console.warn("Cleanup plugin:", a, "Reason:",
|
|
66
|
-
},
|
|
67
|
-
var
|
|
68
|
-
const { error: c, sdkLicense:
|
|
69
|
-
if (!(
|
|
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
|
|
73
|
-
|
|
85
|
+
const E = L[e], M = L[h];
|
|
86
|
+
E > M && p({ pluginRequiredPlan: e, licensePlan: h });
|
|
74
87
|
}
|
|
75
88
|
};
|
|
76
|
-
t.
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
if (
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
|
|
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
|
-
|
|
92
|
-
|
|
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:
|
|
96
|
-
path: `/sdk/${
|
|
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 (
|
|
104
|
-
return console.error("Error during SDK license check:",
|
|
129
|
+
} catch (i) {
|
|
130
|
+
return console.error("Error during SDK license check:", i), !1;
|
|
105
131
|
}
|
|
106
132
|
}
|
|
107
|
-
const
|
|
108
|
-
var
|
|
109
|
-
const
|
|
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
|
-
},
|
|
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
|
-
},
|
|
115
|
-
isVisible: ({ component: t }) =>
|
|
116
|
-
},
|
|
117
|
-
isVisible: ({ component: 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
|
|
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
|
-
},
|
|
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
|
-
},
|
|
127
|
-
const
|
|
152
|
+
}, et = function(t) {
|
|
153
|
+
const e = this;
|
|
128
154
|
let a = null;
|
|
129
|
-
const
|
|
155
|
+
const r = () => {
|
|
130
156
|
a == null || a.disconnect(), a = null;
|
|
131
|
-
},
|
|
132
|
-
|
|
133
|
-
const
|
|
134
|
-
|
|
135
|
-
const
|
|
136
|
-
|
|
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 (!
|
|
139
|
-
|
|
164
|
+
if (!s || s === "none") {
|
|
165
|
+
o.animationName = "none", o.animationPlayState = "paused";
|
|
140
166
|
return;
|
|
141
167
|
}
|
|
142
|
-
if (!
|
|
143
|
-
|
|
168
|
+
if (!p) {
|
|
169
|
+
n();
|
|
144
170
|
return;
|
|
145
171
|
}
|
|
146
|
-
|
|
172
|
+
o.animationPlayState = "paused", a = new IntersectionObserver(
|
|
147
173
|
(c) => {
|
|
148
|
-
c.forEach((
|
|
149
|
-
|
|
174
|
+
c.forEach((f) => {
|
|
175
|
+
f.isIntersecting && (n(), !d && r());
|
|
150
176
|
});
|
|
151
177
|
},
|
|
152
|
-
{ threshold:
|
|
153
|
-
), a.observe(
|
|
178
|
+
{ threshold: m }
|
|
179
|
+
), a.observe(e);
|
|
154
180
|
});
|
|
155
181
|
};
|
|
156
|
-
|
|
157
|
-
},
|
|
158
|
-
const { Components: a, Blocks:
|
|
159
|
-
return a.addType(
|
|
160
|
-
block:
|
|
161
|
-
label:
|
|
162
|
-
media:
|
|
163
|
-
content: { type:
|
|
164
|
-
...
|
|
165
|
-
...
|
|
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:
|
|
196
|
+
name: p,
|
|
171
197
|
traits: [],
|
|
172
|
-
script:
|
|
173
|
-
animationUpdateEvent:
|
|
198
|
+
script: et,
|
|
199
|
+
animationUpdateEvent: T,
|
|
174
200
|
"script-props": ["animationUpdateEvent"],
|
|
175
|
-
styles:
|
|
201
|
+
styles: l.map((n) => n.css).join(`
|
|
176
202
|
`)
|
|
177
203
|
},
|
|
178
204
|
init() {
|
|
179
|
-
const { em:
|
|
205
|
+
const { em: n } = this;
|
|
180
206
|
this.addStyle({
|
|
181
|
-
[
|
|
182
|
-
[
|
|
183
|
-
[
|
|
184
|
-
...
|
|
207
|
+
[u.name]: "fadeIn",
|
|
208
|
+
[u.duration]: "1s",
|
|
209
|
+
[u.fillMode]: "both",
|
|
210
|
+
...e.animationStyle,
|
|
185
211
|
...this.getStyle()
|
|
186
|
-
}), this.listenTo(
|
|
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 ||
|
|
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:
|
|
200
|
-
this.listenTo(
|
|
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
|
|
206
|
-
this.cmpSpots =
|
|
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
|
|
210
|
-
|
|
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(
|
|
239
|
+
this.el.dispatchEvent(new CustomEvent(T));
|
|
214
240
|
},
|
|
215
|
-
handleStyleChange(
|
|
216
|
-
Object.keys((c == null ? void 0 : c.style) || {}).some((
|
|
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
|
-
|
|
249
|
+
r.remove(y), a.removeType(y);
|
|
224
250
|
};
|
|
225
|
-
},
|
|
226
|
-
const
|
|
227
|
-
let
|
|
228
|
-
const
|
|
229
|
-
|
|
230
|
-
},
|
|
231
|
-
|
|
232
|
-
const
|
|
233
|
-
Array.from(
|
|
234
|
-
|
|
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 (!
|
|
263
|
+
if (!m) {
|
|
238
264
|
c();
|
|
239
265
|
return;
|
|
240
266
|
}
|
|
241
|
-
|
|
242
|
-
(
|
|
243
|
-
|
|
244
|
-
h.isIntersecting ? (c(), !
|
|
245
|
-
|
|
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:
|
|
250
|
-
),
|
|
275
|
+
{ threshold: d }
|
|
276
|
+
), o.observe(e);
|
|
251
277
|
};
|
|
252
|
-
|
|
253
|
-
},
|
|
254
|
-
const { Components: a, Blocks:
|
|
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:
|
|
257
|
-
label:
|
|
258
|
-
media:
|
|
282
|
+
block: i ? {
|
|
283
|
+
label: o,
|
|
284
|
+
media: Z.animationGroup,
|
|
259
285
|
content: {
|
|
260
286
|
type: I,
|
|
261
287
|
components: [
|
|
262
|
-
{ type:
|
|
263
|
-
{ type:
|
|
264
|
-
{ type:
|
|
288
|
+
{ type: y },
|
|
289
|
+
{ type: y },
|
|
290
|
+
{ type: y }
|
|
265
291
|
]
|
|
266
292
|
},
|
|
267
|
-
...
|
|
268
|
-
...
|
|
293
|
+
...B,
|
|
294
|
+
...i
|
|
269
295
|
} : void 0,
|
|
270
296
|
model: {
|
|
271
297
|
defaults: {
|
|
272
|
-
name:
|
|
298
|
+
name: o,
|
|
273
299
|
emptyState: !0,
|
|
274
300
|
traits: [],
|
|
275
|
-
script:
|
|
276
|
-
animationGroupUpdateEvent:
|
|
301
|
+
script: at,
|
|
302
|
+
animationGroupUpdateEvent: P,
|
|
277
303
|
"script-props": ["animationGroupUpdateEvent"],
|
|
278
|
-
droppable:
|
|
304
|
+
droppable: J(y)
|
|
279
305
|
},
|
|
280
306
|
init() {
|
|
281
307
|
this.addStyle({
|
|
282
|
-
...
|
|
308
|
+
...e.animationGroupStyle,
|
|
283
309
|
...this.getStyle()
|
|
284
310
|
});
|
|
285
|
-
const
|
|
286
|
-
this.listenTo(
|
|
311
|
+
const l = this.components();
|
|
312
|
+
this.listenTo(l, "add remove", this.updateChildrenStaggerStyles), this.updateChildrenStaggerStyles();
|
|
287
313
|
},
|
|
288
314
|
updateChildrenStaggerStyles() {
|
|
289
|
-
this.components().forEach((
|
|
290
|
-
|
|
315
|
+
this.components().forEach((l, s) => {
|
|
316
|
+
l.is(y) && l.addStyle(
|
|
291
317
|
{
|
|
292
|
-
"--stagger-index":
|
|
293
|
-
[
|
|
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:
|
|
303
|
-
this.listenTo(
|
|
328
|
+
const { model: l } = this;
|
|
329
|
+
this.listenTo(l, "component:styleUpdate", this.handleStyleChange);
|
|
304
330
|
},
|
|
305
331
|
triggerAnimation() {
|
|
306
|
-
this.el.dispatchEvent(new CustomEvent(
|
|
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
|
-
|
|
342
|
+
r.remove(I), a.removeType(I);
|
|
317
343
|
};
|
|
318
|
-
},
|
|
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
|
-
],
|
|
997
|
-
var
|
|
998
|
-
const a = ((
|
|
999
|
-
|
|
1000
|
-
|
|
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
|
-
...
|
|
1032
|
+
...x,
|
|
1007
1033
|
name: "Type",
|
|
1008
|
-
property:
|
|
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
|
-
...
|
|
1041
|
+
...x,
|
|
1016
1042
|
name: "Duration",
|
|
1017
|
-
property:
|
|
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
|
-
...
|
|
1052
|
+
...x,
|
|
1027
1053
|
name: "Delay",
|
|
1028
|
-
property:
|
|
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
|
-
...
|
|
1063
|
+
...x,
|
|
1038
1064
|
name: "Iteration Count",
|
|
1039
|
-
property:
|
|
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
|
-
...
|
|
1074
|
+
...x,
|
|
1049
1075
|
name: "Timing",
|
|
1050
|
-
property:
|
|
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
|
-
...
|
|
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
|
-
...
|
|
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
|
-
...
|
|
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
|
-
...
|
|
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
|
-
}),
|
|
1144
|
+
}), _({
|
|
1119
1145
|
editor: t,
|
|
1120
|
-
licenseKey:
|
|
1121
|
-
plan:
|
|
1122
|
-
pluginName:
|
|
1146
|
+
licenseKey: e.licenseKey,
|
|
1147
|
+
plan: st,
|
|
1148
|
+
pluginName: it,
|
|
1123
1149
|
cleanup: () => {
|
|
1124
|
-
|
|
1150
|
+
r.forEach((o) => o());
|
|
1125
1151
|
}
|
|
1126
1152
|
});
|
|
1127
|
-
},
|
|
1153
|
+
}, lt = W(rt);
|
|
1128
1154
|
export {
|
|
1129
|
-
|
|
1155
|
+
lt as default
|
|
1130
1156
|
};
|