@bettercms-ai/next 0.10.1 → 0.11.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/README.md +11 -1
- package/dist/blocks.js +155 -35
- package/dist/blocks.js.map +1 -1
- package/dist/draft-bridge.d.ts +41 -0
- package/dist/draft-bridge.js +664 -0
- package/dist/draft-bridge.js.map +1 -0
- package/dist/index.d.ts +14 -5
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/visual-editing.d.ts +4 -2
- package/dist/visual-editing.js +1 -1
- package/dist/visual-editing.js.map +1 -1
- package/package.json +9 -4
package/dist/visual-editing.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
interface VisualEditingProps {
|
|
2
2
|
/**
|
|
3
3
|
* Studio origin, for the deep links and for the script itself. Defaults to
|
|
4
|
-
* `https://
|
|
5
|
-
* `NEXT_PUBLIC_BCMS_STUDIO_URL
|
|
4
|
+
* `https://bettercms.ai` — the same origin the dashboard hands out as
|
|
5
|
+
* `NEXT_PUBLIC_BCMS_STUDIO_URL`, confirmed canonical 2026-08-16.
|
|
6
|
+
* (`dashboard.bettercms.ai` resolves but 404s; `demo.bettercms.ai` still serves
|
|
7
|
+
* but is a stale alias we no longer hand out.)
|
|
6
8
|
*/
|
|
7
9
|
studioUrl?: string;
|
|
8
10
|
}
|
package/dist/visual-editing.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
// src/visual-editing.tsx
|
|
5
5
|
import { useEffect } from "react";
|
|
6
|
-
function VisualEditing({ studioUrl = "https://
|
|
6
|
+
function VisualEditing({ studioUrl = "https://bettercms.ai" }) {
|
|
7
7
|
useEffect(() => {
|
|
8
8
|
const src = `${studioUrl.replace(/\/+$/, "")}/bcms-visual-editing.js`;
|
|
9
9
|
if (document.querySelector(`script[src="${src}"]`)) return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/visual-editing.tsx"],"sourcesContent":["\"use client\";\n/**\n * <VisualEditing> — click-to-edit overlay for draft preview. Alt+Click any value that\n * carries stega provenance to open the matching dashboard editor on that field.\n * Render it only in draft mode.\n *\n * import { VisualEditing } from \"@bettercms-ai/next/visual-editing\";\n * {isDraft && <VisualEditing studioUrl=\"https://
|
|
1
|
+
{"version":3,"sources":["../src/visual-editing.tsx"],"sourcesContent":["\"use client\";\n/**\n * <VisualEditing> — click-to-edit overlay for draft preview. Alt+Click any value that\n * carries stega provenance to open the matching dashboard editor on that field.\n * Render it only in draft mode.\n *\n * import { VisualEditing } from \"@bettercms-ai/next/visual-editing\";\n * {isDraft && <VisualEditing studioUrl=\"https://bettercms.ai\" />}\n *\n * The decoder is NOT bundled here. It is one script served from the dashboard origin\n * (`/bcms-visual-editing.js`), shared with @bettercms-ai/astro and with plain-HTML sites\n * that install it by hand — a customer build is un-upgradable, so a copy baked into one\n * could never be fixed. Requires the read client to be in draft perspective with\n * `stega: true`; on a published build there is no provenance and the script is inert.\n */\nimport { useEffect } from \"react\";\n\nexport interface VisualEditingProps {\n /**\n * Studio origin, for the deep links and for the script itself. Defaults to\n * `https://bettercms.ai` — the same origin the dashboard hands out as\n * `NEXT_PUBLIC_BCMS_STUDIO_URL`, confirmed canonical 2026-08-16.\n * (`dashboard.bettercms.ai` resolves but 404s; `demo.bettercms.ai` still serves\n * but is a stale alias we no longer hand out.)\n */\n studioUrl?: string;\n}\n\nexport function VisualEditing({ studioUrl = \"https://bettercms.ai\" }: VisualEditingProps) {\n useEffect(() => {\n const src = `${studioUrl.replace(/\\/+$/, \"\")}/bcms-visual-editing.js`;\n if (document.querySelector(`script[src=\"${src}\"]`)) return;\n const el = document.createElement(\"script\");\n el.src = src;\n el.defer = true;\n el.dataset.bcmsStudio = studioUrl;\n document.head.appendChild(el);\n // No cleanup: removing the tag would not detach the listeners the script installed,\n // so a remove-and-remount would leave one set orphaned and add a second. The tag is\n // its own guard instead — this component is mounted once, in a draft-mode layout.\n }, [studioUrl]);\n return null;\n}\n"],"mappings":";;;;AAeA,SAAS,iBAAiB;AAanB,SAAS,cAAc,EAAE,YAAY,uBAAuB,GAAuB;AACxF,YAAU,MAAM;AACd,UAAM,MAAM,GAAG,UAAU,QAAQ,QAAQ,EAAE,CAAC;AAC5C,QAAI,SAAS,cAAc,eAAe,GAAG,IAAI,EAAG;AACpD,UAAM,KAAK,SAAS,cAAc,QAAQ;AAC1C,OAAG,MAAM;AACT,OAAG,QAAQ;AACX,OAAG,QAAQ,aAAa;AACxB,aAAS,KAAK,YAAY,EAAE;AAAA,EAI9B,GAAG,CAAC,SAAS,CAAC;AACd,SAAO;AACT;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bettercms-ai/next",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "The BetterCMS adapter for Next.js — typed, cache-aware content reads (getEntry/listEntries), draft preview, build-time content snapshot, and llms.txt generation for the App Router. The /blocks, /form, /field, /search and /visual-editing entries are framework-free React and work in any React app (see the React+TS starter), which is why `next` is an OPTIONAL peer.",
|
|
6
6
|
"bin": {
|
|
@@ -40,6 +40,11 @@
|
|
|
40
40
|
"types": "./dist/visual-editing.d.ts",
|
|
41
41
|
"import": "./dist/visual-editing.js",
|
|
42
42
|
"default": "./dist/visual-editing.js"
|
|
43
|
+
},
|
|
44
|
+
"./draft-bridge": {
|
|
45
|
+
"types": "./dist/draft-bridge.d.ts",
|
|
46
|
+
"import": "./dist/draft-bridge.js",
|
|
47
|
+
"default": "./dist/draft-bridge.js"
|
|
43
48
|
}
|
|
44
49
|
},
|
|
45
50
|
"files": [
|
|
@@ -54,9 +59,9 @@
|
|
|
54
59
|
},
|
|
55
60
|
"dependencies": {
|
|
56
61
|
"@bettercms-ai/image-url": "^0.2.0",
|
|
57
|
-
"@bettercms-ai/sdk": "^1.
|
|
58
|
-
"@bettercms-ai/types": "^1.
|
|
59
|
-
"@bettercms-ai/ui": "^0.
|
|
62
|
+
"@bettercms-ai/sdk": "^1.13.0",
|
|
63
|
+
"@bettercms-ai/types": "^1.11.0",
|
|
64
|
+
"@bettercms-ai/ui": "^0.6.0"
|
|
60
65
|
},
|
|
61
66
|
"peerDependencies": {
|
|
62
67
|
"next": ">=14",
|