@webstudio-is/sdk 0.221.0 → 0.222.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.
@@ -104,7 +104,8 @@ var body = [
104
104
  ];
105
105
  var hr = [
106
106
  { property: "height", value: { type: "unit", unit: "number", value: 0 } },
107
- { property: "color", value: { type: "keyword", value: "inherit" } }
107
+ { property: "color", value: { type: "keyword", value: "inherit" } },
108
+ { property: "box-sizing", value: { type: "keyword", value: "border-box" } }
108
109
  ];
109
110
  var b = [
110
111
  {
@@ -187,7 +187,8 @@ var body = [
187
187
  ];
188
188
  var hr = [
189
189
  { property: "height", value: { type: "unit", unit: "number", value: 0 } },
190
- { property: "color", value: { type: "keyword", value: "inherit" } }
190
+ { property: "color", value: { type: "keyword", value: "inherit" } },
191
+ { property: "box-sizing", value: { type: "keyword", value: "border-box" } }
191
192
  ];
192
193
  var b = [
193
194
  {
package/lib/index.js CHANGED
@@ -107,13 +107,23 @@ var DefaultPagePage = z2.string().refine((path) => path !== "", "Can't be empty"
107
107
  (path) => path !== "/build" && path.startsWith("/build/") === false,
108
108
  "/build prefix is reserved for the system"
109
109
  );
110
- var PagePath = DefaultPagePage.refine(
110
+ var OldPagePath = z2.string().refine((path) => path !== "", "Can't be empty").refine((path) => path !== "/", "Can't be just a /").refine(
111
111
  (path) => path === "" || path.startsWith("/"),
112
112
  "Must start with a / or a full URL e.g. https://website.org"
113
+ ).refine((path) => path.endsWith("/") === false, "Can't end with a /").refine((path) => path.includes("//") === false, "Can't contain repeating /").refine(
114
+ (path) => /^[-_a-zA-Z0-9*:?\\/.]*$/.test(path),
115
+ // Allow uppercase letters (A-Z)
116
+ "Only a-z, A-Z, 0-9, -, _, /, :, ?, . and * are allowed"
117
+ ).refine(
118
+ (path) => path !== "/s" && path.startsWith("/s/") === false,
119
+ "/s prefix is reserved for the system"
120
+ ).refine(
121
+ (path) => path !== "/build" && path.startsWith("/build/") === false,
122
+ "/build prefix is reserved for the system"
113
123
  );
114
- var OldPagePath = DefaultPagePage.refine(
124
+ var PagePath = DefaultPagePage.refine(
115
125
  (path) => path === "" || path.startsWith("/"),
116
- "Must start with a / and it must be full path e.g. /project/id"
126
+ "Must start with a / or a full URL e.g. https://website.org"
117
127
  );
118
128
  var Page = z2.object({
119
129
  ...commonPageFields,
@@ -140,7 +150,7 @@ var ProjectNewRedirectPath = PagePath.or(
140
150
  }, "Must be a valid URL")
141
151
  );
142
152
  var PageRedirect = z2.object({
143
- old: PagePath,
153
+ old: OldPagePath,
144
154
  new: ProjectNewRedirectPath,
145
155
  status: z2.enum(["301", "302"]).optional()
146
156
  });
@@ -1063,7 +1073,8 @@ var body = [
1063
1073
  ];
1064
1074
  var hr = [
1065
1075
  { property: "height", value: { type: "unit", unit: "number", value: 0 } },
1066
- { property: "color", value: { type: "keyword", value: "inherit" } }
1076
+ { property: "color", value: { type: "keyword", value: "inherit" } },
1077
+ { property: "box-sizing", value: { type: "keyword", value: "border-box" } }
1067
1078
  ];
1068
1079
  var b = [
1069
1080
  {
@@ -26,8 +26,8 @@ export declare const PageName: z.ZodEffects<z.ZodString, string, string>;
26
26
  export declare const PageTitle: z.ZodEffects<z.ZodString, string, string>;
27
27
  export declare const documentTypes: readonly ["html", "xml"];
28
28
  export declare const HomePagePath: z.ZodEffects<z.ZodString, "", string>;
29
- export declare const PagePath: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>, string, string>, string, string>, string, string>, string, string>, string, string>;
30
29
  export declare const OldPagePath: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>, string, string>, string, string>, string, string>, string, string>, string, string>;
30
+ export declare const PagePath: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>, string, string>, string, string>, string, string>, string, string>, string, string>;
31
31
  declare const Page: z.ZodObject<{
32
32
  path: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>, string, string>, string, string>, string, string>, string, string>, string, string>;
33
33
  id: z.ZodString;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webstudio-is/sdk",
3
- "version": "0.221.0",
3
+ "version": "0.222.0",
4
4
  "description": "Webstudio project data schema",
5
5
  "author": "Webstudio <github@webstudio.is>",
6
6
  "homepage": "https://webstudio.is",
@@ -40,15 +40,15 @@
40
40
  "reserved-identifiers": "^1.0.0",
41
41
  "type-fest": "^4.37.0",
42
42
  "zod": "^3.24.2",
43
- "@webstudio-is/css-engine": "0.221.0",
44
- "@webstudio-is/fonts": "0.221.0",
45
- "@webstudio-is/icons": "0.221.0"
43
+ "@webstudio-is/css-engine": "0.222.0",
44
+ "@webstudio-is/icons": "0.222.0",
45
+ "@webstudio-is/fonts": "0.222.0"
46
46
  },
47
47
  "devDependencies": {
48
48
  "html-tags": "^4.0.0",
49
49
  "vitest": "^3.1.2",
50
50
  "@webstudio-is/css-data": "0.0.0",
51
- "@webstudio-is/template": "0.221.0",
51
+ "@webstudio-is/template": "0.222.0",
52
52
  "@webstudio-is/tsconfig": "1.0.7"
53
53
  },
54
54
  "scripts": {