@webstudio-is/sdk-components-animation 0.209.0 → 0.212.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.
@@ -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
+ };
@@ -0,0 +1,6 @@
1
+ const e = {
2
+ timeline: { required: !1, control: "boolean", type: "boolean" }
3
+ };
4
+ export {
5
+ e as props
6
+ };
@@ -1,16 +1,16 @@
1
- import { SlotComponentIcon as n } from "@webstudio-is/icons/svg";
1
+ import { AnimationGroupIcon as i } from "@webstudio-is/icons/svg";
2
2
  const o = {
3
- category: "general",
3
+ category: "animations",
4
4
  type: "container",
5
- description: "Animate Children",
6
- icon: n,
5
+ description: "Animation Group component is designed to animate its children.",
6
+ icon: i,
7
7
  order: 5,
8
- label: "Animate Children",
8
+ label: "Animation Group",
9
9
  constraints: {
10
10
  relation: "child",
11
11
  text: !1
12
12
  }
13
- }, i = {
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
- i as propsMeta
26
+ t as propsMeta
27
27
  };
@@ -1,24 +1,25 @@
1
- import { TextIcon as t } from "@webstudio-is/icons/svg";
2
- import { props as e } from "./__generated__/animate-text.props.js";
3
- const o = {
4
- category: "general",
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: "Animate Text",
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: "Animate Text",
10
+ label: "Text Animation",
10
11
  constraints: [
11
- { relation: "parent", component: { $eq: "AnimateChildren" } },
12
+ { relation: "parent", component: { $eq: o.AnimateChildren } },
12
13
  {
13
14
  relation: "child",
14
15
  text: !1
15
16
  }
16
17
  ]
17
- }, r = {
18
- props: e,
18
+ }, m = {
19
+ props: i,
19
20
  initialProps: ["slidingWindow", "easing", "splitBy"]
20
21
  };
21
22
  export {
22
- o as meta,
23
- r as propsMeta
23
+ r as meta,
24
+ m as propsMeta
24
25
  };
package/lib/components.js CHANGED
@@ -1,6 +1,10 @@
1
- import { AnimateChildren as t } from "./animate-children.js";
2
- import { AnimateText as o } from "./animate-text.js";
1
+ import { AnimateChildren as r } from "./animate-children.js";
2
+ import { AnimateText as i } from "./animate-text.js";
3
+ import { StaggerAnimation as n } from "./stagger-animation.js";
4
+ import { VideoAnimation as x } from "./video-animation.js";
3
5
  export {
4
- t as AnimateChildren,
5
- o as AnimateText
6
+ r as AnimateChildren,
7
+ i as AnimateText,
8
+ n as StaggerAnimation,
9
+ x as VideoAnimation
6
10
  };
package/lib/metas.js CHANGED
@@ -1,6 +1,10 @@
1
1
  import { meta as a } from "./animate-children.ws.js";
2
- import { meta as r } from "./animate-text.ws.js";
2
+ import { meta as o } from "./animate-text.ws.js";
3
+ import { meta as i } from "./stagger-animation.ws.js";
4
+ import { meta as x } from "./video-animation.ws.js";
3
5
  export {
4
6
  a as AnimateChildren,
5
- r as AnimateText
7
+ o as AnimateText,
8
+ i as StaggerAnimation,
9
+ x as VideoAnimation
6
10
  };
package/lib/props.js CHANGED
@@ -1,6 +1,10 @@
1
- import { propsMeta as t } from "./animate-children.ws.js";
2
- import { propsMeta as o } from "./animate-text.ws.js";
1
+ import { propsMeta as r } from "./animate-children.ws.js";
2
+ import { propsMeta as a } from "./animate-text.ws.js";
3
+ import { propsMeta as i } from "./stagger-animation.ws.js";
4
+ import { propsMeta as s } from "./video-animation.ws.js";
3
5
  export {
4
- t as AnimateChildren,
5
- o as AnimateText
6
+ r as AnimateChildren,
7
+ a as AnimateText,
8
+ i as StaggerAnimation,
9
+ s as VideoAnimation
6
10
  };
@@ -0,0 +1,6 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { forwardRef as e } from "react";
3
+ const f = () => e((r, o) => /* @__PURE__ */ t("div", { ref: o, ...r }));
4
+ export {
5
+ f as createProgressAnimation
6
+ };
@@ -0,0 +1,13 @@
1
+ const n = (t) => new Proxy(
2
+ {},
3
+ {
4
+ get(o, e) {
5
+ return `${t}${e}`;
6
+ }
7
+ }
8
+ ), r = n(
9
+ "@webstudio-is/sdk-components-animation:"
10
+ );
11
+ export {
12
+ r as animation
13
+ };
@@ -0,0 +1,5 @@
1
+ import { createProxy as o } from "@webstudio-is/template";
2
+ const i = o("@webstudio-is/sdk-components-animation:");
3
+ export {
4
+ i as animation
5
+ };
@@ -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
+ };
package/lib/templates.js CHANGED
@@ -1 +1,4 @@
1
-
1
+ import { meta as e } from "./video-animation.template.js";
2
+ export {
3
+ e as VideoAnimation
4
+ };
@@ -0,0 +1,2 @@
1
+ import type { PropMeta } from "@webstudio-is/sdk";
2
+ export declare const props: Record<string, PropMeta>;
@@ -0,0 +1,2 @@
1
+ import type { PropMeta } from "@webstudio-is/sdk";
2
+ export declare const props: Record<string, PropMeta>;
@@ -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>>;
@@ -1,2 +1,4 @@
1
1
  export { AnimateChildren } from "./animate-children";
2
2
  export { AnimateText } from "./animate-text";
3
+ export { StaggerAnimation } from "./stagger-animation";
4
+ export { VideoAnimation } from "./video-animation";
@@ -1,2 +1,4 @@
1
1
  export { meta as AnimateChildren } from "./animate-children.ws";
2
2
  export { meta as AnimateText } from "./animate-text.ws";
3
+ export { meta as StaggerAnimation } from "./stagger-animation.ws";
4
+ export { meta as VideoAnimation } from "./video-animation.ws";
@@ -1,2 +1,4 @@
1
1
  export { propsMeta as AnimateChildren } from "./animate-children.ws";
2
2
  export { propsMeta as AnimateText } from "./animate-text.ws";
3
+ export { propsMeta as StaggerAnimation } from "./stagger-animation.ws";
4
+ export { propsMeta as VideoAnimation } from "./video-animation.ws";
@@ -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,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 {};
@@ -0,0 +1,3 @@
1
+ import type { WsComponentMeta, WsComponentPropsMeta } from "@webstudio-is/sdk";
2
+ export declare const meta: WsComponentMeta;
3
+ export declare const propsMeta: WsComponentPropsMeta;
@@ -1 +1 @@
1
- export {};
1
+ export { meta as VideoAnimation } from "./video-animation.template";
@@ -0,0 +1,5 @@
1
+ export declare const VideoAnimation: import("react").ForwardRefExoticComponent<{
2
+ children: React.ReactNode;
3
+ } & {
4
+ timeline?: boolean;
5
+ } & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,2 @@
1
+ import { type TemplateMeta } from "@webstudio-is/template";
2
+ export declare const meta: TemplateMeta;
@@ -0,0 +1,3 @@
1
+ import type { WsComponentMeta, WsComponentPropsMeta } from "@webstudio-is/sdk";
2
+ export declare const meta: WsComponentMeta;
3
+ export declare const propsMeta: WsComponentPropsMeta;
@@ -0,0 +1,6 @@
1
+ import { createProgressAnimation as i } from "./shared/create-progress-animation.js";
2
+ const o = i(), a = "VideoAnimation";
3
+ o.displayName = a;
4
+ export {
5
+ o as VideoAnimation
6
+ };
@@ -0,0 +1,23 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { $ as i } from "@webstudio-is/template";
3
+ import { YoutubeIcon as t } from "@webstudio-is/icons/svg";
4
+ import { animation as r } from "./shared/proxy.js";
5
+ const p = {
6
+ category: "animations",
7
+ description: "Video Animation",
8
+ order: 2,
9
+ icon: t,
10
+ template: /* @__PURE__ */ o(r.VideoAnimation, { children: /* @__PURE__ */ o(
11
+ i.Video,
12
+ {
13
+ preload: "auto",
14
+ autoPlay: !0,
15
+ muted: !0,
16
+ playsInline: !0,
17
+ crossOrigin: "anonymous"
18
+ }
19
+ ) })
20
+ };
21
+ export {
22
+ p as meta
23
+ };
@@ -0,0 +1,22 @@
1
+ import { Youtube1cIcon as o } from "@webstudio-is/icons/svg";
2
+ import { animation as t } from "./shared/meta.js";
3
+ import { props as i } from "./__generated__/video-animation.props.js";
4
+ const a = {
5
+ type: "container",
6
+ icon: o,
7
+ label: "Video Animation",
8
+ constraints: [
9
+ { relation: "parent", component: { $eq: t.AnimateChildren } },
10
+ {
11
+ relation: "child",
12
+ text: !1
13
+ }
14
+ ]
15
+ }, m = {
16
+ props: i,
17
+ initialProps: ["timeline"]
18
+ };
19
+ export {
20
+ a as meta,
21
+ m as propsMeta
22
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webstudio-is/sdk-components-animation",
3
- "version": "0.209.0",
3
+ "version": "0.212.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.209.0",
53
- "@webstudio-is/icons": "0.209.0",
54
- "@webstudio-is/react-sdk": "0.209.0",
55
- "@webstudio-is/sdk": "0.209.0"
52
+ "@webstudio-is/css-engine": "0.212.0",
53
+ "@webstudio-is/icons": "0.212.0",
54
+ "@webstudio-is/react-sdk": "0.212.0",
55
+ "@webstudio-is/sdk": "0.212.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",
70
+ "@webstudio-is/sdk-components-react": "0.212.0",
69
71
  "@webstudio-is/sdk-cli": "^0.94.0",
70
- "@webstudio-is/template": "0.209.0",
71
- "@webstudio-is/css-data": "0.0.0",
72
- "@webstudio-is/sdk-components-react": "0.209.0",
73
- "@webstudio-is/tsconfig": "1.0.7",
74
- "@webstudio-is/generate-arg-types": "0.0.0"
72
+ "@webstudio-is/generate-arg-types": "0.0.0",
73
+ "@webstudio-is/template": "0.212.0",
74
+ "@webstudio-is/tsconfig": "1.0.7"
75
75
  },
76
76
  "scripts": {
77
77
  "build": "vite build --config ../../vite.sdk-components.config.ts",