@webstudio-is/sdk-components-animation 0.209.0 → 0.210.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/lib/__generated__/animate-text.props.js +6 -0
- package/lib/__generated__/stagger-animation.props.js +34 -0
- package/lib/animate-children.ws.js +7 -7
- package/lib/animate-text.ws.js +12 -11
- package/lib/components.js +4 -2
- package/lib/metas.js +3 -1
- package/lib/props.js +3 -1
- package/lib/shared/meta.js +13 -0
- package/lib/stagger-animation.js +7 -0
- package/lib/stagger-animation.ws.js +25 -0
- package/lib/types/__generated__/stagger-animation.props.d.ts +2 -0
- package/lib/types/animate-text.d.ts +15 -0
- package/lib/types/components.d.ts +1 -0
- package/lib/types/metas.d.ts +1 -0
- package/lib/types/props.d.ts +1 -0
- package/lib/types/shared/meta.d.ts +1 -0
- package/lib/types/stagger-animation.d.ts +31 -0
- package/lib/types/stagger-animation.ws.d.ts +3 -0
- package/package.json +10 -10
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const e = {
|
|
2
2
|
easing: {
|
|
3
|
+
description: "Easing function applied within the sliding window.",
|
|
3
4
|
required: !1,
|
|
4
5
|
control: "select",
|
|
5
6
|
type: "string",
|
|
@@ -18,12 +19,17 @@ const e = {
|
|
|
18
19
|
]
|
|
19
20
|
},
|
|
20
21
|
slidingWindow: {
|
|
22
|
+
description: `Size of the sliding window for the animation:
|
|
23
|
+
- 0: Typewriter effect (no animation).
|
|
24
|
+
- (0..1]: Animates one part of the text at a time.
|
|
25
|
+
- (1..n]: Animates multiple parts of the text within the sliding window.`,
|
|
21
26
|
required: !1,
|
|
22
27
|
control: "number",
|
|
23
28
|
type: "number",
|
|
24
29
|
defaultValue: 5
|
|
25
30
|
},
|
|
26
31
|
splitBy: {
|
|
32
|
+
description: "Defines how the text is split for animation (e.g., by character, space, or symbol).",
|
|
27
33
|
required: !1,
|
|
28
34
|
control: "select",
|
|
29
35
|
type: "string",
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
const e = {
|
|
2
|
+
easing: {
|
|
3
|
+
description: "Easing function applied within the sliding window.",
|
|
4
|
+
required: !1,
|
|
5
|
+
control: "select",
|
|
6
|
+
type: "string",
|
|
7
|
+
defaultValue: "linear",
|
|
8
|
+
options: [
|
|
9
|
+
"linear",
|
|
10
|
+
"easeIn",
|
|
11
|
+
"easeInCubic",
|
|
12
|
+
"easeInQuart",
|
|
13
|
+
"easeOut",
|
|
14
|
+
"easeOutCubic",
|
|
15
|
+
"easeOutQuart",
|
|
16
|
+
"ease",
|
|
17
|
+
"easeInOutCubic",
|
|
18
|
+
"easeInOutQuart"
|
|
19
|
+
]
|
|
20
|
+
},
|
|
21
|
+
slidingWindow: {
|
|
22
|
+
description: `Size of the sliding window for the animation:
|
|
23
|
+
- 0: Typewriter effect (no animation).
|
|
24
|
+
- (0..1]: Animates one child at a time.
|
|
25
|
+
- (1..n]: Animates multiple children within the sliding window.`,
|
|
26
|
+
required: !1,
|
|
27
|
+
control: "number",
|
|
28
|
+
type: "number",
|
|
29
|
+
defaultValue: 1
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
export {
|
|
33
|
+
e as props
|
|
34
|
+
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AnimationGroupIcon as i } from "@webstudio-is/icons/svg";
|
|
2
2
|
const o = {
|
|
3
|
-
category: "
|
|
3
|
+
category: "animations",
|
|
4
4
|
type: "container",
|
|
5
|
-
description: "
|
|
6
|
-
icon:
|
|
5
|
+
description: "Animation Group component is designed to animate its children.",
|
|
6
|
+
icon: i,
|
|
7
7
|
order: 5,
|
|
8
|
-
label: "
|
|
8
|
+
label: "Animation Group",
|
|
9
9
|
constraints: {
|
|
10
10
|
relation: "child",
|
|
11
11
|
text: !1
|
|
12
12
|
}
|
|
13
|
-
},
|
|
13
|
+
}, t = {
|
|
14
14
|
props: {
|
|
15
15
|
action: {
|
|
16
16
|
required: !1,
|
|
@@ -23,5 +23,5 @@ const o = {
|
|
|
23
23
|
};
|
|
24
24
|
export {
|
|
25
25
|
o as meta,
|
|
26
|
-
|
|
26
|
+
t as propsMeta
|
|
27
27
|
};
|
package/lib/animate-text.ws.js
CHANGED
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { TextAnimationIcon as t } from "@webstudio-is/icons/svg";
|
|
2
|
+
import { animation as o } from "./shared/meta.js";
|
|
3
|
+
import { props as i } from "./__generated__/animate-text.props.js";
|
|
4
|
+
const r = {
|
|
5
|
+
category: "animations",
|
|
5
6
|
type: "container",
|
|
6
|
-
description: "
|
|
7
|
+
description: "Text animation allows you to split text by char or by word to animate it.",
|
|
7
8
|
icon: t,
|
|
8
9
|
order: 6,
|
|
9
|
-
label: "
|
|
10
|
+
label: "Text Animation",
|
|
10
11
|
constraints: [
|
|
11
|
-
{ relation: "parent", component: { $eq:
|
|
12
|
+
{ relation: "parent", component: { $eq: o.AnimateChildren } },
|
|
12
13
|
{
|
|
13
14
|
relation: "child",
|
|
14
15
|
text: !1
|
|
15
16
|
}
|
|
16
17
|
]
|
|
17
|
-
},
|
|
18
|
-
props:
|
|
18
|
+
}, m = {
|
|
19
|
+
props: i,
|
|
19
20
|
initialProps: ["slidingWindow", "easing", "splitBy"]
|
|
20
21
|
};
|
|
21
22
|
export {
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
r as meta,
|
|
24
|
+
m as propsMeta
|
|
24
25
|
};
|
package/lib/components.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { AnimateChildren as t } from "./animate-children.js";
|
|
2
|
-
import { AnimateText as
|
|
2
|
+
import { AnimateText as m } from "./animate-text.js";
|
|
3
|
+
import { StaggerAnimation as n } from "./stagger-animation.js";
|
|
3
4
|
export {
|
|
4
5
|
t as AnimateChildren,
|
|
5
|
-
|
|
6
|
+
m as AnimateText,
|
|
7
|
+
n as StaggerAnimation
|
|
6
8
|
};
|
package/lib/metas.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { meta as a } from "./animate-children.ws.js";
|
|
2
2
|
import { meta as r } from "./animate-text.ws.js";
|
|
3
|
+
import { meta as i } from "./stagger-animation.ws.js";
|
|
3
4
|
export {
|
|
4
5
|
a as AnimateChildren,
|
|
5
|
-
r as AnimateText
|
|
6
|
+
r as AnimateText,
|
|
7
|
+
i as StaggerAnimation
|
|
6
8
|
};
|
package/lib/props.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { propsMeta as t } from "./animate-children.ws.js";
|
|
2
2
|
import { propsMeta as o } from "./animate-text.ws.js";
|
|
3
|
+
import { propsMeta as m } from "./stagger-animation.ws.js";
|
|
3
4
|
export {
|
|
4
5
|
t as AnimateChildren,
|
|
5
|
-
o as AnimateText
|
|
6
|
+
o as AnimateText,
|
|
7
|
+
m as StaggerAnimation
|
|
6
8
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as n } from "react";
|
|
3
|
+
const o = n(({ slidingWindow: e = 1, easing: m = "linear", ...i }, r) => /* @__PURE__ */ a("div", { ref: r, ...i })), t = "StaggerAnimation";
|
|
4
|
+
o.displayName = t;
|
|
5
|
+
export {
|
|
6
|
+
o as StaggerAnimation
|
|
7
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { StaggerAnimationIcon as i } from "@webstudio-is/icons/svg";
|
|
2
|
+
import { animation as n } from "./shared/meta.js";
|
|
3
|
+
import { props as t } from "./__generated__/stagger-animation.props.js";
|
|
4
|
+
const r = {
|
|
5
|
+
category: "animations",
|
|
6
|
+
type: "container",
|
|
7
|
+
description: "Stagger animation allows you to animate children elements with a sliding window.",
|
|
8
|
+
icon: i,
|
|
9
|
+
order: 6,
|
|
10
|
+
label: "Stagger Animation",
|
|
11
|
+
constraints: [
|
|
12
|
+
{ relation: "parent", component: { $eq: n.AnimateChildren } },
|
|
13
|
+
{
|
|
14
|
+
relation: "child",
|
|
15
|
+
text: !1
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}, m = {
|
|
19
|
+
props: t,
|
|
20
|
+
initialProps: ["slidingWindow", "easing"]
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
r as meta,
|
|
24
|
+
m as propsMeta
|
|
25
|
+
};
|
|
@@ -17,9 +17,24 @@ declare const split: {
|
|
|
17
17
|
'symbol "~"': boolean;
|
|
18
18
|
};
|
|
19
19
|
type AnimateChildrenProps = {
|
|
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
|
+
*/
|
|
20
26
|
slidingWindow?: number;
|
|
27
|
+
/**
|
|
28
|
+
* Easing function applied within the sliding window.
|
|
29
|
+
*/
|
|
21
30
|
easing?: keyof typeof easings;
|
|
31
|
+
/**
|
|
32
|
+
* Text content to animate.
|
|
33
|
+
*/
|
|
22
34
|
children: React.ReactNode;
|
|
35
|
+
/**
|
|
36
|
+
* Defines how the text is split for animation (e.g., by character, space, or symbol).
|
|
37
|
+
*/
|
|
23
38
|
splitBy?: keyof typeof split;
|
|
24
39
|
};
|
|
25
40
|
export declare const AnimateText: import("react").ForwardRefExoticComponent<AnimateChildrenProps & import("react").RefAttributes<HTMLDivElement>>;
|
package/lib/types/metas.d.ts
CHANGED
package/lib/types/props.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const animation: Record<string, string>;
|
|
@@ -0,0 +1,31 @@
|
|
|
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
|
+
type StaggerAnimationProps = {
|
|
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
|
+
export declare const StaggerAnimation: import("react").ForwardRefExoticComponent<StaggerAnimationProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
31
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webstudio-is/sdk-components-animation",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.210.0",
|
|
4
4
|
"description": "Webstudio components for animation",
|
|
5
5
|
"author": "Webstudio <github@webstudio.is>",
|
|
6
6
|
"homepage": "https://webstudio.is",
|
|
@@ -49,10 +49,10 @@
|
|
|
49
49
|
"nanostores": "^0.11.3",
|
|
50
50
|
"react-error-boundary": "^5.0.0",
|
|
51
51
|
"shallow-equal": "^3.1.0",
|
|
52
|
-
"@webstudio-is/css-engine": "0.
|
|
53
|
-
"@webstudio-is/icons": "0.
|
|
54
|
-
"@webstudio-is/react-sdk": "0.
|
|
55
|
-
"@webstudio-is/sdk": "0.
|
|
52
|
+
"@webstudio-is/css-engine": "0.210.0",
|
|
53
|
+
"@webstudio-is/icons": "0.210.0",
|
|
54
|
+
"@webstudio-is/react-sdk": "0.210.0",
|
|
55
|
+
"@webstudio-is/sdk": "0.210.0"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@types/react": "^18.2.70",
|
|
@@ -65,13 +65,13 @@
|
|
|
65
65
|
"type-fest": "^4.37.0",
|
|
66
66
|
"vitest": "^3.0.8",
|
|
67
67
|
"zod": "^3.24.2",
|
|
68
|
+
"@webstudio-is/css-data": "0.0.0",
|
|
68
69
|
"@webstudio-is/design-system": "0.0.0",
|
|
69
70
|
"@webstudio-is/sdk-cli": "^0.94.0",
|
|
70
|
-
"@webstudio-is/
|
|
71
|
-
"@webstudio-is/
|
|
72
|
-
"@webstudio-is/
|
|
73
|
-
"@webstudio-is/tsconfig": "1.0.7"
|
|
74
|
-
"@webstudio-is/generate-arg-types": "0.0.0"
|
|
71
|
+
"@webstudio-is/generate-arg-types": "0.0.0",
|
|
72
|
+
"@webstudio-is/sdk-components-react": "0.210.0",
|
|
73
|
+
"@webstudio-is/template": "0.210.0",
|
|
74
|
+
"@webstudio-is/tsconfig": "1.0.7"
|
|
75
75
|
},
|
|
76
76
|
"scripts": {
|
|
77
77
|
"build": "vite build --config ../../vite.sdk-components.config.ts",
|