@bettercms-ai/next 0.36.3 → 0.39.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.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/config.ts"],"sourcesContent":["/**\n * withBetterCMS — wrap the site's Next config so `next/image` may optimize BetterCMS media.\n *\n * // next.config.ts\n * import { withBetterCMS } from \"@bettercms-ai/next/config\";\n * export default withBetterCMS(nextConfig);\n *\n * A CMS image is a remote URL (`https://cdn.bettercms.ai/media/<id>/<file>?v=1`), and Next refuses\n * to optimize a host `images.remotePatterns` does not list. This adds the media host\n * (`cdn.bettercms.ai`, and `NEXT_PUBLIC_BCMS_MEDIA_URL` when the site serves media from its own),\n * after the site's own patterns, once each. Nothing else in the config is touched; a config written\n * as a function (`(phase) => config`) is wrapped and its result merged.\n *\n * Its own entry, with a CommonJS build beside the ESM one: Next loads `next.config.ts` as CommonJS\n * (`require`) unless the Node TypeScript loader is on, and `next.config.mjs` with `import`.\n */\nexport const BCMS_MEDIA_URL = \"https://cdn.bettercms.ai\";\n\ninterface RemotePattern {\n protocol?: \"http\" | \"https\";\n hostname: string;\n port?: string;\n pathname?: string;\n search?: string;\n}\n\n/** The media origins `next/image` must accept: ours, and the site's own media host when it names one. */\nexport function mediaRemotePatterns(env: Record<string, string | undefined> = process.env): RemotePattern[] {\n const patterns: RemotePattern[] = [];\n for (const raw of [BCMS_MEDIA_URL, env.NEXT_PUBLIC_BCMS_MEDIA_URL]) {\n let url: URL;\n try {\n url = new URL(raw ?? \"\");\n } catch {\n continue;\n }\n if (url.protocol !== \"https:\" && url.protocol !== \"http:\") continue;\n // No `search`: a media URL carries its version (`?v=1`), and an absent key matches any query.\n const pattern: RemotePattern = { protocol: url.protocol === \"https:\" ? \"https\" : \"http\", hostname: url.hostname, port: url.port, pathname: `${url.pathname.replace(/\\/+$/, \"\")}/**` };\n if (!patterns.some((p) => keyOf(p) === keyOf(pattern))) patterns.push(pattern);\n }\n return patterns;\n}\n\n/** What makes two patterns the same allowance. A `URL` pattern (Next 15.3+) is read the same way. */\nfunction keyOf(pattern: unknown): string {\n if (pattern instanceof URL) return [pattern.protocol.replace(/:$/, \"\"), pattern.hostname, pattern.port, pattern.pathname].join(\"|\");\n const p = (pattern ?? {}) as Partial<RemotePattern>;\n return [p.protocol ?? \"\", p.hostname ?? \"\", p.port ?? \"\", p.pathname ?? \"\"].join(\"|\");\n}\n\ntype ConfigObject = { images?: { remotePatterns?: unknown[] } & Record<string, unknown> } & Record<string, unknown>;\n\nfunction merged(config: ConfigObject | null | undefined): ConfigObject {\n const own = config?.images?.remotePatterns ?? [];\n const seen = new Set(own.map(keyOf));\n const added = mediaRemotePatterns().filter((p) => !seen.has(keyOf(p)));\n return { ...config, images: { ...config?.images, remotePatterns: [...own, ...added] } };\n}\n\n/** The config, with BetterCMS media allowed for `next/image`. Same type in, same type out. */\nexport function withBetterCMS<C>(config: C): C {\n if (typeof config === \"function\") {\n const fn = config as (...args: unknown[]) => ConfigObject | Promise<ConfigObject>;\n return (async (...args: unknown[]) => merged(await fn(...args))) as C;\n }\n return merged(config as ConfigObject) as C;\n}\n"],"mappings":";AAgBO,IAAM,iBAAiB;AAWvB,SAAS,oBAAoB,MAA0C,QAAQ,KAAsB;AAC1G,QAAM,WAA4B,CAAC;AACnC,aAAW,OAAO,CAAC,gBAAgB,IAAI,0BAA0B,GAAG;AAClE,QAAI;AACJ,QAAI;AACF,YAAM,IAAI,IAAI,OAAO,EAAE;AAAA,IACzB,QAAQ;AACN;AAAA,IACF;AACA,QAAI,IAAI,aAAa,YAAY,IAAI,aAAa,QAAS;AAE3D,UAAM,UAAyB,EAAE,UAAU,IAAI,aAAa,WAAW,UAAU,QAAQ,UAAU,IAAI,UAAU,MAAM,IAAI,MAAM,UAAU,GAAG,IAAI,SAAS,QAAQ,QAAQ,EAAE,CAAC,MAAM;AACpL,QAAI,CAAC,SAAS,KAAK,CAAC,MAAM,MAAM,CAAC,MAAM,MAAM,OAAO,CAAC,EAAG,UAAS,KAAK,OAAO;AAAA,EAC/E;AACA,SAAO;AACT;AAGA,SAAS,MAAM,SAA0B;AACvC,MAAI,mBAAmB,IAAK,QAAO,CAAC,QAAQ,SAAS,QAAQ,MAAM,EAAE,GAAG,QAAQ,UAAU,QAAQ,MAAM,QAAQ,QAAQ,EAAE,KAAK,GAAG;AAClI,QAAM,IAAK,WAAW,CAAC;AACvB,SAAO,CAAC,EAAE,YAAY,IAAI,EAAE,YAAY,IAAI,EAAE,QAAQ,IAAI,EAAE,YAAY,EAAE,EAAE,KAAK,GAAG;AACtF;AAIA,SAAS,OAAO,QAAuD;AACrE,QAAM,MAAM,QAAQ,QAAQ,kBAAkB,CAAC;AAC/C,QAAM,OAAO,IAAI,IAAI,IAAI,IAAI,KAAK,CAAC;AACnC,QAAM,QAAQ,oBAAoB,EAAE,OAAO,CAAC,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,CAAC,CAAC;AACrE,SAAO,EAAE,GAAG,QAAQ,QAAQ,EAAE,GAAG,QAAQ,QAAQ,gBAAgB,CAAC,GAAG,KAAK,GAAG,KAAK,EAAE,EAAE;AACxF;AAGO,SAAS,cAAiB,QAAc;AAC7C,MAAI,OAAO,WAAW,YAAY;AAChC,UAAM,KAAK;AACX,YAAQ,UAAU,SAAoB,OAAO,MAAM,GAAG,GAAG,IAAI,CAAC;AAAA,EAChE;AACA,SAAO,OAAO,MAAsB;AACtC;","names":[]}
@@ -51,6 +51,13 @@ interface BcmsButtonProps {
51
51
  }
52
52
  declare function BcmsButton({ path, value, className }: BcmsButtonProps): react_jsx_runtime.JSX.Element | null;
53
53
 
54
+ interface BcmsIconProps {
55
+ /** The stored icon value: a set name, an image URL or an icon object. */
56
+ value: unknown;
57
+ className?: string;
58
+ }
59
+ declare function BcmsIcon({ value, className }: BcmsIconProps): react_jsx_runtime.JSX.Element | null;
60
+
54
61
  /**
55
62
  * C3 — `fieldAttrs(path, fieldStyles)`: the props a site's OWN element spreads to bind a PAGE FIELD
56
63
  * and apply that field's stored style, so the BetterCMS editor offers its width and spacing handles
@@ -102,4 +109,4 @@ declare function entryField(entry: EntryRef, path: string, opts?: {
102
109
  transform?: EntryTransform;
103
110
  }): EntryFieldAttrs;
104
111
 
105
- export { BcmsButton, type BcmsButtonProps, BcmsField, type BcmsFieldProps, BcmsImage, type BcmsImageProps, type EntryFieldAttrs, type EntryRef, type EntryTransform, type FieldAttrs, entryAttrs, entryField, fieldAttrs, fieldStyleOf };
112
+ export { BcmsButton, type BcmsButtonProps, BcmsField, type BcmsFieldProps, BcmsIcon, type BcmsIconProps, BcmsImage, type BcmsImageProps, type EntryFieldAttrs, type EntryRef, type EntryTransform, type FieldAttrs, entryAttrs, entryField, fieldAttrs, fieldStyleOf };
package/dist/elements.js CHANGED
@@ -92,6 +92,26 @@ function BcmsButton({ path, value, className }) {
92
92
  );
93
93
  }
94
94
 
95
+ // src/icon.tsx
96
+ import { iconSrc } from "@bettercms-ai/types";
97
+ import { ICON_MARKUP as ICON_MARKUP2, ICON_VIEWBOX as ICON_VIEWBOX2 } from "@bettercms-ai/icons/markup";
98
+ import { jsx as jsx4 } from "react/jsx-runtime";
99
+ function BcmsIcon({ value, className }) {
100
+ const src = iconSrc(value);
101
+ if (!src) return null;
102
+ const a11y = src.label ? { role: "img", "aria-label": src.label } : { "aria-hidden": true };
103
+ if ("name" in src) {
104
+ const markup = ICON_MARKUP2[src.name];
105
+ if (!markup) return null;
106
+ return /* @__PURE__ */ jsx4("svg", { "data-bcms-icon": src.name, className, viewBox: ICON_VIEWBOX2, width: "1em", height: "1em", fill: "none", focusable: "false", ...a11y, dangerouslySetInnerHTML: { __html: markup } });
107
+ }
108
+ if (src.followsText) {
109
+ const mask = `url(${JSON.stringify(src.url)}) center / contain no-repeat`;
110
+ return /* @__PURE__ */ jsx4("span", { "data-bcms-icon-url": src.url, className, style: { display: "inline-block", width: "1em", height: "1em", backgroundColor: "currentColor", mask, WebkitMask: mask }, ...a11y });
111
+ }
112
+ return /* @__PURE__ */ jsx4("img", { src: src.url, alt: src.label ?? "", className, width: 16, height: 16, style: { width: "1em", height: "1em", objectFit: "contain" } });
113
+ }
114
+
95
115
  // src/field-attrs.ts
96
116
  import { fieldStyleToCss } from "@bettercms-ai/types";
97
117
  function fieldStyleOf(path, fieldStyles) {
@@ -139,6 +159,7 @@ function sectionColumnAttrs(block) {
139
159
  export {
140
160
  BcmsButton,
141
161
  BcmsField,
162
+ BcmsIcon,
142
163
  BcmsImage,
143
164
  entryAttrs,
144
165
  entryField,
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/field.tsx","../src/image.tsx","../src/button.tsx","../src/field-attrs.ts","../src/section-root.ts"],"sourcesContent":["/**\n * <BcmsField> — tag an entry field's rendered value with its identity so the\n * BetterCMS visual editor can bind click-to-edit deterministically (mirrors\n * Sanity's `data-sanity` / BaseHub's `data-basehub`). Entry-backed templates\n * hand-render field values (`f.title`, `f.body.html`), so the field `path` is\n * declared here by the author — the delivery payload carries no source-map.\n *\n * Server-safe (no hooks): renders in a Next Server Component. When the child is ONE\n * DOM element (`<h1>`, `<p>`), the attributes go on that element and nothing is added to\n * the page: `.hero > h1` and every animation target stay what the author wrote. Text,\n * several children, or a component (which may not pass unknown props on) are wrapped in a\n * `display:contents` span as before; pass `as` to carry the attributes on a real wrapper.\n * Twin: BcmsField.astro in @bettercms-ai/astro.\n *\n * `path` follows the editor grammar: `title` · `hero.title` · `columns[0].links[2].href`\n * (dotted keys and any number of `[n]` indices). For images, put the attributes on the\n * `<img>` itself (`kind=\"image\"` reflection patches `.src`), not on a wrapper:\n * <img src={imageValueUrl(f.cover, { w: 1200 })} data-bcms-field=\"cover\" data-bcms-kind=\"image\" />\n * `imageValueUrl` (re-exported from this package) applies the value's per-placement `crop` and\n * `focal`; `.url` alone would drop them. For a cover-fit box add\n * `style={{ objectPosition: imageValueObjectPosition(f.cover) ?? undefined }}`.\n */\nimport { Children, cloneElement, isValidElement, type ElementType, type ReactElement, type ReactNode } from \"react\";\n\nexport interface BcmsFieldProps {\n /** Field path in the editor grammar, e.g. `title` or `facts[2].label`. */\n path: string;\n /** Kind hint the editor's reflection branches on. Omit for plain text/number. */\n kind?: \"richtext\" | \"image\";\n /** Wrapper element. Without it: no wrapper around a single DOM element, a `display:contents` span around anything else. */\n as?: ElementType;\n children: ReactNode;\n}\n\nexport function BcmsField({ path, kind, as, children }: BcmsFieldProps) {\n const Tag = as ?? \"span\";\n const only = as ? [] : Children.toArray(children);\n const sole = only.length === 1 && isValidElement(only[0]) && typeof only[0].type === \"string\" ? (only[0] as ReactElement<Record<string, unknown>>) : null;\n // An element that already declares a field keeps its own address: wrapped, as before.\n if (sole && sole.props[\"data-bcms-field\"] === undefined && sole.props[\"data-bcms-layout-field\"] === undefined) {\n return cloneElement(sole, { \"data-bcms-field\": path, \"data-bcms-kind\": kind });\n }\n return (\n <Tag\n data-bcms-field={path}\n data-bcms-kind={kind}\n style={as ? undefined : { display: \"contents\" }}\n >\n {children}\n </Tag>\n );\n}\n","/**\n * <BcmsImage> — render an image field as one responsive `<img>` on the BetterCMS media transform\n * endpoint, declared so the visual editor binds it and a publish writes the new picture into it.\n * The same markup as the Astro SDK's <BcmsImage>.\n *\n * <BcmsImage path=\"hero.image\" src={page.hero.image} sizes=\"(min-width: 800px) 50vw, 100vw\" />\n *\n * `src` is an image VALUE (`{ url, altText, width?, focal?, crop? }`), a media url or an asset id.\n * The value's per-placement crop and focal point ride every url, and the focal point is also the\n * `object-position` (inert without `object-fit`). With `sizes` and no `width` the srcset is a WIDTH\n * ladder, never wider than the picture; with a pixel `width` it is 1x/2x. The value's `altText` is\n * the alt unless `alt` says otherwise. Any other prop reaches the `<img>` as written.\n *\n * A plain `<img>`, deliberately: `next/image` refuses a remote host the app has not allow-listed,\n * so an editor's replacement would break the build. Server-safe (no hooks).\n */\nimport type { ImageFit, ImageFormat, ImageSource } from \"@bettercms-ai/image-url\";\nimport { imageCore } from \"@bettercms-ai/sdk/bindings\";\nimport type { CSSProperties, ImgHTMLAttributes } from \"react\";\n\n/** What delivery adds to an image value beside its url: the facts this component reads. */\ntype ImageFacts = { altText?: string | null; alt?: string | null; width?: number | null; height?: number | null; focalX?: number | null; focalY?: number | null };\n\nexport interface BcmsImageProps extends Omit<ImgHTMLAttributes<HTMLImageElement>, \"src\" | \"srcSet\" | \"width\" | \"height\"> {\n src: ImageSource | (Exclude<ImageSource, string> & ImageFacts);\n /** The field this image renders, in the editor grammar (`cover`, `hero.image`). */\n path?: string;\n width?: number;\n height?: number;\n format?: ImageFormat;\n quality?: number;\n fit?: ImageFit;\n /** Focal point override, 0–1. Normally omitted: the value and the asset carry their own. */\n focalX?: number | null;\n focalY?: number | null;\n /** Media host for a `src` that is only an asset id. Defaults to the platform's. */\n baseUrl?: string;\n}\n\n/** The widths a `sizes` image offers: phone to desktop, and never an upscale of the picture. */\nexport function BcmsImage({\n src,\n path,\n alt,\n width,\n height,\n format = \"webp\",\n quality,\n fit,\n sizes,\n loading = \"lazy\",\n focalX,\n focalY,\n baseUrl,\n style,\n ...rest\n}: BcmsImageProps) {\n const { src: src1x, srcset: srcSet, alt: resolvedAlt, css } = imageCore(src, { alt, width, height, format, quality, fit, sizes, focalX, focalY, baseUrl });\n const merged: CSSProperties = { ...css, ...style };\n\n return (\n <img\n src={src1x}\n srcSet={srcSet}\n alt={resolvedAlt}\n data-bcms-field={path}\n data-bcms-kind={path ? \"image\" : undefined}\n width={width}\n height={height}\n sizes={sizes}\n loading={loading}\n style={Object.keys(merged).length > 0 ? merged : undefined}\n {...rest}\n />\n );\n}\n","/**\n * <BcmsButton> — render a `button` field ({ label, href, variant?, size?, arrow?, icon?,\n * newTab?, fullWidth? }) as one editable button, with the hooks the BetterCMS visual editor repaints and\n * in-place publishing writes. The same markup as the Astro SDK's <BcmsButton>:\n *\n * <a data-bcms-button=\"<path>\" data-variant data-size [data-full-width] href [target rel] data-bcms-props=\"<path>.href|url|href\">\n * [<svg class=\"bcms-btn-icon\">]<span data-bcms-field=\"<path>.label\">Label</span>[<svg class=\"bcms-btn-arrow\">]\n * </a>\n *\n * A value with `action: \"code\"` (no href: the site's script handles the click) renders the same\n * children in `<button type=\"button\" data-bcms-button=\"<path>\" data-variant data-size>`.\n *\n * Style it by `data-variant` and `data-size` in your own CSS. A full-width button also carries\n * `display:flex;width:100%;justify-content:center` inline, so it stretches with no rule of yours.\n * Server-safe (no hooks).\n *\n * <BcmsButton path=\"hero.cta\" value={page.hero.cta} className=\"btn\" />\n */\nimport { formatPropsAttribute, readButtonValue } from \"@bettercms-ai/types\";\nimport { ICON_MARKUP, ICON_VIEWBOX } from \"@bettercms-ai/icons/markup\";\n\n/**\n * One icon as an `<svg>` drawn from the markup table the block renderer already ships, so a button\n * costs no per-icon module: the icon map pulled every icon into a client bundle.\n */\nconst ButtonIcon = ({ name, className }: { name: keyof typeof ICON_MARKUP; className: string }) => (\n <svg data-bcms-icon={name} className={className} viewBox={ICON_VIEWBOX} width=\"1em\" height=\"1em\" fill=\"none\" aria-hidden focusable=\"false\" dangerouslySetInnerHTML={{ __html: ICON_MARKUP[name] }} />\n);\n\n/** A full-width button stretches across its column, label centred: the hosted renderer's `bcms-btn-full`. */\nconst FULL_WIDTH_STYLE = { display: \"flex\", width: \"100%\", justifyContent: \"center\" } as const;\n\nexport interface BcmsButtonProps {\n /** The field path in the editor grammar, e.g. `cta` or `hero.cta`. */\n path: string;\n /** The stored value. Missing keys render as the defaults (Primary, medium, no arrow, no icon). */\n value: unknown;\n className?: string;\n}\n\nexport function BcmsButton({ path, value, className }: BcmsButtonProps) {\n const b = readButtonValue(value);\n if (!b.label) return null;\n const content = (\n <>\n {/* Direct children of the root, as the editor and in-place publishing find them. */}\n {b.icon && <ButtonIcon name={b.icon} className=\"bcms-btn-icon\" />}\n <span data-bcms-field={`${path}.label`} data-bcms-kind=\"text\">\n {b.label}\n </span>\n {b.arrow && <ButtonIcon name=\"arrow-right\" className=\"bcms-btn-arrow\" />}\n </>\n );\n // `action: \"code\"`: your own handler owns the click (delegate on `[data-bcms-button]`), so no href.\n if (b.action === \"code\") {\n return (\n <button type=\"button\" className={className} data-bcms-button={path} data-variant={b.variant} data-size={b.size} {...(b.fullWidth ? { \"data-full-width\": \"\", style: FULL_WIDTH_STYLE } : {})}>\n {content}\n </button>\n );\n }\n return (\n <a\n className={className}\n href={b.href || \"#\"}\n data-bcms-button={path}\n data-variant={b.variant}\n data-size={b.size}\n {...(b.fullWidth ? { \"data-full-width\": \"\", style: FULL_WIDTH_STYLE } : {})}\n data-bcms-props={formatPropsAttribute([{ address: `${path}.href`, kind: \"url\", attr: \"href\" }])}\n {...(b.newTab ? { target: \"_blank\", rel: \"noopener noreferrer\" } : {})}\n >\n {content}\n </a>\n );\n}\n","/**\n * C3 — `fieldAttrs(path, fieldStyles)`: the props a site's OWN element spreads to bind a PAGE FIELD\n * and apply that field's stored style, so the BetterCMS editor offers its width and spacing handles\n * and its Align / Size / Weight controls.\n *\n * const page = await client.getPage(\"home\");\n * <h1 className=\"title\" {...fieldAttrs(\"hero-title\", page?.fieldStyles)}>{entry.data[\"hero-title\"]}</h1>\n *\n * `data-bcms-style` is the site's promise that \"this element's inline style is\n * `fieldStyleToCss(fieldStyles[path])`\"; the editor offers a field's handles only where it is\n * present. Present even when the field has no style (then there is no `style` prop at all).\n * Twin: `fieldAttrs` in @bettercms-ai/astro (a CSS string there).\n */\nimport type { CSSProperties } from \"react\";\nimport { fieldStyleToCss, type FieldStyle, type FieldStyles } from \"@bettercms-ai/types\";\n\nexport interface FieldAttrs {\n \"data-bcms-field\": string;\n /** The marker's revision: \"2\" promises `size` (zoom) too. Section roots keep \"\". */\n \"data-bcms-style\": \"2\";\n /** `fieldStyleToCss(fieldStyles[path])`; absent when the field has no style. */\n style?: CSSProperties;\n}\n\n/** The stored style for `path`, by OWN key only — a path like `constructor` never reads the prototype. */\nexport function fieldStyleOf(path: string, fieldStyles: FieldStyles | Record<string, unknown> | null | undefined): FieldStyle | undefined {\n if (!fieldStyles || typeof fieldStyles !== \"object\" || !Object.prototype.hasOwnProperty.call(fieldStyles, path)) return undefined;\n const style = (fieldStyles as Record<string, unknown>)[path];\n return style && typeof style === \"object\" ? (style as FieldStyle) : undefined;\n}\n\nexport function fieldAttrs(path: string, fieldStyles?: FieldStyles | Record<string, unknown> | null): FieldAttrs {\n const css = fieldStyleToCss(fieldStyleOf(path, fieldStyles));\n return { \"data-bcms-field\": path, \"data-bcms-style\": \"2\", ...(css ? { style: css as CSSProperties } : {}) };\n}\n\n/**\n * P7 — `entryAttrs(entry)` and `entryField(entry, path)`: the attributes a site's OWN card spreads to\n * declare a collection ENTRY, so the editor binds it without guessing from the rendered text.\n *\n * <article {...entryAttrs(post)}><h3 {...entryField(post, \"title\")}>{post.fields.title}</h3></article>\n *\n * The field address is ABSOLUTE (`entry:<id>:<path>`). With a `transform` the value is shown\n * changed (a date formatted, text truncated), so it is declared as `data-bcms-entry-from`: the\n * editor knows where it is but cannot re-render it. Twin: same helpers in @bettercms-ai/astro.\n */\nexport type EntryRef = { id?: string } | string;\nexport type EntryTransform = \"format\" | \"truncate\" | \"rendition\" | \"route\";\n/** One key is present: `data-bcms-entry-field`, or `data-bcms-entry-from` when transformed; none without an id. */\nexport interface EntryFieldAttrs {\n \"data-bcms-entry-field\"?: string;\n \"data-bcms-entry-from\"?: string;\n}\n\nfunction entryIdOf(entry: EntryRef): string | null {\n const id = typeof entry === \"string\" ? entry : entry?.id;\n return typeof id === \"string\" && id.trim() !== \"\" ? id : null;\n}\n\n/** An entry with no id (a snapshot written before ids were kept) renders unbound, never fails the build. */\nexport function entryAttrs(entry: EntryRef): { \"data-bcms-entry\"?: string } {\n const id = entryIdOf(entry);\n return id ? { \"data-bcms-entry\": id } : {};\n}\n\nexport function entryField(entry: EntryRef, path: string, opts?: { transform?: EntryTransform }): EntryFieldAttrs {\n const id = entryIdOf(entry);\n if (typeof path !== \"string\" || path.trim() === \"\") throw new Error(`entryField: no field path given for entry ${id ?? \"(no id)\"}`);\n if (!id) return {};\n const address = `entry:${id}:${path}`;\n return opts?.transform ? { \"data-bcms-entry-from\": `${address}|${opts.transform}` } : { \"data-bcms-entry-field\": address };\n}\n","/**\n * C3/C4 — `sectionRootAttrs(block)`: the props a site's OWN section root spreads so the\n * BetterCMS editor offers that section's spacing and style handles.\n *\n * <section className=\"hero\" {...sectionRootAttrs(block)}>…</section>\n *\n * The editor shows those handles on a site-rendered page only when EVERY root the site stamps\n * with `data-bcms-block` also carries `data-bcms-style`, which is the site's promise that \"this\n * root's inline style is `blockStyleToCss(block.style)`\" — the same declarations `<BcmsBlocks>`\n * puts on its own wrapper. The marker is present even when the style is EMPTY (then there is no\n * `style` prop at all): an unstyled section is the one an author is about to give its first\n * spacing edit. Twin: `sectionRootAttrs` in @bettercms-ai/astro (style as a string there).\n */\nimport type { CSSProperties } from \"react\";\nimport { blockStyleToColumnCss, blockStyleToCss, hideOnAttr, type BlockStyle } from \"@bettercms-ai/types\";\n\nexport interface SectionRootBlock {\n id?: string | null;\n style?: BlockStyle | Record<string, unknown> | null;\n}\n\nexport interface SectionRootAttrs {\n \"data-bcms-block\"?: string;\n \"data-bcms-style\": \"\";\n /** `\"mobile tablet\"` when `style.hideOn` hides it there; the site ships `RESPONSIVE_CSS` for it. */\n \"data-bcms-hide\"?: string;\n /** `blockStyleToCss(block.style)`; absent when the block has no style. */\n style?: CSSProperties;\n}\n\nexport function sectionRootAttrs(block: SectionRootBlock | null | undefined): SectionRootAttrs {\n const css = blockStyleToCss((block?.style ?? undefined) as BlockStyle | undefined);\n const id = typeof block?.id === \"string\" && block.id !== \"\" ? block.id : undefined;\n const hide = hideOnAttr(block?.style);\n return {\n ...(id !== undefined ? { \"data-bcms-block\": id } : {}),\n \"data-bcms-style\": \"\",\n ...(hide ? { \"data-bcms-hide\": hide } : {}),\n ...(css ? { style: css as CSSProperties } : {}),\n };\n}\n\nexport interface SectionColumnAttrs {\n \"data-bcms-column\": \"\";\n /** `blockStyleToColumnCss(block.style)`; absent when the section has no column. */\n style?: CSSProperties;\n}\n\n/**\n * C3 — `sectionColumnAttrs(block)`: the props a site's own INNER container spreads so the section's\n * content WIDTH ships (`style.contentWidth`, placed by `contentAlign`). The column BetterCMS draws as\n * `.bcms-block-inner`, never on the root (its background stays full-bleed); `data-bcms-column` is the\n * site's promise that this box's inline style is that column. Twin: @bettercms-ai/astro.\n */\nexport function sectionColumnAttrs(block: SectionRootBlock | null | undefined): SectionColumnAttrs {\n const css = blockStyleToColumnCss((block?.style ?? undefined) as BlockStyle | undefined);\n return { \"data-bcms-column\": \"\", ...(css ? { style: css as CSSProperties } : {}) };\n}\n"],"mappings":";AAsBA,SAAS,UAAU,cAAc,sBAA2E;AAqBxG;AATG,SAAS,UAAU,EAAE,MAAM,MAAM,IAAI,SAAS,GAAmB;AACtE,QAAM,MAAM,MAAM;AAClB,QAAM,OAAO,KAAK,CAAC,IAAI,SAAS,QAAQ,QAAQ;AAChD,QAAM,OAAO,KAAK,WAAW,KAAK,eAAe,KAAK,CAAC,CAAC,KAAK,OAAO,KAAK,CAAC,EAAE,SAAS,WAAY,KAAK,CAAC,IAA8C;AAErJ,MAAI,QAAQ,KAAK,MAAM,iBAAiB,MAAM,UAAa,KAAK,MAAM,wBAAwB,MAAM,QAAW;AAC7G,WAAO,aAAa,MAAM,EAAE,mBAAmB,MAAM,kBAAkB,KAAK,CAAC;AAAA,EAC/E;AACA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,mBAAiB;AAAA,MACjB,kBAAgB;AAAA,MAChB,OAAO,KAAK,SAAY,EAAE,SAAS,WAAW;AAAA,MAE7C;AAAA;AAAA,EACH;AAEJ;;;AClCA,SAAS,iBAAiB;AA4CtB,gBAAAA,YAAA;AArBG,SAAS,UAAU;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS;AAAA,EACT;AAAA,EACA;AAAA,EACA;AAAA,EACA,UAAU;AAAA,EACV;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,E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AY,GAAG,KAAK,MAAM,KAAK,KAAK;AAC3D;AAGO,SAAS,WAAW,OAAiD;AAC1E,QAAM,KAAK,UAAU,KAAK;AAC1B,SAAO,KAAK,EAAE,mBAAmB,GAAG,IAAI,CAAC;AAC3C;AAEO,SAAS,WAAW,OAAiB,MAAc,MAAwD;AAChH,QAAM,KAAK,UAAU,KAAK;AAC1B,MAAI,OAAO,SAAS,YAAY,KAAK,KAAK,MAAM,GAAI,OAAM,IAAI,MAAM,6CAA6C,MAAM,SAAS,EAAE;AAClI,MAAI,CAAC,GAAI,QAAO,CAAC;AACjB,QAAM,UAAU,SAAS,EAAE,IAAI,IAAI;AACnC,SAAO,MAAM,YAAY,EAAE,wBAAwB,GAAG,OAAO,IAAI,KAAK,SAAS,GAAG,IAAI,EAAE,yBAAyB,QAAQ;AAC3H;;;ACzDA,SAAS,uBAAuB,iBAAiB,kBAAmC;AAgB7E,SAAS,iBAAiB,OAA8D;AAC7F,QAAM,MAAM,gBAAiB,OAAO,SAAS,MAAoC;AACjF,QAAM,KAAK,OAAO,OAAO,OAAO,YAAY,MAAM,OAAO,KAAK,MAAM,KAAK;AACzE,QAAM,OAAO,WAAW,OAAO,KAAK;AACpC,SAAO;AAAA,IACL,GAAI,OAAO,SAAY,EAAE,mBAAmB,GAAG,IAAI,CAAC;AAAA,IACpD,mBAAmB;AAAA,IACnB,GAAI,OAAO,EAAE,kBAAkB,KAAK,IAAI,CAAC;AAAA,IACzC,GAAI,MAAM,EAAE,OAAO,IAAqB,IAAI,CAAC;AAAA,EAC/C;AACF;AAcO,SAAS,mBAAmB,OAAgE;AACjG,QAAM,MAAM,sBAAuB,OAAO,SAAS,MAAoC;AACvF,SAAO,EAAE,oBAAoB,IAAI,GAAI,MAAM,EAAE,OAAO,IAAqB,IAAI,CAAC,EAAG;AACnF;","names":["jsx","jsx"]}
1
+ {"version":3,"sources":["../src/field.tsx","../src/image.tsx","../src/button.tsx","../src/icon.tsx","../src/field-attrs.ts","../src/section-root.ts"],"sourcesContent":["/**\n * <BcmsField> — tag an entry field's rendered value with its identity so the\n * BetterCMS visual editor can bind click-to-edit deterministically (mirrors\n * Sanity's `data-sanity` / BaseHub's `data-basehub`). Entry-backed templates\n * hand-render field values (`f.title`, `f.body.html`), so the field `path` is\n * declared here by the author — the delivery payload carries no source-map.\n *\n * Server-safe (no hooks): renders in a Next Server Component. When the child is ONE\n * DOM element (`<h1>`, `<p>`), the attributes go on that element and nothing is added to\n * the page: `.hero > h1` and every animation target stay what the author wrote. Text,\n * several children, or a component (which may not pass unknown props on) are wrapped in a\n * `display:contents` span as before; pass `as` to carry the attributes on a real wrapper.\n * Twin: BcmsField.astro in @bettercms-ai/astro.\n *\n * `path` follows the editor grammar: `title` · `hero.title` · `columns[0].links[2].href`\n * (dotted keys and any number of `[n]` indices). For images, put the attributes on the\n * `<img>` itself (`kind=\"image\"` reflection patches `.src`), not on a wrapper:\n * <img src={imageValueUrl(f.cover, { w: 1200 })} data-bcms-field=\"cover\" data-bcms-kind=\"image\" />\n * `imageValueUrl` (re-exported from this package) applies the value's per-placement `crop` and\n * `focal`; `.url` alone would drop them. For a cover-fit box add\n * `style={{ objectPosition: imageValueObjectPosition(f.cover) ?? undefined }}`.\n */\nimport { Children, cloneElement, isValidElement, type ElementType, type ReactElement, type ReactNode } from \"react\";\n\nexport interface BcmsFieldProps {\n /** Field path in the editor grammar, e.g. `title` or `facts[2].label`. */\n path: string;\n /** Kind hint the editor's reflection branches on. Omit for plain text/number. */\n kind?: \"richtext\" | \"image\";\n /** Wrapper element. Without it: no wrapper around a single DOM element, a `display:contents` span around anything else. */\n as?: ElementType;\n children: ReactNode;\n}\n\nexport function BcmsField({ path, kind, as, children }: BcmsFieldProps) {\n const Tag = as ?? \"span\";\n const only = as ? [] : Children.toArray(children);\n const sole = only.length === 1 && isValidElement(only[0]) && typeof only[0].type === \"string\" ? (only[0] as ReactElement<Record<string, unknown>>) : null;\n // An element that already declares a field keeps its own address: wrapped, as before.\n if (sole && sole.props[\"data-bcms-field\"] === undefined && sole.props[\"data-bcms-layout-field\"] === undefined) {\n return cloneElement(sole, { \"data-bcms-field\": path, \"data-bcms-kind\": kind });\n }\n return (\n <Tag\n data-bcms-field={path}\n data-bcms-kind={kind}\n style={as ? undefined : { display: \"contents\" }}\n >\n {children}\n </Tag>\n );\n}\n","/**\n * <BcmsImage> — render an image field as one responsive `<img>` on the BetterCMS media transform\n * endpoint, declared so the visual editor binds it and a publish writes the new picture into it.\n * The same markup as the Astro SDK's <BcmsImage>.\n *\n * <BcmsImage path=\"hero.image\" src={page.hero.image} sizes=\"(min-width: 800px) 50vw, 100vw\" />\n *\n * `src` is an image VALUE (`{ url, altText, width?, focal?, crop? }`), a media url or an asset id.\n * The value's per-placement crop and focal point ride every url, and the focal point is also the\n * `object-position` (inert without `object-fit`). With `sizes` and no `width` the srcset is a WIDTH\n * ladder, never wider than the picture; with a pixel `width` it is 1x/2x. The value's `altText` is\n * the alt unless `alt` says otherwise. Any other prop reaches the `<img>` as written.\n *\n * A plain `<img>`, deliberately: `next/image` refuses a remote host the app has not allow-listed,\n * so an editor's replacement would break the build. Server-safe (no hooks).\n */\nimport type { ImageFit, ImageFormat, ImageSource } from \"@bettercms-ai/image-url\";\nimport { imageCore } from \"@bettercms-ai/sdk/bindings\";\nimport type { CSSProperties, ImgHTMLAttributes } from \"react\";\n\n/** What delivery adds to an image value beside its url: the facts this component reads. */\ntype ImageFacts = { altText?: string | null; alt?: string | null; width?: number | null; height?: number | null; focalX?: number | null; focalY?: number | null };\n\nexport interface BcmsImageProps extends Omit<ImgHTMLAttributes<HTMLImageElement>, \"src\" | \"srcSet\" | \"width\" | \"height\"> {\n src: ImageSource | (Exclude<ImageSource, string> & ImageFacts);\n /** The field this image renders, in the editor grammar (`cover`, `hero.image`). */\n path?: string;\n width?: number;\n height?: number;\n format?: ImageFormat;\n quality?: number;\n fit?: ImageFit;\n /** Focal point override, 0–1. Normally omitted: the value and the asset carry their own. */\n focalX?: number | null;\n focalY?: number | null;\n /** Media host for a `src` that is only an asset id. Defaults to the platform's. */\n baseUrl?: string;\n}\n\n/** The widths a `sizes` image offers: phone to desktop, and never an upscale of the picture. */\nexport function BcmsImage({\n src,\n path,\n alt,\n width,\n height,\n format = \"webp\",\n quality,\n fit,\n sizes,\n loading = \"lazy\",\n focalX,\n focalY,\n baseUrl,\n style,\n ...rest\n}: BcmsImageProps) {\n const { src: src1x, srcset: srcSet, alt: resolvedAlt, css } = imageCore(src, { alt, width, height, format, quality, fit, sizes, focalX, focalY, baseUrl });\n const merged: CSSProperties = { ...css, ...style };\n\n return (\n <img\n src={src1x}\n srcSet={srcSet}\n alt={resolvedAlt}\n data-bcms-field={path}\n data-bcms-kind={path ? \"image\" : undefined}\n width={width}\n height={height}\n sizes={sizes}\n loading={loading}\n style={Object.keys(merged).length > 0 ? merged : undefined}\n {...rest}\n />\n );\n}\n","/**\n * <BcmsButton> — render a `button` field ({ label, href, variant?, size?, arrow?, icon?,\n * newTab?, fullWidth? }) as one editable button, with the hooks the BetterCMS visual editor repaints and\n * in-place publishing writes. The same markup as the Astro SDK's <BcmsButton>:\n *\n * <a data-bcms-button=\"<path>\" data-variant data-size [data-full-width] href [target rel] data-bcms-props=\"<path>.href|url|href\">\n * [<svg class=\"bcms-btn-icon\">]<span data-bcms-field=\"<path>.label\">Label</span>[<svg class=\"bcms-btn-arrow\">]\n * </a>\n *\n * A value with `action: \"code\"` (no href: the site's script handles the click) renders the same\n * children in `<button type=\"button\" data-bcms-button=\"<path>\" data-variant data-size>`.\n *\n * Style it by `data-variant` and `data-size` in your own CSS. A full-width button also carries\n * `display:flex;width:100%;justify-content:center` inline, so it stretches with no rule of yours.\n * Server-safe (no hooks).\n *\n * <BcmsButton path=\"hero.cta\" value={page.hero.cta} className=\"btn\" />\n */\nimport { formatPropsAttribute, readButtonValue } from \"@bettercms-ai/types\";\nimport { ICON_MARKUP, ICON_VIEWBOX } from \"@bettercms-ai/icons/markup\";\n\n/**\n * One icon as an `<svg>` drawn from the markup table the block renderer already ships, so a button\n * costs no per-icon module: the icon map pulled every icon into a client bundle.\n */\nconst ButtonIcon = ({ name, className }: { name: keyof typeof ICON_MARKUP; className: string }) => (\n <svg data-bcms-icon={name} className={className} viewBox={ICON_VIEWBOX} width=\"1em\" height=\"1em\" fill=\"none\" aria-hidden focusable=\"false\" dangerouslySetInnerHTML={{ __html: ICON_MARKUP[name] }} />\n);\n\n/** A full-width button stretches across its column, label centred: the hosted renderer's `bcms-btn-full`. */\nconst FULL_WIDTH_STYLE = { display: \"flex\", width: \"100%\", justifyContent: \"center\" } as const;\n\nexport interface BcmsButtonProps {\n /** The field path in the editor grammar, e.g. `cta` or `hero.cta`. */\n path: string;\n /** The stored value. Missing keys render as the defaults (Primary, medium, no arrow, no icon). */\n value: unknown;\n className?: string;\n}\n\nexport function BcmsButton({ path, value, className }: BcmsButtonProps) {\n const b = readButtonValue(value);\n if (!b.label) return null;\n const content = (\n <>\n {/* Direct children of the root, as the editor and in-place publishing find them. */}\n {b.icon && <ButtonIcon name={b.icon} className=\"bcms-btn-icon\" />}\n <span data-bcms-field={`${path}.label`} data-bcms-kind=\"text\">\n {b.label}\n </span>\n {b.arrow && <ButtonIcon name=\"arrow-right\" className=\"bcms-btn-arrow\" />}\n </>\n );\n // `action: \"code\"`: your own handler owns the click (delegate on `[data-bcms-button]`), so no href.\n if (b.action === \"code\") {\n return (\n <button type=\"button\" className={className} data-bcms-button={path} data-variant={b.variant} data-size={b.size} {...(b.fullWidth ? { \"data-full-width\": \"\", style: FULL_WIDTH_STYLE } : {})}>\n {content}\n </button>\n );\n }\n return (\n <a\n className={className}\n href={b.href || \"#\"}\n data-bcms-button={path}\n data-variant={b.variant}\n data-size={b.size}\n {...(b.fullWidth ? { \"data-full-width\": \"\", style: FULL_WIDTH_STYLE } : {})}\n data-bcms-props={formatPropsAttribute([{ address: `${path}.href`, kind: \"url\", attr: \"href\" }])}\n {...(b.newTab ? { target: \"_blank\", rel: \"noopener noreferrer\" } : {})}\n >\n {content}\n </a>\n );\n}\n","/**\n * <BcmsIcon> — render an `icon` field's value (V2 D65), every stored form:\n *\n * a set name → <svg data-bcms-icon=\"name\">, from the markup table the block renderer ships\n * a library icon that → <span data-bcms-icon-url> masked in the text colour (it recolours with the text)\n * follows the text\n * any other url → <img> (a multicolour SVG or an image keeps its colours)\n *\n * A `label` makes the icon an image with that name; without one it is decorative (aria-hidden). Server-safe (no hooks).\n *\n * <BcmsIcon value={card.icon} className=\"size-5\" />\n */\nimport { iconSrc } from \"@bettercms-ai/types\";\nimport { ICON_MARKUP, ICON_VIEWBOX } from \"@bettercms-ai/icons/markup\";\n\nexport interface BcmsIconProps {\n /** The stored icon value: a set name, an image URL or an icon object. */\n value: unknown;\n className?: string;\n}\n\nexport function BcmsIcon({ value, className }: BcmsIconProps) {\n const src = iconSrc(value);\n if (!src) return null;\n const a11y = src.label ? { role: \"img\", \"aria-label\": src.label } : { \"aria-hidden\": true as const };\n if (\"name\" in src) {\n const markup = (ICON_MARKUP as Record<string, string>)[src.name];\n if (!markup) return null;\n return <svg data-bcms-icon={src.name} className={className} viewBox={ICON_VIEWBOX} width=\"1em\" height=\"1em\" fill=\"none\" focusable=\"false\" {...a11y} dangerouslySetInnerHTML={{ __html: markup }} />;\n }\n if (src.followsText) {\n const mask = `url(${JSON.stringify(src.url)}) center / contain no-repeat`;\n return <span data-bcms-icon-url={src.url} className={className} style={{ display: \"inline-block\", width: \"1em\", height: \"1em\", backgroundColor: \"currentColor\", mask, WebkitMask: mask }} {...a11y} />;\n }\n return <img src={src.url} alt={src.label ?? \"\"} className={className} width={16} height={16} style={{ width: \"1em\", height: \"1em\", objectFit: \"contain\" }} />;\n}\n","/**\n * C3 — `fieldAttrs(path, fieldStyles)`: the props a site's OWN element spreads to bind a PAGE FIELD\n * and apply that field's stored style, so the BetterCMS editor offers its width and spacing handles\n * and its Align / Size / Weight controls.\n *\n * const page = await client.getPage(\"home\");\n * <h1 className=\"title\" {...fieldAttrs(\"hero-title\", page?.fieldStyles)}>{entry.data[\"hero-title\"]}</h1>\n *\n * `data-bcms-style` is the site's promise that \"this element's inline style is\n * `fieldStyleToCss(fieldStyles[path])`\"; the editor offers a field's handles only where it is\n * present. Present even when the field has no style (then there is no `style` prop at all).\n * Twin: `fieldAttrs` in @bettercms-ai/astro (a CSS string there).\n */\nimport type { CSSProperties } from \"react\";\nimport { fieldStyleToCss, type FieldStyle, type FieldStyles } from \"@bettercms-ai/types\";\n\nexport interface FieldAttrs {\n \"data-bcms-field\": string;\n /** The marker's revision: \"2\" promises `size` (zoom) too. Section roots keep \"\". */\n \"data-bcms-style\": \"2\";\n /** `fieldStyleToCss(fieldStyles[path])`; absent when the field has no style. */\n style?: CSSProperties;\n}\n\n/** The stored style for `path`, by OWN key only — a path like `constructor` never reads the prototype. */\nexport function fieldStyleOf(path: string, fieldStyles: FieldStyles | Record<string, unknown> | null | undefined): FieldStyle | undefined {\n if (!fieldStyles || typeof fieldStyles !== \"object\" || !Object.prototype.hasOwnProperty.call(fieldStyles, path)) return undefined;\n const style = (fieldStyles as Record<string, unknown>)[path];\n return style && typeof style === \"object\" ? (style as FieldStyle) : undefined;\n}\n\nexport function fieldAttrs(path: string, fieldStyles?: FieldStyles | Record<string, unknown> | null): FieldAttrs {\n const css = fieldStyleToCss(fieldStyleOf(path, fieldStyles));\n return { \"data-bcms-field\": path, \"data-bcms-style\": \"2\", ...(css ? { style: css as CSSProperties } : {}) };\n}\n\n/**\n * P7 — `entryAttrs(entry)` and `entryField(entry, path)`: the attributes a site's OWN card spreads to\n * declare a collection ENTRY, so the editor binds it without guessing from the rendered text.\n *\n * <article {...entryAttrs(post)}><h3 {...entryField(post, \"title\")}>{post.fields.title}</h3></article>\n *\n * The field address is ABSOLUTE (`entry:<id>:<path>`). With a `transform` the value is shown\n * changed (a date formatted, text truncated), so it is declared as `data-bcms-entry-from`: the\n * editor knows where it is but cannot re-render it. Twin: same helpers in @bettercms-ai/astro.\n */\nexport type EntryRef = { id?: string } | string;\nexport type EntryTransform = \"format\" | \"truncate\" | \"rendition\" | \"route\";\n/** One key is present: `data-bcms-entry-field`, or `data-bcms-entry-from` when transformed; none without an id. */\nexport interface EntryFieldAttrs {\n \"data-bcms-entry-field\"?: string;\n \"data-bcms-entry-from\"?: string;\n}\n\nfunction entryIdOf(entry: EntryRef): string | null {\n const id = typeof entry === \"string\" ? entry : entry?.id;\n return typeof id === \"string\" && id.trim() !== \"\" ? id : null;\n}\n\n/** An entry with no id (a snapshot written before ids were kept) renders unbound, never fails the build. */\nexport function entryAttrs(entry: EntryRef): { \"data-bcms-entry\"?: string } {\n const id = entryIdOf(entry);\n return id ? { \"data-bcms-entry\": id } : {};\n}\n\nexport function entryField(entry: EntryRef, path: string, opts?: { transform?: EntryTransform }): EntryFieldAttrs {\n const id = entryIdOf(entry);\n if (typeof path !== \"string\" || path.trim() === \"\") throw new Error(`entryField: no field path given for entry ${id ?? \"(no id)\"}`);\n if (!id) return {};\n const address = `entry:${id}:${path}`;\n return opts?.transform ? { \"data-bcms-entry-from\": `${address}|${opts.transform}` } : { \"data-bcms-entry-field\": address };\n}\n","/**\n * C3/C4 — `sectionRootAttrs(block)`: the props a site's OWN section root spreads so the\n * BetterCMS editor offers that section's spacing and style handles.\n *\n * <section className=\"hero\" {...sectionRootAttrs(block)}>…</section>\n *\n * The editor shows those handles on a site-rendered page only when EVERY root the site stamps\n * with `data-bcms-block` also carries `data-bcms-style`, which is the site's promise that \"this\n * root's inline style is `blockStyleToCss(block.style)`\" — the same declarations `<BcmsBlocks>`\n * puts on its own wrapper. The marker is present even when the style is EMPTY (then there is no\n * `style` prop at all): an unstyled section is the one an author is about to give its first\n * spacing edit. Twin: `sectionRootAttrs` in @bettercms-ai/astro (style as a string there).\n */\nimport type { CSSProperties } from \"react\";\nimport { blockStyleToColumnCss, blockStyleToCss, hideOnAttr, type BlockStyle } from \"@bettercms-ai/types\";\n\nexport interface SectionRootBlock {\n id?: string | null;\n style?: BlockStyle | Record<string, unknown> | null;\n}\n\nexport interface SectionRootAttrs {\n \"data-bcms-block\"?: string;\n \"data-bcms-style\": \"\";\n /** `\"mobile tablet\"` when `style.hideOn` hides it there; the site ships `RESPONSIVE_CSS` for it. */\n \"data-bcms-hide\"?: string;\n /** `blockStyleToCss(block.style)`; absent when the block has no style. */\n style?: CSSProperties;\n}\n\nexport function sectionRootAttrs(block: SectionRootBlock | null | undefined): SectionRootAttrs {\n const css = blockStyleToCss((block?.style ?? undefined) as BlockStyle | undefined);\n const id = typeof block?.id === \"string\" && block.id !== \"\" ? block.id : undefined;\n const hide = hideOnAttr(block?.style);\n return {\n ...(id !== undefined ? { \"data-bcms-block\": id } : {}),\n \"data-bcms-style\": \"\",\n ...(hide ? { \"data-bcms-hide\": hide } : {}),\n ...(css ? { style: css as CSSProperties } : {}),\n };\n}\n\nexport interface SectionColumnAttrs {\n \"data-bcms-column\": \"\";\n /** `blockStyleToColumnCss(block.style)`; absent when the section has no column. */\n style?: CSSProperties;\n}\n\n/**\n * C3 — `sectionColumnAttrs(block)`: the props a site's own INNER container spreads so the section's\n * content WIDTH ships (`style.contentWidth`, placed by `contentAlign`). The column BetterCMS draws as\n * `.bcms-block-inner`, never on the root (its background stays full-bleed); `data-bcms-column` is the\n * site's promise that this box's inline style is that column. Twin: @bettercms-ai/astro.\n */\nexport function sectionColumnAttrs(block: SectionRootBlock | null | undefined): SectionColumnAttrs {\n const css = blockStyleToColumnCss((block?.style ?? undefined) as BlockStyle | undefined);\n return { \"data-bcms-column\": \"\", ...(css ? { style: css as CSSProperties } : {}) };\n}\n"],"mappings":";AAsBA,SAAS,UAAU,cAAc,sBAA2E;AAqBxG;AATG,SAAS,UAAU,EAAE,MAAM,MAAM,IAAI,SAAS,GAAmB;AACtE,QAAM,MAAM,MAAM;AAClB,QAAM,OAAO,KAAK,CAAC,IAAI,SAAS,QAAQ,QAAQ;AAChD,QAAM,OAAO,KAAK,WAAW,KAAK,eAAe,KAAK,CAAC,CAAC,KAAK,OAAO,KAAK,CAAC,EAA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ACzC,GAAI,MAAM,EAAE,OAAO,IAAqB,IAAI,CAAC;AAAA,EAC/C;AACF;AAcO,SAAS,mBAAmB,OAAgE;AACjG,QAAM,MAAM,sBAAuB,OAAO,SAAS,MAAoC;AACvF,SAAO,EAAE,oBAAoB,IAAI,GAAI,MAAM,EAAE,OAAO,IAAqB,IAAI,CAAC,EAAG;AACnF;","names":["jsx","jsx","ICON_MARKUP","ICON_VIEWBOX","jsx"]}
package/dist/index.d.ts CHANGED
@@ -1,11 +1,12 @@
1
1
  import { PageMetaJson, ContentBlock, DeliveredLayout, FieldStyles, SiteSeoDefaults, BlockStyle, FieldStyle, DeliveryComponent } from '@bettercms-ai/types';
2
2
  export { DeliveredLayout, LinkValue, PageMetaJson, RESPONSIVE_CSS, SiteSeoDefaults, linkHref } from '@bettercms-ai/types';
3
3
  import { Metadata } from 'next';
4
- import { SeoInput, SeoLocation, DeliveryForm } from '@bettercms-ai/sdk';
5
- export { ResolvedSeo, SeoInput, resolveSeo } from '@bettercms-ai/sdk';
4
+ import { SeoInput, SeoLocation } from '@bettercms-ai/sdk/seo';
5
+ export { ResolvedSeo, SeoInput, resolveSeo } from '@bettercms-ai/sdk/seo';
6
6
  import { CSSProperties, ReactElement, ReactNode, ElementType, ImgHTMLAttributes } from 'react';
7
7
  import { ImageSource, ImageFormat, ImageFit } from '@bettercms-ai/image-url';
8
8
  export { ImageCrop, ImageFit, ImageFocal, ImageFormat, ImageSource, ImageUrlBuilder, ImageValueUrlOptions, imageUrl, default as imageUrlBuilder, imageValueObjectPosition, imageValueUrl } from '@bettercms-ai/image-url';
9
+ import { DeliveryForm } from '@bettercms-ai/sdk';
9
10
  import { DeliveryForm as DeliveryForm$1 } from '@bettercms-ai/sdk/read';
10
11
  import * as react_jsx_runtime from 'react/jsx-runtime';
11
12
  import { BcmsChangeEvent } from '@bettercms-ai/sdk/live';
@@ -106,17 +107,6 @@ interface EntryList<TFields> {
106
107
  hasPreviousPage: boolean;
107
108
  }
108
109
 
109
- /**
110
- * createBetterCMS — the Next.js delivery client.
111
- *
112
- * Reads run through the standard `fetch`, which the Next.js App Router patches to
113
- * participate in the data cache. We pass `next: { revalidate, tags }` so content is
114
- * cached/ISR'd and can be invalidated on publish via `revalidateTag()`.
115
- *
116
- * The raw Delivery API response is normalized into `BetterCMSEntry<TFields>` so the
117
- * return types match what @bettercms-ai/codegen generates.
118
- */
119
-
120
110
  /** A published page with its block_json — feed `blocks` to `<BcmsBlocks>`.
121
111
  * The SEO fields (FLO-302) feed `buildMetadata` for the route's `generateMetadata`. */
122
112
  interface BetterCMSPage {
@@ -591,6 +581,18 @@ declare function readPages(path?: string): SnapshotPage[];
591
581
  /** Find a single published page by `slug` from the Action snapshot. */
592
582
  declare function getPage(slug: string, path?: string): SnapshotPage | undefined;
593
583
 
584
+ type PageSnapshot = Record<string, unknown> & {
585
+ slug?: string;
586
+ };
587
+ interface BcmsPageOptions {
588
+ /** Override what `NEXT_PUBLIC_BCMS_*` / `BCMS_*` / `bcms-content.json` say. */
589
+ apiUrl?: string;
590
+ workspace?: string;
591
+ projectId?: string;
592
+ }
593
+ /** The page `slug`'s values (see the module doc for the order). Never throws; `snapshot` is the floor. */
594
+ declare function bcmsPage(slug: string, snapshot?: PageSnapshot, opts?: BcmsPageOptions): Promise<PageSnapshot>;
595
+
594
596
  /**
595
597
  * Build-time reader for the reusable components the deploy Action injects into the
596
598
  * content snapshot (`bcms-content.json` → `components`). Mirrors `forms-read.ts`.
@@ -684,7 +686,7 @@ interface SectionsData {
684
686
  /** The page's published blocks. Null when there is no snapshot or the page is not in it. */
685
687
  blocks: ContentBlock[] | null;
686
688
  components: DeliveryComponent[];
687
- forms: DeliveryForm[];
689
+ forms: DeliveryForm$1[];
688
690
  }
689
691
  /** Which of two pages that share a slug is read. */
690
692
  interface SectionsRead {
@@ -802,6 +804,13 @@ interface BcmsButtonProps {
802
804
  }
803
805
  declare function BcmsButton({ path, value, className }: BcmsButtonProps): react_jsx_runtime.JSX.Element | null;
804
806
 
807
+ interface BcmsIconProps {
808
+ /** The stored icon value: a set name, an image URL or an icon object. */
809
+ value: unknown;
810
+ className?: string;
811
+ }
812
+ declare function BcmsIcon({ value, className }: BcmsIconProps): react_jsx_runtime.JSX.Element | null;
813
+
805
814
  /** What delivery adds to an image value beside its url: the facts this component reads. */
806
815
  type ImageFacts = {
807
816
  altText?: string | null;
@@ -868,6 +877,22 @@ declare function defineBetterCMSLive(config: BetterCMSLiveConfig): {
868
877
  liveSrc: string;
869
878
  };
870
879
 
880
+ /**
881
+ * createRevalidateRoute — App Router POST handler for the backend's revalidation webhook: every
882
+ * tag and every page path the publish changed is revalidated. This is the production live path
883
+ * (publish → backend webhook → revalidate the ISR cache).
884
+ *
885
+ * import { createRevalidateRoute } from "@bettercms-ai/next";
886
+ * export const { POST } = createRevalidateRoute();
887
+ *
888
+ * The `X-BetterCMS-Signature` HMAC-SHA256 header is verified against the raw body with `secret`,
889
+ * else `BCMS_REVALIDATE_SECRET` (the one name, matching the project's revalidation secret).
890
+ *
891
+ * The same route answers a deploy target in "revalidate" mode (a site hosted elsewhere): that call
892
+ * signs with `X-BCMS-Signature` and names the changed `paths` and `tags` at the top level, and
893
+ * neither means everything the site caches. Read as nothing, it answered 200 with nothing refreshed, and the
894
+ * platform took the publish as delivered.
895
+ */
871
896
  interface RevalidateRouteConfig {
872
897
  /** Shared secret matching the project's revalidation webhook secret. Defaults to `BCMS_REVALIDATE_SECRET`. */
873
898
  secret?: string;
@@ -887,4 +912,4 @@ interface VisualEditingProps {
887
912
  studioUrl?: string;
888
913
  }
889
914
 
890
- export { type BcmsBlocksProps, BcmsButton, type BcmsButtonProps, BcmsDraftMarker, BcmsEmbedScripts, BcmsField, type BcmsFieldProps, type BcmsFormProps, BcmsImage, type BcmsImageProps, type BcmsLiveProps, type BcmsSectionProps, type BcmsSectionsProps, type BetterCMSConfig, type BetterCMSEntry, BetterCMSError, type BetterCMSLiveConfig, type BetterCMSNext, type BetterCMSPage, type ContentSnapshot, type ContentSource, DEFAULT_SNAPSHOT_FILE, type DraftModeRouteConfig, type EntryFieldAttrs, type EntryList, type EntryRef, type EntryTransform, type FieldAttrs, type GetEntryOptions, type ListEntriesOptions, type LlmsModel, type LlmsModelField, type LlmsTxtOptions, type LlmsTxtRouteConfig, PREVIEW_TOKEN_COOKIE, type ReadOptions, type RevalidateRouteConfig, SNAPSHOT_VERSION, type SectionColumnAttrs, type SectionRootAttrs, type SectionRootBlock, type SectionRootProps, type SectionsData, type SectionsRead, type SnapshotForms, type SnapshotPage, type VisualEditingProps, buildMetadata, buildSnapshot, createBetterCMS, createDisableDraftRoute, createDraftModeRoute, createRevalidateRoute, defineBetterCMSLive, entryAttrs, entryField, fetchModels, fieldAttrs, fieldStyleOf, generateLlmsTxt, getBranchPreview, getComponent, getContent, getForm, getPage, getPreviewBranch, getPreviewToken, isDraftEnabled, llmsTxtRoute, parseSnapshot, readComponents, readForms, readPages, readSnapshot, sectionColumnAttrs, sectionRootAttrs, sectionsFor, sectionsServerSideProps, sectionsStaticProps, serializeSnapshot, writeSnapshot };
915
+ export { type BcmsBlocksProps, BcmsButton, type BcmsButtonProps, BcmsDraftMarker, BcmsEmbedScripts, BcmsField, type BcmsFieldProps, type BcmsFormProps, BcmsIcon, type BcmsIconProps, BcmsImage, type BcmsImageProps, type BcmsLiveProps, type BcmsPageOptions, type BcmsSectionProps, type BcmsSectionsProps, type BetterCMSConfig, type BetterCMSEntry, BetterCMSError, type BetterCMSLiveConfig, type BetterCMSNext, type BetterCMSPage, type ContentSnapshot, type ContentSource, DEFAULT_SNAPSHOT_FILE, type DraftModeRouteConfig, type EntryFieldAttrs, type EntryList, type EntryRef, type EntryTransform, type FieldAttrs, type GetEntryOptions, type ListEntriesOptions, type LlmsModel, type LlmsModelField, type LlmsTxtOptions, type LlmsTxtRouteConfig, PREVIEW_TOKEN_COOKIE, type PageSnapshot, type ReadOptions, type RevalidateRouteConfig, SNAPSHOT_VERSION, type SectionColumnAttrs, type SectionRootAttrs, type SectionRootBlock, type SectionRootProps, type SectionsData, type SectionsRead, type SnapshotForms, type SnapshotPage, type VisualEditingProps, bcmsPage, buildMetadata, buildSnapshot, createBetterCMS, createDisableDraftRoute, createDraftModeRoute, createRevalidateRoute, defineBetterCMSLive, entryAttrs, entryField, fetchModels, fieldAttrs, fieldStyleOf, generateLlmsTxt, getBranchPreview, getComponent, getContent, getForm, getPage, getPreviewBranch, getPreviewToken, isDraftEnabled, llmsTxtRoute, parseSnapshot, readComponents, readForms, readPages, readSnapshot, sectionColumnAttrs, sectionRootAttrs, sectionsFor, sectionsServerSideProps, sectionsStaticProps, serializeSnapshot, writeSnapshot };