Skip to content

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.

experimental: Animation publishing (#4976)

Ivan Starkovca4b0f89bc7c
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 60c345d321..c183b975ca 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -135,7 +135,7 @@ jobs:
const results = [
await assertSize('./fixtures/ssg/dist/client', 352),
await assertSize('./fixtures/react-router-netlify/build/client', 368),
- await assertSize('./fixtures/webstudio-features/build/client', 936),
+ await assertSize('./fixtures/webstudio-features/build/client', 1024),
]
for (const result of results) {
if (result.passed) {
diff --git a/.gitignore b/.gitignore
index 6d0587466c..e3225c11a0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -62,4 +62,5 @@ dist
# should be here otherwise if placed inside prisma-client pnpm deploy doesn't copy it
packages/prisma-client/src/__generated__
-.temp
\ No newline at end of file
+.temp
+*.timestamp-*.mjs
diff --git a/eslint.config.mjs b/eslint.config.mjs
index 58c6dc3b60..4eb637bf8c 100644
--- a/eslint.config.mjs
+++ b/eslint.config.mjs
@@ -15,6 +15,8 @@ export default tseslint.config({
"packages/prisma-client/prisma/migrations/**",
"packages/cli/templates/**",
"fixtures/**",
+ "packages/sdk-components-animation/private-src/polyfill/**",
+ "packages/sdk-components-animation/private-src/perf/**",
],
extends: [
eslint.configs.recommended,
diff --git a/fixtures/webstudio-cloudflare-template/package.json b/fixtures/webstudio-cloudflare-template/package.json
index e54b2c1656..498ffc4a4b 100644
--- a/fixtures/webstudio-cloudflare-template/package.json
+++ b/fixtures/webstudio-cloudflare-template/package.json
@@ -53,6 +53,7 @@
"@types/react-dom": "^18.2.25",
"typescript": "5.7.3",
"vite": "^5.4.11",
- "wrangler": "^3.63.2"
+ "wrangler": "^3.63.2",
+ "fast-glob": "^3.3.2"
}
}
diff --git a/fixtures/webstudio-cloudflare-template/vite.config.ts b/fixtures/webstudio-cloudflare-template/vite.config.ts
index 07c9f99bc8..209b86184a 100644
--- a/fixtures/webstudio-cloudflare-template/vite.config.ts
+++ b/fixtures/webstudio-cloudflare-template/vite.config.ts
@@ -4,7 +4,34 @@ import {
} from "@remix-run/dev";
import { defineConfig } from "vite";
+import { existsSync } from "node:fs";
+// @ts-ignore
+import path from "node:path";
+// @ts-ignore
+import fg from "fast-glob";
+
+const rootDir = ["..", "../..", "../../.."]
+ .map((dir) => path.join(__dirname, dir))
+ .find((dir) => existsSync(path.join(dir, ".git")));
+
+const hasPrivateFolders =
+ fg.sync([path.join(rootDir ?? "", "packages/*/private-src/*")], {
+ ignore: ["**/node_modules/**"],
+ }).length > 0;
+
+const conditions = hasPrivateFolders
+ ? ["webstudio-private", "webstudio"]
+ : ["webstudio"];
+
export default defineConfig(({ mode }) => ({
+ resolve: {
+ conditions,
+ },
+ ssr: {
+ resolve: {
+ conditions,
+ },
+ },
plugins: [
// without this, remixCloudflareDevProxy trying to load workerd even for production (it's not needed for production)
mode === "production" ? undefined : remixCloudflareDevProxy(),
diff --git a/fixtures/webstudio-features/.webstudio/data.json b/fixtures/webstudio-features/.webstudio/data.json
index ad9334d05d..2181ebd131 100644
--- a/fixtures/webstudio-features/.webstudio/data.json
+++ b/fixtures/webstudio-features/.webstudio/data.json
@@ -1,10 +1,10 @@
{
"build": {
- "id": "6f14cdae-073c-4f2c-b535-da3f404f3e36",
+ "id": "342a7c73-ed72-441d-8a69-8b2659639e93",
"projectId": "cddc1d44-af37-4cb6-a430-d300cf6f932d",
- "version": 479,
- "createdAt": "2025-03-04T16:25:33.097+00:00",
- "updatedAt": "2025-03-04T16:25:33.097+00:00",
+ "version": 543,
+ "createdAt": "2025-03-10T13:33:47.683+00:00",
+ "updatedAt": "2025-03-10T13:33:47.683+00:00",
"pages": {
"meta": {
"siteName": "KittyGuardedZone",
@@ -223,6 +223,31 @@
"include": false
},
"path": "/head-tag"
+ },
+ {
+ "id": "oc1Ra5zelesj-wiJwiw-P",
+ "name": "animations",
+ "title": "\"Untitled\"",
+ "rootInstanceId": "Qrpsu4yKLKARA-82TnhLI",
+ "meta": {
+ "description": "\"\"",
+ "excludePageFromSearch": "true",
+ "language": "\"\"",
+ "socialImageUrl": "\"\"",
+ "status": "200",
+ "redirect": "\"\"",
+ "documentType": "html",
+ "custom": [
+ {
+ "property": "",
+ "content": "\"\""
+ }
+ ]
+ },
+ "marketplace": {
+ "include": false
+ },
+ "path": "/animations"
}
],
"folders": [
@@ -242,7 +267,8 @@
"lTS5DKrDEC_mXSAc5ZDDA",
"FsnS9ui6btzM4W3YELE3Q",
"Q1D-6G1cl0SfXyM9Xj4_O",
- "8fF_9MQOwOqsLM9BhULUG"
+ "8fF_9MQOwOqsLM9BhULUG",
+ "oc1Ra5zelesj-wiJwiw-P"
]
},
{
@@ -1762,6 +1788,314 @@
"alpha": 1
}
}
+ ],
+ [
+ "Eboa64A1ivGBt9vVhHdkx:UoTkWyaFuTYJihS3MFYK5:height:",
+ {
+ "breakpointId": "UoTkWyaFuTYJihS3MFYK5",
+ "styleSourceId": "Eboa64A1ivGBt9vVhHdkx",
+ "property": "height",
+ "value": {
+ "type": "unit",
+ "unit": "dvh",
+ "value": 100
+ }
+ }
+ ],
+ [
+ "Eboa64A1ivGBt9vVhHdkx:UoTkWyaFuTYJihS3MFYK5:display:",
+ {
+ "breakpointId": "UoTkWyaFuTYJihS3MFYK5",
+ "styleSourceId": "Eboa64A1ivGBt9vVhHdkx",
+ "property": "display",
+ "value": {
+ "type": "keyword",
+ "value": "flex"
+ }
+ }
+ ],
+ [
+ "Eboa64A1ivGBt9vVhHdkx:UoTkWyaFuTYJihS3MFYK5:alignItems:",
+ {
+ "breakpointId": "UoTkWyaFuTYJihS3MFYK5",
+ "styleSourceId": "Eboa64A1ivGBt9vVhHdkx",
+ "property": "alignItems",
+ "value": {
+ "type": "keyword",
+ "value": "center"
+ }
+ }
+ ],
+ [
+ "Eboa64A1ivGBt9vVhHdkx:UoTkWyaFuTYJihS3MFYK5:justifyContent:",
+ {
+ "breakpointId": "UoTkWyaFuTYJihS3MFYK5",
+ "styleSourceId": "Eboa64A1ivGBt9vVhHdkx",
+ "property": "justifyContent",
+ "value": {
+ "type": "keyword",
+ "value": "center"
+ }
+ }
+ ],
+ [
+ "C-HNDjw4PJgh2x3Xt-zaT:UoTkWyaFuTYJihS3MFYK5:height:",
+ {
+ "styleSourceId": "C-HNDjw4PJgh2x3Xt-zaT",
+ "breakpointId": "UoTkWyaFuTYJihS3MFYK5",
+ "property": "height",
+ "value": {
+ "type": "unit",
+ "unit": "dvh",
+ "value": 100
+ }
+ }
+ ],
+ [
+ "C-HNDjw4PJgh2x3Xt-zaT:UoTkWyaFuTYJihS3MFYK5:display:",
+ {
+ "styleSourceId": "C-HNDjw4PJgh2x3Xt-zaT",
+ "breakpointId": "UoTkWyaFuTYJihS3MFYK5",
+ "property": "display",
+ "value": {
+ "type": "keyword",
+ "value": "flex"
+ }
+ }
+ ],
+ [
+ "C-HNDjw4PJgh2x3Xt-zaT:UoTkWyaFuTYJihS3MFYK5:alignItems:",
+ {
+ "styleSourceId": "C-HNDjw4PJgh2x3Xt-zaT",
+ "breakpointId": "UoTkWyaFuTYJihS3MFYK5",
+ "property": "alignItems",
+ "value": {
+ "type": "keyword",
+ "value": "center"
+ }
+ }
+ ],
+ [
+ "C-HNDjw4PJgh2x3Xt-zaT:UoTkWyaFuTYJihS3MFYK5:justifyContent:",
+ {
+ "styleSourceId": "C-HNDjw4PJgh2x3Xt-zaT",
+ "breakpointId": "UoTkWyaFuTYJihS3MFYK5",
+ "property": "justifyContent",
+ "value": {
+ "type": "keyword",
+ "value": "center"
+ }
+ }
+ ],
+ [
+ "iseTqeMVub0Y6Q_3eOQ0S:Z8WjyXWkCrr35PXgjHdpY:maxWidth:",
+ {
+ "breakpointId": "Z8WjyXWkCrr35PXgjHdpY",
+ "styleSourceId": "iseTqeMVub0Y6Q_3eOQ0S",
+ "property": "maxWidth",
+ "value": {
+ "type": "unit",
+ "unit": "px",
+ "value": 900
+ }
+ }
+ ],
+ [
+ "iseTqeMVub0Y6Q_3eOQ0S:Z8WjyXWkCrr35PXgjHdpY:width:",
+ {
+ "breakpointId": "Z8WjyXWkCrr35PXgjHdpY",
+ "styleSourceId": "iseTqeMVub0Y6Q_3eOQ0S",
+ "property": "width",
+ "value": {
+ "type": "unit",
+ "unit": "%",
+ "value": 100
+ }
+ }
+ ],
+ [
+ "iseTqeMVub0Y6Q_3eOQ0S:Z8WjyXWkCrr35PXgjHdpY:minWidth:",
+ {
+ "breakpointId": "Z8WjyXWkCrr35PXgjHdpY",
+ "styleSourceId": "iseTqeMVub0Y6Q_3eOQ0S",
+ "property": "minWidth",
+ "value": {
+ "type": "unit",
+ "unit": "px",
+ "value": 0
+ }
+ }
+ ],
+ [
+ "iseTqeMVub0Y6Q_3eOQ0S:Z8WjyXWkCrr35PXgjHdpY:justifySelf:",
+ {
+ "breakpointId": "Z8WjyXWkCrr35PXgjHdpY",
+ "styleSourceId": "iseTqeMVub0Y6Q_3eOQ0S",
+ "property": "justifySelf",
+ "value": {
+ "type": "keyword",
+ "value": "center"
+ },
+ "listed": true
+ }
+ ],
+ [
+ "Uhs5fZ65aKJ2wz5eB2fCJ:Z8WjyXWkCrr35PXgjHdpY:display:",
+ {
+ "breakpointId": "Z8WjyXWkCrr35PXgjHdpY",
+ "styleSourceId": "Uhs5fZ65aKJ2wz5eB2fCJ",
+ "property": "display",
+ "value": {
+ "type": "keyword",
+ "value": "grid"
+ },
+ "listed": true
+ }
+ ],
+ [
+ "Uhs5fZ65aKJ2wz5eB2fCJ:Z8WjyXWkCrr35PXgjHdpY:gridAutoFlow:",
+ {
+ "breakpointId": "Z8WjyXWkCrr35PXgjHdpY",
+ "styleSourceId": "Uhs5fZ65aKJ2wz5eB2fCJ",
+ "property": "gridAutoFlow",
+ "value": {
+ "type": "keyword",
+ "value": "column"
+ },
+ "listed": true
+ }
+ ],
+ [
+ "Uhs5fZ65aKJ2wz5eB2fCJ:Z8WjyXWkCrr35PXgjHdpY:gridAutoColumns:",
+ {
+ "breakpointId": "Z8WjyXWkCrr35PXgjHdpY",
+ "styleSourceId": "Uhs5fZ65aKJ2wz5eB2fCJ",
+ "property": "gridAutoColumns",
+ "value": {
+ "type": "unit",
+ "unit": "fr",
+ "value": 1
+ },
+ "listed": true
+ }
+ ],
+ [
+ "9GVBj1HWWhCsENaCEZID-:Z8WjyXWkCrr35PXgjHdpY:display:",
+ {
+ "styleSourceId": "9GVBj1HWWhCsENaCEZID-",
+ "breakpointId": "Z8WjyXWkCrr35PXgjHdpY",
+ "property": "display",
+ "value": {
+ "type": "keyword",
+ "value": "grid"
+ },
+ "listed": true
+ }
+ ],
+ [
+ "9GVBj1HWWhCsENaCEZID-:Z8WjyXWkCrr35PXgjHdpY:gridAutoFlow:",
+ {
+ "styleSourceId": "9GVBj1HWWhCsENaCEZID-",
+ "breakpointId": "Z8WjyXWkCrr35PXgjHdpY",
+ "property": "gridAutoFlow",
+ "value": {
+ "type": "keyword",
+ "value": "column"
+ },
+ "listed": true
+ }
+ ],
+ [
+ "9GVBj1HWWhCsENaCEZID-:Z8WjyXWkCrr35PXgjHdpY:gridAutoColumns:",
+ {
+ "styleSourceId": "9GVBj1HWWhCsENaCEZID-",
+ "breakpointId": "Z8WjyXWkCrr35PXgjHdpY",
+ "property": "gridAutoColumns",
+ "value": {
+ "type": "unit",
+ "unit": "fr",
+ "value": 1
+ },
+ "listed": true
+ }
+ ],
+ [
+ "mcplLi9TYqk__JBKYzuss:Z8WjyXWkCrr35PXgjHdpY:height:",
+ {
+ "breakpointId": "Z8WjyXWkCrr35PXgjHdpY",
+ "styleSourceId": "mcplLi9TYqk__JBKYzuss",
+ "property": "height",
+ "value": {
+ "type": "unit",
+ "unit": "dvh",
+ "value": 40
+ }
+ }
+ ],
+ [
+ "Uhs5fZ65aKJ2wz5eB2fCJ:Z8WjyXWkCrr35PXgjHdpY:alignItems:",
+ {
+ "breakpointId": "Z8WjyXWkCrr35PXgjHdpY",
+ "styleSourceId": "Uhs5fZ65aKJ2wz5eB2fCJ",
+ "property": "alignItems",
+ "value": {
+ "type": "keyword",
+ "value": "start"
+ },
+ "listed": true
+ }
+ ],
+ [
+ "Uhs5fZ65aKJ2wz5eB2fCJ:Z8WjyXWkCrr35PXgjHdpY:alignContent:",
+ {
+ "breakpointId": "Z8WjyXWkCrr35PXgjHdpY",
+ "styleSourceId": "Uhs5fZ65aKJ2wz5eB2fCJ",
+ "property": "alignContent",
+ "value": {
+ "type": "keyword",
+ "value": "start"
+ },
+ "listed": true
+ }
+ ],
+ [
+ "8WyGOidmbyXhMWoXUdEkK:Z8WjyXWkCrr35PXgjHdpY:marginTop:",
+ {
+ "breakpointId": "Z8WjyXWkCrr35PXgjHdpY",
+ "styleSourceId": "8WyGOidmbyXhMWoXUdEkK",
+ "property": "marginTop",
+ "value": {
+ "type": "unit",
+ "unit": "em",
+ "value": 0
+ }
+ }
+ ],
+ [
+ "8WyGOidmbyXhMWoXUdEkK:Z8WjyXWkCrr35PXgjHdpY:marginBottom:",
+ {
+ "breakpointId": "Z8WjyXWkCrr35PXgjHdpY",
+ "styleSourceId": "8WyGOidmbyXhMWoXUdEkK",
+ "property": "marginBottom",
+ "value": {
+ "type": "unit",
+ "unit": "em",
+ "value": 0
+ }
+ }
+ ],
+ [
+ "hSMd0d2O_5ogkTfvV8g8B:Z8WjyXWkCrr35PXgjHdpY:marginTop:",
+ {
+ "breakpointId": "Z8WjyXWkCrr35PXgjHdpY",
+ "styleSourceId": "hSMd0d2O_5ogkTfvV8g8B",
+ "property": "marginTop",
+ "value": {
+ "type": "unit",
+ "unit": "em",
+ "value": 0
+ }
+ }
]
],
"styleSources": [
@@ -2009,6 +2343,62 @@
"type": "local",
"id": "z9mqrlxshNacx8dvtUKFI"
}
+ ],
+ [
+ "Eboa64A1ivGBt9vVhHdkx",
+ {
+ "type": "local",
+ "id": "Eboa64A1ivGBt9vVhHdkx"
+ }
+ ],
+ [
+ "C-HNDjw4PJgh2x3Xt-zaT",
+ {
+ "type": "local",
+ "id": "C-HNDjw4PJgh2x3Xt-zaT"
+ }
+ ],
+ [
+ "iseTqeMVub0Y6Q_3eOQ0S",
+ {
+ "type": "local",
+ "id": "iseTqeMVub0Y6Q_3eOQ0S"
+ }
+ ],
+ [
+ "Uhs5fZ65aKJ2wz5eB2fCJ",
+ {
+ "type": "local",
+ "id": "Uhs5fZ65aKJ2wz5eB2fCJ"
+ }
+ ],
+ [
+ "9GVBj1HWWhCsENaCEZID-",
+ {
+ "type": "local",
+ "id": "9GVBj1HWWhCsENaCEZID-"
+ }
+ ],
+ [
+ "mcplLi9TYqk__JBKYzuss",
+ {
+ "type": "local",
+ "id": "mcplLi9TYqk__JBKYzuss"
+ }
+ ],
+ [
+ "8WyGOidmbyXhMWoXUdEkK",
+ {
+ "type": "local",
+ "id": "8WyGOidmbyXhMWoXUdEkK"
+ }
+ ],
+ [
+ "hSMd0d2O_5ogkTfvV8g8B",
+ {
+ "type": "local",
+ "id": "hSMd0d2O_5ogkTfvV8g8B"
+ }
]
],
"styleSourceSelections": [
@@ -2256,6 +2646,62 @@
"instanceId": "ccyTkEM40ar6Z2UTXhFvY",
"values": ["z9mqrlxshNacx8dvtUKFI"]
}
+ ],
+ [
+ "1e-3lR1XsDg2IsPu4mSNr",
+ {
+ "instanceId": "1e-3lR1XsDg2IsPu4mSNr",
+ "values": ["Eboa64A1ivGBt9vVhHdkx"]
+ }
+ ],
+ [
+ "YrVDoWK0I_9hpQs5yJzLt",
+ {
+ "instanceId": "YrVDoWK0I_9hpQs5yJzLt",
+ "values": ["C-HNDjw4PJgh2x3Xt-zaT"]
+ }
+ ],
+ [
+ "Qrpsu4yKLKARA-82TnhLI",
+ {
+ "instanceId": "Qrpsu4yKLKARA-82TnhLI",
+ "values": ["iseTqeMVub0Y6Q_3eOQ0S"]
+ }
+ ],
+ [
+ "3hPo1LW5P_4VAyXUmVtpY",
+ {
+ "instanceId": "3hPo1LW5P_4VAyXUmVtpY",
+ "values": ["Uhs5fZ65aKJ2wz5eB2fCJ"]
+ }
+ ],
+ [
+ "KCX8plaeWZXn98-4qmHBW",
+ {
+ "instanceId": "KCX8plaeWZXn98-4qmHBW",
+ "values": ["9GVBj1HWWhCsENaCEZID-"]
+ }
+ ],
+ [
+ "81TW-o_0QLHlfmBAKFyCQ",
+ {
+ "instanceId": "81TW-o_0QLHlfmBAKFyCQ",
+ "values": ["mcplLi9TYqk__JBKYzuss"]
+ }
+ ],
+ [
+ "cvCjIfx9TJ3XeeSpCnW1w",
+ {
+ "instanceId": "cvCjIfx9TJ3XeeSpCnW1w",
+ "values": ["8WyGOidmbyXhMWoXUdEkK"]
+ }
+ ],
+ [
+ "hi1l-ro0pCVQpHFIwIhFO",
+ {
+ "instanceId": "hi1l-ro0pCVQpHFIwIhFO",
+ "values": ["hSMd0d2O_5ogkTfvV8g8B"]
+ }
]
],
"props": [
@@ -2991,13 +3437,381 @@
}
],
[
- "_wNeTsN1d6jG8ZM5ud05d",
+ "_wNeTsN1d6jG8ZM5ud05d",
+ {
+ "id": "_wNeTsN1d6jG8ZM5ud05d",
+ "instanceId": "56x98yMSVYpp7eVo8wuzK",
+ "name": "href",
+ "type": "string",
+ "value": "https://overwritten.slot/head-slot-tag"
+ }
+ ],
+ [
+ "gPNdj8LXDT6H6DLLtqzUi",
+ {
+ "id": "gPNdj8LXDT6H6DLLtqzUi",
+ "instanceId": "D6OU4dJ2tzc_Uq5LqMVWo",
+ "name": "action",
+ "type": "animationAction",
+ "value": {
+ "type": "view",
+ "animations": [
+ {
+ "name": "Fade In",
+ "description": "Fade in the element as it scrolls into view.",
+ "keyframes": [
+ {
+ "offset": 0,
+ "styles": {
+ "opacity": {
+ "type": "unit",
+ "unit": "number",
+ "value": 0
+ }
+ }
+ }
+ ],
+ "timing": {
+ "easing": "linear",
+ "fill": "backwards",
+ "rangeStart": [
+ "entry",
+ {
+ "type": "unit",
+ "value": 0,
+ "unit": "%"
+ }
+ ],
+ "rangeEnd": [
+ "entry",
+ {
+ "type": "unit",
+ "value": 100,
+ "unit": "%"
+ }
+ ]
+ }
+ },
+ {
+ "name": "Fade Out",
+ "description": "Fade out the element as it scrolls out of view.",
+ "keyframes": [
+ {
+ "offset": 1,
+ "styles": {
+ "opacity": {
+ "type": "unit",
+ "unit": "number",
+ "value": 0
+ }
+ }
+ }
+ ],
+ "timing": {
+ "easing": "linear",
+ "fill": "forwards",
+ "rangeStart": [
+ "exit",
+ {
+ "type": "unit",
+ "value": 0,
+ "unit": "%"
+ }
+ ],
+ "rangeEnd": [
+ "exit",
+ {
+ "type": "unit",
+ "value": 100,
+ "unit": "%"
+ }
+ ]
+ }
+ },
+ {
+ "name": "Parallax In",
+ "description": "Parallax the element as it scrolls out of view.",
+ "keyframes": [
+ {
+ "offset": 0,
+ "styles": {
+ "translate": {
+ "type": "tuple",
+ "value": [
+ {
+ "type": "unit",
+ "unit": "number",
+ "value": 0
+ },
+ {
+ "type": "unit",
+ "unit": "px",
+ "value": 100
+ }
+ ]
+ }
+ }
+ }
+ ],
+ "timing": {
+ "easing": "linear",
+ "fill": "backwards",
+ "rangeStart": [
+ "cover",
+ {
+ "type": "unit",
+ "value": 0,
+ "unit": "%"
+ }
+ ],
+ "rangeEnd": [
+ "cover",
+ {
+ "type": "unit",
+ "value": 50,
+ "unit": "%"
+ }
+ ]
+ }
+ },
+ {
+ "name": "Parallax Out",
+ "description": "Parallax the element as it scrolls out of view.",
+ "keyframes": [
+ {
+ "offset": 1,
+ "styles": {
+ "translate": {
+ "type": "tuple",
+ "value": [
+ {
+ "type": "unit",
+ "unit": "number",
+ "value": 0
+ },
+ {
+ "type": "unit",
+ "unit": "px",
+ "value": -100
+ }
+ ]
+ }
+ }
+ }
+ ],
+ "timing": {
+ "easing": "linear",
+ "fill": "forwards",
+ "rangeStart": [
+ "cover",
+ {
+ "type": "unit",
+ "value": 50,
+ "unit": "%"
+ }
+ ],
+ "rangeEnd": [
+ "cover",
+ {
+ "type": "unit",
+ "value": 100,
+ "unit": "%"
+ }
+ ]
+ }
+ }
+ ],
+ "isPinned": false
+ }
+ }
+ ],
+ [
+ "JQasStAdmMJWCzknMxi6D",
+ {
+ "id": "JQasStAdmMJWCzknMxi6D",
+ "instanceId": "ed6Q3Y2M1MXZf7E8rMwwW",
+ "name": "action",
+ "type": "animationAction",
+ "value": {
+ "type": "view",
+ "animations": [
+ {
+ "name": "Fade In",
+ "description": "Fade in the element as it scrolls into view.",
+ "keyframes": [
+ {
+ "offset": 0,
+ "styles": {
+ "opacity": {
+ "type": "unit",
+ "unit": "number",
+ "value": 0
+ }
+ }
+ }
+ ],
+ "timing": {
+ "easing": "linear",
+ "fill": "backwards",
+ "rangeStart": [
+ "entry",
+ {
+ "type": "unit",
+ "value": 0,
+ "unit": "%"
+ }
+ ],
+ "rangeEnd": [
+ "entry",
+ {
+ "type": "unit",
+ "value": 100,
+ "unit": "%"
+ }
+ ]
+ }
+ },
+ {
+ "name": "Fade Out",
+ "description": "Fade out the element as it scrolls out of view.",
+ "keyframes": [
+ {
+ "offset": 1,
+ "styles": {
+ "opacity": {
+ "type": "unit",
+ "unit": "number",
+ "value": 0
+ }
+ }
+ }
+ ],
+ "timing": {
+ "easing": "linear",
+ "fill": "forwards",
+ "rangeStart": [
+ "exit",
+ {
+ "type": "unit",
+ "value": 0,
+ "unit": "%"
+ }
+ ],
+ "rangeEnd": [
+ "exit",
+ {
+ "type": "unit",
+ "value": 100,
+ "unit": "%"
+ }
+ ]
+ }
+ },
+ {
+ "name": "Parallax In",
+ "description": "Parallax the element as it scrolls out of view.",
+ "keyframes": [
+ {
+ "offset": 0,
+ "styles": {
+ "translate": {
+ "type": "tuple",
+ "value": [
+ {
+ "type": "unit",
+ "unit": "number",
+ "value": 0
+ },
+ {
+ "type": "unit",
+ "unit": "px",
+ "value": 100
+ }
+ ]
+ }
+ }
+ }
+ ],
+ "timing": {
+ "easing": "linear",
+ "fill": "backwards",
+ "rangeStart": [
+ "cover",
+ {
+ "type": "unit",
+ "value": 0,
+ "unit": "%"
+ }
+ ],
+ "rangeEnd": [
+ "cover",
+ {
+ "type": "unit",
+ "value": 50,
+ "unit": "%"
+ }
+ ]
+ }
+ },
+ {
+ "name": "Parallax Out",
+ "description": "Parallax the element as it scrolls out of view.",
+ "keyframes": [
+ {
+ "offset": 1,
+ "styles": {
+ "translate": {
+ "type": "tuple",
+ "value": [
+ {
+ "type": "unit",
+ "unit": "number",
+ "value": 0
+ },
+ {
+ "type": "unit",
+ "unit": "px",
+ "value": -100
+ }
+ ]
+ }
+ }
+ }
+ ],
+ "timing": {
+ "easing": "linear",
+ "fill": "forwards",
+ "rangeStart": [
+ "cover",
+ {
+ "type": "unit",
+ "value": 50,
+ "unit": "%"
+ }
+ ],
+ "rangeEnd": [
+ "cover",
+ {
+ "type": "unit",
+ "value": 100,
+ "unit": "%"
+ }
+ ]
+ }
+ }
+ ],
+ "isPinned": false
+ }
+ }
+ ],
+ [
+ "WXm4SG4hn0GOxQzlx1onL",
{
- "id": "_wNeTsN1d6jG8ZM5ud05d",
- "instanceId": "56x98yMSVYpp7eVo8wuzK",
- "name": "href",
- "type": "string",
- "value": "https://overwritten.slot/head-slot-tag"
+ "id": "WXm4SG4hn0GOxQzlx1onL",
+ "instanceId": "GRj9UMUzk-HAWRctEcfFH",
+ "name": "charWindow",
+ "type": "number",
+ "value": 20
}
]
],
@@ -5167,6 +5981,309 @@
}
]
}
+ ],
+ [
+ "Qrpsu4yKLKARA-82TnhLI",
+ {
+ "type": "instance",
+ "id": "Qrpsu4yKLKARA-82TnhLI",
+ "component": "Body",
+ "children": [
+ {
+ "type": "id",
+ "value": "1e-3lR1XsDg2IsPu4mSNr"
+ },
+ {
+ "type": "id",
+ "value": "3hPo1LW5P_4VAyXUmVtpY"
+ },
+ {
+ "type": "id",
+ "value": "81TW-o_0QLHlfmBAKFyCQ"
+ },
+ {
+ "type": "id",
+ "value": "KCX8plaeWZXn98-4qmHBW"
+ },
+ {
+ "type": "id",
+ "value": "YrVDoWK0I_9hpQs5yJzLt"
+ }
+ ]
+ }
+ ],
+ [
+ "1e-3lR1XsDg2IsPu4mSNr",
+ {
+ "type": "instance",
+ "id": "1e-3lR1XsDg2IsPu4mSNr",
+ "component": "Box",
+ "label": "Intro",
+ "children": [
+ {
+ "type": "id",
+ "value": "4wwrTenFWHa_8V-EfwjgO"
+ }
+ ]
+ }
+ ],
+ [
+ "4wwrTenFWHa_8V-EfwjgO",
+ {
+ "type": "instance",
+ "id": "4wwrTenFWHa_8V-EfwjgO",
+ "component": "Heading",
+ "children": [
+ {
+ "type": "text",
+ "value": "ANIMATIONS"
+ }
+ ]
+ }
+ ],
+ [
+ "YrVDoWK0I_9hpQs5yJzLt",
+ {
+ "type": "instance",
+ "id": "YrVDoWK0I_9hpQs5yJzLt",
+ "component": "Box",
+ "label": "Footer",
+ "children": [
+ {
+ "type": "id",
+ "value": "5_baZPv9KywpYUey_eAcH"
+ }
+ ]
+ }
+ ],
+ [
+ "5_baZPv9KywpYUey_eAcH",
+ {
+ "type": "instance",
+ "id": "5_baZPv9KywpYUey_eAcH",
+ "component": "Heading",
+ "children": [
+ {
+ "type": "text",
+ "value": "THE END"
+ }
+ ]
+ }
+ ],
+ [
+ "3hPo1LW5P_4VAyXUmVtpY",
+ {
+ "type": "instance",
+ "id": "3hPo1LW5P_4VAyXUmVtpY",
+ "component": "Box",
+ "label": "Grid",
+ "children": [
+ {
+ "type": "id",
+ "value": "nhg6K_WDmDwhfMi9qkUzE"
+ },
+ {
+ "type": "id",
+ "value": "Vylc3nJKmfZAYwc_rYx6j"
+ }
+ ]
+ }
+ ],
+ [
+ "nhg6K_WDmDwhfMi9qkUzE",
+ {
+ "type": "instance",
+ "id": "nhg6K_WDmDwhfMi9qkUzE",
+ "component": "Box",
+ "label": "AnimCol",
+ "children": [
+ {
+ "type": "id",
+ "value": "D6OU4dJ2tzc_Uq5LqMVWo"
+ }
+ ]
+ }
+ ],
+ [
+ "D6OU4dJ2tzc_Uq5LqMVWo",
+ {
+ "type": "instance",
+ "id": "D6OU4dJ2tzc_Uq5LqMVWo",
+ "component": "@webstudio-is/sdk-components-animation:AnimateChildren",
+ "children": [
+ {
+ "type": "id",
+ "value": "cvCjIfx9TJ3XeeSpCnW1w"
+ },
+ {
+ "type": "id",
+ "value": "815GnawXGdYDbF2lvJ4p-"
+ }
+ ]
+ }
+ ],
+ [
+ "cvCjIfx9TJ3XeeSpCnW1w",
+ {
+ "type": "instance",
+ "id": "cvCjIfx9TJ3XeeSpCnW1w",
+ "component": "Heading",
+ "label": "Animated H0",
+ "children": [
+ {
+ "type": "text",
+ "value": "ANIMATED CHILD 0"
+ }
+ ]
+ }
+ ],
+ [
+ "815GnawXGdYDbF2lvJ4p-",
+ {
+ "type": "instance",
+ "id": "815GnawXGdYDbF2lvJ4p-",
+ "component": "Heading",
+ "label": "Animated H0",
+ "children": [
+ {
+ "type": "text",
+ "value": "ANIMATED CHILD 1"
+ }
+ ]
+ }
+ ],
+ [
+ "Vylc3nJKmfZAYwc_rYx6j",
+ {
+ "type": "instance",
+ "id": "Vylc3nJKmfZAYwc_rYx6j",
+ "component": "Box",
+ "children": [
+ {
+ "type": "text",
+ "value": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce sed tellus at nisi feugiat accumsan. Aliquam tristique vitae augue eget lacinia. "
+ }
+ ]
+ }
+ ],
+ [
+ "KCX8plaeWZXn98-4qmHBW",
+ {
+ "type": "instance",
+ "id": "KCX8plaeWZXn98-4qmHBW",
+ "component": "Box",
+ "label": "Grid",
+ "children": [
+ {
+ "type": "id",
+ "value": "tYYYhZkINGVL853ry_940"
+ },
+ {
+ "type": "id",
+ "value": "EHq0nc3KxVSs35jB5udcn"
+ }
+ ]
+ }
+ ],
+ [
+ "tYYYhZkINGVL853ry_940",
+ {
+ "type": "instance",
+ "id": "tYYYhZkINGVL853ry_940",
+ "component": "Box",
+ "label": "AnimCol",
+ "children": [
+ {
+ "type": "id",
+ "value": "ed6Q3Y2M1MXZf7E8rMwwW"
+ }
+ ]
+ }
+ ],
+ [
+ "ed6Q3Y2M1MXZf7E8rMwwW",
+ {
+ "type": "instance",
+ "id": "ed6Q3Y2M1MXZf7E8rMwwW",
+ "component": "@webstudio-is/sdk-components-animation:AnimateChildren",
+ "children": [
+ {
+ "type": "id",
+ "value": "GRj9UMUzk-HAWRctEcfFH"
+ }
+ ]
+ }
+ ],
+ [
+ "EHq0nc3KxVSs35jB5udcn",
+ {
+ "type": "instance",
+ "id": "EHq0nc3KxVSs35jB5udcn",
+ "component": "Box",
+ "children": [
+ {
+ "type": "text",
+ "value": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce sed tellus at nisi feugiat accumsan. Aliquam tristique vitae augue eget lacinia. "
+ }
+ ]
+ }
+ ],
+ [
+ "GRj9UMUzk-HAWRctEcfFH",
+ {
+ "type": "instance",
+ "id": "GRj9UMUzk-HAWRctEcfFH",
+ "component": "@webstudio-is/sdk-components-animation:AnimateText",
+ "children": [
+ {
+ "type": "id",
+ "value": "hi1l-ro0pCVQpHFIwIhFO"
+ },
+ {
+ "type": "id",
+ "value": "oRr8wiz8x-p2kEhV0zBnt"
+ }
+ ]
+ }
+ ],
+ [
+ "hi1l-ro0pCVQpHFIwIhFO",
+ {
+ "type": "instance",
+ "id": "hi1l-ro0pCVQpHFIwIhFO",
+ "component": "Heading",
+ "label": "Animated H0",
+ "children": [
+ {
+ "type": "text",
+ "value": "ANIMATED CHILD 1"
+ }
+ ]
+ }
+ ],
+ [
+ "oRr8wiz8x-p2kEhV0zBnt",
+ {
+ "type": "instance",
+ "id": "oRr8wiz8x-p2kEhV0zBnt",
+ "component": "Box",
+ "children": [
+ {
+ "type": "text",
+ "value": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce sed tellus at nisi feugiat accumsan. Aliquam tristique vitae augue eget lacinia. "
+ }
+ ]
+ }
+ ],
+ [
+ "81TW-o_0QLHlfmBAKFyCQ",
+ {
+ "type": "instance",
+ "id": "81TW-o_0QLHlfmBAKFyCQ",
+ "component": "Box",
+ "label": "Spacer",
+ "children": []
+ }
]
],
"deployment": {
@@ -5406,6 +6523,31 @@
"include": false
},
"path": "/head-tag"
+ },
+ {
+ "id": "oc1Ra5zelesj-wiJwiw-P",
+ "name": "animations",
+ "title": "\"Untitled\"",
+ "rootInstanceId": "Qrpsu4yKLKARA-82TnhLI",
+ "meta": {
+ "description": "\"\"",
+ "excludePageFromSearch": "true",
+ "language": "\"\"",
+ "socialImageUrl": "\"\"",
+ "status": "200",
+ "redirect": "\"\"",
+ "documentType": "html",
+ "custom": [
+ {
+ "property": "",
+ "content": "\"\""
+ }
+ ]
+ },
+ "marketplace": {
+ "include": false
+ },
+ "path": "/animations"
}
],
"assets": [
diff --git a/fixtures/webstudio-features/app/__generated__/$resources.sitemap.xml.ts b/fixtures/webstudio-features/app/__generated__/$resources.sitemap.xml.ts
index 3a0bc1fc6f..b62896dc5e 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-04",
+ lastModified: "2025-03-10",
},
{
path: "/_route_with_symbols_",
- lastModified: "2025-03-04",
+ lastModified: "2025-03-10",
},
{
path: "/form",
- lastModified: "2025-03-04",
+ lastModified: "2025-03-10",
},
{
path: "/heading-with-id",
- lastModified: "2025-03-04",
+ lastModified: "2025-03-10",
},
{
path: "/resources",
- lastModified: "2025-03-04",
+ lastModified: "2025-03-10",
},
{
path: "/nested/nested-page",
- lastModified: "2025-03-04",
+ lastModified: "2025-03-10",
},
];
diff --git a/fixtures/webstudio-features/app/__generated__/[animations]._index.server.tsx b/fixtures/webstudio-features/app/__generated__/[animations]._index.server.tsx
new file mode 100644
index 0000000000..6c968b385b
--- /dev/null
+++ b/fixtures/webstudio-features/app/__generated__/[animations]._index.server.tsx
@@ -0,0 +1,39 @@
+/* eslint-disable */
+/* This is a auto generated file for building the project */
+
+import type { PageMeta } from "@webstudio-is/sdk";
+import type { System, ResourceRequest } from "@webstudio-is/sdk";
+export const getResources = (_props: { system: System }) => {
+ const _data = new Map<string, ResourceRequest>([]);
+ const _action = new Map<string, ResourceRequest>([]);
+ return { data: _data, action: _action };
+};
+
+export const getPageMeta = ({
+ system,
+ resources,
+}: {
+ system: System;
+ resources: Record<string, any>;
+}): PageMeta => {
+ return {
+ title: "Untitled",
+ description: "",
+ excludePageFromSearch: true,
+ language: "",
+ socialImageAssetName: undefined,
+ socialImageUrl: "",
+ status: 200,
+ redirect: "",
+ custom: [],
+ };
+};
+
+type Params = Record<string, string | undefined>;
+export const getRemixParams = ({ ...params }: Params): Params => {
+ return params;
+};
+
+export const projectId = "cddc1d44-af37-4cb6-a430-d300cf6f932d";
+
+export const contactEmail = "[email protected]";
diff --git a/fixtures/webstudio-features/app/__generated__/[animations]._index.tsx b/fixtures/webstudio-features/app/__generated__/[animations]._index.tsx
new file mode 100644
index 0000000000..dc5123907c
--- /dev/null
+++ b/fixtures/webstudio-features/app/__generated__/[animations]._index.tsx
@@ -0,0 +1,294 @@
+/* eslint-disable */
+/* This is a auto generated file for building the project */
+
+import { Fragment, useState } from "react";
+import { useResource, useVariableState } from "@webstudio-is/react-sdk/runtime";
+import { Body as Body } from "@webstudio-is/sdk-components-react-router";
+import {
+ Box as Box,
+ Heading as Heading,
+} from "@webstudio-is/sdk-components-react";
+import {
+ AnimateChildren as AnimateChildren,
+ AnimateText as AnimateText,
+} from "@webstudio-is/sdk-components-animation";
+
+export const siteName = "KittyGuardedZone";
+
+export const favIconAsset: string | undefined =
+ "DALL_E_2023-10-30_12.39.46_-_Photo_logo_with_a_bold_cat_silhouette_centered_on_a_contrasting_background_designed_for_clarity_at_small_32x32_favicon_resolution_00h6cEA8u2pJRvVJv7hRe.png";
+
+// Font assets on current page (can be preloaded)
+export const pageFontAssets: string[] = [];
+
+export const pageBackgroundImageAssets: string[] = [];
+
+const Page = (_props: { system: any }) => {
+ return (
+ <Body className={`w-body c1jgcte3 cncutr5 c1ywt30e cqvurle`}>
+ <Box className={`w-box c1m04i8w c13v7j50 cpjvam0 cqkqnmd`}>
+ <Heading className={`w-heading`}>{"ANIMATIONS"}</Heading>
+ </Box>
+ <Box className={`w-box c1y8ynw5 c2gdfrb c1yk3skc c16asro7 c1pt69cw`}>
+ <Box className={`w-box`}>
+ <AnimateChildren
+ action={{
+ type: "view",
+ animations: [
+ {
+ name: "Fade In",
+ description: "Fade in the element as it scrolls into view.",
+ keyframes: [
+ {
+ offset: 0,
+ styles: {
+ opacity: { type: "unit", unit: "number", value: 0 },
+ },
+ },
+ ],
+ timing: {
+ easing: "linear",
+ fill: "backwards",
+ rangeStart: [
+ "entry",
+ { type: "unit", value: 0, unit: "%" },
+ ],
+ rangeEnd: [
+ "entry",
+ { type: "unit", value: 100, unit: "%" },
+ ],
+ },
+ },
+ {
+ name: "Fade Out",
+ description:
+ "Fade out the element as it scrolls out of view.",
+ keyframes: [
+ {
+ offset: 1,
+ styles: {
+ opacity: { type: "unit", unit: "number", value: 0 },
+ },
+ },
+ ],
+ timing: {
+ easing: "linear",
+ fill: "forwards",
+ rangeStart: ["exit", { type: "unit", value: 0, unit: "%" }],
+ rangeEnd: ["exit", { type: "unit", value: 100, unit: "%" }],
+ },
+ },
+ {
+ name: "Parallax In",
+ description:
+ "Parallax the element as it scrolls out of view.",
+ keyframes: [
+ {
+ offset: 0,
+ styles: {
+ translate: {
+ type: "tuple",
+ value: [
+ { type: "unit", unit: "number", value: 0 },
+ { type: "unit", unit: "px", value: 100 },
+ ],
+ },
+ },
+ },
+ ],
+ timing: {
+ easing: "linear",
+ fill: "backwards",
+ rangeStart: [
+ "cover",
+ { type: "unit", value: 0, unit: "%" },
+ ],
+ rangeEnd: ["cover", { type: "unit", value: 50, unit: "%" }],
+ },
+ },
+ {
+ name: "Parallax Out",
+ description:
+ "Parallax the element as it scrolls out of view.",
+ keyframes: [
+ {
+ offset: 1,
+ styles: {
+ translate: {
+ type: "tuple",
+ value: [
+ { type: "unit", unit: "number", value: 0 },
+ { type: "unit", unit: "px", value: -100 },
+ ],
+ },
+ },
+ },
+ ],
+ timing: {
+ easing: "linear",
+ fill: "forwards",
+ rangeStart: [
+ "cover",
+ { type: "unit", value: 50, unit: "%" },
+ ],
+ rangeEnd: [
+ "cover",
+ { type: "unit", value: 100, unit: "%" },
+ ],
+ },
+ },
+ ],
+ isPinned: false,
+ }}
+ >
+ <Heading className={`w-heading c1pdroxx cudat22`}>
+ {"ANIMATED CHILD 0"}
+ </Heading>
+ <Heading className={`w-heading`}>{"ANIMATED CHILD 1"}</Heading>
+ </AnimateChildren>
+ </Box>
+ <Box className={`w-box`}>
+ {
+ "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce sed tellus at nisi feugiat accumsan. Aliquam tristique vitae augue eget lacinia. "
+ }
+ </Box>
+ </Box>
+ <Box className={`w-box cq3mp4w`} />
+ <Box className={`w-box c1y8ynw5 c2gdfrb c1yk3skc`}>
+ <Box className={`w-box`}>
+ <AnimateChildren
+ action={{
+ type: "view",
+ animations: [
+ {
+ name: "Fade In",
+ description: "Fade in the element as it scrolls into view.",
+ keyframes: [
+ {
+ offset: 0,
+ styles: {
+ opacity: { type: "unit", unit: "number", value: 0 },
+ },
+ },
+ ],
+ timing: {
+ easing: "linear",
+ fill: "backwards",
+ rangeStart: [
+ "entry",
+ { type: "unit", value: 0, unit: "%" },
+ ],
+ rangeEnd: [
+ "entry",
+ { type: "unit", value: 100, unit: "%" },
+ ],
+ },
+ },
+ {
+ name: "Fade Out",
+ description:
+ "Fade out the element as it scrolls out of view.",
+ keyframes: [
+ {
+ offset: 1,
+ styles: {
+ opacity: { type: "unit", unit: "number", value: 0 },
+ },
+ },
+ ],
+ timing: {
+ easing: "linear",
+ fill: "forwards",
+ rangeStart: ["exit", { type: "unit", value: 0, unit: "%" }],
+ rangeEnd: ["exit", { type: "unit", value: 100, unit: "%" }],
+ },
+ },
+ {
+ name: "Parallax In",
+ description:
+ "Parallax the element as it scrolls out of view.",
+ keyframes: [
+ {
+ offset: 0,
+ styles: {
+ translate: {
+ type: "tuple",
+ value: [
+ { type: "unit", unit: "number", value: 0 },
+ { type: "unit", unit: "px", value: 100 },
+ ],
+ },
+ },
+ },
+ ],
+ timing: {
+ easing: "linear",
+ fill: "backwards",
+ rangeStart: [
+ "cover",
+ { type: "unit", value: 0, unit: "%" },
+ ],
+ rangeEnd: ["cover", { type: "unit", value: 50, unit: "%" }],
+ },
+ },
+ {
+ name: "Parallax Out",
+ description:
+ "Parallax the element as it scrolls out of view.",
+ keyframes: [
+ {
+ offset: 1,
+ styles: {
+ translate: {
+ type: "tuple",
+ value: [
+ { type: "unit", unit: "number", value: 0 },
+ { type: "unit", unit: "px", value: -100 },
+ ],
+ },
+ },
+ },
+ ],
+ timing: {
+ easing: "linear",
+ fill: "forwards",
+ rangeStart: [
+ "cover",
+ { type: "unit", value: 50, unit: "%" },
+ ],
+ rangeEnd: [
+ "cover",
+ { type: "unit", value: 100, unit: "%" },
+ ],
+ },
+ },
+ ],
+ isPinned: false,
+ }}
+ >
+ <AnimateText charWindow={20}>
+ <Heading className={`w-heading c1pdroxx`}>
+ {"ANIMATED CHILD 1"}
+ </Heading>
+ <Box className={`w-box`}>
+ {
+ "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce sed tellus at nisi feugiat accumsan. Aliquam tristique vitae augue eget lacinia. "
+ }
+ </Box>
+ </AnimateText>
+ </AnimateChildren>
+ </Box>
+ <Box className={`w-box`}>
+ {
+ "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce sed tellus at nisi feugiat accumsan. Aliquam tristique vitae augue eget lacinia. "
+ }
+ </Box>
+ </Box>
+ <Box className={`w-box c1m04i8w c13v7j50 cpjvam0 cqkqnmd`}>
+ <Heading className={`w-heading`}>{"THE END"}</Heading>
+ </Box>
+ </Body>
+ );
+};
+
+export { Page };
diff --git a/fixtures/webstudio-features/app/__generated__/index.css b/fixtures/webstudio-features/app/__generated__/index.css
index 64c7211b72..91816fd03e 100644
--- a/fixtures/webstudio-features/app/__generated__/index.css
+++ b/fixtures/webstudio-features/app/__generated__/index.css
@@ -411,4 +411,45 @@
.c1a2hnxl {
background-color: rgba(2, 139, 250, 1);
}
+ .c1m04i8w {
+ height: 100dvh;
+ }
+}
+@media all and (min-width: 472px) {
+ .c1jgcte3 {
+ max-width: 900px;
+ }
+ .cncutr5 {
+ width: 100%;
+ }
+ .c1ywt30e {
+ min-width: 0px;
+ }
+ .cqvurle {
+ justify-self: center;
+ }
+ .c1y8ynw5 {
+ display: grid;
+ }
+ .c2gdfrb {
+ grid-auto-flow: column;
+ }
+ .c1yk3skc {
+ grid-auto-columns: 1fr;
+ }
+ .c16asro7 {
+ align-items: start;
+ }
+ .c1pt69cw {
+ align-content: start;
+ }
+ .cq3mp4w {
+ height: 40dvh;
+ }
+ .c1pdroxx {
+ margin-top: 0em;
+ }
+ .cudat22 {
+ margin-bottom: 0em;
+ }
}
diff --git a/fixtures/webstudio-features/app/routes/[animations]._index.tsx b/fixtures/webstudio-features/app/routes/[animations]._index.tsx
new file mode 100644
index 0000000000..0d0eb765a7
--- /dev/null
+++ b/fixtures/webstudio-features/app/routes/[animations]._index.tsx
@@ -0,0 +1,295 @@
+import {
+ type MetaFunction,
+ type LinksFunction,
+ type LinkDescriptor,
+ type ActionFunctionArgs,
+ type LoaderFunctionArgs,
+ type HeadersFunction,
+ data,
+ redirect,
+ useLoaderData,
+} from "react-router";
+import {
+ isLocalResource,
+ loadResource,
+ loadResources,
+ formIdFieldName,
+ formBotFieldName,
+} from "@webstudio-is/sdk/runtime";
+import {
+ ReactSdkContext,
+ PageSettingsMeta,
+ PageSettingsTitle,
+} from "@webstudio-is/react-sdk/runtime";
+import {
+ Page,
+ siteName,
+ favIconAsset,
+ pageFontAssets,
+ pageBackgroundImageAssets,
+} from "../__generated__/[animations]._index";
+import {
+ getResources,
+ getPageMeta,
+ getRemixParams,
+ projectId,
+ contactEmail,
+} from "../__generated__/[animations]._index.server";
+import { assetBaseUrl, imageLoader } from "../constants.mjs";
+import css from "../__generated__/index.css?url";
+import { sitemap } from "../__generated__/$resources.sitemap.xml";
+
+const customFetch: typeof fetch = (input, init) => {
+ if (typeof input !== "string") {
+ return fetch(input, init);
+ }
+
+ if (isLocalResource(input, "sitemap.xml")) {
+ // @todo: dynamic import sitemap ???
+ const response = new Response(JSON.stringify(sitemap));
+ response.headers.set("content-type", "application/json; charset=utf-8");
+ return Promise.resolve(response);
+ }
+
+ return fetch(input, init);
+};
+
+export const loader = async (arg: LoaderFunctionArgs) => {
+ const url = new URL(arg.request.url);
+ const host =
+ arg.request.headers.get("x-forwarded-host") ||
+ arg.request.headers.get("host") ||
+ "";
+ url.host = host;
+ url.protocol = "https";
+
+ const params = getRemixParams(arg.params);
+ const system = {
+ params,
+ search: Object.fromEntries(url.searchParams),
+ origin: url.origin,
+ };
+
+ const resources = await loadResources(
+ customFetch,
+ getResources({ system }).data
+ );
+ const pageMeta = getPageMeta({ system, resources });
+
+ if (pageMeta.redirect) {
+ const status =
+ pageMeta.status === 301 || pageMeta.status === 302
+ ? pageMeta.status
+ : 302;
+ throw redirect(pageMeta.redirect, status);
+ }
+
+ // typecheck
+ arg.context.EXCLUDE_FROM_SEARCH satisfies boolean;
+
+ if (arg.context.EXCLUDE_FROM_SEARCH) {
+ pageMeta.excludePageFromSearch = arg.context.EXCLUDE_FROM_SEARCH;
+ }
+
+ return data(
+ {
+ host,
+ url: url.href,
+ system,
+ resources,
+ pageMeta,
+ },
+ // No way for current information to change, so add cache for 10 minutes
+ // In case of CRM Data, this should be set to 0
+ {
+ status: pageMeta.status,
+ headers: {
+ "Cache-Control": "public, max-age=600",
+ },
+ }
+ );
+};
+
+export const headers: HeadersFunction = () => {
+ return {
+ "Cache-Control": "public, max-age=0, must-revalidate",
+ };
+};
+
+export const meta: MetaFunction<typeof loader> = ({ data }) => {
+ const metas: ReturnType<MetaFunction> = [];
+ if (data === undefined) {
+ return metas;
+ }
+
+ const origin = `https://${data.host}`;
+
+ if (siteName) {
+ metas.push({
+ "script:ld+json": {
+ "@context": "https://schema.org",
+ "@type": "WebSite",
+ name: siteName,
+ url: origin,
+ },
+ });
+ }
+
+ return metas;
+};
+
+export const links: LinksFunction = () => {
+ const result: LinkDescriptor[] = [];
+
+ result.push({
+ rel: "stylesheet",
+ href: css,
+ });
+
+ if (favIconAsset) {
+ result.push({
+ rel: "icon",
+ href: imageLoader({
+ src: `${assetBaseUrl}${favIconAsset}`,
+ // width,height must be multiple of 48 https://developers.google.com/search/docs/appearance/favicon-in-search
+ width: 144,
+ height: 144,
+ fit: "pad",
+ quality: 100,
+ format: "auto",
+ }),
+ type: undefined,
+ });
+ }
+
+ for (const asset of pageFontAssets) {
+ result.push({
+ rel: "preload",
+ href: `${assetBaseUrl}${asset}`,
+ as: "font",
+ crossOrigin: "anonymous",
+ });
+ }
+
+ for (const backgroundImageAsset of pageBackgroundImageAssets) {
+ result.push({
+ rel: "preload",
+ href: `${assetBaseUrl}${backgroundImageAsset}`,
+ as: "image",
+ });
+ }
+
+ return result;
+};
+
+const getRequestHost = (request: Request): string =>
+ request.headers.get("x-forwarded-host") || request.headers.get("host") || "";
+
+export const action = async ({
+ request,
+ context,
+}: ActionFunctionArgs): Promise<
+ { success: true } | { success: false; errors: string[] }
+> => {
+ try {
+ const url = new URL(request.url);
+ url.host = getRequestHost(request);
+
+ const formData = await request.formData();
+
+ const system = {
+ params: {},
+ search: {},
+ origin: url.origin,
+ };
+
+ const resourceName = formData.get(formIdFieldName);
+ let resource =
+ typeof resourceName === "string"
+ ? getResources({ system }).action.get(resourceName)
+ : undefined;
+
+ const formBotValue = formData.get(formBotFieldName);
+
+ if (formBotValue == null || typeof formBotValue !== "string") {
+ throw new Error("Form bot field not found");
+ }
+
+ const submitTime = parseInt(formBotValue, 16);
+ // Assumes that the difference between the server time and the form submission time,
+ // including any client-server time drift, is within a 5-minute range.
+ // Note: submitTime might be NaN because formBotValue can be any string used for logging purposes.
+ // Example: `formBotValue: jsdom`, or `formBotValue: headless-env`
+ if (
+ Number.isNaN(submitTime) ||
+ Math.abs(Date.now() - submitTime) > 1000 * 60 * 5
+ ) {
+ throw new Error(`Form bot value invalid ${formBotValue}`);
+ }
+
+ formData.delete(formIdFieldName);
+ formData.delete(formBotFieldName);
+
+ if (resource) {
+ resource.headers.push({
+ name: "Content-Type",
+ value: "application/json",
+ });
+ resource.body = Object.fromEntries(formData);
+ } else {
+ if (contactEmail === undefined) {
+ throw new Error("Contact email not found");
+ }
+
+ resource = context.getDefaultActionResource?.({
+ url,
+ projectId,
+ contactEmail,
+ formData,
+ });
+ }
+
+ if (resource === undefined) {
+ throw Error("Resource not found");
+ }
+ const { ok, statusText } = await loadResource(fetch, resource);
+ if (ok) {
+ return { success: true };
+ }
+ return { success: false, errors: [statusText] };
+ } catch (error) {
+ console.error(error);
+
+ return {
+ success: false,
+ errors: [error instanceof Error ? error.message : "Unknown error"],
+ };
+ }
+};
+
+const Outlet = () => {
+ const { system, resources, url, pageMeta, host } =
+ useLoaderData<typeof loader>();
+ return (
+ <ReactSdkContext.Provider
+ value={{
+ imageLoader,
+ assetBaseUrl,
+ resources,
+ }}
+ >
+ {/* Use the URL as the key to force scripts in HTML Embed to reload on dynamic pages */}
+ <Page key={url} system={system} />
+ <PageSettingsMeta
+ url={url}
+ pageMeta={pageMeta}
+ host={host}
+ siteName={siteName}
+ imageLoader={imageLoader}
+ />
+ <PageSettingsTitle>{pageMeta.title}</PageSettingsTitle>
+ </ReactSdkContext.Provider>
+ );
+};
+
+export default Outlet;
diff --git a/fixtures/webstudio-features/package.json b/fixtures/webstudio-features/package.json
index f128a63b63..a584245472 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 6f14cdae-073c-4f2c-b535-da3f404f3e36 && pnpm prettier --write ./.webstudio/",
+ "fixtures:sync": "pnpm cli sync --buildId 342a7c73-ed72-441d-8a69-8b2659639e93 && 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/package.json b/package.json
index a22ae42fed..3ccbbe558e 100644
--- a/package.json
+++ b/package.json
@@ -89,8 +89,7 @@
"@types/[email protected]": "patches/@[email protected]",
"@radix-ui/[email protected]": "patches/@[email protected]",
- "@remix-run/dev": "patches/@remix-run__dev.patch",
+ "@remix-run/dev": "patches/@remix-run__dev.patch"
}
}
}
diff --git a/packages/cli/src/framework-react-router.ts b/packages/cli/src/framework-react-router.ts
index 010608d456..d2c2e6984c 100644
--- a/packages/cli/src/framework-react-router.ts
+++ b/packages/cli/src/framework-react-router.ts
@@ -3,6 +3,7 @@ import { readFile, rm } from "node:fs/promises";
import type { WsComponentMeta } from "@webstudio-is/sdk";
import { generateRemixRoute, namespaceMeta } from "@webstudio-is/react-sdk";
import * as baseComponentMetas from "@webstudio-is/sdk-components-react/metas";
+import * as animationComponentMetas from "@webstudio-is/sdk-components-animation/metas";
import * as reactRouterComponentMetas from "@webstudio-is/sdk-components-react-router/metas";
import * as radixComponentMetas from "@webstudio-is/sdk-components-react-radix/metas";
import type { Framework } from "./framework";
@@ -40,12 +41,26 @@ export const createFramework = async (): Promise<Framework> => {
);
}
+ const animationComponentNamespacedMetas: Record<string, WsComponentMeta> = {};
+ for (const [name, meta] of Object.entries(animationComponentMetas)) {
+ const namespace = "@webstudio-is/sdk-components-animation";
+ animationComponentNamespacedMetas[`${namespace}:${name}`] = namespaceMeta(
+ meta as WsComponentMeta,
+ namespace,
+ new Set(Object.keys(animationComponentMetas))
+ );
+ }
+
return {
components: [
{
source: "@webstudio-is/sdk-components-react",
metas: baseComponentMetas,
},
+ {
+ source: "@webstudio-is/sdk-components-animation",
+ metas: animationComponentNamespacedMetas,
+ },
{
source: "@webstudio-is/sdk-components-react-radix",
metas: radixComponentNamespacedMetas,
diff --git a/packages/cli/templates/saas-helpers/package.json b/packages/cli/templates/saas-helpers/package.json
index e9f8b811c7..05c9ace789 100644
--- a/packages/cli/templates/saas-helpers/package.json
+++ b/packages/cli/templates/saas-helpers/package.json
@@ -2,5 +2,8 @@
"dependencies": {
"worktop": "0.8.0-next.18",
"zod": "^3.22.4"
+ },
+ "devDependencies": {
+ "fast-glob": "^3.3.2"
}
}
diff --git a/packages/cli/templates/saas-helpers/vite.config.ts b/packages/cli/templates/saas-helpers/vite.config.ts
new file mode 100644
index 0000000000..209b86184a
--- /dev/null
+++ b/packages/cli/templates/saas-helpers/vite.config.ts
@@ -0,0 +1,48 @@
+import {
+ vitePlugin as remix,
+ cloudflareDevProxyVitePlugin as remixCloudflareDevProxy,
+} from "@remix-run/dev";
+import { defineConfig } from "vite";
+
+import { existsSync } from "node:fs";
+// @ts-ignore
+import path from "node:path";
+// @ts-ignore
+import fg from "fast-glob";
+
+const rootDir = ["..", "../..", "../../.."]
+ .map((dir) => path.join(__dirname, dir))
+ .find((dir) => existsSync(path.join(dir, ".git")));
+
+const hasPrivateFolders =
+ fg.sync([path.join(rootDir ?? "", "packages/*/private-src/*")], {
+ ignore: ["**/node_modules/**"],
+ }).length > 0;
+
+const conditions = hasPrivateFolders
+ ? ["webstudio-private", "webstudio"]
+ : ["webstudio"];
+
+export default defineConfig(({ mode }) => ({
+ resolve: {
+ conditions,
+ },
+ ssr: {
+ resolve: {
+ conditions,
+ },
+ },
+ plugins: [
+ // without this, remixCloudflareDevProxy trying to load workerd even for production (it's not needed for production)
+ mode === "production" ? undefined : remixCloudflareDevProxy(),
+ remix({
+ future: {
+ v3_lazyRouteDiscovery: false,
+ v3_relativeSplatPath: false,
+ v3_singleFetch: false,
+ v3_fetcherPersist: false,
+ v3_throwAbortReason: false,
+ },
+ }),
+ ].filter(Boolean),
+}));
diff --git a/packages/cli/vite.config.ts b/packages/cli/vite.config.ts
index 880b548e76..92d30ce6f2 100644
--- a/packages/cli/vite.config.ts
+++ b/packages/cli/vite.config.ts
@@ -31,9 +31,6 @@ const isExternal = (id: string, importer: string | undefined) => {
export default defineConfig({
// resolve only webstudio condition in tests
- resolve: {
- conditions: ["webstudio"],
- },
build: {
minify: false,
lib: {
diff --git a/packages/css-engine/package.json b/packages/css-engine/package.json
index 883e8c4b3c..2472aefb01 100644
--- a/packages/css-engine/package.json
+++ b/packages/css-engine/package.json
@@ -7,7 +7,7 @@
"type": "module",
"scripts": {
"typecheck": "tsc",
- "build": "rm -rf lib && esbuild src/index.ts --outdir=lib --bundle --format=esm --packages=external",
+ "build": "rm -rf lib && esbuild src/index.ts --outdir=lib --bundle --format=esm --packages=external && esbuild src/runtime.ts --outdir=lib --bundle --format=esm --packages=external",
"dts": "tsc --project tsconfig.dts.json",
"test": "vitest run"
},
@@ -25,9 +25,16 @@
"vitest": "^3.0.4"
},
"exports": {
- "webstudio": "./src/index.ts",
- "types": "./lib/types/index.d.ts",
- "import": "./lib/index.js"
+ ".": {
+ "webstudio": "./src/index.ts",
+ "types": "./lib/types/index.d.ts",
+ "import": "./lib/index.js"
+ },
+ "./runtime": {
+ "webstudio": "./src/runtime.ts",
+ "types": "./lib/types/runtime.d.ts",
+ "import": "./lib/runtime.js"
+ }
},
"files": [
"lib/*",
diff --git a/packages/css-engine/src/runtime.ts b/packages/css-engine/src/runtime.ts
new file mode 100644
index 0000000000..e85beb3d0c
--- /dev/null
+++ b/packages/css-engine/src/runtime.ts
@@ -0,0 +1 @@
+export { toValue } from "./core/to-value";
diff --git a/packages/sdk-components-animation/package.json b/packages/sdk-components-animation/package.json
index 0413b93d73..fc5a973211 100644
--- a/packages/sdk-components-animation/package.json
+++ b/packages/sdk-components-animation/package.json
@@ -61,7 +61,6 @@
"change-case": "^5.4.4",
"nanostores": "^0.11.3",
"react-error-boundary": "^5.0.0",
- "scroll-timeline-polyfill": "^1.1.0",
"shallow-equal": "^3.1.0"
},
"devDependencies": {
diff --git a/packages/sdk-components-animation/private-src b/packages/sdk-components-animation/private-src
index 45acad5a6c..9a8c382dd3 160000
--- a/packages/sdk-components-animation/private-src
+++ b/packages/sdk-components-animation/private-src
@@ -1 +1 @@
-Subproject commit 45acad5a6caf111e92f62d93ac0cd07310a82e6d
+Subproject commit 9a8c382dd31afcc67c9697133ff76e253b7911e6
diff --git a/packages/sdk-components-animation/src/__generated__/animate-text.props.ts b/packages/sdk-components-animation/src/__generated__/animate-text.props.ts
index d6479f71fe..b6b3b473f7 100644
--- a/packages/sdk-components-animation/src/__generated__/animate-text.props.ts
+++ b/packages/sdk-components-animation/src/__generated__/animate-text.props.ts
@@ -1,11 +1,17 @@
import type { PropMeta } from "@webstudio-is/sdk";
export const props: Record<string, PropMeta> = {
- charWindow: { required: true, control: "number", type: "number" },
+ charWindow: {
+ required: false,
+ control: "number",
+ type: "number",
+ defaultValue: 5,
+ },
easing: {
- required: true,
+ required: false,
control: "select",
type: "string",
+ defaultValue: "linear",
options: [
"linear",
"easeIn",
diff --git a/packages/sdk-components-animation/src/animate-text.tsx b/packages/sdk-components-animation/src/animate-text.tsx
index 6721483b5f..93f7485e6f 100644
--- a/packages/sdk-components-animation/src/animate-text.tsx
+++ b/packages/sdk-components-animation/src/animate-text.tsx
@@ -14,13 +14,13 @@ const easings = {
};
type AnimateChildrenProps = {
- charWindow: number;
- easing: keyof typeof easings;
+ charWindow?: number;
+ easing?: keyof typeof easings;
children: React.ReactNode;
};
export const AnimateText = forwardRef<ElementRef<"div">, AnimateChildrenProps>(
- ({ charWindow: _, easing: __, ...props }, ref) => {
+ ({ charWindow = 5, easing = "linear", ...props }, ref) => {
return <div ref={ref} {...props} />;
}
);
diff --git a/packages/sdk-components-animation/tsconfig.json b/packages/sdk-components-animation/tsconfig.json
index 0744a4ea73..584c207e8e 100644
--- a/packages/sdk-components-animation/tsconfig.json
+++ b/packages/sdk-components-animation/tsconfig.json
@@ -6,6 +6,7 @@
"private-src",
"../sdk/src/schema/animation-schema.ts"
],
+ "exclude": ["private-src/perf/**/*"],
"compilerOptions": {
"types": ["react/experimental", "react-dom/experimental", "@types/node"]
}
diff --git a/patches/[email protected] b/patches/[email protected]
deleted file mode 100644
index 8b78d3071d..0000000000
--- a/patches/[email protected]
+++ /dev/null
@@ -1,25 +0,0 @@
-diff --git a/src/scroll-timeline-base.js b/src/scroll-timeline-base.js
-index 2c854928701c5dae23c985eb04f73a6ca2b661c3..abf1a7629568f411dd83dd509640850706d59528 100644
---- a/src/scroll-timeline-base.js
-+++ b/src/scroll-timeline-base.js
-@@ -162,13 +162,19 @@ function isValidAxis(axis) {
- */
- export function measureSource (source) {
- const style = getComputedStyle(source);
-+ const clientHeight = source.clientHeight;
- return {
- scrollLeft: source.scrollLeft,
- scrollTop: source.scrollTop,
- scrollWidth: source.scrollWidth,
- scrollHeight: source.scrollHeight,
- clientWidth: source.clientWidth,
-- clientHeight: source.clientHeight,
-+ get clientHeight() {
-+ if (document.scrollingElement === source) {
-+ return window.innerHeight;
-+ }
-+ return clientHeight;
-+ },
- writingMode: style.writingMode,
- direction: style.direction,
- scrollPaddingTop: style.scrollPaddingTop,
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 41a8542401..8dc8cfbdbd 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -26,9 +26,6 @@ patchedDependencies:
hash: epgcmebti7rfrc2ej4odb3t4jy
path: patches/[email protected]
- hash: i4g3vdpump4efgy2hri5l5rsfm
- path: patches/[email protected]
importers:
@@ -854,6 +851,9 @@ importers:
'@types/react-dom':
specifier: ^18.2.25
version: 18.2.25
+ fast-glob:
+ specifier: ^3.3.2
+ version: 3.3.2
typescript:
specifier: 5.7.3
version: 5.7.3
@@ -1871,9 +1871,6 @@ importers:
react-error-boundary:
specifier: ^5.0.0
version: 5.0.0([email protected])
- scroll-timeline-polyfill:
- specifier: ^1.1.0
- version: 1.1.0(patch_hash=i4g3vdpump4efgy2hri5l5rsfm)
shallow-equal:
specifier: ^3.1.0
version: 3.1.0
@@ -8497,9 +8494,6 @@ packages:
resolution: {integrity: sha512-ifDO3bUdooS4OlxvGxMyoDEC/aq14MvJLDd0thjrUSZGeLJA7WBc+sr9NZxIxrXfVqMl1GTGGPwXqRJZDNW76w==}
- resolution: {integrity: sha512-BpL3gk3Ynt/5VYaDFUNUP/FTkDldwKQnWcA07g/mDHkMVS9pQUyUXBpsy4RZYAgsfFeI1tWcnPNrEFtCpQoO9Q==}
-
resolution: {integrity: sha512-GSL3aowiF7wa/WtSFwnUrludWFoNhftq8bUkH9pkzjpN2XSPOAYEgg6e0sS9s0rZwgJzJiQRPU18A6clnoW5wQ==}
engines: {node: '>=10'}
@@ -16559,8 +16553,6 @@ snapshots:
dependencies:
loose-envify: 1.4.0
- [email protected](patch_hash=i4g3vdpump4efgy2hri5l5rsfm): {}
-
dependencies:
node-forge: 1.3.1
diff --git a/vite.sdk-components.config.ts b/vite.sdk-components.config.ts
index 6d1436f976..14df1b9436 100644
--- a/vite.sdk-components.config.ts
+++ b/vite.sdk-components.config.ts
@@ -1,17 +1,19 @@
import { defineConfig } from "vite";
+import { existsSync } from "node:fs";
+import path from "node:path";
+
+const hasPrivateFolders = existsSync(
+ path.join(process.cwd(), "private-src", "README.md")
+);
const isBareImport = (id: string) =>
id.startsWith("@") || id.includes(".") === false;
export default defineConfig({
- // resolve only webstudio condition in tests
- resolve: {
- conditions: ["webstudio"],
- },
build: {
lib: {
entry: [
- "src/components.ts",
+ hasPrivateFolders ? "private-src/components.ts" : "src/components.ts",
"src/metas.ts",
"src/props.ts",
"src/hooks.ts",
@@ -21,11 +23,20 @@ export default defineConfig({
},
rollupOptions: {
external: isBareImport,
- output: {
- preserveModules: true,
- preserveModulesRoot: "src",
- dir: "lib",
- },
+ output: [
+ {
+ preserveModules: true,
+ preserveModulesRoot: "src",
+ dir: "lib",
+ },
+ hasPrivateFolders
+ ? {
+ preserveModules: true,
+ preserveModulesRoot: "private-src",
+ dir: "lib",
+ }
+ : undefined,
+ ].filter((output) => output !== undefined),
},
},
});