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: Paste from webflow 13 (#3655)
Oleg Isonen0bb0fa4aa57e
diff --git a/apps/builder/app/shared/copy-paste/plugin-webflow/instances-properties.ts b/apps/builder/app/shared/copy-paste/plugin-webflow/instances-properties.tsindex 764c1854d6..779603ad6e 100644--- a/apps/builder/app/shared/copy-paste/plugin-webflow/instances-properties.ts+++ b/apps/builder/app/shared/copy-paste/plugin-webflow/instances-properties.ts@@ -1,6 +1,7 @@import { nanoid } from "nanoid";import type { Instance, Prop, WebstudioFragment } from "@webstudio-is/sdk";import type { WfElementNode, WfNode } from "./schema";+import { showAttribute } from "@webstudio-is/react-sdk";const toFragment = (wfNode: WfElementNode,@@ -36,20 +37,20 @@ const toFragment = (});return;}- if (type === "number" && typeof value === "number") {+ if (typeof value === "number") {fragment.props.push({...prop,- type,+ type: "number",name,value,});return;}- if (type === "boolean" && typeof value === "boolean") {+ if (typeof value === "boolean") {fragment.props.push({...prop,- type,+ type: "boolean",name,value,});@@ -75,6 +76,13 @@ const toFragment = (addProp("id", wfNode.data.attr.id);}+ // Webflow will have conditions: [false, true] when condition is custom and depends on the collection value+ // We only support condition that has a single value.+ const conditions = wfNode.data?.visibility?.conditions ?? [];+ if (conditions.length === 1 && conditions[0] === false) {+ addProp(showAttribute, false);+ }+switch (component) {case "LineBreak": {return fragment;@@ -86,7 +94,7 @@ const toFragment = (}case "List": {if (wfNode.tag === "ol") {- addProp("ordered", true, "boolean");+ addProp("ordered", true);}addInstance(component);return fragment;@@ -200,7 +208,7 @@ const toFragment = (}case "HtmlEmbed": {addProp("code", wfNode.v);- addProp("clientOnly", true, "boolean");+ addProp("clientOnly", true);addInstance(component);return fragment;}@@ -263,12 +271,12 @@ const toFragment = (const data = wfNode.data;const component = "Input";addProp("name", data.attr.name);- addProp("maxLength", data.attr.maxlength, "number");+ addProp("maxLength", data.attr.maxlength);addProp("placeholder", data.attr.placeholder);- addProp("disabled", data.attr.disabled, "boolean");+ addProp("disabled", data.attr.disabled);addProp("type", data.attr.type);- addProp("required", data.attr.required, "boolean");- addProp("autoFocus", data.attr.autofocus, "boolean");+ addProp("required", data.attr.required);+ addProp("autoFocus", data.attr.autofocus);addInstance(component);return fragment;}@@ -276,10 +284,10 @@ const toFragment = (const data = wfNode.data;const component = "Textarea";addProp("name", data.attr.name);- addProp("maxLength", data.attr.maxlength, "number");+ addProp("maxLength", data.attr.maxlength);addProp("placeholder", data.attr.placeholder);- addProp("required", data.attr.required, "boolean");- addProp("autoFocus", data.attr.autofocus, "boolean");+ addProp("required", data.attr.required);+ addProp("autoFocus", data.attr.autofocus);addInstance(component);return fragment;}@@ -299,8 +307,8 @@ const toFragment = (const component = "Checkbox";const data = wfNode.data;addProp("name", data.attr.name);- addProp("required", data.attr.required, "boolean");- addProp("defaultChecked", data.attr.checked, "boolean");+ addProp("required", data.attr.required);+ addProp("defaultChecked", data.attr.checked);addInstance(component);return fragment;}@@ -319,7 +327,7 @@ const toFragment = (const component = "RadioButton";const data = wfNode.data;addProp("name", data.attr.name);- addProp("required", data.attr.required, "boolean");+ addProp("required", data.attr.required);addProp("value", data.attr.value);addInstance(component);return fragment;@@ -329,8 +337,8 @@ const toFragment = (const component = "Input";const data = wfNode.data;addProp("name", data.attr.name);- addProp("required", data.attr.required, "boolean");- addProp("multiple", data.attr.multiple, "boolean");+ addProp("required", data.attr.required);+ addProp("multiple", data.attr.multiple);addInstance(component);return fragment;}diff --git a/apps/builder/app/shared/copy-paste/plugin-webflow/plugin-webflow.test.tsx b/apps/builder/app/shared/copy-paste/plugin-webflow/plugin-webflow.test.tsxindex a20400ba9c..31d789df27 100644--- a/apps/builder/app/shared/copy-paste/plugin-webflow/plugin-webflow.test.tsx+++ b/apps/builder/app/shared/copy-paste/plugin-webflow/plugin-webflow.test.tsx@@ -2364,6 +2364,32 @@ describe("Custom attributes", () => {});});+test("Set show false when visibility's only condition is false", async () => {+ const fragment = await toWebstudioFragment({+ type: "@webflow/XscpData",+ payload: {+ nodes: [+ {+ _id: "b35ac1a9-5a38-56c6-03ba-3196d421b95e",+ type: "Block",+ tag: "div",+ classes: [],+ children: [],+ data: {+ visibility: {+ conditions: [false],+ },+ },+ },+ ],+ styles: [],+ assets: [],+ },+ });+ equalFragment(fragment, <$.Box data-ws-show={false} />);+ expect(toCss(fragment)).toMatchInlineSnapshot(`""`);+});+describe("Styles", () => {test("Single class", async () => {const fragment = await toWebstudioFragment({@@ -2658,252 +2684,256 @@ describe("Styles", () => {}"`);});-});-test("Breakpoints", async () => {- const fragment = await toWebstudioFragment({- type: "@webflow/XscpData",- payload: {- nodes: [- {- _id: "c06c94aa-e2cd-fa7a-d8f8-574b474a20fa",- type: "Block",- tag: "div",- classes: ["81fbefba-d2de-9cc2-81bf-3a929d4eb219"],- children: [],- },- ],- styles: [- {- _id: "81fbefba-d2de-9cc2-81bf-3a929d4eb219",- fake: false,- type: "class",- name: "Div Block 2",- namespace: "",- comb: "",- styleLess: "background-color: hsla(191, 100.00%, 50.00%, 1.00);",- variants: {- large: {- styleLess: "background-color: hsla(150, 100.00%, 50.00%, 1.00);",- },- xl: {- styleLess: "background-color: hsla(69, 100.00%, 50.00%, 1.00);",- },- xxl: {- styleLess: "background-color: hsla(14, 100.00%, 50.00%, 1.00);",- },- medium: {- styleLess: "background-color: hsla(256, 100.00%, 50.00%, 1.00);",- },- small: {- styleLess: "background-color: hsla(308, 100.00%, 50.00%, 1.00);",- },- tiny: {- styleLess: "background-color: hsla(359, 100.00%, 50.00%, 1.00);",+ test("Breakpoints", async () => {+ const fragment = await toWebstudioFragment({+ type: "@webflow/XscpData",+ payload: {+ nodes: [+ {+ _id: "c06c94aa-e2cd-fa7a-d8f8-574b474a20fa",+ type: "Block",+ tag: "div",+ classes: ["81fbefba-d2de-9cc2-81bf-3a929d4eb219"],+ children: [],+ },+ ],+ styles: [+ {+ _id: "81fbefba-d2de-9cc2-81bf-3a929d4eb219",+ fake: false,+ type: "class",+ name: "Div Block 2",+ namespace: "",+ comb: "",+ styleLess: "background-color: hsla(191, 100.00%, 50.00%, 1.00);",+ variants: {+ large: {+ styleLess:+ "background-color: hsla(150, 100.00%, 50.00%, 1.00);",+ },+ xl: {+ styleLess: "background-color: hsla(69, 100.00%, 50.00%, 1.00);",+ },+ xxl: {+ styleLess: "background-color: hsla(14, 100.00%, 50.00%, 1.00);",+ },+ medium: {+ styleLess:+ "background-color: hsla(256, 100.00%, 50.00%, 1.00);",+ },+ small: {+ styleLess:+ "background-color: hsla(308, 100.00%, 50.00%, 1.00);",+ },+ tiny: {+ styleLess:+ "background-color: hsla(359, 100.00%, 50.00%, 1.00);",+ },},},- },- ],- assets: [],- },- });+ ],+ assets: [],+ },+ });- expect(toCss(fragment)).toMatchInlineSnapshot(`- "@media all {- Div Block 2 {- background-color: rgba(0, 208, 255, 1)- }- }- @media all and (max-width: 991px) {- Div Block 2 {- background-color: rgba(68, 0, 255, 1)- }- }- @media all and (max-width: 767px) {- Div Block 2 {- background-color: rgba(255, 0, 221, 1)- }- }- @media all and (max-width: 479px) {- Div Block 2 {- background-color: rgba(255, 0, 4, 1)- }- }- @media all and (min-width: 1280px) {- Div Block 2 {- background-color: rgba(0, 255, 128, 1)- }- }- @media all and (min-width: 1440px) {- Div Block 2 {- background-color: rgba(217, 255, 0, 1)- }- }- @media all and (min-width: 1920px) {- Div Block 2 {- background-color: rgba(255, 60, 0, 1)+ expect(toCss(fragment)).toMatchInlineSnapshot(`+ "@media all {+ Div Block 2 {+ background-color: rgba(0, 208, 255, 1)+ }}- }"- `);-});+ @media all and (max-width: 991px) {+ Div Block 2 {+ background-color: rgba(68, 0, 255, 1)+ }+ }+ @media all and (max-width: 767px) {+ Div Block 2 {+ background-color: rgba(255, 0, 221, 1)+ }+ }+ @media all and (max-width: 479px) {+ Div Block 2 {+ background-color: rgba(255, 0, 4, 1)+ }+ }+ @media all and (min-width: 1280px) {+ Div Block 2 {+ background-color: rgba(0, 255, 128, 1)+ }+ }+ @media all and (min-width: 1440px) {+ Div Block 2 {+ background-color: rgba(217, 255, 0, 1)+ }+ }+ @media all and (min-width: 1920px) {+ Div Block 2 {+ background-color: rgba(255, 60, 0, 1)+ }+ }"+ `);+ });-test("background images", async () => {- const input = WfData.parse({- type: "@webflow/XscpData",- payload: {- nodes: [- {- _id: "2e9842a4-ac18-9d21-894b-026c6eb20441",- type: "Block",- tag: "div",- classes: ["98133834-439c-9a8c-7e9f-c3186f2fa45f"],- children: [],- data: {- text: false,- },- },- ],- styles: [- {- _id: "98133834-439c-9a8c-7e9f-c3186f2fa45f",- fake: false,- type: "class",- name: "Div Block",- namespace: "",- comb: "",- styleLess:- "height: 400px; background-image: linear-gradient(180deg, hsla(0, 0.00%, 0.00%, 0.11), white), @img_667d0b7769e0cc3754b584f6, @img_667d0fe180995eadc1534a26, @img_example_bg; background-position: 0px 0px, 550px 0px, 0px 0px,0px 0px; background-size: auto, contain, auto, auto; background-repeat: repeat, no-repeat, repeat,repeat; background-attachment: scroll, fixed, scroll, fixed;",- variants: {},- children: [],- createdBy: "5b7c48038bdf56493c54eae4",- origin: null,- selector: null,- },- ],- assets: [- {- cdnUrl:- "https://uploads-ssl.webflow.com/667c32290bd6159c18dca9a0/667d0b7769e0cc3754b584f6_IMG_2882%20(1).png",- siteId: "667c32290bd6159c18dca9a0",- width: 800,- height: 600,- fileName: "IMG_2882 (1).png",- createdOn: "2024-06-27T06:49:27.100Z",- origFileName: "IMG_2882 (1).png",- fileHash: "36f49907757795f0a4ecfcfdfc483115",- variants: [- {- origFileName: "IMG_2882%20(1)-p-500.png",- fileName: "667d0b7769e0cc3754b584f6_IMG_2882%20(1)-p-500.png",- format: "png",- size: 192728,- width: 500,- quality: 100,- cdnUrl:- "https://daks2k3a4ib2z.cloudfront.net/667c32290bd6159c18dca9a0/667d0b7769e0cc3754b584f6_IMG_2882%20(1)-p-500.png",- s3Url:- "https://s3.amazonaws.com/webflow-prod-assets/667c32290bd6159c18dca9a0/667d0b7769e0cc3754b584f6_IMG_2882%20(1)-p-500.png",- },- ],- mimeType: "image/png",- s3Url:- "https://s3.amazonaws.com/webflow-prod-assets/667c32290bd6159c18dca9a0/667d0b7769e0cc3754b584f6_IMG_2882%20(1).png",- thumbUrl: "",- _id: "667d0b7769e0cc3754b584f6",- markedAsDeleted: false,- fileSize: 862053,- },- {- cdnUrl:- "https://uploads-ssl.webflow.com/667c32290bd6159c18dca9a0/667d0fe180995eadc1534a26_%D0%9F%D1%80%D0%B8%D0%B2%D0%B5%D1%82%20%D0%9C%D0%B8%D1%80%20%3A%20%252F%20.webp",- siteId: "667c32290bd6159c18dca9a0",- width: 1024,- height: 1024,- fileName: "Привет Мир : %2F .webp",- createdOn: "2024-06-27T07:08:17.010Z",- origFileName: "Привет Мир : %2F .webp",- fileHash: "d86e52a94c04120f455b276effa59046",- variants: [- {- origFileName:- "%D0%9F%D1%80%D0%B8%D0%B2%D0%B5%D1%82%20%D0%9C%D0%B8%D1%80%20%3A%20%252F%20-p-500.webp",- fileName:- "667d0fe180995eadc1534a26_%D0%9F%D1%80%D0%B8%D0%B2%D0%B5%D1%82%20%D0%9C%D0%B8%D1%80%20%3A%20%252F%20-p-500.webp",- format: "webp",- size: 26992,- width: 500,- quality: 100,- cdnUrl:- "https://daks2k3a4ib2z.cloudfront.net/667c32290bd6159c18dca9a0/667d0fe180995eadc1534a26_%D0%9F%D1%80%D0%B8%D0%B2%D0%B5%D1%82%20%D0%9C%D0%B8%D1%80%20%3A%20%252F%20-p-500.webp",- s3Url:- "https://s3.amazonaws.com/webflow-prod-assets/667c32290bd6159c18dca9a0/667d0fe180995eadc1534a26_%D0%9F%D1%80%D0%B8%D0%B2%D0%B5%D1%82%20%D0%9C%D0%B8%D1%80%20%3A%20%252F%20-p-500.webp",- },- {- origFileName:- "%D0%9F%D1%80%D0%B8%D0%B2%D0%B5%D1%82%20%D0%9C%D0%B8%D1%80%20%3A%20%252F%20-p-800.webp",- fileName:- "667d0fe180995eadc1534a26_%D0%9F%D1%80%D0%B8%D0%B2%D0%B5%D1%82%20%D0%9C%D0%B8%D1%80%20%3A%20%252F%20-p-800.webp",- format: "webp",- size: 45964,- width: 800,- quality: 100,- cdnUrl:- "https://daks2k3a4ib2z.cloudfront.net/667c32290bd6159c18dca9a0/667d0fe180995eadc1534a26_%D0%9F%D1%80%D0%B8%D0%B2%D0%B5%D1%82%20%D0%9C%D0%B8%D1%80%20%3A%20%252F%20-p-800.webp",- s3Url:- "https://s3.amazonaws.com/webflow-prod-assets/667c32290bd6159c18dca9a0/667d0fe180995eadc1534a26_%D0%9F%D1%80%D0%B8%D0%B2%D0%B5%D1%82%20%D0%9C%D0%B8%D1%80%20%3A%20%252F%20-p-800.webp",+ test("background images", async () => {+ const input = WfData.parse({+ type: "@webflow/XscpData",+ payload: {+ nodes: [+ {+ _id: "2e9842a4-ac18-9d21-894b-026c6eb20441",+ type: "Block",+ tag: "div",+ classes: ["98133834-439c-9a8c-7e9f-c3186f2fa45f"],+ children: [],+ data: {+ text: false,},- ],- mimeType: "image/webp",- s3Url:- "https://s3.amazonaws.com/webflow-prod-assets/667c32290bd6159c18dca9a0/667d0fe180995eadc1534a26_%D0%9F%D1%80%D0%B8%D0%B2%D0%B5%D1%82%20%D0%9C%D0%B8%D1%80%20%3A%20%252F%20.webp",- thumbUrl: "",- _id: "667d0fe180995eadc1534a26",- markedAsDeleted: false,- fileSize: 191270,- },- ],- },- });+ },+ ],+ styles: [+ {+ _id: "98133834-439c-9a8c-7e9f-c3186f2fa45f",+ fake: false,+ type: "class",+ name: "Div Block",+ namespace: "",+ comb: "",+ styleLess:+ "height: 400px; background-image: linear-gradient(180deg, hsla(0, 0.00%, 0.00%, 0.11), white), @img_667d0b7769e0cc3754b584f6, @img_667d0fe180995eadc1534a26, @img_example_bg; background-position: 0px 0px, 550px 0px, 0px 0px,0px 0px; background-size: auto, contain, auto, auto; background-repeat: repeat, no-repeat, repeat,repeat; background-attachment: scroll, fixed, scroll, fixed;",+ variants: {},+ children: [],+ createdBy: "5b7c48038bdf56493c54eae4",+ origin: null,+ selector: null,+ },+ ],+ assets: [+ {+ cdnUrl:+ "https://uploads-ssl.webflow.com/667c32290bd6159c18dca9a0/667d0b7769e0cc3754b584f6_IMG_2882%20(1).png",+ siteId: "667c32290bd6159c18dca9a0",+ width: 800,+ height: 600,+ fileName: "IMG_2882 (1).png",+ createdOn: "2024-06-27T06:49:27.100Z",+ origFileName: "IMG_2882 (1).png",+ fileHash: "36f49907757795f0a4ecfcfdfc483115",+ variants: [+ {+ origFileName: "IMG_2882%20(1)-p-500.png",+ fileName: "667d0b7769e0cc3754b584f6_IMG_2882%20(1)-p-500.png",+ format: "png",+ size: 192728,+ width: 500,+ quality: 100,+ cdnUrl:+ "https://daks2k3a4ib2z.cloudfront.net/667c32290bd6159c18dca9a0/667d0b7769e0cc3754b584f6_IMG_2882%20(1)-p-500.png",+ s3Url:+ "https://s3.amazonaws.com/webflow-prod-assets/667c32290bd6159c18dca9a0/667d0b7769e0cc3754b584f6_IMG_2882%20(1)-p-500.png",+ },+ ],+ mimeType: "image/png",+ s3Url:+ "https://s3.amazonaws.com/webflow-prod-assets/667c32290bd6159c18dca9a0/667d0b7769e0cc3754b584f6_IMG_2882%20(1).png",+ thumbUrl: "",+ _id: "667d0b7769e0cc3754b584f6",+ markedAsDeleted: false,+ fileSize: 862053,+ },+ {+ cdnUrl:+ "https://uploads-ssl.webflow.com/667c32290bd6159c18dca9a0/667d0fe180995eadc1534a26_%D0%9F%D1%80%D0%B8%D0%B2%D0%B5%D1%82%20%D0%9C%D0%B8%D1%80%20%3A%20%252F%20.webp",+ siteId: "667c32290bd6159c18dca9a0",+ width: 1024,+ height: 1024,+ fileName: "Привет Мир : %2F .webp",+ createdOn: "2024-06-27T07:08:17.010Z",+ origFileName: "Привет Мир : %2F .webp",+ fileHash: "d86e52a94c04120f455b276effa59046",+ variants: [+ {+ origFileName:+ "%D0%9F%D1%80%D0%B8%D0%B2%D0%B5%D1%82%20%D0%9C%D0%B8%D1%80%20%3A%20%252F%20-p-500.webp",+ fileName:+ "667d0fe180995eadc1534a26_%D0%9F%D1%80%D0%B8%D0%B2%D0%B5%D1%82%20%D0%9C%D0%B8%D1%80%20%3A%20%252F%20-p-500.webp",+ format: "webp",+ size: 26992,+ width: 500,+ quality: 100,+ cdnUrl:+ "https://daks2k3a4ib2z.cloudfront.net/667c32290bd6159c18dca9a0/667d0fe180995eadc1534a26_%D0%9F%D1%80%D0%B8%D0%B2%D0%B5%D1%82%20%D0%9C%D0%B8%D1%80%20%3A%20%252F%20-p-500.webp",+ s3Url:+ "https://s3.amazonaws.com/webflow-prod-assets/667c32290bd6159c18dca9a0/667d0fe180995eadc1534a26_%D0%9F%D1%80%D0%B8%D0%B2%D0%B5%D1%82%20%D0%9C%D0%B8%D1%80%20%3A%20%252F%20-p-500.webp",+ },+ {+ origFileName:+ "%D0%9F%D1%80%D0%B8%D0%B2%D0%B5%D1%82%20%D0%9C%D0%B8%D1%80%20%3A%20%252F%20-p-800.webp",+ fileName:+ "667d0fe180995eadc1534a26_%D0%9F%D1%80%D0%B8%D0%B2%D0%B5%D1%82%20%D0%9C%D0%B8%D1%80%20%3A%20%252F%20-p-800.webp",+ format: "webp",+ size: 45964,+ width: 800,+ quality: 100,+ cdnUrl:+ "https://daks2k3a4ib2z.cloudfront.net/667c32290bd6159c18dca9a0/667d0fe180995eadc1534a26_%D0%9F%D1%80%D0%B8%D0%B2%D0%B5%D1%82%20%D0%9C%D0%B8%D1%80%20%3A%20%252F%20-p-800.webp",+ s3Url:+ "https://s3.amazonaws.com/webflow-prod-assets/667c32290bd6159c18dca9a0/667d0fe180995eadc1534a26_%D0%9F%D1%80%D0%B8%D0%B2%D0%B5%D1%82%20%D0%9C%D0%B8%D1%80%20%3A%20%252F%20-p-800.webp",+ },+ ],+ mimeType: "image/webp",+ s3Url:+ "https://s3.amazonaws.com/webflow-prod-assets/667c32290bd6159c18dca9a0/667d0fe180995eadc1534a26_%D0%9F%D1%80%D0%B8%D0%B2%D0%B5%D1%82%20%D0%9C%D0%B8%D1%80%20%3A%20%252F%20.webp",+ thumbUrl: "",+ _id: "667d0fe180995eadc1534a26",+ markedAsDeleted: false,+ fileSize: 191270,+ },+ ],+ },+ });- const fragment = await toWebstudioFragment(input);+ const fragment = await toWebstudioFragment(input);- const bgStyle = fragment.styles.find(- (style) => style.property === "backgroundImage"- );+ const bgStyle = fragment.styles.find(+ (style) => style.property === "backgroundImage"+ );- expect(bgStyle).not.toBeNull();- expect(bgStyle?.value.type).toEqual("layers");+ expect(bgStyle).not.toBeNull();+ expect(bgStyle?.value.type).toEqual("layers");- const layers = bgStyle?.value;+ const layers = bgStyle?.value;- invariant(layers?.type === "layers");+ invariant(layers?.type === "layers");- const imgA = layers.value[1];- const imgB = layers.value[2];- const noneLayer = layers.value[3];+ const imgA = layers.value[1];+ const imgB = layers.value[2];+ const noneLayer = layers.value[3];- invariant(imgA.type === "image");- invariant(imgA.value.type === "url");- invariant(imgB.type === "image");- invariant(imgB.value.type === "url");+ invariant(imgA.type === "image");+ invariant(imgA.value.type === "url");+ invariant(imgB.type === "image");+ invariant(imgB.value.type === "url");- expect(imgA.value.url).toEqual(input.payload.assets[0].s3Url);- expect(imgB.value.url).toEqual(input.payload.assets[1].s3Url);+ expect(imgA.value.url).toEqual(input.payload.assets[0].s3Url);+ expect(imgB.value.url).toEqual(input.payload.assets[1].s3Url);- expect(noneLayer.type).toEqual("keyword");- invariant(noneLayer.type === "keyword");- expect(noneLayer.value).toEqual("none");+ expect(noneLayer.type).toEqual("keyword");+ invariant(noneLayer.type === "keyword");+ expect(noneLayer.value).toEqual("none");- expect(toCss(fragment)).toMatchInlineSnapshot(`- "@media all {- Div Block {- height: 400px;- background-image: linear-gradient(180deg,hsla(0,0.00%,0.00%,0.11),white), url("https://s3.amazonaws.com/webflow-prod-assets/667c32290bd6159c18dca9a0/667d0b7769e0cc3754b584f6_IMG_2882%20(1).png"), url("https://s3.amazonaws.com/webflow-prod-assets/667c32290bd6159c18dca9a0/667d0fe180995eadc1534a26_%D0%9F%D1%80%D0%B8%D0%B2%D0%B5%D1%82%20%D0%9C%D0%B8%D1%80%20%3A%20%252F%20.webp"), none;- background-size: auto, contain, auto, auto;- background-repeat: repeat, no-repeat, repeat, repeat;- background-attachment: scroll, fixed, scroll, fixed;- background-position: 0px 0px, 550px 0px, 0px 0px, 0px 0px- }- }"-`);+ expect(toCss(fragment)).toMatchInlineSnapshot(`+ "@media all {+ Div Block {+ height: 400px;+ background-image: linear-gradient(180deg,hsla(0,0.00%,0.00%,0.11),white), url("https://s3.amazonaws.com/webflow-prod-assets/667c32290bd6159c18dca9a0/667d0b7769e0cc3754b584f6_IMG_2882%20(1).png"), url("https://s3.amazonaws.com/webflow-prod-assets/667c32290bd6159c18dca9a0/667d0fe180995eadc1534a26_%D0%9F%D1%80%D0%B8%D0%B2%D0%B5%D1%82%20%D0%9C%D0%B8%D1%80%20%3A%20%252F%20.webp"), none;+ background-size: auto, contain, auto, auto;+ background-repeat: repeat, no-repeat, repeat, repeat;+ background-attachment: scroll, fixed, scroll, fixed;+ background-position: 0px 0px, 550px 0px, 0px 0px, 0px 0px+ }+ }"+ `);+ });});diff --git a/apps/builder/app/shared/copy-paste/plugin-webflow/schema.ts b/apps/builder/app/shared/copy-paste/plugin-webflow/schema.tsindex ee03bdc97c..3403a0196c 100644--- a/apps/builder/app/shared/copy-paste/plugin-webflow/schema.ts+++ b/apps/builder/app/shared/copy-paste/plugin-webflow/schema.ts@@ -5,6 +5,11 @@ const Attr = z.object({ id: z.string() }).partial();const WfNodeData = z.object({attr: Attr.optional(),xattr: z.array(z.object({ name: z.string(), value: z.string() })).optional(),+ visibility: z+ .object({+ conditions: z.array(z.boolean()),+ })+ .optional(),});const WfBaseNode = z.object({diff --git a/apps/builder/app/shared/copy-paste/plugin-webflow/styles.ts b/apps/builder/app/shared/copy-paste/plugin-webflow/styles.tsindex 04722a7683..76b6680c52 100644--- a/apps/builder/app/shared/copy-paste/plugin-webflow/styles.ts+++ b/apps/builder/app/shared/copy-paste/plugin-webflow/styles.ts@@ -51,7 +51,9 @@ const parseVariantName = (variant: string) => {state = separator + state;}if (wfBreakpoints.has(breakpointName as WfBreakpointName) === false) {- console.error(`Invalid breakpoint name: ${breakpointName}`);+ if (breakpointName !== "main") {+ console.error(`Invalid breakpoint name: ${breakpointName}`);+ }breakpointName = "base";}