@webstudio-is/sdk-components-animation 0.0.0-017f1bd
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/LICENSE +49 -0
- package/README.md +4 -0
- package/lib/animate-children-4Ikuk4xp.js +2 -0
- package/lib/components.js +2 -0
- package/lib/hooks.js +2 -0
- package/lib/metas.js +8 -0
- package/lib/templates.js +2 -0
- package/lib/types/__generated__/animate-children.props.d.ts +2 -0
- package/lib/types/__generated__/animate-text.props.d.ts +2 -0
- package/lib/types/__generated__/stagger-animation.props.d.ts +2 -0
- package/lib/types/__generated__/video-animation.props.d.ts +2 -0
- package/lib/types/animate-children.d.ts +10 -0
- package/lib/types/animate-children.ws.d.ts +2 -0
- package/lib/types/animate-text.d.ts +42 -0
- package/lib/types/animate-text.ws.d.ts +2 -0
- package/lib/types/components.d.ts +4 -0
- package/lib/types/hooks.d.ts +2 -0
- package/lib/types/metas.d.ts +4 -0
- package/lib/types/shared/create-progress-animation.d.ts +5 -0
- package/lib/types/shared/meta.d.ts +1 -0
- package/lib/types/shared/proxy.d.ts +16 -0
- package/lib/types/stagger-animation.d.ts +32 -0
- package/lib/types/stagger-animation.ws.d.ts +2 -0
- package/lib/types/templates.d.ts +1 -0
- package/lib/types/video-animation.d.ts +5 -0
- package/lib/types/video-animation.template.d.ts +2 -0
- package/lib/types/video-animation.ws.d.ts +2 -0
- package/package.json +80 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
Webstudio, Inc. End User License Agreement (EULA)
|
|
2
|
+
|
|
3
|
+
Last updated: August 3, 2025
|
|
4
|
+
|
|
5
|
+
1. Definitions
|
|
6
|
+
“Agreement” means this End User License Agreement.
|
|
7
|
+
“Company” means Webstudio, Inc., its successors and assigns.
|
|
8
|
+
“Software” means the computer programs identified by this Agreement, including any updates, upgrades, and accompanying documentation.
|
|
9
|
+
“Licensee” or “You” means the individual or legal entity that has downloaded, installed, or is using the Software.
|
|
10
|
+
|
|
11
|
+
2. Grant of License
|
|
12
|
+
Subject to the terms of this Agreement, Company grants You a non-exclusive, non-transferable, revocable, limited license to:
|
|
13
|
+
a. Use the Software solely for Your internal business purposes on the number of devices or seats for which You have purchased licenses.
|
|
14
|
+
b. Run the Software in object code form only.
|
|
15
|
+
No other rights are granted.
|
|
16
|
+
|
|
17
|
+
3. Restrictions
|
|
18
|
+
You shall not, and shall not permit any third party to:
|
|
19
|
+
a. Copy, reproduce, or distribute the Software, in whole or in part, except as expressly authorized in writing by Company.
|
|
20
|
+
b. Modify, adapt, translate, or create derivative works of the Software, or merge the Software into any other program.
|
|
21
|
+
c. Reverse-engineer, decompile, disassemble, or otherwise attempt to discover the source code of the Software.
|
|
22
|
+
d. Rent, lease, sell, sublicense, or otherwise transfer rights to the Software.
|
|
23
|
+
e. Remove, alter, or obscure any proprietary notices, including copyright notices, on the Software.
|
|
24
|
+
|
|
25
|
+
4. Ownership
|
|
26
|
+
The Software is licensed, not sold. Company and its licensors retain all right, title, and interest in and to the Software, including intellectual property rights.
|
|
27
|
+
|
|
28
|
+
5. Updates and Support
|
|
29
|
+
Company may, in its sole discretion, provide updates, upgrades, or support services for the Software under a separate support agreement.
|
|
30
|
+
|
|
31
|
+
6. Term and Termination
|
|
32
|
+
This Agreement remains in effect until terminated. Your rights under this Agreement terminate automatically if You fail to comply with any term. Upon termination, You must cease all use of the Software and destroy all copies in Your possession.
|
|
33
|
+
|
|
34
|
+
7. Warranty Disclaimer
|
|
35
|
+
THE SOFTWARE IS PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND. TO THE MAXIMUM EXTENT PERMITTED BY LAW, COMPANY DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
|
36
|
+
|
|
37
|
+
8. Limitation of Liability
|
|
38
|
+
IN NO EVENT WILL COMPANY BE LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES ARISING FROM OR RELATED TO THE SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. COMPANY’S AGGREGATE LIABILITY UNDER THIS AGREEMENT WILL NOT EXCEED THE LICENSE FEES PAID BY YOU.
|
|
39
|
+
|
|
40
|
+
9. Governing Law and Dispute Resolution
|
|
41
|
+
This Agreement will be governed by the laws of the State of Delaware without regard to conflict of law principles. Any dispute will be resolved in the state or federal courts in the State of Delaware.
|
|
42
|
+
|
|
43
|
+
10. Export Compliance
|
|
44
|
+
You agree to comply with all export laws and regulations of the United States and any other applicable jurisdiction.
|
|
45
|
+
|
|
46
|
+
11. Entire Agreement
|
|
47
|
+
This Agreement constitutes the entire agreement between You and Company regarding the Software and supersedes all prior understandings.
|
|
48
|
+
|
|
49
|
+
SPDX-License-Identifier: LicenseRef-Webstudio,Inc-Proprietary
|
package/README.md
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
//! SPDX-License-Identifier: LicenseRef-Webstudio,Inc-Proprietary
|
|
2
|
+
"use strict";import{jsx as c}from"react/jsx-runtime";import{forwardRef as m}from"react";import{animationCanPlayOnCanvasProperty as o}from"@webstudio-is/sdk/runtime";const e=m(({debug:a=!1,action:t,...i},r)=>c("div",{ref:r,style:{display:"contents"},...i})),n="AnimateChildren";e.displayName=n;const s="@webstudio-is/sdk-components-animation",p={onNavigatorUnselect:(a,t)=>{t.instancePath.length>0&&t.instancePath[0].component===`${s}:${n}`&&a.setMemoryProp(t.instancePath[0],o,void 0)},onNavigatorSelect:(a,t)=>{t.instancePath.length>0&&t.instancePath[0].component===`${s}:${n}`&&a.setMemoryProp(t.instancePath[0],o,!0)}};export{e as A,p as h};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
//! SPDX-License-Identifier: LicenseRef-Webstudio,Inc-Proprietary
|
|
2
|
+
"use strict";import{A as l}from"./animate-children-4Ikuk4xp.js";import{jsx as e}from"react/jsx-runtime";import{forwardRef as o}from"react";const t=o(({slidingWindow:i=5,easing:a="linear",splitBy:s="char",...n},d)=>e("div",{ref:d,...n})),g="AnimateText";t.displayName=g;const r=o(({slidingWindow:i=1,easing:a="linear",...s},n)=>e("div",{ref:n,...s})),p="StaggerAnimation";r.displayName=p;const f=()=>o((i,a)=>e("div",{ref:a,...i})),m=f(),A="VideoAnimation";m.displayName=A;export{l as AnimateChildren,t as AnimateText,r as StaggerAnimation,m as VideoAnimation};
|
package/lib/hooks.js
ADDED
package/lib/metas.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
//! SPDX-License-Identifier: LicenseRef-Webstudio,Inc-Proprietary
|
|
2
|
+
"use strict";import{AnimationGroupIcon as o,TextAnimationIcon as a,StaggerAnimationIcon as s,PlayIcon as r}from"@webstudio-is/icons/svg";import{div as e}from"@webstudio-is/sdk/normalize.css";const l=n=>new Proxy({},{get(w,t){return`${n}${t}`}}),i=l("@webstudio-is/sdk-components-animation:"),c={category:"animations",description:"Animation Group component is designed to animate its children.",icon:o,order:0,label:"Animation Group",contentModel:{category:"instance",children:["instance",i.AnimateText,i.StaggerAnimation,i.VideoAnimation]},initialProps:["action"],props:{action:{required:!1,control:"animationAction",type:"animationAction",description:"Animation Action"}}},d={className:{required:!1,control:"text",type:"string",description:"Classes to which the element belongs"},easing:{description:"Easing function applied within the sliding window.",required:!1,control:"select",type:"string",defaultValue:"linear",options:["linear","easeIn","easeInCubic","easeInQuart","easeOut","easeOutCubic","easeOutQuart","ease","easeInOutCubic","easeInOutQuart"]},slidingWindow:{description:`Size of the sliding window for the animation:
|
|
3
|
+
- 0: Typewriter effect (no animation).
|
|
4
|
+
- (0..1]: Animates one part of the text at a time.
|
|
5
|
+
- (1..n]: Animates multiple parts of the text within the sliding window.`,required:!1,control:"number",type:"number",defaultValue:5},splitBy:{description:"Defines how the text is split for animation (e.g., by character, space, or symbol).",required:!1,control:"select",type:"string",defaultValue:"char",options:["char","space",'symbol "#"','symbol "~"']}},p={category:"animations",description:"Text animation allows you to split text by char or by word to animate it.",icon:a,order:1,label:"Text Animation",contentModel:{category:"none",children:["instance"]},presetStyle:{div:e},initialProps:["slidingWindow","easing","splitBy"],props:d},m={className:{required:!1,control:"text",type:"string",description:"Classes to which the element belongs"},easing:{description:"Easing function applied within the sliding window.",required:!1,control:"select",type:"string",defaultValue:"linear",options:["linear","easeIn","easeInCubic","easeInQuart","easeOut","easeOutCubic","easeOutQuart","ease","easeInOutCubic","easeInOutQuart"]},slidingWindow:{description:`Size of the sliding window for the animation:
|
|
6
|
+
- 0: Typewriter effect (no animation).
|
|
7
|
+
- (0..1]: Animates one child at a time.
|
|
8
|
+
- (1..n]: Animates multiple children within the sliding window.`,required:!1,control:"number",type:"number",defaultValue:1}},u={category:"animations",description:"Stagger animation allows you to animate children elements with a sliding window.",icon:s,order:4,label:"Stagger Animation",contentModel:{category:"none",children:["instance"]},presetStyle:{div:e},initialProps:["slidingWindow","easing"],props:m},g={timeline:{required:!1,control:"boolean",type:"boolean"}},h={icon:r,label:"Video Animation",contentModel:{category:"none",children:["instance"]},presetStyle:{div:e},props:g,initialProps:["timeline"]};export{c as AnimateChildren,p as AnimateText,u as StaggerAnimation,h as VideoAnimation};
|
package/lib/templates.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
//! SPDX-License-Identifier: LicenseRef-Webstudio,Inc-Proprietary
|
|
2
|
+
"use strict";import{jsx as o}from"react/jsx-runtime";import{createProxy as i,$ as n}from"@webstudio-is/template";const a=i("@webstudio-is/sdk-components-animation:"),t={category:"animations",description:"Video Animation",order:2,template:o(a.VideoAnimation,{children:o(n.Video,{preload:"auto",autoPlay:!0,muted:!0,playsInline:!0,crossOrigin:"anonymous"})})};export{t as VideoAnimation};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Hook } from "@webstudio-is/react-sdk";
|
|
2
|
+
import type { AnimationAction } from "@webstudio-is/sdk";
|
|
3
|
+
type ScrollProps = {
|
|
4
|
+
debug?: boolean;
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
action: AnimationAction;
|
|
7
|
+
};
|
|
8
|
+
export declare const AnimateChildren: import("react").ForwardRefExoticComponent<ScrollProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
9
|
+
export declare const hooksAnimateChildren: Hook;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
declare const easings: {
|
|
2
|
+
linear: boolean;
|
|
3
|
+
easeIn: boolean;
|
|
4
|
+
easeInCubic: boolean;
|
|
5
|
+
easeInQuart: boolean;
|
|
6
|
+
easeOut: boolean;
|
|
7
|
+
easeOutCubic: boolean;
|
|
8
|
+
easeOutQuart: boolean;
|
|
9
|
+
ease: boolean;
|
|
10
|
+
easeInOutCubic: boolean;
|
|
11
|
+
easeInOutQuart: boolean;
|
|
12
|
+
};
|
|
13
|
+
declare const split: {
|
|
14
|
+
char: boolean;
|
|
15
|
+
space: boolean;
|
|
16
|
+
'symbol "#"': boolean;
|
|
17
|
+
'symbol "~"': boolean;
|
|
18
|
+
};
|
|
19
|
+
export declare const AnimateText: import("react").ForwardRefExoticComponent<{
|
|
20
|
+
/**
|
|
21
|
+
* Size of the sliding window for the animation:
|
|
22
|
+
* - 0: Typewriter effect (no animation).
|
|
23
|
+
* - (0..1]: Animates one part of the text at a time.
|
|
24
|
+
* - (1..n]: Animates multiple parts of the text within the sliding window.
|
|
25
|
+
*/
|
|
26
|
+
slidingWindow?: number;
|
|
27
|
+
/**
|
|
28
|
+
* Easing function applied within the sliding window.
|
|
29
|
+
*/
|
|
30
|
+
easing?: keyof typeof easings;
|
|
31
|
+
/**
|
|
32
|
+
* Text content to animate.
|
|
33
|
+
*/
|
|
34
|
+
children: React.ReactNode;
|
|
35
|
+
/**
|
|
36
|
+
* Defines how the text is split for animation (e.g., by character, space, or symbol).
|
|
37
|
+
*/
|
|
38
|
+
splitBy?: keyof typeof split;
|
|
39
|
+
} & {
|
|
40
|
+
className?: string;
|
|
41
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
42
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
type ProgressAnimationProps<T extends Record<string, unknown> = {}> = {
|
|
2
|
+
children: React.ReactNode;
|
|
3
|
+
} & T;
|
|
4
|
+
export declare const createProgressAnimation: <T extends Record<string, unknown>>() => import("react").ForwardRefExoticComponent<import("react").PropsWithoutRef<ProgressAnimationProps<T>> & import("react").RefAttributes<HTMLDivElement>>;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const animation: Record<string, string>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const animation: Record<string, {
|
|
2
|
+
displayName: string;
|
|
3
|
+
} & ((props: Record<string, unknown> & Record<`${string}:expression`, string> & {
|
|
4
|
+
"ws:id"?: string;
|
|
5
|
+
"ws:label"?: string;
|
|
6
|
+
"ws:tag"?: string;
|
|
7
|
+
"ws:style"?: import("@webstudio-is/template").TemplateStyleDecl[];
|
|
8
|
+
"ws:show"?: boolean | {
|
|
9
|
+
chunks: string[];
|
|
10
|
+
variables: Array<import("@webstudio-is/template").Variable | import("@webstudio-is/template").Parameter | import("@webstudio-is/template").ResourceValue>;
|
|
11
|
+
};
|
|
12
|
+
children?: import("react").ReactNode | {
|
|
13
|
+
chunks: string[];
|
|
14
|
+
variables: Array<import("@webstudio-is/template").Variable | import("@webstudio-is/template").Parameter | import("@webstudio-is/template").ResourceValue>;
|
|
15
|
+
} | import("@webstudio-is/template").PlaceholderValue;
|
|
16
|
+
}) => import("react").ReactNode)>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
declare const easings: {
|
|
2
|
+
linear: boolean;
|
|
3
|
+
easeIn: boolean;
|
|
4
|
+
easeInCubic: boolean;
|
|
5
|
+
easeInQuart: boolean;
|
|
6
|
+
easeOut: boolean;
|
|
7
|
+
easeOutCubic: boolean;
|
|
8
|
+
easeOutQuart: boolean;
|
|
9
|
+
ease: boolean;
|
|
10
|
+
easeInOutCubic: boolean;
|
|
11
|
+
easeInOutQuart: boolean;
|
|
12
|
+
};
|
|
13
|
+
export declare const StaggerAnimation: import("react").ForwardRefExoticComponent<{
|
|
14
|
+
/**
|
|
15
|
+
* Size of the sliding window for the animation:
|
|
16
|
+
* - 0: Typewriter effect (no animation).
|
|
17
|
+
* - (0..1]: Animates one child at a time.
|
|
18
|
+
* - (1..n]: Animates multiple children within the sliding window.
|
|
19
|
+
*/
|
|
20
|
+
slidingWindow?: number;
|
|
21
|
+
/**
|
|
22
|
+
* Easing function applied within the sliding window.
|
|
23
|
+
*/
|
|
24
|
+
easing?: keyof typeof easings;
|
|
25
|
+
/**
|
|
26
|
+
* Text content to animate.
|
|
27
|
+
*/
|
|
28
|
+
children: React.ReactNode;
|
|
29
|
+
} & {
|
|
30
|
+
className?: string;
|
|
31
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { meta as VideoAnimation } from "./video-animation.template";
|
package/package.json
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@webstudio-is/sdk-components-animation",
|
|
3
|
+
"version": "0.0.0-017f1bd",
|
|
4
|
+
"description": "Webstudio components for animation",
|
|
5
|
+
"author": "Webstudio <github@webstudio.is>",
|
|
6
|
+
"homepage": "https://webstudio.is",
|
|
7
|
+
"license": "AGPL-3.0-or-later",
|
|
8
|
+
"private": false,
|
|
9
|
+
"type": "module",
|
|
10
|
+
"sideEffects": false,
|
|
11
|
+
"files": [
|
|
12
|
+
"lib/*",
|
|
13
|
+
"!*.{test,stories}.*"
|
|
14
|
+
],
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"webstudio-private": "./private-src/components.ts",
|
|
18
|
+
"webstudio": "./src/components.ts",
|
|
19
|
+
"types": "./lib/types/components.d.ts",
|
|
20
|
+
"import": "./lib/components.js"
|
|
21
|
+
},
|
|
22
|
+
"./metas": {
|
|
23
|
+
"webstudio": "./src/metas.ts",
|
|
24
|
+
"types": "./lib/types/metas.d.ts",
|
|
25
|
+
"import": "./lib/metas.js"
|
|
26
|
+
},
|
|
27
|
+
"./hooks": {
|
|
28
|
+
"webstudio": "./src/hooks.ts",
|
|
29
|
+
"types": "./lib/types/hooks.d.ts",
|
|
30
|
+
"import": "./lib/hooks.js"
|
|
31
|
+
},
|
|
32
|
+
"./templates": {
|
|
33
|
+
"webstudio": "./src/templates.ts",
|
|
34
|
+
"types": "./lib/types/templates.d.ts",
|
|
35
|
+
"import": "./lib/templates.js"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"peerDependencies": {
|
|
39
|
+
"react": "18.3.0-canary-14898b6a9-20240318",
|
|
40
|
+
"react-dom": "18.3.0-canary-14898b6a9-20240318"
|
|
41
|
+
},
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"change-case": "^5.4.4",
|
|
44
|
+
"nanostores": "^0.11.3",
|
|
45
|
+
"react-error-boundary": "^5.0.0",
|
|
46
|
+
"shallow-equal": "^3.1.0",
|
|
47
|
+
"@webstudio-is/css-engine": "0.0.0-017f1bd",
|
|
48
|
+
"@webstudio-is/icons": "0.0.0-017f1bd",
|
|
49
|
+
"@webstudio-is/react-sdk": "0.0.0-017f1bd",
|
|
50
|
+
"@webstudio-is/sdk": "0.0.0-017f1bd"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@types/react": "^18.2.70",
|
|
54
|
+
"@types/react-dom": "^18.2.25",
|
|
55
|
+
"@vitest/browser": "^3.0.8",
|
|
56
|
+
"fast-glob": "^3.3.2",
|
|
57
|
+
"playwright": "^1.50.1",
|
|
58
|
+
"react": "18.3.0-canary-14898b6a9-20240318",
|
|
59
|
+
"react-dom": "18.3.0-canary-14898b6a9-20240318",
|
|
60
|
+
"type-fest": "^4.37.0",
|
|
61
|
+
"vitest": "^3.1.2",
|
|
62
|
+
"zod": "^3.24.2",
|
|
63
|
+
"@webstudio-is/design-system": "0.0.0",
|
|
64
|
+
"@webstudio-is/css-data": "0.0.0",
|
|
65
|
+
"@webstudio-is/generate-arg-types": "0.0.0",
|
|
66
|
+
"@webstudio-is/sdk-cli": "^0.94.0",
|
|
67
|
+
"@webstudio-is/template": "0.0.0-017f1bd",
|
|
68
|
+
"@webstudio-is/tsconfig": "1.0.7",
|
|
69
|
+
"@webstudio-is/sdk-components-react": "0.0.0-017f1bd"
|
|
70
|
+
},
|
|
71
|
+
"scripts": {
|
|
72
|
+
"build": "vite build && esbuild './lib/*' --outdir=./lib --minify --allow-overwrite --banner:js='//! SPDX-License-Identifier: LicenseRef-Webstudio,Inc-Proprietary'",
|
|
73
|
+
"build:args": "NODE_OPTIONS=--conditions=webstudio generate-arg-types './src/*.tsx !./src/*.stories.tsx !./src/*.ws.ts !./src/*.template.tsx !./src/*.test.{ts,tsx}' -e asChild -e modal -e defaultOpen -e defaultChecked && prettier --write \"**/*.props.ts\"",
|
|
74
|
+
"build:stories": "webstudio-sdk generate-stories && prettier --write \"src/__generated__/*.stories.tsx\"",
|
|
75
|
+
"dts": "tsc --project tsconfig.dts.json",
|
|
76
|
+
"typecheck": "tsc",
|
|
77
|
+
"test": "vitest run",
|
|
78
|
+
"playwright-init": "playwright install --with-deps"
|
|
79
|
+
}
|
|
80
|
+
}
|