webstudio 0.231.0 → 0.233.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
@@ -5020,7 +5020,7 @@ const e$u = {
5020
5020
  required: false,
5021
5021
  control: "text",
5022
5022
  type: "string",
5023
- description: "Classes to which the element belongs"
5023
+ description: ""
5024
5024
  },
5025
5025
  clientOnly: { required: false, control: "boolean", type: "boolean" },
5026
5026
  code: { required: true, control: "text", type: "string" },
@@ -6495,7 +6495,7 @@ const e$f = {
6495
6495
  required: false,
6496
6496
  control: "text",
6497
6497
  type: "string",
6498
- description: "Document base URL"
6498
+ description: "Address of the hyperlink"
6499
6499
  },
6500
6500
  hreflang: {
6501
6501
  required: false,
@@ -6760,6 +6760,14 @@ const e$d = {
6760
6760
  defaultValue: "medium",
6761
6761
  options: ["full", "long", "medium", "short", "none"]
6762
6762
  },
6763
+ format: {
6764
+ description: `Custom format template string. When provided, overrides Date Style and Time Style.
6765
+ Supports tokens: YYYY, YY, MM, M, DD, D, HH, H, mm, m, ss, s.
6766
+ Example: "YYYY-MM-DD HH:mm:ss" displays as "2025-11-03 18:47:25"`,
6767
+ required: false,
6768
+ control: "text",
6769
+ type: "string"
6770
+ },
6763
6771
  language: {
6764
6772
  required: false,
6765
6773
  control: "select",
@@ -6857,7 +6865,14 @@ const r$9 = {
6857
6865
  presetStyle: {
6858
6866
  time
6859
6867
  },
6860
- initialProps: ["datetime", "language", "country", "dateStyle", "timeStyle"],
6868
+ initialProps: [
6869
+ "datetime",
6870
+ "language",
6871
+ "country",
6872
+ "dateStyle",
6873
+ "timeStyle",
6874
+ "format"
6875
+ ],
6861
6876
  props: e$d
6862
6877
  };
6863
6878
  const o$k = {};
@@ -7050,13 +7065,13 @@ const l$1 = (n2) => new Proxy({}, { get(w2, t2) {
7050
7065
  - (1..n]: Animates multiple parts of the text within the sliding window.`, required: false, control: "number", type: "number", defaultValue: 5 }, splitBy: { description: "Defines how the text is split for animation (e.g., by character, space, or symbol).", required: false, control: "select", type: "string", defaultValue: "char", options: ["char", "space", 'symbol "#"', 'symbol "~"'] } }, p$1 = { category: "animations", description: "Text animation allows you to split text by char or by word to animate it.", icon: TextAnimationIcon, order: 1, label: "Text Animation", contentModel: { category: "none", children: ["instance"] }, presetStyle: { div }, initialProps: ["slidingWindow", "easing", "splitBy"], props: d$2 }, m$5 = { className: { required: false, control: "text", type: "string", description: "Classes to which the element belongs" }, easing: { description: "Easing function applied within the sliding window.", required: false, control: "select", type: "string", defaultValue: "linear", options: ["linear", "easeIn", "easeInCubic", "easeInQuart", "easeOut", "easeOutCubic", "easeOutQuart", "ease", "easeInOutCubic", "easeInOutQuart"] }, slidingWindow: { description: `Size of the sliding window for the animation:
7051
7066
  - 0: Typewriter effect (no animation).
7052
7067
  - (0..1]: Animates one child at a time.
7053
- - (1..n]: Animates multiple children within the sliding window.`, required: false, control: "number", type: "number", defaultValue: 1 } }, u$1 = { category: "animations", description: "Stagger animation allows you to animate children elements with a sliding window.", icon: StaggerAnimationIcon, order: 4, label: "Stagger Animation", contentModel: { category: "none", children: ["instance"] }, presetStyle: { div }, initialProps: ["slidingWindow", "easing"], props: m$5 }, g$2 = { timeline: { required: false, control: "boolean", type: "boolean" } }, h$3 = { icon: PlayIcon, label: "Video Animation", contentModel: { category: "none", children: ["instance"] }, presetStyle: { div }, props: g$2, initialProps: ["timeline"] };
7068
+ - (1..n]: Animates multiple children within the sliding window.`, required: false, control: "number", type: "number", defaultValue: 1 } }, u$1 = { category: "animations", description: "Stagger animation allows you to animate children elements with a sliding window.", icon: StaggerAnimationIcon, order: 4, label: "Stagger Animation", contentModel: { category: "none", children: ["instance"] }, presetStyle: { div }, initialProps: ["slidingWindow", "easing"], props: m$5 }, g$2 = { timeline: { required: false, control: "boolean", type: "boolean" } }, h$2 = { icon: PlayIcon, label: "Video Animation", contentModel: { category: "none", children: ["instance"] }, presetStyle: { div }, props: g$2, initialProps: ["timeline"] };
7054
7069
  const animationComponentMetas = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
7055
7070
  __proto__: null,
7056
7071
  AnimateChildren: c,
7057
7072
  AnimateText: p$1,
7058
7073
  StaggerAnimation: u$1,
7059
- VideoAnimation: h$3
7074
+ VideoAnimation: h$2
7060
7075
  }, Symbol.toStringTag, { value: "Module" }));
7061
7076
  const r$6 = (t2) => new Proxy(
7062
7077
  {},
@@ -7303,7 +7318,7 @@ const C$3 = {
7303
7318
  },
7304
7319
  initialProps: ["side", "sideOffset", "align", "alignOffset"],
7305
7320
  props: t$5
7306
- }, h$2 = {
7321
+ }, h$1 = {
7307
7322
  icon: PopoverIcon,
7308
7323
  contentModel: {
7309
7324
  category: "instance",
@@ -7491,7 +7506,7 @@ const y = {
7491
7506
  },
7492
7507
  presetStyle: { div },
7493
7508
  props: e$6
7494
- }, f$3 = {
7509
+ }, f$2 = {
7495
7510
  icon: HeaderIcon,
7496
7511
  contentModel: {
7497
7512
  category: "none",
@@ -7610,7 +7625,7 @@ const v$1 = {
7610
7625
  presetStyle: { div },
7611
7626
  initialProps: ["value"],
7612
7627
  props: o$5
7613
- }, f$2 = {
7628
+ }, f$1 = {
7614
7629
  label: "Item Header",
7615
7630
  icon: HeaderIcon,
7616
7631
  contentModel: {
@@ -7706,7 +7721,7 @@ const L = {
7706
7721
  div
7707
7722
  },
7708
7723
  props: e$4
7709
- }, h$1 = {
7724
+ }, h = {
7710
7725
  icon: ListIcon,
7711
7726
  label: "Menu List",
7712
7727
  contentModel: {
@@ -7735,7 +7750,7 @@ const L = {
7735
7750
  div
7736
7751
  },
7737
7752
  props: o$4
7738
- }, k$2 = {
7753
+ }, k$3 = {
7739
7754
  icon: TriggerIcon,
7740
7755
  label: "Menu Trigger",
7741
7756
  contentModel: {
@@ -7888,7 +7903,7 @@ const b$1 = {
7888
7903
  },
7889
7904
  initialProps: ["name", "value", "open", "required"],
7890
7905
  props: e$3
7891
- }, f$1 = {
7906
+ }, f = {
7892
7907
  icon: TriggerIcon,
7893
7908
  contentModel: {
7894
7909
  category: "none",
@@ -7925,7 +7940,7 @@ const b$1 = {
7925
7940
  },
7926
7941
  presetStyle: { div },
7927
7942
  props: n
7928
- }, k$1 = {
7943
+ }, k$2 = {
7929
7944
  icon: ItemIcon,
7930
7945
  contentModel: {
7931
7946
  category: "none",
@@ -8029,7 +8044,7 @@ const m = {
8029
8044
  },
8030
8045
  initialProps: ["id", "class", "name", "value", "required", "checked"],
8031
8046
  props: e$1
8032
- }, k = {
8047
+ }, k$1 = {
8033
8048
  icon: TriggerIcon,
8034
8049
  contentModel: {
8035
8050
  category: "none",
@@ -8105,40 +8120,44 @@ const e = {
8105
8120
  description: "Current value of the element"
8106
8121
  }
8107
8122
  }, r = {};
8108
- const G = {
8123
+ const R = {
8109
8124
  icon: RadioGroupIcon,
8110
8125
  contentModel: {
8111
8126
  category: "instance",
8112
8127
  children: ["instance"],
8113
8128
  descendants: [n$4.RadioGroupItem]
8114
8129
  },
8115
- states: [
8116
- { label: "Checked", selector: "[data-state=checked]" },
8117
- { label: "Unchecked", selector: "[data-state=unchecked]" }
8118
- ],
8119
8130
  presetStyle: {
8120
8131
  div
8121
8132
  },
8122
8133
  initialProps: ["id", "class", "name", "value", "required"],
8123
8134
  props: e
8124
- }, h = {
8135
+ }, G = {
8125
8136
  icon: ItemIcon,
8126
8137
  contentModel: {
8127
8138
  category: "none",
8128
8139
  children: ["instance"],
8129
8140
  descendants: [n$4.RadioGroupIndicator]
8130
8141
  },
8142
+ states: [
8143
+ { label: "Checked", selector: "[data-state=checked]" },
8144
+ { label: "Unchecked", selector: "[data-state=unchecked]" }
8145
+ ],
8131
8146
  presetStyle: {
8132
8147
  button: [button, b$4].flat()
8133
8148
  },
8134
8149
  initialProps: ["value"],
8135
8150
  props: o
8136
- }, f = {
8151
+ }, k = {
8137
8152
  icon: TriggerIcon,
8138
8153
  contentModel: {
8139
8154
  category: "none",
8140
8155
  children: ["instance"]
8141
8156
  },
8157
+ states: [
8158
+ { label: "Checked", selector: "[data-state=checked]" },
8159
+ { label: "Unchecked", selector: "[data-state=unchecked]" }
8160
+ ],
8142
8161
  presetStyle: {
8143
8162
  span
8144
8163
  },
@@ -8148,11 +8167,11 @@ const radixComponentMetas = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object
8148
8167
  __proto__: null,
8149
8168
  Accordion: v$1,
8150
8169
  AccordionContent: H,
8151
- AccordionHeader: f$2,
8170
+ AccordionHeader: f$1,
8152
8171
  AccordionItem: x,
8153
8172
  AccordionTrigger: C$1,
8154
8173
  Checkbox: m,
8155
- CheckboxIndicator: k,
8174
+ CheckboxIndicator: k$1,
8156
8175
  Collapsible: g$1,
8157
8176
  CollapsibleContent: d$1,
8158
8177
  CollapsibleTrigger: m$4,
@@ -8168,29 +8187,29 @@ const radixComponentMetas = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object
8168
8187
  NavigationMenuContent: w$1,
8169
8188
  NavigationMenuItem: b$2,
8170
8189
  NavigationMenuLink: C,
8171
- NavigationMenuList: h$1,
8172
- NavigationMenuTrigger: k$2,
8190
+ NavigationMenuList: h,
8191
+ NavigationMenuTrigger: k$3,
8173
8192
  NavigationMenuViewport: S,
8174
- Popover: h$2,
8193
+ Popover: h$1,
8175
8194
  PopoverClose: u,
8176
8195
  PopoverContent: y$1,
8177
8196
  PopoverTrigger: C$3,
8178
- RadioGroup: G,
8179
- RadioGroupIndicator: f,
8180
- RadioGroupItem: h,
8197
+ RadioGroup: R,
8198
+ RadioGroupIndicator: k,
8199
+ RadioGroupItem: G,
8181
8200
  Select: b$1,
8182
8201
  SelectContent: v,
8183
- SelectItem: k$1,
8202
+ SelectItem: k$2,
8184
8203
  SelectItemIndicator: F,
8185
8204
  SelectItemText: q,
8186
- SelectTrigger: f$1,
8205
+ SelectTrigger: f,
8187
8206
  SelectValue: w,
8188
8207
  SelectViewport: P,
8189
8208
  Switch: m$1,
8190
8209
  SwitchThumb: b,
8191
8210
  Tabs: y,
8192
8211
  TabsContent: C$2,
8193
- TabsList: f$3,
8212
+ TabsList: f$2,
8194
8213
  TabsTrigger: x$1,
8195
8214
  Tooltip: m$3,
8196
8215
  TooltipContent: T,
@@ -9098,7 +9117,7 @@ const getDeploymentInstructions = (deployTarget) => {
9098
9117
  }
9099
9118
  };
9100
9119
  const name = "webstudio";
9101
- const version = "0.231.0";
9120
+ const version = "0.233.0";
9102
9121
  const description = "Webstudio CLI";
9103
9122
  const author = "Webstudio <github@webstudio.is>";
9104
9123
  const homepage = "https://webstudio.is";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webstudio",
3
- "version": "0.231.0",
3
+ "version": "0.233.0",
4
4
  "description": "Webstudio CLI",
5
5
  "author": "Webstudio <github@webstudio.is>",
6
6
  "homepage": "https://webstudio.is",
@@ -70,16 +70,16 @@
70
70
  "vite": "^6.3.4",
71
71
  "vitest": "^3.1.2",
72
72
  "wrangler": "^3.63.2",
73
- "@webstudio-is/css-engine": "0.231.0",
74
- "@webstudio-is/http-client": "0.231.0",
75
- "@webstudio-is/image": "0.231.0",
76
- "@webstudio-is/sdk": "0.231.0",
77
- "@webstudio-is/sdk-components-animation": "0.231.0",
78
- "@webstudio-is/sdk-components-react": "0.231.0",
79
- "@webstudio-is/react-sdk": "0.231.0",
80
- "@webstudio-is/sdk-components-react-radix": "0.231.0",
81
- "@webstudio-is/sdk-components-react-remix": "0.231.0",
82
- "@webstudio-is/sdk-components-react-router": "0.231.0",
73
+ "@webstudio-is/css-engine": "0.233.0",
74
+ "@webstudio-is/http-client": "0.233.0",
75
+ "@webstudio-is/image": "0.233.0",
76
+ "@webstudio-is/react-sdk": "0.233.0",
77
+ "@webstudio-is/sdk": "0.233.0",
78
+ "@webstudio-is/sdk-components-animation": "0.233.0",
79
+ "@webstudio-is/sdk-components-react": "0.233.0",
80
+ "@webstudio-is/sdk-components-react-remix": "0.233.0",
81
+ "@webstudio-is/sdk-components-react-radix": "0.233.0",
82
+ "@webstudio-is/sdk-components-react-router": "0.233.0",
83
83
  "@webstudio-is/tsconfig": "1.0.7"
84
84
  },
85
85
  "scripts": {
@@ -54,6 +54,24 @@ const customFetch: typeof fetch = (input, init) => {
54
54
  return Promise.resolve(response);
55
55
  }
56
56
 
57
+ if (isLocalResource(input, "current-date")) {
58
+ const now = new Date();
59
+ // Normalize to midnight UTC to prevent hydration mismatches
60
+ const startOfDay = new Date(
61
+ Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate())
62
+ );
63
+ const data = {
64
+ iso: startOfDay.toISOString(),
65
+ year: startOfDay.getUTCFullYear(),
66
+ month: startOfDay.getUTCMonth() + 1, // 1-12 instead of 0-11
67
+ day: startOfDay.getUTCDate(),
68
+ timestamp: startOfDay.getTime(),
69
+ };
70
+ const response = new Response(JSON.stringify(data));
71
+ response.headers.set("content-type", "application/json; charset=utf-8");
72
+ return Promise.resolve(response);
73
+ }
74
+
57
75
  return cachedFetch(projectId, input, init);
58
76
  };
59
77
 
@@ -71,6 +89,7 @@ export const loader = async (arg: LoaderFunctionArgs) => {
71
89
  params,
72
90
  search: Object.fromEntries(url.searchParams),
73
91
  origin: url.origin,
92
+ pathname: url.pathname,
74
93
  };
75
94
 
76
95
  const resources = await loadResources(
@@ -204,6 +223,7 @@ export const action = async ({
204
223
  params: {},
205
224
  search: {},
206
225
  origin: url.origin,
226
+ pathname: url.pathname,
207
227
  };
208
228
 
209
229
  const resourceName = formData.get(formIdFieldName);
@@ -22,6 +22,24 @@ const customFetch: typeof fetch = (input, init) => {
22
22
  return Promise.resolve(response);
23
23
  }
24
24
 
25
+ if (isLocalResource(input, "current-date")) {
26
+ const now = new Date();
27
+ // Normalize to midnight UTC to prevent hydration mismatches
28
+ const startOfDay = new Date(
29
+ Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate())
30
+ );
31
+ const data = {
32
+ iso: startOfDay.toISOString(),
33
+ year: startOfDay.getUTCFullYear(),
34
+ month: startOfDay.getUTCMonth() + 1, // 1-12 instead of 0-11
35
+ day: startOfDay.getUTCDate(),
36
+ timestamp: startOfDay.getTime(),
37
+ };
38
+ const response = new Response(JSON.stringify(data));
39
+ response.headers.set("content-type", "application/json; charset=utf-8");
40
+ return Promise.resolve(response);
41
+ }
42
+
25
43
  return fetch(input, init);
26
44
  };
27
45
 
@@ -40,6 +58,7 @@ export const loader = async (arg: LoaderFunctionArgs) => {
40
58
  params,
41
59
  search: Object.fromEntries(url.searchParams),
42
60
  origin: url.origin,
61
+ pathname: url.pathname,
43
62
  };
44
63
 
45
64
  const resources = await loadResources(
@@ -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.231.0",
15
- "@webstudio-is/react-sdk": "0.231.0",
16
- "@webstudio-is/sdk": "0.231.0",
17
- "@webstudio-is/sdk-components-react": "0.231.0",
18
- "@webstudio-is/sdk-components-animation": "0.231.0",
19
- "@webstudio-is/sdk-components-react-radix": "0.231.0",
20
- "@webstudio-is/sdk-components-react-remix": "0.231.0",
14
+ "@webstudio-is/image": "0.233.0",
15
+ "@webstudio-is/react-sdk": "0.233.0",
16
+ "@webstudio-is/sdk": "0.233.0",
17
+ "@webstudio-is/sdk-components-react": "0.233.0",
18
+ "@webstudio-is/sdk-components-animation": "0.233.0",
19
+ "@webstudio-is/sdk-components-react-radix": "0.233.0",
20
+ "@webstudio-is/sdk-components-react-remix": "0.233.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"
@@ -53,6 +53,24 @@ const customFetch: typeof fetch = (input, init) => {
53
53
  return Promise.resolve(response);
54
54
  }
55
55
 
56
+ if (isLocalResource(input, "current-date")) {
57
+ const now = new Date();
58
+ // Normalize to midnight UTC to prevent hydration mismatches
59
+ const startOfDay = new Date(
60
+ Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate())
61
+ );
62
+ const data = {
63
+ iso: startOfDay.toISOString(),
64
+ year: startOfDay.getUTCFullYear(),
65
+ month: startOfDay.getUTCMonth() + 1, // 1-12 instead of 0-11
66
+ day: startOfDay.getUTCDate(),
67
+ timestamp: startOfDay.getTime(),
68
+ };
69
+ const response = new Response(JSON.stringify(data));
70
+ response.headers.set("content-type", "application/json; charset=utf-8");
71
+ return Promise.resolve(response);
72
+ }
73
+
56
74
  return cachedFetch(projectId, input, init);
57
75
  };
58
76
 
@@ -70,6 +88,7 @@ export const loader = async (arg: LoaderFunctionArgs) => {
70
88
  params,
71
89
  search: Object.fromEntries(url.searchParams),
72
90
  origin: url.origin,
91
+ pathname: url.pathname,
73
92
  };
74
93
 
75
94
  const resources = await loadResources(
@@ -203,6 +222,7 @@ export const action = async ({
203
222
  params: {},
204
223
  search: {},
205
224
  origin: url.origin,
225
+ pathname: url.pathname,
206
226
  };
207
227
 
208
228
  const resourceName = formData.get(formIdFieldName);
@@ -22,6 +22,24 @@ const customFetch: typeof fetch = (input, init) => {
22
22
  return Promise.resolve(response);
23
23
  }
24
24
 
25
+ if (isLocalResource(input, "current-date")) {
26
+ const now = new Date();
27
+ // Normalize to midnight UTC to prevent hydration mismatches
28
+ const startOfDay = new Date(
29
+ Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate())
30
+ );
31
+ const data = {
32
+ iso: startOfDay.toISOString(),
33
+ year: startOfDay.getUTCFullYear(),
34
+ month: startOfDay.getUTCMonth() + 1, // 1-12 instead of 0-11
35
+ day: startOfDay.getUTCDate(),
36
+ timestamp: startOfDay.getTime(),
37
+ };
38
+ const response = new Response(JSON.stringify(data));
39
+ response.headers.set("content-type", "application/json; charset=utf-8");
40
+ return Promise.resolve(response);
41
+ }
42
+
25
43
  return fetch(input, init);
26
44
  };
27
45
 
@@ -40,6 +58,7 @@ export const loader = async (arg: LoaderFunctionArgs) => {
40
58
  params,
41
59
  search: Object.fromEntries(url.searchParams),
42
60
  origin: url.origin,
61
+ pathname: url.pathname,
43
62
  };
44
63
 
45
64
  const resources = await loadResources(
@@ -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.231.0",
14
- "@webstudio-is/react-sdk": "0.231.0",
15
- "@webstudio-is/sdk": "0.231.0",
16
- "@webstudio-is/sdk-components-animation": "0.231.0",
17
- "@webstudio-is/sdk-components-react-radix": "0.231.0",
18
- "@webstudio-is/sdk-components-react-router": "0.231.0",
19
- "@webstudio-is/sdk-components-react": "0.231.0",
13
+ "@webstudio-is/image": "0.233.0",
14
+ "@webstudio-is/react-sdk": "0.233.0",
15
+ "@webstudio-is/sdk": "0.233.0",
16
+ "@webstudio-is/sdk-components-animation": "0.233.0",
17
+ "@webstudio-is/sdk-components-react-radix": "0.233.0",
18
+ "@webstudio-is/sdk-components-react-router": "0.233.0",
19
+ "@webstudio-is/sdk-components-react": "0.233.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",
@@ -1,8 +1,34 @@
1
1
  import type { PageContextServer } from "vike/types";
2
2
  import { redirect } from "vike/abort";
3
- import { loadResources } from "@webstudio-is/sdk/runtime";
3
+ import { isLocalResource, loadResources } from "@webstudio-is/sdk/runtime";
4
4
  import { getPageMeta, getResources } from "__SERVER__";
5
5
 
6
+ const customFetch: typeof fetch = (input, init) => {
7
+ if (typeof input !== "string") {
8
+ return fetch(input, init);
9
+ }
10
+
11
+ if (isLocalResource(input, "current-date")) {
12
+ const now = new Date();
13
+ // Normalize to midnight UTC to prevent hydration mismatches
14
+ const startOfDay = new Date(
15
+ Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate())
16
+ );
17
+ const data = {
18
+ iso: startOfDay.toISOString(),
19
+ year: startOfDay.getUTCFullYear(),
20
+ month: startOfDay.getUTCMonth() + 1, // 1-12 instead of 0-11
21
+ day: startOfDay.getUTCDate(),
22
+ timestamp: startOfDay.getTime(),
23
+ };
24
+ const response = new Response(JSON.stringify(data));
25
+ response.headers.set("content-type", "application/json; charset=utf-8");
26
+ return Promise.resolve(response);
27
+ }
28
+
29
+ return fetch(input, init);
30
+ };
31
+
6
32
  export const data = async (pageContext: PageContextServer) => {
7
33
  const url = new URL(pageContext.urlOriginal, "http://url");
8
34
  const headers = new Headers(pageContext.headers ?? {});
@@ -15,9 +41,13 @@ export const data = async (pageContext: PageContextServer) => {
15
41
  params,
16
42
  search: Object.fromEntries(url.searchParams),
17
43
  origin: url.origin,
44
+ pathname: url.pathname,
18
45
  };
19
46
 
20
- const resources = await loadResources(fetch, getResources({ system }).data);
47
+ const resources = await loadResources(
48
+ customFetch,
49
+ getResources({ system }).data
50
+ );
21
51
  const pageMeta = getPageMeta({ system, resources });
22
52
 
23
53
  if (pageMeta.redirect) {
@@ -8,12 +8,12 @@
8
8
  "typecheck": "tsc"
9
9
  },
10
10
  "dependencies": {
11
- "@webstudio-is/image": "0.231.0",
12
- "@webstudio-is/react-sdk": "0.231.0",
13
- "@webstudio-is/sdk": "0.231.0",
14
- "@webstudio-is/sdk-components-react": "0.231.0",
15
- "@webstudio-is/sdk-components-animation": "0.231.0",
16
- "@webstudio-is/sdk-components-react-radix": "0.231.0",
11
+ "@webstudio-is/image": "0.233.0",
12
+ "@webstudio-is/react-sdk": "0.233.0",
13
+ "@webstudio-is/sdk": "0.233.0",
14
+ "@webstudio-is/sdk-components-react": "0.233.0",
15
+ "@webstudio-is/sdk-components-animation": "0.233.0",
16
+ "@webstudio-is/sdk-components-react-radix": "0.233.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"