Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.
TypeScript accessibilityalternativecloudflarecloudflare-workersdesignfreefrontendopen-sourceradix-uireactremixweb-developmentwebflowwebsite-builderwebsite-developmentwebsiteswebstudio
experimental: Animate Text Split (#5048)
Ivan Starkov19fd9871dcca
diff --git a/fixtures/webstudio-features/.webstudio/data.json b/fixtures/webstudio-features/.webstudio/data.jsonindex 2181ebd131..d395e1c32a 100644--- a/fixtures/webstudio-features/.webstudio/data.json+++ b/fixtures/webstudio-features/.webstudio/data.json@@ -1,10 +1,10 @@{"build": {- "id": "342a7c73-ed72-441d-8a69-8b2659639e93",+ "id": "3a8c8a9c-cfd9-46b8-a8bf-30d48250bc1b","projectId": "cddc1d44-af37-4cb6-a430-d300cf6f932d",- "version": 543,- "createdAt": "2025-03-10T13:33:47.683+00:00",- "updatedAt": "2025-03-10T13:33:47.683+00:00",+ "version": 554,+ "createdAt": "2025-03-26T12:23:17.308+00:00",+ "updatedAt": "2025-03-26T12:23:17.308+00:00","pages": {"meta": {"siteName": "KittyGuardedZone",@@ -3805,11 +3805,11 @@}],[- "WXm4SG4hn0GOxQzlx1onL",+ "PkOUxrUpSNIkRV8MuLSQh",{- "id": "WXm4SG4hn0GOxQzlx1onL",+ "id": "PkOUxrUpSNIkRV8MuLSQh","instanceId": "GRj9UMUzk-HAWRctEcfFH",- "name": "charWindow",+ "name": "slidingWindow","type": "number","value": 20}diff --git a/fixtures/webstudio-features/app/__generated__/$resources.sitemap.xml.ts b/fixtures/webstudio-features/app/__generated__/$resources.sitemap.xml.tsindex b62896dc5e..9264d48014 100644--- a/fixtures/webstudio-features/app/__generated__/$resources.sitemap.xml.ts+++ b/fixtures/webstudio-features/app/__generated__/$resources.sitemap.xml.ts@@ -1,26 +1,26 @@export const sitemap = [{path: "/",- lastModified: "2025-03-10",+ lastModified: "2025-03-26",},{path: "/_route_with_symbols_",- lastModified: "2025-03-10",+ lastModified: "2025-03-26",},{path: "/form",- lastModified: "2025-03-10",+ lastModified: "2025-03-26",},{path: "/heading-with-id",- lastModified: "2025-03-10",+ lastModified: "2025-03-26",},{path: "/resources",- lastModified: "2025-03-10",+ lastModified: "2025-03-26",},{path: "/nested/nested-page",- lastModified: "2025-03-10",+ lastModified: "2025-03-26",},];diff --git a/fixtures/webstudio-features/app/__generated__/[animations]._index.tsx b/fixtures/webstudio-features/app/__generated__/[animations]._index.tsxindex 5dd4013bdb..1c6818f9cb 100644--- a/fixtures/webstudio-features/app/__generated__/[animations]._index.tsx+++ b/fixtures/webstudio-features/app/__generated__/[animations]._index.tsx@@ -272,7 +272,7 @@ const Page = (_props: { system: any }) => {isPinned: false,}}>- <AnimateText charWindow={20}>+ <AnimateText slidingWindow={20}><Heading className={`w-heading c1pdroxx`}>{"ANIMATED CHILD 1"}</Heading>diff --git a/fixtures/webstudio-features/package.json b/fixtures/webstudio-features/package.jsonindex 1abc02e894..6826acb5d3 100644--- a/fixtures/webstudio-features/package.json+++ b/fixtures/webstudio-features/package.json@@ -6,7 +6,7 @@"dev": "react-router dev","cli": "NODE_OPTIONS='--conditions=webstudio --import=tsx' webstudio","fixtures:link": "pnpm cli link --link https://p-cddc1d44-af37-4cb6-a430-d300cf6f932d-dot-${BUILDER_HOST:-main.development.webstudio.is}'?authToken=1cdc6026-dd5b-4624-b89b-9bd45e9bcc3d'",- "fixtures:sync": "pnpm cli sync --buildId 342a7c73-ed72-441d-8a69-8b2659639e93 && pnpm prettier --write ./.webstudio/",+ "fixtures:sync": "pnpm cli sync --buildId 3a8c8a9c-cfd9-46b8-a8bf-30d48250bc1b && pnpm prettier --write ./.webstudio/","fixtures:build": "pnpm cli build --template react-router --template ./.template && pnpm prettier --write ./app/ ./package.json ./tsconfig.json"},"private": true,diff --git a/packages/sdk-components-animation/private-src b/packages/sdk-components-animation/private-srcindex 3b5b822672..c699f5968c 160000--- a/packages/sdk-components-animation/private-src+++ b/packages/sdk-components-animation/private-src@@ -1 +1 @@-Subproject commit 3b5b82267249609ee5a0f69522dcef2e301be031+Subproject commit c699f5968c7a36ab2bb2334829537c58ecce664adiff --git a/packages/sdk-components-animation/src/__generated__/animate-text.props.ts b/packages/sdk-components-animation/src/__generated__/animate-text.props.tsindex b6b3b473f7..24c6bebe02 100644--- a/packages/sdk-components-animation/src/__generated__/animate-text.props.ts+++ b/packages/sdk-components-animation/src/__generated__/animate-text.props.ts@@ -1,12 +1,6 @@import type { PropMeta } from "@webstudio-is/sdk";export const props: Record<string, PropMeta> = {- charWindow: {- required: false,- control: "number",- type: "number",- defaultValue: 5,- },easing: {required: false,control: "select",@@ -25,4 +19,17 @@ export const props: Record<string, PropMeta> = {"easeInOutQuart",],},+ slidingWindow: {+ required: false,+ control: "number",+ type: "number",+ defaultValue: 5,+ },+ splitBy: {+ required: false,+ control: "select",+ type: "string",+ defaultValue: "char",+ options: ["char", "space", 'symbol "#"', 'symbol "~"'],+ },};diff --git a/packages/sdk-components-animation/src/animate-text.tsx b/packages/sdk-components-animation/src/animate-text.tsxindex 93f7485e6f..c83c5b2a45 100644--- a/packages/sdk-components-animation/src/animate-text.tsx+++ b/packages/sdk-components-animation/src/animate-text.tsx@@ -13,14 +13,25 @@ const easings = {easeInOutQuart: true,};+const split = {+ char: true,+ space: true,+ 'symbol "#"': true,+ 'symbol "~"': true,+};+type AnimateChildrenProps = {- charWindow?: number;+ slidingWindow?: number;easing?: keyof typeof easings;children: React.ReactNode;+ splitBy?: keyof typeof split;};export const AnimateText = forwardRef<ElementRef<"div">, AnimateChildrenProps>(- ({ charWindow = 5, easing = "linear", ...props }, ref) => {+ (+ { slidingWindow = 5, easing = "linear", splitBy = "char", ...props },+ ref+ ) => {return <div ref={ref} {...props} />;});diff --git a/packages/sdk-components-animation/src/animate-text.ws.ts b/packages/sdk-components-animation/src/animate-text.ws.tsindex b5bd1366ea..6fd02eea52 100644--- a/packages/sdk-components-animation/src/animate-text.ws.ts+++ b/packages/sdk-components-animation/src/animate-text.ws.ts@@ -20,5 +20,5 @@ export const meta: WsComponentMeta = {export const propsMeta: WsComponentPropsMeta = {props,- initialProps: ["charWindow", "easing"],+ initialProps: ["slidingWindow", "easing", "splitBy"],};