webstudio 0.204.0 → 0.206.0

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.
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,7 +79,7 @@ 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",
@@ -709,18 +704,48 @@ const getFontFaces = (assets, options) => {
709
704
  }
710
705
  return Array.from(faces.values());
711
706
  };
712
- const addGlobalRules = (sheet, { assets, assetBaseUrl }) => {
713
- const fontAssets = [];
714
- for (const asset of assets.values()) {
715
- if (asset.type === "font") {
716
- fontAssets.push(asset);
717
- }
718
- }
719
- const fontFaces = getFontFaces(fontAssets, { assetBaseUrl });
720
- for (const fontFace of fontFaces) {
721
- sheet.addFontFaceRule(fontFace);
722
- }
723
- };
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)]);
724
749
  const prefixStyles = (styleMap) => {
725
750
  const newStyleMap = /* @__PURE__ */ new Map();
726
751
  for (const [property, value] of styleMap) {
@@ -736,7 +761,7 @@ const prefixStyles = (styleMap) => {
736
761
  if (property === "backdrop-filter") {
737
762
  newStyleMap.set("-webkit-backdrop-filter", value);
738
763
  }
739
- if (property === "view-timeline-name" || property === "scroll-timeline-name") {
764
+ if (property === "view-timeline-name" || property === "scroll-timeline-name" || property === "view-timeline-inset") {
740
765
  newStyleMap.set(`--${property}`, value);
741
766
  }
742
767
  newStyleMap.set(property, value);
@@ -1081,7 +1106,10 @@ const mergeStyles = (styleMap) => {
1081
1106
  mergeBackgroundPosition(newStyle);
1082
1107
  return newStyle;
1083
1108
  };
1084
- 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
+ );
1085
1113
  const mapGroupBy = (array, getKey2) => {
1086
1114
  const groups = /* @__PURE__ */ new Map();
1087
1115
  for (const item of array) {
@@ -1119,11 +1147,10 @@ const mergeDeclarations = (declarations) => {
1119
1147
  }
1120
1148
  return newDeclarations;
1121
1149
  };
1122
- const generateStyleMap = ({
1123
- style,
1150
+ const generateStyleMap = (style, {
1124
1151
  indent = 0,
1125
1152
  transformValue
1126
- }) => {
1153
+ } = {}) => {
1127
1154
  const spaces = " ".repeat(indent);
1128
1155
  let lines = "";
1129
1156
  for (const [property, value] of style) {
@@ -1256,8 +1283,7 @@ class NestingRule {
1256
1283
  const generated = Array.from(styleBySelector).sort(
1257
1284
  ([leftSelector], [rightSelector]) => leftSelector.localeCompare(rightSelector)
1258
1285
  ).map(([selector, style]) => {
1259
- const content = generateStyleMap({
1260
- style: prefixStyles(style),
1286
+ const content = generateStyleMap(prefixStyles(style), {
1261
1287
  indent: indent + 2,
1262
1288
  transformValue
1263
1289
  });
@@ -1618,48 +1644,6 @@ const generateAtomic = (sheet, options) => {
1618
1644
  });
1619
1645
  return { cssText, classes };
1620
1646
  };
1621
- const TextChild = z.object({
1622
- type: z.literal("text"),
1623
- value: z.string(),
1624
- placeholder: z.boolean().optional()
1625
- });
1626
- const InstanceId = z.string();
1627
- const IdChild = z.object({
1628
- type: z.literal("id"),
1629
- value: InstanceId
1630
- });
1631
- const ExpressionChild = z.object({
1632
- type: z.literal("expression"),
1633
- value: z.string()
1634
- });
1635
- const InstanceChild = z.union([IdChild, TextChild, ExpressionChild]);
1636
- const Instance = z.object({
1637
- type: z.literal("instance"),
1638
- id: InstanceId,
1639
- component: z.string(),
1640
- label: z.string().optional(),
1641
- children: z.array(InstanceChild)
1642
- });
1643
- z.map(InstanceId, Instance);
1644
- const MatcherRelation = z.union([
1645
- z.literal("ancestor"),
1646
- z.literal("parent"),
1647
- z.literal("self"),
1648
- z.literal("child"),
1649
- z.literal("descendant")
1650
- ]);
1651
- const MatcherOperation = z.object({
1652
- $eq: z.string().optional(),
1653
- $neq: z.string().optional(),
1654
- $in: z.array(z.string()).optional(),
1655
- $nin: z.array(z.string()).optional()
1656
- });
1657
- const Matcher = z.object({
1658
- relation: MatcherRelation,
1659
- component: MatcherOperation.optional(),
1660
- tag: MatcherOperation.optional()
1661
- });
1662
- const Matchers = z.union([Matcher, z.array(Matcher)]);
1663
1647
  const common = {
1664
1648
  label: z.string().optional(),
1665
1649
  description: z.string().optional(),
@@ -1795,6 +1779,12 @@ const TextContent = z.object({
1795
1779
  type: z.literal("string"),
1796
1780
  defaultValue: z.string().optional()
1797
1781
  });
1782
+ const AnimationAction = z.object({
1783
+ ...common,
1784
+ control: z.literal("animationAction"),
1785
+ type: z.literal("animationAction"),
1786
+ defaultValue: z.undefined().optional()
1787
+ });
1798
1788
  const PropMeta = z.union([
1799
1789
  Number,
1800
1790
  Range,
@@ -1814,7 +1804,8 @@ const PropMeta = z.union([
1814
1804
  Json,
1815
1805
  Date,
1816
1806
  Action,
1817
- TextContent
1807
+ TextContent,
1808
+ AnimationAction
1818
1809
  ]);
1819
1810
  const EmbedTemplateText = z.object({
1820
1811
  type: z.literal("text"),
@@ -1901,6 +1892,12 @@ const WsEmbedTemplate = z.lazy(
1901
1892
  z.union([EmbedTemplateInstance, EmbedTemplateText, EmbedTemplateExpression])
1902
1893
  )
1903
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
+ });
1904
1901
  z.object({
1905
1902
  props: z.record(PropMeta),
1906
1903
  // Props that will be always visible in properties panel.
@@ -1938,6 +1935,11 @@ z.object({
1938
1935
  // embed - images, videos or other embeddable components, without children
1939
1936
  // rich-text-child - formatted text fragment, not listed in components list
1940
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(),
1941
1943
  constraints: Matchers.optional(),
1942
1944
  // when this field is specified component receives
1943
1945
  // prop with index of same components withiin specified ancestor
@@ -1947,9 +1949,7 @@ z.object({
1947
1949
  label: z.optional(z.string()),
1948
1950
  description: z.string().optional(),
1949
1951
  icon: z.string(),
1950
- presetStyle: z.optional(
1951
- z.record(z.string(), z.array(EmbedTemplateStyleDecl))
1952
- ),
1952
+ presetStyle: z.optional(z.record(z.string(), z.array(PresetStyleDecl))),
1953
1953
  states: z.optional(z.array(ComponentState)),
1954
1954
  template: z.optional(WsEmbedTemplate),
1955
1955
  order: z.number().optional()
@@ -2011,21 +2011,24 @@ const WindowTitleIcon = `<svg xmlns="http://www.w3.org/2000/svg" fill="none" vie
2011
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>`;
2012
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>`;
2013
2013
  const div = [
2014
- { property: "boxSizing", value: { type: "keyword", value: "border-box" } },
2015
- { property: "borderTopWidth", value: { type: "unit", unit: "px", value: 1 } },
2014
+ { property: "box-sizing", value: { type: "keyword", value: "border-box" } },
2015
+ {
2016
+ property: "border-top-width",
2017
+ value: { type: "unit", unit: "px", value: 1 }
2018
+ },
2016
2019
  {
2017
- property: "borderRightWidth",
2020
+ property: "border-right-width",
2018
2021
  value: { type: "unit", unit: "px", value: 1 }
2019
2022
  },
2020
2023
  {
2021
- property: "borderBottomWidth",
2024
+ property: "border-bottom-width",
2022
2025
  value: { type: "unit", unit: "px", value: 1 }
2023
2026
  },
2024
2027
  {
2025
- property: "borderLeftWidth",
2028
+ property: "border-left-width",
2026
2029
  value: { type: "unit", unit: "px", value: 1 }
2027
2030
  },
2028
- { property: "outlineWidth", value: { type: "unit", unit: "px", value: 1 } }
2031
+ { property: "outline-width", value: { type: "unit", unit: "px", value: 1 } }
2029
2032
  ];
2030
2033
  const address = div;
2031
2034
  const article = div;
@@ -2055,88 +2058,100 @@ const p = div;
2055
2058
  const span = div;
2056
2059
  const html = [
2057
2060
  { property: "display", value: { type: "keyword", value: "grid" } },
2058
- { property: "minHeight", value: { type: "unit", unit: "%", value: 100 } },
2061
+ { property: "min-height", value: { type: "unit", unit: "%", value: 100 } },
2059
2062
  {
2060
- property: "fontFamily",
2063
+ property: "font-family",
2061
2064
  value: { type: "fontFamily", value: ["Arial", "Roboto", "sans-serif"] }
2062
2065
  },
2063
- { property: "fontSize", value: { type: "unit", unit: "px", value: 16 } },
2066
+ { property: "font-size", value: { type: "unit", unit: "px", value: 16 } },
2064
2067
  {
2065
- property: "lineHeight",
2068
+ property: "line-height",
2066
2069
  value: { type: "unit", unit: "number", value: 1.2 }
2067
2070
  },
2068
2071
  {
2069
- property: "whiteSpaceCollapse",
2072
+ property: "white-space-collapse",
2070
2073
  value: { type: "keyword", value: "preserve" }
2071
2074
  }
2072
2075
  ];
2073
2076
  const body = [
2074
- { property: "marginTop", value: { type: "unit", unit: "number", value: 0 } },
2077
+ { property: "margin-top", value: { type: "unit", unit: "number", value: 0 } },
2075
2078
  {
2076
- property: "marginRight",
2079
+ property: "margin-right",
2077
2080
  value: { type: "unit", unit: "number", value: 0 }
2078
2081
  },
2079
2082
  {
2080
- property: "marginBottom",
2083
+ property: "margin-bottom",
2081
2084
  value: { type: "unit", unit: "number", value: 0 }
2082
2085
  },
2083
- { property: "marginLeft", value: { type: "unit", unit: "number", value: 0 } },
2084
- { property: "boxSizing", value: { type: "keyword", value: "border-box" } },
2085
- { property: "borderTopWidth", value: { type: "unit", unit: "px", value: 1 } },
2086
2086
  {
2087
- 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",
2093
+ value: { type: "unit", unit: "px", value: 1 }
2094
+ },
2095
+ {
2096
+ property: "border-right-width",
2088
2097
  value: { type: "unit", unit: "px", value: 1 }
2089
2098
  },
2090
2099
  {
2091
- property: "borderBottomWidth",
2100
+ property: "border-bottom-width",
2092
2101
  value: { type: "unit", unit: "px", value: 1 }
2093
2102
  },
2094
2103
  {
2095
- property: "borderLeftWidth",
2104
+ property: "border-left-width",
2096
2105
  value: { type: "unit", unit: "px", value: 1 }
2097
2106
  }
2098
2107
  ];
2099
2108
  const hr = [
2100
2109
  { property: "height", value: { type: "unit", unit: "number", value: 0 } },
2101
2110
  { property: "color", value: { type: "keyword", value: "inherit" } },
2102
- { property: "boxSizing", value: { type: "keyword", value: "border-box" } },
2103
- { property: "borderTopWidth", value: { type: "unit", unit: "px", value: 1 } },
2111
+ { property: "box-sizing", value: { type: "keyword", value: "border-box" } },
2104
2112
  {
2105
- property: "borderRightWidth",
2113
+ property: "border-top-width",
2106
2114
  value: { type: "unit", unit: "px", value: 1 }
2107
2115
  },
2108
2116
  {
2109
- property: "borderBottomWidth",
2117
+ property: "border-right-width",
2110
2118
  value: { type: "unit", unit: "px", value: 1 }
2111
2119
  },
2112
2120
  {
2113
- property: "borderLeftWidth",
2121
+ property: "border-bottom-width",
2122
+ value: { type: "unit", unit: "px", value: 1 }
2123
+ },
2124
+ {
2125
+ property: "border-left-width",
2114
2126
  value: { type: "unit", unit: "px", value: 1 }
2115
2127
  }
2116
2128
  ];
2117
2129
  const b = [
2118
2130
  {
2119
- property: "fontWeight",
2131
+ property: "font-weight",
2120
2132
  value: { type: "unit", unit: "number", value: 700 }
2121
2133
  },
2122
- { property: "boxSizing", value: { type: "keyword", value: "border-box" } },
2123
- { 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
+ },
2124
2139
  {
2125
- property: "borderRightWidth",
2140
+ property: "border-right-width",
2126
2141
  value: { type: "unit", unit: "px", value: 1 }
2127
2142
  },
2128
2143
  {
2129
- property: "borderBottomWidth",
2144
+ property: "border-bottom-width",
2130
2145
  value: { type: "unit", unit: "px", value: 1 }
2131
2146
  },
2132
2147
  {
2133
- property: "borderLeftWidth",
2148
+ property: "border-left-width",
2134
2149
  value: { type: "unit", unit: "px", value: 1 }
2135
2150
  }
2136
2151
  ];
2137
2152
  const code = [
2138
2153
  {
2139
- property: "fontFamily",
2154
+ property: "font-family",
2140
2155
  value: {
2141
2156
  type: "fontFamily",
2142
2157
  value: [
@@ -2149,174 +2164,222 @@ const code = [
2149
2164
  ]
2150
2165
  }
2151
2166
  },
2152
- { property: "fontSize", value: { type: "unit", unit: "em", value: 1 } },
2153
- { property: "boxSizing", value: { type: "keyword", value: "border-box" } },
2154
- { 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" } },
2155
2169
  {
2156
- property: "borderRightWidth",
2170
+ property: "border-top-width",
2157
2171
  value: { type: "unit", unit: "px", value: 1 }
2158
2172
  },
2159
2173
  {
2160
- property: "borderBottomWidth",
2174
+ property: "border-right-width",
2161
2175
  value: { type: "unit", unit: "px", value: 1 }
2162
2176
  },
2163
2177
  {
2164
- property: "borderLeftWidth",
2178
+ property: "border-bottom-width",
2179
+ value: { type: "unit", unit: "px", value: 1 }
2180
+ },
2181
+ {
2182
+ property: "border-left-width",
2165
2183
  value: { type: "unit", unit: "px", value: 1 }
2166
2184
  }
2167
2185
  ];
2168
2186
  const sub = [
2169
- { property: "fontSize", value: { type: "unit", unit: "%", value: 75 } },
2170
- { 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
+ },
2171
2192
  { property: "position", value: { type: "keyword", value: "relative" } },
2172
- { property: "verticalAlign", value: { type: "keyword", value: "baseline" } },
2173
- { property: "boxSizing", value: { type: "keyword", value: "border-box" } },
2174
- { 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" } },
2175
2195
  {
2176
- property: "borderRightWidth",
2196
+ property: "border-top-width",
2177
2197
  value: { type: "unit", unit: "px", value: 1 }
2178
2198
  },
2179
2199
  {
2180
- property: "borderBottomWidth",
2200
+ property: "border-right-width",
2181
2201
  value: { type: "unit", unit: "px", value: 1 }
2182
2202
  },
2183
2203
  {
2184
- property: "borderLeftWidth",
2204
+ property: "border-bottom-width",
2205
+ value: { type: "unit", unit: "px", value: 1 }
2206
+ },
2207
+ {
2208
+ property: "border-left-width",
2185
2209
  value: { type: "unit", unit: "px", value: 1 }
2186
2210
  },
2187
2211
  { property: "bottom", value: { type: "unit", unit: "em", value: -0.25 } }
2188
2212
  ];
2189
2213
  const sup = [
2190
- { property: "fontSize", value: { type: "unit", unit: "%", value: 75 } },
2191
- { 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
+ },
2192
2219
  { property: "position", value: { type: "keyword", value: "relative" } },
2193
- { property: "verticalAlign", value: { type: "keyword", value: "baseline" } },
2194
- { property: "boxSizing", value: { type: "keyword", value: "border-box" } },
2195
- { 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" } },
2196
2222
  {
2197
- property: "borderRightWidth",
2223
+ property: "border-top-width",
2198
2224
  value: { type: "unit", unit: "px", value: 1 }
2199
2225
  },
2200
2226
  {
2201
- property: "borderBottomWidth",
2227
+ property: "border-right-width",
2202
2228
  value: { type: "unit", unit: "px", value: 1 }
2203
2229
  },
2204
2230
  {
2205
- property: "borderLeftWidth",
2231
+ property: "border-bottom-width",
2232
+ value: { type: "unit", unit: "px", value: 1 }
2233
+ },
2234
+ {
2235
+ property: "border-left-width",
2206
2236
  value: { type: "unit", unit: "px", value: 1 }
2207
2237
  },
2208
2238
  { property: "top", value: { type: "unit", unit: "em", value: -0.5 } }
2209
2239
  ];
2210
2240
  const input = [
2211
- { property: "fontFamily", value: { type: "keyword", value: "inherit" } },
2212
- { 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 } },
2213
2243
  {
2214
- property: "lineHeight",
2244
+ property: "line-height",
2215
2245
  value: { type: "unit", unit: "number", value: 1.15 }
2216
2246
  },
2217
- { property: "marginTop", value: { type: "unit", unit: "number", value: 0 } },
2247
+ { property: "margin-top", value: { type: "unit", unit: "number", value: 0 } },
2248
+ {
2249
+ property: "margin-right",
2250
+ value: { type: "unit", unit: "number", value: 0 }
2251
+ },
2218
2252
  {
2219
- property: "marginRight",
2253
+ property: "margin-bottom",
2220
2254
  value: { type: "unit", unit: "number", value: 0 }
2221
2255
  },
2222
2256
  {
2223
- property: "marginBottom",
2257
+ property: "margin-left",
2224
2258
  value: { type: "unit", unit: "number", value: 0 }
2225
2259
  },
2226
- { property: "marginLeft", value: { type: "unit", unit: "number", value: 0 } },
2227
- { property: "boxSizing", value: { type: "keyword", value: "border-box" } },
2228
- { property: "borderTopWidth", value: { type: "unit", unit: "px", value: 1 } },
2260
+ { property: "box-sizing", value: { type: "keyword", value: "border-box" } },
2261
+ {
2262
+ property: "border-top-width",
2263
+ value: { type: "unit", unit: "px", value: 1 }
2264
+ },
2229
2265
  {
2230
- property: "borderRightWidth",
2266
+ property: "border-right-width",
2231
2267
  value: { type: "unit", unit: "px", value: 1 }
2232
2268
  },
2233
2269
  {
2234
- property: "borderBottomWidth",
2270
+ property: "border-bottom-width",
2235
2271
  value: { type: "unit", unit: "px", value: 1 }
2236
2272
  },
2237
2273
  {
2238
- property: "borderLeftWidth",
2274
+ property: "border-left-width",
2239
2275
  value: { type: "unit", unit: "px", value: 1 }
2240
2276
  },
2241
- { property: "borderTopStyle", value: { type: "keyword", value: "solid" } },
2242
- { property: "borderRightStyle", value: { type: "keyword", value: "solid" } },
2243
- { property: "borderBottomStyle", value: { type: "keyword", value: "solid" } },
2244
- { property: "borderLeftStyle", value: { type: "keyword", value: "solid" } }
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" } }
2245
2287
  ];
2246
2288
  const textarea = input;
2247
2289
  const radio = [
2248
- { property: "fontFamily", value: { type: "keyword", value: "inherit" } },
2249
- { 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 } },
2250
2292
  {
2251
- property: "lineHeight",
2293
+ property: "line-height",
2252
2294
  value: { type: "unit", unit: "number", value: 1.15 }
2253
2295
  },
2254
- { property: "marginTop", value: { type: "unit", unit: "number", value: 0 } },
2296
+ { property: "margin-top", value: { type: "unit", unit: "number", value: 0 } },
2255
2297
  {
2256
- property: "marginRight",
2298
+ property: "margin-right",
2257
2299
  value: { type: "unit", unit: "number", value: 0 }
2258
2300
  },
2259
2301
  {
2260
- property: "marginBottom",
2302
+ property: "margin-bottom",
2261
2303
  value: { type: "unit", unit: "number", value: 0 }
2262
2304
  },
2263
- { property: "marginLeft", value: { type: "unit", unit: "number", value: 0 } },
2264
- { property: "boxSizing", value: { type: "keyword", value: "border-box" } },
2265
- { property: "borderTopWidth", value: { type: "unit", unit: "px", value: 1 } },
2266
2305
  {
2267
- 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",
2268
2312
  value: { type: "unit", unit: "px", value: 1 }
2269
2313
  },
2270
2314
  {
2271
- property: "borderBottomWidth",
2315
+ property: "border-right-width",
2272
2316
  value: { type: "unit", unit: "px", value: 1 }
2273
2317
  },
2274
2318
  {
2275
- property: "borderLeftWidth",
2319
+ property: "border-bottom-width",
2276
2320
  value: { type: "unit", unit: "px", value: 1 }
2277
2321
  },
2278
- { property: "borderTopStyle", value: { type: "keyword", value: "none" } },
2279
- { property: "borderRightStyle", value: { type: "keyword", value: "none" } },
2280
- { property: "borderBottomStyle", value: { type: "keyword", value: "none" } },
2281
- { 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" } }
2282
2333
  ];
2283
2334
  const checkbox = radio;
2284
2335
  const button = [
2285
- { property: "fontFamily", value: { type: "keyword", value: "inherit" } },
2286
- { 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 } },
2287
2338
  {
2288
- property: "lineHeight",
2339
+ property: "line-height",
2289
2340
  value: { type: "unit", unit: "number", value: 1.15 }
2290
2341
  },
2291
- { 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
+ },
2292
2347
  {
2293
- property: "marginRight",
2348
+ property: "margin-bottom",
2294
2349
  value: { type: "unit", unit: "number", value: 0 }
2295
2350
  },
2296
2351
  {
2297
- property: "marginBottom",
2352
+ property: "margin-left",
2298
2353
  value: { type: "unit", unit: "number", value: 0 }
2299
2354
  },
2300
- { property: "marginLeft", value: { type: "unit", unit: "number", value: 0 } },
2301
- { property: "boxSizing", value: { type: "keyword", value: "border-box" } },
2302
- { property: "borderTopWidth", value: { type: "unit", unit: "px", value: 1 } },
2355
+ { property: "box-sizing", value: { type: "keyword", value: "border-box" } },
2303
2356
  {
2304
- property: "borderRightWidth",
2357
+ property: "border-top-width",
2305
2358
  value: { type: "unit", unit: "px", value: 1 }
2306
2359
  },
2307
2360
  {
2308
- property: "borderBottomWidth",
2361
+ property: "border-right-width",
2309
2362
  value: { type: "unit", unit: "px", value: 1 }
2310
2363
  },
2311
2364
  {
2312
- property: "borderLeftWidth",
2365
+ property: "border-bottom-width",
2313
2366
  value: { type: "unit", unit: "px", value: 1 }
2314
2367
  },
2315
- { property: "borderTopStyle", value: { type: "keyword", value: "solid" } },
2316
- { property: "borderRightStyle", value: { type: "keyword", value: "solid" } },
2317
- { property: "borderBottomStyle", value: { type: "keyword", value: "solid" } },
2318
- { property: "borderLeftStyle", value: { type: "keyword", value: "solid" } },
2319
- { property: "textTransform", value: { type: "keyword", value: "none" } }
2368
+ {
2369
+ property: "border-left-width",
2370
+ value: { type: "unit", unit: "px", value: 1 }
2371
+ },
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" } }
2320
2383
  ];
2321
2384
  const select = button;
2322
2385
  const rootComponent = "ws:root";
@@ -2413,6 +2476,58 @@ const parseComponentName = (componentName) => {
2413
2476
  }
2414
2477
  return [namespace, name2];
2415
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
+ };
2416
2531
  const transpileExpression = ({
2417
2532
  expression,
2418
2533
  executable = false,
@@ -2462,7 +2577,10 @@ const transpileExpression = ({
2462
2577
  return expression;
2463
2578
  };
2464
2579
  const dataSourceVariablePrefix = "$ws$dataSource$";
2465
- const decodeDataSourceVariable = (name2) => {
2580
+ const decodeDataVariableId = (name2) => {
2581
+ if (name2 === "$ws$system") {
2582
+ return SYSTEM_VARIABLE_ID;
2583
+ }
2466
2584
  if (name2.startsWith(dataSourceVariablePrefix)) {
2467
2585
  const encoded = name2.slice(dataSourceVariablePrefix.length);
2468
2586
  return encoded.replaceAll("__DASH__", "-");
@@ -2479,8 +2597,11 @@ const generateExpression = ({
2479
2597
  expression,
2480
2598
  executable: true,
2481
2599
  replaceVariable: (identifier) => {
2482
- const depId = decodeDataSourceVariable(identifier);
2483
- 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
+ }
2484
2605
  if (dep) {
2485
2606
  usedDataSources == null ? void 0 : usedDataSources.set(dep.id, dep);
2486
2607
  return scope.getName(dep.id, dep.name);
@@ -2650,12 +2771,11 @@ const generateResources = ({
2650
2771
  `;
2651
2772
  }
2652
2773
  if (dataSource.type === "parameter") {
2653
- if (dataSource.id !== page.systemDataSourceId) {
2654
- continue;
2655
- }
2656
- const name2 = scope.getName(dataSource.id, dataSource.name);
2657
- 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
2658
2777
  `;
2778
+ }
2659
2779
  }
2660
2780
  }
2661
2781
  let generated = "";
@@ -2852,7 +2972,7 @@ const generatePageMeta = ({
2852
2972
  continue;
2853
2973
  }
2854
2974
  if (dataSource.type === "parameter") {
2855
- if (dataSource.id === page.systemDataSourceId) {
2975
+ if (dataSource.id === page.systemDataSourceId || dataSource.id === SYSTEM_VARIABLE_ID) {
2856
2976
  const valueName = localScope.getName(dataSource.id, dataSource.name);
2857
2977
  generated += ` let ${valueName} = system
2858
2978
  `;
@@ -2896,6 +3016,22 @@ const generatePageMeta = ({
2896
3016
  `;
2897
3017
  return generated;
2898
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
+ };
2899
3035
  const createImageValueTransformer = (assets, { assetBaseUrl }) => (styleValue) => {
2900
3036
  if (styleValue.type === "image" && styleValue.value.type === "asset") {
2901
3037
  const asset = assets.get(styleValue.value.value);
@@ -2925,10 +3061,11 @@ const generateCss = ({
2925
3061
  assetBaseUrl,
2926
3062
  atomic
2927
3063
  }) => {
2928
- const globalSheet = createRegularStyleSheet({ name: "ssr" });
2929
- const sheet = createRegularStyleSheet({ name: "ssr" });
2930
- addGlobalRules(globalSheet, { assets, assetBaseUrl });
2931
- 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");
2932
3069
  const presetClasses = /* @__PURE__ */ new Map();
2933
3070
  const scope = createScope([], normalizeClassName, "-");
2934
3071
  for (const [component, meta2] of componentMetas) {
@@ -2939,8 +3076,8 @@ const generateCss = ({
2939
3076
  presetClasses.set(component, className);
2940
3077
  }
2941
3078
  for (const [tag, styles2] of presetStyle2) {
2942
- const selector = component === rootComponent ? ":root" : `:where(${tag}.${className})`;
2943
- const rule = globalSheet.addNestingRule(selector);
3079
+ const selector = component === rootComponent ? ":root" : `${tag}.${className}`;
3080
+ const rule = presetSheet.addNestingRule(selector);
2944
3081
  for (const declaration of styles2) {
2945
3082
  rule.setDeclaration({
2946
3083
  breakpoint: "presets",
@@ -2952,14 +3089,14 @@ const generateCss = ({
2952
3089
  }
2953
3090
  }
2954
3091
  for (const breakpoint of breakpoints.values()) {
2955
- sheet.addMediaRule(breakpoint.id, breakpoint);
3092
+ userSheet.addMediaRule(breakpoint.id, breakpoint);
2956
3093
  }
2957
3094
  const imageValueTransformer = createImageValueTransformer(assets, {
2958
3095
  assetBaseUrl
2959
3096
  });
2960
- sheet.setTransformer(imageValueTransformer);
3097
+ userSheet.setTransformer(imageValueTransformer);
2961
3098
  for (const styleDecl of styles.values()) {
2962
- const rule = sheet.addMixinRule(styleDecl.styleSourceId);
3099
+ const rule = userSheet.addMixinRule(styleDecl.styleSourceId);
2963
3100
  rule.setDeclaration({
2964
3101
  breakpoint: styleDecl.breakpointId,
2965
3102
  selector: styleDecl.state ?? "",
@@ -2991,7 +3128,7 @@ const generateCss = ({
2991
3128
  let { instanceId } = selection;
2992
3129
  const { values } = selection;
2993
3130
  if (instanceId === ROOT_INSTANCE_ID) {
2994
- const rule2 = sheet.addNestingRule(`:root`);
3131
+ const rule2 = userSheet.addNestingRule(`:root`);
2995
3132
  rule2.applyMixins(values);
2996
3133
  continue;
2997
3134
  }
@@ -3020,22 +3157,30 @@ const generateCss = ({
3020
3157
  }
3021
3158
  classList.push(className);
3022
3159
  }
3023
- const rule = sheet.addNestingRule(`.${className}`, descendantSuffix);
3160
+ const rule = userSheet.addNestingRule(`.${className}`, descendantSuffix);
3024
3161
  rule.applyMixins(values);
3025
3162
  instanceByRule.set(rule, instanceId);
3026
3163
  }
3164
+ const fontCss = fontSheet.cssText;
3165
+ const presetCss = presetSheet.cssText.replaceAll(
3166
+ "@media all ",
3167
+ "@layer presets "
3168
+ );
3027
3169
  if (atomic) {
3028
- const { cssText } = generateAtomic(sheet, {
3170
+ const { cssText } = generateAtomic(userSheet, {
3029
3171
  getKey: (rule) => instanceByRule.get(rule),
3030
3172
  transformValue: imageValueTransformer,
3031
3173
  classes
3032
3174
  });
3033
- return { cssText: `${globalSheet.cssText}
3034
- ${cssText}`, classes };
3175
+ return {
3176
+ cssText: `${fontCss}${presetCss}
3177
+ ${cssText}`,
3178
+ classes
3179
+ };
3035
3180
  }
3036
3181
  return {
3037
- cssText: `${globalSheet.cssText}
3038
- ${sheet.cssText}`,
3182
+ cssText: `${fontCss}${presetCss}
3183
+ ${userSheet.cssText}`,
3039
3184
  classes
3040
3185
  };
3041
3186
  };
@@ -3220,48 +3365,6 @@ const namespaceMeta = (meta2, namespace, components) => {
3220
3365
  }
3221
3366
  return newMeta;
3222
3367
  };
3223
- const getIndexesWithinAncestors = (metas, instances, rootIds) => {
3224
- const ancestors = /* @__PURE__ */ new Set();
3225
- for (const meta2 of metas.values()) {
3226
- if (meta2.indexWithinAncestor !== void 0) {
3227
- ancestors.add(meta2.indexWithinAncestor);
3228
- }
3229
- }
3230
- const indexes = /* @__PURE__ */ new Map();
3231
- const traverseInstances2 = (instances2, instanceId, latestIndexes2 = /* @__PURE__ */ new Map()) => {
3232
- const instance = instances2.get(instanceId);
3233
- if (instance === void 0) {
3234
- return;
3235
- }
3236
- const meta2 = metas.get(instance.component);
3237
- if (meta2 === void 0) {
3238
- return;
3239
- }
3240
- if (ancestors.has(instance.component)) {
3241
- latestIndexes2 = new Map(latestIndexes2);
3242
- latestIndexes2.set(instance.component, /* @__PURE__ */ new Map());
3243
- }
3244
- if (meta2.indexWithinAncestor !== void 0) {
3245
- const ancestorIndexes = latestIndexes2.get(meta2.indexWithinAncestor);
3246
- if (ancestorIndexes !== void 0) {
3247
- let index = ancestorIndexes.get(instance.component) ?? -1;
3248
- index += 1;
3249
- ancestorIndexes.set(instance.component, index);
3250
- indexes.set(instance.id, index);
3251
- }
3252
- }
3253
- for (const child of instance.children) {
3254
- if (child.type === "id") {
3255
- traverseInstances2(instances2, child.value, latestIndexes2);
3256
- }
3257
- }
3258
- };
3259
- const latestIndexes = /* @__PURE__ */ new Map();
3260
- for (const instanceId of rootIds) {
3261
- traverseInstances2(instances, instanceId, latestIndexes);
3262
- }
3263
- return indexes;
3264
- };
3265
3368
  const generateAction = ({
3266
3369
  scope,
3267
3370
  prop,
@@ -3280,7 +3383,7 @@ const generateAction = ({
3280
3383
  if (args == null ? void 0 : args.includes(identifier)) {
3281
3384
  return;
3282
3385
  }
3283
- const depId = decodeDataSourceVariable(identifier);
3386
+ const depId = decodeDataVariableId(identifier);
3284
3387
  const dep = depId ? dataSources.get(depId) : void 0;
3285
3388
  if (dep) {
3286
3389
  usedDataSources.set(dep.id, dep);
@@ -3324,7 +3427,7 @@ const generatePropValue = ({
3324
3427
  if (prop.type === "asset" || prop.type === "page") {
3325
3428
  return;
3326
3429
  }
3327
- 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") {
3328
3431
  return JSON.stringify(prop.value);
3329
3432
  }
3330
3433
  if (prop.type === "parameter") {
@@ -3556,13 +3659,16 @@ const generateWebstudioComponent = ({
3556
3659
  instances,
3557
3660
  props: props2,
3558
3661
  dataSources,
3559
- indexesWithinAncestors,
3662
+ metas,
3560
3663
  classesMap
3561
3664
  }) => {
3562
3665
  const instance = instances.get(rootInstanceId);
3563
3666
  if (instance === void 0) {
3564
3667
  return "";
3565
3668
  }
3669
+ const indexesWithinAncestors = getIndexesWithinAncestors(metas, instances, [
3670
+ rootInstanceId
3671
+ ]);
3566
3672
  const usedDataSources = /* @__PURE__ */ new Map();
3567
3673
  const generatedJsx = generateJsxElement({
3568
3674
  context: "expression",
@@ -3585,20 +3691,24 @@ const generateWebstudioComponent = ({
3585
3691
  })
3586
3692
  });
3587
3693
  let generatedProps = "";
3694
+ let generatedParameters = "";
3695
+ const uniqueParameters = new Set(
3696
+ parameters.map((parameter) => parameter.name)
3697
+ );
3588
3698
  if (parameters.length > 0) {
3589
- let generatedPropsValue = "{ ";
3590
- let generatedPropsType = "{ ";
3699
+ let generatedPropsType = "";
3700
+ for (const parameterName of uniqueParameters) {
3701
+ generatedPropsType += `${parameterName}: any; `;
3702
+ }
3703
+ generatedProps = `_props: { ${generatedPropsType}}`;
3591
3704
  for (const parameter of parameters) {
3592
3705
  const dataSource = usedDataSources.get(parameter.value);
3593
3706
  if (dataSource) {
3594
3707
  const valueName = scope.getName(dataSource.id, dataSource.name);
3595
- generatedPropsValue += `${parameter.name}: ${valueName}, `;
3708
+ generatedParameters += `const ${valueName} = _props.${parameter.name};
3709
+ `;
3596
3710
  }
3597
- generatedPropsType += `${parameter.name}: any; `;
3598
3711
  }
3599
- generatedPropsValue += `}`;
3600
- generatedPropsType += `}`;
3601
- generatedProps = `${generatedPropsValue}: ${generatedPropsType}`;
3602
3712
  }
3603
3713
  let generatedDataSources = "";
3604
3714
  for (const dataSource of usedDataSources.values()) {
@@ -3627,6 +3737,7 @@ const generateWebstudioComponent = ({
3627
3737
  let generatedComponent = "";
3628
3738
  generatedComponent += `const ${name2} = (${generatedProps}) => {
3629
3739
  `;
3740
+ generatedComponent += `${generatedParameters}`;
3630
3741
  generatedComponent += `${generatedDataSources}`;
3631
3742
  generatedComponent += `return ${generatedJsx}`;
3632
3743
  generatedComponent += `}
@@ -3744,14 +3855,14 @@ const htmlToJsx = (html2) => {
3744
3855
  }
3745
3856
  return result;
3746
3857
  };
3747
- const meta$I = {
3858
+ const meta$J = {
3748
3859
  category: "general",
3749
3860
  type: "container",
3750
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.",
3751
3862
  icon: SlotComponentIcon,
3752
3863
  order: 5
3753
3864
  };
3754
- const meta$H = {
3865
+ const meta$I = {
3755
3866
  type: "container",
3756
3867
  icon: ""
3757
3868
  };
@@ -3772,12 +3883,12 @@ const presetStyle$y = {
3772
3883
  value: { type: "keyword", value: "contents" }
3773
3884
  },
3774
3885
  {
3775
- property: "whiteSpaceCollapse",
3886
+ property: "white-space-collapse",
3776
3887
  value: { type: "keyword", value: "collapse" }
3777
3888
  }
3778
3889
  ]
3779
3890
  };
3780
- const meta$G = {
3891
+ const meta$H = {
3781
3892
  category: "general",
3782
3893
  type: "embed",
3783
3894
  label: "HTML Embed",
@@ -3807,7 +3918,7 @@ const meta$G = {
3807
3918
  },
3808
3919
  initialProps: ["className", "clientOnly", "executeScriptOnCanvas"]
3809
3920
  });
3810
- const meta$F = {
3921
+ const meta$G = {
3811
3922
  type: "embed",
3812
3923
  icon: MarkdownEmbedIcon,
3813
3924
  presetStyle: {
@@ -3817,7 +3928,7 @@ const meta$F = {
3817
3928
  value: { type: "keyword", value: "contents" }
3818
3929
  },
3819
3930
  {
3820
- property: "whiteSpaceCollapse",
3931
+ property: "white-space-collapse",
3821
3932
  value: { type: "keyword", value: "collapse" }
3822
3933
  }
3823
3934
  ]
@@ -3827,16 +3938,16 @@ const presetStyle$x = {
3827
3938
  body: [
3828
3939
  ...body,
3829
3940
  {
3830
- property: "WebkitFontSmoothing",
3941
+ property: "-webkit-font-smoothing",
3831
3942
  value: { type: "keyword", value: "antialiased" }
3832
3943
  },
3833
3944
  {
3834
- property: "MozOsxFontSmoothing",
3945
+ property: "-moz-osx-font-smoothing",
3835
3946
  value: { type: "keyword", value: "grayscale" }
3836
3947
  }
3837
3948
  ]
3838
3949
  };
3839
- const meta$E = {
3950
+ const meta$F = {
3840
3951
  type: "container",
3841
3952
  icon: BodyIcon,
3842
3953
  states: defaultStates,
@@ -3854,7 +3965,7 @@ const presetStyle$w = {
3854
3965
  nav,
3855
3966
  section
3856
3967
  };
3857
- const meta$D = {
3968
+ const meta$E = {
3858
3969
  category: "general",
3859
3970
  type: "container",
3860
3971
  description: "A container for content. By default this is a Div, but the tag can be changed in settings.",
@@ -3867,12 +3978,12 @@ const presetStyle$v = {
3867
3978
  div: [
3868
3979
  ...div,
3869
3980
  {
3870
- property: "minHeight",
3981
+ property: "min-height",
3871
3982
  value: { type: "unit", unit: "em", value: 1 }
3872
3983
  }
3873
3984
  ]
3874
3985
  };
3875
- const meta$C = {
3986
+ const meta$D = {
3876
3987
  type: "container",
3877
3988
  icon: TextIcon,
3878
3989
  states: defaultStates,
@@ -3886,8 +3997,9 @@ const presetStyle$u = {
3886
3997
  h5,
3887
3998
  h6
3888
3999
  };
3889
- const meta$B = {
4000
+ const meta$C = {
3890
4001
  type: "container",
4002
+ placeholder: "Heading",
3891
4003
  icon: HeadingIcon,
3892
4004
  constraints: {
3893
4005
  relation: "ancestor",
@@ -3899,8 +4011,9 @@ const meta$B = {
3899
4011
  const presetStyle$t = {
3900
4012
  p
3901
4013
  };
3902
- const meta$A = {
4014
+ const meta$B = {
3903
4015
  type: "container",
4016
+ placeholder: "Paragraph",
3904
4017
  icon: TextAlignLeftIcon,
3905
4018
  constraints: {
3906
4019
  relation: "ancestor",
@@ -3918,8 +4031,9 @@ const presetStyle$s = {
3918
4031
  }
3919
4032
  ]
3920
4033
  };
3921
- const meta$z = {
4034
+ const meta$A = {
3922
4035
  type: "container",
4036
+ placeholder: "Link",
3923
4037
  icon: LinkIcon,
3924
4038
  constraints: {
3925
4039
  relation: "ancestor",
@@ -3939,14 +4053,14 @@ const meta$z = {
3939
4053
  }
3940
4054
  ]
3941
4055
  };
3942
- const meta$y = {
3943
- ...meta$z,
4056
+ const meta$z = {
4057
+ ...meta$A,
3944
4058
  type: "rich-text-child"
3945
4059
  };
3946
4060
  const presetStyle$r = {
3947
4061
  span
3948
4062
  };
3949
- const meta$x = {
4063
+ const meta$y = {
3950
4064
  type: "rich-text-child",
3951
4065
  label: "Text",
3952
4066
  icon: PaintBrushIcon,
@@ -3956,7 +4070,7 @@ const meta$x = {
3956
4070
  const presetStyle$q = {
3957
4071
  b
3958
4072
  };
3959
- const meta$w = {
4073
+ const meta$x = {
3960
4074
  type: "rich-text-child",
3961
4075
  label: "Bold Text",
3962
4076
  icon: BoldIcon,
@@ -3967,12 +4081,12 @@ const presetStyle$p = {
3967
4081
  i: [
3968
4082
  ...i,
3969
4083
  {
3970
- property: "fontStyle",
4084
+ property: "font-style",
3971
4085
  value: { type: "keyword", value: "italic" }
3972
4086
  }
3973
4087
  ]
3974
4088
  };
3975
- const meta$v = {
4089
+ const meta$w = {
3976
4090
  type: "rich-text-child",
3977
4091
  label: "Italic Text",
3978
4092
  icon: TextItalicIcon,
@@ -3982,7 +4096,7 @@ const meta$v = {
3982
4096
  const presetStyle$o = {
3983
4097
  sup
3984
4098
  };
3985
- const meta$u = {
4099
+ const meta$v = {
3986
4100
  type: "rich-text-child",
3987
4101
  label: "Superscript Text",
3988
4102
  icon: SuperscriptIcon,
@@ -3992,7 +4106,7 @@ const meta$u = {
3992
4106
  const presetStyle$n = {
3993
4107
  sub
3994
4108
  };
3995
- const meta$t = {
4109
+ const meta$u = {
3996
4110
  type: "rich-text-child",
3997
4111
  label: "Subscript Text",
3998
4112
  icon: SubscriptIcon,
@@ -4002,7 +4116,7 @@ const meta$t = {
4002
4116
  const presetStyle$m = {
4003
4117
  button
4004
4118
  };
4005
- const meta$s = {
4119
+ const meta$t = {
4006
4120
  icon: ButtonElementIcon,
4007
4121
  type: "container",
4008
4122
  constraints: {
@@ -4025,7 +4139,7 @@ const presetStyle$l = {
4025
4139
  }
4026
4140
  ]
4027
4141
  };
4028
- const meta$r = {
4142
+ const meta$s = {
4029
4143
  category: "forms",
4030
4144
  constraints: {
4031
4145
  relation: "ancestor",
@@ -4051,7 +4165,7 @@ const meta$r = {
4051
4165
  //{ selector: ":read-write", label: "Read Write" },
4052
4166
  ]
4053
4167
  };
4054
- const meta$q = {
4168
+ const meta$r = {
4055
4169
  label: "Webhook Form",
4056
4170
  icon: WebhookFormIcon,
4057
4171
  type: "container",
@@ -4070,10 +4184,10 @@ const meta$q = {
4070
4184
  const presetStyle$k = {
4071
4185
  form: [
4072
4186
  ...form,
4073
- { property: "minHeight", value: { type: "unit", unit: "px", value: 20 } }
4187
+ { property: "min-height", value: { type: "unit", unit: "px", value: 20 } }
4074
4188
  ]
4075
4189
  };
4076
- const meta$p = {
4190
+ const meta$q = {
4077
4191
  category: "forms",
4078
4192
  type: "container",
4079
4193
  label: "Form",
@@ -4092,7 +4206,7 @@ const presetStyle$j = {
4092
4206
  ...img,
4093
4207
  // Otherwise on new image insert onto canvas it can overfit screen size multiple times
4094
4208
  {
4095
- property: "maxWidth",
4209
+ property: "max-width",
4096
4210
  value: { type: "unit", unit: "%", value: 100 }
4097
4211
  },
4098
4212
  // inline | inline-block is not suitable because without line-height: 0 on the parent you get unsuitable spaces/margins
@@ -4110,7 +4224,7 @@ const presetStyle$j = {
4110
4224
  }
4111
4225
  ]
4112
4226
  };
4113
- const meta$o = {
4227
+ const meta$p = {
4114
4228
  category: "media",
4115
4229
  type: "embed",
4116
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.",
@@ -4122,53 +4236,54 @@ const meta$o = {
4122
4236
  const presetStyle$i = {
4123
4237
  blockquote: [
4124
4238
  {
4125
- property: "marginTop",
4239
+ property: "margin-top",
4126
4240
  value: { type: "unit", value: 0, unit: "number" }
4127
4241
  },
4128
4242
  {
4129
- property: "marginRight",
4243
+ property: "margin-right",
4130
4244
  value: { type: "unit", value: 0, unit: "number" }
4131
4245
  },
4132
4246
  {
4133
- property: "marginBottom",
4247
+ property: "margin-bottom",
4134
4248
  value: { type: "unit", value: 10, unit: "px" }
4135
4249
  },
4136
4250
  {
4137
- property: "marginLeft",
4251
+ property: "margin-left",
4138
4252
  value: { type: "unit", value: 0, unit: "number" }
4139
4253
  },
4140
4254
  {
4141
- property: "paddingTop",
4255
+ property: "padding-top",
4142
4256
  value: { type: "unit", value: 10, unit: "px" }
4143
4257
  },
4144
4258
  {
4145
- property: "paddingBottom",
4259
+ property: "padding-bottom",
4146
4260
  value: { type: "unit", value: 10, unit: "px" }
4147
4261
  },
4148
4262
  {
4149
- property: "paddingLeft",
4263
+ property: "padding-left",
4150
4264
  value: { type: "unit", value: 20, unit: "px" }
4151
4265
  },
4152
4266
  {
4153
- property: "paddingRight",
4267
+ property: "padding-right",
4154
4268
  value: { type: "unit", value: 20, unit: "px" }
4155
4269
  },
4156
4270
  {
4157
- property: "borderLeftWidth",
4271
+ property: "border-left-width",
4158
4272
  value: { type: "unit", value: 5, unit: "px" }
4159
4273
  },
4160
4274
  {
4161
- property: "borderLeftStyle",
4275
+ property: "border-left-style",
4162
4276
  value: { type: "keyword", value: "solid" }
4163
4277
  },
4164
4278
  {
4165
- property: "borderLeftColor",
4279
+ property: "border-left-color",
4166
4280
  value: { type: "rgb", r: 226, g: 226, b: 226, alpha: 1 }
4167
4281
  }
4168
4282
  ]
4169
4283
  };
4170
- const meta$n = {
4284
+ const meta$o = {
4171
4285
  type: "container",
4286
+ placeholder: "Blockquote",
4172
4287
  icon: BlockquoteIcon,
4173
4288
  states: defaultStates,
4174
4289
  presetStyle: presetStyle$i
@@ -4177,35 +4292,35 @@ const presetStyle$h = {
4177
4292
  ol: [
4178
4293
  ...ol,
4179
4294
  {
4180
- property: "marginTop",
4295
+ property: "margin-top",
4181
4296
  value: { type: "keyword", value: "0" }
4182
4297
  },
4183
4298
  {
4184
- property: "marginBottom",
4299
+ property: "margin-bottom",
4185
4300
  value: { type: "keyword", value: "10px" }
4186
4301
  },
4187
4302
  {
4188
- property: "paddingLeft",
4303
+ property: "padding-left",
4189
4304
  value: { type: "keyword", value: "40px" }
4190
4305
  }
4191
4306
  ],
4192
4307
  ul: [
4193
4308
  ...ul,
4194
4309
  {
4195
- property: "marginTop",
4310
+ property: "margin-top",
4196
4311
  value: { type: "keyword", value: "0" }
4197
4312
  },
4198
4313
  {
4199
- property: "marginBottom",
4314
+ property: "margin-bottom",
4200
4315
  value: { type: "keyword", value: "10px" }
4201
4316
  },
4202
4317
  {
4203
- property: "paddingLeft",
4318
+ property: "padding-left",
4204
4319
  value: { type: "keyword", value: "40px" }
4205
4320
  }
4206
4321
  ]
4207
4322
  };
4208
- const meta$m = {
4323
+ const meta$n = {
4209
4324
  type: "container",
4210
4325
  icon: ListIcon,
4211
4326
  states: defaultStates,
@@ -4214,8 +4329,9 @@ const meta$m = {
4214
4329
  const presetStyle$g = {
4215
4330
  li
4216
4331
  };
4217
- const meta$l = {
4332
+ const meta$m = {
4218
4333
  type: "container",
4334
+ placeholder: "List item",
4219
4335
  constraints: {
4220
4336
  // cannot use parent relation here
4221
4337
  // because list item can be put inside of collection or slot
@@ -4235,28 +4351,28 @@ const presetStyle$f = {
4235
4351
  value: { type: "keyword", value: "1px" }
4236
4352
  },
4237
4353
  {
4238
- property: "backgroundColor",
4354
+ property: "background-color",
4239
4355
  value: { type: "keyword", value: "gray" }
4240
4356
  },
4241
4357
  {
4242
- property: "borderTopStyle",
4358
+ property: "border-top-style",
4243
4359
  value: { type: "keyword", value: "none" }
4244
4360
  },
4245
4361
  {
4246
- property: "borderRightStyle",
4362
+ property: "border-right-style",
4247
4363
  value: { type: "keyword", value: "none" }
4248
4364
  },
4249
4365
  {
4250
- property: "borderLeftStyle",
4366
+ property: "border-left-style",
4251
4367
  value: { type: "keyword", value: "none" }
4252
4368
  },
4253
4369
  {
4254
- property: "borderBottomStyle",
4370
+ property: "border-bottom-style",
4255
4371
  value: { type: "keyword", value: "none" }
4256
4372
  }
4257
4373
  ]
4258
4374
  };
4259
- const meta$k = {
4375
+ const meta$l = {
4260
4376
  category: "general",
4261
4377
  type: "embed",
4262
4378
  description: "Used to visually divide sections of content, helping to improve readability and organization within a webpage.",
@@ -4273,28 +4389,28 @@ const presetStyle$e = {
4273
4389
  value: { type: "keyword", value: "block" }
4274
4390
  },
4275
4391
  {
4276
- property: "whiteSpaceCollapse",
4392
+ property: "white-space-collapse",
4277
4393
  value: { type: "keyword", value: "preserve" }
4278
4394
  },
4279
4395
  {
4280
- property: "textWrapMode",
4396
+ property: "text-wrap-mode",
4281
4397
  value: { type: "keyword", value: "wrap" }
4282
4398
  },
4283
4399
  {
4284
- property: "paddingLeft",
4400
+ property: "padding-left",
4285
4401
  value: { type: "unit", value: 0.2, unit: "em" }
4286
4402
  },
4287
4403
  {
4288
- property: "paddingRight",
4404
+ property: "padding-right",
4289
4405
  value: { type: "unit", value: 0.2, unit: "em" }
4290
4406
  },
4291
4407
  {
4292
- property: "backgroundColor",
4408
+ property: "background-color",
4293
4409
  value: { type: "rgb", r: 238, g: 238, b: 238, alpha: 1 }
4294
4410
  }
4295
4411
  ]
4296
4412
  };
4297
- const meta$j = {
4413
+ const meta$k = {
4298
4414
  category: "general",
4299
4415
  type: "embed",
4300
4416
  description: "Use this component when you want to display code as text on the page.",
@@ -4313,7 +4429,7 @@ const presetStyle$d = {
4313
4429
  { property: "display", value: { type: "keyword", value: "block" } }
4314
4430
  ]
4315
4431
  };
4316
- const meta$i = {
4432
+ const meta$j = {
4317
4433
  constraints: {
4318
4434
  relation: "ancestor",
4319
4435
  component: { $nin: ["Button", "Link"] }
@@ -4335,7 +4451,7 @@ const presetStyle$c = {
4335
4451
  }
4336
4452
  ]
4337
4453
  };
4338
- const meta$h = {
4454
+ const meta$i = {
4339
4455
  category: "forms",
4340
4456
  type: "control",
4341
4457
  label: "Text Area",
@@ -4365,12 +4481,12 @@ const presetStyle$b = {
4365
4481
  input: [
4366
4482
  ...radio,
4367
4483
  {
4368
- property: "marginRight",
4484
+ property: "margin-right",
4369
4485
  value: { type: "unit", unit: "em", value: 0.5 }
4370
4486
  }
4371
4487
  ]
4372
4488
  };
4373
- const meta$g = {
4489
+ const meta$h = {
4374
4490
  constraints: {
4375
4491
  relation: "ancestor",
4376
4492
  component: { $nin: ["Button", "Link"] }
@@ -4395,12 +4511,12 @@ const presetStyle$a = {
4395
4511
  input: [
4396
4512
  ...checkbox,
4397
4513
  {
4398
- property: "marginRight",
4514
+ property: "margin-right",
4399
4515
  value: { type: "unit", unit: "em", value: 0.5 }
4400
4516
  }
4401
4517
  ]
4402
4518
  };
4403
- const meta$f = {
4519
+ const meta$g = {
4404
4520
  constraints: {
4405
4521
  relation: "ancestor",
4406
4522
  component: { $nin: ["Button", "Link"] }
@@ -4422,7 +4538,7 @@ const meta$f = {
4422
4538
  const presetStyle$9 = {
4423
4539
  div
4424
4540
  };
4425
- const meta$e = {
4541
+ const meta$f = {
4426
4542
  type: "container",
4427
4543
  icon: VimeoIcon,
4428
4544
  states: defaultStates,
@@ -4435,7 +4551,7 @@ const meta$e = {
4435
4551
  const presetStyle$8 = {
4436
4552
  div
4437
4553
  };
4438
- const meta$d = {
4554
+ const meta$e = {
4439
4555
  type: "container",
4440
4556
  icon: YoutubeIcon,
4441
4557
  states: defaultStates,
@@ -4445,8 +4561,8 @@ const meta$d = {
4445
4561
  component: { $nin: ["Button", "Link", "Heading"] }
4446
4562
  }
4447
4563
  };
4448
- const meta$c = {
4449
- ...meta$o,
4564
+ const meta$d = {
4565
+ ...meta$p,
4450
4566
  category: "hidden",
4451
4567
  label: "Preview Image",
4452
4568
  constraints: {
@@ -4457,7 +4573,7 @@ const meta$c = {
4457
4573
  const presetStyle$7 = {
4458
4574
  button
4459
4575
  };
4460
- const meta$b = {
4576
+ const meta$c = {
4461
4577
  category: "hidden",
4462
4578
  type: "container",
4463
4579
  constraints: [
@@ -4478,7 +4594,7 @@ const meta$b = {
4478
4594
  const presetStyle$6 = {
4479
4595
  div
4480
4596
  };
4481
- const meta$a = {
4597
+ const meta$b = {
4482
4598
  type: "container",
4483
4599
  constraints: {
4484
4600
  relation: "ancestor",
@@ -4490,14 +4606,14 @@ const meta$a = {
4490
4606
  category: "hidden",
4491
4607
  label: "Spinner"
4492
4608
  };
4493
- const meta$9 = {
4609
+ const meta$a = {
4494
4610
  category: "xml",
4495
4611
  order: 6,
4496
4612
  type: "container",
4497
4613
  icon: XmlIcon,
4498
4614
  description: "XML Node"
4499
4615
  };
4500
- const meta$8 = {
4616
+ const meta$9 = {
4501
4617
  category: "xml",
4502
4618
  type: "container",
4503
4619
  description: "Converts machine-readable date and time to ISO format.",
@@ -4507,7 +4623,7 @@ const meta$8 = {
4507
4623
  const presetStyle$5 = {
4508
4624
  time
4509
4625
  };
4510
- const meta$7 = {
4626
+ const meta$8 = {
4511
4627
  category: "localization",
4512
4628
  type: "container",
4513
4629
  description: "Converts machine-readable date and time to a human-readable format.",
@@ -4524,7 +4640,7 @@ const presetStyle$4 = {
4524
4640
  }
4525
4641
  ]
4526
4642
  };
4527
- const meta$6 = {
4643
+ const meta$7 = {
4528
4644
  constraints: {
4529
4645
  relation: "ancestor",
4530
4646
  component: { $nin: ["Button", "Link"] }
@@ -4544,7 +4660,7 @@ const meta$6 = {
4544
4660
  const presetStyle$3 = {
4545
4661
  option: [
4546
4662
  {
4547
- property: "backgroundColor",
4663
+ property: "background-color",
4548
4664
  state: ":checked",
4549
4665
  value: {
4550
4666
  type: "rgb",
@@ -4556,7 +4672,7 @@ const presetStyle$3 = {
4556
4672
  }
4557
4673
  ]
4558
4674
  };
4559
- const meta$5 = {
4675
+ const meta$6 = {
4560
4676
  category: "hidden",
4561
4677
  constraints: {
4562
4678
  relation: "parent",
@@ -4577,7 +4693,7 @@ const meta$5 = {
4577
4693
  { selector: ":disabled", label: "Disabled" }
4578
4694
  ]
4579
4695
  };
4580
- const meta$4 = {
4696
+ const meta$5 = {
4581
4697
  icon: HeaderIcon,
4582
4698
  type: "container",
4583
4699
  description: "Inserts children into the head of the document",
@@ -4592,7 +4708,7 @@ const meta$4 = {
4592
4708
  }
4593
4709
  ]
4594
4710
  };
4595
- const meta$3 = {
4711
+ const meta$4 = {
4596
4712
  category: "hidden",
4597
4713
  icon: ResourceIcon,
4598
4714
  type: "embed",
@@ -4601,7 +4717,7 @@ const meta$3 = {
4601
4717
  component: { $eq: "HeadSlot" }
4602
4718
  }
4603
4719
  };
4604
- const meta$2 = {
4720
+ const meta$3 = {
4605
4721
  category: "hidden",
4606
4722
  icon: WindowInfoIcon,
4607
4723
  type: "embed",
@@ -4610,7 +4726,7 @@ const meta$2 = {
4610
4726
  component: { $eq: "HeadSlot" }
4611
4727
  }
4612
4728
  };
4613
- const meta$1 = {
4729
+ const meta$2 = {
4614
4730
  category: "hidden",
4615
4731
  icon: WindowTitleIcon,
4616
4732
  type: "container",
@@ -4621,61 +4737,70 @@ const meta$1 = {
4621
4737
  };
4622
4738
  const baseComponentMetas = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4623
4739
  __proto__: null,
4624
- Blockquote: meta$n,
4625
- Body: meta$E,
4626
- Bold: meta$w,
4627
- Box: meta$D,
4628
- Button: meta$s,
4629
- Checkbox: meta$f,
4630
- CodeText: meta$j,
4631
- Form: meta$q,
4632
- Fragment: meta$H,
4633
- HeadLink: meta$3,
4634
- HeadMeta: meta$2,
4635
- HeadSlot: meta$4,
4636
- HeadTitle: meta$1,
4637
- Heading: meta$B,
4638
- HtmlEmbed: meta$G,
4639
- Image: meta$o,
4640
- Input: meta$r,
4641
- Italic: meta$v,
4642
- Label: meta$i,
4643
- Link: meta$z,
4644
- List: meta$m,
4645
- ListItem: meta$l,
4646
- MarkdownEmbed: meta$F,
4647
- Option: meta$5,
4648
- Paragraph: meta$A,
4649
- RadioButton: meta$g,
4650
- RemixForm: meta$p,
4651
- RichTextLink: meta$y,
4652
- Select: meta$6,
4653
- Separator: meta$k,
4654
- Slot: meta$I,
4655
- Span: meta$x,
4656
- Subscript: meta$t,
4657
- Superscript: meta$u,
4658
- Text: meta$C,
4659
- Textarea: meta$h,
4660
- Time: meta$7,
4661
- Vimeo: meta$e,
4662
- VimeoPlayButton: meta$b,
4663
- VimeoPreviewImage: meta$c,
4664
- VimeoSpinner: meta$a,
4665
- XmlNode: meta$9,
4666
- XmlTime: meta$8,
4667
- 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
4668
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
+ };
4669
4793
  const animationComponentMetas = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4670
- __proto__: null
4794
+ __proto__: null,
4795
+ AnimateChildren: meta$1
4671
4796
  }, Symbol.toStringTag, { value: "Module" }));
4672
4797
  const remixComponentMetas = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4673
4798
  __proto__: null,
4674
- Body: meta$E,
4675
- Form: meta$q,
4676
- Link: meta$z,
4677
- RemixForm: meta$p,
4678
- RichTextLink: meta$y
4799
+ Body: meta$F,
4800
+ Form: meta$r,
4801
+ Link: meta$A,
4802
+ RemixForm: meta$q,
4803
+ RichTextLink: meta$z
4679
4804
  }, Symbol.toStringTag, { value: "Module" }));
4680
4805
  const metaCollapsible = {
4681
4806
  type: "container",
@@ -4727,29 +4852,29 @@ const rgb = (property, r, g, b2) => ({
4727
4852
  });
4728
4853
  const buttonReset = [
4729
4854
  {
4730
- property: "backgroundColor",
4855
+ property: "background-color",
4731
4856
  value: { type: "keyword", value: "transparent" }
4732
4857
  },
4733
4858
  {
4734
- property: "backgroundImage",
4859
+ property: "background-image",
4735
4860
  value: { type: "keyword", value: "none" }
4736
4861
  },
4737
- unit("borderTopWidth", 0, "px"),
4738
- unit("borderRightWidth", 0, "px"),
4739
- unit("borderBottomWidth", 0, "px"),
4740
- unit("borderLeftWidth", 0, "px"),
4741
- keyword("borderTopStyle", "solid"),
4742
- keyword("borderRightStyle", "solid"),
4743
- keyword("borderBottomStyle", "solid"),
4744
- keyword("borderLeftStyle", "solid"),
4745
- rgb("borderTopColor", 226, 232, 240),
4746
- rgb("borderRightColor", 226, 232, 240),
4747
- rgb("borderBottomColor", 226, 232, 240),
4748
- rgb("borderLeftColor", 226, 232, 240),
4749
- unit("paddingTop", 0, "px"),
4750
- unit("paddingRight", 0, "px"),
4751
- unit("paddingBottom", 0, "px"),
4752
- 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")
4753
4878
  ];
4754
4879
  const metaDialogTrigger = {
4755
4880
  type: "container",
@@ -5051,11 +5176,11 @@ const metaAccordionHeader = {
5051
5176
  h3: [
5052
5177
  ...h3,
5053
5178
  {
5054
- property: "marginTop",
5179
+ property: "margin-top",
5055
5180
  value: { type: "unit", unit: "px", value: 0 }
5056
5181
  },
5057
5182
  {
5058
- property: "marginBottom",
5183
+ property: "margin-bottom",
5059
5184
  value: { type: "unit", unit: "px", value: 0 }
5060
5185
  }
5061
5186
  ]
@@ -5587,11 +5712,11 @@ const createFramework$2 = async () => {
5587
5712
  };
5588
5713
  const reactRouterComponentMetas = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
5589
5714
  __proto__: null,
5590
- Body: meta$E,
5591
- Form: meta$q,
5592
- Link: meta$z,
5593
- RemixForm: meta$p,
5594
- RichTextLink: meta$y
5715
+ Body: meta$F,
5716
+ Form: meta$r,
5717
+ Link: meta$A,
5718
+ RemixForm: meta$q,
5719
+ RichTextLink: meta$z
5595
5720
  }, Symbol.toStringTag, { value: "Module" }));
5596
5721
  const createFramework$1 = async () => {
5597
5722
  const routeTemplatesDir = join("app", "route-templates");
@@ -5832,7 +5957,7 @@ audit=false
5832
5957
  fund=false
5833
5958
  `;
5834
5959
  const prebuild = async (options) => {
5835
- 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, _m;
5836
5961
  if (options.template.length === 0) {
5837
5962
  log.error(
5838
5963
  `Template is not provided
@@ -5886,10 +6011,9 @@ Please check webstudio --help for more details`
5886
6011
  componentSources.set(componentName, entry.source);
5887
6012
  }
5888
6013
  }
5889
- const projectMetas = new Map(
6014
+ const usedMetas = new Map(
5890
6015
  Object.entries(coreMetas)
5891
6016
  );
5892
- const componentsByPage = {};
5893
6017
  const siteDataByPage = {};
5894
6018
  const fontAssetsByPage = {};
5895
6019
  const backgroundImageAssetsByPage = {};
@@ -5899,6 +6023,7 @@ Please check webstudio --help for more details`
5899
6023
  instanceMap,
5900
6024
  page.rootInstanceId
5901
6025
  );
6026
+ pageInstanceSet.add(ROOT_INSTANCE_ID);
5902
6027
  const instances = siteData.build.instances.filter(([id]) => pageInstanceSet.has(id));
5903
6028
  const dataSources = [];
5904
6029
  const normalizedProps = normalizeProps({
@@ -5941,15 +6066,10 @@ Please check webstudio --help for more details`
5941
6066
  page,
5942
6067
  assets: siteData.assets
5943
6068
  };
5944
- componentsByPage[page.id] = /* @__PURE__ */ new Set();
5945
6069
  for (const [_instanceId, instance] of instances) {
5946
- if (isCoreComponent(instance.component)) {
5947
- continue;
5948
- }
5949
- componentsByPage[page.id].add(instance.component);
5950
6070
  const meta2 = metas.get(instance.component);
5951
6071
  if (meta2) {
5952
- projectMetas.set(instance.component, meta2);
6072
+ usedMetas.set(instance.component, meta2);
5953
6073
  }
5954
6074
  }
5955
6075
  const styleSourceSelections = ((_a = siteData.build) == null ? void 0 : _a.styleSourceSelections) ?? [];
@@ -5964,7 +6084,7 @@ Please check webstudio --help for more details`
5964
6084
  ([, { value }]) => value.type === "fontFamily" ? value.value : void 0
5965
6085
  ).flat().filter((value) => value !== void 0)
5966
6086
  );
5967
- 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);
5968
6088
  fontAssetsByPage[page.id] = pageFontAssets;
5969
6089
  const backgroundImageAssetIdSet = new Set(
5970
6090
  pageStyles.filter(([, { property }]) => property === "backgroundImage").map(
@@ -5973,7 +6093,7 @@ Please check webstudio --help for more details`
5973
6093
  ) : void 0
5974
6094
  ).flat().filter((value) => value !== void 0)
5975
6095
  );
5976
- 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);
5977
6097
  backgroundImageAssetsByPage[page.id] = backgroundImageAssets;
5978
6098
  }
5979
6099
  const assetsToDownload = [];
@@ -6013,12 +6133,12 @@ Please check webstudio --help for more details`
6013
6133
  styles: new Map((_e = siteData.build) == null ? void 0 : _e.styles),
6014
6134
  styleSourceSelections: new Map((_f = siteData.build) == null ? void 0 : _f.styleSourceSelections),
6015
6135
  // pass only used metas to not generate unused preset styles
6016
- componentMetas: projectMetas,
6136
+ componentMetas: usedMetas,
6017
6137
  assetBaseUrl,
6018
6138
  atomic: ((_g = siteData.build.pages.compiler) == null ? void 0 : _g.atomicStyles) ?? true
6019
6139
  });
6020
6140
  await createFileIfNotExists(join(generatedDir, "index.css"), cssText);
6021
- for (const [pageId, pageComponents] of Object.entries(componentsByPage)) {
6141
+ for (const page of Object.values(siteData.pages)) {
6022
6142
  const scope = createScope([
6023
6143
  // manually maintained list of occupied identifiers
6024
6144
  "useState",
@@ -6028,6 +6148,29 @@ Please check webstudio --help for more details`
6028
6148
  "Page",
6029
6149
  "_props"
6030
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
+ if (((_h = bodyInstance == null ? void 0 : bodyInstance.children) == null ? void 0 : _h[0].type) === "id") {
6158
+ rootInstanceId = bodyInstance.children[0].value;
6159
+ }
6160
+ for (const instance of instances.values()) {
6161
+ if (isCoreComponent(instance.component)) {
6162
+ continue;
6163
+ }
6164
+ if (((_i = usedMetas.get(instance.component)) == null ? void 0 : _i.category) === "xml") {
6165
+ continue;
6166
+ }
6167
+ instances.delete(instance.id);
6168
+ }
6169
+ }
6170
+ const pageComponents = /* @__PURE__ */ new Set();
6171
+ for (const instance of instances.values()) {
6172
+ pageComponents.add(instance.component);
6173
+ }
6031
6174
  const namespaces = /* @__PURE__ */ new Map();
6032
6175
  for (const component of pageComponents) {
6033
6176
  const namespace = componentSources.get(component);
@@ -6041,50 +6184,18 @@ Please check webstudio --help for more details`
6041
6184
  );
6042
6185
  }
6043
6186
  const [_namespace, shortName] = parseComponentName(component);
6044
- (_h = namespaces.get(namespace)) == null ? void 0 : _h.add([shortName, component]);
6187
+ (_j = namespaces.get(namespace)) == null ? void 0 : _j.add([shortName, component]);
6045
6188
  }
6046
6189
  let componentImports = "";
6047
- let xmlPresentationComponents = "";
6048
- const pageData = siteDataByPage[pageId];
6049
- const documentType = pageData.page.meta.documentType ?? "html";
6050
6190
  for (const [namespace, componentsSet] of namespaces.entries()) {
6051
- switch (documentType) {
6052
- case "html":
6053
- {
6054
- const specifiers = Array.from(componentsSet).map(
6055
- ([shortName, component]) => `${shortName} as ${scope.getName(component, shortName)}`
6056
- ).join(", ");
6057
- componentImports += `import { ${specifiers} } from "${namespace}";
6058
- `;
6059
- }
6060
- break;
6061
- case "xml":
6062
- {
6063
- componentImports = `import { XmlNode, XmlTime } from "@webstudio-is/sdk-components-react";
6191
+ const specifiers = Array.from(componentsSet).map(
6192
+ ([shortName, component]) => `${shortName} as ${scope.getName(component, shortName)}`
6193
+ ).join(", ");
6194
+ componentImports += `import { ${specifiers} } from "${namespace}";
6064
6195
  `;
6065
- xmlPresentationComponents += Array.from(componentsSet).map(
6066
- ([shortName, component]) => scope.getName(component, shortName)
6067
- ).filter(
6068
- (scopedName) => scopedName !== "XmlNode" && scopedName !== "XmlTime"
6069
- ).map(
6070
- (scopedName) => scopedName === "Body" ? (
6071
- // Using <svg> prevents React from hoisting elements like <title>, <meta>, and <link>
6072
- // out of their intended scope during rendering.
6073
- // More details: https://github.com/facebook/react/blob/7c8e5e7ab8bb63de911637892392c5efd8ce1d0f/packages/react-dom-bindings/src/client/ReactFiberConfigDOM.js#L3083
6074
- `const ${scopedName} = (props: any) => <svg>{props.children}</svg>;`
6075
- ) : (
6076
- // Do not render all other components
6077
- `const ${scopedName} = (props: any) => null;`
6078
- )
6079
- ).join("\n");
6080
- }
6081
- break;
6082
- }
6083
6196
  }
6084
- const pageFontAssets = fontAssetsByPage[pageId];
6085
- const pageBackgroundImageAssets = backgroundImageAssetsByPage[pageId];
6086
- const rootInstanceId = pageData.page.rootInstanceId;
6087
- const instances = new Map(pageData.build.instances);
6197
+ const pageFontAssets = fontAssetsByPage[page.id];
6198
+ const pageBackgroundImageAssets = backgroundImageAssetsByPage[page.id];
6088
6199
  const props2 = new Map(pageData.build.props);
6089
6200
  const dataSources = new Map(pageData.build.dataSources);
6090
6201
  const resources = new Map(pageData.build.resources);
@@ -6099,49 +6210,51 @@ Please check webstudio --help for more details`
6099
6210
  rootInstanceId,
6100
6211
  parameters: [
6101
6212
  {
6102
- id: `system`,
6213
+ id: `page-system`,
6103
6214
  instanceId: "",
6104
6215
  name: "system",
6105
6216
  type: "parameter",
6106
- value: pageData.page.systemDataSourceId ?? ""
6217
+ value: page.systemDataSourceId ?? ""
6218
+ },
6219
+ {
6220
+ id: "global-system",
6221
+ type: "parameter",
6222
+ instanceId: "",
6223
+ name: "system",
6224
+ value: SYSTEM_VARIABLE_ID
6107
6225
  }
6108
6226
  ],
6109
6227
  instances,
6110
6228
  props: props2,
6111
6229
  dataSources,
6112
6230
  classesMap: classes,
6113
- indexesWithinAncestors: getIndexesWithinAncestors(
6114
- projectMetas,
6115
- instances,
6116
- [rootInstanceId]
6117
- )
6231
+ metas: usedMetas
6118
6232
  });
6119
6233
  const projectMeta = siteData.build.pages.meta;
6120
6234
  const contactEmail = (
6121
6235
  // fallback to user email when contact email is empty string
6122
- (projectMeta == null ? void 0 : projectMeta.contactEmail) || ((_i = siteData.user) == null ? void 0 : _i.email) || void 0
6236
+ (projectMeta == null ? void 0 : projectMeta.contactEmail) || ((_k = siteData.user) == null ? void 0 : _k.email) || void 0
6123
6237
  );
6124
- const favIconAsset = assets.get((projectMeta == null ? void 0 : projectMeta.faviconAssetId) ?? "");
6125
- const pagePath = getPagePath(pageData.page.id, siteData.build.pages);
6238
+ const favIconAsset = (_l = assets.get((projectMeta == null ? void 0 : projectMeta.faviconAssetId) ?? "")) == null ? void 0 : _l.name;
6239
+ const pagePath = getPagePath(page.id, siteData.build.pages);
6126
6240
  const pageExports = `/* eslint-disable */
6127
6241
  /* This is a auto generated file for building the project */
6128
6242
 
6129
6243
 
6130
6244
  import { Fragment, useState } from "react";
6131
- import type { FontAsset, ImageAsset } from "@webstudio-is/sdk";
6132
6245
  import { useResource, useVariableState } from "@webstudio-is/react-sdk/runtime";
6133
6246
  ${componentImports}
6134
6247
 
6135
6248
  export const siteName = ${JSON.stringify(projectMeta == null ? void 0 : projectMeta.siteName)};
6136
6249
 
6137
- export const favIconAsset: ImageAsset | undefined =
6250
+ export const favIconAsset: string | undefined =
6138
6251
  ${JSON.stringify(favIconAsset)};
6139
6252
 
6140
6253
  // Font assets on current page (can be preloaded)
6141
- export const pageFontAssets: FontAsset[] =
6254
+ export const pageFontAssets: string[] =
6142
6255
  ${JSON.stringify(pageFontAssets)}
6143
6256
 
6144
- export const pageBackgroundImageAssets: ImageAsset[] =
6257
+ export const pageBackgroundImageAssets: string[] =
6145
6258
  ${JSON.stringify(pageBackgroundImageAssets)}
6146
6259
 
6147
6260
  ${pagePath === "/" ? `
@@ -6167,8 +6280,6 @@ Please check webstudio --help for more details`
6167
6280
  }
6168
6281
  ` : ""}
6169
6282
 
6170
- ${xmlPresentationComponents}
6171
-
6172
6283
  ${pageComponent}
6173
6284
 
6174
6285
  export { Page }
@@ -6180,7 +6291,7 @@ Please check webstudio --help for more details`
6180
6291
  import type { PageMeta } from "@webstudio-is/sdk";
6181
6292
  ${generateResources({
6182
6293
  scope,
6183
- page: pageData.page,
6294
+ page,
6184
6295
  dataSources,
6185
6296
  props: props2,
6186
6297
  resources
@@ -6188,12 +6299,12 @@ Please check webstudio --help for more details`
6188
6299
 
6189
6300
  ${generatePageMeta({
6190
6301
  globalScope: scope,
6191
- page: pageData.page,
6302
+ page,
6192
6303
  dataSources,
6193
6304
  assets
6194
6305
  })}
6195
6306
 
6196
- ${generateRemixParams(pageData.page.path)}
6307
+ ${generateRemixParams(page.path)}
6197
6308
 
6198
6309
  export const projectId = "${siteData.build.projectId}";
6199
6310
 
@@ -6239,7 +6350,7 @@ Please check webstudio --help for more details`
6239
6350
  )};
6240
6351
  `
6241
6352
  );
6242
- const redirects = (_j = siteData.build.pages) == null ? void 0 : _j.redirects;
6353
+ const redirects = (_m = siteData.build.pages) == null ? void 0 : _m.redirects;
6243
6354
  if (redirects !== void 0 && redirects.length > 0) {
6244
6355
  for (const redirect of redirects) {
6245
6356
  const generatedBasename = generateRemixRoute(redirect.old);
@@ -6414,7 +6525,7 @@ const getDeploymentInstructions = (deployTarget) => {
6414
6525
  }
6415
6526
  };
6416
6527
  const name = "webstudio";
6417
- const version = "0.204.0";
6528
+ const version = "0.206.0";
6418
6529
  const description = "Webstudio CLI";
6419
6530
  const author = "Webstudio <github@webstudio.is>";
6420
6531
  const homepage = "https://webstudio.is";
@@ -6474,6 +6585,7 @@ const devDependencies = {
6474
6585
  "@types/react": "^18.2.70",
6475
6586
  "@types/react-dom": "^18.2.25",
6476
6587
  "@types/yargs": "^17.0.33",
6588
+ "@vercel/react-router": "^1.0.2",
6477
6589
  "@vitejs/plugin-react": "^4.3.4",
6478
6590
  "@webstudio-is/http-client": "workspace:*",
6479
6591
  "@webstudio-is/image": "workspace:*",
@@ -6485,14 +6597,14 @@ const devDependencies = {
6485
6597
  "@webstudio-is/sdk-components-react-remix": "workspace:*",
6486
6598
  "@webstudio-is/sdk-components-react-router": "workspace:*",
6487
6599
  "@webstudio-is/tsconfig": "workspace:*",
6488
- h3: "^1.14.0",
6600
+ h3: "^1.15.0",
6489
6601
  ipx: "^3.0.1",
6490
6602
  prettier: "3.4.2",
6491
6603
  react: "18.3.0-canary-14898b6a9-20240318",
6492
6604
  "react-dom": "18.3.0-canary-14898b6a9-20240318",
6493
6605
  "react-router": "^7.1.5",
6494
6606
  "ts-expect": "^1.3.0",
6495
- vike: "^0.4.220",
6607
+ vike: "^0.4.222",
6496
6608
  vite: "^5.4.11",
6497
6609
  vitest: "^3.0.4",
6498
6610
  wrangler: "^3.63.2"