@realadvisor-sites/kit-react 0.5.0 → 0.5.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/package.json +3 -3
- package/server/worker.ts +4 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@realadvisor-sites/kit-react",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "The React Router (framework mode, SSR on Cloudflare Workers) version of the RealAdvisor sites kit: Worker with a per-request CSP nonce, data through the SDK interface, images, legal, consent, enquiry, SEO, listings search and map, and the deploy check. Reuses @realadvisor/sites-kit-core for every rule, string and browser script it can.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"sites-kit-react": "bin/sites-kit-react.mjs"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
|
-
"@realadvisor/sites-kit-core": "^0.5.
|
|
54
|
-
"@realadvisor/sites-sdk": "^0.5.
|
|
53
|
+
"@realadvisor/sites-kit-core": "^0.5.1",
|
|
54
|
+
"@realadvisor/sites-sdk": "^0.5.1",
|
|
55
55
|
"react": "^19.0.0",
|
|
56
56
|
"react-dom": "^19.0.0",
|
|
57
57
|
"react-router": "^7.18.0",
|
package/server/worker.ts
CHANGED
|
@@ -133,7 +133,10 @@ export function createSiteWorker(build: () => Promise<ServerBuild>) {
|
|
|
133
133
|
// Only an HTML page carries inline scripts: the nonce goes in its CSP alone.
|
|
134
134
|
const html = (res.headers.get('content-type') ?? '').includes('text/html');
|
|
135
135
|
try {
|
|
136
|
-
|
|
136
|
+
// Dev (the CRM preview's sandbox) is always framable, whatever SITE_MODE says:
|
|
137
|
+
// the sandbox sets SITE_MODE=production so preview enquiries send.
|
|
138
|
+
const framable = siteMode() === 'preview' || import.meta.env.DEV === true;
|
|
139
|
+
const headers = siteHeaders(framable, html ? nonce : undefined);
|
|
137
140
|
for (const [k, v] of Object.entries(headers)) {
|
|
138
141
|
if (k === 'content-security-policy' || !res.headers.has(k)) res.headers.set(k, v);
|
|
139
142
|
}
|