@usethrottle/builder-react 0.3.1 → 0.4.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/CLAUDE.md +31 -0
- package/dist/{chunk-LXBCOZP2.js → chunk-4EGFSBVT.js} +1413 -521
- package/dist/{chunk-IDGSPYRH.cjs → chunk-54BG5PPM.cjs} +1379 -487
- package/dist/index.cjs +1697 -750
- package/dist/index.d.cts +200 -38
- package/dist/index.d.ts +200 -38
- package/dist/index.js +1671 -720
- package/dist/interactions-runtime.cjs +207 -0
- package/dist/interactions-runtime.js +186 -0
- package/dist/next.cjs +6 -6
- package/dist/next.d.cts +1 -1
- package/dist/next.d.ts +1 -1
- package/dist/next.js +1 -1
- package/dist/{seo-Dz439Jlk.d.cts → seo-CNZ9DrlU.d.cts} +16 -1
- package/dist/{seo-Dz439Jlk.d.ts → seo-CNZ9DrlU.d.ts} +16 -1
- package/dist/server.cjs +26 -22
- package/dist/server.d.cts +2 -2
- package/dist/server.d.ts +2 -2
- package/dist/server.js +9 -5
- package/package.json +5 -4
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-
|
|
2
|
-
export { B as BundleAsk, g as getBundle } from './seo-
|
|
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-
|
|
2
|
-
export { B as BundleAsk, g as getBundle } from './seo-
|
|
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-
|
|
15
|
+
} from "./chunk-4EGFSBVT.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
|
|
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
|
+
"version": "0.4.0",
|
|
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.
|
|
61
|
-
"@usethrottle/
|
|
62
|
-
"@usethrottle/
|
|
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",
|