@usethrottle/builder-react 0.3.1 → 0.4.1

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/dist/server.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { C as ClientOptions, W as WidgetPack, b as LoadedSite, L as LoadedPage, a as LoadedRedirect, P as PagePathResolver } from './seo-Dz439Jlk.cjs';
2
- export { B as BundleAsk, g as getBundle } from './seo-Dz439Jlk.cjs';
1
+ import { C as ClientOptions, W as WidgetPack, b as LoadedSite, L as LoadedPage, a as LoadedRedirect, P as PagePathResolver } from './seo-CNZ9DrlU.cjs';
2
+ export { B as BundleAsk, g as getBundle } from './seo-CNZ9DrlU.cjs';
3
3
  export { BuilderNotFoundError, BuilderUnavailableError } from '@usethrottle/builder';
4
4
  import 'react';
5
5
  import '@usethrottle/builder-schema';
package/dist/server.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { C as ClientOptions, W as WidgetPack, b as LoadedSite, L as LoadedPage, a as LoadedRedirect, P as PagePathResolver } from './seo-Dz439Jlk.js';
2
- export { B as BundleAsk, g as getBundle } from './seo-Dz439Jlk.js';
1
+ import { C as ClientOptions, W as WidgetPack, b as LoadedSite, L as LoadedPage, a as LoadedRedirect, P as PagePathResolver } from './seo-CNZ9DrlU.js';
2
+ export { B as BundleAsk, g as getBundle } from './seo-CNZ9DrlU.js';
3
3
  export { BuilderNotFoundError, BuilderUnavailableError } from '@usethrottle/builder';
4
4
  import 'react';
5
5
  import '@usethrottle/builder-schema';
package/dist/server.js CHANGED
@@ -12,7 +12,7 @@ import {
12
12
  siteLocales,
13
13
  staticDataFor,
14
14
  warnOnce
15
- } from "./chunk-LXBCOZP2.js";
15
+ } from "./chunk-TS2WCTZ3.js";
16
16
 
17
17
  // src/server/load-site.ts
18
18
  import { BuilderUnavailableError } from "@usethrottle/builder";
@@ -29,7 +29,11 @@ async function loadSite(options) {
29
29
  }
30
30
  const registry = createRendererRegistry(packs);
31
31
  const names = Object.keys(bundle.slots);
32
- const documents = [bundle.header.document, bundle.footer.document, ...names.map((n) => bundle.slots[n].document)];
32
+ const withShared = (loaded) => ({
33
+ ...loaded,
34
+ ...(loaded.savedSections ?? bundle.savedSections) === void 0 ? {} : { savedSections: loaded.savedSections ?? bundle.savedSections }
35
+ });
36
+ const documents = [bundle.header, bundle.footer, ...names.map((n) => bundle.slots[n])].map(withShared);
33
37
  const data = await staticDataFor(documents, registry, locale, currency);
34
38
  return {
35
39
  status: "ok",
@@ -38,9 +42,9 @@ async function loadSite(options) {
38
42
  siteVersion: bundle.site.siteVersion,
39
43
  mediaOrigin,
40
44
  settings: bundle.site.settings,
41
- header: partOf(bundle.header, data),
42
- footer: partOf(bundle.footer, data),
43
- slots: Object.fromEntries(names.map((name) => [name, partOf(bundle.slots[name], data)]))
45
+ header: partOf(bundle.header, data, bundle),
46
+ footer: partOf(bundle.footer, data, bundle),
47
+ slots: Object.fromEntries(names.map((name) => [name, partOf(bundle.slots[name], data, bundle)]))
44
48
  };
45
49
  }
46
50
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usethrottle/builder-react",
3
- "version": "0.3.1",
3
+ "version": "0.4.1",
4
4
  "description": "Renders a published Throttle Builder page document as React in a merchant's store: responsive CSS, header, footer, slots and the site design provider.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -57,9 +57,9 @@
57
57
  "nextjs"
58
58
  ],
59
59
  "dependencies": {
60
- "@usethrottle/builder": "^0.4.1",
61
- "@usethrottle/builder-schema": "^0.2.0",
62
- "@usethrottle/ui": "^0.1.2"
60
+ "@usethrottle/builder-schema": "^0.2.1",
61
+ "@usethrottle/ui": "^0.1.2",
62
+ "@usethrottle/builder": "^0.5.0"
63
63
  },
64
64
  "peerDependencies": {
65
65
  "next": ">=15",
@@ -76,6 +76,7 @@
76
76
  "@types/node": "^20.0.0",
77
77
  "@types/react": "^19.1.0",
78
78
  "@types/react-dom": "^19.1.0",
79
+ "axe-core": "4.14.0",
79
80
  "jsdom": "^25.0.1",
80
81
  "next": "15.5.15",
81
82
  "playwright": "^1.62.1",