@unlayer/react-elements 0.1.18 → 0.1.19
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/README.md +6 -1
- package/dist/index.cjs +4 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +20 -1
- package/dist/index.d.ts +20 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -331,7 +331,12 @@ The document shell matches the mode: `<Email>` gets the XHTML transitional docty
|
|
|
331
331
|
- `title` — document `<title>`
|
|
332
332
|
- `fonts` — web-font stylesheet URLs to load via `<link>` tags, e.g. `[{ url: "https://fonts.googleapis.com/css2?family=Inter" }]`
|
|
333
333
|
|
|
334
|
-
If your app owns the document shell (an existing page template, an ESP template, an iframe `srcdoc`), use `renderToHtmlParts` instead — it returns `{ head, body }`
|
|
334
|
+
If your app owns the document shell (an existing page template, an ESP template, an iframe `srcdoc`), use `renderToHtmlParts` instead — it returns `{ head, body }` plus the granular pieces (`css`, `js`, `tags`) for pipelines that need them separately, e.g. CSS inlining. This mirrors the editor's [chunk parameters](https://docs.unlayer.com/builder/latest/export-html#chunk-parameters) with two deliberate differences: `tags` is extra (components can contribute head tags, and reassembling from `css` + `js` alone would drop them), and there is no `fonts` chunk (Elements has no font registry — pass font stylesheet URLs via `renderToHtml`'s `fonts` option instead).
|
|
335
|
+
|
|
336
|
+
```tsx
|
|
337
|
+
const { head, body, css, js, tags } = renderToHtmlParts(<Email>...</Email>);
|
|
338
|
+
// head = css/js/tags pre-assembled; css = raw stylesheet (no <style> wrapper)
|
|
339
|
+
```
|
|
335
340
|
|
|
336
341
|
## Custom Tools
|
|
337
342
|
|
package/dist/index.cjs
CHANGED