webstudio 0.254.0 → 0.257.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/cli.js CHANGED
@@ -822,7 +822,7 @@ var toValue = (styleValue, transformValue) => {
822
822
  }
823
823
  if (value.type === "color") {
824
824
  let [c1, c2, c3] = value.components;
825
- const alpha = value.alpha;
825
+ const alpha = typeof value.alpha === "number" ? value.alpha : toValue(value.alpha);
826
826
  switch (value.colorSpace) {
827
827
  case "srgb": {
828
828
  c1 = Math.round(c1 * 255);
@@ -842,11 +842,15 @@ var toValue = (styleValue, transformValue) => {
842
842
  return `oklab(${c1} ${c2} ${c3} / ${alpha})`;
843
843
  case "oklch":
844
844
  return `oklch(${c1} ${c2} ${c3} / ${alpha})`;
845
- // Fall back to color() function for less common color spaces
845
+ // Fall back to color() function for less common color spaces.
846
+ // Webstudio uses colorjs internal names; map to CSS predefined color space names.
846
847
  case "p3":
847
- case "srgb-linear":
848
+ return `color(display-p3 ${c1} ${c2} ${c3} / ${alpha})`;
848
849
  case "a98rgb":
850
+ return `color(a98-rgb ${c1} ${c2} ${c3} / ${alpha})`;
849
851
  case "prophoto":
852
+ return `color(prophoto-rgb ${c1} ${c2} ${c3} / ${alpha})`;
853
+ case "srgb-linear":
850
854
  case "rec2020":
851
855
  case "xyz-d65":
852
856
  case "xyz-d50":
@@ -955,7 +959,7 @@ var ColorValue = z.object({
955
959
  z.literal("xyz-d50")
956
960
  ]),
957
961
  components: z.tuple([z.number(), z.number(), z.number()]),
958
- alpha: z.number(),
962
+ alpha: z.union([z.number(), z.lazy(() => VarValue)]),
959
963
  hidden: z.boolean().optional()
960
964
  });
961
965
  var FunctionValue = z.object({
@@ -1884,11 +1888,10 @@ var DefaultPagePage = z.string().refine((path) => path !== "", "Can't be empty")
1884
1888
  var OldPagePath = z.string().refine((path) => path !== "", "Can't be empty").refine((path) => path !== "/", "Can't be just a /").refine(
1885
1889
  (path) => path === "" || path.startsWith("/"),
1886
1890
  "Must start with a / or a full URL e.g. https://website.org"
1887
- ).refine((path) => path.endsWith("/") === false, "Can't end with a /").refine((path) => path.includes("//") === false, "Can't contain repeating /").refine(
1888
- (path) => /^[-_a-zA-Z0-9*:?\\/.]*$/.test(path),
1889
- // Allow uppercase letters (A-Z)
1890
- "Only a-z, A-Z, 0-9, -, _, /, :, ?, . and * are allowed"
1891
- ).refine(
1891
+ ).refine((path) => path.endsWith("/") === false, "Can't end with a /").refine((path) => path.includes("//") === false, "Can't contain repeating /").refine((path) => {
1892
+ const disallowedChars = /[\s<>"{}|\\^`[\]\u0000-\u001f\u007f]/;
1893
+ return !disallowedChars.test(path);
1894
+ }, "Path contains invalid characters (spaces or URL-unsafe characters are not allowed)").refine(
1892
1895
  (path) => path !== "/s" && path.startsWith("/s/") === false,
1893
1896
  "/s prefix is reserved for the system"
1894
1897
  ).refine(
@@ -1910,7 +1913,7 @@ var ProjectMeta = z.object({
1910
1913
  faviconAssetId: z.string().optional(),
1911
1914
  code: z.string().optional()
1912
1915
  });
1913
- var ProjectNewRedirectPath = z.string().refine((data) => {
1916
+ var ProjectNewRedirectPath = z.string().min(1, "Path is required").refine((data) => {
1914
1917
  try {
1915
1918
  new URL(data, "http://url.com");
1916
1919
  return true;
@@ -2340,12 +2343,11 @@ var Breakpoint = z.object({
2340
2343
  if (condition !== void 0) {
2341
2344
  return minWidth === void 0 && maxWidth === void 0;
2342
2345
  }
2343
- return (
2344
- // Either min or max width have to be defined
2345
- minWidth !== void 0 && maxWidth === void 0 || minWidth === void 0 && maxWidth !== void 0 || // This is a base breakpoint
2346
- minWidth === void 0 && maxWidth === void 0
2347
- );
2348
- }, "Either minWidth, maxWidth, or condition should be defined, but not both");
2346
+ if (minWidth !== void 0 && maxWidth !== void 0) {
2347
+ return minWidth < maxWidth;
2348
+ }
2349
+ return true;
2350
+ }, "Width-based (minWidth/maxWidth) and condition are mutually exclusive, and minWidth must be less than maxWidth");
2349
2351
  z.map(BreakpointId, Breakpoint);
2350
2352
  var StyleSourceId = z.string();
2351
2353
  var StyleSourceToken = z.object({
@@ -2901,6 +2903,11 @@ var span$1 = div$1;
2901
2903
  var html = [
2902
2904
  { property: "display", value: { type: "keyword", value: "grid" } },
2903
2905
  { property: "min-height", value: { type: "unit", unit: "%", value: 100 } },
2906
+ { property: "grid-template-rows", value: { type: "keyword", value: "auto" } },
2907
+ {
2908
+ property: "grid-template-columns",
2909
+ value: { type: "unit", unit: "fr", value: 1 }
2910
+ },
2904
2911
  {
2905
2912
  property: "font-family",
2906
2913
  value: { type: "fontFamily", value: ["Arial", "Roboto", "sans-serif"] }
@@ -3335,7 +3342,7 @@ var tags = [
3335
3342
  ];
3336
3343
  var rootComponent = "ws:root";
3337
3344
  var rootMeta = {
3338
- label: "Global Root",
3345
+ label: "Global root",
3339
3346
  icon: SettingsIcon,
3340
3347
  presetStyle: {
3341
3348
  html
@@ -9042,7 +9049,7 @@ const getDeploymentInstructions = (deployTarget) => {
9042
9049
  }
9043
9050
  };
9044
9051
  const name = "webstudio";
9045
- const version = "0.254.0";
9052
+ const version = "0.257.0";
9046
9053
  const description = "Webstudio CLI";
9047
9054
  const author = "Webstudio <github@webstudio.is>";
9048
9055
  const homepage = "https://webstudio.is";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webstudio",
3
- "version": "0.254.0",
3
+ "version": "0.257.0",
4
4
  "description": "Webstudio CLI",
5
5
  "author": "Webstudio <github@webstudio.is>",
6
6
  "homepage": "https://webstudio.is",
@@ -71,17 +71,17 @@
71
71
  "vite": "^6.3.4",
72
72
  "vitest": "^3.1.2",
73
73
  "wrangler": "^3.63.2",
74
- "@webstudio-is/css-engine": "0.254.0",
75
- "@webstudio-is/http-client": "0.254.0",
76
- "@webstudio-is/image": "0.254.0",
77
- "@webstudio-is/sdk": "0.254.0",
78
- "@webstudio-is/sdk-components-animation": "0.254.0",
79
- "@webstudio-is/react-sdk": "0.254.0",
80
- "@webstudio-is/sdk-components-react": "0.254.0",
81
- "@webstudio-is/sdk-components-react-radix": "0.254.0",
82
- "@webstudio-is/sdk-components-react-remix": "0.254.0",
83
- "@webstudio-is/sdk-components-react-router": "0.254.0",
84
- "@webstudio-is/tsconfig": "1.0.7"
74
+ "@webstudio-is/css-engine": "0.257.0",
75
+ "@webstudio-is/http-client": "0.257.0",
76
+ "@webstudio-is/react-sdk": "0.257.0",
77
+ "@webstudio-is/image": "0.257.0",
78
+ "@webstudio-is/sdk": "0.257.0",
79
+ "@webstudio-is/sdk-components-react": "0.257.0",
80
+ "@webstudio-is/sdk-components-react-router": "0.257.0",
81
+ "@webstudio-is/tsconfig": "1.0.7",
82
+ "@webstudio-is/sdk-components-react-radix": "0.257.0",
83
+ "@webstudio-is/sdk-components-react-remix": "0.257.0",
84
+ "@webstudio-is/sdk-components-animation": "0.257.0"
85
85
  },
86
86
  "scripts": {
87
87
  "typecheck": "tsgo --noEmit",
@@ -11,13 +11,13 @@
11
11
  "@remix-run/node": "2.16.5",
12
12
  "@remix-run/react": "2.16.5",
13
13
  "@remix-run/server-runtime": "2.16.5",
14
- "@webstudio-is/image": "0.254.0",
15
- "@webstudio-is/react-sdk": "0.254.0",
16
- "@webstudio-is/sdk": "0.254.0",
17
- "@webstudio-is/sdk-components-react": "0.254.0",
18
- "@webstudio-is/sdk-components-animation": "0.254.0",
19
- "@webstudio-is/sdk-components-react-radix": "0.254.0",
20
- "@webstudio-is/sdk-components-react-remix": "0.254.0",
14
+ "@webstudio-is/image": "0.257.0",
15
+ "@webstudio-is/react-sdk": "0.257.0",
16
+ "@webstudio-is/sdk": "0.257.0",
17
+ "@webstudio-is/sdk-components-react": "0.257.0",
18
+ "@webstudio-is/sdk-components-animation": "0.257.0",
19
+ "@webstudio-is/sdk-components-react-radix": "0.257.0",
20
+ "@webstudio-is/sdk-components-react-remix": "0.257.0",
21
21
  "isbot": "^5.1.25",
22
22
  "react": "18.3.0-canary-14898b6a9-20240318",
23
23
  "react-dom": "18.3.0-canary-14898b6a9-20240318"
@@ -10,13 +10,13 @@
10
10
  "dependencies": {
11
11
  "@react-router/dev": "^7.5.3",
12
12
  "@react-router/fs-routes": "^7.5.3",
13
- "@webstudio-is/image": "0.254.0",
14
- "@webstudio-is/react-sdk": "0.254.0",
15
- "@webstudio-is/sdk": "0.254.0",
16
- "@webstudio-is/sdk-components-animation": "0.254.0",
17
- "@webstudio-is/sdk-components-react-radix": "0.254.0",
18
- "@webstudio-is/sdk-components-react-router": "0.254.0",
19
- "@webstudio-is/sdk-components-react": "0.254.0",
13
+ "@webstudio-is/image": "0.257.0",
14
+ "@webstudio-is/react-sdk": "0.257.0",
15
+ "@webstudio-is/sdk": "0.257.0",
16
+ "@webstudio-is/sdk-components-animation": "0.257.0",
17
+ "@webstudio-is/sdk-components-react-radix": "0.257.0",
18
+ "@webstudio-is/sdk-components-react-router": "0.257.0",
19
+ "@webstudio-is/sdk-components-react": "0.257.0",
20
20
  "isbot": "^5.1.25",
21
21
  "react": "18.3.0-canary-14898b6a9-20240318",
22
22
  "react-dom": "18.3.0-canary-14898b6a9-20240318",
@@ -8,12 +8,12 @@
8
8
  "typecheck": "tsgo --noEmit"
9
9
  },
10
10
  "dependencies": {
11
- "@webstudio-is/image": "0.254.0",
12
- "@webstudio-is/react-sdk": "0.254.0",
13
- "@webstudio-is/sdk": "0.254.0",
14
- "@webstudio-is/sdk-components-react": "0.254.0",
15
- "@webstudio-is/sdk-components-animation": "0.254.0",
16
- "@webstudio-is/sdk-components-react-radix": "0.254.0",
11
+ "@webstudio-is/image": "0.257.0",
12
+ "@webstudio-is/react-sdk": "0.257.0",
13
+ "@webstudio-is/sdk": "0.257.0",
14
+ "@webstudio-is/sdk-components-react": "0.257.0",
15
+ "@webstudio-is/sdk-components-animation": "0.257.0",
16
+ "@webstudio-is/sdk-components-react-radix": "0.257.0",
17
17
  "react": "18.3.0-canary-14898b6a9-20240318",
18
18
  "react-dom": "18.3.0-canary-14898b6a9-20240318",
19
19
  "vike": "^0.4.229"
@@ -1,6 +1,7 @@
1
1
  import type { Config } from "vike/types";
2
2
 
3
3
  export default {
4
+ prerender: true,
4
5
  meta: {
5
6
  Head: {
6
7
  env: { server: true, client: true },
@@ -3,7 +3,7 @@ import react from "@vitejs/plugin-react";
3
3
  import vike from "vike/plugin";
4
4
 
5
5
  export default defineConfig({
6
- plugins: [react(), vike({ prerender: true })],
6
+ plugins: [react(), vike()],
7
7
  resolve: {
8
8
  conditions: ["browser", "development|production"],
9
9
  },