webstudio 0.0.0-588fe22 → 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.
- package/README.md +1 -7
- package/lib/cli.js +636 -536
- package/package.json +20 -20
- package/templates/defaults/app/route-templates/html.tsx +3 -3
- package/templates/defaults/app/route-templates/xml.tsx +0 -4
- package/templates/defaults/package.json +8 -8
- package/templates/{react-router-docker → react-router}/app/route-templates/html.tsx +3 -3
- package/templates/react-router/package.json +34 -0
- package/templates/react-router-docker/package.json +5 -33
- package/templates/{netlify-edge-functions → react-router-netlify}/app/constants.mjs +1 -1
- package/templates/react-router-netlify/netlify.toml +6 -0
- package/templates/react-router-netlify/package.json +10 -0
- package/templates/react-router-netlify/vite.config.ts +7 -0
- package/templates/{vercel → react-router-vercel}/app/constants.mjs +1 -1
- package/templates/react-router-vercel/package.json +9 -0
- package/templates/react-router-vercel/react-router.config.ts +6 -0
- package/templates/{vercel → react-router-vercel}/vercel.json +1 -0
- package/templates/ssg/app/route-templates/html/+Head.tsx +5 -5
- package/templates/ssg/package.json +7 -7
- package/templates/netlify-edge-functions/app/entry.server.tsx +0 -21
- package/templates/netlify-edge-functions/netlify.toml +0 -16
- package/templates/netlify-edge-functions/package.json +0 -9
- package/templates/netlify-edge-functions/vite.config.ts +0 -18
- package/templates/netlify-functions/app/constants.mjs +0 -29
- package/templates/netlify-functions/app/entry.server.tsx +0 -1
- package/templates/netlify-functions/netlify.toml +0 -16
- package/templates/netlify-functions/package.json +0 -9
- package/templates/netlify-functions/vite.config.ts +0 -18
- package/templates/vercel/.vercelignore +0 -8
- package/templates/vercel/package.json +0 -1
- /package/templates/{react-router-docker → react-router}/app/extension.ts +0 -0
- /package/templates/{react-router-docker → react-router}/app/root.tsx +0 -0
- /package/templates/{react-router-docker → react-router}/app/route-templates/default-sitemap.tsx +0 -0
- /package/templates/{react-router-docker → react-router}/app/route-templates/redirect.tsx +0 -0
- /package/templates/{react-router-docker → react-router}/app/route-templates/xml.tsx +0 -0
- /package/templates/{react-router-docker → react-router}/app/routes/[robots.txt].tsx +0 -0
- /package/templates/{react-router-docker → react-router}/app/routes.ts +0 -0
- /package/templates/{react-router-docker → react-router}/public/favicon.ico +0 -0
- /package/templates/{react-router-docker → react-router}/tsconfig.json +0 -0
- /package/templates/{react-router-docker → react-router}/vite.config.ts +0 -0
package/lib/cli.js
CHANGED
|
@@ -71,30 +71,20 @@ 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",
|
|
82
|
-
expand: ["react-router-docker"]
|
|
77
|
+
expand: ["react-router", "react-router-docker"]
|
|
83
78
|
},
|
|
84
79
|
{
|
|
85
80
|
value: "vercel",
|
|
86
81
|
label: "Vercel",
|
|
87
|
-
expand: ["
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
value: "netlify-functions",
|
|
91
|
-
label: "Netlify Functions",
|
|
92
|
-
expand: ["defaults", "netlify-functions"]
|
|
82
|
+
expand: ["react-router", "react-router-vercel"]
|
|
93
83
|
},
|
|
94
84
|
{
|
|
95
|
-
value: "netlify
|
|
96
|
-
label: "Netlify
|
|
97
|
-
expand: ["
|
|
85
|
+
value: "netlify",
|
|
86
|
+
label: "Netlify",
|
|
87
|
+
expand: ["react-router", "react-router-netlify"]
|
|
98
88
|
},
|
|
99
89
|
{
|
|
100
90
|
value: "ssg",
|
|
@@ -714,18 +704,48 @@ const getFontFaces = (assets, options) => {
|
|
|
714
704
|
}
|
|
715
705
|
return Array.from(faces.values());
|
|
716
706
|
};
|
|
717
|
-
const
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
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)]);
|
|
729
749
|
const prefixStyles = (styleMap) => {
|
|
730
750
|
const newStyleMap = /* @__PURE__ */ new Map();
|
|
731
751
|
for (const [property, value] of styleMap) {
|
|
@@ -741,19 +761,13 @@ const prefixStyles = (styleMap) => {
|
|
|
741
761
|
if (property === "backdrop-filter") {
|
|
742
762
|
newStyleMap.set("-webkit-backdrop-filter", value);
|
|
743
763
|
}
|
|
764
|
+
if (property === "view-timeline-name" || property === "scroll-timeline-name" || property === "view-timeline-inset") {
|
|
765
|
+
newStyleMap.set(`--${property}`, value);
|
|
766
|
+
}
|
|
744
767
|
newStyleMap.set(property, value);
|
|
745
768
|
}
|
|
746
769
|
return newStyleMap;
|
|
747
770
|
};
|
|
748
|
-
const captureError = (error, value) => {
|
|
749
|
-
if (process.env.NODE_ENV === "development") {
|
|
750
|
-
throw error;
|
|
751
|
-
}
|
|
752
|
-
setTimeout(() => {
|
|
753
|
-
throw error;
|
|
754
|
-
});
|
|
755
|
-
return value;
|
|
756
|
-
};
|
|
757
771
|
const fallbackTransform = (styleValue) => {
|
|
758
772
|
var _a;
|
|
759
773
|
if (styleValue.type !== "fontFamily") {
|
|
@@ -845,7 +859,7 @@ const toValue = (styleValue, transformValue) => {
|
|
|
845
859
|
if (value.type === "guaranteedInvalid") {
|
|
846
860
|
return "";
|
|
847
861
|
}
|
|
848
|
-
return
|
|
862
|
+
return "";
|
|
849
863
|
};
|
|
850
864
|
const Unit = z.string();
|
|
851
865
|
const UnitValue = z.object({
|
|
@@ -1092,7 +1106,10 @@ const mergeStyles = (styleMap) => {
|
|
|
1092
1106
|
mergeBackgroundPosition(newStyle);
|
|
1093
1107
|
return newStyle;
|
|
1094
1108
|
};
|
|
1095
|
-
const hyphenateProperty = (property) => property.replace(
|
|
1109
|
+
const hyphenateProperty = (property) => property.replace(
|
|
1110
|
+
/[A-Z]/g,
|
|
1111
|
+
(match) => "-" + match.toLowerCase()
|
|
1112
|
+
);
|
|
1096
1113
|
const mapGroupBy = (array, getKey2) => {
|
|
1097
1114
|
const groups = /* @__PURE__ */ new Map();
|
|
1098
1115
|
for (const item of array) {
|
|
@@ -1130,11 +1147,10 @@ const mergeDeclarations = (declarations) => {
|
|
|
1130
1147
|
}
|
|
1131
1148
|
return newDeclarations;
|
|
1132
1149
|
};
|
|
1133
|
-
const generateStyleMap = ({
|
|
1134
|
-
style,
|
|
1150
|
+
const generateStyleMap = (style, {
|
|
1135
1151
|
indent = 0,
|
|
1136
1152
|
transformValue
|
|
1137
|
-
}) => {
|
|
1153
|
+
} = {}) => {
|
|
1138
1154
|
const spaces = " ".repeat(indent);
|
|
1139
1155
|
let lines = "";
|
|
1140
1156
|
for (const [property, value] of style) {
|
|
@@ -1267,8 +1283,7 @@ class NestingRule {
|
|
|
1267
1283
|
const generated = Array.from(styleBySelector).sort(
|
|
1268
1284
|
([leftSelector], [rightSelector]) => leftSelector.localeCompare(rightSelector)
|
|
1269
1285
|
).map(([selector, style]) => {
|
|
1270
|
-
const content = generateStyleMap({
|
|
1271
|
-
style: prefixStyles(style),
|
|
1286
|
+
const content = generateStyleMap(prefixStyles(style), {
|
|
1272
1287
|
indent: indent + 2,
|
|
1273
1288
|
transformValue
|
|
1274
1289
|
});
|
|
@@ -1629,48 +1644,6 @@ const generateAtomic = (sheet, options) => {
|
|
|
1629
1644
|
});
|
|
1630
1645
|
return { cssText, classes };
|
|
1631
1646
|
};
|
|
1632
|
-
const TextChild = z.object({
|
|
1633
|
-
type: z.literal("text"),
|
|
1634
|
-
value: z.string(),
|
|
1635
|
-
placeholder: z.boolean().optional()
|
|
1636
|
-
});
|
|
1637
|
-
const InstanceId = z.string();
|
|
1638
|
-
const IdChild = z.object({
|
|
1639
|
-
type: z.literal("id"),
|
|
1640
|
-
value: InstanceId
|
|
1641
|
-
});
|
|
1642
|
-
const ExpressionChild = z.object({
|
|
1643
|
-
type: z.literal("expression"),
|
|
1644
|
-
value: z.string()
|
|
1645
|
-
});
|
|
1646
|
-
const InstanceChild = z.union([IdChild, TextChild, ExpressionChild]);
|
|
1647
|
-
const Instance = z.object({
|
|
1648
|
-
type: z.literal("instance"),
|
|
1649
|
-
id: InstanceId,
|
|
1650
|
-
component: z.string(),
|
|
1651
|
-
label: z.string().optional(),
|
|
1652
|
-
children: z.array(InstanceChild)
|
|
1653
|
-
});
|
|
1654
|
-
z.map(InstanceId, Instance);
|
|
1655
|
-
const MatcherRelation = z.union([
|
|
1656
|
-
z.literal("ancestor"),
|
|
1657
|
-
z.literal("parent"),
|
|
1658
|
-
z.literal("self"),
|
|
1659
|
-
z.literal("child"),
|
|
1660
|
-
z.literal("descendant")
|
|
1661
|
-
]);
|
|
1662
|
-
const MatcherOperation = z.object({
|
|
1663
|
-
$eq: z.string().optional(),
|
|
1664
|
-
$neq: z.string().optional(),
|
|
1665
|
-
$in: z.array(z.string()).optional(),
|
|
1666
|
-
$nin: z.array(z.string()).optional()
|
|
1667
|
-
});
|
|
1668
|
-
const Matcher = z.object({
|
|
1669
|
-
relation: MatcherRelation,
|
|
1670
|
-
component: MatcherOperation.optional(),
|
|
1671
|
-
tag: MatcherOperation.optional()
|
|
1672
|
-
});
|
|
1673
|
-
const Matchers = z.union([Matcher, z.array(Matcher)]);
|
|
1674
1647
|
const common = {
|
|
1675
1648
|
label: z.string().optional(),
|
|
1676
1649
|
description: z.string().optional(),
|
|
@@ -1806,6 +1779,12 @@ const TextContent = z.object({
|
|
|
1806
1779
|
type: z.literal("string"),
|
|
1807
1780
|
defaultValue: z.string().optional()
|
|
1808
1781
|
});
|
|
1782
|
+
const AnimationAction = z.object({
|
|
1783
|
+
...common,
|
|
1784
|
+
control: z.literal("animationAction"),
|
|
1785
|
+
type: z.literal("animationAction"),
|
|
1786
|
+
defaultValue: z.undefined().optional()
|
|
1787
|
+
});
|
|
1809
1788
|
const PropMeta = z.union([
|
|
1810
1789
|
Number,
|
|
1811
1790
|
Range,
|
|
@@ -1825,7 +1804,8 @@ const PropMeta = z.union([
|
|
|
1825
1804
|
Json,
|
|
1826
1805
|
Date,
|
|
1827
1806
|
Action,
|
|
1828
|
-
TextContent
|
|
1807
|
+
TextContent,
|
|
1808
|
+
AnimationAction
|
|
1829
1809
|
]);
|
|
1830
1810
|
const EmbedTemplateText = z.object({
|
|
1831
1811
|
type: z.literal("text"),
|
|
@@ -1912,6 +1892,12 @@ const WsEmbedTemplate = z.lazy(
|
|
|
1912
1892
|
z.union([EmbedTemplateInstance, EmbedTemplateText, EmbedTemplateExpression])
|
|
1913
1893
|
)
|
|
1914
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
|
+
});
|
|
1915
1901
|
z.object({
|
|
1916
1902
|
props: z.record(PropMeta),
|
|
1917
1903
|
// Props that will be always visible in properties panel.
|
|
@@ -1949,6 +1935,11 @@ z.object({
|
|
|
1949
1935
|
// embed - images, videos or other embeddable components, without children
|
|
1950
1936
|
// rich-text-child - formatted text fragment, not listed in components list
|
|
1951
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(),
|
|
1952
1943
|
constraints: Matchers.optional(),
|
|
1953
1944
|
// when this field is specified component receives
|
|
1954
1945
|
// prop with index of same components withiin specified ancestor
|
|
@@ -1958,9 +1949,7 @@ z.object({
|
|
|
1958
1949
|
label: z.optional(z.string()),
|
|
1959
1950
|
description: z.string().optional(),
|
|
1960
1951
|
icon: z.string(),
|
|
1961
|
-
presetStyle: z.optional(
|
|
1962
|
-
z.record(z.string(), z.array(EmbedTemplateStyleDecl))
|
|
1963
|
-
),
|
|
1952
|
+
presetStyle: z.optional(z.record(z.string(), z.array(PresetStyleDecl))),
|
|
1964
1953
|
states: z.optional(z.array(ComponentState)),
|
|
1965
1954
|
template: z.optional(WsEmbedTemplate),
|
|
1966
1955
|
order: z.number().optional()
|
|
@@ -2022,21 +2011,24 @@ const WindowTitleIcon = `<svg xmlns="http://www.w3.org/2000/svg" fill="none" vie
|
|
|
2022
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>`;
|
|
2023
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>`;
|
|
2024
2013
|
const div = [
|
|
2025
|
-
{ property: "
|
|
2026
|
-
{
|
|
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
|
+
},
|
|
2027
2019
|
{
|
|
2028
|
-
property: "
|
|
2020
|
+
property: "border-right-width",
|
|
2029
2021
|
value: { type: "unit", unit: "px", value: 1 }
|
|
2030
2022
|
},
|
|
2031
2023
|
{
|
|
2032
|
-
property: "
|
|
2024
|
+
property: "border-bottom-width",
|
|
2033
2025
|
value: { type: "unit", unit: "px", value: 1 }
|
|
2034
2026
|
},
|
|
2035
2027
|
{
|
|
2036
|
-
property: "
|
|
2028
|
+
property: "border-left-width",
|
|
2037
2029
|
value: { type: "unit", unit: "px", value: 1 }
|
|
2038
2030
|
},
|
|
2039
|
-
{ property: "
|
|
2031
|
+
{ property: "outline-width", value: { type: "unit", unit: "px", value: 1 } }
|
|
2040
2032
|
];
|
|
2041
2033
|
const address = div;
|
|
2042
2034
|
const article = div;
|
|
@@ -2066,88 +2058,100 @@ const p = div;
|
|
|
2066
2058
|
const span = div;
|
|
2067
2059
|
const html = [
|
|
2068
2060
|
{ property: "display", value: { type: "keyword", value: "grid" } },
|
|
2069
|
-
{ property: "
|
|
2061
|
+
{ property: "min-height", value: { type: "unit", unit: "%", value: 100 } },
|
|
2070
2062
|
{
|
|
2071
|
-
property: "
|
|
2063
|
+
property: "font-family",
|
|
2072
2064
|
value: { type: "fontFamily", value: ["Arial", "Roboto", "sans-serif"] }
|
|
2073
2065
|
},
|
|
2074
|
-
{ property: "
|
|
2066
|
+
{ property: "font-size", value: { type: "unit", unit: "px", value: 16 } },
|
|
2075
2067
|
{
|
|
2076
|
-
property: "
|
|
2068
|
+
property: "line-height",
|
|
2077
2069
|
value: { type: "unit", unit: "number", value: 1.2 }
|
|
2078
2070
|
},
|
|
2079
2071
|
{
|
|
2080
|
-
property: "
|
|
2072
|
+
property: "white-space-collapse",
|
|
2081
2073
|
value: { type: "keyword", value: "preserve" }
|
|
2082
2074
|
}
|
|
2083
2075
|
];
|
|
2084
2076
|
const body = [
|
|
2085
|
-
{ property: "
|
|
2077
|
+
{ property: "margin-top", value: { type: "unit", unit: "number", value: 0 } },
|
|
2086
2078
|
{
|
|
2087
|
-
property: "
|
|
2079
|
+
property: "margin-right",
|
|
2088
2080
|
value: { type: "unit", unit: "number", value: 0 }
|
|
2089
2081
|
},
|
|
2090
2082
|
{
|
|
2091
|
-
property: "
|
|
2083
|
+
property: "margin-bottom",
|
|
2092
2084
|
value: { type: "unit", unit: "number", value: 0 }
|
|
2093
2085
|
},
|
|
2094
|
-
{ property: "marginLeft", value: { type: "unit", unit: "number", value: 0 } },
|
|
2095
|
-
{ property: "boxSizing", value: { type: "keyword", value: "border-box" } },
|
|
2096
|
-
{ property: "borderTopWidth", value: { type: "unit", unit: "px", value: 1 } },
|
|
2097
2086
|
{
|
|
2098
|
-
property: "
|
|
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",
|
|
2099
2093
|
value: { type: "unit", unit: "px", value: 1 }
|
|
2100
2094
|
},
|
|
2101
2095
|
{
|
|
2102
|
-
property: "
|
|
2096
|
+
property: "border-right-width",
|
|
2103
2097
|
value: { type: "unit", unit: "px", value: 1 }
|
|
2104
2098
|
},
|
|
2105
2099
|
{
|
|
2106
|
-
property: "
|
|
2100
|
+
property: "border-bottom-width",
|
|
2101
|
+
value: { type: "unit", unit: "px", value: 1 }
|
|
2102
|
+
},
|
|
2103
|
+
{
|
|
2104
|
+
property: "border-left-width",
|
|
2107
2105
|
value: { type: "unit", unit: "px", value: 1 }
|
|
2108
2106
|
}
|
|
2109
2107
|
];
|
|
2110
2108
|
const hr = [
|
|
2111
2109
|
{ property: "height", value: { type: "unit", unit: "number", value: 0 } },
|
|
2112
2110
|
{ property: "color", value: { type: "keyword", value: "inherit" } },
|
|
2113
|
-
{ property: "
|
|
2114
|
-
{ property: "borderTopWidth", value: { type: "unit", unit: "px", value: 1 } },
|
|
2111
|
+
{ property: "box-sizing", value: { type: "keyword", value: "border-box" } },
|
|
2115
2112
|
{
|
|
2116
|
-
property: "
|
|
2113
|
+
property: "border-top-width",
|
|
2117
2114
|
value: { type: "unit", unit: "px", value: 1 }
|
|
2118
2115
|
},
|
|
2119
2116
|
{
|
|
2120
|
-
property: "
|
|
2117
|
+
property: "border-right-width",
|
|
2121
2118
|
value: { type: "unit", unit: "px", value: 1 }
|
|
2122
2119
|
},
|
|
2123
2120
|
{
|
|
2124
|
-
property: "
|
|
2121
|
+
property: "border-bottom-width",
|
|
2122
|
+
value: { type: "unit", unit: "px", value: 1 }
|
|
2123
|
+
},
|
|
2124
|
+
{
|
|
2125
|
+
property: "border-left-width",
|
|
2125
2126
|
value: { type: "unit", unit: "px", value: 1 }
|
|
2126
2127
|
}
|
|
2127
2128
|
];
|
|
2128
2129
|
const b = [
|
|
2129
2130
|
{
|
|
2130
|
-
property: "
|
|
2131
|
+
property: "font-weight",
|
|
2131
2132
|
value: { type: "unit", unit: "number", value: 700 }
|
|
2132
2133
|
},
|
|
2133
|
-
{ property: "
|
|
2134
|
-
{
|
|
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
|
+
},
|
|
2135
2139
|
{
|
|
2136
|
-
property: "
|
|
2140
|
+
property: "border-right-width",
|
|
2137
2141
|
value: { type: "unit", unit: "px", value: 1 }
|
|
2138
2142
|
},
|
|
2139
2143
|
{
|
|
2140
|
-
property: "
|
|
2144
|
+
property: "border-bottom-width",
|
|
2141
2145
|
value: { type: "unit", unit: "px", value: 1 }
|
|
2142
2146
|
},
|
|
2143
2147
|
{
|
|
2144
|
-
property: "
|
|
2148
|
+
property: "border-left-width",
|
|
2145
2149
|
value: { type: "unit", unit: "px", value: 1 }
|
|
2146
2150
|
}
|
|
2147
2151
|
];
|
|
2148
2152
|
const code = [
|
|
2149
2153
|
{
|
|
2150
|
-
property: "
|
|
2154
|
+
property: "font-family",
|
|
2151
2155
|
value: {
|
|
2152
2156
|
type: "fontFamily",
|
|
2153
2157
|
value: [
|
|
@@ -2160,174 +2164,222 @@ const code = [
|
|
|
2160
2164
|
]
|
|
2161
2165
|
}
|
|
2162
2166
|
},
|
|
2163
|
-
{ property: "
|
|
2164
|
-
{ property: "
|
|
2165
|
-
{ 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" } },
|
|
2166
2169
|
{
|
|
2167
|
-
property: "
|
|
2170
|
+
property: "border-top-width",
|
|
2168
2171
|
value: { type: "unit", unit: "px", value: 1 }
|
|
2169
2172
|
},
|
|
2170
2173
|
{
|
|
2171
|
-
property: "
|
|
2174
|
+
property: "border-right-width",
|
|
2172
2175
|
value: { type: "unit", unit: "px", value: 1 }
|
|
2173
2176
|
},
|
|
2174
2177
|
{
|
|
2175
|
-
property: "
|
|
2178
|
+
property: "border-bottom-width",
|
|
2179
|
+
value: { type: "unit", unit: "px", value: 1 }
|
|
2180
|
+
},
|
|
2181
|
+
{
|
|
2182
|
+
property: "border-left-width",
|
|
2176
2183
|
value: { type: "unit", unit: "px", value: 1 }
|
|
2177
2184
|
}
|
|
2178
2185
|
];
|
|
2179
2186
|
const sub = [
|
|
2180
|
-
{ property: "
|
|
2181
|
-
{
|
|
2187
|
+
{ property: "font-size", value: { type: "unit", unit: "%", value: 75 } },
|
|
2188
|
+
{
|
|
2189
|
+
property: "line-height",
|
|
2190
|
+
value: { type: "unit", unit: "number", value: 0 }
|
|
2191
|
+
},
|
|
2182
2192
|
{ property: "position", value: { type: "keyword", value: "relative" } },
|
|
2183
|
-
{ property: "
|
|
2184
|
-
{ property: "
|
|
2185
|
-
{ 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" } },
|
|
2186
2195
|
{
|
|
2187
|
-
property: "
|
|
2196
|
+
property: "border-top-width",
|
|
2188
2197
|
value: { type: "unit", unit: "px", value: 1 }
|
|
2189
2198
|
},
|
|
2190
2199
|
{
|
|
2191
|
-
property: "
|
|
2200
|
+
property: "border-right-width",
|
|
2192
2201
|
value: { type: "unit", unit: "px", value: 1 }
|
|
2193
2202
|
},
|
|
2194
2203
|
{
|
|
2195
|
-
property: "
|
|
2204
|
+
property: "border-bottom-width",
|
|
2205
|
+
value: { type: "unit", unit: "px", value: 1 }
|
|
2206
|
+
},
|
|
2207
|
+
{
|
|
2208
|
+
property: "border-left-width",
|
|
2196
2209
|
value: { type: "unit", unit: "px", value: 1 }
|
|
2197
2210
|
},
|
|
2198
2211
|
{ property: "bottom", value: { type: "unit", unit: "em", value: -0.25 } }
|
|
2199
2212
|
];
|
|
2200
2213
|
const sup = [
|
|
2201
|
-
{ property: "
|
|
2202
|
-
{
|
|
2214
|
+
{ property: "font-size", value: { type: "unit", unit: "%", value: 75 } },
|
|
2215
|
+
{
|
|
2216
|
+
property: "line-height",
|
|
2217
|
+
value: { type: "unit", unit: "number", value: 0 }
|
|
2218
|
+
},
|
|
2203
2219
|
{ property: "position", value: { type: "keyword", value: "relative" } },
|
|
2204
|
-
{ property: "
|
|
2205
|
-
{ property: "
|
|
2206
|
-
{
|
|
2220
|
+
{ property: "vertical-align", value: { type: "keyword", value: "baseline" } },
|
|
2221
|
+
{ property: "box-sizing", value: { type: "keyword", value: "border-box" } },
|
|
2222
|
+
{
|
|
2223
|
+
property: "border-top-width",
|
|
2224
|
+
value: { type: "unit", unit: "px", value: 1 }
|
|
2225
|
+
},
|
|
2207
2226
|
{
|
|
2208
|
-
property: "
|
|
2227
|
+
property: "border-right-width",
|
|
2209
2228
|
value: { type: "unit", unit: "px", value: 1 }
|
|
2210
2229
|
},
|
|
2211
2230
|
{
|
|
2212
|
-
property: "
|
|
2231
|
+
property: "border-bottom-width",
|
|
2213
2232
|
value: { type: "unit", unit: "px", value: 1 }
|
|
2214
2233
|
},
|
|
2215
2234
|
{
|
|
2216
|
-
property: "
|
|
2235
|
+
property: "border-left-width",
|
|
2217
2236
|
value: { type: "unit", unit: "px", value: 1 }
|
|
2218
2237
|
},
|
|
2219
2238
|
{ property: "top", value: { type: "unit", unit: "em", value: -0.5 } }
|
|
2220
2239
|
];
|
|
2221
2240
|
const input = [
|
|
2222
|
-
{ property: "
|
|
2223
|
-
{ property: "
|
|
2241
|
+
{ property: "font-family", value: { type: "keyword", value: "inherit" } },
|
|
2242
|
+
{ property: "font-size", value: { type: "unit", unit: "%", value: 100 } },
|
|
2224
2243
|
{
|
|
2225
|
-
property: "
|
|
2244
|
+
property: "line-height",
|
|
2226
2245
|
value: { type: "unit", unit: "number", value: 1.15 }
|
|
2227
2246
|
},
|
|
2228
|
-
{ property: "
|
|
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
|
+
},
|
|
2229
2252
|
{
|
|
2230
|
-
property: "
|
|
2253
|
+
property: "margin-bottom",
|
|
2231
2254
|
value: { type: "unit", unit: "number", value: 0 }
|
|
2232
2255
|
},
|
|
2233
2256
|
{
|
|
2234
|
-
property: "
|
|
2257
|
+
property: "margin-left",
|
|
2235
2258
|
value: { type: "unit", unit: "number", value: 0 }
|
|
2236
2259
|
},
|
|
2237
|
-
{ property: "
|
|
2238
|
-
{
|
|
2239
|
-
|
|
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
|
+
},
|
|
2240
2265
|
{
|
|
2241
|
-
property: "
|
|
2266
|
+
property: "border-right-width",
|
|
2242
2267
|
value: { type: "unit", unit: "px", value: 1 }
|
|
2243
2268
|
},
|
|
2244
2269
|
{
|
|
2245
|
-
property: "
|
|
2270
|
+
property: "border-bottom-width",
|
|
2246
2271
|
value: { type: "unit", unit: "px", value: 1 }
|
|
2247
2272
|
},
|
|
2248
2273
|
{
|
|
2249
|
-
property: "
|
|
2274
|
+
property: "border-left-width",
|
|
2250
2275
|
value: { type: "unit", unit: "px", value: 1 }
|
|
2251
2276
|
},
|
|
2252
|
-
{ property: "
|
|
2253
|
-
{
|
|
2254
|
-
|
|
2255
|
-
|
|
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" } }
|
|
2256
2287
|
];
|
|
2257
2288
|
const textarea = input;
|
|
2258
2289
|
const radio = [
|
|
2259
|
-
{ property: "
|
|
2260
|
-
{ property: "
|
|
2290
|
+
{ property: "font-family", value: { type: "keyword", value: "inherit" } },
|
|
2291
|
+
{ property: "font-size", value: { type: "unit", unit: "%", value: 100 } },
|
|
2261
2292
|
{
|
|
2262
|
-
property: "
|
|
2293
|
+
property: "line-height",
|
|
2263
2294
|
value: { type: "unit", unit: "number", value: 1.15 }
|
|
2264
2295
|
},
|
|
2265
|
-
{ property: "
|
|
2296
|
+
{ property: "margin-top", value: { type: "unit", unit: "number", value: 0 } },
|
|
2297
|
+
{
|
|
2298
|
+
property: "margin-right",
|
|
2299
|
+
value: { type: "unit", unit: "number", value: 0 }
|
|
2300
|
+
},
|
|
2266
2301
|
{
|
|
2267
|
-
property: "
|
|
2302
|
+
property: "margin-bottom",
|
|
2268
2303
|
value: { type: "unit", unit: "number", value: 0 }
|
|
2269
2304
|
},
|
|
2270
2305
|
{
|
|
2271
|
-
property: "
|
|
2306
|
+
property: "margin-left",
|
|
2272
2307
|
value: { type: "unit", unit: "number", value: 0 }
|
|
2273
2308
|
},
|
|
2274
|
-
{ property: "
|
|
2275
|
-
{
|
|
2276
|
-
|
|
2309
|
+
{ property: "box-sizing", value: { type: "keyword", value: "border-box" } },
|
|
2310
|
+
{
|
|
2311
|
+
property: "border-top-width",
|
|
2312
|
+
value: { type: "unit", unit: "px", value: 1 }
|
|
2313
|
+
},
|
|
2277
2314
|
{
|
|
2278
|
-
property: "
|
|
2315
|
+
property: "border-right-width",
|
|
2279
2316
|
value: { type: "unit", unit: "px", value: 1 }
|
|
2280
2317
|
},
|
|
2281
2318
|
{
|
|
2282
|
-
property: "
|
|
2319
|
+
property: "border-bottom-width",
|
|
2283
2320
|
value: { type: "unit", unit: "px", value: 1 }
|
|
2284
2321
|
},
|
|
2285
2322
|
{
|
|
2286
|
-
property: "
|
|
2323
|
+
property: "border-left-width",
|
|
2287
2324
|
value: { type: "unit", unit: "px", value: 1 }
|
|
2288
2325
|
},
|
|
2289
|
-
{ property: "
|
|
2290
|
-
{ property: "
|
|
2291
|
-
{
|
|
2292
|
-
|
|
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" } }
|
|
2293
2333
|
];
|
|
2294
2334
|
const checkbox = radio;
|
|
2295
2335
|
const button = [
|
|
2296
|
-
{ property: "
|
|
2297
|
-
{ property: "
|
|
2336
|
+
{ property: "font-family", value: { type: "keyword", value: "inherit" } },
|
|
2337
|
+
{ property: "font-size", value: { type: "unit", unit: "%", value: 100 } },
|
|
2298
2338
|
{
|
|
2299
|
-
property: "
|
|
2339
|
+
property: "line-height",
|
|
2300
2340
|
value: { type: "unit", unit: "number", value: 1.15 }
|
|
2301
2341
|
},
|
|
2302
|
-
{ property: "
|
|
2342
|
+
{ property: "margin-top", value: { type: "unit", unit: "number", value: 0 } },
|
|
2303
2343
|
{
|
|
2304
|
-
property: "
|
|
2344
|
+
property: "margin-right",
|
|
2305
2345
|
value: { type: "unit", unit: "number", value: 0 }
|
|
2306
2346
|
},
|
|
2307
2347
|
{
|
|
2308
|
-
property: "
|
|
2348
|
+
property: "margin-bottom",
|
|
2309
2349
|
value: { type: "unit", unit: "number", value: 0 }
|
|
2310
2350
|
},
|
|
2311
|
-
{ property: "marginLeft", value: { type: "unit", unit: "number", value: 0 } },
|
|
2312
|
-
{ property: "boxSizing", value: { type: "keyword", value: "border-box" } },
|
|
2313
|
-
{ property: "borderTopWidth", value: { type: "unit", unit: "px", value: 1 } },
|
|
2314
2351
|
{
|
|
2315
|
-
property: "
|
|
2352
|
+
property: "margin-left",
|
|
2353
|
+
value: { type: "unit", unit: "number", value: 0 }
|
|
2354
|
+
},
|
|
2355
|
+
{ property: "box-sizing", value: { type: "keyword", value: "border-box" } },
|
|
2356
|
+
{
|
|
2357
|
+
property: "border-top-width",
|
|
2316
2358
|
value: { type: "unit", unit: "px", value: 1 }
|
|
2317
2359
|
},
|
|
2318
2360
|
{
|
|
2319
|
-
property: "
|
|
2361
|
+
property: "border-right-width",
|
|
2320
2362
|
value: { type: "unit", unit: "px", value: 1 }
|
|
2321
2363
|
},
|
|
2322
2364
|
{
|
|
2323
|
-
property: "
|
|
2365
|
+
property: "border-bottom-width",
|
|
2324
2366
|
value: { type: "unit", unit: "px", value: 1 }
|
|
2325
2367
|
},
|
|
2326
|
-
{
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
{ property: "
|
|
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" } }
|
|
2331
2383
|
];
|
|
2332
2384
|
const select = button;
|
|
2333
2385
|
const rootComponent = "ws:root";
|
|
@@ -2424,6 +2476,58 @@ const parseComponentName = (componentName) => {
|
|
|
2424
2476
|
}
|
|
2425
2477
|
return [namespace, name2];
|
|
2426
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
|
+
};
|
|
2427
2531
|
const transpileExpression = ({
|
|
2428
2532
|
expression,
|
|
2429
2533
|
executable = false,
|
|
@@ -2473,7 +2577,10 @@ const transpileExpression = ({
|
|
|
2473
2577
|
return expression;
|
|
2474
2578
|
};
|
|
2475
2579
|
const dataSourceVariablePrefix = "$ws$dataSource$";
|
|
2476
|
-
const
|
|
2580
|
+
const decodeDataVariableId = (name2) => {
|
|
2581
|
+
if (name2 === "$ws$system") {
|
|
2582
|
+
return SYSTEM_VARIABLE_ID;
|
|
2583
|
+
}
|
|
2477
2584
|
if (name2.startsWith(dataSourceVariablePrefix)) {
|
|
2478
2585
|
const encoded = name2.slice(dataSourceVariablePrefix.length);
|
|
2479
2586
|
return encoded.replaceAll("__DASH__", "-");
|
|
@@ -2490,8 +2597,11 @@ const generateExpression = ({
|
|
|
2490
2597
|
expression,
|
|
2491
2598
|
executable: true,
|
|
2492
2599
|
replaceVariable: (identifier) => {
|
|
2493
|
-
const depId =
|
|
2494
|
-
|
|
2600
|
+
const depId = decodeDataVariableId(identifier);
|
|
2601
|
+
let dep = depId ? dataSources.get(depId) : void 0;
|
|
2602
|
+
if (depId === SYSTEM_VARIABLE_ID) {
|
|
2603
|
+
dep = systemParameter;
|
|
2604
|
+
}
|
|
2495
2605
|
if (dep) {
|
|
2496
2606
|
usedDataSources == null ? void 0 : usedDataSources.set(dep.id, dep);
|
|
2497
2607
|
return scope.getName(dep.id, dep.name);
|
|
@@ -2661,12 +2771,11 @@ const generateResources = ({
|
|
|
2661
2771
|
`;
|
|
2662
2772
|
}
|
|
2663
2773
|
if (dataSource.type === "parameter") {
|
|
2664
|
-
if (dataSource.id
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
const name2 = scope.getName(dataSource.id, dataSource.name);
|
|
2668
|
-
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
|
|
2669
2777
|
`;
|
|
2778
|
+
}
|
|
2670
2779
|
}
|
|
2671
2780
|
}
|
|
2672
2781
|
let generated = "";
|
|
@@ -2863,7 +2972,7 @@ const generatePageMeta = ({
|
|
|
2863
2972
|
continue;
|
|
2864
2973
|
}
|
|
2865
2974
|
if (dataSource.type === "parameter") {
|
|
2866
|
-
if (dataSource.id === page.systemDataSourceId) {
|
|
2975
|
+
if (dataSource.id === page.systemDataSourceId || dataSource.id === SYSTEM_VARIABLE_ID) {
|
|
2867
2976
|
const valueName = localScope.getName(dataSource.id, dataSource.name);
|
|
2868
2977
|
generated += ` let ${valueName} = system
|
|
2869
2978
|
`;
|
|
@@ -2907,6 +3016,22 @@ const generatePageMeta = ({
|
|
|
2907
3016
|
`;
|
|
2908
3017
|
return generated;
|
|
2909
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
|
+
};
|
|
2910
3035
|
const createImageValueTransformer = (assets, { assetBaseUrl }) => (styleValue) => {
|
|
2911
3036
|
if (styleValue.type === "image" && styleValue.value.type === "asset") {
|
|
2912
3037
|
const asset = assets.get(styleValue.value.value);
|
|
@@ -2936,10 +3061,11 @@ const generateCss = ({
|
|
|
2936
3061
|
assetBaseUrl,
|
|
2937
3062
|
atomic
|
|
2938
3063
|
}) => {
|
|
2939
|
-
const
|
|
2940
|
-
const
|
|
2941
|
-
|
|
2942
|
-
|
|
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");
|
|
2943
3069
|
const presetClasses = /* @__PURE__ */ new Map();
|
|
2944
3070
|
const scope = createScope([], normalizeClassName, "-");
|
|
2945
3071
|
for (const [component, meta2] of componentMetas) {
|
|
@@ -2950,8 +3076,8 @@ const generateCss = ({
|
|
|
2950
3076
|
presetClasses.set(component, className);
|
|
2951
3077
|
}
|
|
2952
3078
|
for (const [tag, styles2] of presetStyle2) {
|
|
2953
|
-
const selector = component === rootComponent ? ":root" :
|
|
2954
|
-
const rule =
|
|
3079
|
+
const selector = component === rootComponent ? ":root" : `${tag}.${className}`;
|
|
3080
|
+
const rule = presetSheet.addNestingRule(selector);
|
|
2955
3081
|
for (const declaration of styles2) {
|
|
2956
3082
|
rule.setDeclaration({
|
|
2957
3083
|
breakpoint: "presets",
|
|
@@ -2963,14 +3089,14 @@ const generateCss = ({
|
|
|
2963
3089
|
}
|
|
2964
3090
|
}
|
|
2965
3091
|
for (const breakpoint of breakpoints.values()) {
|
|
2966
|
-
|
|
3092
|
+
userSheet.addMediaRule(breakpoint.id, breakpoint);
|
|
2967
3093
|
}
|
|
2968
3094
|
const imageValueTransformer = createImageValueTransformer(assets, {
|
|
2969
3095
|
assetBaseUrl
|
|
2970
3096
|
});
|
|
2971
|
-
|
|
3097
|
+
userSheet.setTransformer(imageValueTransformer);
|
|
2972
3098
|
for (const styleDecl of styles.values()) {
|
|
2973
|
-
const rule =
|
|
3099
|
+
const rule = userSheet.addMixinRule(styleDecl.styleSourceId);
|
|
2974
3100
|
rule.setDeclaration({
|
|
2975
3101
|
breakpoint: styleDecl.breakpointId,
|
|
2976
3102
|
selector: styleDecl.state ?? "",
|
|
@@ -3002,7 +3128,7 @@ const generateCss = ({
|
|
|
3002
3128
|
let { instanceId } = selection;
|
|
3003
3129
|
const { values } = selection;
|
|
3004
3130
|
if (instanceId === ROOT_INSTANCE_ID) {
|
|
3005
|
-
const rule2 =
|
|
3131
|
+
const rule2 = userSheet.addNestingRule(`:root`);
|
|
3006
3132
|
rule2.applyMixins(values);
|
|
3007
3133
|
continue;
|
|
3008
3134
|
}
|
|
@@ -3031,22 +3157,30 @@ const generateCss = ({
|
|
|
3031
3157
|
}
|
|
3032
3158
|
classList.push(className);
|
|
3033
3159
|
}
|
|
3034
|
-
const rule =
|
|
3160
|
+
const rule = userSheet.addNestingRule(`.${className}`, descendantSuffix);
|
|
3035
3161
|
rule.applyMixins(values);
|
|
3036
3162
|
instanceByRule.set(rule, instanceId);
|
|
3037
3163
|
}
|
|
3164
|
+
const fontCss = fontSheet.cssText;
|
|
3165
|
+
const presetCss = presetSheet.cssText.replaceAll(
|
|
3166
|
+
"@media all ",
|
|
3167
|
+
"@layer presets "
|
|
3168
|
+
);
|
|
3038
3169
|
if (atomic) {
|
|
3039
|
-
const { cssText } = generateAtomic(
|
|
3170
|
+
const { cssText } = generateAtomic(userSheet, {
|
|
3040
3171
|
getKey: (rule) => instanceByRule.get(rule),
|
|
3041
3172
|
transformValue: imageValueTransformer,
|
|
3042
3173
|
classes
|
|
3043
3174
|
});
|
|
3044
|
-
return {
|
|
3045
|
-
${
|
|
3175
|
+
return {
|
|
3176
|
+
cssText: `${fontCss}${presetCss}
|
|
3177
|
+
${cssText}`,
|
|
3178
|
+
classes
|
|
3179
|
+
};
|
|
3046
3180
|
}
|
|
3047
3181
|
return {
|
|
3048
|
-
cssText: `${
|
|
3049
|
-
${
|
|
3182
|
+
cssText: `${fontCss}${presetCss}
|
|
3183
|
+
${userSheet.cssText}`,
|
|
3050
3184
|
classes
|
|
3051
3185
|
};
|
|
3052
3186
|
};
|
|
@@ -3231,48 +3365,6 @@ const namespaceMeta = (meta2, namespace, components) => {
|
|
|
3231
3365
|
}
|
|
3232
3366
|
return newMeta;
|
|
3233
3367
|
};
|
|
3234
|
-
const getIndexesWithinAncestors = (metas, instances, rootIds) => {
|
|
3235
|
-
const ancestors = /* @__PURE__ */ new Set();
|
|
3236
|
-
for (const meta2 of metas.values()) {
|
|
3237
|
-
if (meta2.indexWithinAncestor !== void 0) {
|
|
3238
|
-
ancestors.add(meta2.indexWithinAncestor);
|
|
3239
|
-
}
|
|
3240
|
-
}
|
|
3241
|
-
const indexes = /* @__PURE__ */ new Map();
|
|
3242
|
-
const traverseInstances2 = (instances2, instanceId, latestIndexes2 = /* @__PURE__ */ new Map()) => {
|
|
3243
|
-
const instance = instances2.get(instanceId);
|
|
3244
|
-
if (instance === void 0) {
|
|
3245
|
-
return;
|
|
3246
|
-
}
|
|
3247
|
-
const meta2 = metas.get(instance.component);
|
|
3248
|
-
if (meta2 === void 0) {
|
|
3249
|
-
return;
|
|
3250
|
-
}
|
|
3251
|
-
if (ancestors.has(instance.component)) {
|
|
3252
|
-
latestIndexes2 = new Map(latestIndexes2);
|
|
3253
|
-
latestIndexes2.set(instance.component, /* @__PURE__ */ new Map());
|
|
3254
|
-
}
|
|
3255
|
-
if (meta2.indexWithinAncestor !== void 0) {
|
|
3256
|
-
const ancestorIndexes = latestIndexes2.get(meta2.indexWithinAncestor);
|
|
3257
|
-
if (ancestorIndexes !== void 0) {
|
|
3258
|
-
let index = ancestorIndexes.get(instance.component) ?? -1;
|
|
3259
|
-
index += 1;
|
|
3260
|
-
ancestorIndexes.set(instance.component, index);
|
|
3261
|
-
indexes.set(instance.id, index);
|
|
3262
|
-
}
|
|
3263
|
-
}
|
|
3264
|
-
for (const child of instance.children) {
|
|
3265
|
-
if (child.type === "id") {
|
|
3266
|
-
traverseInstances2(instances2, child.value, latestIndexes2);
|
|
3267
|
-
}
|
|
3268
|
-
}
|
|
3269
|
-
};
|
|
3270
|
-
const latestIndexes = /* @__PURE__ */ new Map();
|
|
3271
|
-
for (const instanceId of rootIds) {
|
|
3272
|
-
traverseInstances2(instances, instanceId, latestIndexes);
|
|
3273
|
-
}
|
|
3274
|
-
return indexes;
|
|
3275
|
-
};
|
|
3276
3368
|
const generateAction = ({
|
|
3277
3369
|
scope,
|
|
3278
3370
|
prop,
|
|
@@ -3291,7 +3383,7 @@ const generateAction = ({
|
|
|
3291
3383
|
if (args == null ? void 0 : args.includes(identifier)) {
|
|
3292
3384
|
return;
|
|
3293
3385
|
}
|
|
3294
|
-
const depId =
|
|
3386
|
+
const depId = decodeDataVariableId(identifier);
|
|
3295
3387
|
const dep = depId ? dataSources.get(depId) : void 0;
|
|
3296
3388
|
if (dep) {
|
|
3297
3389
|
usedDataSources.set(dep.id, dep);
|
|
@@ -3335,7 +3427,7 @@ const generatePropValue = ({
|
|
|
3335
3427
|
if (prop.type === "asset" || prop.type === "page") {
|
|
3336
3428
|
return;
|
|
3337
3429
|
}
|
|
3338
|
-
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") {
|
|
3339
3431
|
return JSON.stringify(prop.value);
|
|
3340
3432
|
}
|
|
3341
3433
|
if (prop.type === "parameter") {
|
|
@@ -3446,7 +3538,7 @@ ${prop.name}={${propValue}}`;
|
|
|
3446
3538
|
return "";
|
|
3447
3539
|
}
|
|
3448
3540
|
const indexVariable = scope.getName(`${instance.id}-index`, "index");
|
|
3449
|
-
generatedElement += `{${collectionDataValue}?.map((${collectionItemValue}: any, ${indexVariable}: number) =>
|
|
3541
|
+
generatedElement += `{${collectionDataValue}?.map?.((${collectionItemValue}: any, ${indexVariable}: number) =>
|
|
3450
3542
|
`;
|
|
3451
3543
|
generatedElement += `<Fragment key={${indexVariable}}>
|
|
3452
3544
|
`;
|
|
@@ -3567,49 +3659,56 @@ const generateWebstudioComponent = ({
|
|
|
3567
3659
|
instances,
|
|
3568
3660
|
props: props2,
|
|
3569
3661
|
dataSources,
|
|
3570
|
-
|
|
3662
|
+
metas,
|
|
3571
3663
|
classesMap
|
|
3572
3664
|
}) => {
|
|
3573
3665
|
const instance = instances.get(rootInstanceId);
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3666
|
+
const indexesWithinAncestors = getIndexesWithinAncestors(metas, instances, [
|
|
3667
|
+
rootInstanceId
|
|
3668
|
+
]);
|
|
3577
3669
|
const usedDataSources = /* @__PURE__ */ new Map();
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
props: props2,
|
|
3583
|
-
dataSources,
|
|
3584
|
-
usedDataSources,
|
|
3585
|
-
indexesWithinAncestors,
|
|
3586
|
-
classesMap,
|
|
3587
|
-
children: generateJsxChildren({
|
|
3670
|
+
let generatedJsx = "<></>\n";
|
|
3671
|
+
if (instance) {
|
|
3672
|
+
generatedJsx = generateJsxElement({
|
|
3673
|
+
context: "expression",
|
|
3588
3674
|
scope,
|
|
3589
|
-
|
|
3590
|
-
instances,
|
|
3675
|
+
instance,
|
|
3591
3676
|
props: props2,
|
|
3592
3677
|
dataSources,
|
|
3593
3678
|
usedDataSources,
|
|
3594
3679
|
indexesWithinAncestors,
|
|
3595
|
-
classesMap
|
|
3596
|
-
|
|
3597
|
-
|
|
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
|
+
}
|
|
3598
3693
|
let generatedProps = "";
|
|
3694
|
+
let generatedParameters = "";
|
|
3695
|
+
const uniqueParameters = new Set(
|
|
3696
|
+
parameters.map((parameter) => parameter.name)
|
|
3697
|
+
);
|
|
3599
3698
|
if (parameters.length > 0) {
|
|
3600
|
-
let
|
|
3601
|
-
|
|
3699
|
+
let generatedPropsType = "";
|
|
3700
|
+
for (const parameterName of uniqueParameters) {
|
|
3701
|
+
generatedPropsType += `${parameterName}: any; `;
|
|
3702
|
+
}
|
|
3703
|
+
generatedProps = `_props: { ${generatedPropsType}}`;
|
|
3602
3704
|
for (const parameter of parameters) {
|
|
3603
3705
|
const dataSource = usedDataSources.get(parameter.value);
|
|
3604
3706
|
if (dataSource) {
|
|
3605
3707
|
const valueName = scope.getName(dataSource.id, dataSource.name);
|
|
3606
|
-
|
|
3708
|
+
generatedParameters += `const ${valueName} = _props.${parameter.name};
|
|
3709
|
+
`;
|
|
3607
3710
|
}
|
|
3608
|
-
generatedPropsType += `${parameter.name}: any; `;
|
|
3609
3711
|
}
|
|
3610
|
-
generatedPropsValue += `}`;
|
|
3611
|
-
generatedPropsType += `}`;
|
|
3612
|
-
generatedProps = `${generatedPropsValue}: ${generatedPropsType}`;
|
|
3613
3712
|
}
|
|
3614
3713
|
let generatedDataSources = "";
|
|
3615
3714
|
for (const dataSource of usedDataSources.values()) {
|
|
@@ -3638,6 +3737,7 @@ const generateWebstudioComponent = ({
|
|
|
3638
3737
|
let generatedComponent = "";
|
|
3639
3738
|
generatedComponent += `const ${name2} = (${generatedProps}) => {
|
|
3640
3739
|
`;
|
|
3740
|
+
generatedComponent += `${generatedParameters}`;
|
|
3641
3741
|
generatedComponent += `${generatedDataSources}`;
|
|
3642
3742
|
generatedComponent += `return ${generatedJsx}`;
|
|
3643
3743
|
generatedComponent += `}
|
|
@@ -3755,14 +3855,14 @@ const htmlToJsx = (html2) => {
|
|
|
3755
3855
|
}
|
|
3756
3856
|
return result;
|
|
3757
3857
|
};
|
|
3758
|
-
const meta$
|
|
3858
|
+
const meta$J = {
|
|
3759
3859
|
category: "general",
|
|
3760
3860
|
type: "container",
|
|
3761
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.",
|
|
3762
3862
|
icon: SlotComponentIcon,
|
|
3763
3863
|
order: 5
|
|
3764
3864
|
};
|
|
3765
|
-
const meta$
|
|
3865
|
+
const meta$I = {
|
|
3766
3866
|
type: "container",
|
|
3767
3867
|
icon: ""
|
|
3768
3868
|
};
|
|
@@ -3783,12 +3883,12 @@ const presetStyle$y = {
|
|
|
3783
3883
|
value: { type: "keyword", value: "contents" }
|
|
3784
3884
|
},
|
|
3785
3885
|
{
|
|
3786
|
-
property: "
|
|
3886
|
+
property: "white-space-collapse",
|
|
3787
3887
|
value: { type: "keyword", value: "collapse" }
|
|
3788
3888
|
}
|
|
3789
3889
|
]
|
|
3790
3890
|
};
|
|
3791
|
-
const meta$
|
|
3891
|
+
const meta$H = {
|
|
3792
3892
|
category: "general",
|
|
3793
3893
|
type: "embed",
|
|
3794
3894
|
label: "HTML Embed",
|
|
@@ -3818,7 +3918,7 @@ const meta$G = {
|
|
|
3818
3918
|
},
|
|
3819
3919
|
initialProps: ["className", "clientOnly", "executeScriptOnCanvas"]
|
|
3820
3920
|
});
|
|
3821
|
-
const meta$
|
|
3921
|
+
const meta$G = {
|
|
3822
3922
|
type: "embed",
|
|
3823
3923
|
icon: MarkdownEmbedIcon,
|
|
3824
3924
|
presetStyle: {
|
|
@@ -3828,7 +3928,7 @@ const meta$F = {
|
|
|
3828
3928
|
value: { type: "keyword", value: "contents" }
|
|
3829
3929
|
},
|
|
3830
3930
|
{
|
|
3831
|
-
property: "
|
|
3931
|
+
property: "white-space-collapse",
|
|
3832
3932
|
value: { type: "keyword", value: "collapse" }
|
|
3833
3933
|
}
|
|
3834
3934
|
]
|
|
@@ -3838,16 +3938,16 @@ const presetStyle$x = {
|
|
|
3838
3938
|
body: [
|
|
3839
3939
|
...body,
|
|
3840
3940
|
{
|
|
3841
|
-
property: "
|
|
3941
|
+
property: "-webkit-font-smoothing",
|
|
3842
3942
|
value: { type: "keyword", value: "antialiased" }
|
|
3843
3943
|
},
|
|
3844
3944
|
{
|
|
3845
|
-
property: "
|
|
3945
|
+
property: "-moz-osx-font-smoothing",
|
|
3846
3946
|
value: { type: "keyword", value: "grayscale" }
|
|
3847
3947
|
}
|
|
3848
3948
|
]
|
|
3849
3949
|
};
|
|
3850
|
-
const meta$
|
|
3950
|
+
const meta$F = {
|
|
3851
3951
|
type: "container",
|
|
3852
3952
|
icon: BodyIcon,
|
|
3853
3953
|
states: defaultStates,
|
|
@@ -3865,7 +3965,7 @@ const presetStyle$w = {
|
|
|
3865
3965
|
nav,
|
|
3866
3966
|
section
|
|
3867
3967
|
};
|
|
3868
|
-
const meta$
|
|
3968
|
+
const meta$E = {
|
|
3869
3969
|
category: "general",
|
|
3870
3970
|
type: "container",
|
|
3871
3971
|
description: "A container for content. By default this is a Div, but the tag can be changed in settings.",
|
|
@@ -3878,12 +3978,12 @@ const presetStyle$v = {
|
|
|
3878
3978
|
div: [
|
|
3879
3979
|
...div,
|
|
3880
3980
|
{
|
|
3881
|
-
property: "
|
|
3981
|
+
property: "min-height",
|
|
3882
3982
|
value: { type: "unit", unit: "em", value: 1 }
|
|
3883
3983
|
}
|
|
3884
3984
|
]
|
|
3885
3985
|
};
|
|
3886
|
-
const meta$
|
|
3986
|
+
const meta$D = {
|
|
3887
3987
|
type: "container",
|
|
3888
3988
|
icon: TextIcon,
|
|
3889
3989
|
states: defaultStates,
|
|
@@ -3897,8 +3997,9 @@ const presetStyle$u = {
|
|
|
3897
3997
|
h5,
|
|
3898
3998
|
h6
|
|
3899
3999
|
};
|
|
3900
|
-
const meta$
|
|
4000
|
+
const meta$C = {
|
|
3901
4001
|
type: "container",
|
|
4002
|
+
placeholder: "Heading",
|
|
3902
4003
|
icon: HeadingIcon,
|
|
3903
4004
|
constraints: {
|
|
3904
4005
|
relation: "ancestor",
|
|
@@ -3910,8 +4011,9 @@ const meta$B = {
|
|
|
3910
4011
|
const presetStyle$t = {
|
|
3911
4012
|
p
|
|
3912
4013
|
};
|
|
3913
|
-
const meta$
|
|
4014
|
+
const meta$B = {
|
|
3914
4015
|
type: "container",
|
|
4016
|
+
placeholder: "Paragraph",
|
|
3915
4017
|
icon: TextAlignLeftIcon,
|
|
3916
4018
|
constraints: {
|
|
3917
4019
|
relation: "ancestor",
|
|
@@ -3929,8 +4031,9 @@ const presetStyle$s = {
|
|
|
3929
4031
|
}
|
|
3930
4032
|
]
|
|
3931
4033
|
};
|
|
3932
|
-
const meta$
|
|
4034
|
+
const meta$A = {
|
|
3933
4035
|
type: "container",
|
|
4036
|
+
placeholder: "Link",
|
|
3934
4037
|
icon: LinkIcon,
|
|
3935
4038
|
constraints: {
|
|
3936
4039
|
relation: "ancestor",
|
|
@@ -3950,14 +4053,14 @@ const meta$z = {
|
|
|
3950
4053
|
}
|
|
3951
4054
|
]
|
|
3952
4055
|
};
|
|
3953
|
-
const meta$
|
|
3954
|
-
...meta$
|
|
4056
|
+
const meta$z = {
|
|
4057
|
+
...meta$A,
|
|
3955
4058
|
type: "rich-text-child"
|
|
3956
4059
|
};
|
|
3957
4060
|
const presetStyle$r = {
|
|
3958
4061
|
span
|
|
3959
4062
|
};
|
|
3960
|
-
const meta$
|
|
4063
|
+
const meta$y = {
|
|
3961
4064
|
type: "rich-text-child",
|
|
3962
4065
|
label: "Text",
|
|
3963
4066
|
icon: PaintBrushIcon,
|
|
@@ -3967,7 +4070,7 @@ const meta$x = {
|
|
|
3967
4070
|
const presetStyle$q = {
|
|
3968
4071
|
b
|
|
3969
4072
|
};
|
|
3970
|
-
const meta$
|
|
4073
|
+
const meta$x = {
|
|
3971
4074
|
type: "rich-text-child",
|
|
3972
4075
|
label: "Bold Text",
|
|
3973
4076
|
icon: BoldIcon,
|
|
@@ -3978,12 +4081,12 @@ const presetStyle$p = {
|
|
|
3978
4081
|
i: [
|
|
3979
4082
|
...i,
|
|
3980
4083
|
{
|
|
3981
|
-
property: "
|
|
4084
|
+
property: "font-style",
|
|
3982
4085
|
value: { type: "keyword", value: "italic" }
|
|
3983
4086
|
}
|
|
3984
4087
|
]
|
|
3985
4088
|
};
|
|
3986
|
-
const meta$
|
|
4089
|
+
const meta$w = {
|
|
3987
4090
|
type: "rich-text-child",
|
|
3988
4091
|
label: "Italic Text",
|
|
3989
4092
|
icon: TextItalicIcon,
|
|
@@ -3993,7 +4096,7 @@ const meta$v = {
|
|
|
3993
4096
|
const presetStyle$o = {
|
|
3994
4097
|
sup
|
|
3995
4098
|
};
|
|
3996
|
-
const meta$
|
|
4099
|
+
const meta$v = {
|
|
3997
4100
|
type: "rich-text-child",
|
|
3998
4101
|
label: "Superscript Text",
|
|
3999
4102
|
icon: SuperscriptIcon,
|
|
@@ -4003,7 +4106,7 @@ const meta$u = {
|
|
|
4003
4106
|
const presetStyle$n = {
|
|
4004
4107
|
sub
|
|
4005
4108
|
};
|
|
4006
|
-
const meta$
|
|
4109
|
+
const meta$u = {
|
|
4007
4110
|
type: "rich-text-child",
|
|
4008
4111
|
label: "Subscript Text",
|
|
4009
4112
|
icon: SubscriptIcon,
|
|
@@ -4013,7 +4116,7 @@ const meta$t = {
|
|
|
4013
4116
|
const presetStyle$m = {
|
|
4014
4117
|
button
|
|
4015
4118
|
};
|
|
4016
|
-
const meta$
|
|
4119
|
+
const meta$t = {
|
|
4017
4120
|
icon: ButtonElementIcon,
|
|
4018
4121
|
type: "container",
|
|
4019
4122
|
constraints: {
|
|
@@ -4036,7 +4139,7 @@ const presetStyle$l = {
|
|
|
4036
4139
|
}
|
|
4037
4140
|
]
|
|
4038
4141
|
};
|
|
4039
|
-
const meta$
|
|
4142
|
+
const meta$s = {
|
|
4040
4143
|
category: "forms",
|
|
4041
4144
|
constraints: {
|
|
4042
4145
|
relation: "ancestor",
|
|
@@ -4062,7 +4165,7 @@ const meta$r = {
|
|
|
4062
4165
|
//{ selector: ":read-write", label: "Read Write" },
|
|
4063
4166
|
]
|
|
4064
4167
|
};
|
|
4065
|
-
const meta$
|
|
4168
|
+
const meta$r = {
|
|
4066
4169
|
label: "Webhook Form",
|
|
4067
4170
|
icon: WebhookFormIcon,
|
|
4068
4171
|
type: "container",
|
|
@@ -4081,10 +4184,10 @@ const meta$q = {
|
|
|
4081
4184
|
const presetStyle$k = {
|
|
4082
4185
|
form: [
|
|
4083
4186
|
...form,
|
|
4084
|
-
{ property: "
|
|
4187
|
+
{ property: "min-height", value: { type: "unit", unit: "px", value: 20 } }
|
|
4085
4188
|
]
|
|
4086
4189
|
};
|
|
4087
|
-
const meta$
|
|
4190
|
+
const meta$q = {
|
|
4088
4191
|
category: "forms",
|
|
4089
4192
|
type: "container",
|
|
4090
4193
|
label: "Form",
|
|
@@ -4103,7 +4206,7 @@ const presetStyle$j = {
|
|
|
4103
4206
|
...img,
|
|
4104
4207
|
// Otherwise on new image insert onto canvas it can overfit screen size multiple times
|
|
4105
4208
|
{
|
|
4106
|
-
property: "
|
|
4209
|
+
property: "max-width",
|
|
4107
4210
|
value: { type: "unit", unit: "%", value: 100 }
|
|
4108
4211
|
},
|
|
4109
4212
|
// inline | inline-block is not suitable because without line-height: 0 on the parent you get unsuitable spaces/margins
|
|
@@ -4121,7 +4224,7 @@ const presetStyle$j = {
|
|
|
4121
4224
|
}
|
|
4122
4225
|
]
|
|
4123
4226
|
};
|
|
4124
|
-
const meta$
|
|
4227
|
+
const meta$p = {
|
|
4125
4228
|
category: "media",
|
|
4126
4229
|
type: "embed",
|
|
4127
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.",
|
|
@@ -4133,53 +4236,54 @@ const meta$o = {
|
|
|
4133
4236
|
const presetStyle$i = {
|
|
4134
4237
|
blockquote: [
|
|
4135
4238
|
{
|
|
4136
|
-
property: "
|
|
4239
|
+
property: "margin-top",
|
|
4137
4240
|
value: { type: "unit", value: 0, unit: "number" }
|
|
4138
4241
|
},
|
|
4139
4242
|
{
|
|
4140
|
-
property: "
|
|
4243
|
+
property: "margin-right",
|
|
4141
4244
|
value: { type: "unit", value: 0, unit: "number" }
|
|
4142
4245
|
},
|
|
4143
4246
|
{
|
|
4144
|
-
property: "
|
|
4247
|
+
property: "margin-bottom",
|
|
4145
4248
|
value: { type: "unit", value: 10, unit: "px" }
|
|
4146
4249
|
},
|
|
4147
4250
|
{
|
|
4148
|
-
property: "
|
|
4251
|
+
property: "margin-left",
|
|
4149
4252
|
value: { type: "unit", value: 0, unit: "number" }
|
|
4150
4253
|
},
|
|
4151
4254
|
{
|
|
4152
|
-
property: "
|
|
4255
|
+
property: "padding-top",
|
|
4153
4256
|
value: { type: "unit", value: 10, unit: "px" }
|
|
4154
4257
|
},
|
|
4155
4258
|
{
|
|
4156
|
-
property: "
|
|
4259
|
+
property: "padding-bottom",
|
|
4157
4260
|
value: { type: "unit", value: 10, unit: "px" }
|
|
4158
4261
|
},
|
|
4159
4262
|
{
|
|
4160
|
-
property: "
|
|
4263
|
+
property: "padding-left",
|
|
4161
4264
|
value: { type: "unit", value: 20, unit: "px" }
|
|
4162
4265
|
},
|
|
4163
4266
|
{
|
|
4164
|
-
property: "
|
|
4267
|
+
property: "padding-right",
|
|
4165
4268
|
value: { type: "unit", value: 20, unit: "px" }
|
|
4166
4269
|
},
|
|
4167
4270
|
{
|
|
4168
|
-
property: "
|
|
4271
|
+
property: "border-left-width",
|
|
4169
4272
|
value: { type: "unit", value: 5, unit: "px" }
|
|
4170
4273
|
},
|
|
4171
4274
|
{
|
|
4172
|
-
property: "
|
|
4275
|
+
property: "border-left-style",
|
|
4173
4276
|
value: { type: "keyword", value: "solid" }
|
|
4174
4277
|
},
|
|
4175
4278
|
{
|
|
4176
|
-
property: "
|
|
4279
|
+
property: "border-left-color",
|
|
4177
4280
|
value: { type: "rgb", r: 226, g: 226, b: 226, alpha: 1 }
|
|
4178
4281
|
}
|
|
4179
4282
|
]
|
|
4180
4283
|
};
|
|
4181
|
-
const meta$
|
|
4284
|
+
const meta$o = {
|
|
4182
4285
|
type: "container",
|
|
4286
|
+
placeholder: "Blockquote",
|
|
4183
4287
|
icon: BlockquoteIcon,
|
|
4184
4288
|
states: defaultStates,
|
|
4185
4289
|
presetStyle: presetStyle$i
|
|
@@ -4188,35 +4292,35 @@ const presetStyle$h = {
|
|
|
4188
4292
|
ol: [
|
|
4189
4293
|
...ol,
|
|
4190
4294
|
{
|
|
4191
|
-
property: "
|
|
4295
|
+
property: "margin-top",
|
|
4192
4296
|
value: { type: "keyword", value: "0" }
|
|
4193
4297
|
},
|
|
4194
4298
|
{
|
|
4195
|
-
property: "
|
|
4299
|
+
property: "margin-bottom",
|
|
4196
4300
|
value: { type: "keyword", value: "10px" }
|
|
4197
4301
|
},
|
|
4198
4302
|
{
|
|
4199
|
-
property: "
|
|
4303
|
+
property: "padding-left",
|
|
4200
4304
|
value: { type: "keyword", value: "40px" }
|
|
4201
4305
|
}
|
|
4202
4306
|
],
|
|
4203
4307
|
ul: [
|
|
4204
4308
|
...ul,
|
|
4205
4309
|
{
|
|
4206
|
-
property: "
|
|
4310
|
+
property: "margin-top",
|
|
4207
4311
|
value: { type: "keyword", value: "0" }
|
|
4208
4312
|
},
|
|
4209
4313
|
{
|
|
4210
|
-
property: "
|
|
4314
|
+
property: "margin-bottom",
|
|
4211
4315
|
value: { type: "keyword", value: "10px" }
|
|
4212
4316
|
},
|
|
4213
4317
|
{
|
|
4214
|
-
property: "
|
|
4318
|
+
property: "padding-left",
|
|
4215
4319
|
value: { type: "keyword", value: "40px" }
|
|
4216
4320
|
}
|
|
4217
4321
|
]
|
|
4218
4322
|
};
|
|
4219
|
-
const meta$
|
|
4323
|
+
const meta$n = {
|
|
4220
4324
|
type: "container",
|
|
4221
4325
|
icon: ListIcon,
|
|
4222
4326
|
states: defaultStates,
|
|
@@ -4225,8 +4329,9 @@ const meta$m = {
|
|
|
4225
4329
|
const presetStyle$g = {
|
|
4226
4330
|
li
|
|
4227
4331
|
};
|
|
4228
|
-
const meta$
|
|
4332
|
+
const meta$m = {
|
|
4229
4333
|
type: "container",
|
|
4334
|
+
placeholder: "List item",
|
|
4230
4335
|
constraints: {
|
|
4231
4336
|
// cannot use parent relation here
|
|
4232
4337
|
// because list item can be put inside of collection or slot
|
|
@@ -4246,28 +4351,28 @@ const presetStyle$f = {
|
|
|
4246
4351
|
value: { type: "keyword", value: "1px" }
|
|
4247
4352
|
},
|
|
4248
4353
|
{
|
|
4249
|
-
property: "
|
|
4354
|
+
property: "background-color",
|
|
4250
4355
|
value: { type: "keyword", value: "gray" }
|
|
4251
4356
|
},
|
|
4252
4357
|
{
|
|
4253
|
-
property: "
|
|
4358
|
+
property: "border-top-style",
|
|
4254
4359
|
value: { type: "keyword", value: "none" }
|
|
4255
4360
|
},
|
|
4256
4361
|
{
|
|
4257
|
-
property: "
|
|
4362
|
+
property: "border-right-style",
|
|
4258
4363
|
value: { type: "keyword", value: "none" }
|
|
4259
4364
|
},
|
|
4260
4365
|
{
|
|
4261
|
-
property: "
|
|
4366
|
+
property: "border-left-style",
|
|
4262
4367
|
value: { type: "keyword", value: "none" }
|
|
4263
4368
|
},
|
|
4264
4369
|
{
|
|
4265
|
-
property: "
|
|
4370
|
+
property: "border-bottom-style",
|
|
4266
4371
|
value: { type: "keyword", value: "none" }
|
|
4267
4372
|
}
|
|
4268
4373
|
]
|
|
4269
4374
|
};
|
|
4270
|
-
const meta$
|
|
4375
|
+
const meta$l = {
|
|
4271
4376
|
category: "general",
|
|
4272
4377
|
type: "embed",
|
|
4273
4378
|
description: "Used to visually divide sections of content, helping to improve readability and organization within a webpage.",
|
|
@@ -4284,28 +4389,28 @@ const presetStyle$e = {
|
|
|
4284
4389
|
value: { type: "keyword", value: "block" }
|
|
4285
4390
|
},
|
|
4286
4391
|
{
|
|
4287
|
-
property: "
|
|
4392
|
+
property: "white-space-collapse",
|
|
4288
4393
|
value: { type: "keyword", value: "preserve" }
|
|
4289
4394
|
},
|
|
4290
4395
|
{
|
|
4291
|
-
property: "
|
|
4396
|
+
property: "text-wrap-mode",
|
|
4292
4397
|
value: { type: "keyword", value: "wrap" }
|
|
4293
4398
|
},
|
|
4294
4399
|
{
|
|
4295
|
-
property: "
|
|
4400
|
+
property: "padding-left",
|
|
4296
4401
|
value: { type: "unit", value: 0.2, unit: "em" }
|
|
4297
4402
|
},
|
|
4298
4403
|
{
|
|
4299
|
-
property: "
|
|
4404
|
+
property: "padding-right",
|
|
4300
4405
|
value: { type: "unit", value: 0.2, unit: "em" }
|
|
4301
4406
|
},
|
|
4302
4407
|
{
|
|
4303
|
-
property: "
|
|
4408
|
+
property: "background-color",
|
|
4304
4409
|
value: { type: "rgb", r: 238, g: 238, b: 238, alpha: 1 }
|
|
4305
4410
|
}
|
|
4306
4411
|
]
|
|
4307
4412
|
};
|
|
4308
|
-
const meta$
|
|
4413
|
+
const meta$k = {
|
|
4309
4414
|
category: "general",
|
|
4310
4415
|
type: "embed",
|
|
4311
4416
|
description: "Use this component when you want to display code as text on the page.",
|
|
@@ -4324,7 +4429,7 @@ const presetStyle$d = {
|
|
|
4324
4429
|
{ property: "display", value: { type: "keyword", value: "block" } }
|
|
4325
4430
|
]
|
|
4326
4431
|
};
|
|
4327
|
-
const meta$
|
|
4432
|
+
const meta$j = {
|
|
4328
4433
|
constraints: {
|
|
4329
4434
|
relation: "ancestor",
|
|
4330
4435
|
component: { $nin: ["Button", "Link"] }
|
|
@@ -4346,7 +4451,7 @@ const presetStyle$c = {
|
|
|
4346
4451
|
}
|
|
4347
4452
|
]
|
|
4348
4453
|
};
|
|
4349
|
-
const meta$
|
|
4454
|
+
const meta$i = {
|
|
4350
4455
|
category: "forms",
|
|
4351
4456
|
type: "control",
|
|
4352
4457
|
label: "Text Area",
|
|
@@ -4376,12 +4481,12 @@ const presetStyle$b = {
|
|
|
4376
4481
|
input: [
|
|
4377
4482
|
...radio,
|
|
4378
4483
|
{
|
|
4379
|
-
property: "
|
|
4484
|
+
property: "margin-right",
|
|
4380
4485
|
value: { type: "unit", unit: "em", value: 0.5 }
|
|
4381
4486
|
}
|
|
4382
4487
|
]
|
|
4383
4488
|
};
|
|
4384
|
-
const meta$
|
|
4489
|
+
const meta$h = {
|
|
4385
4490
|
constraints: {
|
|
4386
4491
|
relation: "ancestor",
|
|
4387
4492
|
component: { $nin: ["Button", "Link"] }
|
|
@@ -4406,12 +4511,12 @@ const presetStyle$a = {
|
|
|
4406
4511
|
input: [
|
|
4407
4512
|
...checkbox,
|
|
4408
4513
|
{
|
|
4409
|
-
property: "
|
|
4514
|
+
property: "margin-right",
|
|
4410
4515
|
value: { type: "unit", unit: "em", value: 0.5 }
|
|
4411
4516
|
}
|
|
4412
4517
|
]
|
|
4413
4518
|
};
|
|
4414
|
-
const meta$
|
|
4519
|
+
const meta$g = {
|
|
4415
4520
|
constraints: {
|
|
4416
4521
|
relation: "ancestor",
|
|
4417
4522
|
component: { $nin: ["Button", "Link"] }
|
|
@@ -4433,7 +4538,7 @@ const meta$f = {
|
|
|
4433
4538
|
const presetStyle$9 = {
|
|
4434
4539
|
div
|
|
4435
4540
|
};
|
|
4436
|
-
const meta$
|
|
4541
|
+
const meta$f = {
|
|
4437
4542
|
type: "container",
|
|
4438
4543
|
icon: VimeoIcon,
|
|
4439
4544
|
states: defaultStates,
|
|
@@ -4446,7 +4551,7 @@ const meta$e = {
|
|
|
4446
4551
|
const presetStyle$8 = {
|
|
4447
4552
|
div
|
|
4448
4553
|
};
|
|
4449
|
-
const meta$
|
|
4554
|
+
const meta$e = {
|
|
4450
4555
|
type: "container",
|
|
4451
4556
|
icon: YoutubeIcon,
|
|
4452
4557
|
states: defaultStates,
|
|
@@ -4456,8 +4561,8 @@ const meta$d = {
|
|
|
4456
4561
|
component: { $nin: ["Button", "Link", "Heading"] }
|
|
4457
4562
|
}
|
|
4458
4563
|
};
|
|
4459
|
-
const meta$
|
|
4460
|
-
...meta$
|
|
4564
|
+
const meta$d = {
|
|
4565
|
+
...meta$p,
|
|
4461
4566
|
category: "hidden",
|
|
4462
4567
|
label: "Preview Image",
|
|
4463
4568
|
constraints: {
|
|
@@ -4468,7 +4573,7 @@ const meta$c = {
|
|
|
4468
4573
|
const presetStyle$7 = {
|
|
4469
4574
|
button
|
|
4470
4575
|
};
|
|
4471
|
-
const meta$
|
|
4576
|
+
const meta$c = {
|
|
4472
4577
|
category: "hidden",
|
|
4473
4578
|
type: "container",
|
|
4474
4579
|
constraints: [
|
|
@@ -4489,7 +4594,7 @@ const meta$b = {
|
|
|
4489
4594
|
const presetStyle$6 = {
|
|
4490
4595
|
div
|
|
4491
4596
|
};
|
|
4492
|
-
const meta$
|
|
4597
|
+
const meta$b = {
|
|
4493
4598
|
type: "container",
|
|
4494
4599
|
constraints: {
|
|
4495
4600
|
relation: "ancestor",
|
|
@@ -4501,14 +4606,14 @@ const meta$a = {
|
|
|
4501
4606
|
category: "hidden",
|
|
4502
4607
|
label: "Spinner"
|
|
4503
4608
|
};
|
|
4504
|
-
const meta$
|
|
4609
|
+
const meta$a = {
|
|
4505
4610
|
category: "xml",
|
|
4506
4611
|
order: 6,
|
|
4507
4612
|
type: "container",
|
|
4508
4613
|
icon: XmlIcon,
|
|
4509
4614
|
description: "XML Node"
|
|
4510
4615
|
};
|
|
4511
|
-
const meta$
|
|
4616
|
+
const meta$9 = {
|
|
4512
4617
|
category: "xml",
|
|
4513
4618
|
type: "container",
|
|
4514
4619
|
description: "Converts machine-readable date and time to ISO format.",
|
|
@@ -4518,7 +4623,7 @@ const meta$8 = {
|
|
|
4518
4623
|
const presetStyle$5 = {
|
|
4519
4624
|
time
|
|
4520
4625
|
};
|
|
4521
|
-
const meta$
|
|
4626
|
+
const meta$8 = {
|
|
4522
4627
|
category: "localization",
|
|
4523
4628
|
type: "container",
|
|
4524
4629
|
description: "Converts machine-readable date and time to a human-readable format.",
|
|
@@ -4535,7 +4640,7 @@ const presetStyle$4 = {
|
|
|
4535
4640
|
}
|
|
4536
4641
|
]
|
|
4537
4642
|
};
|
|
4538
|
-
const meta$
|
|
4643
|
+
const meta$7 = {
|
|
4539
4644
|
constraints: {
|
|
4540
4645
|
relation: "ancestor",
|
|
4541
4646
|
component: { $nin: ["Button", "Link"] }
|
|
@@ -4555,7 +4660,7 @@ const meta$6 = {
|
|
|
4555
4660
|
const presetStyle$3 = {
|
|
4556
4661
|
option: [
|
|
4557
4662
|
{
|
|
4558
|
-
property: "
|
|
4663
|
+
property: "background-color",
|
|
4559
4664
|
state: ":checked",
|
|
4560
4665
|
value: {
|
|
4561
4666
|
type: "rgb",
|
|
@@ -4567,7 +4672,7 @@ const presetStyle$3 = {
|
|
|
4567
4672
|
}
|
|
4568
4673
|
]
|
|
4569
4674
|
};
|
|
4570
|
-
const meta$
|
|
4675
|
+
const meta$6 = {
|
|
4571
4676
|
category: "hidden",
|
|
4572
4677
|
constraints: {
|
|
4573
4678
|
relation: "parent",
|
|
@@ -4588,7 +4693,7 @@ const meta$5 = {
|
|
|
4588
4693
|
{ selector: ":disabled", label: "Disabled" }
|
|
4589
4694
|
]
|
|
4590
4695
|
};
|
|
4591
|
-
const meta$
|
|
4696
|
+
const meta$5 = {
|
|
4592
4697
|
icon: HeaderIcon,
|
|
4593
4698
|
type: "container",
|
|
4594
4699
|
description: "Inserts children into the head of the document",
|
|
@@ -4603,25 +4708,25 @@ const meta$4 = {
|
|
|
4603
4708
|
}
|
|
4604
4709
|
]
|
|
4605
4710
|
};
|
|
4606
|
-
const meta$
|
|
4711
|
+
const meta$4 = {
|
|
4607
4712
|
category: "hidden",
|
|
4608
4713
|
icon: ResourceIcon,
|
|
4609
|
-
type: "
|
|
4714
|
+
type: "embed",
|
|
4610
4715
|
constraints: {
|
|
4611
4716
|
relation: "parent",
|
|
4612
4717
|
component: { $eq: "HeadSlot" }
|
|
4613
4718
|
}
|
|
4614
4719
|
};
|
|
4615
|
-
const meta$
|
|
4720
|
+
const meta$3 = {
|
|
4616
4721
|
category: "hidden",
|
|
4617
4722
|
icon: WindowInfoIcon,
|
|
4618
|
-
type: "
|
|
4723
|
+
type: "embed",
|
|
4619
4724
|
constraints: {
|
|
4620
4725
|
relation: "parent",
|
|
4621
4726
|
component: { $eq: "HeadSlot" }
|
|
4622
4727
|
}
|
|
4623
4728
|
};
|
|
4624
|
-
const meta$
|
|
4729
|
+
const meta$2 = {
|
|
4625
4730
|
category: "hidden",
|
|
4626
4731
|
icon: WindowTitleIcon,
|
|
4627
4732
|
type: "container",
|
|
@@ -4632,61 +4737,70 @@ const meta$1 = {
|
|
|
4632
4737
|
};
|
|
4633
4738
|
const baseComponentMetas = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4634
4739
|
__proto__: null,
|
|
4635
|
-
Blockquote: meta$
|
|
4636
|
-
Body: meta$
|
|
4637
|
-
Bold: meta$
|
|
4638
|
-
Box: meta$
|
|
4639
|
-
Button: meta$
|
|
4640
|
-
Checkbox: meta$
|
|
4641
|
-
CodeText: meta$
|
|
4642
|
-
Form: meta$
|
|
4643
|
-
Fragment: meta$
|
|
4644
|
-
HeadLink: meta$
|
|
4645
|
-
HeadMeta: meta$
|
|
4646
|
-
HeadSlot: meta$
|
|
4647
|
-
HeadTitle: meta$
|
|
4648
|
-
Heading: meta$
|
|
4649
|
-
HtmlEmbed: meta$
|
|
4650
|
-
Image: meta$
|
|
4651
|
-
Input: meta$
|
|
4652
|
-
Italic: meta$
|
|
4653
|
-
Label: meta$
|
|
4654
|
-
Link: meta$
|
|
4655
|
-
List: meta$
|
|
4656
|
-
ListItem: meta$
|
|
4657
|
-
MarkdownEmbed: meta$
|
|
4658
|
-
Option: meta$
|
|
4659
|
-
Paragraph: meta$
|
|
4660
|
-
RadioButton: meta$
|
|
4661
|
-
RemixForm: meta$
|
|
4662
|
-
RichTextLink: meta$
|
|
4663
|
-
Select: meta$
|
|
4664
|
-
Separator: meta$
|
|
4665
|
-
Slot: meta$
|
|
4666
|
-
Span: meta$
|
|
4667
|
-
Subscript: meta$
|
|
4668
|
-
Superscript: meta$
|
|
4669
|
-
Text: meta$
|
|
4670
|
-
Textarea: meta$
|
|
4671
|
-
Time: meta$
|
|
4672
|
-
Vimeo: meta$
|
|
4673
|
-
VimeoPlayButton: meta$
|
|
4674
|
-
VimeoPreviewImage: meta$
|
|
4675
|
-
VimeoSpinner: meta$
|
|
4676
|
-
XmlNode: meta$
|
|
4677
|
-
XmlTime: meta$
|
|
4678
|
-
YouTube: meta$
|
|
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
|
|
4679
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
|
+
};
|
|
4680
4793
|
const animationComponentMetas = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4681
|
-
__proto__: null
|
|
4794
|
+
__proto__: null,
|
|
4795
|
+
AnimateChildren: meta$1
|
|
4682
4796
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4683
4797
|
const remixComponentMetas = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4684
4798
|
__proto__: null,
|
|
4685
|
-
Body: meta$
|
|
4686
|
-
Form: meta$
|
|
4687
|
-
Link: meta$
|
|
4688
|
-
RemixForm: meta$
|
|
4689
|
-
RichTextLink: meta$
|
|
4799
|
+
Body: meta$F,
|
|
4800
|
+
Form: meta$r,
|
|
4801
|
+
Link: meta$A,
|
|
4802
|
+
RemixForm: meta$q,
|
|
4803
|
+
RichTextLink: meta$z
|
|
4690
4804
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4691
4805
|
const metaCollapsible = {
|
|
4692
4806
|
type: "container",
|
|
@@ -4738,29 +4852,29 @@ const rgb = (property, r, g, b2) => ({
|
|
|
4738
4852
|
});
|
|
4739
4853
|
const buttonReset = [
|
|
4740
4854
|
{
|
|
4741
|
-
property: "
|
|
4855
|
+
property: "background-color",
|
|
4742
4856
|
value: { type: "keyword", value: "transparent" }
|
|
4743
4857
|
},
|
|
4744
4858
|
{
|
|
4745
|
-
property: "
|
|
4859
|
+
property: "background-image",
|
|
4746
4860
|
value: { type: "keyword", value: "none" }
|
|
4747
4861
|
},
|
|
4748
|
-
unit("
|
|
4749
|
-
unit("
|
|
4750
|
-
unit("
|
|
4751
|
-
unit("
|
|
4752
|
-
keyword("
|
|
4753
|
-
keyword("
|
|
4754
|
-
keyword("
|
|
4755
|
-
keyword("
|
|
4756
|
-
rgb("
|
|
4757
|
-
rgb("
|
|
4758
|
-
rgb("
|
|
4759
|
-
rgb("
|
|
4760
|
-
unit("
|
|
4761
|
-
unit("
|
|
4762
|
-
unit("
|
|
4763
|
-
unit("
|
|
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")
|
|
4764
4878
|
];
|
|
4765
4879
|
const metaDialogTrigger = {
|
|
4766
4880
|
type: "container",
|
|
@@ -5062,11 +5176,11 @@ const metaAccordionHeader = {
|
|
|
5062
5176
|
h3: [
|
|
5063
5177
|
...h3,
|
|
5064
5178
|
{
|
|
5065
|
-
property: "
|
|
5179
|
+
property: "margin-top",
|
|
5066
5180
|
value: { type: "unit", unit: "px", value: 0 }
|
|
5067
5181
|
},
|
|
5068
5182
|
{
|
|
5069
|
-
property: "
|
|
5183
|
+
property: "margin-bottom",
|
|
5070
5184
|
value: { type: "unit", unit: "px", value: 0 }
|
|
5071
5185
|
}
|
|
5072
5186
|
]
|
|
@@ -5598,11 +5712,11 @@ const createFramework$2 = async () => {
|
|
|
5598
5712
|
};
|
|
5599
5713
|
const reactRouterComponentMetas = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
5600
5714
|
__proto__: null,
|
|
5601
|
-
Body: meta$
|
|
5602
|
-
Form: meta$
|
|
5603
|
-
Link: meta$
|
|
5604
|
-
RemixForm: meta$
|
|
5605
|
-
RichTextLink: meta$
|
|
5715
|
+
Body: meta$F,
|
|
5716
|
+
Form: meta$r,
|
|
5717
|
+
Link: meta$A,
|
|
5718
|
+
RemixForm: meta$q,
|
|
5719
|
+
RichTextLink: meta$z
|
|
5606
5720
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
5607
5721
|
const createFramework$1 = async () => {
|
|
5608
5722
|
const routeTemplatesDir = join("app", "route-templates");
|
|
@@ -5843,7 +5957,7 @@ audit=false
|
|
|
5843
5957
|
fund=false
|
|
5844
5958
|
`;
|
|
5845
5959
|
const prebuild = async (options) => {
|
|
5846
|
-
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;
|
|
5847
5961
|
if (options.template.length === 0) {
|
|
5848
5962
|
log.error(
|
|
5849
5963
|
`Template is not provided
|
|
@@ -5876,7 +5990,7 @@ Please check webstudio --help for more details`
|
|
|
5876
5990
|
let framework;
|
|
5877
5991
|
if (options.template.includes("ssg")) {
|
|
5878
5992
|
framework = await createFramework();
|
|
5879
|
-
} else if (options.template.includes("react-router
|
|
5993
|
+
} else if (options.template.includes("react-router")) {
|
|
5880
5994
|
framework = await createFramework$1();
|
|
5881
5995
|
} else {
|
|
5882
5996
|
framework = await createFramework$2();
|
|
@@ -5897,10 +6011,9 @@ Please check webstudio --help for more details`
|
|
|
5897
6011
|
componentSources.set(componentName, entry.source);
|
|
5898
6012
|
}
|
|
5899
6013
|
}
|
|
5900
|
-
const
|
|
6014
|
+
const usedMetas = new Map(
|
|
5901
6015
|
Object.entries(coreMetas)
|
|
5902
6016
|
);
|
|
5903
|
-
const componentsByPage = {};
|
|
5904
6017
|
const siteDataByPage = {};
|
|
5905
6018
|
const fontAssetsByPage = {};
|
|
5906
6019
|
const backgroundImageAssetsByPage = {};
|
|
@@ -5910,6 +6023,7 @@ Please check webstudio --help for more details`
|
|
|
5910
6023
|
instanceMap,
|
|
5911
6024
|
page.rootInstanceId
|
|
5912
6025
|
);
|
|
6026
|
+
pageInstanceSet.add(ROOT_INSTANCE_ID);
|
|
5913
6027
|
const instances = siteData.build.instances.filter(([id]) => pageInstanceSet.has(id));
|
|
5914
6028
|
const dataSources = [];
|
|
5915
6029
|
const normalizedProps = normalizeProps({
|
|
@@ -5952,15 +6066,10 @@ Please check webstudio --help for more details`
|
|
|
5952
6066
|
page,
|
|
5953
6067
|
assets: siteData.assets
|
|
5954
6068
|
};
|
|
5955
|
-
componentsByPage[page.id] = /* @__PURE__ */ new Set();
|
|
5956
6069
|
for (const [_instanceId, instance] of instances) {
|
|
5957
|
-
if (isCoreComponent(instance.component)) {
|
|
5958
|
-
continue;
|
|
5959
|
-
}
|
|
5960
|
-
componentsByPage[page.id].add(instance.component);
|
|
5961
6070
|
const meta2 = metas.get(instance.component);
|
|
5962
6071
|
if (meta2) {
|
|
5963
|
-
|
|
6072
|
+
usedMetas.set(instance.component, meta2);
|
|
5964
6073
|
}
|
|
5965
6074
|
}
|
|
5966
6075
|
const styleSourceSelections = ((_a = siteData.build) == null ? void 0 : _a.styleSourceSelections) ?? [];
|
|
@@ -5975,7 +6084,7 @@ Please check webstudio --help for more details`
|
|
|
5975
6084
|
([, { value }]) => value.type === "fontFamily" ? value.value : void 0
|
|
5976
6085
|
).flat().filter((value) => value !== void 0)
|
|
5977
6086
|
);
|
|
5978
|
-
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);
|
|
5979
6088
|
fontAssetsByPage[page.id] = pageFontAssets;
|
|
5980
6089
|
const backgroundImageAssetIdSet = new Set(
|
|
5981
6090
|
pageStyles.filter(([, { property }]) => property === "backgroundImage").map(
|
|
@@ -5984,7 +6093,7 @@ Please check webstudio --help for more details`
|
|
|
5984
6093
|
) : void 0
|
|
5985
6094
|
).flat().filter((value) => value !== void 0)
|
|
5986
6095
|
);
|
|
5987
|
-
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);
|
|
5988
6097
|
backgroundImageAssetsByPage[page.id] = backgroundImageAssets;
|
|
5989
6098
|
}
|
|
5990
6099
|
const assetsToDownload = [];
|
|
@@ -5995,7 +6104,7 @@ Please check webstudio --help for more details`
|
|
|
5995
6104
|
assetsToDownload.push(
|
|
5996
6105
|
limit(
|
|
5997
6106
|
() => downloadAsset(
|
|
5998
|
-
`${assetOrigin}/cgi/image/${asset.name}?format=
|
|
6107
|
+
`${assetOrigin}/cgi/image/${asset.name}?format=raw`,
|
|
5999
6108
|
asset.name,
|
|
6000
6109
|
assetBaseUrl
|
|
6001
6110
|
)
|
|
@@ -6024,12 +6133,12 @@ Please check webstudio --help for more details`
|
|
|
6024
6133
|
styles: new Map((_e = siteData.build) == null ? void 0 : _e.styles),
|
|
6025
6134
|
styleSourceSelections: new Map((_f = siteData.build) == null ? void 0 : _f.styleSourceSelections),
|
|
6026
6135
|
// pass only used metas to not generate unused preset styles
|
|
6027
|
-
componentMetas:
|
|
6136
|
+
componentMetas: usedMetas,
|
|
6028
6137
|
assetBaseUrl,
|
|
6029
6138
|
atomic: ((_g = siteData.build.pages.compiler) == null ? void 0 : _g.atomicStyles) ?? true
|
|
6030
6139
|
});
|
|
6031
6140
|
await createFileIfNotExists(join(generatedDir, "index.css"), cssText);
|
|
6032
|
-
for (const
|
|
6141
|
+
for (const page of Object.values(siteData.pages)) {
|
|
6033
6142
|
const scope = createScope([
|
|
6034
6143
|
// manually maintained list of occupied identifiers
|
|
6035
6144
|
"useState",
|
|
@@ -6039,6 +6148,30 @@ Please check webstudio --help for more details`
|
|
|
6039
6148
|
"Page",
|
|
6040
6149
|
"_props"
|
|
6041
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
|
+
}
|
|
6042
6175
|
const namespaces = /* @__PURE__ */ new Map();
|
|
6043
6176
|
for (const component of pageComponents) {
|
|
6044
6177
|
const namespace = componentSources.get(component);
|
|
@@ -6052,50 +6185,18 @@ Please check webstudio --help for more details`
|
|
|
6052
6185
|
);
|
|
6053
6186
|
}
|
|
6054
6187
|
const [_namespace, shortName] = parseComponentName(component);
|
|
6055
|
-
(
|
|
6188
|
+
(_i = namespaces.get(namespace)) == null ? void 0 : _i.add([shortName, component]);
|
|
6056
6189
|
}
|
|
6057
6190
|
let componentImports = "";
|
|
6058
|
-
let xmlPresentationComponents = "";
|
|
6059
|
-
const pageData = siteDataByPage[pageId];
|
|
6060
|
-
const documentType = pageData.page.meta.documentType ?? "html";
|
|
6061
6191
|
for (const [namespace, componentsSet] of namespaces.entries()) {
|
|
6062
|
-
|
|
6063
|
-
|
|
6064
|
-
|
|
6065
|
-
|
|
6066
|
-
([shortName, component]) => `${shortName} as ${scope.getName(component, shortName)}`
|
|
6067
|
-
).join(", ");
|
|
6068
|
-
componentImports += `import { ${specifiers} } from "${namespace}";
|
|
6069
|
-
`;
|
|
6070
|
-
}
|
|
6071
|
-
break;
|
|
6072
|
-
case "xml":
|
|
6073
|
-
{
|
|
6074
|
-
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}";
|
|
6075
6196
|
`;
|
|
6076
|
-
xmlPresentationComponents += Array.from(componentsSet).map(
|
|
6077
|
-
([shortName, component]) => scope.getName(component, shortName)
|
|
6078
|
-
).filter(
|
|
6079
|
-
(scopedName) => scopedName !== "XmlNode" && scopedName !== "XmlTime"
|
|
6080
|
-
).map(
|
|
6081
|
-
(scopedName) => scopedName === "Body" ? (
|
|
6082
|
-
// Using <svg> prevents React from hoisting elements like <title>, <meta>, and <link>
|
|
6083
|
-
// out of their intended scope during rendering.
|
|
6084
|
-
// More details: https://github.com/facebook/react/blob/7c8e5e7ab8bb63de911637892392c5efd8ce1d0f/packages/react-dom-bindings/src/client/ReactFiberConfigDOM.js#L3083
|
|
6085
|
-
`const ${scopedName} = (props: any) => <svg>{props.children}</svg>;`
|
|
6086
|
-
) : (
|
|
6087
|
-
// Do not render all other components
|
|
6088
|
-
`const ${scopedName} = (props: any) => null;`
|
|
6089
|
-
)
|
|
6090
|
-
).join("\n");
|
|
6091
|
-
}
|
|
6092
|
-
break;
|
|
6093
|
-
}
|
|
6094
6197
|
}
|
|
6095
|
-
const pageFontAssets = fontAssetsByPage[
|
|
6096
|
-
const pageBackgroundImageAssets = backgroundImageAssetsByPage[
|
|
6097
|
-
const rootInstanceId = pageData.page.rootInstanceId;
|
|
6098
|
-
const instances = new Map(pageData.build.instances);
|
|
6198
|
+
const pageFontAssets = fontAssetsByPage[page.id];
|
|
6199
|
+
const pageBackgroundImageAssets = backgroundImageAssetsByPage[page.id];
|
|
6099
6200
|
const props2 = new Map(pageData.build.props);
|
|
6100
6201
|
const dataSources = new Map(pageData.build.dataSources);
|
|
6101
6202
|
const resources = new Map(pageData.build.resources);
|
|
@@ -6110,49 +6211,51 @@ Please check webstudio --help for more details`
|
|
|
6110
6211
|
rootInstanceId,
|
|
6111
6212
|
parameters: [
|
|
6112
6213
|
{
|
|
6113
|
-
id: `system`,
|
|
6214
|
+
id: `page-system`,
|
|
6114
6215
|
instanceId: "",
|
|
6115
6216
|
name: "system",
|
|
6116
6217
|
type: "parameter",
|
|
6117
|
-
value:
|
|
6218
|
+
value: page.systemDataSourceId ?? ""
|
|
6219
|
+
},
|
|
6220
|
+
{
|
|
6221
|
+
id: "global-system",
|
|
6222
|
+
type: "parameter",
|
|
6223
|
+
instanceId: "",
|
|
6224
|
+
name: "system",
|
|
6225
|
+
value: SYSTEM_VARIABLE_ID
|
|
6118
6226
|
}
|
|
6119
6227
|
],
|
|
6120
6228
|
instances,
|
|
6121
6229
|
props: props2,
|
|
6122
6230
|
dataSources,
|
|
6123
6231
|
classesMap: classes,
|
|
6124
|
-
|
|
6125
|
-
projectMetas,
|
|
6126
|
-
instances,
|
|
6127
|
-
[rootInstanceId]
|
|
6128
|
-
)
|
|
6232
|
+
metas: usedMetas
|
|
6129
6233
|
});
|
|
6130
6234
|
const projectMeta = siteData.build.pages.meta;
|
|
6131
6235
|
const contactEmail = (
|
|
6132
6236
|
// fallback to user email when contact email is empty string
|
|
6133
|
-
(projectMeta == null ? void 0 : projectMeta.contactEmail) || ((
|
|
6237
|
+
(projectMeta == null ? void 0 : projectMeta.contactEmail) || ((_j = siteData.user) == null ? void 0 : _j.email) || void 0
|
|
6134
6238
|
);
|
|
6135
|
-
const favIconAsset = assets.get((projectMeta == null ? void 0 : projectMeta.faviconAssetId) ?? "");
|
|
6136
|
-
const pagePath = getPagePath(
|
|
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);
|
|
6137
6241
|
const pageExports = `/* eslint-disable */
|
|
6138
6242
|
/* This is a auto generated file for building the project */
|
|
6139
6243
|
|
|
6140
6244
|
|
|
6141
6245
|
import { Fragment, useState } from "react";
|
|
6142
|
-
import type { FontAsset, ImageAsset } from "@webstudio-is/sdk";
|
|
6143
6246
|
import { useResource, useVariableState } from "@webstudio-is/react-sdk/runtime";
|
|
6144
6247
|
${componentImports}
|
|
6145
6248
|
|
|
6146
6249
|
export const siteName = ${JSON.stringify(projectMeta == null ? void 0 : projectMeta.siteName)};
|
|
6147
6250
|
|
|
6148
|
-
export const favIconAsset:
|
|
6251
|
+
export const favIconAsset: string | undefined =
|
|
6149
6252
|
${JSON.stringify(favIconAsset)};
|
|
6150
6253
|
|
|
6151
6254
|
// Font assets on current page (can be preloaded)
|
|
6152
|
-
export const pageFontAssets:
|
|
6255
|
+
export const pageFontAssets: string[] =
|
|
6153
6256
|
${JSON.stringify(pageFontAssets)}
|
|
6154
6257
|
|
|
6155
|
-
export const pageBackgroundImageAssets:
|
|
6258
|
+
export const pageBackgroundImageAssets: string[] =
|
|
6156
6259
|
${JSON.stringify(pageBackgroundImageAssets)}
|
|
6157
6260
|
|
|
6158
6261
|
${pagePath === "/" ? `
|
|
@@ -6178,8 +6281,6 @@ Please check webstudio --help for more details`
|
|
|
6178
6281
|
}
|
|
6179
6282
|
` : ""}
|
|
6180
6283
|
|
|
6181
|
-
${xmlPresentationComponents}
|
|
6182
|
-
|
|
6183
6284
|
${pageComponent}
|
|
6184
6285
|
|
|
6185
6286
|
export { Page }
|
|
@@ -6191,7 +6292,7 @@ Please check webstudio --help for more details`
|
|
|
6191
6292
|
import type { PageMeta } from "@webstudio-is/sdk";
|
|
6192
6293
|
${generateResources({
|
|
6193
6294
|
scope,
|
|
6194
|
-
page
|
|
6295
|
+
page,
|
|
6195
6296
|
dataSources,
|
|
6196
6297
|
props: props2,
|
|
6197
6298
|
resources
|
|
@@ -6199,12 +6300,12 @@ Please check webstudio --help for more details`
|
|
|
6199
6300
|
|
|
6200
6301
|
${generatePageMeta({
|
|
6201
6302
|
globalScope: scope,
|
|
6202
|
-
page
|
|
6303
|
+
page,
|
|
6203
6304
|
dataSources,
|
|
6204
6305
|
assets
|
|
6205
6306
|
})}
|
|
6206
6307
|
|
|
6207
|
-
${generateRemixParams(
|
|
6308
|
+
${generateRemixParams(page.path)}
|
|
6208
6309
|
|
|
6209
6310
|
export const projectId = "${siteData.build.projectId}";
|
|
6210
6311
|
|
|
@@ -6250,7 +6351,7 @@ Please check webstudio --help for more details`
|
|
|
6250
6351
|
)};
|
|
6251
6352
|
`
|
|
6252
6353
|
);
|
|
6253
|
-
const redirects = (
|
|
6354
|
+
const redirects = (_l = siteData.build.pages) == null ? void 0 : _l.redirects;
|
|
6254
6355
|
if (redirects !== void 0 && redirects.length > 0) {
|
|
6255
6356
|
for (const redirect of redirects) {
|
|
6256
6357
|
const generatedBasename = generateRemixRoute(redirect.old);
|
|
@@ -6412,8 +6513,7 @@ const getDeploymentInstructions = (deployTarget) => {
|
|
|
6412
6513
|
switch (deployTarget) {
|
|
6413
6514
|
case "vercel":
|
|
6414
6515
|
return `Run ${pc.dim("npx vercel")} to publish on Vercel.`;
|
|
6415
|
-
case "netlify
|
|
6416
|
-
case "netlify-edge-functions":
|
|
6516
|
+
case "netlify":
|
|
6417
6517
|
return [
|
|
6418
6518
|
`To deploy to Netlify, run the following commands: `,
|
|
6419
6519
|
`Run ${pc.dim("npx netlify-cli login")} to login to Netlify.`,
|
|
@@ -6426,7 +6526,7 @@ const getDeploymentInstructions = (deployTarget) => {
|
|
|
6426
6526
|
}
|
|
6427
6527
|
};
|
|
6428
6528
|
const name = "webstudio";
|
|
6429
|
-
const version = "0.0.0-
|
|
6529
|
+
const version = "0.0.0-bdb8a58";
|
|
6430
6530
|
const description = "Webstudio CLI";
|
|
6431
6531
|
const author = "Webstudio <github@webstudio.is>";
|
|
6432
6532
|
const homepage = "https://webstudio.is";
|
|
@@ -6457,9 +6557,9 @@ const engines = {
|
|
|
6457
6557
|
node: ">=20.12"
|
|
6458
6558
|
};
|
|
6459
6559
|
const dependencies = {
|
|
6460
|
-
"@clack/prompts": "^0.
|
|
6560
|
+
"@clack/prompts": "^0.10.0",
|
|
6461
6561
|
"@emotion/hash": "^0.9.2",
|
|
6462
|
-
acorn: "^8.14.
|
|
6562
|
+
acorn: "^8.14.1",
|
|
6463
6563
|
"acorn-walk": "^8.3.4",
|
|
6464
6564
|
"change-case": "^5.4.4",
|
|
6465
6565
|
deepmerge: "^4.3.1",
|
|
@@ -6474,10 +6574,9 @@ const dependencies = {
|
|
|
6474
6574
|
zod: "^3.22.4"
|
|
6475
6575
|
};
|
|
6476
6576
|
const devDependencies = {
|
|
6477
|
-
"@netlify/
|
|
6478
|
-
"@
|
|
6479
|
-
"@react-router/
|
|
6480
|
-
"@react-router/fs-routes": "^7.1.3",
|
|
6577
|
+
"@netlify/vite-plugin-react-router": "^1.0.0",
|
|
6578
|
+
"@react-router/dev": "^7.3.0",
|
|
6579
|
+
"@react-router/fs-routes": "^7.3.0",
|
|
6481
6580
|
"@remix-run/cloudflare": "^2.15.2",
|
|
6482
6581
|
"@remix-run/cloudflare-pages": "^2.15.2",
|
|
6483
6582
|
"@remix-run/dev": "^2.15.2",
|
|
@@ -6487,6 +6586,7 @@ const devDependencies = {
|
|
|
6487
6586
|
"@types/react": "^18.2.70",
|
|
6488
6587
|
"@types/react-dom": "^18.2.25",
|
|
6489
6588
|
"@types/yargs": "^17.0.33",
|
|
6589
|
+
"@vercel/react-router": "^1.1.0",
|
|
6490
6590
|
"@vitejs/plugin-react": "^4.3.4",
|
|
6491
6591
|
"@webstudio-is/http-client": "workspace:*",
|
|
6492
6592
|
"@webstudio-is/image": "workspace:*",
|
|
@@ -6498,16 +6598,16 @@ const devDependencies = {
|
|
|
6498
6598
|
"@webstudio-is/sdk-components-react-remix": "workspace:*",
|
|
6499
6599
|
"@webstudio-is/sdk-components-react-router": "workspace:*",
|
|
6500
6600
|
"@webstudio-is/tsconfig": "workspace:*",
|
|
6501
|
-
h3: "^1.
|
|
6601
|
+
h3: "^1.15.1",
|
|
6502
6602
|
ipx: "^3.0.1",
|
|
6503
6603
|
prettier: "3.4.2",
|
|
6504
6604
|
react: "18.3.0-canary-14898b6a9-20240318",
|
|
6505
6605
|
"react-dom": "18.3.0-canary-14898b6a9-20240318",
|
|
6506
|
-
"react-router": "^7.
|
|
6606
|
+
"react-router": "^7.3.0",
|
|
6507
6607
|
"ts-expect": "^1.3.0",
|
|
6508
|
-
vike: "^0.4.
|
|
6608
|
+
vike: "^0.4.224",
|
|
6509
6609
|
vite: "^5.4.11",
|
|
6510
|
-
vitest: "^3.0.
|
|
6610
|
+
vitest: "^3.0.4",
|
|
6511
6611
|
wrangler: "^3.63.2"
|
|
6512
6612
|
};
|
|
6513
6613
|
const packageJson = {
|