@braincrew-lab/langchain-canvas 0.7.1 → 0.7.2

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.
Files changed (2) hide show
  1. package/dist/index.js +5 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2310,6 +2310,7 @@ var dataExporters = {
2310
2310
  { label: "PowerPoint", extension: "pptx", mime: MIME.pptx, build: (a) => slidesToPptx(a.data, a.title) }
2311
2311
  ]
2312
2312
  };
2313
+ var PRINT_COLOR_CSS = "*{-webkit-print-color-adjust:exact;print-color-adjust:exact}";
2313
2314
  function toStandaloneHtml(title, renderedHtml) {
2314
2315
  return `<!doctype html>
2315
2316
  <html lang="en">
@@ -2317,7 +2318,8 @@ function toStandaloneHtml(title, renderedHtml) {
2317
2318
  <meta charset="utf-8" />
2318
2319
  <meta name="viewport" content="width=device-width, initial-scale=1" />
2319
2320
  <title>${escapeHtml(title)}</title>
2320
- <style>${EXPORT_CSS}</style>
2321
+ <style>${EXPORT_CSS}
2322
+ ${PRINT_COLOR_CSS}</style>
2321
2323
  </head>
2322
2324
  <body>
2323
2325
  <main class="export">
@@ -2472,6 +2474,7 @@ function slidesToPrintHtml(data, title) {
2472
2474
  return `<!doctype html><html><head><meta charset="utf-8"><title>${escapeXml(title)}</title><style>
2473
2475
  @page { size: ${pw}px ${ph}px; margin: 0; }
2474
2476
  * { margin: 0; box-sizing: border-box; }
2477
+ ${PRINT_COLOR_CSS}
2475
2478
  body { font-family: Inter, Arial, sans-serif; }
2476
2479
  .slide { position: relative; width: ${pw}px; height: ${ph}px; overflow: hidden; page-break-after: always; }
2477
2480
  .el { position: absolute; overflow: hidden; line-height: 1.25; }
@@ -2481,7 +2484,7 @@ function slidesToPrintHtml(data, title) {
2481
2484
  function htmlSlideToPrintHtml(html, ratio) {
2482
2485
  const w = ratio === "4:3" ? 960 : 1280;
2483
2486
  const h = 720;
2484
- const style = `<style>@page{size:${w}px ${h}px;margin:0}html,body{margin:0!important;padding:0!important;background:#fff}.slide-container{width:${w}px!important;height:${h}px!important;box-shadow:none!important;border-radius:0!important;overflow:hidden!important;page-break-after:avoid}</style>`;
2487
+ const style = `<style>@page{size:${w}px ${h}px;margin:0}${PRINT_COLOR_CSS}html,body{margin:0!important;padding:0!important;background:#fff}.slide-container{width:${w}px!important;height:${h}px!important;box-shadow:none!important;border-radius:0!important;overflow:hidden!important;page-break-after:avoid}</style>`;
2485
2488
  const i = html.toLowerCase().lastIndexOf("</head>");
2486
2489
  return i === -1 ? style + html : html.slice(0, i) + style + html.slice(i);
2487
2490
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@braincrew-lab/langchain-canvas",
3
- "version": "0.7.1",
3
+ "version": "0.7.2",
4
4
  "description": "A live canvas for LangChain agents — stream documents, charts, and rich artifacts into a React panel.",
5
5
  "license": "MIT",
6
6
  "author": "Brain Crew (https://github.com/braincrew-lab)",