@grapesjs/studio-sdk-plugins 1.0.21 → 1.0.22
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/animationComponent/components/Animation.d.ts +6 -0
- package/dist/animationComponent/components/AnimationGroup.d.ts +4 -0
- package/dist/animationComponent/index.cjs.d.ts +3 -0
- package/dist/animationComponent/index.cjs.js +507 -0
- package/dist/animationComponent/index.d.ts +3 -0
- package/dist/animationComponent/index.es.d.ts +3 -0
- package/dist/animationComponent/index.es.js +1111 -0
- package/dist/animationComponent/index.umd.js +507 -0
- package/dist/animationComponent/shared.d.ts +3 -0
- package/dist/animationComponent/types.d.ts +28 -0
- package/dist/animationComponent/typesSchema.d.ts +48 -0
- package/dist/animationComponent/utils.d.ts +19 -0
- package/dist/dataSourceEjs/EjsExporter.d.ts +13 -0
- package/dist/dataSourceEjs/EjsImporter.d.ts +29 -0
- package/dist/dataSourceEjs/index.cjs.d.ts +2 -2
- package/dist/dataSourceEjs/index.cjs.js +24 -3
- package/dist/dataSourceEjs/index.d.ts +2 -2
- package/dist/dataSourceEjs/index.es.d.ts +2 -2
- package/dist/dataSourceEjs/index.es.js +697 -114
- package/dist/dataSourceEjs/index.umd.js +24 -3
- package/dist/dataSourceEjs/shared.d.ts +3 -0
- package/dist/dataSourceEjs/types.d.ts +2 -2
- package/dist/dataSourceEjs/typesSchema.d.ts +3 -0
- package/dist/dataSourceHandlebars/HandlebarsExporter.d.ts +16 -0
- package/dist/dataSourceHandlebars/HandlebarsImporter.d.ts +20 -0
- package/dist/dataSourceHandlebars/helperImplementations.d.ts +1 -0
- package/dist/dataSourceHandlebars/index.cjs.js +20 -1
- package/dist/dataSourceHandlebars/index.es.js +401 -99
- package/dist/dataSourceHandlebars/index.umd.js +20 -1
- package/dist/dataSourceHandlebars/shared.d.ts +3 -0
- package/dist/dataSourceHandlebars/types.d.ts +2 -2
- package/dist/dataSourceHandlebars/typesSchema.d.ts +3 -0
- package/dist/googleFontsAssetProvider/index.cjs.js +1 -1
- package/dist/googleFontsAssetProvider/index.es.js +29 -29
- package/dist/googleFontsAssetProvider/index.umd.js +1 -1
- package/dist/iconifyComponent/index.cjs.js +2 -2
- package/dist/iconifyComponent/index.es.js +64 -64
- package/dist/iconifyComponent/index.umd.js +2 -2
- package/dist/index.cjs.d.ts +1 -0
- package/dist/index.cjs.js +587 -51
- package/dist/index.d.ts +1 -0
- package/dist/index.es.d.ts +1 -0
- package/dist/index.es.js +4809 -3046
- package/dist/index.umd.js +584 -48
- package/dist/layoutSidebarButtons/index.cjs.js +1 -1
- package/dist/layoutSidebarButtons/index.es.js +59 -59
- package/dist/layoutSidebarButtons/index.umd.js +1 -1
- package/dist/presetPrintable/index.cjs.js +3 -3
- package/dist/presetPrintable/index.es.js +136 -131
- package/dist/presetPrintable/index.umd.js +4 -4
- package/dist/prosemirror/index.cjs.js +1 -1
- package/dist/prosemirror/index.es.js +1 -1
- package/dist/prosemirror/index.umd.js +1 -1
- package/dist/rteTinyMce/index.cjs.js +2 -2
- package/dist/rteTinyMce/index.es.js +67 -67
- package/dist/rteTinyMce/index.umd.js +2 -2
- package/dist/tableComponent/index.cjs.js +1 -1
- package/dist/tableComponent/index.es.js +14 -14
- package/dist/tableComponent/index.umd.js +1 -1
- package/dist/utilsDataSources.d.ts +28 -0
- package/dist/youtubeAssetProvider/index.cjs.js +1 -1
- package/dist/youtubeAssetProvider/index.es.js +26 -26
- package/dist/youtubeAssetProvider/index.umd.js +1 -1
- package/package.json +2 -1
- package/dist/dataSourceEjs/EjsStrategy.d.ts +0 -15
- package/dist/dataSourceHandlebars/HandlebarsStrategy.d.ts +0 -17
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Editor } from 'grapesjs';
|
|
2
|
+
import { AnimationComponentOptions, AnimationOption } from '../types';
|
|
3
|
+
declare const loadAnimationComponent: (editor: Editor, opts: AnimationComponentOptions & {
|
|
4
|
+
animationList: AnimationOption[];
|
|
5
|
+
}) => () => void;
|
|
6
|
+
export default loadAnimationComponent;
|
|
@@ -0,0 +1,507 @@
|
|
|
1
|
+
"use strict";const P="app.grapesjs.com",z="app-stage.grapesjs.com",A=[P,z,"localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],B="license:check:start",V="license:check:end",F=()=>typeof window<"u",O=({isDev:t,isStage:n})=>`${t?"":`https://${n?z:P}`}/api`,X=()=>{const t=F()&&window.location.hostname;return!!t&&(A.includes(t)||A.some(n=>t.endsWith(n)))};async function M({path:t,baseApiUrl:n,method:e="GET",headers:r={},params:i,body:o}){const c=`${n||O({isDev:!1,isStage:!1})}${t}`,l={method:e,headers:{"Content-Type":"application/json",...r}};o&&(l.body=JSON.stringify(o));const f=i?new URLSearchParams(i).toString():"",a=f?`?${f}`:"",s=await fetch(`${c}${a}`,l);if(!s.ok)throw new Error(`HTTP error! status: ${s.status}`);return s.json()}var I=(t=>(t.free="free",t.startup="startup",t.business="business",t.enterprise="enterprise",t))(I||{});const L={[I.free]:0,[I.startup]:10,[I.business]:20,[I.enterprise]:30};function W(t){const n=t;return n.init=e=>r=>t(r,e),n}const Y=t=>W(t);async function $({editor:t,plan:n,pluginName:e,licenseKey:r,cleanup:i}){let o="",m=!1;const c=X(),l=a=>{console.warn("Cleanup plugin:",e,"Reason:",a),i()},f=(a={})=>{var b;const{error:s,sdkLicense:g}=a,p=(b=a.plan)==null?void 0:b.category;if(!(g||a.license)||s)l(s||"Invalid license");else if(p){const C=L[n],U=L[p];C>U&&l({pluginRequiredPlan:n,licensePlan:p})}};t.on(B,a=>{o=a==null?void 0:a.baseApiUrl,m=!0}),t.on(V,a=>{f(a)}),setTimeout(async()=>{if(!m){if(c)return;if(r){const a=await j({licenseKey:r,pluginName:e,baseApiUrl:o});a&&f(a)}else l("The `licenseKey` option not provided")}},2e3)}async function j(t){const{licenseKey:n,pluginName:e,baseApiUrl:r}=t;try{return(await M({baseApiUrl:r,path:`/sdk/${n||"na"}`,method:"POST",params:{d:window.location.hostname,pn:e}})).result||{}}catch(i){return console.error("Error during SDK license check:",i),!1}}const H=(...t)=>n=>t.some(e=>n.is(e));var u=(t=>(t.name="animation-name",t.duration="animation-duration",t.delay="animation-delay",t.fillMode="animation-fill-mode",t))(u||{}),T=(t=>(t.staggerDelay="--stagger-delay",t))(T||{}),d=(t=>(t.onScroll="--animation-on-scroll",t.threshold="--animation-threshold",t.repeat="--animation-repeat",t))(d||{});const y="animation",v="animation-group",E="animation:update",k="animation-group:update",Z={category:{id:"animations",label:"Animations"},select:!0},w=t=>(t==null?void 0:t.type)===y,x=t=>(t==null?void 0:t.type)===v,N=t=>w(t)||x(t),_={isVisible:({component:t})=>N(t)},S={isVisible:({component:t})=>w(t)},K={isVisible:({component:t})=>x(t)},D={isVisible:({component:t,sector:n})=>{var e;return w(t)&&x(t==null?void 0:t.parent())?!1:N(t)&&((e=n.getProperty(d.onScroll))==null?void 0:e.getValue())==="true"}},G={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>',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>'},R=[{id:"bounce",name:"Bounce",css:`@keyframes bounce {
|
|
2
|
+
0%, 20%, 53%, 80%, to {
|
|
3
|
+
animation-timing-function: cubic-bezier(.215, .61, .355, 1);
|
|
4
|
+
transform:translateZ(0)
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
40%, 43% {
|
|
8
|
+
animation-timing-function: cubic-bezier(.755, .05, .855, .06);
|
|
9
|
+
transform:translate3d(0, -30px, 0)
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
70% {
|
|
13
|
+
animation-timing-function: cubic-bezier(.755, .05, .855, .06);
|
|
14
|
+
transform:translate3d(0, -15px, 0)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
90% {
|
|
18
|
+
transform:translate3d(0, -4px, 0)
|
|
19
|
+
}
|
|
20
|
+
}`},{id:"flash",name:"Flash",css:`@keyframes flash {
|
|
21
|
+
0%, 50%, to {
|
|
22
|
+
opacity:1
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
25%, 75% {
|
|
26
|
+
opacity:0
|
|
27
|
+
}
|
|
28
|
+
}`},{id:"pulse",name:"Pulse",css:`@keyframes pulse {
|
|
29
|
+
0% {
|
|
30
|
+
transform:scaleX(1)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
50% {
|
|
34
|
+
transform:scale3d(1.05, 1.05, 1.05)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
to {
|
|
38
|
+
transform:scaleX(1)
|
|
39
|
+
}
|
|
40
|
+
}`},{id:"shake",name:"Shake",css:`@keyframes shake {
|
|
41
|
+
0%, to {
|
|
42
|
+
transform:translateZ(0)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
10%, 30%, 50%, 70%, 90% {
|
|
46
|
+
transform:translate3d(-10px, 0, 0)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
20%, 40%, 60%, 80% {
|
|
50
|
+
transform:translate3d(10px, 0, 0)
|
|
51
|
+
}
|
|
52
|
+
}`},{id:"tada",name:"Tada",css:`@keyframes tada {
|
|
53
|
+
0% {
|
|
54
|
+
transform:scaleX(1)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
10%, 20% {
|
|
58
|
+
transform:scale3d(.9, .9, .9) rotate(-3deg)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
30%, 50%, 70%, 90% {
|
|
62
|
+
transform:scale3d(1.1, 1.1, 1.1) rotate(3deg)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
40%, 60%, 80% {
|
|
66
|
+
transform:scale3d(1.1, 1.1, 1.1) rotate(-3deg)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
to {
|
|
70
|
+
transform:scaleX(1)
|
|
71
|
+
}
|
|
72
|
+
}`},{id:"heartBeat",name:"Heart Beat",css:`@keyframes heartBeat {
|
|
73
|
+
0% {
|
|
74
|
+
transform:scale(1)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
14% {
|
|
78
|
+
transform:scale(1.3)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
28% {
|
|
82
|
+
transform:scale(1)
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
42% {
|
|
86
|
+
transform:scale(1.3)
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
70% {
|
|
90
|
+
transform:scale(1)
|
|
91
|
+
}
|
|
92
|
+
}`},{id:"bounceIn",name:"Bounce In",css:`@keyframes bounceIn {
|
|
93
|
+
0%, 20%, 40%, 60%, 80%, to {
|
|
94
|
+
animation-timing-function:cubic-bezier(.215, .61, .355, 1)
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
0% {
|
|
98
|
+
opacity: 0;
|
|
99
|
+
transform:scale3d(.3, .3, .3)
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
20% {
|
|
103
|
+
transform:scale3d(1.1, 1.1, 1.1)
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
40% {
|
|
107
|
+
transform:scale3d(.9, .9, .9)
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
60% {
|
|
111
|
+
opacity: 1;
|
|
112
|
+
transform:scale3d(1.03, 1.03, 1.03)
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
80% {
|
|
116
|
+
transform:scale3d(.97, .97, .97)
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
to {
|
|
120
|
+
opacity: 1;
|
|
121
|
+
transform:scaleX(1)
|
|
122
|
+
}
|
|
123
|
+
}`},{id:"bounceInDown",name:"Bounce In Down",css:`@keyframes bounceInDown {
|
|
124
|
+
0%, 60%, 75%, 90%, to {
|
|
125
|
+
animation-timing-function:cubic-bezier(.215, .61, .355, 1)
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
0% {
|
|
129
|
+
opacity: 0;
|
|
130
|
+
transform:translate3d(0, -100%, 0)
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
60% {
|
|
134
|
+
opacity: 1;
|
|
135
|
+
transform:translate3d(0, 25px, 0)
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
75% {
|
|
139
|
+
transform:translate3d(0, -10px, 0)
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
90% {
|
|
143
|
+
transform:translate3d(0, 5px, 0)
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
to {
|
|
147
|
+
transform:translateZ(0)
|
|
148
|
+
}
|
|
149
|
+
}`},{id:"bounceInLeft",name:"Bounce In Left",css:`@keyframes bounceInLeft {
|
|
150
|
+
0%, 1%, 60%, 75%, 90%, to {
|
|
151
|
+
animation-timing-function:cubic-bezier(.215, .61, .355, .1)
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
0% {
|
|
155
|
+
opacity: 0;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
1% {
|
|
159
|
+
transform:translate3d(-100%, 0, 0)
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
60% {
|
|
163
|
+
opacity: 1;
|
|
164
|
+
transform:translate3d(25px, 0, 0)
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
75% {
|
|
168
|
+
transform:translate3d(-10px, 0, 0)
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
90% {
|
|
172
|
+
transform:translate3d(5px, 0, 0)
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
to {
|
|
176
|
+
transform:translateZ(0)
|
|
177
|
+
}
|
|
178
|
+
}`},{id:"bounceInRight",name:"Bounce In Right",css:`@keyframes bounceInRight {
|
|
179
|
+
0%, 1%, 60%, 75%, 90%, to {
|
|
180
|
+
animation-timing-function:cubic-bezier(.215, .61, .355, .1)
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
0% {
|
|
184
|
+
opacity: 0;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
1% {
|
|
188
|
+
transform:translate3d(100%, 0, 0)
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
60% {
|
|
192
|
+
opacity: 1;
|
|
193
|
+
transform:translate3d(-25px, 0, 0)
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
75% {
|
|
197
|
+
transform:translate3d(10px, 0, 0)
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
90% {
|
|
201
|
+
transform:translate3d(-5px, 0, 0)
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
to {
|
|
205
|
+
transform:translateZ(0)
|
|
206
|
+
}
|
|
207
|
+
}`},{id:"bounceInUp",name:"Bounce In Up",css:`@keyframes bounceInUp {
|
|
208
|
+
0%, 60%, 75%, 90%, to {
|
|
209
|
+
animation-timing-function:cubic-bezier(.215, .61, .355, .1)
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
0% {
|
|
213
|
+
opacity: 0;
|
|
214
|
+
transform:translate3d(0, 100%, 0)
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
60% {
|
|
218
|
+
opacity: 1;
|
|
219
|
+
transform:translate3d(0, -20px, 0)
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
75% {
|
|
223
|
+
transform:translate3d(0, 10px, 0)
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
90% {
|
|
227
|
+
transform:translate3d(0, -5px, 0)
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
to {
|
|
231
|
+
transform:translateZ(0)
|
|
232
|
+
}
|
|
233
|
+
}`},{id:"fadeIn",name:"Fade In",css:`@keyframes fadeIn {
|
|
234
|
+
0% {
|
|
235
|
+
opacity:0
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
to {
|
|
239
|
+
opacity:1
|
|
240
|
+
}
|
|
241
|
+
}`},{id:"fadeInDown",name:"Fade In Down",css:`@keyframes fadeInDown {
|
|
242
|
+
0% {
|
|
243
|
+
opacity: 0;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
1% {
|
|
247
|
+
transform:translate3d(0, -100%, 0)
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
to {
|
|
251
|
+
opacity: 1;
|
|
252
|
+
transform:translateZ(0)
|
|
253
|
+
}
|
|
254
|
+
}`},{id:"fadeInLeft",name:"Fade In Left",css:`@keyframes fadeInLeft {
|
|
255
|
+
0% {
|
|
256
|
+
opacity: 0;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
1% {
|
|
260
|
+
transform:translate3d(-100%, 0, 0)
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
to {
|
|
264
|
+
opacity: 1;
|
|
265
|
+
transform:translateZ(0)
|
|
266
|
+
}
|
|
267
|
+
}`},{id:"fadeInRight",name:"Fade In Right",css:`@keyframes fadeInRight {
|
|
268
|
+
0% {
|
|
269
|
+
opacity: 0;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
1% {
|
|
273
|
+
transform:translate3d(100%, 0, 0)
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
to {
|
|
277
|
+
opacity: 1;
|
|
278
|
+
transform:translateZ(0)
|
|
279
|
+
}
|
|
280
|
+
}`},{id:"fadeInUp",name:"Fade In Up",css:`@keyframes fadeInUp {
|
|
281
|
+
0% {
|
|
282
|
+
opacity: 0;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
1% {
|
|
286
|
+
transform:translate3d(0, 100%, 0)
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
to {
|
|
290
|
+
opacity: 1;
|
|
291
|
+
transform:translateZ(0)
|
|
292
|
+
}
|
|
293
|
+
}`},{id:"flipInX",name:"Flip In X",css:`@keyframes flipInX {
|
|
294
|
+
0% {
|
|
295
|
+
transform: perspective(400px) rotateX(90deg);
|
|
296
|
+
animation-timing-function: ease-in;
|
|
297
|
+
opacity:0
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
40% {
|
|
301
|
+
transform: perspective(400px) rotateX(-20deg);
|
|
302
|
+
animation-timing-function:ease-in
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
60% {
|
|
306
|
+
transform: perspective(400px) rotateX(10deg);
|
|
307
|
+
opacity:1
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
80% {
|
|
311
|
+
transform:perspective(400px) rotateX(-5deg)
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
to {
|
|
315
|
+
transform:perspective(400px)
|
|
316
|
+
}
|
|
317
|
+
}`},{id:"flipInY",name:"Flip In Y",css:`@keyframes flipInY {
|
|
318
|
+
0% {
|
|
319
|
+
transform: perspective(400px) rotateY(90deg);
|
|
320
|
+
animation-timing-function: ease-in;
|
|
321
|
+
opacity:0
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
40% {
|
|
325
|
+
transform: perspective(400px) rotateY(-20deg);
|
|
326
|
+
animation-timing-function:ease-in
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
60% {
|
|
330
|
+
transform: perspective(400px) rotateY(10deg);
|
|
331
|
+
opacity:1
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
80% {
|
|
335
|
+
transform:perspective(400px) rotateY(-5deg)
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
to {
|
|
339
|
+
transform:perspective(400px)
|
|
340
|
+
}
|
|
341
|
+
}`},{id:"rotateIn",name:"Rotate In",css:`@keyframes rotateIn {
|
|
342
|
+
0% {
|
|
343
|
+
transform-origin: center;
|
|
344
|
+
transform: rotate(-200deg);
|
|
345
|
+
opacity:0
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
to {
|
|
349
|
+
transform-origin: center;
|
|
350
|
+
transform: translateZ(0);
|
|
351
|
+
opacity:1
|
|
352
|
+
}
|
|
353
|
+
}`},{id:"rotateInDownLeft",name:"Rotate In Down Left",css:`@keyframes rotateInDownLeft {
|
|
354
|
+
0% {
|
|
355
|
+
transform-origin: left bottom;
|
|
356
|
+
transform: rotate(-45deg);
|
|
357
|
+
opacity:0
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
to {
|
|
361
|
+
transform-origin: left bottom;
|
|
362
|
+
transform: translateZ(0);
|
|
363
|
+
opacity:1
|
|
364
|
+
}
|
|
365
|
+
}`},{id:"rotateInDownRight",name:"Rotate In Down Right",css:`@keyframes rotateInDownRight {
|
|
366
|
+
0% {
|
|
367
|
+
transform-origin: right bottom;
|
|
368
|
+
transform: rotate(45deg);
|
|
369
|
+
opacity:0
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
to {
|
|
373
|
+
transform-origin: right bottom;
|
|
374
|
+
transform: translateZ(0);
|
|
375
|
+
opacity:1
|
|
376
|
+
}
|
|
377
|
+
}`},{id:"rotateInUpLeft",name:"Rotate In Up Left",css:`@keyframes rotateInUpLeft {
|
|
378
|
+
0% {
|
|
379
|
+
transform-origin: left bottom;
|
|
380
|
+
transform: rotate(45deg);
|
|
381
|
+
opacity:0
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
to {
|
|
385
|
+
transform-origin: left bottom;
|
|
386
|
+
transform: translateZ(0);
|
|
387
|
+
opacity:1
|
|
388
|
+
}
|
|
389
|
+
}`},{id:"rotateInUpRight",name:"Rotate In Up Right",css:`@keyframes rotateInUpRight {
|
|
390
|
+
0% {
|
|
391
|
+
transform-origin: right bottom;
|
|
392
|
+
transform: rotate(-90deg);
|
|
393
|
+
opacity:0
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
to {
|
|
397
|
+
transform-origin: right bottom;
|
|
398
|
+
transform: translateZ(0);
|
|
399
|
+
opacity:1
|
|
400
|
+
}
|
|
401
|
+
}`},{id:"slideInDown",name:"Slide In Down",css:`@keyframes slideInDown {
|
|
402
|
+
0% {
|
|
403
|
+
visibility:visible
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
1% {
|
|
407
|
+
transform: translate3d(0, -100%, 0);
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
to {
|
|
411
|
+
transform:translateZ(0)
|
|
412
|
+
}
|
|
413
|
+
}`},{id:"slideInLeft",name:"Slide In Left",css:`@keyframes slideInLeft {
|
|
414
|
+
0% {
|
|
415
|
+
visibility:visible
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
1% {
|
|
419
|
+
transform: translate3d(-100%, 0, 0);
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
to {
|
|
423
|
+
transform:translateZ(0)
|
|
424
|
+
}
|
|
425
|
+
}`},{id:"slideInRight",name:"Slide In Right",css:`@keyframes slideInRight {
|
|
426
|
+
0% {
|
|
427
|
+
visibility:visible
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
1% {
|
|
431
|
+
transform: translate3d(100%, 0, 0);
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
to {
|
|
435
|
+
transform:translateZ(0)
|
|
436
|
+
}
|
|
437
|
+
}`},{id:"slideInUp",name:"Slide In Up",css:`@keyframes slideInUp {
|
|
438
|
+
0% {
|
|
439
|
+
visibility:visible
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
1% {
|
|
443
|
+
transform: translate3d(0, 100%, 0);
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
to {
|
|
447
|
+
transform:translateZ(0)
|
|
448
|
+
}
|
|
449
|
+
}`},{id:"zoomIn",name:"Zoom In",css:`@keyframes zoomIn {
|
|
450
|
+
0% {
|
|
451
|
+
opacity: 0;
|
|
452
|
+
transform:scale3d(.3, .3, .3)
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
50% {
|
|
456
|
+
opacity:1
|
|
457
|
+
}
|
|
458
|
+
}`},{id:"zoomInDown",name:"Zoom In Down",css:`@keyframes zoomInDown {
|
|
459
|
+
0% {
|
|
460
|
+
opacity: 0;
|
|
461
|
+
transform: scale3d(.1, .1, .1) translate3d(0, -1000px, 0);
|
|
462
|
+
animation-timing-function:cubic-bezier(.55, .055, .675, .19)
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
60% {
|
|
466
|
+
opacity: 1;
|
|
467
|
+
transform: scale3d(.475, .475, .475) translate3d(0, 60px, 0);
|
|
468
|
+
animation-timing-function:cubic-bezier(.175, .885, .32, 1)
|
|
469
|
+
}
|
|
470
|
+
}`},{id:"zoomInLeft",name:"Zoom In Left",css:`@keyframes zoomInLeft {
|
|
471
|
+
0% {
|
|
472
|
+
opacity: 0;
|
|
473
|
+
transform: scale3d(.1, .1, .1) translate3d(-1000px, 0, 0);
|
|
474
|
+
animation-timing-function:cubic-bezier(.55, .055, .675, .19)
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
60% {
|
|
478
|
+
opacity: 1;
|
|
479
|
+
transform: scale3d(.475, .475, .475) translate3d(10px, 0, 0);
|
|
480
|
+
animation-timing-function:cubic-bezier(.175, .885, .32, 1)
|
|
481
|
+
}
|
|
482
|
+
}`},{id:"zoomInRight",name:"Zoom In Right",css:`@keyframes zoomInRight {
|
|
483
|
+
0% {
|
|
484
|
+
opacity: 0;
|
|
485
|
+
transform: scale3d(.1, .1, .1) translate3d(1000px, 0, 0);
|
|
486
|
+
animation-timing-function:cubic-bezier(.55, .055, .675, .19)
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
60% {
|
|
490
|
+
opacity: 1;
|
|
491
|
+
transform: scale3d(.475, .475, .475) translate3d(-10px, 0, 0);
|
|
492
|
+
animation-timing-function:cubic-bezier(.175, .885, .32, 1)
|
|
493
|
+
}
|
|
494
|
+
}`},{id:"zoomInUp",name:"Zoom In Up",css:`@keyframes zoomInUp {
|
|
495
|
+
0% {
|
|
496
|
+
opacity: 0;
|
|
497
|
+
transform: scale3d(.1, .1, .1) translate3d(0, 1000px, 0);
|
|
498
|
+
animation-timing-function:cubic-bezier(.55, .055, .675, .19)
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
60% {
|
|
502
|
+
opacity: 1;
|
|
503
|
+
transform: scale3d(.475, .475, .475) translate3d(0, -60px, 0);
|
|
504
|
+
animation-timing-function:cubic-bezier(.175, .885, .32, 1)
|
|
505
|
+
}
|
|
506
|
+
}`}],q=function(t){const n=this;let e=null;const r=()=>{e==null||e.disconnect(),e=null},i=()=>{r();const o=n.style;o.animationName="",requestAnimationFrame(()=>{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())||.2,a=m.getPropertyValue("--animation-repeat").trim()==="true",s=()=>{o.animationName="none",n.offsetWidth,o.animationName=c,o.animationPlayState="running"};if(!c||c==="none"){o.animationName="none",o.animationPlayState="paused";return}if(!l){s();return}o.animationPlayState="paused",e=new IntersectionObserver(g=>{g.forEach(p=>{p.isIntersecting&&(s(),!a&&r())})},{threshold:f}),e.observe(n)})};n.addEventListener(t.animationUpdateEvent,i),i()},J=(t,n)=>{const{Components:e,Blocks:r,Canvas:i}=t,{block:o={},animationList:m=[]}=n,c="Animation",l=Object.values(d),f=Object.values(u);return e.addType(y,{block:o?{label:c,media:G.animation,content:{type:y},...Z,...o}:void 0,model:{defaults:{emptyState:!0,name:c,traits:[],script:q,animationUpdateEvent:E,"script-props":["animationUpdateEvent"],styles:m.map(a=>a.css).join(`
|
|
507
|
+
`),style:{[u.name]:"fadeIn",[u.duration]:"1s",[u.delay]:"0s",[u.fillMode]:"both",[d.onScroll]:"true",[d.threshold]:"0.2",[d.repeat]:"false",...n.animationStyle}},init(){const{em:a}=this;this.listenTo(a,"component:mount",s=>{var p;if(s!==this)return;((p=this.parent())==null?void 0:p.get("type"))!==v||l.forEach(h=>this.removeStyle(h))})}},view:{events:()=>({animationstart:"onAnimationStart",animationend:"onAnimationEnd"}),init(){const{model:a}=this;this.listenTo(a,"component:styleUpdate",this.handleStyleChange)},onAnimationStart(){var s;if((s=this.cmpSpots)!=null&&s.length)return;const a=i.getSpots({component:this.model});this.cmpSpots=a,i.removeSpots(a),this.el.ownerDocument.body.style.overflowX="hidden"},onAnimationEnd(){const a=this.cmpSpots||[];i.spots.add(a),this.cmpSpots=[],this.el.ownerDocument.body.style.overflowX=""},triggerAnimation(){this.el.dispatchEvent(new CustomEvent(E))},handleStyleChange(a,s){Object.keys((s==null?void 0:s.style)||{}).some(h=>f.includes(h)||l.includes(h))&&this.triggerAnimation()},onRender(){this.triggerAnimation()}}}),()=>{r.remove(y),e.removeType(y)}},Q=function(t){const n=this,e="--animation-on-scroll",r="--animation-threshold",i="--animation-repeat";let o=null;const m=()=>{o==null||o.disconnect(),o=null},c=()=>{m();const l=getComputedStyle(n),f=l.getPropertyValue(e).trim()!=="false",a=parseFloat(l.getPropertyValue(r).trim())||.2,s=l.getPropertyValue(i).trim()==="true",g=()=>{Array.from(n.children).forEach(p=>{p instanceof HTMLElement&&typeof p.dispatchEvent=="function"&&p.dispatchEvent(new CustomEvent(k,{bubbles:!1}))})};if(!f){g();return}o=new IntersectionObserver(p=>{p.forEach(h=>{h.isIntersecting?(g(),!s&&m()):s&&Array.from(n.children).forEach(b=>{b instanceof HTMLElement&&getComputedStyle(b).getPropertyValue(e).trim()!=="false"&&(b.style.opacity="0",b.style.animationPlayState="paused")})})},{threshold:a}),o.observe(n)};n.addEventListener(t.animationGroupUpdateEvent,c),c()},tt=(t,n)=>{const{Components:e,Blocks:r}=t,{blockGroup:i={}}=n,o="Animation Group";return e.addType(v,{block:i?{label:o,media:G.animationGroup,content:{type:v,components:[{type:y},{type:y},{type:y}]},...Z,...i}:void 0,model:{defaults:{name:o,emptyState:!0,traits:[],script:Q,animationGroupUpdateEvent:k,"script-props":["animationGroupUpdateEvent"],droppable:H(y),style:{[T.staggerDelay]:"0.3s",[d.onScroll]:"true",[d.threshold]:"0.2",[d.repeat]:"false",...n.animationGroupStyle}},init(){const m=this.components();this.listenTo(m,"add remove",this.updateChildrenStaggerStyles),this.updateChildrenStaggerStyles()},updateChildrenStaggerStyles(){this.components().forEach((m,c)=>{m.is(y)&&m.addStyle({"--stagger-index":c.toString(),[u.delay]:"calc(var(--stagger-index, 0) * var(--stagger-delay, 0s))"},{partial:!0})})}},view:{init(){const{model:m}=this;this.listenTo(m,"component:styleUpdate",this.handleStyleChange)},triggerAnimation(){this.el.dispatchEvent(new CustomEvent(k))},handleStyleChange(){this.triggerAnimation(),this.model.updateChildrenStaggerStyles()},onRender(){this.triggerAnimation()}}}),()=>{r.remove(v),e.removeType(v)}},nt="animationComponent",et=I.startup,at=function(t,n={}){var i;const e=((i=n.animations)==null?void 0:i.call(n,{items:R}))||R,r=[J(t,{...n,animationList:e}),tt(t,n)];t.Styles.addSector("animation",{name:"Animation",properties:[{...S,name:"Type",property:u.name,type:"select",full:!0,default:"fadeIn",options:e},{...S,name:"Duration",property:u.duration,type:"number",units:["s"],min:.1,max:10,step:.1,default:"1s"},{...S,name:"Fill Mode",property:u.fillMode,type:"select",default:"both",options:[{name:"None",id:"none"},{name:"Forwards",id:"forwards"},{name:"Backwards",id:"backwards"},{name:"Both",id:"both"}]},{...K,name:"Stagger Delay",property:"--stagger-delay",type:"slider",units:["s"],min:.1,max:5,step:.1,default:"0.1s"},{..._,name:"Animate on Scroll",property:d.onScroll,type:"radio",default:"true",options:[{name:"Yes",id:"true"},{name:"No",id:"false"}]},{...D,name:"Scroll Threshold",property:d.threshold,type:"number",full:!0,min:.1,max:1,step:.01,default:"0.2"},{...D,name:"Repeat on Scroll",property:d.repeat,type:"radio",default:"false",options:[{name:"Yes",id:"true"},{name:"No",id:"false"}]}]}),$({editor:t,licenseKey:n.licenseKey,plan:et,pluginName:nt,cleanup:()=>{r.forEach(o=>o())}})},ot=Y(at);module.exports=ot;
|