webstudio 0.299.0 → 0.300.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webstudio",
3
- "version": "0.299.0",
3
+ "version": "0.300.0",
4
4
  "description": "Webstudio CLI",
5
5
  "author": "Webstudio <github@webstudio.is>",
6
6
  "homepage": "https://webstudio.is",
@@ -53,9 +53,9 @@
53
53
  "which": "^5.0.0",
54
54
  "yargs": "^17.7.2",
55
55
  "zod": "^4.4.3",
56
- "@webstudio-is/http-client": "0.299.0",
57
- "@webstudio-is/project-migrations": "0.299.0",
58
- "@webstudio-is/protocol": "0.299.0",
56
+ "@webstudio-is/http-client": "0.300.0",
57
+ "@webstudio-is/protocol": "0.300.0",
58
+ "@webstudio-is/project-migrations": "0.300.0",
59
59
  "@webstudio-is/sync-client": "0.0.0"
60
60
  },
61
61
  "devDependencies": {
@@ -99,24 +99,24 @@
99
99
  "vite": "^6.3.4",
100
100
  "vitest": "^3.1.2",
101
101
  "wrangler": "4.130.0",
102
- "@webstudio-is/css-engine": "0.299.0",
103
- "@webstudio-is/content-engine": "0.299.0",
104
- "@webstudio-is/expression": "0.299.0",
105
- "@webstudio-is/fonts": "0.299.0",
106
- "@webstudio-is/image": "0.299.0",
102
+ "@webstudio-is/expression": "0.300.0",
103
+ "@webstudio-is/fonts": "0.300.0",
104
+ "@webstudio-is/image": "0.300.0",
107
105
  "@webstudio-is/project-build": "0.0.0",
108
- "@webstudio-is/react-sdk": "0.299.0",
109
- "@webstudio-is/query-builder": "0.299.0",
110
- "@webstudio-is/sdk-components-animation": "0.299.0",
111
- "@webstudio-is/sdk-components-react": "0.299.0",
112
- "@webstudio-is/sdk-components-react-radix": "0.299.0",
113
- "@webstudio-is/sdk-components-react-remix": "0.299.0",
114
- "@webstudio-is/sdk": "0.299.0",
115
- "@webstudio-is/sdk-components-react-router": "0.299.0",
116
- "@webstudio-is/sdk-components-registry": "0.299.0",
106
+ "@webstudio-is/query-builder": "0.300.0",
107
+ "@webstudio-is/css-engine": "0.300.0",
108
+ "@webstudio-is/sdk-components-animation": "0.300.0",
109
+ "@webstudio-is/react-sdk": "0.300.0",
110
+ "@webstudio-is/sdk": "0.300.0",
111
+ "@webstudio-is/sdk-components-react": "0.300.0",
112
+ "@webstudio-is/content-engine": "0.300.0",
113
+ "@webstudio-is/sdk-components-react-radix": "0.300.0",
114
+ "@webstudio-is/sdk-components-react-router": "0.300.0",
117
115
  "@webstudio-is/tsconfig": "1.0.7",
118
- "@webstudio-is/vision": "0.0.0",
119
- "@webstudio-is/wsauth": "0.299.0"
116
+ "@webstudio-is/sdk-components-registry": "0.300.0",
117
+ "@webstudio-is/wsauth": "0.300.0",
118
+ "@webstudio-is/sdk-components-react-remix": "0.300.0",
119
+ "@webstudio-is/vision": "0.0.0"
120
120
  },
121
121
  "scripts": {
122
122
  "typecheck": "tsc --noEmit",
@@ -12,7 +12,7 @@
12
12
  "build-cf-types": "wrangler types"
13
13
  },
14
14
  "dependencies": {
15
- "@webstudio-is/wsauth": "0.299.0",
15
+ "@webstudio-is/wsauth": "0.300.0",
16
16
  "@remix-run/cloudflare": "2.16.5",
17
17
  "@remix-run/cloudflare-pages": "2.16.5"
18
18
  },
@@ -276,9 +276,10 @@ export const action = async ({
276
276
  };
277
277
 
278
278
  const resourceName = formData.get(formIdFieldName);
279
- let resource =
279
+ const generatedResources = getResources({ system });
280
+ const actionResource =
280
281
  typeof resourceName === "string"
281
- ? getResources({ system }).action.get(resourceName)
282
+ ? generatedResources.action.get(resourceName)
282
283
  : undefined;
283
284
 
284
285
  const formBotValue = formData.get(formBotFieldName);
@@ -307,25 +308,49 @@ export const action = async ({
307
308
  formData.delete(formIdFieldName);
308
309
  formData.delete(formBotFieldName);
309
310
 
310
- if (resource) {
311
- resource.body = Object.fromEntries(formData);
312
- } else {
311
+ let result: Awaited<ReturnType<typeof loadResource>>;
312
+ if (actionResource === undefined) {
313
313
  if (contactEmail === undefined) {
314
314
  throw new Error("Contact email not found");
315
315
  }
316
-
317
- resource = context.getDefaultActionResource?.({
316
+ const resource = context.getDefaultActionResource?.({
318
317
  url,
319
318
  projectId,
320
319
  contactEmail,
321
320
  formData,
322
321
  });
322
+ if (resource === undefined) {
323
+ throw Error("Resource not found");
324
+ }
325
+ result = await loadResource(fetch, resource);
326
+ } else {
327
+ const actionFetch = await createGeneratedAssetResourceFetch({
328
+ request,
329
+ context,
330
+ fallback: customFetch,
331
+ });
332
+ const results = await loadResources(
333
+ actionFetch,
334
+ {
335
+ ...generatedResources.data,
336
+ rootIds: [actionResource.id],
337
+ },
338
+ url,
339
+ {
340
+ requestOverrides: new Map([
341
+ // Mutations must reach the backend on every submission, even when
342
+ // the resource has caching enabled. Dependencies can stay cached.
343
+ [actionResource.id, { body: Object.fromEntries(formData), fetch }],
344
+ ]),
345
+ }
346
+ );
347
+ const actionResult = results[actionResource.outputName];
348
+ if (actionResult === undefined) {
349
+ throw Error("Resource not found");
350
+ }
351
+ result = actionResult as Awaited<ReturnType<typeof loadResource>>;
323
352
  }
324
-
325
- if (resource === undefined) {
326
- throw Error("Resource not found");
327
- }
328
- const { ok, statusText } = await loadResource(fetch, resource);
353
+ const { ok, statusText } = result;
329
354
  if (ok) {
330
355
  return { success: true };
331
356
  }
@@ -13,14 +13,14 @@
13
13
  "@remix-run/node": "2.16.5",
14
14
  "@remix-run/react": "2.16.5",
15
15
  "@remix-run/server-runtime": "2.16.5",
16
- "@webstudio-is/image": "0.299.0",
17
- "@webstudio-is/react-sdk": "0.299.0",
18
- "@webstudio-is/sdk": "0.299.0",
19
- "@webstudio-is/sdk-components-react": "0.299.0",
20
- "@webstudio-is/sdk-components-animation": "0.299.0",
21
- "@webstudio-is/sdk-components-react-radix": "0.299.0",
22
- "@webstudio-is/sdk-components-react-remix": "0.299.0",
23
- "@webstudio-is/wsauth": "0.299.0",
16
+ "@webstudio-is/image": "0.300.0",
17
+ "@webstudio-is/react-sdk": "0.300.0",
18
+ "@webstudio-is/sdk": "0.300.0",
19
+ "@webstudio-is/sdk-components-react": "0.300.0",
20
+ "@webstudio-is/sdk-components-animation": "0.300.0",
21
+ "@webstudio-is/sdk-components-react-radix": "0.300.0",
22
+ "@webstudio-is/sdk-components-react-remix": "0.300.0",
23
+ "@webstudio-is/wsauth": "0.300.0",
24
24
  "isbot": "^5.1.25",
25
25
  "react": "18.3.0-canary-14898b6a9-20240318",
26
26
  "react-dom": "18.3.0-canary-14898b6a9-20240318",
@@ -3,6 +3,7 @@ import type { ResourceRequest } from "@webstudio-is/sdk";
3
3
  declare module "react-router" {
4
4
  interface AppLoadContext {
5
5
  EXCLUDE_FROM_SEARCH: boolean;
6
+ WEBSTUDIO_AUTOMATION_TOKEN?: string;
6
7
  getDefaultActionResource?: (options: {
7
8
  url: URL;
8
9
  projectId: string;
@@ -275,9 +275,10 @@ export const action = async ({
275
275
  };
276
276
 
277
277
  const resourceName = formData.get(formIdFieldName);
278
- let resource =
278
+ const generatedResources = getResources({ system });
279
+ const actionResource =
279
280
  typeof resourceName === "string"
280
- ? getResources({ system }).action.get(resourceName)
281
+ ? generatedResources.action.get(resourceName)
281
282
  : undefined;
282
283
 
283
284
  const formBotValue = formData.get(formBotFieldName);
@@ -306,25 +307,49 @@ export const action = async ({
306
307
  formData.delete(formIdFieldName);
307
308
  formData.delete(formBotFieldName);
308
309
 
309
- if (resource) {
310
- resource.body = Object.fromEntries(formData);
311
- } else {
310
+ let result: Awaited<ReturnType<typeof loadResource>>;
311
+ if (actionResource === undefined) {
312
312
  if (contactEmail === undefined) {
313
313
  throw new Error("Contact email not found");
314
314
  }
315
-
316
- resource = context.getDefaultActionResource?.({
315
+ const resource = context.getDefaultActionResource?.({
317
316
  url,
318
317
  projectId,
319
318
  contactEmail,
320
319
  formData,
321
320
  });
321
+ if (resource === undefined) {
322
+ throw Error("Resource not found");
323
+ }
324
+ result = await loadResource(fetch, resource);
325
+ } else {
326
+ const actionFetch = await createGeneratedAssetResourceFetch({
327
+ request,
328
+ context,
329
+ fallback: customFetch,
330
+ });
331
+ const results = await loadResources(
332
+ actionFetch,
333
+ {
334
+ ...generatedResources.data,
335
+ rootIds: [actionResource.id],
336
+ },
337
+ url,
338
+ {
339
+ requestOverrides: new Map([
340
+ // Mutations must reach the backend on every submission, even when
341
+ // the resource has caching enabled. Dependencies can stay cached.
342
+ [actionResource.id, { body: Object.fromEntries(formData), fetch }],
343
+ ]),
344
+ }
345
+ );
346
+ const actionResult = results[actionResource.outputName];
347
+ if (actionResult === undefined) {
348
+ throw Error("Resource not found");
349
+ }
350
+ result = actionResult as Awaited<ReturnType<typeof loadResource>>;
322
351
  }
323
-
324
- if (resource === undefined) {
325
- throw Error("Resource not found");
326
- }
327
- const { ok, statusText } = await loadResource(fetch, resource);
352
+ const { ok, statusText } = result;
328
353
  if (ok) {
329
354
  return { success: true };
330
355
  }
@@ -15,14 +15,14 @@
15
15
  "@react-router/fs-routes": "^7.5.3",
16
16
  "@react-router/node": "^7.5.3",
17
17
  "@react-router/serve": "^7.5.3",
18
- "@webstudio-is/image": "0.299.0",
19
- "@webstudio-is/react-sdk": "0.299.0",
20
- "@webstudio-is/sdk": "0.299.0",
21
- "@webstudio-is/sdk-components-animation": "0.299.0",
22
- "@webstudio-is/sdk-components-react-radix": "0.299.0",
23
- "@webstudio-is/sdk-components-react-router": "0.299.0",
24
- "@webstudio-is/sdk-components-react": "0.299.0",
25
- "@webstudio-is/wsauth": "0.299.0",
18
+ "@webstudio-is/image": "0.300.0",
19
+ "@webstudio-is/react-sdk": "0.300.0",
20
+ "@webstudio-is/sdk": "0.300.0",
21
+ "@webstudio-is/sdk-components-animation": "0.300.0",
22
+ "@webstudio-is/sdk-components-react-radix": "0.300.0",
23
+ "@webstudio-is/sdk-components-react-router": "0.300.0",
24
+ "@webstudio-is/sdk-components-react": "0.300.0",
25
+ "@webstudio-is/wsauth": "0.300.0",
26
26
  "isbot": "^5.1.25",
27
27
  "react": "18.3.0-canary-14898b6a9-20240318",
28
28
  "react-dom": "18.3.0-canary-14898b6a9-20240318",
@@ -7,7 +7,7 @@
7
7
  },
8
8
  "dependencies": {
9
9
  "@cloudflare/vite-plugin": "^1.1.0",
10
- "@webstudio-is/wsauth": "0.299.0",
10
+ "@webstudio-is/wsauth": "0.300.0",
11
11
  "wrangler": "^4.14.1"
12
12
  }
13
13
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "node_modules/wrangler/config-schema.json",
3
- // SaaS publishes Workers. This takes precedence over the Cloudflare Pages
3
+ // Hosted deployments publish Workers. This takes precedence over the Cloudflare Pages
4
4
  // template's wrangler.toml; publish workflows provide the name and date.
5
5
  "name": "webstudio-remix-app",
6
6
  "compatibility_date": "2024-04-05"
@@ -18,5 +18,9 @@ export const createSsgAssetResourceFetch = ({
18
18
  baseUrl: "https://webstudio.local",
19
19
  deploymentId,
20
20
  artifact,
21
+ automationToken:
22
+ typeof process === "undefined"
23
+ ? undefined
24
+ : process.env.WEBSTUDIO_AUTOMATION_TOKEN,
21
25
  runtimeAssets,
22
26
  });
@@ -11,12 +11,12 @@
11
11
  "dependencies": {
12
12
  "@shikijs/langs": "4.4.1",
13
13
  "@shikijs/themes": "4.4.1",
14
- "@webstudio-is/image": "0.299.0",
15
- "@webstudio-is/react-sdk": "0.299.0",
16
- "@webstudio-is/sdk": "0.299.0",
17
- "@webstudio-is/sdk-components-react": "0.299.0",
18
- "@webstudio-is/sdk-components-animation": "0.299.0",
19
- "@webstudio-is/sdk-components-react-radix": "0.299.0",
14
+ "@webstudio-is/image": "0.300.0",
15
+ "@webstudio-is/react-sdk": "0.300.0",
16
+ "@webstudio-is/sdk": "0.300.0",
17
+ "@webstudio-is/sdk-components-react": "0.300.0",
18
+ "@webstudio-is/sdk-components-animation": "0.300.0",
19
+ "@webstudio-is/sdk-components-react-radix": "0.300.0",
20
20
  "react": "18.3.0-canary-14898b6a9-20240318",
21
21
  "react-dom": "18.3.0-canary-14898b6a9-20240318",
22
22
  "shiki": "4.4.1",