@kurumera/editable 0.4.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/CHANGELOG.md ADDED
@@ -0,0 +1,24 @@
1
+ # @kurumera/editable — changelog
2
+
3
+ ## 0.5.1 — 2026-11-12
4
+
5
+ `@kurumera/storefront` is now accepted from 0.9.0 up to (not including) 1.0.0,
6
+ was `^0.9.0`. For a 0.x package `^0.9.0` stops at 0.9.x, so a theme on
7
+ storefront 0.10 or 0.11 got a second, older copy of the SDK nested under this
8
+ package. Nothing here needs more than 0.9 (forwardHeaders).
9
+
10
+ ## 0.5.0 — 2026-10-16
11
+
12
+ `resolveEditableContent()` now forwards the visitor's `x-forwarded-for` and
13
+ `cf-connecting-ip`, as received, on its platform call — the same change as
14
+ `@kurumera/storefront` 0.9.0's `forwardHeaders`.
15
+
16
+ It runs from the root layout on every page, and it never throws by design, so a
17
+ call the platform throttled did not fail the page: it quietly rendered without
18
+ the merchant's edited content. Without the visitor's address every page view on
19
+ a server looked like one visitor, and a single crawler was enough to cause that.
20
+
21
+ **Dependency change:** `@kurumera/storefront` is now `^0.9.0`, was `^0.3.0`. The
22
+ old range made every theme install a separate nested 0.3.x copy of the SDK just
23
+ for this package; with it, the forwarding above would have been silently
24
+ ignored. Update both packages together.
@@ -36,6 +36,14 @@ export const resolveEditableContent = cache(async () => {
36
36
  domain: domain || undefined,
37
37
  apiUrl,
38
38
  editSessionToken: editToken || undefined,
39
+ // The visitor, as received — same reason as getStore() in the theme.
40
+ // This runs from the root layout on EVERY page, and the never-throws
41
+ // rule above means a throttled call here does not fail the page: it
42
+ // silently renders without the merchant's edited content instead.
43
+ forwardHeaders: {
44
+ "x-forwarded-for": h.get("x-forwarded-for"),
45
+ "cf-connecting-ip": h.get("cf-connecting-ip"),
46
+ },
39
47
  });
40
48
  const res = await client.content.getAll();
41
49
  const mode = !res.editable ? "off" : modeParam === "preview" ? "preview" : "edit";
package/package.json CHANGED
@@ -1,17 +1,31 @@
1
1
  {
2
2
  "name": "@kurumera/editable",
3
- "version": "0.4.0",
4
- "description": "Kurumera Editable Components — inline, draft/publish, no-rebuild content editing for code themes.",
3
+ "version": "0.5.1",
4
+ "description": "Kurumera Editable Components \u2014 inline, draft/publish, no-rebuild content editing for code themes.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "exports": {
9
- ".": { "types": "./dist/index.d.ts", "import": "./dist/index.js" },
10
- "./client": { "types": "./dist/client.d.ts", "import": "./dist/client.js" },
11
- "./server": { "types": "./dist/server.d.ts", "import": "./dist/server.js" }
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js"
12
+ },
13
+ "./client": {
14
+ "types": "./dist/client.d.ts",
15
+ "import": "./dist/client.js"
16
+ },
17
+ "./server": {
18
+ "types": "./dist/server.d.ts",
19
+ "import": "./dist/server.js"
20
+ }
21
+ },
22
+ "files": [
23
+ "dist",
24
+ "CHANGELOG.md"
25
+ ],
26
+ "publishConfig": {
27
+ "access": "public"
12
28
  },
13
- "files": ["dist"],
14
- "publishConfig": { "access": "public" },
15
29
  "scripts": {
16
30
  "build": "tsc -p tsconfig.json",
17
31
  "typecheck": "tsc -p tsconfig.json --noEmit",
@@ -23,7 +37,7 @@
23
37
  "react-dom": "^19.0.0"
24
38
  },
25
39
  "dependencies": {
26
- "@kurumera/storefront": "^0.3.0"
40
+ "@kurumera/storefront": ">=0.9.0 <1.0.0"
27
41
  },
28
42
  "devDependencies": {
29
43
  "@types/react": "^19.0.0",