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: Copy from webflow 12 (#3642)

Oleg Isonen3cf3da0f772d
diff --git a/apps/builder/app/shared/copy-paste/plugin-webflow/__generated__/style-presets.ts b/apps/builder/app/shared/copy-paste/plugin-webflow/__generated__/style-presets.ts
index 5418d9ef9f..6b0e88a101 100644
--- a/apps/builder/app/shared/copy-paste/plugin-webflow/__generated__/style-presets.ts
+++ b/apps/builder/app/shared/copy-paste/plugin-webflow/__generated__/style-presets.ts
@@ -28,8 +28,13 @@ export const styles = {
{
property: "backgroundAttachment",
value: {
- type: "keyword",
- value: "scroll",
+ type: "layers",
+ value: [
+ {
+ type: "keyword",
+ value: "scroll",
+ },
+ ],
},
},
{
@@ -549,8 +554,13 @@ export const styles = {
{
property: "backgroundImage",
value: {
- type: "invalid",
- value: "",
+ type: "layers",
+ value: [
+ {
+ type: "invalid",
+ value: "",
+ },
+ ],
},
},
{
@@ -2912,8 +2922,18 @@ export const styles = {
{
property: "textShadow",
value: {
- type: "keyword",
- value: "none",
+ type: "layers",
+ value: [
+ {
+ type: "tuple",
+ value: [
+ {
+ type: "keyword",
+ value: "none",
+ },
+ ],
+ },
+ ],
},
},
{
@@ -2954,8 +2974,13 @@ export const styles = {
{
property: "backgroundImage",
value: {
- type: "invalid",
- value: "",
+ type: "layers",
+ value: [
+ {
+ type: "keyword",
+ value: "none",
+ },
+ ],
},
},
{
@@ -3098,31 +3123,46 @@ export const styles = {
{
property: "transitionProperty",
value: {
- type: "keyword",
+ type: "invalid",
value: "none",
},
},
{
property: "transitionDuration",
value: {
- type: "unit",
- unit: "s",
- value: 0,
+ type: "layers",
+ value: [
+ {
+ type: "unit",
+ value: 0,
+ unit: "s",
+ },
+ ],
},
},
{
property: "transitionTimingFunction",
value: {
- type: "keyword",
- value: "ease",
+ type: "layers",
+ value: [
+ {
+ type: "keyword",
+ value: "ease",
+ },
+ ],
},
},
{
property: "transitionDelay",
value: {
- type: "unit",
- unit: "s",
- value: 0,
+ type: "layers",
+ value: [
+ {
+ type: "unit",
+ value: 0,
+ unit: "s",
+ },
+ ],
},
},
{
@@ -3156,8 +3196,68 @@ export const styles = {
{
property: "boxShadow",
value: {
- type: "unparsed",
- value: "0 0 0 1px rgba(0,0,0,0.1),0 1px 3px rgba(0,0,0,0.1)",
+ type: "layers",
+ value: [
+ {
+ type: "tuple",
+ value: [
+ {
+ type: "unit",
+ value: 0,
+ unit: "number",
+ },
+ {
+ type: "unit",
+ value: 0,
+ unit: "number",
+ },
+ {
+ type: "unit",
+ value: 0,
+ unit: "number",
+ },
+ {
+ type: "unit",
+ value: 1,
+ unit: "px",
+ },
+ {
+ type: "rgb",
+ alpha: 0.1,
+ r: 0,
+ g: 0,
+ b: 0,
+ },
+ ],
+ },
+ {
+ type: "tuple",
+ value: [
+ {
+ type: "unit",
+ value: 0,
+ unit: "number",
+ },
+ {
+ type: "unit",
+ value: 1,
+ unit: "px",
+ },
+ {
+ type: "unit",
+ value: 3,
+ unit: "px",
+ },
+ {
+ type: "rgb",
+ alpha: 0.1,
+ r: 0,
+ g: 0,
+ b: 0,
+ },
+ ],
+ },
+ ],
},
},
{
@@ -7034,8 +7134,13 @@ export const styles = {
{
property: "backgroundImage",
value: {
- type: "invalid",
- value: "",
+ type: "layers",
+ value: [
+ {
+ type: "invalid",
+ value: "",
+ },
+ ],
},
},
{
@@ -7810,7 +7915,7 @@ export const styles = {
},
},
{
- property: "WebkitTapHighlightColor",
+ property: "-webkit-tap-highlight-color",
value: {
type: "rgb",
alpha: 0,
@@ -7829,8 +7934,13 @@ export const styles = {
{
property: "backgroundImage",
value: {
- type: "invalid",
- value: "",
+ type: "layers",
+ value: [
+ {
+ type: "invalid",
+ value: "",
+ },
+ ],
},
},
{
@@ -8012,7 +8122,7 @@ export const styles = {
},
},
{
- property: "WebkitTapHighlightColor",
+ property: "-webkit-tap-highlight-color",
value: {
type: "rgb",
alpha: 0,
@@ -8181,8 +8291,36 @@ export const styles = {
{
property: "boxShadow",
value: {
- type: "unparsed",
- value: "0 0 3px rgba(51,51,51,0.4)",
+ type: "layers",
+ value: [
+ {
+ type: "tuple",
+ value: [
+ {
+ type: "unit",
+ value: 0,
+ unit: "number",
+ },
+ {
+ type: "unit",
+ value: 0,
+ unit: "number",
+ },
+ {
+ type: "unit",
+ value: 3,
+ unit: "px",
+ },
+ {
+ type: "rgb",
+ alpha: 0.4,
+ r: 51,
+ g: 51,
+ b: 51,
+ },
+ ],
+ },
+ ],
},
},
],
@@ -8212,8 +8350,18 @@ export const styles = {
{
property: "boxShadow",
value: {
- type: "keyword",
- value: "none",
+ type: "layers",
+ value: [
+ {
+ type: "tuple",
+ value: [
+ {
+ type: "keyword",
+ value: "none",
+ },
+ ],
+ },
+ ],
},
},
],
@@ -8276,29 +8424,69 @@ export const styles = {
{
property: "transitionProperty",
value: {
- type: "unparsed",
- value: "background-color,color",
+ type: "layers",
+ value: [
+ {
+ type: "keyword",
+ value: "background-color",
+ },
+ {
+ type: "keyword",
+ value: "color",
+ },
+ ],
},
},
{
property: "transitionDuration",
value: {
- type: "unparsed",
- value: "0.1s,0.1s",
+ type: "layers",
+ value: [
+ {
+ type: "unit",
+ value: 0.1,
+ unit: "s",
+ },
+ {
+ type: "unit",
+ value: 0.1,
+ unit: "s",
+ },
+ ],
},
},
{
property: "transitionTimingFunction",
value: {
- type: "unparsed",
- value: "ease,ease",
+ type: "layers",
+ value: [
+ {
+ type: "keyword",
+ value: "ease",
+ },
+ {
+ type: "keyword",
+ value: "ease",
+ },
+ ],
},
},
{
property: "transitionDelay",
value: {
- type: "unparsed",
- value: "0s,0s",
+ type: "layers",
+ value: [
+ {
+ type: "unit",
+ value: 0,
+ unit: "s",
+ },
+ {
+ type: "unit",
+ value: 0,
+ unit: "s",
+ },
+ ],
},
},
{
@@ -8359,8 +8547,18 @@ export const styles = {
{
property: "boxShadow",
value: {
- type: "keyword",
- value: "none",
+ type: "layers",
+ value: [
+ {
+ type: "tuple",
+ value: [
+ {
+ type: "keyword",
+ value: "none",
+ },
+ ],
+ },
+ ],
},
state: ":focus",
},
@@ -8384,7 +8582,7 @@ export const styles = {
},
},
{
- property: "WebkitTapHighlightColor",
+ property: "-webkit-tap-highlight-color",
value: {
type: "rgb",
alpha: 0,
@@ -8556,7 +8754,7 @@ export const styles = {
},
},
{
- property: "WebkitTapHighlightColor",
+ property: "-webkit-tap-highlight-color",
value: {
type: "rgb",
alpha: 0,
@@ -9382,8 +9580,13 @@ export const styles = {
{
property: "backgroundImage",
value: {
- type: "invalid",
- value: "",
+ type: "layers",
+ value: [
+ {
+ type: "invalid",
+ value: "",
+ },
+ ],
},
},
{
@@ -9551,8 +9754,18 @@ export const styles = {
{
property: "textShadow",
value: {
- type: "keyword",
- value: "none",
+ type: "layers",
+ value: [
+ {
+ type: "tuple",
+ value: [
+ {
+ type: "keyword",
+ value: "none",
+ },
+ ],
+ },
+ ],
},
},
{
@@ -9645,7 +9858,7 @@ export const styles = {
},
},
{
- property: "WebkitTapHighlightColor",
+ property: "-webkit-tap-highlight-color",
value: {
type: "invalid",
value: "",
@@ -9654,8 +9867,13 @@ export const styles = {
{
property: "backgroundImage",
value: {
- type: "invalid",
- value: "",
+ type: "layers",
+ value: [
+ {
+ type: "invalid",
+ value: "",
+ },
+ ],
},
},
{
@@ -9796,7 +10014,7 @@ export const styles = {
},
},
{
- property: "WebkitOverflowScrolling",
+ property: "-webkit-overflow-scrolling",
value: {
type: "invalid",
value: "",
@@ -9827,7 +10045,7 @@ export const styles = {
],
"w-lightbox-container": [
{
- property: "WebkitOverflowScrolling",
+ property: "-webkit-overflow-scrolling",
value: {
type: "invalid",
value: "",
@@ -10113,8 +10331,13 @@ export const styles = {
{
property: "backgroundImage",
value: {
- type: "invalid",
- value: "",
+ type: "layers",
+ value: [
+ {
+ type: "invalid",
+ value: "",
+ },
+ ],
},
},
{
@@ -10273,23 +10496,38 @@ export const styles = {
{
property: "backgroundPosition",
value: {
- type: "keyword",
- value: "center",
+ type: "layers",
+ value: [
+ {
+ type: "keyword",
+ value: "center",
+ },
+ ],
},
},
{
property: "backgroundRepeat",
value: {
- type: "keyword",
- value: "no-repeat",
+ type: "layers",
+ value: [
+ {
+ type: "keyword",
+ value: "no-repeat",
+ },
+ ],
},
},
{
property: "backgroundSize",
value: {
- type: "unit",
- unit: "px",
- value: 24,
+ type: "layers",
+ value: [
+ {
+ type: "unit",
+ unit: "px",
+ value: 24,
+ },
+ ],
},
},
{
@@ -10303,31 +10541,51 @@ export const styles = {
{
property: "transitionProperty",
value: {
- type: "keyword",
- value: "all",
+ type: "layers",
+ value: [
+ {
+ type: "keyword",
+ value: "all",
+ },
+ ],
},
},
{
property: "transitionDuration",
value: {
- type: "unit",
- unit: "s",
- value: 0.3,
+ type: "layers",
+ value: [
+ {
+ type: "unit",
+ value: 0.3,
+ unit: "s",
+ },
+ ],
},
},
{
property: "transitionTimingFunction",
value: {
- type: "keyword",
- value: "ease",
+ type: "layers",
+ value: [
+ {
+ type: "keyword",
+ value: "ease",
+ },
+ ],
},
},
{
property: "transitionDelay",
value: {
- type: "unit",
- unit: "s",
- value: 0,
+ type: "layers",
+ value: [
+ {
+ type: "unit",
+ value: 0,
+ unit: "s",
+ },
+ ],
},
},
{
@@ -10366,9 +10624,16 @@ export const styles = {
{
property: "backgroundImage",
value: {
- type: "unparsed",
- value:
- "url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9Ii0yMCAwIDI0IDQwIiB3aWR0aD0iMjQiIGhlaWdodD0iNDAiPjxnIHRyYW5zZm9ybT0icm90YXRlKDQ1KSI+PHBhdGggZD0ibTAgMGg1djIzaDIzdjVoLTI4eiIgb3BhY2l0eT0iLjQiLz48cGF0aCBkPSJtMSAxaDN2MjNoMjN2M2gtMjZ6IiBmaWxsPSIjZmZmIi8+PC9nPjwvc3ZnPg==)",
+ type: "layers",
+ value: [
+ {
+ type: "image",
+ value: {
+ type: "url",
+ url: "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9Ii0yMCAwIDI0IDQwIiB3aWR0aD0iMjQiIGhlaWdodD0iNDAiPjxnIHRyYW5zZm9ybT0icm90YXRlKDQ1KSI+PHBhdGggZD0ibTAgMGg1djIzaDIzdjVoLTI4eiIgb3BhY2l0eT0iLjQiLz48cGF0aCBkPSJtMSAxaDN2MjNoMjN2M2gtMjZ6IiBmaWxsPSIjZmZmIi8+PC9nPjwvc3ZnPg==",
+ },
+ },
+ ],
},
},
{
@@ -10407,9 +10672,16 @@ export const styles = {
{
property: "backgroundImage",
value: {
- type: "unparsed",
- value:
- "url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9Ii00IDAgMjQgNDAiIHdpZHRoPSIyNCIgaGVpZ2h0PSI0MCI+PGcgdHJhbnNmb3JtPSJyb3RhdGUoNDUpIj48cGF0aCBkPSJtMC0waDI4djI4aC01di0yM2gtMjN6IiBvcGFjaXR5PSIuNCIvPjxwYXRoIGQ9Im0xIDFoMjZ2MjZoLTN2LTIzaC0yM3oiIGZpbGw9IiNmZmYiLz48L2c+PC9zdmc+)",
+ type: "layers",
+ value: [
+ {
+ type: "image",
+ value: {
+ type: "url",
+ url: "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9Ii00IDAgMjQgNDAiIHdpZHRoPSIyNCIgaGVpZ2h0PSI0MCI+PGcgdHJhbnNmb3JtPSJyb3RhdGUoNDUpIj48cGF0aCBkPSJtMC0waDI4djI4aC01di0yM2gtMjN6IiBvcGFjaXR5PSIuNCIvPjxwYXRoIGQ9Im0xIDFoMjZ2MjZoLTN2LTIzaC0yM3oiIGZpbGw9IiNmZmYiLz48L2c+PC9zdmc+",
+ },
+ },
+ ],
},
},
{
@@ -10448,17 +10720,29 @@ export const styles = {
{
property: "backgroundImage",
value: {
- type: "unparsed",
- value:
- "url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9Ii00IDAgMTggMTciIHdpZHRoPSIxOCIgaGVpZ2h0PSIxNyI+PGcgdHJhbnNmb3JtPSJyb3RhdGUoNDUpIj48cGF0aCBkPSJtMCAwaDd2LTdoNXY3aDd2NWgtN3Y3aC01di03aC03eiIgb3BhY2l0eT0iLjQiLz48cGF0aCBkPSJtMSAxaDd2LTdoM3Y3aDd2M2gtN3Y3aC0zdi03aC03eiIgZmlsbD0iI2ZmZiIvPjwvZz48L3N2Zz4=)",
+ type: "layers",
+ value: [
+ {
+ type: "image",
+ value: {
+ type: "url",
+ url: "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9Ii00IDAgMTggMTciIHdpZHRoPSIxOCIgaGVpZ2h0PSIxNyI+PGcgdHJhbnNmb3JtPSJyb3RhdGUoNDUpIj48cGF0aCBkPSJtMCAwaDd2LTdoNXY3aDd2NWgtN3Y3aC01di03aC03eiIgb3BhY2l0eT0iLjQiLz48cGF0aCBkPSJtMSAxaDd2LTdoM3Y3aDd2M2gtN3Y3aC0zdi03aC03eiIgZmlsbD0iI2ZmZiIvPjwvZz48L3N2Zz4=",
+ },
+ },
+ ],
},
},
{
property: "backgroundSize",
value: {
- type: "unit",
- unit: "px",
- value: 18,
+ type: "layers",
+ value: [
+ {
+ type: "unit",
+ unit: "px",
+ value: 18,
+ },
+ ],
},
},
{
@@ -10671,8 +10955,13 @@ export const styles = {
{
property: "backgroundImage",
value: {
- type: "invalid",
- value: "",
+ type: "layers",
+ value: [
+ {
+ type: "invalid",
+ value: "",
+ },
+ ],
},
},
{
@@ -11552,8 +11841,13 @@ export const styles = {
{
property: "backgroundImage",
value: {
- type: "invalid",
- value: "",
+ type: "layers",
+ value: [
+ {
+ type: "invalid",
+ value: "",
+ },
+ ],
},
},
{
@@ -11947,7 +12241,7 @@ export const styles = {
},
},
{
- property: "WebkitTapHighlightColor",
+ property: "-webkit-tap-highlight-color",
value: {
type: "rgb",
alpha: 0,
@@ -12507,6 +12801,276 @@ export const styles = {
},
},
],
+ "w-layout-blockcontainer": [
+ {
+ property: "marginLeft",
+ value: {
+ type: "keyword",
+ value: "auto",
+ },
+ },
+ {
+ property: "marginRight",
+ value: {
+ type: "keyword",
+ value: "auto",
+ },
+ },
+ {
+ property: "display",
+ value: {
+ type: "keyword",
+ value: "block",
+ },
+ },
+ {
+ property: "maxWidth",
+ value: {
+ type: "keyword",
+ value: "none",
+ },
+ },
+ ],
+ "w-layout-layout": [
+ {
+ property: "rowGap",
+ value: {
+ type: "unit",
+ unit: "px",
+ value: 20,
+ },
+ },
+ {
+ property: "columnGap",
+ value: {
+ type: "unit",
+ unit: "px",
+ value: 20,
+ },
+ },
+ {
+ property: "gridAutoColumns",
+ value: {
+ type: "unit",
+ unit: "fr",
+ value: 1,
+ },
+ },
+ {
+ property: "justifyContent",
+ value: {
+ type: "keyword",
+ value: "center",
+ },
+ },
+ {
+ property: "paddingTop",
+ value: {
+ type: "unit",
+ unit: "px",
+ value: 20,
+ },
+ },
+ {
+ property: "paddingRight",
+ value: {
+ type: "unit",
+ unit: "px",
+ value: 20,
+ },
+ },
+ {
+ property: "paddingBottom",
+ value: {
+ type: "unit",
+ unit: "px",
+ value: 20,
+ },
+ },
+ {
+ property: "paddingLeft",
+ value: {
+ type: "unit",
+ unit: "px",
+ value: 20,
+ },
+ },
+ ],
+ "w-layout-cell": [
+ {
+ property: "flexDirection",
+ value: {
+ type: "keyword",
+ value: "column",
+ },
+ },
+ {
+ property: "justifyContent",
+ value: {
+ type: "keyword",
+ value: "flex-start",
+ },
+ },
+ {
+ property: "alignItems",
+ value: {
+ type: "keyword",
+ value: "flex-start",
+ },
+ },
+ {
+ property: "display",
+ value: {
+ type: "keyword",
+ value: "flex",
+ },
+ },
+ ],
+ "w-layout-vflex": [
+ {
+ property: "flexDirection",
+ value: {
+ type: "keyword",
+ value: "column",
+ },
+ },
+ {
+ property: "alignItems",
+ value: {
+ type: "keyword",
+ value: "flex-start",
+ },
+ },
+ {
+ property: "display",
+ value: {
+ type: "keyword",
+ value: "flex",
+ },
+ },
+ ],
+ "w-layout-hflex": [
+ {
+ property: "flexDirection",
+ value: {
+ type: "keyword",
+ value: "row",
+ },
+ },
+ {
+ property: "alignItems",
+ value: {
+ type: "keyword",
+ value: "flex-start",
+ },
+ },
+ {
+ property: "display",
+ value: {
+ type: "keyword",
+ value: "flex",
+ },
+ },
+ ],
+ "w-embed-youtubevideo": [
+ {
+ property: "backgroundImage",
+ value: {
+ type: "layers",
+ value: [
+ {
+ type: "image",
+ value: {
+ type: "url",
+ url: "https://d3e54v103j8qbb.cloudfront.net/static/youtube-placeholder.2b05e7d68d.svg",
+ },
+ },
+ ],
+ },
+ },
+ {
+ property: "backgroundPosition",
+ value: {
+ type: "layers",
+ value: [
+ {
+ type: "unit",
+ unit: "%",
+ value: 50,
+ },
+ ],
+ },
+ },
+ {
+ property: "backgroundSize",
+ value: {
+ type: "layers",
+ value: [
+ {
+ type: "keyword",
+ value: "cover",
+ },
+ ],
+ },
+ },
+ {
+ property: "width",
+ value: {
+ type: "unit",
+ unit: "%",
+ value: 100,
+ },
+ },
+ {
+ property: "paddingBottom",
+ value: {
+ type: "unit",
+ unit: "number",
+ value: 0,
+ },
+ },
+ {
+ property: "paddingLeft",
+ value: {
+ type: "unit",
+ unit: "number",
+ value: 0,
+ },
+ },
+ {
+ property: "paddingRight",
+ value: {
+ type: "unit",
+ unit: "number",
+ value: 0,
+ },
+ },
+ {
+ property: "position",
+ value: {
+ type: "keyword",
+ value: "relative",
+ },
+ },
+ {
+ property: "minHeight",
+ value: {
+ type: "unit",
+ unit: "px",
+ value: 75,
+ },
+ state: ":empty",
+ },
+ {
+ property: "paddingBottom",
+ value: {
+ type: "unit",
+ unit: "%",
+ value: 56.25,
+ },
+ state: ":empty",
+ },
+ ],
"w-checkbox": [
{
property: "marginBottom",
@@ -12806,31 +13370,53 @@ export const styles = {
{
property: "backgroundImage",
value: {
- type: "unparsed",
- value:
- "url(https://d3e54v103j8qbb.cloudfront.net/static/custom-checkbox-checkmark.589d534424.svg)",
+ type: "layers",
+ value: [
+ {
+ type: "image",
+ value: {
+ type: "url",
+ url: "https://d3e54v103j8qbb.cloudfront.net/static/custom-checkbox-checkmark.589d534424.svg",
+ },
+ },
+ ],
},
},
{
property: "backgroundPosition",
value: {
- type: "unit",
- unit: "%",
- value: 50,
+ type: "layers",
+ value: [
+ {
+ type: "unit",
+ unit: "%",
+ value: 50,
+ },
+ ],
},
},
{
property: "backgroundRepeat",
value: {
- type: "keyword",
- value: "no-repeat",
+ type: "layers",
+ value: [
+ {
+ type: "keyword",
+ value: "no-repeat",
+ },
+ ],
},
},
{
property: "backgroundSize",
value: {
- type: "keyword",
- value: "cover",
+ type: "layers",
+ value: [
+ {
+ type: "keyword",
+ value: "cover",
+ },
+ ],
},
},
{
@@ -12876,8 +13462,41 @@ export const styles = {
{
property: "boxShadow",
value: {
- type: "unparsed",
- value: "0 0 3px 1px #3898ec",
+ type: "layers",
+ value: [
+ {
+ type: "tuple",
+ value: [
+ {
+ type: "unit",
+ value: 0,
+ unit: "number",
+ },
+ {
+ type: "unit",
+ value: 0,
+ unit: "number",
+ },
+ {
+ type: "unit",
+ value: 3,
+ unit: "px",
+ },
+ {
+ type: "unit",
+ value: 1,
+ unit: "px",
+ },
+ {
+ type: "rgb",
+ alpha: 1,
+ r: 56,
+ g: 152,
+ b: 236,
+ },
+ ],
+ },
+ ],
},
},
],
@@ -12895,31 +13514,53 @@ export const styles = {
{
property: "backgroundImage",
value: {
- type: "unparsed",
- value:
- "url(https://d3e54v103j8qbb.cloudfront.net/static/custom-checkbox-checkmark.589d534424.svg)",
+ type: "layers",
+ value: [
+ {
+ type: "image",
+ value: {
+ type: "url",
+ url: "https://d3e54v103j8qbb.cloudfront.net/static/custom-checkbox-checkmark.589d534424.svg",
+ },
+ },
+ ],
},
},
{
property: "backgroundPosition",
value: {
- type: "unit",
- unit: "%",
- value: 50,
+ type: "layers",
+ value: [
+ {
+ type: "unit",
+ unit: "%",
+ value: 50,
+ },
+ ],
},
},
{
property: "backgroundRepeat",
value: {
- type: "keyword",
- value: "no-repeat",
+ type: "layers",
+ value: [
+ {
+ type: "keyword",
+ value: "no-repeat",
+ },
+ ],
},
},
{
property: "backgroundSize",
value: {
- type: "keyword",
- value: "cover",
+ type: "layers",
+ value: [
+ {
+ type: "keyword",
+ value: "cover",
+ },
+ ],
},
},
{
@@ -12999,8 +13640,41 @@ export const styles = {
{
property: "boxShadow",
value: {
- type: "unparsed",
- value: "0 0 3px 1px #3898ec",
+ type: "layers",
+ value: [
+ {
+ type: "tuple",
+ value: [
+ {
+ type: "unit",
+ value: 0,
+ unit: "number",
+ },
+ {
+ type: "unit",
+ value: 0,
+ unit: "number",
+ },
+ {
+ type: "unit",
+ value: 3,
+ unit: "px",
+ },
+ {
+ type: "unit",
+ value: 1,
+ unit: "px",
+ },
+ {
+ type: "rgb",
+ alpha: 1,
+ r: 56,
+ g: 152,
+ b: 236,
+ },
+ ],
+ },
+ ],
},
},
],
@@ -13076,8 +13750,41 @@ export const styles = {
{
property: "boxShadow",
value: {
- type: "unparsed",
- value: "0 0 3px 1px #3898ec",
+ type: "layers",
+ value: [
+ {
+ type: "tuple",
+ value: [
+ {
+ type: "unit",
+ value: 0,
+ unit: "number",
+ },
+ {
+ type: "unit",
+ value: 0,
+ unit: "number",
+ },
+ {
+ type: "unit",
+ value: 3,
+ unit: "px",
+ },
+ {
+ type: "unit",
+ value: 1,
+ unit: "px",
+ },
+ {
+ type: "rgb",
+ alpha: 1,
+ r: 56,
+ g: 152,
+ b: 236,
+ },
+ ],
+ },
+ ],
},
},
{
@@ -13153,5 +13860,257 @@ export const styles = {
},
},
],
+ "w-form-formrecaptcha": [
+ {
+ property: "marginBottom",
+ value: {
+ type: "unit",
+ unit: "px",
+ value: 8,
+ },
+ },
+ ],
+ "w-backgroundvideo-backgroundvideoplaypausebutton": [
+ {
+ property: "outlineOffset",
+ value: {
+ type: "unit",
+ unit: "px",
+ value: 2,
+ },
+ state: ":focus-visible",
+ },
+ {
+ property: "borderTopLeftRadius",
+ value: {
+ type: "unit",
+ unit: "%",
+ value: 50,
+ },
+ state: ":focus-visible",
+ },
+ {
+ property: "borderTopRightRadius",
+ value: {
+ type: "unit",
+ unit: "%",
+ value: 50,
+ },
+ state: ":focus-visible",
+ },
+ {
+ property: "borderBottomRightRadius",
+ value: {
+ type: "unit",
+ unit: "%",
+ value: 50,
+ },
+ state: ":focus-visible",
+ },
+ {
+ property: "outlineWidth",
+ value: {
+ type: "unit",
+ unit: "px",
+ value: 2,
+ },
+ state: ":focus-visible",
+ },
+ {
+ property: "outlineStyle",
+ value: {
+ type: "keyword",
+ value: "solid",
+ },
+ state: ":focus-visible",
+ },
+ {
+ property: "outlineColor",
+ value: {
+ type: "rgb",
+ alpha: 1,
+ r: 59,
+ g: 121,
+ b: 195,
+ },
+ state: ":focus-visible",
+ },
+ ],
+ "w-layout-grid": [
+ {
+ property: "rowGap",
+ value: {
+ type: "unit",
+ unit: "px",
+ value: 16,
+ },
+ },
+ {
+ property: "columnGap",
+ value: {
+ type: "unit",
+ unit: "px",
+ value: 16,
+ },
+ },
+ {
+ property: "gridTemplateRows",
+ value: {
+ type: "tuple",
+ value: [
+ {
+ type: "keyword",
+ value: "auto",
+ },
+ {
+ type: "keyword",
+ value: "auto",
+ },
+ ],
+ },
+ },
+ {
+ property: "gridTemplateColumns",
+ value: {
+ type: "tuple",
+ value: [
+ {
+ type: "unit",
+ unit: "fr",
+ value: 1,
+ },
+ {
+ type: "unit",
+ unit: "fr",
+ value: 1,
+ },
+ ],
+ },
+ },
+ {
+ property: "gridAutoColumns",
+ value: {
+ type: "unit",
+ unit: "fr",
+ value: 1,
+ },
+ },
+ {
+ property: "display",
+ value: {
+ type: "keyword",
+ value: "grid",
+ },
+ },
+ ],
+ "utility-page-wrap": [
+ {
+ property: "justifyContent",
+ value: {
+ type: "keyword",
+ value: "center",
+ },
+ },
+ {
+ property: "alignItems",
+ value: {
+ type: "keyword",
+ value: "center",
+ },
+ },
+ {
+ property: "width",
+ value: {
+ type: "unit",
+ unit: "vw",
+ value: 100,
+ },
+ },
+ {
+ property: "maxWidth",
+ value: {
+ type: "unit",
+ unit: "%",
+ value: 100,
+ },
+ },
+ {
+ property: "height",
+ value: {
+ type: "unit",
+ unit: "vh",
+ value: 100,
+ },
+ },
+ {
+ property: "maxHeight",
+ value: {
+ type: "unit",
+ unit: "%",
+ value: 100,
+ },
+ },
+ {
+ property: "display",
+ value: {
+ type: "keyword",
+ value: "flex",
+ },
+ },
+ ],
+ "utility-page-content": [
+ {
+ property: "textAlign",
+ value: {
+ type: "keyword",
+ value: "center",
+ },
+ },
+ {
+ property: "flexDirection",
+ value: {
+ type: "keyword",
+ value: "column",
+ },
+ },
+ {
+ property: "width",
+ value: {
+ type: "unit",
+ unit: "px",
+ value: 260,
+ },
+ },
+ {
+ property: "display",
+ value: {
+ type: "keyword",
+ value: "flex",
+ },
+ },
+ ],
+ "utility-page-form": [
+ {
+ property: "flexDirection",
+ value: {
+ type: "keyword",
+ value: "column",
+ },
+ },
+ {
+ property: "alignItems",
+ value: {
+ type: "keyword",
+ value: "stretch",
+ },
+ },
+ {
+ property: "display",
+ value: {
+ type: "keyword",
+ value: "flex",
+ },
+ },
+ ],
};
export type Styles = typeof styles;
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.ts
index 93a5a33e9a..764c1854d6 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
@@ -107,9 +107,24 @@ const toFragment = (
}
case "Link": {
const data = wfNode.data;
-
- addProp("href", data.link.url);
- addProp("target", data.link.target);
+ if ("url" in data.link) {
+ addProp("href", data.link.url);
+ }
+ if ("target" in data.link) {
+ addProp("target", data.link.target);
+ }
+ if ("href" in data.link) {
+ addProp("href", data.link.href);
+ }
+ if ("email" in data.link) {
+ const subject = data.link.subject
+ ? `?subject=${data.link.subject}`
+ : "";
+ addProp("href", `mailto:${data.link.email}${subject}`);
+ }
+ if ("tel" in data.link) {
+ addProp("href", `tel:${data.link.tel}`);
+ }
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.tsx
index 3f01fa21f0..e30e96f8d9 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
@@ -134,6 +134,19 @@ test("Heading", async () => {
});
equalFragment(fragment, <$.Heading tag="h1">Turtle in the sea</$.Heading>);
+ expect(toCss(fragment)).toMatchInlineSnapshot(`
+ "@media all {
+ h1 {
+ margin-right: 0;
+ margin-left: 0;
+ margin-bottom: 10px;
+ font-weight: bold;
+ margin-top: 20px;
+ font-size: 38px;
+ line-height: 44px
+ }
+ }"
+ `);
});
test("Link Block, Button, Text Link", async () => {
@@ -164,6 +177,19 @@ test("Link Block, Button, Text Link", async () => {
fragment,
<$.Link href="https://webstudio.is" target="_blank" />
);
+ expect(toCss(fragment)).toMatchInlineSnapshot(`
+ "@media all {
+ a {
+ background-color: rgba(0, 0, 0, 0)
+ }
+ a:active {
+ outline: 0 none currentColor
+ }
+ a:hover {
+ outline: 0 none currentColor
+ }
+ }"
+ `);
});
test("List and ListItem", async () => {
@@ -217,6 +243,16 @@ test("List and ListItem", async () => {
<$.ListItem />
</$.List>
);
+
+ expect(toCss(fragment)).toMatchInlineSnapshot(`
+ "@media all {
+ ul {
+ margin-top: 0;
+ margin-bottom: 10px;
+ padding-left: 40px
+ }
+ }"
+ `);
});
test("Paragraph", async () => {
@@ -243,6 +279,15 @@ test("Paragraph", async () => {
});
equalFragment(fragment, <$.Paragraph>Text in a paragraph</$.Paragraph>);
+
+ expect(toCss(fragment)).toMatchInlineSnapshot(`
+ "@media all {
+ p {
+ margin-top: 0;
+ margin-bottom: 10px
+ }
+ }"
+ `);
});
test("Text", async () => {
@@ -275,6 +320,8 @@ test("Text", async () => {
fragment,
<$.Text>This is some text inside of a div block.</$.Text>
);
+
+ expect(toCss(fragment)).toMatchInlineSnapshot(`""`);
});
test("Blockquote", async () => {
@@ -301,6 +348,23 @@ test("Blockquote", async () => {
});
equalFragment(fragment, <$.Blockquote>Block Quote</$.Blockquote>);
+ expect(toCss(fragment)).toMatchInlineSnapshot(`
+ "@media all {
+ blockquote {
+ margin-top: 0;
+ margin-right: 0;
+ margin-bottom: 10px;
+ margin-left: 0;
+ padding-top: 10px;
+ padding-right: 20px;
+ padding-bottom: 10px;
+ padding-left: 20px;
+ font-size: 18px;
+ line-height: 22px;
+ border-left: 5px solid rgba(226, 226, 226, 1)
+ }
+ }"
+ `);
});
test("Strong", async () => {
@@ -327,6 +391,13 @@ test("Strong", async () => {
});
equalFragment(fragment, <$.Bold>Bold Text</$.Bold>);
+ expect(toCss(fragment)).toMatchInlineSnapshot(`
+ "@media all {
+ strong {
+ font-weight: bold
+ }
+ }"
+ `);
});
test("Emphasized", async () => {
@@ -352,6 +423,7 @@ test("Emphasized", async () => {
},
});
equalFragment(fragment, <$.Italic>Emphasis</$.Italic>);
+ expect(toCss(fragment)).toMatchInlineSnapshot(`""`);
});
test("Superscript", async () => {
@@ -378,6 +450,17 @@ test("Superscript", async () => {
});
equalFragment(fragment, <$.Superscript>Superscript</$.Superscript>);
+ expect(toCss(fragment)).toMatchInlineSnapshot(`
+ "@media all {
+ sup {
+ vertical-align: baseline;
+ font-size: 75%;
+ line-height: 0;
+ position: relative;
+ top: -0.5em
+ }
+ }"
+ `);
});
test("Subscript", async () => {
@@ -404,6 +487,17 @@ test("Subscript", async () => {
});
equalFragment(fragment, <$.Subscript>Subscript</$.Subscript>);
+ expect(toCss(fragment)).toMatchInlineSnapshot(`
+ "@media all {
+ sub {
+ vertical-align: baseline;
+ font-size: 75%;
+ line-height: 0;
+ position: relative;
+ bottom: -0.25em
+ }
+ }"
+ `);
});
test("Section", async () => {
@@ -425,6 +519,13 @@ test("Section", async () => {
});
equalFragment(fragment, <$.Box tag="section" />);
+ expect(toCss(fragment)).toMatchInlineSnapshot(`
+ "@media all {
+ section {
+ display: block
+ }
+ }"
+ `);
});
test("BlockContainer", async () => {
@@ -445,6 +546,38 @@ test("BlockContainer", async () => {
},
});
equalFragment(fragment, <$.Box />);
+ expect(toCss(fragment)).toMatchInlineSnapshot(`
+ "@media all {
+ w-layout-blockcontainer {
+ margin-left: auto;
+ margin-right: auto;
+ display: block;
+ max-width: none
+ }
+ w-container {
+ margin-left: auto;
+ margin-right: auto;
+ max-width: none
+ }
+ w-container:after {
+ content: " ";
+ grid-row-start: 1;
+ grid-column-start: 1;
+ grid-row-end: 2;
+ grid-column-end: 2;
+ display: table;
+ clear: both
+ }
+ w-container:before {
+ content: " ";
+ grid-row-start: 1;
+ grid-column-start: 1;
+ grid-row-end: 2;
+ grid-column-end: 2;
+ display: table
+ }
+ }"
+ `);
});
test("Block", async () => {
@@ -466,6 +599,7 @@ test("Block", async () => {
});
equalFragment(fragment, <$.Box />);
+ expect(toCss(fragment)).toMatchInlineSnapshot(`""`);
});
test("V Flex", async () => {
@@ -486,6 +620,7 @@ test("V Flex", async () => {
},
});
equalFragment(fragment, <$.Box />);
+ expect(toCss(fragment)).toMatchInlineSnapshot(`""`);
});
test("H Flex", async () => {
@@ -506,9 +641,10 @@ test("H Flex", async () => {
},
});
equalFragment(fragment, <$.Box />);
+ expect(toCss(fragment)).toMatchInlineSnapshot(`""`);
});
-test("Quick Stack", async () => {
+test("QuickStack", async () => {
const fragment = await toWebstudioFragment({
type: "@webflow/XscpData",
payload: {
@@ -549,6 +685,26 @@ test("Quick Stack", async () => {
<$.Box />
</$.Box>
);
+ expect(toCss(fragment)).toMatchInlineSnapshot(`
+ "@media all {
+ w-layout-layout {
+ row-gap: 20px;
+ column-gap: 20px;
+ grid-auto-columns: 1fr;
+ justify-content: center;
+ padding: 20px
+ }
+ wf-layout-layout {
+ display: grid
+ }
+ w-layout-cell {
+ flex-direction: column;
+ justify-content: flex-start;
+ align-items: flex-start;
+ display: flex
+ }
+ }"
+ `);
});
test("Grid", async () => {
@@ -570,6 +726,18 @@ test("Grid", async () => {
});
equalFragment(fragment, <$.Box />);
+ expect(toCss(fragment)).toMatchInlineSnapshot(`
+ "@media all {
+ w-layout-grid {
+ row-gap: 16px;
+ column-gap: 16px;
+ grid-template-rows: auto auto;
+ grid-template-columns: 1fr 1fr;
+ grid-auto-columns: 1fr;
+ display: grid
+ }
+ }"
+ `);
});
test("Columns", async () => {
@@ -614,6 +782,41 @@ test("Columns", async () => {
<$.Box />
</$.Box>
);
+ expect(toCss(fragment)).toMatchInlineSnapshot(`
+ "@media all {
+ w-row {
+ margin-left: 0;
+ margin-right: 0
+ }
+ w-row:after {
+ content: " ";
+ grid-row-start: 1;
+ grid-column-start: 1;
+ grid-row-end: 2;
+ grid-column-end: 2;
+ display: table;
+ clear: both
+ }
+ w-row:before {
+ content: " ";
+ grid-row-start: 1;
+ grid-column-start: 1;
+ grid-row-end: 2;
+ grid-column-end: 2;
+ display: table
+ }
+ w-col {
+ float: left;
+ min-height: 1px;
+ padding-left: 10px;
+ padding-right: 10px;
+ position: relative;
+ left: auto;
+ right: auto;
+ width: 100%
+ }
+ }"
+ `);
});
test("Image", async () => {
@@ -652,6 +855,16 @@ test("Image", async () => {
src="https://test.com/image.jpg"
/>
);
+ expect(toCss(fragment)).toMatchInlineSnapshot(`
+ "@media all {
+ img {
+ vertical-align: middle;
+ max-width: 100%;
+ display: inline-block;
+ border: 0 none currentColor
+ }
+ }"
+ `);
});
test("HtmlEmbed", async () => {
@@ -673,6 +886,27 @@ test("HtmlEmbed", async () => {
},
});
equalFragment(fragment, <$.HtmlEmbed code="some html" clientOnly={true} />);
+ expect(toCss(fragment)).toMatchInlineSnapshot(`
+ "@media all {
+ w-embed:after {
+ content: " ";
+ grid-row-start: 1;
+ grid-column-start: 1;
+ grid-row-end: 2;
+ grid-column-end: 2;
+ display: table;
+ clear: both
+ }
+ w-embed:before {
+ content: " ";
+ grid-row-start: 1;
+ grid-column-start: 1;
+ grid-row-end: 2;
+ grid-column-end: 2;
+ display: table
+ }
+ }"
+ `);
});
test("CodeBlock", async () => {
@@ -698,6 +932,16 @@ test("CodeBlock", async () => {
});
equalFragment(fragment, <$.CodeText lang="javascript" code="test" />);
+ expect(toCss(fragment)).toMatchInlineSnapshot(`
+ "@media all {
+ w-code-block {
+ margin-top: unset;
+ margin-right: unset;
+ margin-bottom: unset;
+ margin-left: unset
+ }
+ }"
+ `);
});
test("RichText", async () => {
@@ -1100,6 +1344,107 @@ test("RichText", async () => {
</$.Paragraph>
</$.Box>
);
+ expect(toCss(fragment)).toMatchInlineSnapshot(`
+ "@media all {
+ h1 {
+ margin-right: 0;
+ margin-left: 0;
+ margin-bottom: 10px;
+ font-weight: bold;
+ margin-top: 20px;
+ font-size: 38px;
+ line-height: 44px
+ }
+ h2 {
+ margin-bottom: 10px;
+ font-weight: bold;
+ margin-top: 20px;
+ font-size: 32px;
+ line-height: 36px
+ }
+ h3 {
+ margin-bottom: 10px;
+ font-weight: bold;
+ margin-top: 20px;
+ font-size: 24px;
+ line-height: 30px
+ }
+ h4 {
+ margin-bottom: 10px;
+ font-weight: bold;
+ margin-top: 10px;
+ font-size: 18px;
+ line-height: 24px
+ }
+ h5 {
+ margin-bottom: 10px;
+ font-weight: bold;
+ margin-top: 10px;
+ font-size: 14px;
+ line-height: 20px
+ }
+ h6 {
+ margin-bottom: 10px;
+ font-weight: bold;
+ margin-top: 10px;
+ font-size: 12px;
+ line-height: 18px
+ }
+ p {
+ margin-top: 0;
+ margin-bottom: 10px
+ }
+ blockquote {
+ margin-top: 0;
+ margin-right: 0;
+ margin-bottom: 10px;
+ margin-left: 0;
+ padding-top: 10px;
+ padding-right: 20px;
+ padding-bottom: 10px;
+ padding-left: 20px;
+ font-size: 18px;
+ line-height: 22px;
+ border-left: 5px solid rgba(226, 226, 226, 1)
+ }
+ ol {
+ margin-top: 0;
+ margin-bottom: 10px;
+ padding-left: 40px
+ }
+ ul {
+ margin-top: 0;
+ margin-bottom: 10px;
+ padding-left: 40px
+ }
+ a {
+ background-color: rgba(0, 0, 0, 0)
+ }
+ a:active {
+ outline: 0 none currentColor
+ }
+ a:hover {
+ outline: 0 none currentColor
+ }
+ strong {
+ font-weight: bold
+ }
+ sup {
+ vertical-align: baseline;
+ font-size: 75%;
+ line-height: 0;
+ position: relative;
+ top: -0.5em
+ }
+ sub {
+ vertical-align: baseline;
+ font-size: 75%;
+ line-height: 0;
+ position: relative;
+ bottom: -0.25em
+ }
+ }"
+ `);
});
test("Form", async () => {
@@ -1205,6 +1550,67 @@ test("Form", async () => {
</$.Box>
</$.Box>
);
+ expect(toCss(fragment)).toMatchInlineSnapshot(`
+ "@media all {
+ w-form {
+ margin-top: 0;
+ margin-right: 0;
+ margin-bottom: 15px;
+ margin-left: 0
+ }
+ input {
+ color: inherit;
+ font-style: initial;
+ font-variant-caps: initial;
+ font-weight: initial;
+ font-stretch: initial;
+ font-size: inherit;
+ font-family: unset;
+ cursor: pointer;
+ line-height: normal;
+ box-sizing: border-box;
+ height: auto;
+ appearance: button;
+ border: 0 none currentColor;
+ margin: 0;
+ padding: 0
+ }
+ w-input {
+ color: rgba(51, 51, 51, 1);
+ vertical-align: middle;
+ background-color: rgba(255, 255, 255, 1);
+ width: 100%;
+ margin-bottom: 10px;
+ padding-top: 8px;
+ padding-right: 12px;
+ padding-bottom: 8px;
+ padding-left: 12px;
+ font-size: 14px;
+ line-height: 1.42857;
+ display: block;
+ cursor: not-allowed;
+ height: auto;
+ border: 1px solid rgba(204, 204, 204, 1)
+ }
+ w-input:-moz-placeholder {
+ color: rgba(153, 153, 153, 1)
+ }
+ w-input::-moz-placeholder {
+ color: rgba(153, 153, 153, 1);
+ opacity: 1
+ }
+ w-input::-webkit-input-placeholder {
+ color: rgba(153, 153, 153, 1)
+ }
+ w-input:focus {
+ border-top-color: rgba(56, 152, 236, 1);
+ border-right-color: rgba(56, 152, 236, 1);
+ border-bottom-color: rgba(56, 152, 236, 1);
+ border-left-color: rgba(56, 152, 236, 1);
+ outline: 0 none currentColor
+ }
+ }"
+ `);
});
test("FormButton", async () => {
@@ -1231,6 +1637,46 @@ test("FormButton", async () => {
});
equalFragment(fragment, <$.Button>Submit</$.Button>);
+ expect(toCss(fragment)).toMatchInlineSnapshot(`
+ "@media all {
+ input {
+ color: inherit;
+ font-style: initial;
+ font-variant-caps: initial;
+ font-weight: initial;
+ font-stretch: initial;
+ font-size: inherit;
+ font-family: unset;
+ cursor: pointer;
+ line-height: normal;
+ box-sizing: border-box;
+ height: auto;
+ appearance: button;
+ border: 0 none currentColor;
+ margin: 0;
+ padding: 0
+ }
+ w-button {
+ color: rgba(255, 255, 255, 1);
+ line-height: inherit;
+ cursor: pointer;
+ background-color: rgba(56, 152, 236, 1);
+ border-top-left-radius: 0;
+ border-top-right-radius: 0;
+ border-bottom-right-radius: 0;
+ padding-top: 9px;
+ padding-right: 15px;
+ padding-bottom: 9px;
+ padding-left: 15px;
+ text-decoration-line: none;
+ text-decoration-style: initial;
+ text-decoration-color: initial;
+ display: inline-block;
+ appearance: button;
+ border: 0 none currentColor
+ }
+ }"
+ `);
});
test("FormTextInput", async () => {
@@ -1276,6 +1722,61 @@ test("FormTextInput", async () => {
autoFocus={false}
/>
);
+ expect(toCss(fragment)).toMatchInlineSnapshot(`
+ "@media all {
+ input {
+ color: inherit;
+ font-style: initial;
+ font-variant-caps: initial;
+ font-weight: initial;
+ font-stretch: initial;
+ font-size: inherit;
+ font-family: unset;
+ cursor: pointer;
+ line-height: normal;
+ box-sizing: border-box;
+ height: auto;
+ appearance: button;
+ border: 0 none currentColor;
+ margin: 0;
+ padding: 0
+ }
+ w-input {
+ color: rgba(51, 51, 51, 1);
+ vertical-align: middle;
+ background-color: rgba(255, 255, 255, 1);
+ width: 100%;
+ margin-bottom: 10px;
+ padding-top: 8px;
+ padding-right: 12px;
+ padding-bottom: 8px;
+ padding-left: 12px;
+ font-size: 14px;
+ line-height: 1.42857;
+ display: block;
+ cursor: not-allowed;
+ height: auto;
+ border: 1px solid rgba(204, 204, 204, 1)
+ }
+ w-input:-moz-placeholder {
+ color: rgba(153, 153, 153, 1)
+ }
+ w-input::-moz-placeholder {
+ color: rgba(153, 153, 153, 1);
+ opacity: 1
+ }
+ w-input::-webkit-input-placeholder {
+ color: rgba(153, 153, 153, 1)
+ }
+ w-input:focus {
+ border-top-color: rgba(56, 152, 236, 1);
+ border-right-color: rgba(56, 152, 236, 1);
+ border-bottom-color: rgba(56, 152, 236, 1);
+ border-left-color: rgba(56, 152, 236, 1);
+ outline: 0 none currentColor
+ }
+ }"
+ `);
});
test("FormBlockLabel", async () => {
@@ -1307,6 +1808,15 @@ test("FormBlockLabel", async () => {
});
equalFragment(fragment, <$.Label htmlFor="email">Email Address</$.Label>);
+ expect(toCss(fragment)).toMatchInlineSnapshot(`
+ "@media all {
+ label {
+ margin-bottom: 5px;
+ font-weight: bold;
+ display: block
+ }
+ }"
+ `);
});
test("FormTextarea", async () => {
@@ -1348,6 +1858,59 @@ test("FormTextarea", async () => {
autoFocus={false}
/>
);
+
+ expect(toCss(fragment)).toMatchInlineSnapshot(`
+ "@media all {
+ textarea {
+ color: inherit;
+ font-style: initial;
+ font-variant-caps: initial;
+ font-weight: initial;
+ font-stretch: initial;
+ font-size: inherit;
+ line-height: initial;
+ font-family: unset;
+ overflow-x: auto;
+ overflow-y: auto;
+ height: auto;
+ margin: 0
+ }
+ w-input {
+ color: rgba(51, 51, 51, 1);
+ vertical-align: middle;
+ background-color: rgba(255, 255, 255, 1);
+ width: 100%;
+ margin-bottom: 10px;
+ padding-top: 8px;
+ padding-right: 12px;
+ padding-bottom: 8px;
+ padding-left: 12px;
+ font-size: 14px;
+ line-height: 1.42857;
+ display: block;
+ cursor: not-allowed;
+ height: auto;
+ border: 1px solid rgba(204, 204, 204, 1)
+ }
+ w-input:-moz-placeholder {
+ color: rgba(153, 153, 153, 1)
+ }
+ w-input::-moz-placeholder {
+ color: rgba(153, 153, 153, 1);
+ opacity: 1
+ }
+ w-input::-webkit-input-placeholder {
+ color: rgba(153, 153, 153, 1)
+ }
+ w-input:focus {
+ border-top-color: rgba(56, 152, 236, 1);
+ border-right-color: rgba(56, 152, 236, 1);
+ border-bottom-color: rgba(56, 152, 236, 1);
+ border-left-color: rgba(56, 152, 236, 1);
+ outline: 0 none currentColor
+ }
+ }"
+ `);
});
test("FormBlockLabel", async () => {
@@ -1379,6 +1942,15 @@ test("FormBlockLabel", async () => {
});
equalFragment(fragment, <$.Label htmlFor="email">Email Address</$.Label>);
+ expect(toCss(fragment)).toMatchInlineSnapshot(`
+ "@media all {
+ label {
+ margin-bottom: 5px;
+ font-weight: bold;
+ display: block
+ }
+ }"
+ `);
});
test("FormCheckboxWrapper, FormCheckboxInput, FormInlineLabel", async () => {
@@ -1444,6 +2016,68 @@ test("FormCheckboxWrapper, FormCheckboxInput, FormInlineLabel", async () => {
</$.Text>
</$.Label>
);
+ expect(toCss(fragment)).toMatchInlineSnapshot(`
+ "@media all {
+ w-checkbox {
+ margin-bottom: 5px;
+ padding-left: 20px;
+ display: block
+ }
+ w-checkbox:after {
+ content: " ";
+ clear: both;
+ grid-row-start: 1;
+ grid-column-start: 1;
+ grid-row-end: 2;
+ grid-column-end: 2;
+ display: table
+ }
+ w-checkbox:before {
+ content: " ";
+ grid-row-start: 1;
+ grid-column-start: 1;
+ grid-row-end: 2;
+ grid-column-end: 2;
+ display: table
+ }
+ input {
+ color: inherit;
+ font-style: initial;
+ font-variant-caps: initial;
+ font-weight: initial;
+ font-stretch: initial;
+ font-size: inherit;
+ font-family: unset;
+ cursor: pointer;
+ line-height: normal;
+ box-sizing: border-box;
+ height: auto;
+ appearance: button;
+ border: 0 none currentColor;
+ margin: 0;
+ padding: 0
+ }
+ w-checkbox-input {
+ float: left;
+ margin-top: 4px;
+ margin-right: 0;
+ margin-bottom: 0;
+ margin-left: -20px;
+ line-height: normal
+ }
+ label {
+ margin-bottom: 5px;
+ font-weight: bold;
+ display: block
+ }
+ w-form-label {
+ cursor: pointer;
+ margin-bottom: 0;
+ font-weight: normal;
+ display: inline-block
+ }
+ }"
+ `);
});
test("FormRadioWrapper, FormRadioInput, FormInlineLabel", async () => {
@@ -1504,6 +2138,68 @@ test("FormRadioWrapper, FormRadioInput, FormInlineLabel", async () => {
</$.Text>
</$.Label>
);
+ expect(toCss(fragment)).toMatchInlineSnapshot(`
+ "@media all {
+ w-radio {
+ margin-bottom: 5px;
+ padding-left: 20px;
+ display: block
+ }
+ w-radio:after {
+ content: " ";
+ grid-row-start: 1;
+ grid-column-start: 1;
+ grid-row-end: 2;
+ grid-column-end: 2;
+ display: table;
+ clear: both
+ }
+ w-radio:before {
+ content: " ";
+ grid-row-start: 1;
+ grid-column-start: 1;
+ grid-row-end: 2;
+ grid-column-end: 2;
+ display: table
+ }
+ input {
+ color: inherit;
+ font-style: initial;
+ font-variant-caps: initial;
+ font-weight: initial;
+ font-stretch: initial;
+ font-size: inherit;
+ font-family: unset;
+ cursor: pointer;
+ line-height: normal;
+ box-sizing: border-box;
+ height: auto;
+ appearance: button;
+ border: 0 none currentColor;
+ margin: 0;
+ padding: 0
+ }
+ w-radio-input {
+ float: left;
+ margin-top: 3px;
+ margin-right: 0;
+ margin-bottom: 0;
+ margin-left: -20px;
+ line-height: normal
+ }
+ label {
+ margin-bottom: 5px;
+ font-weight: bold;
+ display: block
+ }
+ w-form-label {
+ cursor: pointer;
+ margin-bottom: 0;
+ font-weight: normal;
+ display: inline-block
+ }
+ }"
+ `);
});
test("FormSelect", async () => {
@@ -1556,6 +2252,22 @@ test("FormSelect", async () => {
fragment,
<$.Input id="field-3" name="field-3" required={false} multiple={false} />
);
+ expect(toCss(fragment)).toMatchInlineSnapshot(`
+ "@media all {
+ select {
+ color: inherit;
+ font-style: initial;
+ font-variant-caps: initial;
+ font-weight: initial;
+ font-stretch: initial;
+ font-size: inherit;
+ line-height: initial;
+ font-family: unset;
+ text-transform: none;
+ margin: 0
+ }
+ }"
+ `);
});
test("Multiline text", async () => {
@@ -1605,6 +2317,8 @@ test("Multiline text", async () => {
{"b"}
</$.Box>
);
+
+ expect(toCss(fragment)).toMatchInlineSnapshot(`""`);
});
describe("Custom attributes", () => {
@@ -1634,6 +2348,19 @@ describe("Custom attributes", () => {
},
});
equalFragment(fragment, <$.Heading tag="h1" at="b" />);
+ expect(toCss(fragment)).toMatchInlineSnapshot(`
+ "@media all {
+ h1 {
+ margin-right: 0;
+ margin-left: 0;
+ margin-bottom: 10px;
+ font-weight: bold;
+ margin-top: 20px;
+ font-size: 38px;
+ line-height: 44px
+ }
+ }"
+ `);
});
});
@@ -2143,7 +2870,6 @@ test("background images", async () => {
const bgStyle = fragment.styles.find(
(style) => style.property === "backgroundImage"
);
- //
expect(bgStyle).not.toBeNull();
expect(bgStyle?.value.type).toEqual("layers");
@@ -2167,4 +2893,17 @@ test("background images", async () => {
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-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
+ }
+ }"
+ `);
});
diff --git a/apps/builder/app/shared/copy-paste/plugin-webflow/schema.ts b/apps/builder/app/shared/copy-paste/plugin-webflow/schema.ts
index 254c006730..ee03bdc97c 100644
--- a/apps/builder/app/shared/copy-paste/plugin-webflow/schema.ts
+++ b/apps/builder/app/shared/copy-paste/plugin-webflow/schema.ts
@@ -83,10 +83,26 @@ const WfElementNode = z.union([
attr: Attr.optional(),
block: z.enum(["inline", "block", ""]).optional(),
button: z.boolean().optional(),
- link: z.object({
- url: z.string(),
- target: z.string().optional(),
- }),
+ link: z.union([
+ // External link
+ z.object({
+ url: z.string(),
+ target: z.string().optional(),
+ }),
+ // Page link and section link
+ z.object({
+ href: z.string(),
+ }),
+ // Email link
+ z.object({
+ email: z.string(),
+ subject: z.string().optional(),
+ }),
+ // Phone link
+ z.object({
+ tel: z.string(),
+ }),
+ ]),
}),
}),
WfBaseNode.extend({ type: z.enum(["Paragraph"]) }),
diff --git a/apps/builder/app/shared/copy-paste/plugin-webflow/style-presets.css b/apps/builder/app/shared/copy-paste/plugin-webflow/style-presets.css
index a6603672a7..81bce2d2e3 100644
--- a/apps/builder/app/shared/copy-paste/plugin-webflow/style-presets.css
+++ b/apps/builder/app/shared/copy-paste/plugin-webflow/style-presets.css
@@ -2226,6 +2226,56 @@ textarea.w-select {
left: 0;
}
+.w-layout-blockcontainer {
+ max-width: 940px;
+ margin-left: auto;
+ margin-right: auto;
+ display: block;
+}
+
+.w-layout-layout {
+ grid-row-gap: 20px;
+ grid-column-gap: 20px;
+ grid-auto-columns: 1fr;
+ justify-content: center;
+ padding: 20px;
+}
+
+.w-layout-cell {
+ flex-direction: column;
+ justify-content: flex-start;
+ align-items: flex-start;
+ display: flex;
+}
+
+.w-layout-vflex {
+ flex-direction: column;
+ align-items: flex-start;
+ display: flex;
+}
+
+.w-layout-hflex {
+ flex-direction: row;
+ align-items: flex-start;
+ display: flex;
+}
+
+.w-embed-youtubevideo {
+ background-image: url("https://d3e54v103j8qbb.cloudfront.net/static/youtube-placeholder.2b05e7d68d.svg");
+ background-position: 50%;
+ background-size: cover;
+ width: 100%;
+ padding-bottom: 0;
+ padding-left: 0;
+ padding-right: 0;
+ position: relative;
+}
+
+.w-embed-youtubevideo:empty {
+ min-height: 75px;
+ padding-bottom: 56.25%;
+}
+
.w-checkbox {
margin-bottom: 5px;
padding-left: 20px;
@@ -2286,3 +2336,57 @@ textarea.w-select {
border-width: 4px;
border-color: #3898ec;
}
+
+.w-form-formrecaptcha {
+ margin-bottom: 8px;
+}
+
+.w-backgroundvideo-backgroundvideoplaypausebutton:focus-visible {
+ outline-offset: 2px;
+ border-radius: 50%;
+ outline: 2px solid #3b79c3;
+}
+
+.w-layout-grid {
+ grid-row-gap: 16px;
+ grid-column-gap: 16px;
+ grid-template-rows: auto auto;
+ grid-template-columns: 1fr 1fr;
+ grid-auto-columns: 1fr;
+ display: grid;
+}
+
+@media screen and (max-width: 991px) {
+ .w-layout-blockcontainer {
+ max-width: 728px;
+ }
+}
+
+@media screen and (max-width: 767px) {
+ .w-layout-blockcontainer {
+ max-width: none;
+ }
+}
+
+.utility-page-wrap {
+ justify-content: center;
+ align-items: center;
+ width: 100vw;
+ max-width: 100%;
+ height: 100vh;
+ max-height: 100%;
+ display: flex;
+}
+
+.utility-page-content {
+ text-align: center;
+ flex-direction: column;
+ width: 260px;
+ display: flex;
+}
+
+.utility-page-form {
+ flex-direction: column;
+ align-items: stretch;
+ display: flex;
+}
diff --git a/apps/builder/app/shared/copy-paste/plugin-webflow/styles.ts b/apps/builder/app/shared/copy-paste/plugin-webflow/styles.ts
index d65b3dbcb6..04722a7683 100644
--- a/apps/builder/app/shared/copy-paste/plugin-webflow/styles.ts
+++ b/apps/builder/app/shared/copy-paste/plugin-webflow/styles.ts
@@ -266,6 +266,7 @@ const mapComponentAndPresetStyles = (
return presetStyles;
}
case "BlockContainer": {
+ presetStyles.push("w-layout-blockcontainer");
presetStyles.push("w-container");
return presetStyles;
}
@@ -273,10 +274,24 @@ const mapComponentAndPresetStyles = (
presetStyles.push("w-row");
return presetStyles;
}
+ case "Cell": {
+ presetStyles.push("w-layout-cell");
+ return presetStyles;
+ }
case "Column": {
+ // @todo wf has w-col-1 etc in grid
presetStyles.push("w-col");
return presetStyles;
}
+ case "Grid": {
+ presetStyles.push("w-layout-grid");
+ return presetStyles;
+ }
+ case "Layout": {
+ presetStyles.push("w-layout-layout");
+ presetStyles.push("wf-layout-layout");
+ return presetStyles;
+ }
case "FormWrapper": {
presetStyles.push("w-form");
return presetStyles;
diff --git a/packages/css-data/src/parse-css.test.ts b/packages/css-data/src/parse-css.test.ts
index 0a10c48baf..d2a8c37f31 100644
--- a/packages/css-data/src/parse-css.test.ts
+++ b/packages/css-data/src/parse-css.test.ts
@@ -487,18 +487,18 @@ describe("Parse CSS", () => {
// @todo parser is wrong here, it should be keyword horizontal
expect(parseCss(`a { -webkit-box-orient: horizontal; }`))
.toMatchInlineSnapshot(`
-{
- "a": [
- {
- "property": "-webkit-box-orient",
- "value": {
- "type": "keyword",
- "value": "horizontal",
- },
- },
- ],
-}
-`);
+ {
+ "a": [
+ {
+ "property": "-webkit-box-orient",
+ "value": {
+ "type": "keyword",
+ "value": "horizontal",
+ },
+ },
+ ],
+ }
+ `);
});
test("parse child combinator", () => {