@grapesjs/studio-sdk-plugins 1.0.38-rc.0 → 1.0.39-rc.0
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 +5 -5
- package/dist/accordionComponent/index.es.js +70 -67
- package/dist/accordionComponent/index.js +39 -0
- package/dist/accordionComponent/index.umd.js +4 -4
- package/dist/aiChat/components/AiChatHeader.d.ts +4 -5
- package/dist/aiChat/components/AiChatInput/index.d.ts +4 -5
- package/dist/aiChat/components/AiChatMessage.d.ts +7 -8
- package/dist/aiChat/components/index.d.ts +1 -1
- package/dist/aiChat/components/utils.d.ts +1 -1
- package/dist/aiChat/index.cjs.js +10 -376
- package/dist/aiChat/index.es.js +4569 -28851
- package/dist/aiChat/index.js +10 -376
- package/dist/aiChat/index.umd.js +11 -377
- package/dist/aiChat/server/index.cjs.d.ts +0 -1
- package/dist/aiChat/server/index.cjs.js +45 -45
- package/dist/aiChat/server/index.d.ts +0 -1
- package/dist/aiChat/server/index.es.d.ts +0 -1
- package/dist/aiChat/server/index.es.js +371 -427
- package/dist/aiChat/server/index.js +45 -45
- package/dist/aiChat/server/index.umd.js +41 -41
- package/dist/aiChat/server/stream.test.d.ts +1 -0
- package/dist/aiChat/types.d.ts +18 -4
- package/dist/aiChat/typesSchema.d.ts +13 -0
- package/dist/animationComponent/index.cjs.js +3 -3
- package/dist/animationComponent/index.es.js +49 -46
- package/dist/animationComponent/index.js +519 -0
- package/dist/animationComponent/index.umd.js +3 -3
- package/dist/canvasAbsoluteMode/index.cjs.js +1 -1
- package/dist/canvasAbsoluteMode/index.es.js +115 -112
- package/dist/canvasAbsoluteMode/index.js +1 -0
- package/dist/canvasAbsoluteMode/index.umd.js +1 -1
- package/dist/canvasEmptyState/index.cjs.js +1 -1
- package/dist/canvasEmptyState/index.es.js +71 -68
- package/dist/canvasEmptyState/index.js +1 -0
- package/dist/canvasEmptyState/index.umd.js +1 -1
- package/dist/canvasFullSize/index.cjs.js +3 -3
- package/dist/canvasFullSize/index.es.js +69 -66
- package/dist/canvasFullSize/index.js +10 -0
- package/dist/canvasFullSize/index.umd.js +4 -4
- package/dist/canvasGridMode/index.cjs.js +7 -7
- package/dist/canvasGridMode/index.es.js +142 -139
- package/dist/canvasGridMode/index.js +26 -0
- package/dist/canvasGridMode/index.umd.js +7 -7
- package/dist/canvasScreenshot/index.cjs.js +1 -1
- package/dist/canvasScreenshot/index.es.js +78 -75
- package/dist/canvasScreenshot/index.js +1 -0
- package/dist/canvasScreenshot/index.umd.js +1 -1
- package/dist/dataSourceEjs/EjsExporter.d.ts +1 -1
- package/dist/dataSourceEjs/index.cjs.js +3 -3
- package/dist/dataSourceEjs/index.es.js +40 -37
- package/dist/dataSourceEjs/index.js +21 -0
- package/dist/dataSourceEjs/index.umd.js +3 -3
- package/dist/dataSourceHandlebars/HandlebarsExporter.d.ts +2 -2
- package/dist/dataSourceHandlebars/constants.d.ts +1 -1
- package/dist/dataSourceHandlebars/index.cjs.js +4 -4
- package/dist/dataSourceHandlebars/index.es.js +58 -55
- package/dist/dataSourceHandlebars/index.js +10 -0
- package/dist/dataSourceHandlebars/index.umd.js +2 -2
- package/dist/dialogComponent/index.cjs.js +11 -11
- package/dist/dialogComponent/index.es.js +72 -69
- package/dist/dialogComponent/index.js +59 -0
- package/dist/dialogComponent/index.umd.js +11 -11
- package/dist/flexComponent/index.cjs.js +6 -6
- package/dist/flexComponent/index.es.js +151 -142
- package/dist/flexComponent/index.js +33 -0
- package/dist/flexComponent/index.umd.js +8 -8
- package/dist/flexComponent/typesSchema.d.ts +1 -1
- package/dist/fsLightboxComponent/index.cjs.js +3 -3
- package/dist/fsLightboxComponent/index.es.js +93 -90
- package/dist/fsLightboxComponent/index.js +6 -0
- package/dist/fsLightboxComponent/index.umd.js +3 -3
- package/dist/googleFontsAssetProvider/index.cjs.js +1 -1
- package/dist/googleFontsAssetProvider/index.es.js +112 -109
- package/dist/googleFontsAssetProvider/index.js +1 -0
- package/dist/googleFontsAssetProvider/index.umd.js +1 -1
- package/dist/googleFontsAssetProvider/utils.d.ts +1 -1
- package/dist/iconifyComponent/index.cjs.js +2 -2
- package/dist/iconifyComponent/index.es.js +80 -77
- package/dist/iconifyComponent/index.js +3 -0
- package/dist/iconifyComponent/index.umd.js +2 -2
- package/dist/index.cjs.d.ts +1 -0
- package/dist/index.cjs.js +970 -82
- package/dist/index.d.ts +1 -0
- package/dist/index.es.d.ts +1 -0
- package/dist/index.es.js +7422 -6145
- package/dist/index.umd.js +975 -87
- package/dist/layoutSidebarButtons/index.cjs.js +1 -1
- package/dist/layoutSidebarButtons/index.es.js +95 -92
- package/dist/layoutSidebarButtons/index.js +1 -0
- package/dist/layoutSidebarButtons/index.umd.js +1 -1
- package/dist/lightGalleryComponent/index.cjs.js +1 -1
- package/dist/lightGalleryComponent/index.es.js +164 -161
- package/dist/lightGalleryComponent/index.js +1 -0
- package/dist/lightGalleryComponent/index.umd.js +1 -1
- package/dist/lightGalleryComponent/utils.d.ts +1 -1
- package/dist/linkImageComponent/index.cjs.js +2 -2
- package/dist/linkImageComponent/index.es.js +60 -57
- package/dist/linkImageComponent/index.js +12 -0
- package/dist/linkImageComponent/index.umd.js +2 -2
- package/dist/listPagesComponent/index.cjs.js +4 -4
- package/dist/listPagesComponent/index.es.js +57 -54
- package/dist/listPagesComponent/index.js +11 -0
- package/dist/listPagesComponent/index.umd.js +4 -4
- package/dist/listPagesComponent/utils.d.ts +1 -1
- package/dist/presetBlockLibrary/blocks.d.ts +6 -0
- package/dist/presetBlockLibrary/blocks.test.d.ts +2 -0
- package/dist/presetBlockLibrary/emailBlocks.d.ts +53 -0
- package/dist/presetBlockLibrary/index.cjs.d.ts +3 -0
- package/dist/presetBlockLibrary/index.cjs.js +889 -0
- package/dist/presetBlockLibrary/index.d.ts +3 -0
- package/dist/presetBlockLibrary/index.es.d.ts +3 -0
- package/dist/presetBlockLibrary/index.es.js +1408 -0
- package/dist/presetBlockLibrary/index.js +889 -0
- package/dist/presetBlockLibrary/index.test.d.ts +1 -0
- package/dist/presetBlockLibrary/index.umd.js +889 -0
- package/dist/presetBlockLibrary/shared.d.ts +3 -0
- package/dist/presetBlockLibrary/types.d.ts +24 -0
- package/dist/presetBlockLibrary/typesSchema.d.ts +47 -0
- package/dist/presetPrintable/index.cjs.js +3 -3
- package/dist/presetPrintable/index.es.js +133 -130
- package/dist/presetPrintable/index.js +32 -0
- package/dist/presetPrintable/index.umd.js +4 -4
- package/dist/prosemirror/index.cjs.js +8 -8
- package/dist/prosemirror/index.es.js +552 -549
- package/dist/prosemirror/index.js +10 -0
- package/dist/prosemirror/index.umd.js +9 -9
- package/dist/prosemirror/toolbar.d.ts +2 -2
- package/dist/prosemirror/types.d.ts +5 -5
- package/dist/rendererReact/index.cjs.js +1 -1
- package/dist/rendererReact/index.es.js +137 -134
- 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 +74 -71
- package/dist/rteTinyMce/index.js +104 -0
- package/dist/rteTinyMce/index.umd.js +2 -2
- package/dist/shapeDividerComponent/index.cjs.js +4 -4
- package/dist/shapeDividerComponent/index.es.js +91 -88
- package/dist/shapeDividerComponent/index.js +97 -0
- package/dist/shapeDividerComponent/index.umd.js +4 -4
- package/dist/swiperComponent/index.cjs.js +7 -7
- package/dist/swiperComponent/index.es.js +95 -92
- package/dist/swiperComponent/index.js +45 -0
- package/dist/swiperComponent/index.umd.js +5 -5
- package/dist/tableComponent/index.cjs.js +1 -1
- package/dist/tableComponent/index.es.js +181 -178
- package/dist/tableComponent/index.js +1 -0
- package/dist/tableComponent/index.umd.js +1 -1
- package/dist/tableComponent/types.d.ts +3 -3
- package/dist/types.d.ts +14 -14
- package/dist/utils.d.ts +3 -2
- package/dist/utilsDataSources.d.ts +1 -1
- package/dist/youtubeAssetProvider/index.cjs.js +1 -1
- package/dist/youtubeAssetProvider/index.es.js +90 -87
- package/dist/youtubeAssetProvider/index.js +1 -0
- package/dist/youtubeAssetProvider/index.umd.js +1 -1
- package/package.json +182 -34
- package/dist/aiChat/server/models.d.ts +0 -15
package/dist/aiChat/types.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { ChatInit, DynamicToolUIPart, HttpChatTransportInitOptions, ToolUIPart }
|
|
|
3
3
|
import { Component, Editor } from 'grapesjs';
|
|
4
4
|
import { StudioLayoutComponentsConfig } from '../types';
|
|
5
5
|
import { LicenseCheckResult } from '../utils';
|
|
6
|
+
import { ChatManager } from './chatManager';
|
|
6
7
|
import { ToolStatusProgressMap } from './clientToolsProcessors';
|
|
7
8
|
import { AiChatLayoutComponentsRegistryEntries } from './components/index';
|
|
8
9
|
import { AiChatOptions as AiChatOptionsSchema, CommonComponentPropsSchema } from './typesSchema';
|
|
@@ -44,6 +45,11 @@ export declare enum AiChatCommands {
|
|
|
44
45
|
getChatState = "aiChat:getChatState",
|
|
45
46
|
getChatApi = "aiChat:getChatApi"
|
|
46
47
|
}
|
|
48
|
+
export interface AiChatCommandRunMap {
|
|
49
|
+
[AiChatCommands.getChatManager]: () => ChatManager;
|
|
50
|
+
[AiChatCommands.getChatState]: () => ChatState;
|
|
51
|
+
[AiChatCommands.getChatApi]: () => ChatApi;
|
|
52
|
+
}
|
|
47
53
|
export interface ToolGenerateImageInput extends Record<string, unknown> {
|
|
48
54
|
prompt: string;
|
|
49
55
|
images?: string[];
|
|
@@ -173,6 +179,10 @@ export interface ChatRequestBody {
|
|
|
173
179
|
export interface ChatContext extends Pick<UseChatHelpers<UIMessage>, 'id' | 'setMessages' | 'messages' | 'sendMessage' | 'status' | 'stop' | 'addToolApprovalResponse' | 'addToolOutput' | 'clearError' | 'error'>, Pick<ChatState, 'toolStatusProgress' | 'contextComponents'> {
|
|
174
180
|
setError: (error: Error | string | undefined) => void;
|
|
175
181
|
}
|
|
182
|
+
declare module 'grapesjs' {
|
|
183
|
+
interface CommandRegistryRun extends AiChatCommandRunMap {
|
|
184
|
+
}
|
|
185
|
+
}
|
|
176
186
|
export interface AiChatMessageLayoutProps {
|
|
177
187
|
editor: Editor;
|
|
178
188
|
chatContext: ChatContext;
|
|
@@ -211,9 +221,10 @@ export interface AiChatClientToolOnDataProps<TInput extends Record<string, unkno
|
|
|
211
221
|
export interface CommandLabelProps {
|
|
212
222
|
isExecuted: boolean;
|
|
213
223
|
}
|
|
224
|
+
export type OptionalLayoutComponent = StudioLayoutComponentsConfig | undefined;
|
|
214
225
|
type CommandToolResult = string | Record<string, unknown> | void;
|
|
215
226
|
export interface CommandToolClientDefinition {
|
|
216
|
-
label?: (props: CommandLabelProps) =>
|
|
227
|
+
label?: (props: CommandLabelProps) => OptionalLayoutComponent;
|
|
217
228
|
execute?: (props: {
|
|
218
229
|
editor: Editor;
|
|
219
230
|
input: AiChatToolsArguments[AiChatToolName.RUN_COMMAND];
|
|
@@ -236,7 +247,7 @@ export interface AiChatClientTool<TInput extends Record<string, unknown> = any>
|
|
|
236
247
|
/**
|
|
237
248
|
* Custom label for tool in the message.
|
|
238
249
|
*/
|
|
239
|
-
layoutToolLabel?: (props: AiChatMessageToolDetailLayoutProps) =>
|
|
250
|
+
layoutToolLabel?: (props: AiChatMessageToolDetailLayoutProps) => OptionalLayoutComponent;
|
|
240
251
|
/**
|
|
241
252
|
* Callback on incoming status data for this tool.
|
|
242
253
|
*/
|
|
@@ -244,7 +255,7 @@ export interface AiChatClientTool<TInput extends Record<string, unknown> = any>
|
|
|
244
255
|
/**
|
|
245
256
|
* Custom layout for tool in the message.
|
|
246
257
|
*/
|
|
247
|
-
layoutToolResult?: (props: AiChatMessageToolDetailLayoutProps) =>
|
|
258
|
+
layoutToolResult?: (props: AiChatMessageToolDetailLayoutProps) => OptionalLayoutComponent;
|
|
248
259
|
}
|
|
249
260
|
/**
|
|
250
261
|
* Context passed to client-side tools
|
|
@@ -309,7 +320,10 @@ export interface LayoutComponentContext<T> {
|
|
|
309
320
|
editor: Editor;
|
|
310
321
|
props: Omit<T, 'chatContext' | 'type'>;
|
|
311
322
|
}
|
|
312
|
-
type
|
|
323
|
+
type RelaxOptionalLayoutCallbacks<T> = {
|
|
324
|
+
[K in keyof T]: NonNullable<T[K]> extends (...args: infer TArgs) => OptionalLayoutComponent ? ((...args: TArgs) => OptionalLayoutComponent | void) | Extract<T[K], undefined> : T[K];
|
|
325
|
+
};
|
|
326
|
+
type CustomLayoutComponentPropsFn<T> = (props: LayoutComponentContext<T>) => Partial<RelaxOptionalLayoutCallbacks<Omit<T, 'chatContext' | 'type'>>>;
|
|
313
327
|
/**
|
|
314
328
|
* Customizable layout components
|
|
315
329
|
* @example
|
|
@@ -69,6 +69,19 @@ export interface AiChatOptions extends SDKPluginOptions {
|
|
|
69
69
|
* body: { projectId: 'my-project' }
|
|
70
70
|
*/
|
|
71
71
|
body?: object | '__fn__';
|
|
72
|
+
/**
|
|
73
|
+
* Default transport options for chat API calls.
|
|
74
|
+
* Use this to customize headers, credentials, or other transport settings.
|
|
75
|
+
* @examples
|
|
76
|
+
* defaultTransportOptions: {
|
|
77
|
+
* headers: async () => ({
|
|
78
|
+
* 'X-Workspace-Id': workspaceId,
|
|
79
|
+
* 'X-Project-Id': projectId
|
|
80
|
+
* }),
|
|
81
|
+
* credentials: 'include'
|
|
82
|
+
* }
|
|
83
|
+
*/
|
|
84
|
+
defaultTransportOptions?: object;
|
|
72
85
|
/**
|
|
73
86
|
* Function to get the access token
|
|
74
87
|
* @examples
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";const G="app.grapesjs.com",
|
|
2
|
-
`)},init(){const{em:n}=this;this.addStyle({[u.name]:"fadeIn",[u.duration]:"1s",[u.fillMode]:"both",...e.animationStyle,...this.getStyle()}),this.listenTo(n,s.mount,c=>{var h;if(c!==this)return;((h=this.parent())==null?void 0:h.get("type"))!==I||m.forEach(g=>this.removeStyle(g))})}},view:{events:()=>({animationstart:"onAnimationStart",animationend:"onAnimationEnd"}),init(){const{model:n}=this;this.listenTo(n,s.styleUpdate,this.handleStyleChange)},onAnimationStart(){var c;if((c=this.cmpSpots)!=null&&c.length)return;const n=i.getSpots({component:this.model});this.cmpSpots=n,i.removeSpots(n),this.el.ownerDocument.body.style.overflowX="hidden"},onAnimationEnd(){const n=this.cmpSpots||[];i.spots.add(n),this.cmpSpots=[],this.el.ownerDocument.body.style.overflowX=""},triggerAnimation(){this.el.dispatchEvent(new CustomEvent(T))},handleStyleChange(n,c){Object.keys((c==null?void 0:c.style)||{}).some(g=>d.includes(g)||m.includes(g))&&this.triggerAnimation()},onRender(){this.triggerAnimation()}}}),()=>{r.remove(y),a.removeType(y)}},
|
|
1
|
+
"use strict";const G="app.grapesjs.com",B="app-stage.grapesjs.com",N="app2.grapesjs.com",V="app-stage2.grapesjs.com",D=[G,N,B,V,"localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io",".claudemcpcontent.com",".web-sandbox.oaiusercontent.com"],X="license:check:end",j=()=>typeof window<"u",_=({isDev:t,isStage:e,isPlatform:a})=>`${t?"":`https://${e?B:G}`}/${a?"platform-api":"api"}`,$=()=>{if(!j())return"";const{hostname:t}=window.location;if(t)return t;try{return window.parent.location.hostname||""}catch{return""}},C=()=>{const t=$();return!!t&&(D.includes(t)||D.some(e=>t.endsWith(e)))};async function Y({path:t,baseApiUrl:e,method:a="GET",headers:r={},params:i,body:o}){const s=`${e||_({isDev:!1,isStage:!1})}${t}`,p={method:a,headers:{"Content-Type":"application/json",...r}};o&&(p.body=JSON.stringify(o));const m=i?new URLSearchParams(i).toString():"",d=m?`?${m}`:"",n=await fetch(`${s}${d}`,p);if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);return n.json()}var b=(t=>(t.free="free",t.startup="startup",t.business="business",t.enterprise="enterprise",t))(b||{}),P=(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.openEditCode="studio:openEditCode",t.openBlocks="studio:openBlocks",t.appendComponent="studio:appendComponent",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||{});const L={[b.free]:0,[b.startup]:10,[b.business]:20,[b.enterprise]:30};function H(t,e){const a=t;return a.init=r=>{const i=o=>t(o,r);return i.__gjsPluginId=e,i},a}const W=(t,e)=>H(t,e);async function K({editor:t,plan:e,pluginName:a,licenseKey:r,onLicenseCheckResponse:i,cleanup:o}){let l="",s;const p=n=>{console.warn("Cleanup plugin:",a,"Reason:",n),o(t,a)},m=(n={})=>{var A;const{error:c,sdkLicense:f}=n,h=(A=n.plan)==null?void 0:A.category;if(!(f||n.license)||c)p(c||"Invalid license");else if(h){const E=L[e],F=L[h];E>F&&p({pluginRequiredPlan:e,licensePlan:h})}};t.Commands.has(P.settings)&&(s=t.runCommand(P.settings),l=(s==null?void 0:s.baseUrl)||"");const d=n=>{i==null||i(n),n&&m(n)};if(!s){t.onReady(async()=>{if(!C())if(r){const n=await J({licenseKey:r,pluginName:a,baseApiUrl:l});d(n)}else p("The `licenseKey` option not provided")});return}if(s.licensePlan||s.licenseError){const n=q(s);d(n);return}t.on(X,n=>d(n))}const q=t=>({sdkLicense:t.license,license:t.license,error:t.licenseError,plan:t.licensePlan});async function J(t){const{licenseKey:e,pluginName:a,baseApiUrl:r}=t;try{return(await Y({baseApiUrl:r,path:`/sdk/${e||"na"}`,method:"POST",params:{d:window.location.hostname,pn:a}})).result||{}}catch(i){return console.error("Error during SDK license check:",i),!1}}const Q=(...t)=>e=>t.some(a=>e.is(a));var u=(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=(t=>(t.onScroll="--animation-on-scroll",t.threshold="--animation-threshold",t.repeat="--animation-repeat",t))(v||{});const y="animation",I="animation-group",T="animation:update",R="animation-group:update",z={category:{id:"animations",label:"Animations"},select:!0},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={isVisible:({component:t})=>k(t)},tt={isVisible:({component:t})=>w(t)},et={isVisible:({component:t})=>k(t)&&w(t==null?void 0:t.parent())?!1:O(t)},U={isVisible:({component:t,sector:e})=>{var a;return k(t)&&w(t==null?void 0:t.parent())?!1:O(t)&&((a=e.getProperty(v.onScroll))==null?void 0:a.getValue())==="true"}},Z={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>'},nt=function(t){const e=this;let a=null;const r=()=>{a==null||a.disconnect(),a=null},i=()=>{r();const o=e.style;o.animationName="",requestAnimationFrame(()=>{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())||.2,d=l.getPropertyValue("--animation-repeat").trim()==="true",n=()=>{o.animationName="none",e.offsetWidth,o.animationName=s,o.animationPlayState="running"};if(!s||s==="none"){o.animationName="none",o.animationPlayState="paused";return}if(!p){n();return}o.animationPlayState="paused",a=new IntersectionObserver(c=>{c.forEach(f=>{f.isIntersecting&&(n(),!d&&r())})},{threshold:m}),a.observe(e)})};e.addEventListener(t.animationUpdateEvent,i),i()},at=(t,e)=>{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);return a.addType(y,{block:o?{label:p,media:Z.animation,content:{type:y},...z,...o}:void 0,model:{defaults:{emptyState:!0,name:p,traits:[],script:nt,animationUpdateEvent:T,"script-props":["animationUpdateEvent"],styles:l.map(n=>n.css).join(`
|
|
2
|
+
`)},init(){const{em:n}=this;this.addStyle({[u.name]:"fadeIn",[u.duration]:"1s",[u.fillMode]:"both",...e.animationStyle,...this.getStyle()}),this.listenTo(n,s.mount,c=>{var h;if(c!==this)return;((h=this.parent())==null?void 0:h.get("type"))!==I||m.forEach(g=>this.removeStyle(g))})}},view:{events:()=>({animationstart:"onAnimationStart",animationend:"onAnimationEnd"}),init(){const{model:n}=this;this.listenTo(n,s.styleUpdate,this.handleStyleChange)},onAnimationStart(){var c;if((c=this.cmpSpots)!=null&&c.length)return;const n=i.getSpots({component:this.model});this.cmpSpots=n,i.removeSpots(n),this.el.ownerDocument.body.style.overflowX="hidden"},onAnimationEnd(){const n=this.cmpSpots||[];i.spots.add(n),this.cmpSpots=[],this.el.ownerDocument.body.style.overflowX=""},triggerAnimation(){this.el.dispatchEvent(new CustomEvent(T))},handleStyleChange(n,c){Object.keys((c==null?void 0:c.style)||{}).some(g=>d.includes(g)||m.includes(g))&&this.triggerAnimation()},onRender(){this.triggerAnimation()}}}),()=>{r.remove(y),a.removeType(y)}},ot=function(t){const e=this,a="--animation-on-scroll",r="--animation-threshold",i="--animation-repeat";let o=null;const l=()=>{o==null||o.disconnect(),o=null},s=()=>{l();const p=getComputedStyle(e),m=p.getPropertyValue(a).trim()!=="false",d=parseFloat(p.getPropertyValue(r).trim())||.2,n=p.getPropertyValue(i).trim()==="true",c=()=>{Array.from(e.children).forEach(f=>{f instanceof HTMLElement&&typeof f.dispatchEvent=="function"&&f.dispatchEvent(new CustomEvent(R,{bubbles:!1}))})};if(!m){c();return}o=new IntersectionObserver(f=>{f.forEach(h=>{h.isIntersecting?(c(),!n&&l()):n&&Array.from(e.children).forEach(g=>{g instanceof HTMLElement&&getComputedStyle(g).getPropertyValue(a).trim()!=="false"&&(g.style.opacity="0",g.style.animationPlayState="paused")})})},{threshold:d}),o.observe(e)};e.addEventListener(t.animationGroupUpdateEvent,s),s()},it=(t,e)=>{const{Components:a,Blocks:r}=t,{blockGroup:i={}}=e,o="Animation Group";return a.addType(I,{block:i?{label:o,media:Z.animationGroup,content:{type:I,components:[{type:y},{type:y},{type:y}]},...z,...i}:void 0,model:{defaults:{name:o,emptyState:!0,traits:[],script:ot,animationGroupUpdateEvent:R,"script-props":["animationGroupUpdateEvent"],droppable:Q(y)},init(){this.addStyle({...e.animationGroupStyle,...this.getStyle()});const l=this.components();this.listenTo(l,"add remove",this.updateChildrenStaggerStyles),this.updateChildrenStaggerStyles()},updateChildrenStaggerStyles(){this.components().forEach((l,s)=>{l.is(y)&&l.addStyle({"--stagger-index":s.toString(),[u.delay]:"calc(var(--stagger-index, 0) * var(--stagger-delay, 0.3s))"},{partial:!0})})}},view:{init(){const{model:l}=this;this.listenTo(l,"component:styleUpdate",this.handleStyleChange)},triggerAnimation(){this.el.dispatchEvent(new CustomEvent(R))},handleStyleChange(){this.triggerAnimation(),this.model.updateChildrenStaggerStyles()},onRender(){this.triggerAnimation()}}}),()=>{r.remove(I),a.removeType(I)}},M="animationComponent",st=b.startup,S=[{id:"flash",name:"Flash",css:`@keyframes flash {
|
|
3
3
|
0%, 50%, to {
|
|
4
4
|
opacity:1
|
|
5
5
|
}
|
|
@@ -516,4 +516,4 @@
|
|
|
516
516
|
transform: scale3d(.475, .475, .475) translate3d(0, -60px, 0);
|
|
517
517
|
animation-timing-function:cubic-bezier(.175, .885, .32, 1)
|
|
518
518
|
}
|
|
519
|
-
}`}],rt=function(t,e={}){var i;const a=((i=e.animations)==null?void 0:i.call(e,{items:S}))||S,r=[
|
|
519
|
+
}`}],rt=function(t,e={}){var i;const a=((i=e.animations)==null?void 0:i.call(e,{items:S}))||S,r=[at(t,{...e,animationList:a}),it(t,e)];t.Styles.addSector("animation",{name:"Animation",properties:[{...x,name:"Type",property:u.name,type:"select",full:!0,default:"fadeIn",options:a},{...x,name:"Duration",property:u.duration,type:"number",units:["s"],min:.1,max:10,step:.1,default:"1s"},{...x,name:"Delay",property:u.delay,type:"number",units:["s"],min:0,max:10,step:.1,default:"1s"},{...x,name:"Iteration Count",property:u.iterationCount,type:"select",default:"1",options:[{id:"1",name:"One time"},{id:"infinite",name:"Infinite"}]},{...x,name:"Timing",property:u.timingFunction,type:"select",default:"ease",options:[{id:"ease",name:"Ease"},{id:"ease-in",name:"Ease in"},{id:"ease-out",name:"Ease out"},{id:"ease-in-out",name:"Ease in out"},{id:"linear",name:"Linear"}]},{...tt,name:"Stagger Delay",property:"--stagger-delay",type:"slider",units:["s"],min:.1,max:5,step:.1,default:"0.3s"},{...et,name:"Animate on Scroll",property:v.onScroll,type:"radio",default:"true",options:[{name:"Yes",id:"true"},{name:"No",id:"false"}]},{...U,name:"Scroll Threshold",property:v.threshold,type:"number",full:!0,min:.1,max:1,step:.01,default:"0.2"},{...U,name:"Repeat on Scroll",property:v.repeat,type:"radio",default:"false",options:[{name:"Yes",id:"true"},{name:"No",id:"false"}]}]}),K({editor:t,licenseKey:e.licenseKey,plan:st,pluginName:M,cleanup:()=>{r.forEach(o=>o())}})},lt=W(rt,M);module.exports=lt;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const G = "app.grapesjs.com",
|
|
1
|
+
const G = "app.grapesjs.com", B = "app-stage.grapesjs.com", N = "app2.grapesjs.com", V = "app-stage2.grapesjs.com", D = [
|
|
2
2
|
G,
|
|
3
|
-
F,
|
|
4
|
-
z,
|
|
5
3
|
N,
|
|
4
|
+
B,
|
|
5
|
+
V,
|
|
6
6
|
"localhost",
|
|
7
7
|
"127.0.0.1",
|
|
8
8
|
".local-credentialless.webcontainer.io",
|
|
@@ -15,12 +15,12 @@ const G = "app.grapesjs.com", z = "app-stage.grapesjs.com", F = "app2.grapesjs.c
|
|
|
15
15
|
// For Claude mcp app
|
|
16
16
|
".web-sandbox.oaiusercontent.com"
|
|
17
17
|
// For OpenAI mcp app
|
|
18
|
-
],
|
|
18
|
+
], X = "license:check:end", j = () => typeof window < "u", _ = ({
|
|
19
19
|
isDev: t,
|
|
20
20
|
isStage: e,
|
|
21
21
|
isPlatform: a
|
|
22
|
-
}) => `${t ? "" : `https://${e ?
|
|
23
|
-
if (!
|
|
22
|
+
}) => `${t ? "" : `https://${e ? B : G}`}/${a ? "platform-api" : "api"}`, $ = () => {
|
|
23
|
+
if (!j()) return "";
|
|
24
24
|
const { hostname: t } = window.location;
|
|
25
25
|
if (t) return t;
|
|
26
26
|
try {
|
|
@@ -40,7 +40,7 @@ async function Y({
|
|
|
40
40
|
params: i,
|
|
41
41
|
body: o
|
|
42
42
|
}) {
|
|
43
|
-
const s = `${e ||
|
|
43
|
+
const s = `${e || _({ isDev: !1, isStage: !1 })}${t}`, p = {
|
|
44
44
|
method: a,
|
|
45
45
|
headers: {
|
|
46
46
|
"Content-Type": "application/json",
|
|
@@ -53,19 +53,22 @@ async function Y({
|
|
|
53
53
|
throw new Error(`HTTP error! status: ${n.status}`);
|
|
54
54
|
return n.json();
|
|
55
55
|
}
|
|
56
|
-
var b = /* @__PURE__ */ ((t) => (t.free = "free", t.startup = "startup", t.business = "business", t.enterprise = "enterprise", t))(b || {}),
|
|
56
|
+
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.openEditCode = "studio:openEditCode", t.openBlocks = "studio:openBlocks", t.appendComponent = "studio:appendComponent", 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 || {});
|
|
57
57
|
const L = {
|
|
58
58
|
[b.free]: 0,
|
|
59
59
|
[b.startup]: 10,
|
|
60
60
|
[b.business]: 20,
|
|
61
61
|
[b.enterprise]: 30
|
|
62
62
|
};
|
|
63
|
-
function H(t) {
|
|
64
|
-
const
|
|
65
|
-
return
|
|
63
|
+
function H(t, e) {
|
|
64
|
+
const a = t;
|
|
65
|
+
return a.init = (r) => {
|
|
66
|
+
const i = (o) => t(o, r);
|
|
67
|
+
return i.__gjsPluginId = e, i;
|
|
68
|
+
}, a;
|
|
66
69
|
}
|
|
67
|
-
const W = (t) => /* @__PURE__ */ H(t);
|
|
68
|
-
async function
|
|
70
|
+
const W = (t, e) => /* @__PURE__ */ H(t, e);
|
|
71
|
+
async function K({
|
|
69
72
|
editor: t,
|
|
70
73
|
plan: e,
|
|
71
74
|
pluginName: a,
|
|
@@ -75,18 +78,18 @@ async function _({
|
|
|
75
78
|
}) {
|
|
76
79
|
let l = "", s;
|
|
77
80
|
const p = (n) => {
|
|
78
|
-
console.warn("Cleanup plugin:", a, "Reason:", n), o();
|
|
81
|
+
console.warn("Cleanup plugin:", a, "Reason:", n), o(t, a);
|
|
79
82
|
}, m = (n = {}) => {
|
|
80
83
|
var A;
|
|
81
84
|
const { error: c, sdkLicense: f } = n, h = (A = n.plan) == null ? void 0 : A.category;
|
|
82
85
|
if (!(f || n.license) || c)
|
|
83
86
|
p(c || "Invalid license");
|
|
84
87
|
else if (h) {
|
|
85
|
-
const E = L[e],
|
|
86
|
-
E >
|
|
88
|
+
const E = L[e], F = L[h];
|
|
89
|
+
E > F && p({ pluginRequiredPlan: e, licensePlan: h });
|
|
87
90
|
}
|
|
88
91
|
};
|
|
89
|
-
t.Commands.has(
|
|
92
|
+
t.Commands.has(P.settings) && (s = t.runCommand(P.settings), l = (s == null ? void 0 : s.baseUrl) || "");
|
|
90
93
|
const d = (n) => {
|
|
91
94
|
i == null || i(n), n && m(n);
|
|
92
95
|
};
|
|
@@ -94,7 +97,7 @@ async function _({
|
|
|
94
97
|
t.onReady(async () => {
|
|
95
98
|
if (!C())
|
|
96
99
|
if (r) {
|
|
97
|
-
const n = await
|
|
100
|
+
const n = await J({ licenseKey: r, pluginName: a, baseApiUrl: l });
|
|
98
101
|
d(n);
|
|
99
102
|
} else
|
|
100
103
|
p("The `licenseKey` option not provided");
|
|
@@ -102,19 +105,19 @@ async function _({
|
|
|
102
105
|
return;
|
|
103
106
|
}
|
|
104
107
|
if (s.licensePlan || s.licenseError) {
|
|
105
|
-
const n =
|
|
108
|
+
const n = q(s);
|
|
106
109
|
d(n);
|
|
107
110
|
return;
|
|
108
111
|
}
|
|
109
|
-
t.on(
|
|
112
|
+
t.on(X, (n) => d(n));
|
|
110
113
|
}
|
|
111
|
-
const
|
|
114
|
+
const q = (t) => ({
|
|
112
115
|
sdkLicense: t.license,
|
|
113
116
|
license: t.license,
|
|
114
117
|
error: t.licenseError,
|
|
115
118
|
plan: t.licensePlan
|
|
116
119
|
});
|
|
117
|
-
async function
|
|
120
|
+
async function J(t) {
|
|
118
121
|
const { licenseKey: e, pluginName: a, baseApiUrl: r } = t;
|
|
119
122
|
try {
|
|
120
123
|
return (await Y({
|
|
@@ -130,16 +133,16 @@ async function q(t) {
|
|
|
130
133
|
return console.error("Error during SDK license check:", i), !1;
|
|
131
134
|
}
|
|
132
135
|
}
|
|
133
|
-
const
|
|
136
|
+
const Q = (...t) => (e) => t.some((a) => e.is(a));
|
|
134
137
|
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",
|
|
138
|
+
const y = "animation", I = "animation-group", T = "animation:update", R = "animation-group:update", z = {
|
|
136
139
|
category: { id: "animations", label: "Animations" },
|
|
137
140
|
select: !0
|
|
138
141
|
}, 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
142
|
isVisible: ({ component: t }) => k(t)
|
|
140
|
-
}, Q = {
|
|
141
|
-
isVisible: ({ component: t }) => w(t)
|
|
142
143
|
}, tt = {
|
|
144
|
+
isVisible: ({ component: t }) => w(t)
|
|
145
|
+
}, et = {
|
|
143
146
|
isVisible: ({ component: t }) => k(t) && w(t == null ? void 0 : t.parent()) ? !1 : O(t)
|
|
144
147
|
}, U = {
|
|
145
148
|
isVisible: ({ component: t, sector: e }) => {
|
|
@@ -149,7 +152,7 @@ const y = "animation", I = "animation-group", T = "animation:update", P = "anima
|
|
|
149
152
|
}, Z = {
|
|
150
153
|
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>',
|
|
151
154
|
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>'
|
|
152
|
-
},
|
|
155
|
+
}, nt = function(t) {
|
|
153
156
|
const e = this;
|
|
154
157
|
let a = null;
|
|
155
158
|
const r = () => {
|
|
@@ -180,14 +183,14 @@ const y = "animation", I = "animation-group", T = "animation:update", P = "anima
|
|
|
180
183
|
});
|
|
181
184
|
};
|
|
182
185
|
e.addEventListener(t.animationUpdateEvent, i), i();
|
|
183
|
-
},
|
|
186
|
+
}, at = (t, e) => {
|
|
184
187
|
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
188
|
return a.addType(y, {
|
|
186
189
|
block: o ? {
|
|
187
190
|
label: p,
|
|
188
191
|
media: Z.animation,
|
|
189
192
|
content: { type: y },
|
|
190
|
-
...
|
|
193
|
+
...z,
|
|
191
194
|
...o
|
|
192
195
|
} : void 0,
|
|
193
196
|
model: {
|
|
@@ -195,7 +198,7 @@ const y = "animation", I = "animation-group", T = "animation:update", P = "anima
|
|
|
195
198
|
emptyState: !0,
|
|
196
199
|
name: p,
|
|
197
200
|
traits: [],
|
|
198
|
-
script:
|
|
201
|
+
script: nt,
|
|
199
202
|
animationUpdateEvent: T,
|
|
200
203
|
"script-props": ["animationUpdateEvent"],
|
|
201
204
|
styles: l.map((n) => n.css).join(`
|
|
@@ -248,7 +251,7 @@ const y = "animation", I = "animation-group", T = "animation:update", P = "anima
|
|
|
248
251
|
}), () => {
|
|
249
252
|
r.remove(y), a.removeType(y);
|
|
250
253
|
};
|
|
251
|
-
},
|
|
254
|
+
}, ot = function(t) {
|
|
252
255
|
const e = this, a = "--animation-on-scroll", r = "--animation-threshold", i = "--animation-repeat";
|
|
253
256
|
let o = null;
|
|
254
257
|
const l = () => {
|
|
@@ -257,7 +260,7 @@ const y = "animation", I = "animation-group", T = "animation:update", P = "anima
|
|
|
257
260
|
l();
|
|
258
261
|
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
262
|
Array.from(e.children).forEach((f) => {
|
|
260
|
-
f instanceof HTMLElement && typeof f.dispatchEvent == "function" && f.dispatchEvent(new CustomEvent(
|
|
263
|
+
f instanceof HTMLElement && typeof f.dispatchEvent == "function" && f.dispatchEvent(new CustomEvent(R, { bubbles: !1 }));
|
|
261
264
|
});
|
|
262
265
|
};
|
|
263
266
|
if (!m) {
|
|
@@ -276,7 +279,7 @@ const y = "animation", I = "animation-group", T = "animation:update", P = "anima
|
|
|
276
279
|
), o.observe(e);
|
|
277
280
|
};
|
|
278
281
|
e.addEventListener(t.animationGroupUpdateEvent, s), s();
|
|
279
|
-
},
|
|
282
|
+
}, it = (t, e) => {
|
|
280
283
|
const { Components: a, Blocks: r } = t, { blockGroup: i = {} } = e, o = "Animation Group";
|
|
281
284
|
return a.addType(I, {
|
|
282
285
|
block: i ? {
|
|
@@ -290,7 +293,7 @@ const y = "animation", I = "animation-group", T = "animation:update", P = "anima
|
|
|
290
293
|
{ type: y }
|
|
291
294
|
]
|
|
292
295
|
},
|
|
293
|
-
...
|
|
296
|
+
...z,
|
|
294
297
|
...i
|
|
295
298
|
} : void 0,
|
|
296
299
|
model: {
|
|
@@ -298,10 +301,10 @@ const y = "animation", I = "animation-group", T = "animation:update", P = "anima
|
|
|
298
301
|
name: o,
|
|
299
302
|
emptyState: !0,
|
|
300
303
|
traits: [],
|
|
301
|
-
script:
|
|
302
|
-
animationGroupUpdateEvent:
|
|
304
|
+
script: ot,
|
|
305
|
+
animationGroupUpdateEvent: R,
|
|
303
306
|
"script-props": ["animationGroupUpdateEvent"],
|
|
304
|
-
droppable:
|
|
307
|
+
droppable: Q(y)
|
|
305
308
|
},
|
|
306
309
|
init() {
|
|
307
310
|
this.addStyle({
|
|
@@ -329,7 +332,7 @@ const y = "animation", I = "animation-group", T = "animation:update", P = "anima
|
|
|
329
332
|
this.listenTo(l, "component:styleUpdate", this.handleStyleChange);
|
|
330
333
|
},
|
|
331
334
|
triggerAnimation() {
|
|
332
|
-
this.el.dispatchEvent(new CustomEvent(
|
|
335
|
+
this.el.dispatchEvent(new CustomEvent(R));
|
|
333
336
|
},
|
|
334
337
|
handleStyleChange() {
|
|
335
338
|
this.triggerAnimation(), this.model.updateChildrenStaggerStyles();
|
|
@@ -341,7 +344,7 @@ const y = "animation", I = "animation-group", T = "animation:update", P = "anima
|
|
|
341
344
|
}), () => {
|
|
342
345
|
r.remove(I), a.removeType(I);
|
|
343
346
|
};
|
|
344
|
-
},
|
|
347
|
+
}, M = "animationComponent", st = b.startup, S = [
|
|
345
348
|
{
|
|
346
349
|
id: "flash",
|
|
347
350
|
name: "Flash",
|
|
@@ -1022,8 +1025,8 @@ const y = "animation", I = "animation-group", T = "animation:update", P = "anima
|
|
|
1022
1025
|
], rt = function(t, e = {}) {
|
|
1023
1026
|
var i;
|
|
1024
1027
|
const a = ((i = e.animations) == null ? void 0 : i.call(e, { items: S })) || S, r = [
|
|
1025
|
-
|
|
1026
|
-
|
|
1028
|
+
at(t, { ...e, animationList: a }),
|
|
1029
|
+
it(t, e)
|
|
1027
1030
|
];
|
|
1028
1031
|
t.Styles.addSector("animation", {
|
|
1029
1032
|
name: "Animation",
|
|
@@ -1085,7 +1088,7 @@ const y = "animation", I = "animation-group", T = "animation:update", P = "anima
|
|
|
1085
1088
|
]
|
|
1086
1089
|
},
|
|
1087
1090
|
{
|
|
1088
|
-
...
|
|
1091
|
+
...tt,
|
|
1089
1092
|
name: "Stagger Delay",
|
|
1090
1093
|
property: "--stagger-delay",
|
|
1091
1094
|
type: "slider",
|
|
@@ -1096,7 +1099,7 @@ const y = "animation", I = "animation-group", T = "animation:update", P = "anima
|
|
|
1096
1099
|
default: "0.3s"
|
|
1097
1100
|
},
|
|
1098
1101
|
{
|
|
1099
|
-
...
|
|
1102
|
+
...et,
|
|
1100
1103
|
name: "Animate on Scroll",
|
|
1101
1104
|
property: v.onScroll,
|
|
1102
1105
|
type: "radio",
|
|
@@ -1141,16 +1144,16 @@ const y = "animation", I = "animation-group", T = "animation:update", P = "anima
|
|
|
1141
1144
|
]
|
|
1142
1145
|
}
|
|
1143
1146
|
]
|
|
1144
|
-
}),
|
|
1147
|
+
}), K({
|
|
1145
1148
|
editor: t,
|
|
1146
1149
|
licenseKey: e.licenseKey,
|
|
1147
1150
|
plan: st,
|
|
1148
|
-
pluginName:
|
|
1151
|
+
pluginName: M,
|
|
1149
1152
|
cleanup: () => {
|
|
1150
1153
|
r.forEach((o) => o());
|
|
1151
1154
|
}
|
|
1152
1155
|
});
|
|
1153
|
-
}, lt = W(rt);
|
|
1156
|
+
}, lt = W(rt, M);
|
|
1154
1157
|
export {
|
|
1155
1158
|
lt as default
|
|
1156
1159
|
};
|