@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 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 }` chunks for you to place yourself.
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
@@ -1857,7 +1857,10 @@ function renderToHtmlParts(element, config) {
1857
1857
  }
1858
1858
  return {
1859
1859
  head: headParts.join("\n"),
1860
- body
1860
+ body,
1861
+ css,
1862
+ js,
1863
+ tags
1861
1864
  };
1862
1865
  }
1863
1866
  var schemaVersion = exporters.schemaVersion ?? 24;