webstudio 0.0.0-bd48788 → 0.0.0-bdb8a58

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/README.md +1 -7
  2. package/lib/cli.js +628 -535
  3. package/package.json +19 -20
  4. package/templates/defaults/app/route-templates/html.tsx +3 -3
  5. package/templates/defaults/app/route-templates/xml.tsx +0 -4
  6. package/templates/defaults/package.json +8 -8
  7. package/templates/react-router/app/route-templates/html.tsx +3 -3
  8. package/templates/react-router/package.json +11 -11
  9. package/templates/react-router-docker/package.json +3 -3
  10. package/templates/react-router-netlify/package.json +1 -1
  11. package/templates/{vercel → react-router-vercel}/app/constants.mjs +1 -1
  12. package/templates/react-router-vercel/package.json +9 -0
  13. package/templates/react-router-vercel/react-router.config.ts +6 -0
  14. package/templates/{vercel → react-router-vercel}/vercel.json +1 -0
  15. package/templates/ssg/app/route-templates/html/+Head.tsx +5 -5
  16. package/templates/ssg/package.json +7 -7
  17. package/templates/netlify-edge-functions/app/constants.mjs +0 -29
  18. package/templates/netlify-edge-functions/app/entry.server.tsx +0 -21
  19. package/templates/netlify-edge-functions/netlify.toml +0 -16
  20. package/templates/netlify-edge-functions/package.json +0 -9
  21. package/templates/netlify-edge-functions/vite.config.ts +0 -18
  22. package/templates/netlify-functions/app/constants.mjs +0 -29
  23. package/templates/netlify-functions/app/entry.server.tsx +0 -1
  24. package/templates/netlify-functions/netlify.toml +0 -16
  25. package/templates/netlify-functions/package.json +0 -9
  26. package/templates/netlify-functions/vite.config.ts +0 -18
  27. package/templates/vercel/.vercelignore +0 -8
  28. package/templates/vercel/package.json +0 -1
package/lib/cli.js CHANGED
@@ -71,11 +71,6 @@ const jsonToGlobalConfig = (json) => {
71
71
  return zGlobalConfig.parse(json);
72
72
  };
73
73
  const PROJECT_TEMPLATES = [
74
- {
75
- value: "vanilla",
76
- label: "Vanilla",
77
- expand: ["defaults"]
78
- },
79
74
  {
80
75
  value: "docker",
81
76
  label: "Docker",
@@ -84,23 +79,13 @@ const PROJECT_TEMPLATES = [
84
79
  {
85
80
  value: "vercel",
86
81
  label: "Vercel",
87
- expand: ["defaults", "vercel"]
82
+ expand: ["react-router", "react-router-vercel"]
88
83
  },
89
84
  {
90
85
  value: "netlify",
91
86
  label: "Netlify",
92
87
  expand: ["react-router", "react-router-netlify"]
93
88
  },
94
- {
95
- value: "netlify-functions",
96
- label: "Netlify Functions",
97
- expand: ["defaults", "netlify-functions"]
98
- },
99
- {
100
- value: "netlify-edge-functions",
101
- label: "Netlify Edge Functions",
102
- expand: ["defaults", "netlify-edge-functions"]
103
- },
104
89
  {
105
90
  value: "ssg",
106
91
  label: "Static Site Generation (SSG)"
@@ -719,18 +704,48 @@ const getFontFaces = (assets, options) => {
719
704
  }
720
705
  return Array.from(faces.values());
721
706
  };
722
- const addGlobalRules = (sheet, { assets, assetBaseUrl }) => {
723
- const fontAssets = [];
724
- for (const asset of assets.values()) {
725
- if (asset.type === "font") {
726
- fontAssets.push(asset);
727
- }
728
- }
729
- const fontFaces = getFontFaces(fontAssets, { assetBaseUrl });
730
- for (const fontFace of fontFaces) {
731
- sheet.addFontFaceRule(fontFace);
732
- }
733
- };
707
+ const TextChild = z.object({
708
+ type: z.literal("text"),
709
+ value: z.string(),
710
+ placeholder: z.boolean().optional()
711
+ });
712
+ const InstanceId = z.string();
713
+ const IdChild = z.object({
714
+ type: z.literal("id"),
715
+ value: InstanceId
716
+ });
717
+ const ExpressionChild = z.object({
718
+ type: z.literal("expression"),
719
+ value: z.string()
720
+ });
721
+ const InstanceChild = z.union([IdChild, TextChild, ExpressionChild]);
722
+ const Instance = z.object({
723
+ type: z.literal("instance"),
724
+ id: InstanceId,
725
+ component: z.string(),
726
+ label: z.string().optional(),
727
+ children: z.array(InstanceChild)
728
+ });
729
+ z.map(InstanceId, Instance);
730
+ const MatcherRelation = z.union([
731
+ z.literal("ancestor"),
732
+ z.literal("parent"),
733
+ z.literal("self"),
734
+ z.literal("child"),
735
+ z.literal("descendant")
736
+ ]);
737
+ const MatcherOperation = z.object({
738
+ $eq: z.string().optional(),
739
+ $neq: z.string().optional(),
740
+ $in: z.array(z.string()).optional(),
741
+ $nin: z.array(z.string()).optional()
742
+ });
743
+ const Matcher = z.object({
744
+ relation: MatcherRelation,
745
+ component: MatcherOperation.optional(),
746
+ tag: MatcherOperation.optional()
747
+ });
748
+ const Matchers = z.union([Matcher, z.array(Matcher)]);
734
749
  const prefixStyles = (styleMap) => {
735
750
  const newStyleMap = /* @__PURE__ */ new Map();
736
751
  for (const [property, value] of styleMap) {
@@ -746,19 +761,13 @@ const prefixStyles = (styleMap) => {
746
761
  if (property === "backdrop-filter") {
747
762
  newStyleMap.set("-webkit-backdrop-filter", value);
748
763
  }
764
+ if (property === "view-timeline-name" || property === "scroll-timeline-name" || property === "view-timeline-inset") {
765
+ newStyleMap.set(`--${property}`, value);
766
+ }
749
767
  newStyleMap.set(property, value);
750
768
  }
751
769
  return newStyleMap;
752
770
  };
753
- const captureError = (error, value) => {
754
- if (process.env.NODE_ENV === "development") {
755
- throw error;
756
- }
757
- setTimeout(() => {
758
- throw error;
759
- });
760
- return value;
761
- };
762
771
  const fallbackTransform = (styleValue) => {
763
772
  var _a;
764
773
  if (styleValue.type !== "fontFamily") {
@@ -850,7 +859,7 @@ const toValue = (styleValue, transformValue) => {
850
859
  if (value.type === "guaranteedInvalid") {
851
860
  return "";
852
861
  }
853
- return captureError(new Error("Unknown value type"), value);
862
+ return "";
854
863
  };
855
864
  const Unit = z.string();
856
865
  const UnitValue = z.object({
@@ -1097,7 +1106,10 @@ const mergeStyles = (styleMap) => {
1097
1106
  mergeBackgroundPosition(newStyle);
1098
1107
  return newStyle;
1099
1108
  };
1100
- const hyphenateProperty = (property) => property.replace(/[A-Z]/g, (match) => "-" + match.toLowerCase());
1109
+ const hyphenateProperty = (property) => property.replace(
1110
+ /[A-Z]/g,
1111
+ (match) => "-" + match.toLowerCase()
1112
+ );
1101
1113
  const mapGroupBy = (array, getKey2) => {
1102
1114
  const groups = /* @__PURE__ */ new Map();
1103
1115
  for (const item of array) {
@@ -1135,11 +1147,10 @@ const mergeDeclarations = (declarations) => {
1135
1147
  }
1136
1148
  return newDeclarations;
1137
1149
  };
1138
- const generateStyleMap = ({
1139
- style,
1150
+ const generateStyleMap = (style, {
1140
1151
  indent = 0,
1141
1152
  transformValue
1142
- }) => {
1153
+ } = {}) => {
1143
1154
  const spaces = " ".repeat(indent);
1144
1155
  let lines = "";
1145
1156
  for (const [property, value] of style) {
@@ -1272,8 +1283,7 @@ class NestingRule {
1272
1283
  const generated = Array.from(styleBySelector).sort(
1273
1284
  ([leftSelector], [rightSelector]) => leftSelector.localeCompare(rightSelector)
1274
1285
  ).map(([selector, style]) => {
1275
- const content = generateStyleMap({
1276
- style: prefixStyles(style),
1286
+ const content = generateStyleMap(prefixStyles(style), {
1277
1287
  indent: indent + 2,
1278
1288
  transformValue
1279
1289
  });
@@ -1634,48 +1644,6 @@ const generateAtomic = (sheet, options) => {
1634
1644
  });
1635
1645
  return { cssText, classes };
1636
1646
  };
1637
- const TextChild = z.object({
1638
- type: z.literal("text"),
1639
- value: z.string(),
1640
- placeholder: z.boolean().optional()
1641
- });
1642
- const InstanceId = z.string();
1643
- const IdChild = z.object({
1644
- type: z.literal("id"),
1645
- value: InstanceId
1646
- });
1647
- const ExpressionChild = z.object({
1648
- type: z.literal("expression"),
1649
- value: z.string()
1650
- });
1651
- const InstanceChild = z.union([IdChild, TextChild, ExpressionChild]);
1652
- const Instance = z.object({
1653
- type: z.literal("instance"),
1654
- id: InstanceId,
1655
- component: z.string(),
1656
- label: z.string().optional(),
1657
- children: z.array(InstanceChild)
1658
- });
1659
- z.map(InstanceId, Instance);
1660
- const MatcherRelation = z.union([
1661
- z.literal("ancestor"),
1662
- z.literal("parent"),
1663
- z.literal("self"),
1664
- z.literal("child"),
1665
- z.literal("descendant")
1666
- ]);
1667
- const MatcherOperation = z.object({
1668
- $eq: z.string().optional(),
1669
- $neq: z.string().optional(),
1670
- $in: z.array(z.string()).optional(),
1671
- $nin: z.array(z.string()).optional()
1672
- });
1673
- const Matcher = z.object({
1674
- relation: MatcherRelation,
1675
- component: MatcherOperation.optional(),
1676
- tag: MatcherOperation.optional()
1677
- });
1678
- const Matchers = z.union([Matcher, z.array(Matcher)]);
1679
1647
  const common = {
1680
1648
  label: z.string().optional(),
1681
1649
  description: z.string().optional(),
@@ -1811,6 +1779,12 @@ const TextContent = z.object({
1811
1779
  type: z.literal("string"),
1812
1780
  defaultValue: z.string().optional()
1813
1781
  });
1782
+ const AnimationAction = z.object({
1783
+ ...common,
1784
+ control: z.literal("animationAction"),
1785
+ type: z.literal("animationAction"),
1786
+ defaultValue: z.undefined().optional()
1787
+ });
1814
1788
  const PropMeta = z.union([
1815
1789
  Number,
1816
1790
  Range,
@@ -1830,7 +1804,8 @@ const PropMeta = z.union([
1830
1804
  Json,
1831
1805
  Date,
1832
1806
  Action,
1833
- TextContent
1807
+ TextContent,
1808
+ AnimationAction
1834
1809
  ]);
1835
1810
  const EmbedTemplateText = z.object({
1836
1811
  type: z.literal("text"),
@@ -1917,6 +1892,12 @@ const WsEmbedTemplate = z.lazy(
1917
1892
  z.union([EmbedTemplateInstance, EmbedTemplateText, EmbedTemplateExpression])
1918
1893
  )
1919
1894
  );
1895
+ const PresetStyleDecl = z.object({
1896
+ // State selector, e.g. :hover
1897
+ state: z.optional(z.string()),
1898
+ property: z.string(),
1899
+ value: StyleValue
1900
+ });
1920
1901
  z.object({
1921
1902
  props: z.record(PropMeta),
1922
1903
  // Props that will be always visible in properties panel.
@@ -1954,6 +1935,11 @@ z.object({
1954
1935
  // embed - images, videos or other embeddable components, without children
1955
1936
  // rich-text-child - formatted text fragment, not listed in components list
1956
1937
  type: z.enum(["container", "control", "embed", "rich-text-child"]),
1938
+ /**
1939
+ * a property used as textual placeholder when no content specified while in builder
1940
+ * also signals to not insert components inside unless dropped explicitly
1941
+ */
1942
+ placeholder: z.string().optional(),
1957
1943
  constraints: Matchers.optional(),
1958
1944
  // when this field is specified component receives
1959
1945
  // prop with index of same components withiin specified ancestor
@@ -1963,9 +1949,7 @@ z.object({
1963
1949
  label: z.optional(z.string()),
1964
1950
  description: z.string().optional(),
1965
1951
  icon: z.string(),
1966
- presetStyle: z.optional(
1967
- z.record(z.string(), z.array(EmbedTemplateStyleDecl))
1968
- ),
1952
+ presetStyle: z.optional(z.record(z.string(), z.array(PresetStyleDecl))),
1969
1953
  states: z.optional(z.array(ComponentState)),
1970
1954
  template: z.optional(WsEmbedTemplate),
1971
1955
  order: z.number().optional()
@@ -2027,21 +2011,24 @@ const WindowTitleIcon = `<svg xmlns="http://www.w3.org/2000/svg" fill="none" vie
2027
2011
  const XmlIcon = `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16" width="100%" height="100%" style="display: block;"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M12.163 9.02v-4L8.83 1.686h-5.5A1.333 1.333 0 0 0 1.997 3.02v6"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M8.164 2.186v1.667a1.333 1.333 0 0 0 1.333 1.333h2.667M1.997 11.314l3 3M4.997 11.314l-3 3M6.997 14.314v-3l1.5 1.523 1.5-1.523v3M12.163 11.314v3h1.84"/></svg>`;
2028
2012
  const YoutubeIcon = `<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 16 16" width="100%" height="100%" style="display: block;"><path d="M.892 11.528a18.047 18.047 0 0 1 0-7.482A1.496 1.496 0 0 1 1.94 3a37.082 37.082 0 0 1 12.12 0 1.497 1.497 0 0 1 1.048 1.047 18.046 18.046 0 0 1 0 7.482 1.497 1.497 0 0 1-1.048 1.048 37.077 37.077 0 0 1-12.12 0 1.497 1.497 0 0 1-1.048-1.048Z"/><path d="m6.5 10.3 4-2.4-4-2.4v4.8Z"/></svg>`;
2029
2013
  const div = [
2030
- { property: "boxSizing", value: { type: "keyword", value: "border-box" } },
2031
- { property: "borderTopWidth", value: { type: "unit", unit: "px", value: 1 } },
2014
+ { property: "box-sizing", value: { type: "keyword", value: "border-box" } },
2032
2015
  {
2033
- property: "borderRightWidth",
2016
+ property: "border-top-width",
2034
2017
  value: { type: "unit", unit: "px", value: 1 }
2035
2018
  },
2036
2019
  {
2037
- property: "borderBottomWidth",
2020
+ property: "border-right-width",
2038
2021
  value: { type: "unit", unit: "px", value: 1 }
2039
2022
  },
2040
2023
  {
2041
- property: "borderLeftWidth",
2024
+ property: "border-bottom-width",
2042
2025
  value: { type: "unit", unit: "px", value: 1 }
2043
2026
  },
2044
- { property: "outlineWidth", value: { type: "unit", unit: "px", value: 1 } }
2027
+ {
2028
+ property: "border-left-width",
2029
+ value: { type: "unit", unit: "px", value: 1 }
2030
+ },
2031
+ { property: "outline-width", value: { type: "unit", unit: "px", value: 1 } }
2045
2032
  ];
2046
2033
  const address = div;
2047
2034
  const article = div;
@@ -2071,88 +2058,100 @@ const p = div;
2071
2058
  const span = div;
2072
2059
  const html = [
2073
2060
  { property: "display", value: { type: "keyword", value: "grid" } },
2074
- { property: "minHeight", value: { type: "unit", unit: "%", value: 100 } },
2061
+ { property: "min-height", value: { type: "unit", unit: "%", value: 100 } },
2075
2062
  {
2076
- property: "fontFamily",
2063
+ property: "font-family",
2077
2064
  value: { type: "fontFamily", value: ["Arial", "Roboto", "sans-serif"] }
2078
2065
  },
2079
- { property: "fontSize", value: { type: "unit", unit: "px", value: 16 } },
2066
+ { property: "font-size", value: { type: "unit", unit: "px", value: 16 } },
2080
2067
  {
2081
- property: "lineHeight",
2068
+ property: "line-height",
2082
2069
  value: { type: "unit", unit: "number", value: 1.2 }
2083
2070
  },
2084
2071
  {
2085
- property: "whiteSpaceCollapse",
2072
+ property: "white-space-collapse",
2086
2073
  value: { type: "keyword", value: "preserve" }
2087
2074
  }
2088
2075
  ];
2089
2076
  const body = [
2090
- { property: "marginTop", value: { type: "unit", unit: "number", value: 0 } },
2077
+ { property: "margin-top", value: { type: "unit", unit: "number", value: 0 } },
2091
2078
  {
2092
- property: "marginRight",
2079
+ property: "margin-right",
2093
2080
  value: { type: "unit", unit: "number", value: 0 }
2094
2081
  },
2095
2082
  {
2096
- property: "marginBottom",
2083
+ property: "margin-bottom",
2097
2084
  value: { type: "unit", unit: "number", value: 0 }
2098
2085
  },
2099
- { property: "marginLeft", value: { type: "unit", unit: "number", value: 0 } },
2100
- { property: "boxSizing", value: { type: "keyword", value: "border-box" } },
2101
- { property: "borderTopWidth", value: { type: "unit", unit: "px", value: 1 } },
2102
2086
  {
2103
- property: "borderRightWidth",
2087
+ property: "margin-left",
2088
+ value: { type: "unit", unit: "number", value: 0 }
2089
+ },
2090
+ { property: "box-sizing", value: { type: "keyword", value: "border-box" } },
2091
+ {
2092
+ property: "border-top-width",
2104
2093
  value: { type: "unit", unit: "px", value: 1 }
2105
2094
  },
2106
2095
  {
2107
- property: "borderBottomWidth",
2096
+ property: "border-right-width",
2108
2097
  value: { type: "unit", unit: "px", value: 1 }
2109
2098
  },
2110
2099
  {
2111
- property: "borderLeftWidth",
2100
+ property: "border-bottom-width",
2101
+ value: { type: "unit", unit: "px", value: 1 }
2102
+ },
2103
+ {
2104
+ property: "border-left-width",
2112
2105
  value: { type: "unit", unit: "px", value: 1 }
2113
2106
  }
2114
2107
  ];
2115
2108
  const hr = [
2116
2109
  { property: "height", value: { type: "unit", unit: "number", value: 0 } },
2117
2110
  { property: "color", value: { type: "keyword", value: "inherit" } },
2118
- { property: "boxSizing", value: { type: "keyword", value: "border-box" } },
2119
- { property: "borderTopWidth", value: { type: "unit", unit: "px", value: 1 } },
2111
+ { property: "box-sizing", value: { type: "keyword", value: "border-box" } },
2112
+ {
2113
+ property: "border-top-width",
2114
+ value: { type: "unit", unit: "px", value: 1 }
2115
+ },
2120
2116
  {
2121
- property: "borderRightWidth",
2117
+ property: "border-right-width",
2122
2118
  value: { type: "unit", unit: "px", value: 1 }
2123
2119
  },
2124
2120
  {
2125
- property: "borderBottomWidth",
2121
+ property: "border-bottom-width",
2126
2122
  value: { type: "unit", unit: "px", value: 1 }
2127
2123
  },
2128
2124
  {
2129
- property: "borderLeftWidth",
2125
+ property: "border-left-width",
2130
2126
  value: { type: "unit", unit: "px", value: 1 }
2131
2127
  }
2132
2128
  ];
2133
2129
  const b = [
2134
2130
  {
2135
- property: "fontWeight",
2131
+ property: "font-weight",
2136
2132
  value: { type: "unit", unit: "number", value: 700 }
2137
2133
  },
2138
- { property: "boxSizing", value: { type: "keyword", value: "border-box" } },
2139
- { property: "borderTopWidth", value: { type: "unit", unit: "px", value: 1 } },
2134
+ { property: "box-sizing", value: { type: "keyword", value: "border-box" } },
2135
+ {
2136
+ property: "border-top-width",
2137
+ value: { type: "unit", unit: "px", value: 1 }
2138
+ },
2140
2139
  {
2141
- property: "borderRightWidth",
2140
+ property: "border-right-width",
2142
2141
  value: { type: "unit", unit: "px", value: 1 }
2143
2142
  },
2144
2143
  {
2145
- property: "borderBottomWidth",
2144
+ property: "border-bottom-width",
2146
2145
  value: { type: "unit", unit: "px", value: 1 }
2147
2146
  },
2148
2147
  {
2149
- property: "borderLeftWidth",
2148
+ property: "border-left-width",
2150
2149
  value: { type: "unit", unit: "px", value: 1 }
2151
2150
  }
2152
2151
  ];
2153
2152
  const code = [
2154
2153
  {
2155
- property: "fontFamily",
2154
+ property: "font-family",
2156
2155
  value: {
2157
2156
  type: "fontFamily",
2158
2157
  value: [
@@ -2165,174 +2164,222 @@ const code = [
2165
2164
  ]
2166
2165
  }
2167
2166
  },
2168
- { property: "fontSize", value: { type: "unit", unit: "em", value: 1 } },
2169
- { property: "boxSizing", value: { type: "keyword", value: "border-box" } },
2170
- { property: "borderTopWidth", value: { type: "unit", unit: "px", value: 1 } },
2167
+ { property: "font-size", value: { type: "unit", unit: "em", value: 1 } },
2168
+ { property: "box-sizing", value: { type: "keyword", value: "border-box" } },
2169
+ {
2170
+ property: "border-top-width",
2171
+ value: { type: "unit", unit: "px", value: 1 }
2172
+ },
2171
2173
  {
2172
- property: "borderRightWidth",
2174
+ property: "border-right-width",
2173
2175
  value: { type: "unit", unit: "px", value: 1 }
2174
2176
  },
2175
2177
  {
2176
- property: "borderBottomWidth",
2178
+ property: "border-bottom-width",
2177
2179
  value: { type: "unit", unit: "px", value: 1 }
2178
2180
  },
2179
2181
  {
2180
- property: "borderLeftWidth",
2182
+ property: "border-left-width",
2181
2183
  value: { type: "unit", unit: "px", value: 1 }
2182
2184
  }
2183
2185
  ];
2184
2186
  const sub = [
2185
- { property: "fontSize", value: { type: "unit", unit: "%", value: 75 } },
2186
- { property: "lineHeight", value: { type: "unit", unit: "number", value: 0 } },
2187
+ { property: "font-size", value: { type: "unit", unit: "%", value: 75 } },
2188
+ {
2189
+ property: "line-height",
2190
+ value: { type: "unit", unit: "number", value: 0 }
2191
+ },
2187
2192
  { property: "position", value: { type: "keyword", value: "relative" } },
2188
- { property: "verticalAlign", value: { type: "keyword", value: "baseline" } },
2189
- { property: "boxSizing", value: { type: "keyword", value: "border-box" } },
2190
- { property: "borderTopWidth", value: { type: "unit", unit: "px", value: 1 } },
2193
+ { property: "vertical-align", value: { type: "keyword", value: "baseline" } },
2194
+ { property: "box-sizing", value: { type: "keyword", value: "border-box" } },
2191
2195
  {
2192
- property: "borderRightWidth",
2196
+ property: "border-top-width",
2193
2197
  value: { type: "unit", unit: "px", value: 1 }
2194
2198
  },
2195
2199
  {
2196
- property: "borderBottomWidth",
2200
+ property: "border-right-width",
2197
2201
  value: { type: "unit", unit: "px", value: 1 }
2198
2202
  },
2199
2203
  {
2200
- property: "borderLeftWidth",
2204
+ property: "border-bottom-width",
2205
+ value: { type: "unit", unit: "px", value: 1 }
2206
+ },
2207
+ {
2208
+ property: "border-left-width",
2201
2209
  value: { type: "unit", unit: "px", value: 1 }
2202
2210
  },
2203
2211
  { property: "bottom", value: { type: "unit", unit: "em", value: -0.25 } }
2204
2212
  ];
2205
2213
  const sup = [
2206
- { property: "fontSize", value: { type: "unit", unit: "%", value: 75 } },
2207
- { property: "lineHeight", value: { type: "unit", unit: "number", value: 0 } },
2214
+ { property: "font-size", value: { type: "unit", unit: "%", value: 75 } },
2215
+ {
2216
+ property: "line-height",
2217
+ value: { type: "unit", unit: "number", value: 0 }
2218
+ },
2208
2219
  { property: "position", value: { type: "keyword", value: "relative" } },
2209
- { property: "verticalAlign", value: { type: "keyword", value: "baseline" } },
2210
- { property: "boxSizing", value: { type: "keyword", value: "border-box" } },
2211
- { property: "borderTopWidth", value: { type: "unit", unit: "px", value: 1 } },
2220
+ { property: "vertical-align", value: { type: "keyword", value: "baseline" } },
2221
+ { property: "box-sizing", value: { type: "keyword", value: "border-box" } },
2212
2222
  {
2213
- property: "borderRightWidth",
2223
+ property: "border-top-width",
2214
2224
  value: { type: "unit", unit: "px", value: 1 }
2215
2225
  },
2216
2226
  {
2217
- property: "borderBottomWidth",
2227
+ property: "border-right-width",
2218
2228
  value: { type: "unit", unit: "px", value: 1 }
2219
2229
  },
2220
2230
  {
2221
- property: "borderLeftWidth",
2231
+ property: "border-bottom-width",
2232
+ value: { type: "unit", unit: "px", value: 1 }
2233
+ },
2234
+ {
2235
+ property: "border-left-width",
2222
2236
  value: { type: "unit", unit: "px", value: 1 }
2223
2237
  },
2224
2238
  { property: "top", value: { type: "unit", unit: "em", value: -0.5 } }
2225
2239
  ];
2226
2240
  const input = [
2227
- { property: "fontFamily", value: { type: "keyword", value: "inherit" } },
2228
- { property: "fontSize", value: { type: "unit", unit: "%", value: 100 } },
2241
+ { property: "font-family", value: { type: "keyword", value: "inherit" } },
2242
+ { property: "font-size", value: { type: "unit", unit: "%", value: 100 } },
2229
2243
  {
2230
- property: "lineHeight",
2244
+ property: "line-height",
2231
2245
  value: { type: "unit", unit: "number", value: 1.15 }
2232
2246
  },
2233
- { property: "marginTop", value: { type: "unit", unit: "number", value: 0 } },
2247
+ { property: "margin-top", value: { type: "unit", unit: "number", value: 0 } },
2234
2248
  {
2235
- property: "marginRight",
2249
+ property: "margin-right",
2236
2250
  value: { type: "unit", unit: "number", value: 0 }
2237
2251
  },
2238
2252
  {
2239
- property: "marginBottom",
2253
+ property: "margin-bottom",
2240
2254
  value: { type: "unit", unit: "number", value: 0 }
2241
2255
  },
2242
- { property: "marginLeft", value: { type: "unit", unit: "number", value: 0 } },
2243
- { property: "boxSizing", value: { type: "keyword", value: "border-box" } },
2244
- { property: "borderTopWidth", value: { type: "unit", unit: "px", value: 1 } },
2245
2256
  {
2246
- property: "borderRightWidth",
2257
+ property: "margin-left",
2258
+ value: { type: "unit", unit: "number", value: 0 }
2259
+ },
2260
+ { property: "box-sizing", value: { type: "keyword", value: "border-box" } },
2261
+ {
2262
+ property: "border-top-width",
2247
2263
  value: { type: "unit", unit: "px", value: 1 }
2248
2264
  },
2249
2265
  {
2250
- property: "borderBottomWidth",
2266
+ property: "border-right-width",
2251
2267
  value: { type: "unit", unit: "px", value: 1 }
2252
2268
  },
2253
2269
  {
2254
- property: "borderLeftWidth",
2270
+ property: "border-bottom-width",
2255
2271
  value: { type: "unit", unit: "px", value: 1 }
2256
2272
  },
2257
- { property: "borderTopStyle", value: { type: "keyword", value: "solid" } },
2258
- { property: "borderRightStyle", value: { type: "keyword", value: "solid" } },
2259
- { property: "borderBottomStyle", value: { type: "keyword", value: "solid" } },
2260
- { property: "borderLeftStyle", value: { type: "keyword", value: "solid" } }
2273
+ {
2274
+ property: "border-left-width",
2275
+ value: { type: "unit", unit: "px", value: 1 }
2276
+ },
2277
+ { property: "border-top-style", value: { type: "keyword", value: "solid" } },
2278
+ {
2279
+ property: "border-right-style",
2280
+ value: { type: "keyword", value: "solid" }
2281
+ },
2282
+ {
2283
+ property: "border-bottom-style",
2284
+ value: { type: "keyword", value: "solid" }
2285
+ },
2286
+ { property: "border-left-style", value: { type: "keyword", value: "solid" } }
2261
2287
  ];
2262
2288
  const textarea = input;
2263
2289
  const radio = [
2264
- { property: "fontFamily", value: { type: "keyword", value: "inherit" } },
2265
- { property: "fontSize", value: { type: "unit", unit: "%", value: 100 } },
2290
+ { property: "font-family", value: { type: "keyword", value: "inherit" } },
2291
+ { property: "font-size", value: { type: "unit", unit: "%", value: 100 } },
2266
2292
  {
2267
- property: "lineHeight",
2293
+ property: "line-height",
2268
2294
  value: { type: "unit", unit: "number", value: 1.15 }
2269
2295
  },
2270
- { property: "marginTop", value: { type: "unit", unit: "number", value: 0 } },
2296
+ { property: "margin-top", value: { type: "unit", unit: "number", value: 0 } },
2271
2297
  {
2272
- property: "marginRight",
2298
+ property: "margin-right",
2273
2299
  value: { type: "unit", unit: "number", value: 0 }
2274
2300
  },
2275
2301
  {
2276
- property: "marginBottom",
2302
+ property: "margin-bottom",
2277
2303
  value: { type: "unit", unit: "number", value: 0 }
2278
2304
  },
2279
- { property: "marginLeft", value: { type: "unit", unit: "number", value: 0 } },
2280
- { property: "boxSizing", value: { type: "keyword", value: "border-box" } },
2281
- { property: "borderTopWidth", value: { type: "unit", unit: "px", value: 1 } },
2282
2305
  {
2283
- property: "borderRightWidth",
2306
+ property: "margin-left",
2307
+ value: { type: "unit", unit: "number", value: 0 }
2308
+ },
2309
+ { property: "box-sizing", value: { type: "keyword", value: "border-box" } },
2310
+ {
2311
+ property: "border-top-width",
2284
2312
  value: { type: "unit", unit: "px", value: 1 }
2285
2313
  },
2286
2314
  {
2287
- property: "borderBottomWidth",
2315
+ property: "border-right-width",
2288
2316
  value: { type: "unit", unit: "px", value: 1 }
2289
2317
  },
2290
2318
  {
2291
- property: "borderLeftWidth",
2319
+ property: "border-bottom-width",
2292
2320
  value: { type: "unit", unit: "px", value: 1 }
2293
2321
  },
2294
- { property: "borderTopStyle", value: { type: "keyword", value: "none" } },
2295
- { property: "borderRightStyle", value: { type: "keyword", value: "none" } },
2296
- { property: "borderBottomStyle", value: { type: "keyword", value: "none" } },
2297
- { property: "borderLeftStyle", value: { type: "keyword", value: "none" } }
2322
+ {
2323
+ property: "border-left-width",
2324
+ value: { type: "unit", unit: "px", value: 1 }
2325
+ },
2326
+ { property: "border-top-style", value: { type: "keyword", value: "none" } },
2327
+ { property: "border-right-style", value: { type: "keyword", value: "none" } },
2328
+ {
2329
+ property: "border-bottom-style",
2330
+ value: { type: "keyword", value: "none" }
2331
+ },
2332
+ { property: "border-left-style", value: { type: "keyword", value: "none" } }
2298
2333
  ];
2299
2334
  const checkbox = radio;
2300
2335
  const button = [
2301
- { property: "fontFamily", value: { type: "keyword", value: "inherit" } },
2302
- { property: "fontSize", value: { type: "unit", unit: "%", value: 100 } },
2336
+ { property: "font-family", value: { type: "keyword", value: "inherit" } },
2337
+ { property: "font-size", value: { type: "unit", unit: "%", value: 100 } },
2303
2338
  {
2304
- property: "lineHeight",
2339
+ property: "line-height",
2305
2340
  value: { type: "unit", unit: "number", value: 1.15 }
2306
2341
  },
2307
- { property: "marginTop", value: { type: "unit", unit: "number", value: 0 } },
2342
+ { property: "margin-top", value: { type: "unit", unit: "number", value: 0 } },
2343
+ {
2344
+ property: "margin-right",
2345
+ value: { type: "unit", unit: "number", value: 0 }
2346
+ },
2308
2347
  {
2309
- property: "marginRight",
2348
+ property: "margin-bottom",
2310
2349
  value: { type: "unit", unit: "number", value: 0 }
2311
2350
  },
2312
2351
  {
2313
- property: "marginBottom",
2352
+ property: "margin-left",
2314
2353
  value: { type: "unit", unit: "number", value: 0 }
2315
2354
  },
2316
- { property: "marginLeft", value: { type: "unit", unit: "number", value: 0 } },
2317
- { property: "boxSizing", value: { type: "keyword", value: "border-box" } },
2318
- { property: "borderTopWidth", value: { type: "unit", unit: "px", value: 1 } },
2355
+ { property: "box-sizing", value: { type: "keyword", value: "border-box" } },
2356
+ {
2357
+ property: "border-top-width",
2358
+ value: { type: "unit", unit: "px", value: 1 }
2359
+ },
2319
2360
  {
2320
- property: "borderRightWidth",
2361
+ property: "border-right-width",
2321
2362
  value: { type: "unit", unit: "px", value: 1 }
2322
2363
  },
2323
2364
  {
2324
- property: "borderBottomWidth",
2365
+ property: "border-bottom-width",
2325
2366
  value: { type: "unit", unit: "px", value: 1 }
2326
2367
  },
2327
2368
  {
2328
- property: "borderLeftWidth",
2369
+ property: "border-left-width",
2329
2370
  value: { type: "unit", unit: "px", value: 1 }
2330
2371
  },
2331
- { property: "borderTopStyle", value: { type: "keyword", value: "solid" } },
2332
- { property: "borderRightStyle", value: { type: "keyword", value: "solid" } },
2333
- { property: "borderBottomStyle", value: { type: "keyword", value: "solid" } },
2334
- { property: "borderLeftStyle", value: { type: "keyword", value: "solid" } },
2335
- { property: "textTransform", value: { type: "keyword", value: "none" } }
2372
+ { property: "border-top-style", value: { type: "keyword", value: "solid" } },
2373
+ {
2374
+ property: "border-right-style",
2375
+ value: { type: "keyword", value: "solid" }
2376
+ },
2377
+ {
2378
+ property: "border-bottom-style",
2379
+ value: { type: "keyword", value: "solid" }
2380
+ },
2381
+ { property: "border-left-style", value: { type: "keyword", value: "solid" } },
2382
+ { property: "text-transform", value: { type: "keyword", value: "none" } }
2336
2383
  ];
2337
2384
  const select = button;
2338
2385
  const rootComponent = "ws:root";
@@ -2429,6 +2476,58 @@ const parseComponentName = (componentName) => {
2429
2476
  }
2430
2477
  return [namespace, name2];
2431
2478
  };
2479
+ const getIndexesWithinAncestors = (metas, instances, rootIds) => {
2480
+ const ancestors = /* @__PURE__ */ new Set();
2481
+ for (const meta2 of metas.values()) {
2482
+ if (meta2.indexWithinAncestor !== void 0) {
2483
+ ancestors.add(meta2.indexWithinAncestor);
2484
+ }
2485
+ }
2486
+ const indexes = /* @__PURE__ */ new Map();
2487
+ const traverseInstances2 = (instances2, instanceId, latestIndexes2 = /* @__PURE__ */ new Map()) => {
2488
+ const instance = instances2.get(instanceId);
2489
+ if (instance === void 0) {
2490
+ return;
2491
+ }
2492
+ const meta2 = metas.get(instance.component);
2493
+ if (ancestors.has(instance.component)) {
2494
+ latestIndexes2 = new Map(latestIndexes2);
2495
+ latestIndexes2.set(instance.component, /* @__PURE__ */ new Map());
2496
+ }
2497
+ if (instance.component === blockTemplateComponent) {
2498
+ latestIndexes2 = new Map(latestIndexes2);
2499
+ for (const key of latestIndexes2.keys()) {
2500
+ latestIndexes2.set(key, /* @__PURE__ */ new Map());
2501
+ }
2502
+ }
2503
+ if ((meta2 == null ? void 0 : meta2.indexWithinAncestor) !== void 0) {
2504
+ const ancestorIndexes = latestIndexes2.get(meta2.indexWithinAncestor);
2505
+ if (ancestorIndexes) {
2506
+ let index = ancestorIndexes.get(instance.component) ?? -1;
2507
+ index += 1;
2508
+ ancestorIndexes.set(instance.component, index);
2509
+ indexes.set(instance.id, index);
2510
+ }
2511
+ }
2512
+ for (const child of instance.children) {
2513
+ if (child.type === "id") {
2514
+ traverseInstances2(instances2, child.value, latestIndexes2);
2515
+ }
2516
+ }
2517
+ };
2518
+ const latestIndexes = /* @__PURE__ */ new Map();
2519
+ for (const instanceId of rootIds) {
2520
+ traverseInstances2(instances, instanceId, latestIndexes);
2521
+ }
2522
+ return indexes;
2523
+ };
2524
+ const SYSTEM_VARIABLE_ID = ":system";
2525
+ const systemParameter = {
2526
+ id: SYSTEM_VARIABLE_ID,
2527
+ scopeInstanceId: ROOT_INSTANCE_ID,
2528
+ type: "parameter",
2529
+ name: "system"
2530
+ };
2432
2531
  const transpileExpression = ({
2433
2532
  expression,
2434
2533
  executable = false,
@@ -2478,7 +2577,10 @@ const transpileExpression = ({
2478
2577
  return expression;
2479
2578
  };
2480
2579
  const dataSourceVariablePrefix = "$ws$dataSource$";
2481
- const decodeDataSourceVariable = (name2) => {
2580
+ const decodeDataVariableId = (name2) => {
2581
+ if (name2 === "$ws$system") {
2582
+ return SYSTEM_VARIABLE_ID;
2583
+ }
2482
2584
  if (name2.startsWith(dataSourceVariablePrefix)) {
2483
2585
  const encoded = name2.slice(dataSourceVariablePrefix.length);
2484
2586
  return encoded.replaceAll("__DASH__", "-");
@@ -2495,8 +2597,11 @@ const generateExpression = ({
2495
2597
  expression,
2496
2598
  executable: true,
2497
2599
  replaceVariable: (identifier) => {
2498
- const depId = decodeDataSourceVariable(identifier);
2499
- const dep = depId ? dataSources.get(depId) : void 0;
2600
+ const depId = decodeDataVariableId(identifier);
2601
+ let dep = depId ? dataSources.get(depId) : void 0;
2602
+ if (depId === SYSTEM_VARIABLE_ID) {
2603
+ dep = systemParameter;
2604
+ }
2500
2605
  if (dep) {
2501
2606
  usedDataSources == null ? void 0 : usedDataSources.set(dep.id, dep);
2502
2607
  return scope.getName(dep.id, dep.name);
@@ -2666,12 +2771,11 @@ const generateResources = ({
2666
2771
  `;
2667
2772
  }
2668
2773
  if (dataSource.type === "parameter") {
2669
- if (dataSource.id !== page.systemDataSourceId) {
2670
- continue;
2671
- }
2672
- const name2 = scope.getName(dataSource.id, dataSource.name);
2673
- generatedVariables += ` const ${name2} = _props.system
2774
+ if (dataSource.id === page.systemDataSourceId || dataSource.id === SYSTEM_VARIABLE_ID) {
2775
+ const name2 = scope.getName(dataSource.id, dataSource.name);
2776
+ generatedVariables += ` const ${name2} = _props.system
2674
2777
  `;
2778
+ }
2675
2779
  }
2676
2780
  }
2677
2781
  let generated = "";
@@ -2868,7 +2972,7 @@ const generatePageMeta = ({
2868
2972
  continue;
2869
2973
  }
2870
2974
  if (dataSource.type === "parameter") {
2871
- if (dataSource.id === page.systemDataSourceId) {
2975
+ if (dataSource.id === page.systemDataSourceId || dataSource.id === SYSTEM_VARIABLE_ID) {
2872
2976
  const valueName = localScope.getName(dataSource.id, dataSource.name);
2873
2977
  generated += ` let ${valueName} = system
2874
2978
  `;
@@ -2912,6 +3016,22 @@ const generatePageMeta = ({
2912
3016
  `;
2913
3017
  return generated;
2914
3018
  };
3019
+ const addFontRules = ({
3020
+ sheet,
3021
+ assets,
3022
+ assetBaseUrl
3023
+ }) => {
3024
+ const fontAssets = [];
3025
+ for (const asset of assets.values()) {
3026
+ if (asset.type === "font") {
3027
+ fontAssets.push(asset);
3028
+ }
3029
+ }
3030
+ const fontFaces = getFontFaces(fontAssets, { assetBaseUrl });
3031
+ for (const fontFace of fontFaces) {
3032
+ sheet.addFontFaceRule(fontFace);
3033
+ }
3034
+ };
2915
3035
  const createImageValueTransformer = (assets, { assetBaseUrl }) => (styleValue) => {
2916
3036
  if (styleValue.type === "image" && styleValue.value.type === "asset") {
2917
3037
  const asset = assets.get(styleValue.value.value);
@@ -2941,10 +3061,11 @@ const generateCss = ({
2941
3061
  assetBaseUrl,
2942
3062
  atomic
2943
3063
  }) => {
2944
- const globalSheet = createRegularStyleSheet({ name: "ssr" });
2945
- const sheet = createRegularStyleSheet({ name: "ssr" });
2946
- addGlobalRules(globalSheet, { assets, assetBaseUrl });
2947
- globalSheet.addMediaRule("presets");
3064
+ const fontSheet = createRegularStyleSheet({ name: "ssr" });
3065
+ const presetSheet = createRegularStyleSheet({ name: "ssr" });
3066
+ const userSheet = createRegularStyleSheet({ name: "ssr" });
3067
+ addFontRules({ sheet: fontSheet, assets, assetBaseUrl });
3068
+ presetSheet.addMediaRule("presets");
2948
3069
  const presetClasses = /* @__PURE__ */ new Map();
2949
3070
  const scope = createScope([], normalizeClassName, "-");
2950
3071
  for (const [component, meta2] of componentMetas) {
@@ -2955,8 +3076,8 @@ const generateCss = ({
2955
3076
  presetClasses.set(component, className);
2956
3077
  }
2957
3078
  for (const [tag, styles2] of presetStyle2) {
2958
- const selector = component === rootComponent ? ":root" : `:where(${tag}.${className})`;
2959
- const rule = globalSheet.addNestingRule(selector);
3079
+ const selector = component === rootComponent ? ":root" : `${tag}.${className}`;
3080
+ const rule = presetSheet.addNestingRule(selector);
2960
3081
  for (const declaration of styles2) {
2961
3082
  rule.setDeclaration({
2962
3083
  breakpoint: "presets",
@@ -2968,14 +3089,14 @@ const generateCss = ({
2968
3089
  }
2969
3090
  }
2970
3091
  for (const breakpoint of breakpoints.values()) {
2971
- sheet.addMediaRule(breakpoint.id, breakpoint);
3092
+ userSheet.addMediaRule(breakpoint.id, breakpoint);
2972
3093
  }
2973
3094
  const imageValueTransformer = createImageValueTransformer(assets, {
2974
3095
  assetBaseUrl
2975
3096
  });
2976
- sheet.setTransformer(imageValueTransformer);
3097
+ userSheet.setTransformer(imageValueTransformer);
2977
3098
  for (const styleDecl of styles.values()) {
2978
- const rule = sheet.addMixinRule(styleDecl.styleSourceId);
3099
+ const rule = userSheet.addMixinRule(styleDecl.styleSourceId);
2979
3100
  rule.setDeclaration({
2980
3101
  breakpoint: styleDecl.breakpointId,
2981
3102
  selector: styleDecl.state ?? "",
@@ -3007,7 +3128,7 @@ const generateCss = ({
3007
3128
  let { instanceId } = selection;
3008
3129
  const { values } = selection;
3009
3130
  if (instanceId === ROOT_INSTANCE_ID) {
3010
- const rule2 = sheet.addNestingRule(`:root`);
3131
+ const rule2 = userSheet.addNestingRule(`:root`);
3011
3132
  rule2.applyMixins(values);
3012
3133
  continue;
3013
3134
  }
@@ -3036,22 +3157,30 @@ const generateCss = ({
3036
3157
  }
3037
3158
  classList.push(className);
3038
3159
  }
3039
- const rule = sheet.addNestingRule(`.${className}`, descendantSuffix);
3160
+ const rule = userSheet.addNestingRule(`.${className}`, descendantSuffix);
3040
3161
  rule.applyMixins(values);
3041
3162
  instanceByRule.set(rule, instanceId);
3042
3163
  }
3164
+ const fontCss = fontSheet.cssText;
3165
+ const presetCss = presetSheet.cssText.replaceAll(
3166
+ "@media all ",
3167
+ "@layer presets "
3168
+ );
3043
3169
  if (atomic) {
3044
- const { cssText } = generateAtomic(sheet, {
3170
+ const { cssText } = generateAtomic(userSheet, {
3045
3171
  getKey: (rule) => instanceByRule.get(rule),
3046
3172
  transformValue: imageValueTransformer,
3047
3173
  classes
3048
3174
  });
3049
- return { cssText: `${globalSheet.cssText}
3050
- ${cssText}`, classes };
3175
+ return {
3176
+ cssText: `${fontCss}${presetCss}
3177
+ ${cssText}`,
3178
+ classes
3179
+ };
3051
3180
  }
3052
3181
  return {
3053
- cssText: `${globalSheet.cssText}
3054
- ${sheet.cssText}`,
3182
+ cssText: `${fontCss}${presetCss}
3183
+ ${userSheet.cssText}`,
3055
3184
  classes
3056
3185
  };
3057
3186
  };
@@ -3236,48 +3365,6 @@ const namespaceMeta = (meta2, namespace, components) => {
3236
3365
  }
3237
3366
  return newMeta;
3238
3367
  };
3239
- const getIndexesWithinAncestors = (metas, instances, rootIds) => {
3240
- const ancestors = /* @__PURE__ */ new Set();
3241
- for (const meta2 of metas.values()) {
3242
- if (meta2.indexWithinAncestor !== void 0) {
3243
- ancestors.add(meta2.indexWithinAncestor);
3244
- }
3245
- }
3246
- const indexes = /* @__PURE__ */ new Map();
3247
- const traverseInstances2 = (instances2, instanceId, latestIndexes2 = /* @__PURE__ */ new Map()) => {
3248
- const instance = instances2.get(instanceId);
3249
- if (instance === void 0) {
3250
- return;
3251
- }
3252
- const meta2 = metas.get(instance.component);
3253
- if (meta2 === void 0) {
3254
- return;
3255
- }
3256
- if (ancestors.has(instance.component)) {
3257
- latestIndexes2 = new Map(latestIndexes2);
3258
- latestIndexes2.set(instance.component, /* @__PURE__ */ new Map());
3259
- }
3260
- if (meta2.indexWithinAncestor !== void 0) {
3261
- const ancestorIndexes = latestIndexes2.get(meta2.indexWithinAncestor);
3262
- if (ancestorIndexes !== void 0) {
3263
- let index = ancestorIndexes.get(instance.component) ?? -1;
3264
- index += 1;
3265
- ancestorIndexes.set(instance.component, index);
3266
- indexes.set(instance.id, index);
3267
- }
3268
- }
3269
- for (const child of instance.children) {
3270
- if (child.type === "id") {
3271
- traverseInstances2(instances2, child.value, latestIndexes2);
3272
- }
3273
- }
3274
- };
3275
- const latestIndexes = /* @__PURE__ */ new Map();
3276
- for (const instanceId of rootIds) {
3277
- traverseInstances2(instances, instanceId, latestIndexes);
3278
- }
3279
- return indexes;
3280
- };
3281
3368
  const generateAction = ({
3282
3369
  scope,
3283
3370
  prop,
@@ -3296,7 +3383,7 @@ const generateAction = ({
3296
3383
  if (args == null ? void 0 : args.includes(identifier)) {
3297
3384
  return;
3298
3385
  }
3299
- const depId = decodeDataSourceVariable(identifier);
3386
+ const depId = decodeDataVariableId(identifier);
3300
3387
  const dep = depId ? dataSources.get(depId) : void 0;
3301
3388
  if (dep) {
3302
3389
  usedDataSources.set(dep.id, dep);
@@ -3340,7 +3427,7 @@ const generatePropValue = ({
3340
3427
  if (prop.type === "asset" || prop.type === "page") {
3341
3428
  return;
3342
3429
  }
3343
- if (prop.type === "string" || prop.type === "number" || prop.type === "boolean" || prop.type === "string[]" || prop.type === "json") {
3430
+ if (prop.type === "string" || prop.type === "number" || prop.type === "boolean" || prop.type === "string[]" || prop.type === "json" || prop.type === "animationAction") {
3344
3431
  return JSON.stringify(prop.value);
3345
3432
  }
3346
3433
  if (prop.type === "parameter") {
@@ -3451,7 +3538,7 @@ ${prop.name}={${propValue}}`;
3451
3538
  return "";
3452
3539
  }
3453
3540
  const indexVariable = scope.getName(`${instance.id}-index`, "index");
3454
- generatedElement += `{${collectionDataValue}?.map((${collectionItemValue}: any, ${indexVariable}: number) =>
3541
+ generatedElement += `{${collectionDataValue}?.map?.((${collectionItemValue}: any, ${indexVariable}: number) =>
3455
3542
  `;
3456
3543
  generatedElement += `<Fragment key={${indexVariable}}>
3457
3544
  `;
@@ -3572,49 +3659,56 @@ const generateWebstudioComponent = ({
3572
3659
  instances,
3573
3660
  props: props2,
3574
3661
  dataSources,
3575
- indexesWithinAncestors,
3662
+ metas,
3576
3663
  classesMap
3577
3664
  }) => {
3578
3665
  const instance = instances.get(rootInstanceId);
3579
- if (instance === void 0) {
3580
- return "";
3581
- }
3666
+ const indexesWithinAncestors = getIndexesWithinAncestors(metas, instances, [
3667
+ rootInstanceId
3668
+ ]);
3582
3669
  const usedDataSources = /* @__PURE__ */ new Map();
3583
- const generatedJsx = generateJsxElement({
3584
- context: "expression",
3585
- scope,
3586
- instance,
3587
- props: props2,
3588
- dataSources,
3589
- usedDataSources,
3590
- indexesWithinAncestors,
3591
- classesMap,
3592
- children: generateJsxChildren({
3670
+ let generatedJsx = "<></>\n";
3671
+ if (instance) {
3672
+ generatedJsx = generateJsxElement({
3673
+ context: "expression",
3593
3674
  scope,
3594
- children: instance.children,
3595
- instances,
3675
+ instance,
3596
3676
  props: props2,
3597
3677
  dataSources,
3598
3678
  usedDataSources,
3599
3679
  indexesWithinAncestors,
3600
- classesMap
3601
- })
3602
- });
3680
+ classesMap,
3681
+ children: generateJsxChildren({
3682
+ scope,
3683
+ children: instance.children,
3684
+ instances,
3685
+ props: props2,
3686
+ dataSources,
3687
+ usedDataSources,
3688
+ indexesWithinAncestors,
3689
+ classesMap
3690
+ })
3691
+ });
3692
+ }
3603
3693
  let generatedProps = "";
3694
+ let generatedParameters = "";
3695
+ const uniqueParameters = new Set(
3696
+ parameters.map((parameter) => parameter.name)
3697
+ );
3604
3698
  if (parameters.length > 0) {
3605
- let generatedPropsValue = "{ ";
3606
- let generatedPropsType = "{ ";
3699
+ let generatedPropsType = "";
3700
+ for (const parameterName of uniqueParameters) {
3701
+ generatedPropsType += `${parameterName}: any; `;
3702
+ }
3703
+ generatedProps = `_props: { ${generatedPropsType}}`;
3607
3704
  for (const parameter of parameters) {
3608
3705
  const dataSource = usedDataSources.get(parameter.value);
3609
3706
  if (dataSource) {
3610
3707
  const valueName = scope.getName(dataSource.id, dataSource.name);
3611
- generatedPropsValue += `${parameter.name}: ${valueName}, `;
3708
+ generatedParameters += `const ${valueName} = _props.${parameter.name};
3709
+ `;
3612
3710
  }
3613
- generatedPropsType += `${parameter.name}: any; `;
3614
3711
  }
3615
- generatedPropsValue += `}`;
3616
- generatedPropsType += `}`;
3617
- generatedProps = `${generatedPropsValue}: ${generatedPropsType}`;
3618
3712
  }
3619
3713
  let generatedDataSources = "";
3620
3714
  for (const dataSource of usedDataSources.values()) {
@@ -3643,6 +3737,7 @@ const generateWebstudioComponent = ({
3643
3737
  let generatedComponent = "";
3644
3738
  generatedComponent += `const ${name2} = (${generatedProps}) => {
3645
3739
  `;
3740
+ generatedComponent += `${generatedParameters}`;
3646
3741
  generatedComponent += `${generatedDataSources}`;
3647
3742
  generatedComponent += `return ${generatedJsx}`;
3648
3743
  generatedComponent += `}
@@ -3760,14 +3855,14 @@ const htmlToJsx = (html2) => {
3760
3855
  }
3761
3856
  return result;
3762
3857
  };
3763
- const meta$I = {
3858
+ const meta$J = {
3764
3859
  category: "general",
3765
3860
  type: "container",
3766
3861
  description: "Slot is a container for content that you want to reference across the project. Changes made to a Slot's children will be reflected in all other instances of that Slot.",
3767
3862
  icon: SlotComponentIcon,
3768
3863
  order: 5
3769
3864
  };
3770
- const meta$H = {
3865
+ const meta$I = {
3771
3866
  type: "container",
3772
3867
  icon: ""
3773
3868
  };
@@ -3788,12 +3883,12 @@ const presetStyle$y = {
3788
3883
  value: { type: "keyword", value: "contents" }
3789
3884
  },
3790
3885
  {
3791
- property: "whiteSpaceCollapse",
3886
+ property: "white-space-collapse",
3792
3887
  value: { type: "keyword", value: "collapse" }
3793
3888
  }
3794
3889
  ]
3795
3890
  };
3796
- const meta$G = {
3891
+ const meta$H = {
3797
3892
  category: "general",
3798
3893
  type: "embed",
3799
3894
  label: "HTML Embed",
@@ -3823,7 +3918,7 @@ const meta$G = {
3823
3918
  },
3824
3919
  initialProps: ["className", "clientOnly", "executeScriptOnCanvas"]
3825
3920
  });
3826
- const meta$F = {
3921
+ const meta$G = {
3827
3922
  type: "embed",
3828
3923
  icon: MarkdownEmbedIcon,
3829
3924
  presetStyle: {
@@ -3833,7 +3928,7 @@ const meta$F = {
3833
3928
  value: { type: "keyword", value: "contents" }
3834
3929
  },
3835
3930
  {
3836
- property: "whiteSpaceCollapse",
3931
+ property: "white-space-collapse",
3837
3932
  value: { type: "keyword", value: "collapse" }
3838
3933
  }
3839
3934
  ]
@@ -3843,16 +3938,16 @@ const presetStyle$x = {
3843
3938
  body: [
3844
3939
  ...body,
3845
3940
  {
3846
- property: "WebkitFontSmoothing",
3941
+ property: "-webkit-font-smoothing",
3847
3942
  value: { type: "keyword", value: "antialiased" }
3848
3943
  },
3849
3944
  {
3850
- property: "MozOsxFontSmoothing",
3945
+ property: "-moz-osx-font-smoothing",
3851
3946
  value: { type: "keyword", value: "grayscale" }
3852
3947
  }
3853
3948
  ]
3854
3949
  };
3855
- const meta$E = {
3950
+ const meta$F = {
3856
3951
  type: "container",
3857
3952
  icon: BodyIcon,
3858
3953
  states: defaultStates,
@@ -3870,7 +3965,7 @@ const presetStyle$w = {
3870
3965
  nav,
3871
3966
  section
3872
3967
  };
3873
- const meta$D = {
3968
+ const meta$E = {
3874
3969
  category: "general",
3875
3970
  type: "container",
3876
3971
  description: "A container for content. By default this is a Div, but the tag can be changed in settings.",
@@ -3883,12 +3978,12 @@ const presetStyle$v = {
3883
3978
  div: [
3884
3979
  ...div,
3885
3980
  {
3886
- property: "minHeight",
3981
+ property: "min-height",
3887
3982
  value: { type: "unit", unit: "em", value: 1 }
3888
3983
  }
3889
3984
  ]
3890
3985
  };
3891
- const meta$C = {
3986
+ const meta$D = {
3892
3987
  type: "container",
3893
3988
  icon: TextIcon,
3894
3989
  states: defaultStates,
@@ -3902,8 +3997,9 @@ const presetStyle$u = {
3902
3997
  h5,
3903
3998
  h6
3904
3999
  };
3905
- const meta$B = {
4000
+ const meta$C = {
3906
4001
  type: "container",
4002
+ placeholder: "Heading",
3907
4003
  icon: HeadingIcon,
3908
4004
  constraints: {
3909
4005
  relation: "ancestor",
@@ -3915,8 +4011,9 @@ const meta$B = {
3915
4011
  const presetStyle$t = {
3916
4012
  p
3917
4013
  };
3918
- const meta$A = {
4014
+ const meta$B = {
3919
4015
  type: "container",
4016
+ placeholder: "Paragraph",
3920
4017
  icon: TextAlignLeftIcon,
3921
4018
  constraints: {
3922
4019
  relation: "ancestor",
@@ -3934,8 +4031,9 @@ const presetStyle$s = {
3934
4031
  }
3935
4032
  ]
3936
4033
  };
3937
- const meta$z = {
4034
+ const meta$A = {
3938
4035
  type: "container",
4036
+ placeholder: "Link",
3939
4037
  icon: LinkIcon,
3940
4038
  constraints: {
3941
4039
  relation: "ancestor",
@@ -3955,14 +4053,14 @@ const meta$z = {
3955
4053
  }
3956
4054
  ]
3957
4055
  };
3958
- const meta$y = {
3959
- ...meta$z,
4056
+ const meta$z = {
4057
+ ...meta$A,
3960
4058
  type: "rich-text-child"
3961
4059
  };
3962
4060
  const presetStyle$r = {
3963
4061
  span
3964
4062
  };
3965
- const meta$x = {
4063
+ const meta$y = {
3966
4064
  type: "rich-text-child",
3967
4065
  label: "Text",
3968
4066
  icon: PaintBrushIcon,
@@ -3972,7 +4070,7 @@ const meta$x = {
3972
4070
  const presetStyle$q = {
3973
4071
  b
3974
4072
  };
3975
- const meta$w = {
4073
+ const meta$x = {
3976
4074
  type: "rich-text-child",
3977
4075
  label: "Bold Text",
3978
4076
  icon: BoldIcon,
@@ -3983,12 +4081,12 @@ const presetStyle$p = {
3983
4081
  i: [
3984
4082
  ...i,
3985
4083
  {
3986
- property: "fontStyle",
4084
+ property: "font-style",
3987
4085
  value: { type: "keyword", value: "italic" }
3988
4086
  }
3989
4087
  ]
3990
4088
  };
3991
- const meta$v = {
4089
+ const meta$w = {
3992
4090
  type: "rich-text-child",
3993
4091
  label: "Italic Text",
3994
4092
  icon: TextItalicIcon,
@@ -3998,7 +4096,7 @@ const meta$v = {
3998
4096
  const presetStyle$o = {
3999
4097
  sup
4000
4098
  };
4001
- const meta$u = {
4099
+ const meta$v = {
4002
4100
  type: "rich-text-child",
4003
4101
  label: "Superscript Text",
4004
4102
  icon: SuperscriptIcon,
@@ -4008,7 +4106,7 @@ const meta$u = {
4008
4106
  const presetStyle$n = {
4009
4107
  sub
4010
4108
  };
4011
- const meta$t = {
4109
+ const meta$u = {
4012
4110
  type: "rich-text-child",
4013
4111
  label: "Subscript Text",
4014
4112
  icon: SubscriptIcon,
@@ -4018,7 +4116,7 @@ const meta$t = {
4018
4116
  const presetStyle$m = {
4019
4117
  button
4020
4118
  };
4021
- const meta$s = {
4119
+ const meta$t = {
4022
4120
  icon: ButtonElementIcon,
4023
4121
  type: "container",
4024
4122
  constraints: {
@@ -4041,7 +4139,7 @@ const presetStyle$l = {
4041
4139
  }
4042
4140
  ]
4043
4141
  };
4044
- const meta$r = {
4142
+ const meta$s = {
4045
4143
  category: "forms",
4046
4144
  constraints: {
4047
4145
  relation: "ancestor",
@@ -4067,7 +4165,7 @@ const meta$r = {
4067
4165
  //{ selector: ":read-write", label: "Read Write" },
4068
4166
  ]
4069
4167
  };
4070
- const meta$q = {
4168
+ const meta$r = {
4071
4169
  label: "Webhook Form",
4072
4170
  icon: WebhookFormIcon,
4073
4171
  type: "container",
@@ -4086,10 +4184,10 @@ const meta$q = {
4086
4184
  const presetStyle$k = {
4087
4185
  form: [
4088
4186
  ...form,
4089
- { property: "minHeight", value: { type: "unit", unit: "px", value: 20 } }
4187
+ { property: "min-height", value: { type: "unit", unit: "px", value: 20 } }
4090
4188
  ]
4091
4189
  };
4092
- const meta$p = {
4190
+ const meta$q = {
4093
4191
  category: "forms",
4094
4192
  type: "container",
4095
4193
  label: "Form",
@@ -4108,7 +4206,7 @@ const presetStyle$j = {
4108
4206
  ...img,
4109
4207
  // Otherwise on new image insert onto canvas it can overfit screen size multiple times
4110
4208
  {
4111
- property: "maxWidth",
4209
+ property: "max-width",
4112
4210
  value: { type: "unit", unit: "%", value: 100 }
4113
4211
  },
4114
4212
  // inline | inline-block is not suitable because without line-height: 0 on the parent you get unsuitable spaces/margins
@@ -4126,7 +4224,7 @@ const presetStyle$j = {
4126
4224
  }
4127
4225
  ]
4128
4226
  };
4129
- const meta$o = {
4227
+ const meta$p = {
4130
4228
  category: "media",
4131
4229
  type: "embed",
4132
4230
  description: "Add an image asset to the page. Webstudio automatically converts images to WebP or AVIF format and makes them responsive for best performance.",
@@ -4138,53 +4236,54 @@ const meta$o = {
4138
4236
  const presetStyle$i = {
4139
4237
  blockquote: [
4140
4238
  {
4141
- property: "marginTop",
4239
+ property: "margin-top",
4142
4240
  value: { type: "unit", value: 0, unit: "number" }
4143
4241
  },
4144
4242
  {
4145
- property: "marginRight",
4243
+ property: "margin-right",
4146
4244
  value: { type: "unit", value: 0, unit: "number" }
4147
4245
  },
4148
4246
  {
4149
- property: "marginBottom",
4247
+ property: "margin-bottom",
4150
4248
  value: { type: "unit", value: 10, unit: "px" }
4151
4249
  },
4152
4250
  {
4153
- property: "marginLeft",
4251
+ property: "margin-left",
4154
4252
  value: { type: "unit", value: 0, unit: "number" }
4155
4253
  },
4156
4254
  {
4157
- property: "paddingTop",
4255
+ property: "padding-top",
4158
4256
  value: { type: "unit", value: 10, unit: "px" }
4159
4257
  },
4160
4258
  {
4161
- property: "paddingBottom",
4259
+ property: "padding-bottom",
4162
4260
  value: { type: "unit", value: 10, unit: "px" }
4163
4261
  },
4164
4262
  {
4165
- property: "paddingLeft",
4263
+ property: "padding-left",
4166
4264
  value: { type: "unit", value: 20, unit: "px" }
4167
4265
  },
4168
4266
  {
4169
- property: "paddingRight",
4267
+ property: "padding-right",
4170
4268
  value: { type: "unit", value: 20, unit: "px" }
4171
4269
  },
4172
4270
  {
4173
- property: "borderLeftWidth",
4271
+ property: "border-left-width",
4174
4272
  value: { type: "unit", value: 5, unit: "px" }
4175
4273
  },
4176
4274
  {
4177
- property: "borderLeftStyle",
4275
+ property: "border-left-style",
4178
4276
  value: { type: "keyword", value: "solid" }
4179
4277
  },
4180
4278
  {
4181
- property: "borderLeftColor",
4279
+ property: "border-left-color",
4182
4280
  value: { type: "rgb", r: 226, g: 226, b: 226, alpha: 1 }
4183
4281
  }
4184
4282
  ]
4185
4283
  };
4186
- const meta$n = {
4284
+ const meta$o = {
4187
4285
  type: "container",
4286
+ placeholder: "Blockquote",
4188
4287
  icon: BlockquoteIcon,
4189
4288
  states: defaultStates,
4190
4289
  presetStyle: presetStyle$i
@@ -4193,35 +4292,35 @@ const presetStyle$h = {
4193
4292
  ol: [
4194
4293
  ...ol,
4195
4294
  {
4196
- property: "marginTop",
4295
+ property: "margin-top",
4197
4296
  value: { type: "keyword", value: "0" }
4198
4297
  },
4199
4298
  {
4200
- property: "marginBottom",
4299
+ property: "margin-bottom",
4201
4300
  value: { type: "keyword", value: "10px" }
4202
4301
  },
4203
4302
  {
4204
- property: "paddingLeft",
4303
+ property: "padding-left",
4205
4304
  value: { type: "keyword", value: "40px" }
4206
4305
  }
4207
4306
  ],
4208
4307
  ul: [
4209
4308
  ...ul,
4210
4309
  {
4211
- property: "marginTop",
4310
+ property: "margin-top",
4212
4311
  value: { type: "keyword", value: "0" }
4213
4312
  },
4214
4313
  {
4215
- property: "marginBottom",
4314
+ property: "margin-bottom",
4216
4315
  value: { type: "keyword", value: "10px" }
4217
4316
  },
4218
4317
  {
4219
- property: "paddingLeft",
4318
+ property: "padding-left",
4220
4319
  value: { type: "keyword", value: "40px" }
4221
4320
  }
4222
4321
  ]
4223
4322
  };
4224
- const meta$m = {
4323
+ const meta$n = {
4225
4324
  type: "container",
4226
4325
  icon: ListIcon,
4227
4326
  states: defaultStates,
@@ -4230,8 +4329,9 @@ const meta$m = {
4230
4329
  const presetStyle$g = {
4231
4330
  li
4232
4331
  };
4233
- const meta$l = {
4332
+ const meta$m = {
4234
4333
  type: "container",
4334
+ placeholder: "List item",
4235
4335
  constraints: {
4236
4336
  // cannot use parent relation here
4237
4337
  // because list item can be put inside of collection or slot
@@ -4251,28 +4351,28 @@ const presetStyle$f = {
4251
4351
  value: { type: "keyword", value: "1px" }
4252
4352
  },
4253
4353
  {
4254
- property: "backgroundColor",
4354
+ property: "background-color",
4255
4355
  value: { type: "keyword", value: "gray" }
4256
4356
  },
4257
4357
  {
4258
- property: "borderTopStyle",
4358
+ property: "border-top-style",
4259
4359
  value: { type: "keyword", value: "none" }
4260
4360
  },
4261
4361
  {
4262
- property: "borderRightStyle",
4362
+ property: "border-right-style",
4263
4363
  value: { type: "keyword", value: "none" }
4264
4364
  },
4265
4365
  {
4266
- property: "borderLeftStyle",
4366
+ property: "border-left-style",
4267
4367
  value: { type: "keyword", value: "none" }
4268
4368
  },
4269
4369
  {
4270
- property: "borderBottomStyle",
4370
+ property: "border-bottom-style",
4271
4371
  value: { type: "keyword", value: "none" }
4272
4372
  }
4273
4373
  ]
4274
4374
  };
4275
- const meta$k = {
4375
+ const meta$l = {
4276
4376
  category: "general",
4277
4377
  type: "embed",
4278
4378
  description: "Used to visually divide sections of content, helping to improve readability and organization within a webpage.",
@@ -4289,28 +4389,28 @@ const presetStyle$e = {
4289
4389
  value: { type: "keyword", value: "block" }
4290
4390
  },
4291
4391
  {
4292
- property: "whiteSpaceCollapse",
4392
+ property: "white-space-collapse",
4293
4393
  value: { type: "keyword", value: "preserve" }
4294
4394
  },
4295
4395
  {
4296
- property: "textWrapMode",
4396
+ property: "text-wrap-mode",
4297
4397
  value: { type: "keyword", value: "wrap" }
4298
4398
  },
4299
4399
  {
4300
- property: "paddingLeft",
4400
+ property: "padding-left",
4301
4401
  value: { type: "unit", value: 0.2, unit: "em" }
4302
4402
  },
4303
4403
  {
4304
- property: "paddingRight",
4404
+ property: "padding-right",
4305
4405
  value: { type: "unit", value: 0.2, unit: "em" }
4306
4406
  },
4307
4407
  {
4308
- property: "backgroundColor",
4408
+ property: "background-color",
4309
4409
  value: { type: "rgb", r: 238, g: 238, b: 238, alpha: 1 }
4310
4410
  }
4311
4411
  ]
4312
4412
  };
4313
- const meta$j = {
4413
+ const meta$k = {
4314
4414
  category: "general",
4315
4415
  type: "embed",
4316
4416
  description: "Use this component when you want to display code as text on the page.",
@@ -4329,7 +4429,7 @@ const presetStyle$d = {
4329
4429
  { property: "display", value: { type: "keyword", value: "block" } }
4330
4430
  ]
4331
4431
  };
4332
- const meta$i = {
4432
+ const meta$j = {
4333
4433
  constraints: {
4334
4434
  relation: "ancestor",
4335
4435
  component: { $nin: ["Button", "Link"] }
@@ -4351,7 +4451,7 @@ const presetStyle$c = {
4351
4451
  }
4352
4452
  ]
4353
4453
  };
4354
- const meta$h = {
4454
+ const meta$i = {
4355
4455
  category: "forms",
4356
4456
  type: "control",
4357
4457
  label: "Text Area",
@@ -4381,12 +4481,12 @@ const presetStyle$b = {
4381
4481
  input: [
4382
4482
  ...radio,
4383
4483
  {
4384
- property: "marginRight",
4484
+ property: "margin-right",
4385
4485
  value: { type: "unit", unit: "em", value: 0.5 }
4386
4486
  }
4387
4487
  ]
4388
4488
  };
4389
- const meta$g = {
4489
+ const meta$h = {
4390
4490
  constraints: {
4391
4491
  relation: "ancestor",
4392
4492
  component: { $nin: ["Button", "Link"] }
@@ -4411,12 +4511,12 @@ const presetStyle$a = {
4411
4511
  input: [
4412
4512
  ...checkbox,
4413
4513
  {
4414
- property: "marginRight",
4514
+ property: "margin-right",
4415
4515
  value: { type: "unit", unit: "em", value: 0.5 }
4416
4516
  }
4417
4517
  ]
4418
4518
  };
4419
- const meta$f = {
4519
+ const meta$g = {
4420
4520
  constraints: {
4421
4521
  relation: "ancestor",
4422
4522
  component: { $nin: ["Button", "Link"] }
@@ -4438,7 +4538,7 @@ const meta$f = {
4438
4538
  const presetStyle$9 = {
4439
4539
  div
4440
4540
  };
4441
- const meta$e = {
4541
+ const meta$f = {
4442
4542
  type: "container",
4443
4543
  icon: VimeoIcon,
4444
4544
  states: defaultStates,
@@ -4451,7 +4551,7 @@ const meta$e = {
4451
4551
  const presetStyle$8 = {
4452
4552
  div
4453
4553
  };
4454
- const meta$d = {
4554
+ const meta$e = {
4455
4555
  type: "container",
4456
4556
  icon: YoutubeIcon,
4457
4557
  states: defaultStates,
@@ -4461,8 +4561,8 @@ const meta$d = {
4461
4561
  component: { $nin: ["Button", "Link", "Heading"] }
4462
4562
  }
4463
4563
  };
4464
- const meta$c = {
4465
- ...meta$o,
4564
+ const meta$d = {
4565
+ ...meta$p,
4466
4566
  category: "hidden",
4467
4567
  label: "Preview Image",
4468
4568
  constraints: {
@@ -4473,7 +4573,7 @@ const meta$c = {
4473
4573
  const presetStyle$7 = {
4474
4574
  button
4475
4575
  };
4476
- const meta$b = {
4576
+ const meta$c = {
4477
4577
  category: "hidden",
4478
4578
  type: "container",
4479
4579
  constraints: [
@@ -4494,7 +4594,7 @@ const meta$b = {
4494
4594
  const presetStyle$6 = {
4495
4595
  div
4496
4596
  };
4497
- const meta$a = {
4597
+ const meta$b = {
4498
4598
  type: "container",
4499
4599
  constraints: {
4500
4600
  relation: "ancestor",
@@ -4506,14 +4606,14 @@ const meta$a = {
4506
4606
  category: "hidden",
4507
4607
  label: "Spinner"
4508
4608
  };
4509
- const meta$9 = {
4609
+ const meta$a = {
4510
4610
  category: "xml",
4511
4611
  order: 6,
4512
4612
  type: "container",
4513
4613
  icon: XmlIcon,
4514
4614
  description: "XML Node"
4515
4615
  };
4516
- const meta$8 = {
4616
+ const meta$9 = {
4517
4617
  category: "xml",
4518
4618
  type: "container",
4519
4619
  description: "Converts machine-readable date and time to ISO format.",
@@ -4523,7 +4623,7 @@ const meta$8 = {
4523
4623
  const presetStyle$5 = {
4524
4624
  time
4525
4625
  };
4526
- const meta$7 = {
4626
+ const meta$8 = {
4527
4627
  category: "localization",
4528
4628
  type: "container",
4529
4629
  description: "Converts machine-readable date and time to a human-readable format.",
@@ -4540,7 +4640,7 @@ const presetStyle$4 = {
4540
4640
  }
4541
4641
  ]
4542
4642
  };
4543
- const meta$6 = {
4643
+ const meta$7 = {
4544
4644
  constraints: {
4545
4645
  relation: "ancestor",
4546
4646
  component: { $nin: ["Button", "Link"] }
@@ -4560,7 +4660,7 @@ const meta$6 = {
4560
4660
  const presetStyle$3 = {
4561
4661
  option: [
4562
4662
  {
4563
- property: "backgroundColor",
4663
+ property: "background-color",
4564
4664
  state: ":checked",
4565
4665
  value: {
4566
4666
  type: "rgb",
@@ -4572,7 +4672,7 @@ const presetStyle$3 = {
4572
4672
  }
4573
4673
  ]
4574
4674
  };
4575
- const meta$5 = {
4675
+ const meta$6 = {
4576
4676
  category: "hidden",
4577
4677
  constraints: {
4578
4678
  relation: "parent",
@@ -4593,7 +4693,7 @@ const meta$5 = {
4593
4693
  { selector: ":disabled", label: "Disabled" }
4594
4694
  ]
4595
4695
  };
4596
- const meta$4 = {
4696
+ const meta$5 = {
4597
4697
  icon: HeaderIcon,
4598
4698
  type: "container",
4599
4699
  description: "Inserts children into the head of the document",
@@ -4608,25 +4708,25 @@ const meta$4 = {
4608
4708
  }
4609
4709
  ]
4610
4710
  };
4611
- const meta$3 = {
4711
+ const meta$4 = {
4612
4712
  category: "hidden",
4613
4713
  icon: ResourceIcon,
4614
- type: "container",
4714
+ type: "embed",
4615
4715
  constraints: {
4616
4716
  relation: "parent",
4617
4717
  component: { $eq: "HeadSlot" }
4618
4718
  }
4619
4719
  };
4620
- const meta$2 = {
4720
+ const meta$3 = {
4621
4721
  category: "hidden",
4622
4722
  icon: WindowInfoIcon,
4623
- type: "container",
4723
+ type: "embed",
4624
4724
  constraints: {
4625
4725
  relation: "parent",
4626
4726
  component: { $eq: "HeadSlot" }
4627
4727
  }
4628
4728
  };
4629
- const meta$1 = {
4729
+ const meta$2 = {
4630
4730
  category: "hidden",
4631
4731
  icon: WindowTitleIcon,
4632
4732
  type: "container",
@@ -4637,61 +4737,70 @@ const meta$1 = {
4637
4737
  };
4638
4738
  const baseComponentMetas = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4639
4739
  __proto__: null,
4640
- Blockquote: meta$n,
4641
- Body: meta$E,
4642
- Bold: meta$w,
4643
- Box: meta$D,
4644
- Button: meta$s,
4645
- Checkbox: meta$f,
4646
- CodeText: meta$j,
4647
- Form: meta$q,
4648
- Fragment: meta$H,
4649
- HeadLink: meta$3,
4650
- HeadMeta: meta$2,
4651
- HeadSlot: meta$4,
4652
- HeadTitle: meta$1,
4653
- Heading: meta$B,
4654
- HtmlEmbed: meta$G,
4655
- Image: meta$o,
4656
- Input: meta$r,
4657
- Italic: meta$v,
4658
- Label: meta$i,
4659
- Link: meta$z,
4660
- List: meta$m,
4661
- ListItem: meta$l,
4662
- MarkdownEmbed: meta$F,
4663
- Option: meta$5,
4664
- Paragraph: meta$A,
4665
- RadioButton: meta$g,
4666
- RemixForm: meta$p,
4667
- RichTextLink: meta$y,
4668
- Select: meta$6,
4669
- Separator: meta$k,
4670
- Slot: meta$I,
4671
- Span: meta$x,
4672
- Subscript: meta$t,
4673
- Superscript: meta$u,
4674
- Text: meta$C,
4675
- Textarea: meta$h,
4676
- Time: meta$7,
4677
- Vimeo: meta$e,
4678
- VimeoPlayButton: meta$b,
4679
- VimeoPreviewImage: meta$c,
4680
- VimeoSpinner: meta$a,
4681
- XmlNode: meta$9,
4682
- XmlTime: meta$8,
4683
- YouTube: meta$d
4740
+ Blockquote: meta$o,
4741
+ Body: meta$F,
4742
+ Bold: meta$x,
4743
+ Box: meta$E,
4744
+ Button: meta$t,
4745
+ Checkbox: meta$g,
4746
+ CodeText: meta$k,
4747
+ Form: meta$r,
4748
+ Fragment: meta$I,
4749
+ HeadLink: meta$4,
4750
+ HeadMeta: meta$3,
4751
+ HeadSlot: meta$5,
4752
+ HeadTitle: meta$2,
4753
+ Heading: meta$C,
4754
+ HtmlEmbed: meta$H,
4755
+ Image: meta$p,
4756
+ Input: meta$s,
4757
+ Italic: meta$w,
4758
+ Label: meta$j,
4759
+ Link: meta$A,
4760
+ List: meta$n,
4761
+ ListItem: meta$m,
4762
+ MarkdownEmbed: meta$G,
4763
+ Option: meta$6,
4764
+ Paragraph: meta$B,
4765
+ RadioButton: meta$h,
4766
+ RemixForm: meta$q,
4767
+ RichTextLink: meta$z,
4768
+ Select: meta$7,
4769
+ Separator: meta$l,
4770
+ Slot: meta$J,
4771
+ Span: meta$y,
4772
+ Subscript: meta$u,
4773
+ Superscript: meta$v,
4774
+ Text: meta$D,
4775
+ Textarea: meta$i,
4776
+ Time: meta$8,
4777
+ Vimeo: meta$f,
4778
+ VimeoPlayButton: meta$c,
4779
+ VimeoPreviewImage: meta$d,
4780
+ VimeoSpinner: meta$b,
4781
+ XmlNode: meta$a,
4782
+ XmlTime: meta$9,
4783
+ YouTube: meta$e
4684
4784
  }, Symbol.toStringTag, { value: "Module" }));
4785
+ const meta$1 = {
4786
+ category: "general",
4787
+ type: "container",
4788
+ description: "Animate Children",
4789
+ icon: SlotComponentIcon,
4790
+ order: 5,
4791
+ label: "Animate Children"
4792
+ };
4685
4793
  const animationComponentMetas = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4686
- __proto__: null
4794
+ __proto__: null,
4795
+ AnimateChildren: meta$1
4687
4796
  }, Symbol.toStringTag, { value: "Module" }));
4688
4797
  const remixComponentMetas = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4689
4798
  __proto__: null,
4690
- Body: meta$E,
4691
- Form: meta$q,
4692
- Link: meta$z,
4693
- RemixForm: meta$p,
4694
- RichTextLink: meta$y
4799
+ Body: meta$F,
4800
+ Form: meta$r,
4801
+ Link: meta$A,
4802
+ RemixForm: meta$q,
4803
+ RichTextLink: meta$z
4695
4804
  }, Symbol.toStringTag, { value: "Module" }));
4696
4805
  const metaCollapsible = {
4697
4806
  type: "container",
@@ -4743,29 +4852,29 @@ const rgb = (property, r, g, b2) => ({
4743
4852
  });
4744
4853
  const buttonReset = [
4745
4854
  {
4746
- property: "backgroundColor",
4855
+ property: "background-color",
4747
4856
  value: { type: "keyword", value: "transparent" }
4748
4857
  },
4749
4858
  {
4750
- property: "backgroundImage",
4859
+ property: "background-image",
4751
4860
  value: { type: "keyword", value: "none" }
4752
4861
  },
4753
- unit("borderTopWidth", 0, "px"),
4754
- unit("borderRightWidth", 0, "px"),
4755
- unit("borderBottomWidth", 0, "px"),
4756
- unit("borderLeftWidth", 0, "px"),
4757
- keyword("borderTopStyle", "solid"),
4758
- keyword("borderRightStyle", "solid"),
4759
- keyword("borderBottomStyle", "solid"),
4760
- keyword("borderLeftStyle", "solid"),
4761
- rgb("borderTopColor", 226, 232, 240),
4762
- rgb("borderRightColor", 226, 232, 240),
4763
- rgb("borderBottomColor", 226, 232, 240),
4764
- rgb("borderLeftColor", 226, 232, 240),
4765
- unit("paddingTop", 0, "px"),
4766
- unit("paddingRight", 0, "px"),
4767
- unit("paddingBottom", 0, "px"),
4768
- unit("paddingLeft", 0, "px")
4862
+ unit("border-top-width", 0, "px"),
4863
+ unit("border-right-width", 0, "px"),
4864
+ unit("border-bottom-width", 0, "px"),
4865
+ unit("border-left-width", 0, "px"),
4866
+ keyword("border-top-style", "solid"),
4867
+ keyword("border-right-style", "solid"),
4868
+ keyword("border-bottom-style", "solid"),
4869
+ keyword("border-left-style", "solid"),
4870
+ rgb("border-top-color", 226, 232, 240),
4871
+ rgb("border-right-color", 226, 232, 240),
4872
+ rgb("border-bottom-color", 226, 232, 240),
4873
+ rgb("border-left-color", 226, 232, 240),
4874
+ unit("padding-top", 0, "px"),
4875
+ unit("padding-right", 0, "px"),
4876
+ unit("padding-bottom", 0, "px"),
4877
+ unit("padding-left", 0, "px")
4769
4878
  ];
4770
4879
  const metaDialogTrigger = {
4771
4880
  type: "container",
@@ -5067,11 +5176,11 @@ const metaAccordionHeader = {
5067
5176
  h3: [
5068
5177
  ...h3,
5069
5178
  {
5070
- property: "marginTop",
5179
+ property: "margin-top",
5071
5180
  value: { type: "unit", unit: "px", value: 0 }
5072
5181
  },
5073
5182
  {
5074
- property: "marginBottom",
5183
+ property: "margin-bottom",
5075
5184
  value: { type: "unit", unit: "px", value: 0 }
5076
5185
  }
5077
5186
  ]
@@ -5603,11 +5712,11 @@ const createFramework$2 = async () => {
5603
5712
  };
5604
5713
  const reactRouterComponentMetas = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
5605
5714
  __proto__: null,
5606
- Body: meta$E,
5607
- Form: meta$q,
5608
- Link: meta$z,
5609
- RemixForm: meta$p,
5610
- RichTextLink: meta$y
5715
+ Body: meta$F,
5716
+ Form: meta$r,
5717
+ Link: meta$A,
5718
+ RemixForm: meta$q,
5719
+ RichTextLink: meta$z
5611
5720
  }, Symbol.toStringTag, { value: "Module" }));
5612
5721
  const createFramework$1 = async () => {
5613
5722
  const routeTemplatesDir = join("app", "route-templates");
@@ -5848,7 +5957,7 @@ audit=false
5848
5957
  fund=false
5849
5958
  `;
5850
5959
  const prebuild = async (options) => {
5851
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
5960
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
5852
5961
  if (options.template.length === 0) {
5853
5962
  log.error(
5854
5963
  `Template is not provided
@@ -5902,10 +6011,9 @@ Please check webstudio --help for more details`
5902
6011
  componentSources.set(componentName, entry.source);
5903
6012
  }
5904
6013
  }
5905
- const projectMetas = new Map(
6014
+ const usedMetas = new Map(
5906
6015
  Object.entries(coreMetas)
5907
6016
  );
5908
- const componentsByPage = {};
5909
6017
  const siteDataByPage = {};
5910
6018
  const fontAssetsByPage = {};
5911
6019
  const backgroundImageAssetsByPage = {};
@@ -5915,6 +6023,7 @@ Please check webstudio --help for more details`
5915
6023
  instanceMap,
5916
6024
  page.rootInstanceId
5917
6025
  );
6026
+ pageInstanceSet.add(ROOT_INSTANCE_ID);
5918
6027
  const instances = siteData.build.instances.filter(([id]) => pageInstanceSet.has(id));
5919
6028
  const dataSources = [];
5920
6029
  const normalizedProps = normalizeProps({
@@ -5957,15 +6066,10 @@ Please check webstudio --help for more details`
5957
6066
  page,
5958
6067
  assets: siteData.assets
5959
6068
  };
5960
- componentsByPage[page.id] = /* @__PURE__ */ new Set();
5961
6069
  for (const [_instanceId, instance] of instances) {
5962
- if (isCoreComponent(instance.component)) {
5963
- continue;
5964
- }
5965
- componentsByPage[page.id].add(instance.component);
5966
6070
  const meta2 = metas.get(instance.component);
5967
6071
  if (meta2) {
5968
- projectMetas.set(instance.component, meta2);
6072
+ usedMetas.set(instance.component, meta2);
5969
6073
  }
5970
6074
  }
5971
6075
  const styleSourceSelections = ((_a = siteData.build) == null ? void 0 : _a.styleSourceSelections) ?? [];
@@ -5980,7 +6084,7 @@ Please check webstudio --help for more details`
5980
6084
  ([, { value }]) => value.type === "fontFamily" ? value.value : void 0
5981
6085
  ).flat().filter((value) => value !== void 0)
5982
6086
  );
5983
- const pageFontAssets = siteData.assets.filter((asset) => asset.type === "font").filter((fontAsset) => pageFontFamilySet.has(fontAsset.meta.family));
6087
+ const pageFontAssets = siteData.assets.filter((asset) => asset.type === "font").filter((fontAsset) => pageFontFamilySet.has(fontAsset.meta.family)).map((asset) => asset.name);
5984
6088
  fontAssetsByPage[page.id] = pageFontAssets;
5985
6089
  const backgroundImageAssetIdSet = new Set(
5986
6090
  pageStyles.filter(([, { property }]) => property === "backgroundImage").map(
@@ -5989,7 +6093,7 @@ Please check webstudio --help for more details`
5989
6093
  ) : void 0
5990
6094
  ).flat().filter((value) => value !== void 0)
5991
6095
  );
5992
- const backgroundImageAssets = siteData.assets.filter((asset) => asset.type === "image").filter((imageAsset) => backgroundImageAssetIdSet.has(imageAsset.id));
6096
+ const backgroundImageAssets = siteData.assets.filter((asset) => asset.type === "image").filter((imageAsset) => backgroundImageAssetIdSet.has(imageAsset.id)).map((asset) => asset.name);
5993
6097
  backgroundImageAssetsByPage[page.id] = backgroundImageAssets;
5994
6098
  }
5995
6099
  const assetsToDownload = [];
@@ -6029,12 +6133,12 @@ Please check webstudio --help for more details`
6029
6133
  styles: new Map((_e = siteData.build) == null ? void 0 : _e.styles),
6030
6134
  styleSourceSelections: new Map((_f = siteData.build) == null ? void 0 : _f.styleSourceSelections),
6031
6135
  // pass only used metas to not generate unused preset styles
6032
- componentMetas: projectMetas,
6136
+ componentMetas: usedMetas,
6033
6137
  assetBaseUrl,
6034
6138
  atomic: ((_g = siteData.build.pages.compiler) == null ? void 0 : _g.atomicStyles) ?? true
6035
6139
  });
6036
6140
  await createFileIfNotExists(join(generatedDir, "index.css"), cssText);
6037
- for (const [pageId, pageComponents] of Object.entries(componentsByPage)) {
6141
+ for (const page of Object.values(siteData.pages)) {
6038
6142
  const scope = createScope([
6039
6143
  // manually maintained list of occupied identifiers
6040
6144
  "useState",
@@ -6044,6 +6148,30 @@ Please check webstudio --help for more details`
6044
6148
  "Page",
6045
6149
  "_props"
6046
6150
  ]);
6151
+ const pageData = siteDataByPage[page.id];
6152
+ const instances = new Map(pageData.build.instances);
6153
+ const documentType = page.meta.documentType ?? "html";
6154
+ let rootInstanceId = page.rootInstanceId;
6155
+ if (documentType === "xml") {
6156
+ const bodyInstance = instances.get(rootInstanceId);
6157
+ const firstChild = bodyInstance == null ? void 0 : bodyInstance.children.at(0);
6158
+ if ((firstChild == null ? void 0 : firstChild.type) === "id") {
6159
+ rootInstanceId = firstChild.value;
6160
+ }
6161
+ for (const instance of instances.values()) {
6162
+ if (isCoreComponent(instance.component)) {
6163
+ continue;
6164
+ }
6165
+ if (((_h = usedMetas.get(instance.component)) == null ? void 0 : _h.category) === "xml") {
6166
+ continue;
6167
+ }
6168
+ instances.delete(instance.id);
6169
+ }
6170
+ }
6171
+ const pageComponents = /* @__PURE__ */ new Set();
6172
+ for (const instance of instances.values()) {
6173
+ pageComponents.add(instance.component);
6174
+ }
6047
6175
  const namespaces = /* @__PURE__ */ new Map();
6048
6176
  for (const component of pageComponents) {
6049
6177
  const namespace = componentSources.get(component);
@@ -6057,50 +6185,18 @@ Please check webstudio --help for more details`
6057
6185
  );
6058
6186
  }
6059
6187
  const [_namespace, shortName] = parseComponentName(component);
6060
- (_h = namespaces.get(namespace)) == null ? void 0 : _h.add([shortName, component]);
6188
+ (_i = namespaces.get(namespace)) == null ? void 0 : _i.add([shortName, component]);
6061
6189
  }
6062
6190
  let componentImports = "";
6063
- let xmlPresentationComponents = "";
6064
- const pageData = siteDataByPage[pageId];
6065
- const documentType = pageData.page.meta.documentType ?? "html";
6066
6191
  for (const [namespace, componentsSet] of namespaces.entries()) {
6067
- switch (documentType) {
6068
- case "html":
6069
- {
6070
- const specifiers = Array.from(componentsSet).map(
6071
- ([shortName, component]) => `${shortName} as ${scope.getName(component, shortName)}`
6072
- ).join(", ");
6073
- componentImports += `import { ${specifiers} } from "${namespace}";
6074
- `;
6075
- }
6076
- break;
6077
- case "xml":
6078
- {
6079
- componentImports = `import { XmlNode, XmlTime } from "@webstudio-is/sdk-components-react";
6192
+ const specifiers = Array.from(componentsSet).map(
6193
+ ([shortName, component]) => `${shortName} as ${scope.getName(component, shortName)}`
6194
+ ).join(", ");
6195
+ componentImports += `import { ${specifiers} } from "${namespace}";
6080
6196
  `;
6081
- xmlPresentationComponents += Array.from(componentsSet).map(
6082
- ([shortName, component]) => scope.getName(component, shortName)
6083
- ).filter(
6084
- (scopedName) => scopedName !== "XmlNode" && scopedName !== "XmlTime"
6085
- ).map(
6086
- (scopedName) => scopedName === "Body" ? (
6087
- // Using <svg> prevents React from hoisting elements like <title>, <meta>, and <link>
6088
- // out of their intended scope during rendering.
6089
- // More details: https://github.com/facebook/react/blob/7c8e5e7ab8bb63de911637892392c5efd8ce1d0f/packages/react-dom-bindings/src/client/ReactFiberConfigDOM.js#L3083
6090
- `const ${scopedName} = (props: any) => <svg>{props.children}</svg>;`
6091
- ) : (
6092
- // Do not render all other components
6093
- `const ${scopedName} = (props: any) => null;`
6094
- )
6095
- ).join("\n");
6096
- }
6097
- break;
6098
- }
6099
6197
  }
6100
- const pageFontAssets = fontAssetsByPage[pageId];
6101
- const pageBackgroundImageAssets = backgroundImageAssetsByPage[pageId];
6102
- const rootInstanceId = pageData.page.rootInstanceId;
6103
- const instances = new Map(pageData.build.instances);
6198
+ const pageFontAssets = fontAssetsByPage[page.id];
6199
+ const pageBackgroundImageAssets = backgroundImageAssetsByPage[page.id];
6104
6200
  const props2 = new Map(pageData.build.props);
6105
6201
  const dataSources = new Map(pageData.build.dataSources);
6106
6202
  const resources = new Map(pageData.build.resources);
@@ -6115,49 +6211,51 @@ Please check webstudio --help for more details`
6115
6211
  rootInstanceId,
6116
6212
  parameters: [
6117
6213
  {
6118
- id: `system`,
6214
+ id: `page-system`,
6119
6215
  instanceId: "",
6120
6216
  name: "system",
6121
6217
  type: "parameter",
6122
- value: pageData.page.systemDataSourceId ?? ""
6218
+ value: page.systemDataSourceId ?? ""
6219
+ },
6220
+ {
6221
+ id: "global-system",
6222
+ type: "parameter",
6223
+ instanceId: "",
6224
+ name: "system",
6225
+ value: SYSTEM_VARIABLE_ID
6123
6226
  }
6124
6227
  ],
6125
6228
  instances,
6126
6229
  props: props2,
6127
6230
  dataSources,
6128
6231
  classesMap: classes,
6129
- indexesWithinAncestors: getIndexesWithinAncestors(
6130
- projectMetas,
6131
- instances,
6132
- [rootInstanceId]
6133
- )
6232
+ metas: usedMetas
6134
6233
  });
6135
6234
  const projectMeta = siteData.build.pages.meta;
6136
6235
  const contactEmail = (
6137
6236
  // fallback to user email when contact email is empty string
6138
- (projectMeta == null ? void 0 : projectMeta.contactEmail) || ((_i = siteData.user) == null ? void 0 : _i.email) || void 0
6237
+ (projectMeta == null ? void 0 : projectMeta.contactEmail) || ((_j = siteData.user) == null ? void 0 : _j.email) || void 0
6139
6238
  );
6140
- const favIconAsset = assets.get((projectMeta == null ? void 0 : projectMeta.faviconAssetId) ?? "");
6141
- const pagePath = getPagePath(pageData.page.id, siteData.build.pages);
6239
+ const favIconAsset = (_k = assets.get((projectMeta == null ? void 0 : projectMeta.faviconAssetId) ?? "")) == null ? void 0 : _k.name;
6240
+ const pagePath = getPagePath(page.id, siteData.build.pages);
6142
6241
  const pageExports = `/* eslint-disable */
6143
6242
  /* This is a auto generated file for building the project */
6144
6243
 
6145
6244
 
6146
6245
  import { Fragment, useState } from "react";
6147
- import type { FontAsset, ImageAsset } from "@webstudio-is/sdk";
6148
6246
  import { useResource, useVariableState } from "@webstudio-is/react-sdk/runtime";
6149
6247
  ${componentImports}
6150
6248
 
6151
6249
  export const siteName = ${JSON.stringify(projectMeta == null ? void 0 : projectMeta.siteName)};
6152
6250
 
6153
- export const favIconAsset: ImageAsset | undefined =
6251
+ export const favIconAsset: string | undefined =
6154
6252
  ${JSON.stringify(favIconAsset)};
6155
6253
 
6156
6254
  // Font assets on current page (can be preloaded)
6157
- export const pageFontAssets: FontAsset[] =
6255
+ export const pageFontAssets: string[] =
6158
6256
  ${JSON.stringify(pageFontAssets)}
6159
6257
 
6160
- export const pageBackgroundImageAssets: ImageAsset[] =
6258
+ export const pageBackgroundImageAssets: string[] =
6161
6259
  ${JSON.stringify(pageBackgroundImageAssets)}
6162
6260
 
6163
6261
  ${pagePath === "/" ? `
@@ -6183,8 +6281,6 @@ Please check webstudio --help for more details`
6183
6281
  }
6184
6282
  ` : ""}
6185
6283
 
6186
- ${xmlPresentationComponents}
6187
-
6188
6284
  ${pageComponent}
6189
6285
 
6190
6286
  export { Page }
@@ -6196,7 +6292,7 @@ Please check webstudio --help for more details`
6196
6292
  import type { PageMeta } from "@webstudio-is/sdk";
6197
6293
  ${generateResources({
6198
6294
  scope,
6199
- page: pageData.page,
6295
+ page,
6200
6296
  dataSources,
6201
6297
  props: props2,
6202
6298
  resources
@@ -6204,12 +6300,12 @@ Please check webstudio --help for more details`
6204
6300
 
6205
6301
  ${generatePageMeta({
6206
6302
  globalScope: scope,
6207
- page: pageData.page,
6303
+ page,
6208
6304
  dataSources,
6209
6305
  assets
6210
6306
  })}
6211
6307
 
6212
- ${generateRemixParams(pageData.page.path)}
6308
+ ${generateRemixParams(page.path)}
6213
6309
 
6214
6310
  export const projectId = "${siteData.build.projectId}";
6215
6311
 
@@ -6255,7 +6351,7 @@ Please check webstudio --help for more details`
6255
6351
  )};
6256
6352
  `
6257
6353
  );
6258
- const redirects = (_j = siteData.build.pages) == null ? void 0 : _j.redirects;
6354
+ const redirects = (_l = siteData.build.pages) == null ? void 0 : _l.redirects;
6259
6355
  if (redirects !== void 0 && redirects.length > 0) {
6260
6356
  for (const redirect of redirects) {
6261
6357
  const generatedBasename = generateRemixRoute(redirect.old);
@@ -6418,8 +6514,6 @@ const getDeploymentInstructions = (deployTarget) => {
6418
6514
  case "vercel":
6419
6515
  return `Run ${pc.dim("npx vercel")} to publish on Vercel.`;
6420
6516
  case "netlify":
6421
- case "netlify-functions":
6422
- case "netlify-edge-functions":
6423
6517
  return [
6424
6518
  `To deploy to Netlify, run the following commands: `,
6425
6519
  `Run ${pc.dim("npx netlify-cli login")} to login to Netlify.`,
@@ -6432,7 +6526,7 @@ const getDeploymentInstructions = (deployTarget) => {
6432
6526
  }
6433
6527
  };
6434
6528
  const name = "webstudio";
6435
- const version = "0.0.0-bd48788";
6529
+ const version = "0.0.0-bdb8a58";
6436
6530
  const description = "Webstudio CLI";
6437
6531
  const author = "Webstudio <github@webstudio.is>";
6438
6532
  const homepage = "https://webstudio.is";
@@ -6463,9 +6557,9 @@ const engines = {
6463
6557
  node: ">=20.12"
6464
6558
  };
6465
6559
  const dependencies = {
6466
- "@clack/prompts": "^0.9.1",
6560
+ "@clack/prompts": "^0.10.0",
6467
6561
  "@emotion/hash": "^0.9.2",
6468
- acorn: "^8.14.0",
6562
+ acorn: "^8.14.1",
6469
6563
  "acorn-walk": "^8.3.4",
6470
6564
  "change-case": "^5.4.4",
6471
6565
  deepmerge: "^4.3.1",
@@ -6480,11 +6574,9 @@ const dependencies = {
6480
6574
  zod: "^3.22.4"
6481
6575
  };
6482
6576
  const devDependencies = {
6483
- "@netlify/remix-adapter": "^2.5.1",
6484
- "@netlify/remix-edge-adapter": "3.4.2",
6485
6577
  "@netlify/vite-plugin-react-router": "^1.0.0",
6486
- "@react-router/dev": "^7.1.4",
6487
- "@react-router/fs-routes": "^7.1.4",
6578
+ "@react-router/dev": "^7.3.0",
6579
+ "@react-router/fs-routes": "^7.3.0",
6488
6580
  "@remix-run/cloudflare": "^2.15.2",
6489
6581
  "@remix-run/cloudflare-pages": "^2.15.2",
6490
6582
  "@remix-run/dev": "^2.15.2",
@@ -6494,6 +6586,7 @@ const devDependencies = {
6494
6586
  "@types/react": "^18.2.70",
6495
6587
  "@types/react-dom": "^18.2.25",
6496
6588
  "@types/yargs": "^17.0.33",
6589
+ "@vercel/react-router": "^1.1.0",
6497
6590
  "@vitejs/plugin-react": "^4.3.4",
6498
6591
  "@webstudio-is/http-client": "workspace:*",
6499
6592
  "@webstudio-is/image": "workspace:*",
@@ -6505,16 +6598,16 @@ const devDependencies = {
6505
6598
  "@webstudio-is/sdk-components-react-remix": "workspace:*",
6506
6599
  "@webstudio-is/sdk-components-react-router": "workspace:*",
6507
6600
  "@webstudio-is/tsconfig": "workspace:*",
6508
- h3: "^1.14.0",
6601
+ h3: "^1.15.1",
6509
6602
  ipx: "^3.0.1",
6510
6603
  prettier: "3.4.2",
6511
6604
  react: "18.3.0-canary-14898b6a9-20240318",
6512
6605
  "react-dom": "18.3.0-canary-14898b6a9-20240318",
6513
- "react-router": "^7.1.4",
6606
+ "react-router": "^7.3.0",
6514
6607
  "ts-expect": "^1.3.0",
6515
- vike: "^0.4.220",
6608
+ vike: "^0.4.224",
6516
6609
  vite: "^5.4.11",
6517
- vitest: "^3.0.2",
6610
+ vitest: "^3.0.4",
6518
6611
  wrangler: "^3.63.2"
6519
6612
  };
6520
6613
  const packageJson = {