@usethrottle/builder-react 0.4.3 → 0.5.1
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/CLAUDE.md +23 -2
- package/dist/{chunk-C57AQKJI.js → chunk-G6I4RIXU.js} +2122 -393
- package/dist/{chunk-E7SRVAFV.cjs → chunk-UNL4JWZS.cjs} +1992 -263
- package/dist/index.cjs +2251 -603
- package/dist/index.d.cts +186 -61
- package/dist/index.d.ts +186 -61
- package/dist/index.js +2218 -569
- package/dist/next.cjs +383 -13
- package/dist/next.d.cts +92 -3
- package/dist/next.d.ts +92 -3
- package/dist/next.js +385 -15
- package/dist/{seo-BYBk3Sya.d.cts → seo-iX2POfOp.d.cts} +39 -2
- package/dist/{seo-BYBk3Sya.d.ts → seo-iX2POfOp.d.ts} +39 -2
- package/dist/server.cjs +193 -24
- package/dist/server.d.cts +187 -8
- package/dist/server.d.ts +187 -8
- package/dist/server.js +176 -7
- package/package.json +4 -4
package/CLAUDE.md
CHANGED
|
@@ -166,10 +166,31 @@ below `BuilderProvider`, and it builds its own appearance from that design.
|
|
|
166
166
|
from their validated settings (a common setting), columns and sections from `resolveEntrance` (a column uses desktop).
|
|
167
167
|
- **Countdown** server text is UTC (`YYYY-MM-DD HH:mm UTC`) so server and client agree; the ticking boxes are filled by the
|
|
168
168
|
runtime only (no `Date.now()` in a live render, so no hydration mismatch and ISR stays valid).
|
|
169
|
-
- **Custom CSS.** `theme.ts` `customCssOf(settings)` runs `
|
|
170
|
-
|
|
169
|
+
- **Custom CSS.** `theme.ts` `customCssOf(settings, mediaOrigin)` runs `sanitizeSiteCss` again with the site's media origin
|
|
170
|
+
(T-C4: unscoped, never the stored string; any refused token drops the whole sheet; the sanitised size decides inline vs
|
|
171
|
+
`customCssHref`) and the provider emits it once in `@layer throttle,throttle-custom;@layer throttle-custom{...}` when non-empty. The
|
|
171
172
|
renderer root gets `data-b-root` only when the provider says there is CSS (`scopeCustomCss`), so a page without it is unchanged.
|
|
172
173
|
|
|
174
|
+
## Common props, Meridian basics (T-B1, T-B2)
|
|
175
|
+
|
|
176
|
+
- **`cssClass`** (node-level, beside `props`) is put on the node root by `NodeWrapper`, after `cssClassSchema` re-checks it (a bad token drops the
|
|
177
|
+
whole list). **`showWhen`** is drawn by `show-when.tsx` `ShowWhen`, a client leaf the renderer wraps a gated node in (the editor never gates):
|
|
178
|
+
the server and the first client render draw the `guest` and `empty` branches and a hidden `tb-sw` placeholder (never the content) for `signed-in`
|
|
179
|
+
and `has-items`, with the reserved height per device as `--tb-sw-h|ht|hp` (a section's `minHeight`, a widget's `height` as px or a spacing
|
|
180
|
+
token, a column's stacked children, a section's tallest column; 0 where hidden; `show-when-browser.test.ts` proves in Chromium that what
|
|
181
|
+
follows does not move when the node appears). After mount the store's
|
|
182
|
+
`BuilderProvider viewer` (`{ signedIn, cartItemCount }`, `null` = still loading) decides; no `viewer` means a guest with an empty cart.
|
|
183
|
+
**`showWhen` is presentation only, NOT access control**: the document and everything a node draws go to every visitor. Never put member
|
|
184
|
+
prices, codes or private content behind it.
|
|
185
|
+
- **v2 basics** (`basics/v2/`): FAQ, rich content, SVG, icon list, quote, breadcrumbs and heading v2 are `PackWidget`s built from builder-schema's
|
|
186
|
+
definitions (`mbDefinition`). Stored values are untrusted: `sanitizeRichContent` / `sanitizeSvg` run at render time and their output is read into
|
|
187
|
+
React elements by `v2/markup.tsx` (no raw HTML; attribute names go through an allow-list, `href`/`src` are checked unconditionally). A
|
|
188
|
+
media-library SVG is fetched in the browser (`redirect: 'error'`, no credentials, answer from the media origin, `image/svg+xml`, at most 20 KB),
|
|
189
|
+
sanitised, then inlined (an image until then). That fetch needs CORS from the media origin and, for a store with a CSP, `connect-src` for it;
|
|
190
|
+
without either the image stays. Their styles are a second hoisted sheet (`v2/styles.tsx`), so the parity golden does not move.
|
|
191
|
+
- JSON-LD (`FAQPage`, `BreadcrumbList`) is emitted only when the site's `seo.structuredData.faq` / `.breadcrumbs` is on. Breadcrumb URLs are site paths.
|
|
192
|
+
- The pack carries the latest version of each basic type (heading v2 replaces v1); a stored v1 node is upgraded in memory by `renderer.tsx`.
|
|
193
|
+
|
|
173
194
|
## SEO (`src/next/seo.ts`)
|
|
174
195
|
|
|
175
196
|
`createBuilderPage().generateMetadata` is `metadataOf(page, ...)`: the page's own `seo` over the
|