@bettercms-ai/next 0.34.0 → 0.36.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/dist/bettercms-snapshot.js +5 -2
- package/dist/bettercms-snapshot.js.map +1 -1
- package/dist/elements.d.ts +56 -2
- package/dist/elements.js +56 -37
- package/dist/elements.js.map +1 -1
- package/dist/index.d.ts +22 -24
- package/dist/index.js +20 -45
- package/dist/index.js.map +1 -1
- package/dist/live.d.ts +4 -20
- package/dist/live.js +2 -39
- package/dist/live.js.map +1 -1
- package/dist/section-root-_bk8G5ry.d.ts +44 -0
- package/dist/sections.d.ts +2 -24
- package/dist/visual-editing.js +2 -9
- package/dist/visual-editing.js.map +1 -1
- package/package.json +3 -3
package/dist/live.d.ts
CHANGED
|
@@ -1,22 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
slug: string;
|
|
5
|
-
reason: "publish" | "unpublish" | "draft";
|
|
6
|
-
/** Cache tags, `bcms:{ws}:all` + `bcms:{ws}:{type}:{slug}`. */
|
|
7
|
-
tags: string[];
|
|
8
|
-
projectId: string | null;
|
|
9
|
-
/** When the change was committed. */
|
|
10
|
-
at: string;
|
|
11
|
-
/** When the server flushed this frame — `at`→`sentAt` is its own cost. */
|
|
12
|
-
sentAt?: string;
|
|
13
|
-
/**
|
|
14
|
-
* The finished delivery payload. Absent on `unpublish`, and when the server
|
|
15
|
-
* could not hydrate it (over quota, deleted, larger than the frame cap) — in
|
|
16
|
-
* which case the client has to refetch, which is what it always used to do.
|
|
17
|
-
*/
|
|
18
|
-
doc?: T;
|
|
19
|
-
}
|
|
1
|
+
import { BcmsChangeEvent } from '@bettercms-ai/sdk/live';
|
|
2
|
+
export { BcmsChangeEvent } from '@bettercms-ai/sdk/live';
|
|
3
|
+
|
|
20
4
|
/** Raw subscription. `onChange` may change identity freely — it is read via a ref. */
|
|
21
5
|
declare function useBcmsLive(src: string, onChange: (e: BcmsChangeEvent) => void): void;
|
|
22
6
|
interface BcmsLiveProps {
|
|
@@ -60,4 +44,4 @@ interface UseBcmsLiveEntryOptions {
|
|
|
60
44
|
*/
|
|
61
45
|
declare function useBcmsLiveEntry<T>(initial: T, opts: UseBcmsLiveEntryOptions): T;
|
|
62
46
|
|
|
63
|
-
export {
|
|
47
|
+
export { BcmsLive, type BcmsLiveProps, type UseBcmsLiveEntryOptions, useBcmsLive, useBcmsLiveEntry };
|
package/dist/live.js
CHANGED
|
@@ -4,34 +4,7 @@
|
|
|
4
4
|
// src/live.tsx
|
|
5
5
|
import { useEffect, useRef, useState } from "react";
|
|
6
6
|
import { useRouter } from "next/navigation";
|
|
7
|
-
|
|
8
|
-
function subscribe(src, fn) {
|
|
9
|
-
let pool = pools.get(src);
|
|
10
|
-
if (!pool) {
|
|
11
|
-
const es = new EventSource(src);
|
|
12
|
-
pool = { es, listeners: /* @__PURE__ */ new Set() };
|
|
13
|
-
es.addEventListener("change", (e) => {
|
|
14
|
-
let parsed;
|
|
15
|
-
try {
|
|
16
|
-
parsed = JSON.parse(e.data);
|
|
17
|
-
} catch {
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
for (const l of pools.get(src)?.listeners ?? []) l(parsed);
|
|
21
|
-
});
|
|
22
|
-
pools.set(src, pool);
|
|
23
|
-
}
|
|
24
|
-
pool.listeners.add(fn);
|
|
25
|
-
return () => {
|
|
26
|
-
const p = pools.get(src);
|
|
27
|
-
if (!p) return;
|
|
28
|
-
p.listeners.delete(fn);
|
|
29
|
-
if (p.listeners.size === 0) {
|
|
30
|
-
p.es.close();
|
|
31
|
-
pools.delete(src);
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
}
|
|
7
|
+
import { onCanvasRefresh, subscribeLive as subscribe } from "@bettercms-ai/sdk/live";
|
|
35
8
|
function useBcmsLive(src, onChange) {
|
|
36
9
|
const cb = useRef(onChange);
|
|
37
10
|
useEffect(() => {
|
|
@@ -46,17 +19,7 @@ function BcmsLive({ src, refreshOnChange = true, tags, onChange }) {
|
|
|
46
19
|
onChange?.(event);
|
|
47
20
|
if (refreshOnChange) router.refresh();
|
|
48
21
|
});
|
|
49
|
-
useEffect(() =>
|
|
50
|
-
if (window.parent === window) return;
|
|
51
|
-
const onMessage = (e) => {
|
|
52
|
-
if (e.origin !== window.location.origin || e.source !== window.parent) return;
|
|
53
|
-
if (e.data?.type !== "bcms:refresh") return;
|
|
54
|
-
window.parent.postMessage({ type: "bcms:refreshed" }, e.origin);
|
|
55
|
-
router.refresh();
|
|
56
|
-
};
|
|
57
|
-
window.addEventListener("message", onMessage);
|
|
58
|
-
return () => window.removeEventListener("message", onMessage);
|
|
59
|
-
}, [router]);
|
|
22
|
+
useEffect(() => onCanvasRefresh(() => router.refresh()), [router]);
|
|
60
23
|
return null;
|
|
61
24
|
}
|
|
62
25
|
function useBcmsLiveEntry(initial, opts) {
|
package/dist/live.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/live.tsx"],"sourcesContent":["\"use client\";\n/**\n * Live content for the App Router — the client half of the delivery SSE lane.\n *\n * The stream pushes the CHANGED DOCUMENT, not just a pointer to it (see the\n * backend's routes/delivery/live.ts), which is what makes the two exports here\n * differ in cost:\n *\n * <BcmsLive> refetches — `router.refresh()`, one RSC round trip.\n * useBcmsLiveEntry() patches — swaps in the pushed doc, ZERO round trips.\n *\n * Prefer the hook on anything that updates often. Keep `<BcmsLive>` for pages\n * rendered entirely on the server, where there is no client state to patch.\n *\n * import { BcmsLive, useBcmsLiveEntry } from \"@bettercms-ai/next/live\";\n * import { defineBetterCMSLive } from \"@bettercms-ai/next\";\n * const { liveSrc } = defineBetterCMSLive({ apiUrl, workspace, apiKey });\n * // in layout.tsx: <BcmsLive src={liveSrc} />\n *\n * `src` embeds a content:read key as a query param because browser EventSource\n * cannot send headers — use a read-only key.\n */\nimport { useEffect, useRef, useState } from \"react\";\nimport { useRouter } from \"next/navigation\";\
|
|
1
|
+
{"version":3,"sources":["../src/live.tsx"],"sourcesContent":["\"use client\";\n/**\n * Live content for the App Router — the client half of the delivery SSE lane.\n *\n * The stream pushes the CHANGED DOCUMENT, not just a pointer to it (see the\n * backend's routes/delivery/live.ts), which is what makes the two exports here\n * differ in cost:\n *\n * <BcmsLive> refetches — `router.refresh()`, one RSC round trip.\n * useBcmsLiveEntry() patches — swaps in the pushed doc, ZERO round trips.\n *\n * Prefer the hook on anything that updates often. Keep `<BcmsLive>` for pages\n * rendered entirely on the server, where there is no client state to patch.\n *\n * import { BcmsLive, useBcmsLiveEntry } from \"@bettercms-ai/next/live\";\n * import { defineBetterCMSLive } from \"@bettercms-ai/next\";\n * const { liveSrc } = defineBetterCMSLive({ apiUrl, workspace, apiKey });\n * // in layout.tsx: <BcmsLive src={liveSrc} />\n *\n * `src` embeds a content:read key as a query param because browser EventSource\n * cannot send headers — use a read-only key.\n */\nimport { useEffect, useRef, useState } from \"react\";\nimport { useRouter } from \"next/navigation\";\nimport { onCanvasRefresh, subscribeLive as subscribe, type BcmsChangeEvent } from \"@bettercms-ai/sdk/live\";\n\nexport type { BcmsChangeEvent };\n\n/** Raw subscription. `onChange` may change identity freely — it is read via a ref. */\nexport function useBcmsLive(src: string, onChange: (e: BcmsChangeEvent) => void): void {\n const cb = useRef(onChange);\n // Kept current in an effect, not during render: this hook's callers pass inline\n // arrows, and a render-phase write is the one thing that misbehaves under\n // StrictMode double-rendering. Declared first, so it lands before the subscribe.\n useEffect(() => {\n cb.current = onChange;\n });\n useEffect(() => subscribe(src, (e) => cb.current(e)), [src]);\n}\n\nexport interface BcmsLiveProps {\n /** Live SSE URL, e.g. from `defineBetterCMSLive().liveSrc`. */\n src: string;\n /** Refresh the route on each matching change. Default true. */\n refreshOnChange?: boolean;\n /**\n * Only react to changes touching one of these tags. Omit to react to\n * everything (the old behaviour). A blog post page passing its own tag stops\n * re-rendering every time an unrelated entry elsewhere is published.\n */\n tags?: string[];\n /** Called for every matching change, with the pushed `doc` when there is one. */\n onChange?: (event: BcmsChangeEvent) => void;\n}\n\nexport function BcmsLive({ src, refreshOnChange = true, tags, onChange }: BcmsLiveProps) {\n const router = useRouter();\n useBcmsLive(src, (event) => {\n if (tags?.length && !event.tags.some((t) => tags.includes(t))) return;\n onChange?.(event);\n if (refreshOnChange) router.refresh();\n });\n\n /**\n * Soft refresh for the BetterCMS canvas: the editor asks only after a STRUCTURAL write and\n * waits for the ack (see onCanvasRefresh in @bettercms-ai/sdk/live).\n */\n useEffect(() => onCanvasRefresh(() => router.refresh()), [router]);\n\n return null;\n}\n\nexport interface UseBcmsLiveEntryOptions {\n /** Live SSE URL, e.g. from `defineBetterCMSLive().liveSrc`. */\n src: string;\n /** The slug this component renders. */\n slug: string;\n /** Default \"entry\". */\n type?: \"entry\" | \"page\";\n /**\n * What to do when the resource is unpublished, or when the server pushed no\n * doc and a refetch is the only way forward. Default: leave the last value in\n * place (a live site keeps showing the last good render).\n */\n onStale?: (event: BcmsChangeEvent) => void;\n}\n\n/**\n * Server-render once, stay live for free.\n *\n * Seed it with the entry you already fetched on the server; it returns that\n * value until a matching change arrives, then returns the pushed document.\n * No refetch, no route re-render — the update costs one repaint.\n *\n * const post = useBcmsLiveEntry(initialPost, { src: liveSrc, slug: params.slug });\n * return <article>{post.data.title}</article>;\n */\nexport function useBcmsLiveEntry<T>(initial: T, opts: UseBcmsLiveEntryOptions): T {\n const { src, slug, type = \"entry\", onStale } = opts;\n const [value, setValue] = useState<T>(initial);\n\n // A navigation to a different slug re-renders with a new `initial`; without this\n // the hook would keep serving the previous route's document.\n const seeded = useRef(initial);\n if (seeded.current !== initial) {\n seeded.current = initial;\n setValue(initial);\n }\n\n const stale = useRef(onStale);\n useEffect(() => {\n stale.current = onStale;\n });\n\n useBcmsLive(src, (event) => {\n if (event.slug !== slug || event.type !== type) return;\n if (event.doc !== undefined) setValue(event.doc as T);\n else stale.current?.(event);\n });\n\n return value;\n}\n"],"mappings":";;;;AAsBA,SAAS,WAAW,QAAQ,gBAAgB;AAC5C,SAAS,iBAAiB;AAC1B,SAAS,iBAAiB,iBAAiB,iBAAuC;AAK3E,SAAS,YAAY,KAAa,UAA8C;AACrF,QAAM,KAAK,OAAO,QAAQ;AAI1B,YAAU,MAAM;AACd,OAAG,UAAU;AAAA,EACf,CAAC;AACD,YAAU,MAAM,UAAU,KAAK,CAAC,MAAM,GAAG,QAAQ,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;AAC7D;AAiBO,SAAS,SAAS,EAAE,KAAK,kBAAkB,MAAM,MAAM,SAAS,GAAkB;AACvF,QAAM,SAAS,UAAU;AACzB,cAAY,KAAK,CAAC,UAAU;AAC1B,QAAI,MAAM,UAAU,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,EAAG;AAC/D,eAAW,KAAK;AAChB,QAAI,gBAAiB,QAAO,QAAQ;AAAA,EACtC,CAAC;AAMD,YAAU,MAAM,gBAAgB,MAAM,OAAO,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC;AAEjE,SAAO;AACT;AA2BO,SAAS,iBAAoB,SAAY,MAAkC;AAChF,QAAM,EAAE,KAAK,MAAM,OAAO,SAAS,QAAQ,IAAI;AAC/C,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAY,OAAO;AAI7C,QAAM,SAAS,OAAO,OAAO;AAC7B,MAAI,OAAO,YAAY,SAAS;AAC9B,WAAO,UAAU;AACjB,aAAS,OAAO;AAAA,EAClB;AAEA,QAAM,QAAQ,OAAO,OAAO;AAC5B,YAAU,MAAM;AACd,UAAM,UAAU;AAAA,EAClB,CAAC;AAED,cAAY,KAAK,CAAC,UAAU;AAC1B,QAAI,MAAM,SAAS,QAAQ,MAAM,SAAS,KAAM;AAChD,QAAI,MAAM,QAAQ,OAAW,UAAS,MAAM,GAAQ;AAAA,QAC/C,OAAM,UAAU,KAAK;AAAA,EAC5B,CAAC;AAED,SAAO;AACT;","names":[]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import { BlockStyle } from '@bettercms-ai/types';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* C3/C4 — `sectionRootAttrs(block)`: the props a site's OWN section root spreads so the
|
|
6
|
+
* BetterCMS editor offers that section's spacing and style handles.
|
|
7
|
+
*
|
|
8
|
+
* <section className="hero" {...sectionRootAttrs(block)}>…</section>
|
|
9
|
+
*
|
|
10
|
+
* The editor shows those handles on a site-rendered page only when EVERY root the site stamps
|
|
11
|
+
* with `data-bcms-block` also carries `data-bcms-style`, which is the site's promise that "this
|
|
12
|
+
* root's inline style is `blockStyleToCss(block.style)`" — the same declarations `<BcmsBlocks>`
|
|
13
|
+
* puts on its own wrapper. The marker is present even when the style is EMPTY (then there is no
|
|
14
|
+
* `style` prop at all): an unstyled section is the one an author is about to give its first
|
|
15
|
+
* spacing edit. Twin: `sectionRootAttrs` in @bettercms-ai/astro (style as a string there).
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
interface SectionRootBlock {
|
|
19
|
+
id?: string | null;
|
|
20
|
+
style?: BlockStyle | Record<string, unknown> | null;
|
|
21
|
+
}
|
|
22
|
+
interface SectionRootAttrs {
|
|
23
|
+
"data-bcms-block"?: string;
|
|
24
|
+
"data-bcms-style": "";
|
|
25
|
+
/** `"mobile tablet"` when `style.hideOn` hides it there; the site ships `RESPONSIVE_CSS` for it. */
|
|
26
|
+
"data-bcms-hide"?: string;
|
|
27
|
+
/** `blockStyleToCss(block.style)`; absent when the block has no style. */
|
|
28
|
+
style?: CSSProperties;
|
|
29
|
+
}
|
|
30
|
+
declare function sectionRootAttrs(block: SectionRootBlock | null | undefined): SectionRootAttrs;
|
|
31
|
+
interface SectionColumnAttrs {
|
|
32
|
+
"data-bcms-column": "";
|
|
33
|
+
/** `blockStyleToColumnCss(block.style)`; absent when the section has no column. */
|
|
34
|
+
style?: CSSProperties;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* C3 — `sectionColumnAttrs(block)`: the props a site's own INNER container spreads so the section's
|
|
38
|
+
* content WIDTH ships (`style.contentWidth`, placed by `contentAlign`). The column BetterCMS draws as
|
|
39
|
+
* `.bcms-block-inner`, never on the root (its background stays full-bleed); `data-bcms-column` is the
|
|
40
|
+
* site's promise that this box's inline style is that column. Twin: @bettercms-ai/astro.
|
|
41
|
+
*/
|
|
42
|
+
declare function sectionColumnAttrs(block: SectionRootBlock | null | undefined): SectionColumnAttrs;
|
|
43
|
+
|
|
44
|
+
export { type SectionColumnAttrs as S, type SectionRootAttrs as a, type SectionRootBlock as b, sectionRootAttrs as c, sectionColumnAttrs as s };
|
package/dist/sections.d.ts
CHANGED
|
@@ -1,29 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReactNode, ReactElement } from 'react';
|
|
2
2
|
import { ContentBlock, DeliveryComponent } from '@bettercms-ai/types';
|
|
3
3
|
import { DeliveryForm } from '@bettercms-ai/sdk';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* C3/C4 — `sectionRootAttrs(block)`: the props a site's OWN section root spreads so the
|
|
7
|
-
* BetterCMS editor offers that section's spacing and style handles.
|
|
8
|
-
*
|
|
9
|
-
* <section className="hero" {...sectionRootAttrs(block)}>…</section>
|
|
10
|
-
*
|
|
11
|
-
* The editor shows those handles on a site-rendered page only when EVERY root the site stamps
|
|
12
|
-
* with `data-bcms-block` also carries `data-bcms-style`, which is the site's promise that "this
|
|
13
|
-
* root's inline style is `blockStyleToCss(block.style)`" — the same declarations `<BcmsBlocks>`
|
|
14
|
-
* puts on its own wrapper. The marker is present even when the style is EMPTY (then there is no
|
|
15
|
-
* `style` prop at all): an unstyled section is the one an author is about to give its first
|
|
16
|
-
* spacing edit. Twin: `sectionRootAttrs` in @bettercms-ai/astro (style as a string there).
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
interface SectionRootAttrs {
|
|
20
|
-
"data-bcms-block"?: string;
|
|
21
|
-
"data-bcms-style": "";
|
|
22
|
-
/** `"mobile tablet"` when `style.hideOn` hides it there; the site ships `RESPONSIVE_CSS` for it. */
|
|
23
|
-
"data-bcms-hide"?: string;
|
|
24
|
-
/** `blockStyleToCss(block.style)`; absent when the block has no style. */
|
|
25
|
-
style?: CSSProperties;
|
|
26
|
-
}
|
|
4
|
+
import { a as SectionRootAttrs } from './section-root-_bk8G5ry.js';
|
|
27
5
|
|
|
28
6
|
/**
|
|
29
7
|
* <BcmsSections> — a code-built page's sections, in the order its CMS page lists them.
|
package/dist/visual-editing.js
CHANGED
|
@@ -3,16 +3,9 @@
|
|
|
3
3
|
|
|
4
4
|
// src/visual-editing.tsx
|
|
5
5
|
import { useEffect } from "react";
|
|
6
|
+
import { loadVisualEditing } from "@bettercms-ai/sdk/live";
|
|
6
7
|
function VisualEditing({ studioUrl = "https://bettercms.ai" }) {
|
|
7
|
-
useEffect(() =>
|
|
8
|
-
const src = `${studioUrl.replace(/\/+$/, "")}/bcms-visual-editing.js`;
|
|
9
|
-
if (document.querySelector(`script[src="${src}"]`)) return;
|
|
10
|
-
const el = document.createElement("script");
|
|
11
|
-
el.src = src;
|
|
12
|
-
el.defer = true;
|
|
13
|
-
el.dataset.bcmsStudio = studioUrl;
|
|
14
|
-
document.head.appendChild(el);
|
|
15
|
-
}, [studioUrl]);
|
|
8
|
+
useEffect(() => loadVisualEditing(studioUrl), [studioUrl]);
|
|
16
9
|
return null;
|
|
17
10
|
}
|
|
18
11
|
export {
|
|
@@ -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://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
|
|
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\";\nimport { loadVisualEditing } from \"@bettercms-ai/sdk/live\";\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 // The tag is its own guard (see loadVisualEditing): this component is mounted once, in a\n // draft-mode layout, and never removes it.\n useEffect(() => loadVisualEditing(studioUrl), [studioUrl]);\n return null;\n}\n"],"mappings":";;;;AAeA,SAAS,iBAAiB;AAC1B,SAAS,yBAAyB;AAa3B,SAAS,cAAc,EAAE,YAAY,uBAAuB,GAAuB;AAGxF,YAAU,MAAM,kBAAkB,SAAS,GAAG,CAAC,SAAS,CAAC;AACzD,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.36.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": {
|
|
@@ -70,8 +70,8 @@
|
|
|
70
70
|
"dependencies": {
|
|
71
71
|
"@bettercms-ai/icons": "^0.4.0",
|
|
72
72
|
"@bettercms-ai/image-url": "^0.4.0",
|
|
73
|
-
"@bettercms-ai/richtext": "^0.17.
|
|
74
|
-
"@bettercms-ai/sdk": "^1.
|
|
73
|
+
"@bettercms-ai/richtext": "^0.17.1",
|
|
74
|
+
"@bettercms-ai/sdk": "^1.40.0",
|
|
75
75
|
"@bettercms-ai/types": "^1.60.0",
|
|
76
76
|
"@bettercms-ai/ui": "^0.26.0",
|
|
77
77
|
"react-phone-number-input": "^3.4.18"
|