Docs: image lightbox page, agent guide, skills, audit check, upgrade note
- docs/lightbox.md: setup, sizes, styling, overrides, migration from a hand-made modal or glightbox - AGENT.md (§6.9, §7 catalog, §7.1, §12), ipal-reference (option, wiring, api.md section), ipal-site and ipal-block steps, PROGRAMISTA §6 row 48 - ipal-audit warns about lightbox libraries - notifications.md, richtext.md, media.md, frontend.md, README index Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
476c3ac1df
commit
7eacf1e713
@@ -89,6 +89,18 @@ const items = block.tableOfContents?.show ? extractHeadings(block.content) : []
|
||||
- `buildTableOfContentsField({ name = 'tableOfContents' })` — a "Show table of contents" switch + a localized label (type `TableOfContentsSettings`).
|
||||
A new field in a block = a migration (`pnpm payload migrate:create`).
|
||||
|
||||
## Click-to-enlarge images (lightbox, opt-in)
|
||||
|
||||
```tsx
|
||||
<RenderRichText data={post.content} lightbox />
|
||||
<RenderRichText data={post.content} lightbox={{ group: 'post', image: { size: 'hero' }, triggerClassName: 'my-8' }} />
|
||||
```
|
||||
|
||||
Each image upload is wrapped in `<LightboxTrigger>` (`/client`); the images of the page browse as one
|
||||
gallery (default group `'richtext'`, `group: false` = each alone). Your own `upload` converter still
|
||||
renders the inline image. Your own renderer: `converters={withLightboxUploads(myConverters, options)}`
|
||||
(`/rsc`). Details, labels and styling: [lightbox.md](./lightbox.md).
|
||||
|
||||
## lexicalToMarkdown — richText → Markdown (for AI)
|
||||
|
||||
For readability by AI agents (Markdown per page, llms-full) you need
|
||||
@@ -127,6 +139,7 @@ project already has (it is the editor). No extra dependencies.
|
||||
|
||||
- The module has no option in `ipalKit()` — it adds nothing to the schema; you use the components and functions or you don't.
|
||||
- Override the look of nodes through `converters` (spread `defaultConverters`); heading ids through `headingIds` (`levels`, `className`).
|
||||
- Image lightbox: off by default; `lightbox` turns it on, `withLightboxUploads` is the building block (lightbox.md).
|
||||
- Link filtering: on by default; `safeLinks={false}` turns it off for fully trusted content.
|
||||
- `extractHeadings(data, { levels })` and `headingText(node)` — building blocks for your own table of contents; style `<TableOfContents>` with `classNames`, the active-section threshold with `offset`.
|
||||
- `lexicalToMarkdown` has no options (the handled nodes are fixed; unknown ones degrade to text) — another format needs your own converter.
|
||||
|
||||
Reference in New Issue
Block a user