@aglyn/besigner-ui 1.17.0 → 1.19.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/package.json +17 -17
- package/src/lib/components/element-props-form.component.d.ts +8 -5
- package/src/lib/components/element-props-form.component.js +21 -12
- package/src/lib/components/element-props-form.component.js.map +1 -1
- package/src/lib/components/node-leaf.js +7 -4
- package/src/lib/components/node-leaf.js.map +1 -1
- package/src/lib/hooks/use-insert-token-options.d.ts +7 -0
- package/src/lib/hooks/use-insert-token-options.js +22 -6
- package/src/lib/hooks/use-insert-token-options.js.map +1 -1
- package/src/lib/hooks/use-repeat-preview.d.ts +2 -0
- package/src/lib/hooks/use-repeat-preview.js +4 -1
- package/src/lib/hooks/use-repeat-preview.js.map +1 -1
- package/src/lib/utils/docs-help.generated.d.ts +1 -1
- package/src/lib/utils/docs-help.generated.js +2 -0
- package/src/lib/utils/docs-help.generated.js.map +1 -1
|
@@ -61,7 +61,8 @@ const noVersion = ()=>0;
|
|
|
61
61
|
return repeat ? {
|
|
62
62
|
sourceId: repeat.source.id,
|
|
63
63
|
key: repeat.key,
|
|
64
|
-
label: repeat.source.label
|
|
64
|
+
label: repeat.source.label,
|
|
65
|
+
keyProp: repeat.source.keyProp
|
|
65
66
|
} : undefined;
|
|
66
67
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
67
68
|
}, [
|
|
@@ -89,6 +90,7 @@ const noVersion = ()=>0;
|
|
|
89
90
|
label: request.label,
|
|
90
91
|
records: [],
|
|
91
92
|
scope: repeatScope(node),
|
|
93
|
+
keyProp: request.keyProp,
|
|
92
94
|
missing: true
|
|
93
95
|
};
|
|
94
96
|
}
|
|
@@ -101,6 +103,7 @@ const noVersion = ()=>0;
|
|
|
101
103
|
label: answer.label,
|
|
102
104
|
records,
|
|
103
105
|
scope: repeatScope(node),
|
|
106
|
+
keyProp: request.keyProp,
|
|
104
107
|
dataset,
|
|
105
108
|
datasetsByKey: answer.rowsByKey
|
|
106
109
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../../libs/besigner/feature/designer/src/lib/hooks/use-repeat-preview.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n'use client'\n\nimport { canvas } from '@aglyn/aglyn'\n// By path: the repeat rules and the source registry stay out of every\n// `@aglyn/aglyn` barrel, so nothing on a published page can pull them in.\nimport {\n expandRepeatables,\n REPEAT_NODE_ID_PREFIX,\n type RepeatableDataset,\n type RepeatScope,\n repeatedRecords,\n repeatScope,\n substituteRecordTokens,\n} from '@aglyn/aglyn/app-utils/expand-repeatables'\nimport { repeatSourceOf } from '@aglyn/aglyn/app-utils/repeat-sources'\nimport { useTheme } from '@mui/material'\nimport type { Theme } from '@mui/material/styles'\nimport {\n createElement,\n type ReactNode,\n useContext,\n useEffect,\n useMemo,\n useSyncExternalStore,\n} from 'react'\nimport {\n RepeatRowsContext,\n repeatRowsKey,\n} from '../contexts/repeat-rows-context'\nimport CanvasChromeThemeContext from '../contexts/canvas-chrome-theme-context'\nimport {\n RepeatRecordContext,\n RepeatTemplateContext,\n} from '../contexts/repeat-record-context'\nimport { tokenPillStyle } from '../components/token-pill.component'\n\nconst subscribeToNothing = () => () => undefined\nconst noVersion = () => 0\n\n/** What a repeating element draws on the canvas. */\nexport interface RepeatPreview {\n /** What authors call the thing being repeated, for the badge. */\n label: string\n /**\n * The records this element renders, in order, bounded exactly as the\n * published page's composition bounds them. EMPTY when nothing matches: the\n * published page then renders no copy at all (AGL-3496), while the canvas\n * keeps the template on screen to be edited and the badge says so.\n */\n records: ReadonlyArray<Record<string, unknown>>\n /**\n * The key names nothing this site can read — a deleted or unshared dataset.\n * `records` is empty, and the published page renders no copy.\n */\n missing?: boolean\n /** Which scope applies, so the canvas draws what the page will build. */\n scope: RepeatScope\n /** The repeated rows, for the token substitution's reference hops. */\n dataset?: RepeatableDataset\n /** Every key the rows answered under, for a one-hop reference (AGL-180). */\n datasetsByKey?: Readonly<Record<string, RepeatableDataset>>\n}\n\n/**\n * The rows a canvas element repeats over, and the copies it therefore draws\n * (AGL-3111).\n *\n * The designer cannot read them itself — it renders inside a plugin sandbox,\n * and which documents hold them is the source's business — so this HOLDS the\n * request and reads back whatever the host app's reader filed. Without a\n * provider, before an answer, or after a failed read, it returns `undefined`\n * and the element draws its template once with no badge: nothing is known.\n *\n * An answer of no rows — a filter that matches nothing, an empty dataset, a\n * key that names nothing (`missing`) — IS known, and is returned with no\n * records rather than as `undefined`: the published page renders that repeat\n * zero times (AGL-3496), and an author looking at their template on the\n * canvas has to be told so.\n *\n * The records are {@link repeatedRecords}, not a second reading of the same\n * props: the filter, the sort, the limit and `REPEAT_MAX_RECORDS` are applied\n * by the function the page applies them with, so a copy on the canvas is a\n * copy a visitor gets.\n */\nexport function useRepeatPreview(node: unknown): RepeatPreview | undefined {\n const source = useContext(RepeatRowsContext)\n const props = (node as { props?: Record<string, unknown> })?.props\n // MobX props are observable and change in place; their JSON keys the memos\n // below, the way every other render copy in the canvas is keyed.\n const propsJson = JSON.stringify(props ?? null)\n const request = useMemo(() => {\n const repeat = source ? repeatSourceOf({ props }) : undefined\n return repeat\n ? { sourceId: repeat.source.id, key: repeat.key, label: repeat.source.label }\n : undefined\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [source, props, propsJson])\n\n const key = request ? repeatRowsKey(request) : ''\n useEffect(() => {\n if (!source || !request) return undefined\n return source.retain(request)\n // `key` stands in for `request`: the same source and key keeps the read\n // it already holds rather than dropping and re-taking it.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [source, key])\n\n const version = useSyncExternalStore(\n source && request ? source.subscribe : subscribeToNothing,\n source ? source.getVersion : noVersion,\n noVersion,\n )\n\n return useMemo(() => {\n if (!source || !request) return undefined\n const answer = source.get(key)\n if (answer?.status === 'missing') {\n return {\n label: request.label,\n records: [],\n scope: repeatScope(node),\n missing: true,\n }\n }\n if (answer?.status !== 'ready') return undefined\n const dataset = answer.rowsByKey[request.key]\n const records = repeatedRecords({ props }, dataset)\n return {\n label: answer.label,\n records,\n scope: repeatScope(node),\n dataset,\n datasetsByKey: answer.rowsByKey,\n }\n // `version` carries a new answer in; the body reads it through `get`.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [source, request, key, version, node, props, propsJson])\n}\n\n/**\n * The stored subtree under `rootId`, as a plain snapshot.\n *\n * Canvas nodes are MobX observables the expansion must not read through — it\n * copies props by reference into the copies it builds, and an observable read\n * outside a reaction is both a stale value and a missing dependency.\n */\nfunction subtreeSnapshot(rootId: string): Record<string, any> {\n const snapshot: Record<string, any> = {}\n const walk = (id: string) => {\n // Node by node rather than through the whole canvas's `toJSON()`: read\n // during a render, this is what the repeating element re-renders on, and\n // it should re-render for an edit inside what it repeats, not for every\n // edit on the page.\n const node = canvas.getNode(id)\n if (!node || snapshot[id]) return\n snapshot[id] = JSON.parse(JSON.stringify(node))\n for (const childId of (snapshot[id].nodes ?? []) as string[]) walk(childId)\n }\n walk(rootId)\n return snapshot\n}\n\n/**\n * The copies a repeating element draws BESIDE the one an author edits\n * (AGL-3111): records 2..n, as denormalized trees ready for an inert render.\n *\n * The first record is deliberately missing. It is drawn by the element's own\n * children — the real canvas nodes, selectable and draggable, with that\n * record's values laid over their render copies through\n * {@link RepeatRecordContext}. That is what makes editing the template edit\n * every copy: there is one template, it is on the canvas, and the copies are\n * pictures of it.\n *\n * Built by running the published page's own {@link expandRepeatables} over a\n * snapshot of this subtree, so the canvas cannot draw a shape the page would\n * not compose.\n */\nexport function useRepeatCopies(\n node: { $id?: string; parentId?: string } | null | undefined,\n preview: RepeatPreview | undefined,\n): any[] {\n const $id = node?.$id\n const recordCount = preview?.records.length ?? 0\n // What is repeated, read on every render. The copies are pictures of it, so\n // an edit to it — retyping the template's text — has to redraw them; keyed\n // on the records alone, they kept the text from when the page loaded.\n const subtreeJson =\n $id && preview && recordCount >= 2\n ? JSON.stringify(subtreeSnapshot($id))\n : ''\n const key = preview\n ? `${$id}\\n${preview.scope}\\n${JSON.stringify(preview.records)}\\n${subtreeJson}`\n : ''\n return useMemo(() => {\n if (!$id || !preview || recordCount < 2 || !subtreeJson) return []\n const snapshot = JSON.parse(subtreeJson) as Record<string, any>\n if (!snapshot[$id]) return []\n // A parent the copies can take their place in. The real parent is not in\n // this snapshot — only the subtree is — so a self-scoped repeat is given\n // a holder that lists it, which is all the expansion reads a parent for.\n const holderId = `${$id}__repeat-preview-parent`\n snapshot[$id] = { ...snapshot[$id], parentId: holderId }\n snapshot[holderId] = { $id: holderId, nodes: [$id] }\n const expanded = expandRepeatables(snapshot as never, {\n // Under the key the node stores, which is the key the expansion looks\n // the rows up by.\n ...(preview.datasetsByKey ?? {}),\n } as never) as Record<string, any>\n // The first record's copies are the ones the real nodes already draw. By\n // id, not by count: a copy leaves out an element whose binding its record\n // leaves empty (AGL-3616), so records need not copy alike.\n const firstCopy = `${REPEAT_NODE_ID_PREFIX}${$id}__0__`\n const copyIds = (\n (preview.scope === 'self'\n ? expanded[holderId]?.nodes\n : expanded[$id]?.nodes) ?? []\n ).filter((id: string) => !id.startsWith(firstCopy))\n return copyIds\n .map((id: string) => denormalize(expanded, id))\n .filter(Boolean)\n // `key` stands in for the records and the node; both are snapshots.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [$id, key, recordCount])\n}\n\n/** Nested-object form of an expanded map, which is what `Stem` walks. */\nfunction denormalize(\n nodes: Record<string, any>,\n rootId: string,\n seen: Set<string> = new Set(),\n): any {\n const node = nodes?.[rootId]\n if (!node || seen.has(rootId)) return undefined\n seen.add(rootId)\n return {\n ...node,\n children: ((node.nodes ?? []) as string[])\n .map((childId) => denormalize(nodes, childId, seen))\n .filter(Boolean),\n }\n}\n\n/**\n * A node's render copy with the record its subtree is drawing laid over it\n * (AGL-3111).\n *\n * Inside a repeating element the FIRST record's values belong on the real\n * canvas nodes, so the element an author edits reads as the first copy rather\n * than as a row of raw `{{item.*}}` tokens beside the copies that resolved\n * them. Render copies only — the node keeps its tokens, and every save writes\n * the template.\n */\nexport function useNodeWithRepeatRecord<N>(node: N): N {\n const context = useContext(RepeatRecordContext)\n const template = useContext(RepeatTemplateContext)\n const theme = useTheme()\n const chrome = useContext(CanvasChromeThemeContext) ?? theme\n const rendered = node as { props?: Record<string, unknown> } | null | undefined\n const propsJson =\n context || template ? JSON.stringify(rendered?.props ?? null) : ''\n return useMemo(() => {\n if (!rendered?.props) return node\n if (context) {\n const props = substituteRecordTokens({ ...rendered.props }, context)\n return { ...rendered, props } as N\n }\n const children = rendered.props['children']\n if (!template || typeof children !== 'string') return node\n const chipped = itemTokensAsChips(children, chrome)\n return chipped === children\n ? node\n : ({ ...rendered, props: { ...rendered.props, children: chipped } } as N)\n // Observable props: the JSON string keys the copy, as everywhere else.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [node, rendered, context, template, chrome, propsJson])\n}\n\n/** `{{item.<path>}}`, as the page's substitution reads a record field. */\nconst ITEM_TOKEN = /\\{\\{\\s*item\\.([A-Za-z_$][\\w$]*(?:\\.[A-Za-z_$][\\w$]*)*)\\s*\\}\\}/g\n\n/** `name` → `Name`, `photo_url` → `Photo url`: a field's key as words. */\nfunction fieldWords(path: string): string {\n const last = path.split('.').pop() ?? path\n const words = last\n .replace(/([a-z0-9])([A-Z])/g, '$1 $2')\n .replace(/[_-]+/g, ' ')\n .trim()\n .toLowerCase()\n return words.charAt(0).toUpperCase() + words.slice(1)\n}\n\n/**\n * `text` with each `{{item.*}}` token drawn as a chip, or `text` itself when\n * it holds none. The chip is the editors' own pill look (`tokenPillStyle`),\n * titled with the raw token so it stays inspectable.\n */\nexport function itemTokensAsChips(text: string, theme: Theme): ReactNode {\n const parts: ReactNode[] = []\n let last = 0\n for (const match of text.matchAll(ITEM_TOKEN)) {\n const at = match.index ?? 0\n if (at > last) parts.push(text.slice(last, at))\n parts.push(\n createElement(\n 'span',\n {\n key: `${at}`,\n title: match[0],\n 'data-aglyn-token-chip': '',\n style: { ...tokenPillStyle(theme, 'item'), cursor: 'inherit' },\n },\n fieldWords(match[1]),\n ),\n )\n last = at + match[0].length\n }\n if (!parts.length) return text\n if (last < text.length) parts.push(text.slice(last))\n return parts\n}\n\nexport default useRepeatPreview\n"],"names":["canvas","expandRepeatables","REPEAT_NODE_ID_PREFIX","repeatedRecords","repeatScope","substituteRecordTokens","repeatSourceOf","useTheme","createElement","useContext","useEffect","useMemo","useSyncExternalStore","RepeatRowsContext","repeatRowsKey","CanvasChromeThemeContext","RepeatRecordContext","RepeatTemplateContext","tokenPillStyle","subscribeToNothing","undefined","noVersion","useRepeatPreview","node","source","props","propsJson","JSON","stringify","request","repeat","sourceId","id","key","label","retain","version","subscribe","getVersion","answer","get","status","records","scope","missing","dataset","rowsByKey","datasetsByKey","subtreeSnapshot","rootId","snapshot","walk","getNode","parse","childId","nodes","useRepeatCopies","preview","$id","recordCount","length","subtreeJson","expanded","holderId","parentId","firstCopy","copyIds","filter","startsWith","map","denormalize","Boolean","seen","Set","has","add","children","useNodeWithRepeatRecord","context","template","theme","chrome","rendered","chipped","itemTokensAsChips","ITEM_TOKEN","fieldWords","path","last","split","pop","words","replace","trim","toLowerCase","charAt","toUpperCase","slice","text","parts","match","matchAll","at","index","push","title","style","cursor"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GACD;;AAEA,SAASA,MAAM,QAAQ,eAAc;AACrC,sEAAsE;AACtE,0EAA0E;AAC1E,SACEC,iBAAiB,EACjBC,qBAAqB,EAGrBC,eAAe,EACfC,WAAW,EACXC,sBAAsB,QACjB,4CAA2C;AAClD,SA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AAK,CAACT;IAC9C,OAAOW;AACT;AAEA,eAAe7E,iBAAgB"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../libs/besigner/feature/designer/src/lib/hooks/use-repeat-preview.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n'use client'\n\nimport { canvas } from '@aglyn/aglyn'\n// By path: the repeat rules and the source registry stay out of every\n// `@aglyn/aglyn` barrel, so nothing on a published page can pull them in.\nimport {\n expandRepeatables,\n REPEAT_NODE_ID_PREFIX,\n type RepeatableDataset,\n type RepeatScope,\n repeatedRecords,\n repeatScope,\n substituteRecordTokens,\n} from '@aglyn/aglyn/app-utils/expand-repeatables'\nimport { repeatSourceOf } from '@aglyn/aglyn/app-utils/repeat-sources'\nimport { useTheme } from '@mui/material'\nimport type { Theme } from '@mui/material/styles'\nimport {\n createElement,\n type ReactNode,\n useContext,\n useEffect,\n useMemo,\n useSyncExternalStore,\n} from 'react'\nimport {\n RepeatRowsContext,\n repeatRowsKey,\n} from '../contexts/repeat-rows-context'\nimport CanvasChromeThemeContext from '../contexts/canvas-chrome-theme-context'\nimport {\n RepeatRecordContext,\n RepeatTemplateContext,\n} from '../contexts/repeat-record-context'\nimport { tokenPillStyle } from '../components/token-pill.component'\n\nconst subscribeToNothing = () => () => undefined\nconst noVersion = () => 0\n\n/** What a repeating element draws on the canvas. */\nexport interface RepeatPreview {\n /** What authors call the thing being repeated, for the badge. */\n label: string\n /**\n * The records this element renders, in order, bounded exactly as the\n * published page's composition bounds them. EMPTY when nothing matches: the\n * published page then renders no copy at all (AGL-3496), while the canvas\n * keeps the template on screen to be edited and the badge says so.\n */\n records: ReadonlyArray<Record<string, unknown>>\n /**\n * The key names nothing this site can read — a deleted or unshared dataset.\n * `records` is empty, and the published page renders no copy.\n */\n missing?: boolean\n /** Which scope applies, so the canvas draws what the page will build. */\n scope: RepeatScope\n /** The prop the key is stored under, so the badge opens that field (AGL-4212). */\n keyProp?: string\n /** The repeated rows, for the token substitution's reference hops. */\n dataset?: RepeatableDataset\n /** Every key the rows answered under, for a one-hop reference (AGL-180). */\n datasetsByKey?: Readonly<Record<string, RepeatableDataset>>\n}\n\n/**\n * The rows a canvas element repeats over, and the copies it therefore draws\n * (AGL-3111).\n *\n * The designer cannot read them itself — it renders inside a plugin sandbox,\n * and which documents hold them is the source's business — so this HOLDS the\n * request and reads back whatever the host app's reader filed. Without a\n * provider, before an answer, or after a failed read, it returns `undefined`\n * and the element draws its template once with no badge: nothing is known.\n *\n * An answer of no rows — a filter that matches nothing, an empty dataset, a\n * key that names nothing (`missing`) — IS known, and is returned with no\n * records rather than as `undefined`: the published page renders that repeat\n * zero times (AGL-3496), and an author looking at their template on the\n * canvas has to be told so.\n *\n * The records are {@link repeatedRecords}, not a second reading of the same\n * props: the filter, the sort, the limit and `REPEAT_MAX_RECORDS` are applied\n * by the function the page applies them with, so a copy on the canvas is a\n * copy a visitor gets.\n */\nexport function useRepeatPreview(node: unknown): RepeatPreview | undefined {\n const source = useContext(RepeatRowsContext)\n const props = (node as { props?: Record<string, unknown> })?.props\n // MobX props are observable and change in place; their JSON keys the memos\n // below, the way every other render copy in the canvas is keyed.\n const propsJson = JSON.stringify(props ?? null)\n const request = useMemo(() => {\n const repeat = source ? repeatSourceOf({ props }) : undefined\n return repeat\n ? {\n sourceId: repeat.source.id,\n key: repeat.key,\n label: repeat.source.label,\n keyProp: repeat.source.keyProp,\n }\n : undefined\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [source, props, propsJson])\n\n const key = request ? repeatRowsKey(request) : ''\n useEffect(() => {\n if (!source || !request) return undefined\n return source.retain(request)\n // `key` stands in for `request`: the same source and key keeps the read\n // it already holds rather than dropping and re-taking it.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [source, key])\n\n const version = useSyncExternalStore(\n source && request ? source.subscribe : subscribeToNothing,\n source ? source.getVersion : noVersion,\n noVersion,\n )\n\n return useMemo(() => {\n if (!source || !request) return undefined\n const answer = source.get(key)\n if (answer?.status === 'missing') {\n return {\n label: request.label,\n records: [],\n scope: repeatScope(node),\n keyProp: request.keyProp,\n missing: true,\n }\n }\n if (answer?.status !== 'ready') return undefined\n const dataset = answer.rowsByKey[request.key]\n const records = repeatedRecords({ props }, dataset)\n return {\n label: answer.label,\n records,\n scope: repeatScope(node),\n keyProp: request.keyProp,\n dataset,\n datasetsByKey: answer.rowsByKey,\n }\n // `version` carries a new answer in; the body reads it through `get`.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [source, request, key, version, node, props, propsJson])\n}\n\n/**\n * The stored subtree under `rootId`, as a plain snapshot.\n *\n * Canvas nodes are MobX observables the expansion must not read through — it\n * copies props by reference into the copies it builds, and an observable read\n * outside a reaction is both a stale value and a missing dependency.\n */\nfunction subtreeSnapshot(rootId: string): Record<string, any> {\n const snapshot: Record<string, any> = {}\n const walk = (id: string) => {\n // Node by node rather than through the whole canvas's `toJSON()`: read\n // during a render, this is what the repeating element re-renders on, and\n // it should re-render for an edit inside what it repeats, not for every\n // edit on the page.\n const node = canvas.getNode(id)\n if (!node || snapshot[id]) return\n snapshot[id] = JSON.parse(JSON.stringify(node))\n for (const childId of (snapshot[id].nodes ?? []) as string[]) walk(childId)\n }\n walk(rootId)\n return snapshot\n}\n\n/**\n * The copies a repeating element draws BESIDE the one an author edits\n * (AGL-3111): records 2..n, as denormalized trees ready for an inert render.\n *\n * The first record is deliberately missing. It is drawn by the element's own\n * children — the real canvas nodes, selectable and draggable, with that\n * record's values laid over their render copies through\n * {@link RepeatRecordContext}. That is what makes editing the template edit\n * every copy: there is one template, it is on the canvas, and the copies are\n * pictures of it.\n *\n * Built by running the published page's own {@link expandRepeatables} over a\n * snapshot of this subtree, so the canvas cannot draw a shape the page would\n * not compose.\n */\nexport function useRepeatCopies(\n node: { $id?: string; parentId?: string } | null | undefined,\n preview: RepeatPreview | undefined,\n): any[] {\n const $id = node?.$id\n const recordCount = preview?.records.length ?? 0\n // What is repeated, read on every render. The copies are pictures of it, so\n // an edit to it — retyping the template's text — has to redraw them; keyed\n // on the records alone, they kept the text from when the page loaded.\n const subtreeJson =\n $id && preview && recordCount >= 2\n ? JSON.stringify(subtreeSnapshot($id))\n : ''\n const key = preview\n ? `${$id}\\n${preview.scope}\\n${JSON.stringify(preview.records)}\\n${subtreeJson}`\n : ''\n return useMemo(() => {\n if (!$id || !preview || recordCount < 2 || !subtreeJson) return []\n const snapshot = JSON.parse(subtreeJson) as Record<string, any>\n if (!snapshot[$id]) return []\n // A parent the copies can take their place in. The real parent is not in\n // this snapshot — only the subtree is — so a self-scoped repeat is given\n // a holder that lists it, which is all the expansion reads a parent for.\n const holderId = `${$id}__repeat-preview-parent`\n snapshot[$id] = { ...snapshot[$id], parentId: holderId }\n snapshot[holderId] = { $id: holderId, nodes: [$id] }\n const expanded = expandRepeatables(snapshot as never, {\n // Under the key the node stores, which is the key the expansion looks\n // the rows up by.\n ...(preview.datasetsByKey ?? {}),\n } as never) as Record<string, any>\n // The first record's copies are the ones the real nodes already draw. By\n // id, not by count: a copy leaves out an element whose binding its record\n // leaves empty (AGL-3616), so records need not copy alike.\n const firstCopy = `${REPEAT_NODE_ID_PREFIX}${$id}__0__`\n const copyIds = (\n (preview.scope === 'self'\n ? expanded[holderId]?.nodes\n : expanded[$id]?.nodes) ?? []\n ).filter((id: string) => !id.startsWith(firstCopy))\n return copyIds\n .map((id: string) => denormalize(expanded, id))\n .filter(Boolean)\n // `key` stands in for the records and the node; both are snapshots.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [$id, key, recordCount])\n}\n\n/** Nested-object form of an expanded map, which is what `Stem` walks. */\nfunction denormalize(\n nodes: Record<string, any>,\n rootId: string,\n seen: Set<string> = new Set(),\n): any {\n const node = nodes?.[rootId]\n if (!node || seen.has(rootId)) return undefined\n seen.add(rootId)\n return {\n ...node,\n children: ((node.nodes ?? []) as string[])\n .map((childId) => denormalize(nodes, childId, seen))\n .filter(Boolean),\n }\n}\n\n/**\n * A node's render copy with the record its subtree is drawing laid over it\n * (AGL-3111).\n *\n * Inside a repeating element the FIRST record's values belong on the real\n * canvas nodes, so the element an author edits reads as the first copy rather\n * than as a row of raw `{{item.*}}` tokens beside the copies that resolved\n * them. Render copies only — the node keeps its tokens, and every save writes\n * the template.\n */\nexport function useNodeWithRepeatRecord<N>(node: N): N {\n const context = useContext(RepeatRecordContext)\n const template = useContext(RepeatTemplateContext)\n const theme = useTheme()\n const chrome = useContext(CanvasChromeThemeContext) ?? theme\n const rendered = node as { props?: Record<string, unknown> } | null | undefined\n const propsJson =\n context || template ? JSON.stringify(rendered?.props ?? null) : ''\n return useMemo(() => {\n if (!rendered?.props) return node\n if (context) {\n const props = substituteRecordTokens({ ...rendered.props }, context)\n return { ...rendered, props } as N\n }\n const children = rendered.props['children']\n if (!template || typeof children !== 'string') return node\n const chipped = itemTokensAsChips(children, chrome)\n return chipped === children\n ? node\n : ({ ...rendered, props: { ...rendered.props, children: chipped } } as N)\n // Observable props: the JSON string keys the copy, as everywhere else.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [node, rendered, context, template, chrome, propsJson])\n}\n\n/** `{{item.<path>}}`, as the page's substitution reads a record field. */\nconst ITEM_TOKEN = /\\{\\{\\s*item\\.([A-Za-z_$][\\w$]*(?:\\.[A-Za-z_$][\\w$]*)*)\\s*\\}\\}/g\n\n/** `name` → `Name`, `photo_url` → `Photo url`: a field's key as words. */\nfunction fieldWords(path: string): string {\n const last = path.split('.').pop() ?? path\n const words = last\n .replace(/([a-z0-9])([A-Z])/g, '$1 $2')\n .replace(/[_-]+/g, ' ')\n .trim()\n .toLowerCase()\n return words.charAt(0).toUpperCase() + words.slice(1)\n}\n\n/**\n * `text` with each `{{item.*}}` token drawn as a chip, or `text` itself when\n * it holds none. The chip is the editors' own pill look (`tokenPillStyle`),\n * titled with the raw token so it stays inspectable.\n */\nexport function itemTokensAsChips(text: string, theme: Theme): ReactNode {\n const parts: ReactNode[] = []\n let last = 0\n for (const match of text.matchAll(ITEM_TOKEN)) {\n const at = match.index ?? 0\n if (at > last) parts.push(text.slice(last, at))\n parts.push(\n createElement(\n 'span',\n {\n key: `${at}`,\n title: match[0],\n 'data-aglyn-token-chip': '',\n style: { ...tokenPillStyle(theme, 'item'), cursor: 'inherit' },\n },\n fieldWords(match[1]),\n ),\n )\n last = at + match[0].length\n }\n if (!parts.length) return text\n if (last < text.length) parts.push(text.slice(last))\n return parts\n}\n\nexport default useRepeatPreview\n"],"names":["canvas","expandRepeatables","REPEAT_NODE_ID_PREFIX","repeatedRecords","repeatScope","substituteRecordTokens","repeatSourceOf","useTheme","createElement","useContext","useEffect","useMemo","useSyncExternalStore","RepeatRowsContext","repeatRowsKey","CanvasChromeThemeContext","RepeatRecordContext","RepeatTemplateContext","tokenPillStyle","subscribeToNothing","undefined","noVersion","useRepeatPreview","node","source","props","propsJson","JSON","stringify","request","repeat","sourceId","id","key","label","keyProp","retain","version","subscribe","getVersion","answer","get","status","records","scope","missing","dataset","rowsByKey","datasetsByKey","subtreeSnapshot","rootId","snapshot","walk","getNode","parse","childId","nodes","useRepeatCopies","preview","$id","recordCount","length","subtreeJson","expanded","holderId","parentId","firstCopy","copyIds","filter","startsWith","map","denormalize","Boolean","seen","Set","has","add","children","useNodeWithRepeatRecord","context","template","theme","chrome","rendered","chipped","itemTokensAsChips","ITEM_TOKEN","fieldWords","path","last","split","pop","words","replace","trim","toLowerCase","charAt","toUpperCase","slice","text","parts","match","matchAll","at","index","push","title","style","cursor"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GACD;;AAEA,SAASA,MAAM,QAAQ,eAA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;;QACrD,GACArB,WAAWc,KAAK,CAAC,EAAE;QAGvBZ,OAAOc,KAAKF,KAAK,CAAC,EAAE,CAACxC,MAAM;IAC7B;IACA,IAAI,CAACuC,MAAMvC,MAAM,EAAE,OAAOsC;IAC1B,IAAIV,OAAOU,KAAKtC,MAAM,EAAEuC,MAAMK,IAAI,CAACN,KAAKD,KAAK,CAACT;IAC9C,OAAOW;AACT;AAEA,eAAe9E,iBAAgB"}
|
|
@@ -35,7 +35,7 @@ export declare const BESIGNER_DOCS_ANCHORS: {
|
|
|
35
35
|
readonly elementCatalog: readonly ["#finding-an-element", "#element-search", "#element-detail", "#layout", "#the-pages-main-landmark", "#every-container-can-be-a-semantic-element", "#light-or-dark-whatever-the-visitor-picked", "#which-link-groups-want-to-be-a-nav", "#header-and-footer-for-your-site-chrome", "#grid", "#surface", "#accordion", "#navigation", "#where-a-link-opens", "#linking-to-a-collection-listing", "#link-container", "#tabs", "#tabs-that-go-to-another-screen", "#pagination", "#text", "#data-display", "#media", "#image", "#image-list", "#forms", "#commerce", "#members", "#input", "#related"];
|
|
36
36
|
readonly interactions: readonly ["#fluent-interactions", "#interactions-belong-to-the-page-they-are-on", "#plan-availability", "#pick-the-target-by-clicking", "#interaction-cookbook", "#scroll-to-element-step", "#play-video-step", "#open-a-lightbox", "#analytics-event-step", "#analytics-event-name", "#analytics-event-parameters", "#analytics-event-delivery", "#custom-html-block", "#related"];
|
|
37
37
|
readonly layouts: readonly ["#what-a-layout-is", "#find-a-layout", "#nested-layouts", "#layout-properties", "#restyle-the-layout-on-one-page", "#duplicate", "#generate-a-layout-with-aglyn-ai", "#used-by", "#layouts-vs-reusable-components", "#related"];
|
|
38
|
-
readonly repeat: readonly ["#turn-it-on", "#what-repeats-the-element-or-whats-inside-it", "#fill-each-copy-in", "#see-the-copies-while-you-design", "#bound-what-renders", "#the-hundred-record-ceiling", "#what-you-cant-do", "#when-a-dataset-goes-away", "#related"];
|
|
38
|
+
readonly repeat: readonly ["#turn-it-on", "#what-repeats-the-element-or-whats-inside-it", "#fill-each-copy-in", "#see-the-copies-while-you-design", "#bound-what-renders", "#the-hundred-record-ceiling", "#what-you-cant-do", "#repeat-over-a-connected-service", "#hide-part-of-a-copy-when-a-field-is-empty", "#when-a-dataset-goes-away", "#related"];
|
|
39
39
|
readonly responsiveStyling: readonly ["#style-per-breakpoint", "#mute-a-style", "#interaction-states", "#you-can-see-the-state-while-you-style-it", "#fields-you-dont-touch-keep-inheriting", "#states-and-breakpoints-combine", "#focus-state", "#box-stylers", "#spacing-side-names", "#spacing-units", "#spacing-steps", "#spacing-custom-amounts", "#unit-px", "#unit-rem", "#unit-em", "#unit-percent", "#unit-ch", "#unit-viewport", "#unit-small-viewport", "#style-groups", "#borders-without-css", "#picking-a-font", "#gradient-backgrounds", "#visibility-per-device-band", "#scheme-scoped-colors", "#pin-a-color-scheme", "#custom-classes", "#custom-css-sx", "#semantic-sections--theme-mode", "#edit-json-for-one-element"];
|
|
40
40
|
readonly reusableComponents: readonly ["#promote", "#insert-instances", "#properties", "#declare-them", "#make-a-property-conditional", "#use-them", "#save-then-publish", "#fill-them-in-per-page", "#restyle-one-instance", "#override-an-attribute-on-one-instance", "#retrofit-duplicated-sections", "#detach", "#nesting", "#used-by", "#manage", "#component-details-card", "#duplicate", "#reusable-email-blocks", "#make-a-header-or-footer", "#add-one-to-an-email", "#change-a-block-in-one-email", "#emails-you-have-not-designed", "#email-theme-colors", "#copy--paste-vs-reusable-components", "#tips", "#related"];
|
|
41
41
|
readonly seo: readonly ["#per-screen-seo", "#how-a-page-title-is-built", "#variables-so-a-title-is-not-a-copy-of-your-site-name", "#site-wide-defaults", "#site-description", "#title-separator", "#title-pattern", "#favicon", "#app-icon", "#site-social-image", "#every-icon-size-is-generated-for-you", "#your-sites-install-details-the-web-app-manifest", "#what-language-your-site-says-it-is-in", "#seo-check", "#target-keywords", "#check-one-page", "#search-engine-visibility", "#the-whole-site", "#a-single-page", "#verify-your-site-with-google-search-console", "#sitemap--robots", "#one-index-one-file-per-section", "#social-cards", "#what-each-kind-of-page-emits", "#structured-data", "#entity-card", "#entity-type", "#entity-description", "#entity-website", "#entity-contact", "#entity-logo", "#local-businesses", "#ai-agents", "#markdown-for-any-page", "#llmstxt", "#ai-agents-card", "#openapijson", "#well-knownapi-catalog", "#crawler-access", "#analytics-integration", "#related"];
|
|
@@ -142,6 +142,8 @@ export const BESIGNER_DOCS_ANCHORS = {
|
|
|
142
142
|
'#bound-what-renders',
|
|
143
143
|
'#the-hundred-record-ceiling',
|
|
144
144
|
'#what-you-cant-do',
|
|
145
|
+
'#repeat-over-a-connected-service',
|
|
146
|
+
'#hide-part-of-a-copy-when-a-field-is-empty',
|
|
145
147
|
'#when-a-dataset-goes-away',
|
|
146
148
|
'#related'
|
|
147
149
|
],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../../libs/besigner/feature/designer/src/lib/utils/docs-help.generated.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// GENERATED FILE — do not edit. Regenerate with:\n// node tools/scripts/generate-docs-help.mjs\n// Source of truth: apps/docs/docs frontmatter + headings (AGL-602).\n\n// The besigner designer lib can't import the console constants, so it carries\n// its own generated subset of the docs help registry.\n\nexport const BESIGNER_DOCS = {\n besigner: '/building-sites/besigner/overview',\n bindings: '/building-sites/bindings/overview',\n dragDropHierarchy: '/building-sites/besigner/drag-drop-hierarchy',\n elementCatalog: '/building-sites/besigner/element-catalog',\n interactions: '/building-sites/besigner/interactions-and-custom-html',\n layouts: '/building-sites/screens-and-layouts/layouts',\n repeat: '/building-sites/besigner/repeat',\n responsiveStyling: '/building-sites/besigner/responsive-styling',\n reusableComponents: '/building-sites/besigner/reusable-components',\n seo: '/building-sites/seo/overview',\n textEditing: '/building-sites/besigner/text-editing',\n} as const satisfies Record<string, string>\n\nexport type BesignerDocsKey = keyof typeof BESIGNER_DOCS\n\nexport const BESIGNER_DOCS_ANCHORS = {\n besigner: ['#preview-vs-canvas', '#publish-from-a-preview', '#what-you-can-do', '#the-canvas', '#hierarchy-panel', '#the-inspector', '#inline-and-rich-text', '#reusable-components', '#editing-together', '#ai-in-the-canvas', '#related'],\n bindings: ['#binding-tokens', '#rename-safe-id-tokens', '#insert-a-variable', '#token-pills', '#in-the-canvas-text-editor', '#site-details', '#typed-variables', '#no-code-functions', '#functions-card', '#parameters-a-visitor-can-answer', '#a-calculator-you-lay-out', '#where-used--safety', '#workflows', '#related'],\n dragDropHierarchy: ['#where-you-can-drag', '#what-a-drag-does', '#drop-zones-edges-vs-center', '#containers-vs-leaf-elements', '#containers-accept-children', '#leaf-elements-dont--dropping-on-one-makes-a-sibling', '#adding-a-new-element', '#when-a-drop-is-rejected', '#moving-an-element-without-dragging', '#multi-drag', '#tips', '#related'],\n elementCatalog: ['#finding-an-element', '#element-search', '#element-detail', '#layout', '#the-pages-main-landmark', '#every-container-can-be-a-semantic-element', '#light-or-dark-whatever-the-visitor-picked', '#which-link-groups-want-to-be-a-nav', '#header-and-footer-for-your-site-chrome', '#grid', '#surface', '#accordion', '#navigation', '#where-a-link-opens', '#linking-to-a-collection-listing', '#link-container', '#tabs', '#tabs-that-go-to-another-screen', '#pagination', '#text', '#data-display', '#media', '#image', '#image-list', '#forms', '#commerce', '#members', '#input', '#related'],\n interactions: ['#fluent-interactions', '#interactions-belong-to-the-page-they-are-on', '#plan-availability', '#pick-the-target-by-clicking', '#interaction-cookbook', '#scroll-to-element-step', '#play-video-step', '#open-a-lightbox', '#analytics-event-step', '#analytics-event-name', '#analytics-event-parameters', '#analytics-event-delivery', '#custom-html-block', '#related'],\n layouts: ['#what-a-layout-is', '#find-a-layout', '#nested-layouts', '#layout-properties', '#restyle-the-layout-on-one-page', '#duplicate', '#generate-a-layout-with-aglyn-ai', '#used-by', '#layouts-vs-reusable-components', '#related'],\n repeat: ['#turn-it-on', '#what-repeats-the-element-or-whats-inside-it', '#fill-each-copy-in', '#see-the-copies-while-you-design', '#bound-what-renders', '#the-hundred-record-ceiling', '#what-you-cant-do', '#when-a-dataset-goes-away', '#related'],\n responsiveStyling: ['#style-per-breakpoint', '#mute-a-style', '#interaction-states', '#you-can-see-the-state-while-you-style-it', '#fields-you-dont-touch-keep-inheriting', '#states-and-breakpoints-combine', '#focus-state', '#box-stylers', '#spacing-side-names', '#spacing-units', '#spacing-steps', '#spacing-custom-amounts', '#unit-px', '#unit-rem', '#unit-em', '#unit-percent', '#unit-ch', '#unit-viewport', '#unit-small-viewport', '#style-groups', '#borders-without-css', '#picking-a-font', '#gradient-backgrounds', '#visibility-per-device-band', '#scheme-scoped-colors', '#pin-a-color-scheme', '#custom-classes', '#custom-css-sx', '#semantic-sections--theme-mode', '#edit-json-for-one-element'],\n reusableComponents: ['#promote', '#insert-instances', '#properties', '#declare-them', '#make-a-property-conditional', '#use-them', '#save-then-publish', '#fill-them-in-per-page', '#restyle-one-instance', '#override-an-attribute-on-one-instance', '#retrofit-duplicated-sections', '#detach', '#nesting', '#used-by', '#manage', '#component-details-card', '#duplicate', '#reusable-email-blocks', '#make-a-header-or-footer', '#add-one-to-an-email', '#change-a-block-in-one-email', '#emails-you-have-not-designed', '#email-theme-colors', '#copy--paste-vs-reusable-components', '#tips', '#related'],\n seo: ['#per-screen-seo', '#how-a-page-title-is-built', '#variables-so-a-title-is-not-a-copy-of-your-site-name', '#site-wide-defaults', '#site-description', '#title-separator', '#title-pattern', '#favicon', '#app-icon', '#site-social-image', '#every-icon-size-is-generated-for-you', '#your-sites-install-details-the-web-app-manifest', '#what-language-your-site-says-it-is-in', '#seo-check', '#target-keywords', '#check-one-page', '#search-engine-visibility', '#the-whole-site', '#a-single-page', '#verify-your-site-with-google-search-console', '#sitemap--robots', '#one-index-one-file-per-section', '#social-cards', '#what-each-kind-of-page-emits', '#structured-data', '#entity-card', '#entity-type', '#entity-description', '#entity-website', '#entity-contact', '#entity-logo', '#local-businesses', '#ai-agents', '#markdown-for-any-page', '#llmstxt', '#ai-agents-card', '#openapijson', '#well-knownapi-catalog', '#crawler-access', '#analytics-integration', '#related'],\n textEditing: ['#edit-inline', '#committing', '#inline-toolbar', '#rich-text', '#the-text-attribute', '#text-field-formatting', '#remove-formatting', '#line-breaks', '#bindings-in-text', '#limits', '#wrapped-outlines', '#related'],\n} as const satisfies Partial<Record<BesignerDocsKey, readonly `#${string}`[]>>\n\ntype BesignerAnchorMap = typeof BESIGNER_DOCS_ANCHORS\n\n/** Valid heading anchors for a besigner docs page (`never` when none). */\nexport type BesignerDocsAnchor<K extends BesignerDocsKey> =\n K extends keyof BesignerAnchorMap ? BesignerAnchorMap[K][number] : never\n"],"names":["BESIGNER_DOCS","besigner","bindings","dragDropHierarchy","elementCatalog","interactions","layouts","repeat","responsiveStyling","reusableComponents","seo","textEditing","BESIGNER_DOCS_ANCHORS"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GACD,iDAAiD;AACjD,8CAA8C;AAC9C,oEAAoE;AAEpE,8EAA8E;AAC9E,sDAAsD;AAEtD,OAAO,MAAMA,gBAAgB;IAC3BC,UAAU;IACVC,UAAU;IACVC,mBAAmB;IACnBC,gBAAgB;IAChBC,cAAc;IACdC,SAAS;IACTC,QAAQ;IACRC,mBAAmB;IACnBC,oBAAoB;IACpBC,KAAK;IACLC,aAAa;AACf,EAA2C;AAI3C,OAAO,MAAMC,wBAAwB;IACnCX,UAAU;QAAC;QAAsB;QAA2B;QAAoB;QAAe;QAAoB;QAAkB;QAAyB;QAAwB;QAAqB;QAAqB;KAAW;IAC3OC,UAAU;QAAC;QAAmB;QAA0B;QAAsB;QAAgB;QAA8B;QAAiB;QAAoB;QAAsB;QAAmB;QAAoC;QAA6B;QAAuB;QAAc;KAAW;IAC3TC,mBAAmB;QAAC;QAAuB;QAAqB;QAA+B;QAAgC;QAA+B;QAAwD;QAAyB;QAA4B;QAAuC;QAAe;QAAS;KAAW;IACrVC,gBAAgB;QAAC;QAAuB;QAAmB;QAAmB;QAAW;QAA4B;QAA8C;QAA8C;QAAuC;QAA2C;QAAS;QAAY;QAAc;QAAe;QAAuB;QAAoC;QAAmB;QAAS;QAAmC;QAAe;QAAS;QAAiB;QAAU;QAAU;QAAe;QAAU;QAAa;QAAY;QAAU;KAAW;IACnlBC,cAAc;QAAC;QAAwB;QAAgD;QAAsB;QAAgC;QAAyB;QAA2B;QAAoB;QAAoB;QAAyB;QAAyB;QAA+B;QAA6B;QAAsB;KAAW;IACxXC,SAAS;QAAC;QAAqB;QAAkB;QAAmB;QAAsB;QAAmC;QAAc;QAAoC;QAAY;QAAmC;KAAW;IACzOC,QAAQ;QAAC;QAAe;QAAgD;QAAsB;QAAoC;QAAuB;QAA+B;QAAqB;QAA6B;KAAW;
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../libs/besigner/feature/designer/src/lib/utils/docs-help.generated.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// GENERATED FILE — do not edit. Regenerate with:\n// node tools/scripts/generate-docs-help.mjs\n// Source of truth: apps/docs/docs frontmatter + headings (AGL-602).\n\n// The besigner designer lib can't import the console constants, so it carries\n// its own generated subset of the docs help registry.\n\nexport const BESIGNER_DOCS = {\n besigner: '/building-sites/besigner/overview',\n bindings: '/building-sites/bindings/overview',\n dragDropHierarchy: '/building-sites/besigner/drag-drop-hierarchy',\n elementCatalog: '/building-sites/besigner/element-catalog',\n interactions: '/building-sites/besigner/interactions-and-custom-html',\n layouts: '/building-sites/screens-and-layouts/layouts',\n repeat: '/building-sites/besigner/repeat',\n responsiveStyling: '/building-sites/besigner/responsive-styling',\n reusableComponents: '/building-sites/besigner/reusable-components',\n seo: '/building-sites/seo/overview',\n textEditing: '/building-sites/besigner/text-editing',\n} as const satisfies Record<string, string>\n\nexport type BesignerDocsKey = keyof typeof BESIGNER_DOCS\n\nexport const BESIGNER_DOCS_ANCHORS = {\n besigner: ['#preview-vs-canvas', '#publish-from-a-preview', '#what-you-can-do', '#the-canvas', '#hierarchy-panel', '#the-inspector', '#inline-and-rich-text', '#reusable-components', '#editing-together', '#ai-in-the-canvas', '#related'],\n bindings: ['#binding-tokens', '#rename-safe-id-tokens', '#insert-a-variable', '#token-pills', '#in-the-canvas-text-editor', '#site-details', '#typed-variables', '#no-code-functions', '#functions-card', '#parameters-a-visitor-can-answer', '#a-calculator-you-lay-out', '#where-used--safety', '#workflows', '#related'],\n dragDropHierarchy: ['#where-you-can-drag', '#what-a-drag-does', '#drop-zones-edges-vs-center', '#containers-vs-leaf-elements', '#containers-accept-children', '#leaf-elements-dont--dropping-on-one-makes-a-sibling', '#adding-a-new-element', '#when-a-drop-is-rejected', '#moving-an-element-without-dragging', '#multi-drag', '#tips', '#related'],\n elementCatalog: ['#finding-an-element', '#element-search', '#element-detail', '#layout', '#the-pages-main-landmark', '#every-container-can-be-a-semantic-element', '#light-or-dark-whatever-the-visitor-picked', '#which-link-groups-want-to-be-a-nav', '#header-and-footer-for-your-site-chrome', '#grid', '#surface', '#accordion', '#navigation', '#where-a-link-opens', '#linking-to-a-collection-listing', '#link-container', '#tabs', '#tabs-that-go-to-another-screen', '#pagination', '#text', '#data-display', '#media', '#image', '#image-list', '#forms', '#commerce', '#members', '#input', '#related'],\n interactions: ['#fluent-interactions', '#interactions-belong-to-the-page-they-are-on', '#plan-availability', '#pick-the-target-by-clicking', '#interaction-cookbook', '#scroll-to-element-step', '#play-video-step', '#open-a-lightbox', '#analytics-event-step', '#analytics-event-name', '#analytics-event-parameters', '#analytics-event-delivery', '#custom-html-block', '#related'],\n layouts: ['#what-a-layout-is', '#find-a-layout', '#nested-layouts', '#layout-properties', '#restyle-the-layout-on-one-page', '#duplicate', '#generate-a-layout-with-aglyn-ai', '#used-by', '#layouts-vs-reusable-components', '#related'],\n repeat: ['#turn-it-on', '#what-repeats-the-element-or-whats-inside-it', '#fill-each-copy-in', '#see-the-copies-while-you-design', '#bound-what-renders', '#the-hundred-record-ceiling', '#what-you-cant-do', '#repeat-over-a-connected-service', '#hide-part-of-a-copy-when-a-field-is-empty', '#when-a-dataset-goes-away', '#related'],\n responsiveStyling: ['#style-per-breakpoint', '#mute-a-style', '#interaction-states', '#you-can-see-the-state-while-you-style-it', '#fields-you-dont-touch-keep-inheriting', '#states-and-breakpoints-combine', '#focus-state', '#box-stylers', '#spacing-side-names', '#spacing-units', '#spacing-steps', '#spacing-custom-amounts', '#unit-px', '#unit-rem', '#unit-em', '#unit-percent', '#unit-ch', '#unit-viewport', '#unit-small-viewport', '#style-groups', '#borders-without-css', '#picking-a-font', '#gradient-backgrounds', '#visibility-per-device-band', '#scheme-scoped-colors', '#pin-a-color-scheme', '#custom-classes', '#custom-css-sx', '#semantic-sections--theme-mode', '#edit-json-for-one-element'],\n reusableComponents: ['#promote', '#insert-instances', '#properties', '#declare-them', '#make-a-property-conditional', '#use-them', '#save-then-publish', '#fill-them-in-per-page', '#restyle-one-instance', '#override-an-attribute-on-one-instance', '#retrofit-duplicated-sections', '#detach', '#nesting', '#used-by', '#manage', '#component-details-card', '#duplicate', '#reusable-email-blocks', '#make-a-header-or-footer', '#add-one-to-an-email', '#change-a-block-in-one-email', '#emails-you-have-not-designed', '#email-theme-colors', '#copy--paste-vs-reusable-components', '#tips', '#related'],\n seo: ['#per-screen-seo', '#how-a-page-title-is-built', '#variables-so-a-title-is-not-a-copy-of-your-site-name', '#site-wide-defaults', '#site-description', '#title-separator', '#title-pattern', '#favicon', '#app-icon', '#site-social-image', '#every-icon-size-is-generated-for-you', '#your-sites-install-details-the-web-app-manifest', '#what-language-your-site-says-it-is-in', '#seo-check', '#target-keywords', '#check-one-page', '#search-engine-visibility', '#the-whole-site', '#a-single-page', '#verify-your-site-with-google-search-console', '#sitemap--robots', '#one-index-one-file-per-section', '#social-cards', '#what-each-kind-of-page-emits', '#structured-data', '#entity-card', '#entity-type', '#entity-description', '#entity-website', '#entity-contact', '#entity-logo', '#local-businesses', '#ai-agents', '#markdown-for-any-page', '#llmstxt', '#ai-agents-card', '#openapijson', '#well-knownapi-catalog', '#crawler-access', '#analytics-integration', '#related'],\n textEditing: ['#edit-inline', '#committing', '#inline-toolbar', '#rich-text', '#the-text-attribute', '#text-field-formatting', '#remove-formatting', '#line-breaks', '#bindings-in-text', '#limits', '#wrapped-outlines', '#related'],\n} as const satisfies Partial<Record<BesignerDocsKey, readonly `#${string}`[]>>\n\ntype BesignerAnchorMap = typeof BESIGNER_DOCS_ANCHORS\n\n/** Valid heading anchors for a besigner docs page (`never` when none). */\nexport type BesignerDocsAnchor<K extends BesignerDocsKey> =\n K extends keyof BesignerAnchorMap ? BesignerAnchorMap[K][number] : never\n"],"names":["BESIGNER_DOCS","besigner","bindings","dragDropHierarchy","elementCatalog","interactions","layouts","repeat","responsiveStyling","reusableComponents","seo","textEditing","BESIGNER_DOCS_ANCHORS"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GACD,iDAAiD;AACjD,8CAA8C;AAC9C,oEAAoE;AAEpE,8EAA8E;AAC9E,sDAAsD;AAEtD,OAAO,MAAMA,gBAAgB;IAC3BC,UAAU;IACVC,UAAU;IACVC,mBAAmB;IACnBC,gBAAgB;IAChBC,cAAc;IACdC,SAAS;IACTC,QAAQ;IACRC,mBAAmB;IACnBC,oBAAoB;IACpBC,KAAK;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