docgen-utils 1.0.17 → 1.0.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.
Files changed (37) hide show
  1. package/dist/bundle.js +441 -176
  2. package/dist/bundle.min.js +233 -233
  3. package/dist/cli.js +496 -151
  4. package/dist/packages/cli/commands/export-docs.d.ts +2 -3
  5. package/dist/packages/cli/commands/export-docs.d.ts.map +1 -1
  6. package/dist/packages/cli/commands/export-docs.js +108 -101
  7. package/dist/packages/cli/commands/export-docs.js.map +1 -1
  8. package/dist/packages/cli/commands/export-slides.d.ts +10 -0
  9. package/dist/packages/cli/commands/export-slides.d.ts.map +1 -1
  10. package/dist/packages/cli/commands/export-slides.js +41 -26
  11. package/dist/packages/cli/commands/export-slides.js.map +1 -1
  12. package/dist/packages/docs/convert.d.ts.map +1 -1
  13. package/dist/packages/docs/convert.js +14 -10
  14. package/dist/packages/docs/convert.js.map +1 -1
  15. package/dist/packages/docs/import-docx.d.ts.map +1 -1
  16. package/dist/packages/docs/import-docx.js +256 -11
  17. package/dist/packages/docs/import-docx.js.map +1 -1
  18. package/dist/packages/shared/fetch-with-proxy.d.ts +18 -0
  19. package/dist/packages/shared/fetch-with-proxy.d.ts.map +1 -0
  20. package/dist/packages/shared/fetch-with-proxy.js +200 -0
  21. package/dist/packages/shared/fetch-with-proxy.js.map +1 -0
  22. package/dist/packages/shared/fonts.d.ts +73 -0
  23. package/dist/packages/shared/fonts.d.ts.map +1 -0
  24. package/dist/packages/shared/fonts.js +251 -0
  25. package/dist/packages/shared/fonts.js.map +1 -0
  26. package/dist/packages/slides/common.d.ts +4 -0
  27. package/dist/packages/slides/common.d.ts.map +1 -1
  28. package/dist/packages/slides/convert.d.ts.map +1 -1
  29. package/dist/packages/slides/convert.js +34 -4
  30. package/dist/packages/slides/convert.js.map +1 -1
  31. package/dist/packages/slides/fonts.d.ts +4 -37
  32. package/dist/packages/slides/fonts.d.ts.map +1 -1
  33. package/dist/packages/slides/fonts.js +4 -205
  34. package/dist/packages/slides/fonts.js.map +1 -1
  35. package/dist/packages/slides/vendor/pptxgen.d.ts +2 -0
  36. package/dist/packages/slides/vendor/pptxgen.js +2 -1
  37. package/package.json +2 -3
package/dist/bundle.js CHANGED
@@ -51313,6 +51313,198 @@ var docgen = (() => {
51313
51313
  return elements;
51314
51314
  }
51315
51315
 
51316
+ // packages/shared/fonts.js
51317
+ var FONT_MAP = {
51318
+ // ---- Microsoft Office fonts ----
51319
+ "Calibri": { cssFallback: "'Calibri','Carlito','Helvetica Neue',Helvetica,Arial,sans-serif", officeFont: "Calibri", category: "sans-serif" },
51320
+ "Calibri Light": { cssFallback: "'Calibri Light','Carlito','Helvetica Neue Light','Helvetica Neue',Arial,sans-serif", officeFont: "Calibri Light", category: "sans-serif" },
51321
+ "Cambria": { cssFallback: "'Cambria','Caladea','Times New Roman',Georgia,serif", officeFont: "Cambria", category: "serif" },
51322
+ "Cambria Math": { cssFallback: "'Cambria Math','Caladea','Times New Roman',serif", officeFont: "Cambria Math", category: "serif" },
51323
+ "Consolas": { cssFallback: "'Consolas','Courier New',monospace", officeFont: "Consolas", category: "monospace" },
51324
+ "Aptos": { cssFallback: "'Aptos','Carlito','Helvetica Neue',Arial,sans-serif", officeFont: "Aptos", category: "sans-serif" },
51325
+ "Times New Roman": { cssFallback: "'Times New Roman','Liberation Serif',Georgia,serif", officeFont: "Times New Roman", category: "serif" },
51326
+ // ---- Handwriting / decorative fonts ----
51327
+ "MV Boli": { cssFallback: "'MV Boli','Comic Sans MS','Marker Felt',cursive", officeFont: "MV Boli", category: "cursive" },
51328
+ "Kristen ITC": { cssFallback: "'Kristen ITC','Comic Sans MS','Marker Felt',cursive", officeFont: "Kristen ITC", category: "cursive" },
51329
+ "Stylus BT": { cssFallback: "'Stylus BT','Brush Script MT','Snell Roundhand',cursive", officeFont: "Stylus BT", category: "cursive" },
51330
+ "Caveat": { cssFallback: "'Caveat','Comic Sans MS','Marker Felt',cursive", officeFont: "Caveat", category: "cursive" },
51331
+ // ---- Japanese sans-serif fonts ----
51332
+ "MS Gothic": { cssFallback: "'MS Gothic','Noto Sans CJK JP','Hiragino Kaku Gothic ProN','Yu Gothic',sans-serif", officeFont: "MS Gothic", category: "sans-serif" },
51333
+ "MS PGothic": { cssFallback: "'MS PGothic','Noto Sans CJK JP','Hiragino Kaku Gothic ProN','Yu Gothic',sans-serif", officeFont: "MS PGothic", category: "sans-serif" },
51334
+ "\uFF2D\uFF33 \uFF30\u30B4\u30B7\u30C3\u30AF": { cssFallback: "'\uFF2D\uFF33 \uFF30\u30B4\u30B7\u30C3\u30AF','Noto Sans CJK JP','Hiragino Kaku Gothic ProN','Yu Gothic',sans-serif", officeFont: "\uFF2D\uFF33 \uFF30\u30B4\u30B7\u30C3\u30AF", category: "sans-serif" },
51335
+ "\uFF2D\uFF33 \u30B4\u30B7\u30C3\u30AF": { cssFallback: "'\uFF2D\uFF33 \u30B4\u30B7\u30C3\u30AF','Noto Sans CJK JP','Hiragino Kaku Gothic ProN','Yu Gothic',sans-serif", officeFont: "\uFF2D\uFF33 \u30B4\u30B7\u30C3\u30AF", category: "sans-serif" },
51336
+ "Kozuka Gothic Pro R": { cssFallback: "'Kozuka Gothic Pro R','Noto Sans CJK JP','Hiragino Kaku Gothic ProN',sans-serif", officeFont: "Kozuka Gothic Pro R", category: "sans-serif" },
51337
+ "Kozuka Gothic Pro B": { cssFallback: "'Kozuka Gothic Pro B','Noto Sans CJK JP Bold','Hiragino Kaku Gothic ProN',sans-serif", officeFont: "Kozuka Gothic Pro B", category: "sans-serif" },
51338
+ "Kozuka Gothic Pro M": { cssFallback: "'Kozuka Gothic Pro M','Noto Sans CJK JP Medium','Hiragino Kaku Gothic ProN',sans-serif", officeFont: "Kozuka Gothic Pro M", category: "sans-serif" },
51339
+ "Kozuka Gothic Pro EL": { cssFallback: "'Kozuka Gothic Pro EL','Noto Sans CJK JP Light','Hiragino Kaku Gothic ProN',sans-serif", officeFont: "Kozuka Gothic Pro EL", category: "sans-serif" },
51340
+ "HGSKyokashotai": { cssFallback: "'HGSKyokashotai','Noto Sans CJK JP','Hiragino Kaku Gothic ProN',sans-serif", officeFont: "HGSKyokashotai", category: "sans-serif" },
51341
+ // ---- Japanese serif fonts ----
51342
+ "MS Mincho": { cssFallback: "'MS Mincho','Noto Serif CJK JP','Hiragino Mincho ProN','Yu Mincho',serif", officeFont: "MS Mincho", category: "serif" },
51343
+ "MS PMincho": { cssFallback: "'MS PMincho','Noto Serif CJK JP','Hiragino Mincho ProN','Yu Mincho',serif", officeFont: "MS PMincho", category: "serif" },
51344
+ // ---- CJK fonts (Chinese, Korean) ----
51345
+ "\u5B8B\u4F53": { cssFallback: "'\u5B8B\u4F53','Noto Serif CJK SC','Songti SC','STSong',serif", officeFont: "\u5B8B\u4F53", category: "serif" },
51346
+ "\u65B0\u7D30\u660E\u9AD4": { cssFallback: "'\u65B0\u7D30\u660E\u9AD4','Noto Serif CJK TC','Songti TC',serif", officeFont: "\u65B0\u7D30\u660E\u9AD4", category: "serif" },
51347
+ "\u9ED1\u4F53": { cssFallback: "'\u9ED1\u4F53','Noto Sans CJK SC','Heiti SC','STHeiti',sans-serif", officeFont: "\u9ED1\u4F53", category: "sans-serif" },
51348
+ "\u5FAE\u8EDF\u6B63\u9ED1\u9AD4": { cssFallback: "'\u5FAE\u8EDF\u6B63\u9ED1\u9AD4','Noto Sans CJK TC','Heiti TC',sans-serif", officeFont: "\u5FAE\u8EDF\u6B63\u9ED1\u9AD4", category: "sans-serif" },
51349
+ "\uB9D1\uC740 \uACE0\uB515": { cssFallback: "'\uB9D1\uC740 \uACE0\uB515','Apple SD Gothic Neo',sans-serif", officeFont: "\uB9D1\uC740 \uACE0\uB515", category: "sans-serif" },
51350
+ // ---- UI / system fonts ----
51351
+ "Lucida Sans Unicode": { cssFallback: "'Lucida Sans Unicode','Lucida Grande','Lucida Sans',sans-serif", officeFont: "Lucida Sans Unicode", category: "sans-serif" },
51352
+ "Segoe UI": { cssFallback: "'Segoe UI','-apple-system','Helvetica Neue',sans-serif", officeFont: "Segoe UI", category: "sans-serif" },
51353
+ "Segoe Sans Display": { cssFallback: "'Segoe Sans Display','-apple-system','Helvetica Neue',Arial,sans-serif", officeFont: "Segoe Sans Display", category: "sans-serif" },
51354
+ "Segoe Sans Display Semibold": { cssFallback: "'Segoe Sans Display Semibold','-apple-system','Helvetica Neue',Arial,sans-serif", officeFont: "Segoe Sans Display Semibold", category: "sans-serif" },
51355
+ "Segoe Sans Small Regular": { cssFallback: "'Segoe Sans Small Regular','Segoe UI','-apple-system','Helvetica Neue',sans-serif", officeFont: "Segoe Sans Small Regular", category: "sans-serif" },
51356
+ "Segoe Sans Text Regular": { cssFallback: "'Segoe Sans Text Regular','Segoe UI','-apple-system','Helvetica Neue',sans-serif", officeFont: "Segoe Sans Text Regular", category: "sans-serif" },
51357
+ "Grandview": { cssFallback: "'Grandview','Helvetica Neue',Arial,sans-serif", officeFont: "Grandview", category: "sans-serif" },
51358
+ "Nirmala UI": { cssFallback: "'Nirmala UI','Helvetica Neue',Arial,sans-serif", officeFont: "Nirmala UI", category: "sans-serif" },
51359
+ "Ebrima": { cssFallback: "'Ebrima','Helvetica Neue',Arial,sans-serif", officeFont: "Ebrima", category: "sans-serif" },
51360
+ // ---- Google Fonts / web fonts (sans-serif) ----
51361
+ // Preserve original font names in Office export for maximum fidelity.
51362
+ // Office apps will render these correctly if the fonts are installed,
51363
+ // and fall back gracefully if not. The cssFallback stack provides
51364
+ // alternatives for HTML rendering (import side) only.
51365
+ "Inter": { cssFallback: "'Inter','Helvetica Neue',Helvetica,Arial,sans-serif", officeFont: "Inter", category: "sans-serif" },
51366
+ "Inter Light": { cssFallback: "'Inter Light','Inter','Helvetica Neue',Arial,sans-serif", officeFont: "Inter Light", category: "sans-serif" },
51367
+ "Inter ExtraBold": { cssFallback: "'Inter ExtraBold','Inter','Helvetica Neue',Arial,sans-serif", officeFont: "Inter ExtraBold", category: "sans-serif" },
51368
+ "Roboto": { cssFallback: "'Roboto','Helvetica Neue',Helvetica,Arial,sans-serif", officeFont: "Roboto", category: "sans-serif" },
51369
+ "Open Sans": { cssFallback: "'Open Sans','Helvetica Neue',Helvetica,Arial,sans-serif", officeFont: "Open Sans", category: "sans-serif" },
51370
+ "Lato": { cssFallback: "'Lato','Helvetica Neue',Helvetica,Arial,sans-serif", officeFont: "Lato", category: "sans-serif" },
51371
+ "Montserrat": { cssFallback: "'Montserrat','Helvetica Neue',Helvetica,Arial,sans-serif", officeFont: "Montserrat", category: "sans-serif" },
51372
+ "Montserrat SemiBold": { cssFallback: "'Montserrat SemiBold','Montserrat','Helvetica Neue',Arial,sans-serif", officeFont: "Montserrat SemiBold", category: "sans-serif" },
51373
+ "Montserrat ExtraBold": { cssFallback: "'Montserrat ExtraBold','Montserrat','Helvetica Neue',Arial,sans-serif", officeFont: "Montserrat ExtraBold", category: "sans-serif" },
51374
+ "Poppins": { cssFallback: "'Poppins','Helvetica Neue',Helvetica,Arial,sans-serif", officeFont: "Poppins", category: "sans-serif" },
51375
+ "Source Sans Pro": { cssFallback: "'Source Sans Pro','Helvetica Neue',Helvetica,Arial,sans-serif", officeFont: "Source Sans Pro", category: "sans-serif" },
51376
+ "Nunito": { cssFallback: "'Nunito','Helvetica Neue',Helvetica,Arial,sans-serif", officeFont: "Nunito", category: "sans-serif" },
51377
+ "Raleway": { cssFallback: "'Raleway','Helvetica Neue',Helvetica,Arial,sans-serif", officeFont: "Raleway", category: "sans-serif" },
51378
+ "Ubuntu": { cssFallback: "'Ubuntu','Helvetica Neue',Helvetica,Arial,sans-serif", officeFont: "Ubuntu", category: "sans-serif" },
51379
+ "PT Sans": { cssFallback: "'PT Sans','Helvetica Neue',Helvetica,Arial,sans-serif", officeFont: "PT Sans", category: "sans-serif" },
51380
+ "Noto Sans": { cssFallback: "'Noto Sans','Helvetica Neue',Helvetica,Arial,sans-serif", officeFont: "Noto Sans", category: "sans-serif" },
51381
+ "Fira Sans": { cssFallback: "'Fira Sans','Helvetica Neue',Helvetica,Arial,sans-serif", officeFont: "Fira Sans", category: "sans-serif" },
51382
+ "Work Sans": { cssFallback: "'Work Sans','Helvetica Neue',Helvetica,Arial,sans-serif", officeFont: "Work Sans", category: "sans-serif" },
51383
+ "Space Grotesk": { cssFallback: "'Space Grotesk','Helvetica Neue',Helvetica,Arial,sans-serif", officeFont: "Space Grotesk", category: "sans-serif" },
51384
+ "Oswald": { cssFallback: "'Oswald','Helvetica Neue',Helvetica,Arial,sans-serif", officeFont: "Oswald", category: "sans-serif" },
51385
+ "Archivo": { cssFallback: "'Archivo','Helvetica Neue',Helvetica,Arial,sans-serif", officeFont: "Archivo", category: "sans-serif" },
51386
+ "Economica": { cssFallback: "'Economica','Helvetica Neue',Arial,sans-serif", officeFont: "Economica", category: "sans-serif" },
51387
+ "Syncopate": { cssFallback: "'Syncopate','Helvetica Neue',Helvetica,Arial,sans-serif", officeFont: "Syncopate", category: "sans-serif" },
51388
+ // ---- Google Fonts / web fonts (serif) ----
51389
+ "Playfair Display": { cssFallback: "'Playfair Display','Georgia','Times New Roman',serif", officeFont: "Playfair Display", category: "serif" },
51390
+ "Playfair Display SemiBold": { cssFallback: "'Playfair Display SemiBold','Playfair Display','Georgia',serif", officeFont: "Playfair Display SemiBold", category: "serif" },
51391
+ "Libre Baskerville": { cssFallback: "'Libre Baskerville','Georgia','Times New Roman',serif", officeFont: "Libre Baskerville", category: "serif" },
51392
+ "Merriweather": { cssFallback: "'Merriweather','Georgia','Times New Roman',serif", officeFont: "Merriweather", category: "serif" },
51393
+ "PT Serif": { cssFallback: "'PT Serif','Georgia','Times New Roman',serif", officeFont: "PT Serif", category: "serif" },
51394
+ "Noto Serif": { cssFallback: "'Noto Serif','Georgia','Times New Roman',serif", officeFont: "Noto Serif", category: "serif" },
51395
+ "Lora": { cssFallback: "'Lora','Georgia','Times New Roman',serif", officeFont: "Lora", category: "serif" },
51396
+ // ---- Google Fonts / web fonts (monospace) ----
51397
+ "Fira Code": { cssFallback: "'Fira Code','Courier New',monospace", officeFont: "Fira Code", category: "monospace" },
51398
+ "Source Code Pro": { cssFallback: "'Source Code Pro','Courier New',monospace", officeFont: "Source Code Pro", category: "monospace" },
51399
+ "JetBrains Mono": { cssFallback: "'JetBrains Mono','Courier New',monospace", officeFont: "JetBrains Mono", category: "monospace" },
51400
+ // ---- GitHub Copilot fonts ----
51401
+ "Ginto Copilot": { cssFallback: "'Ginto Copilot','Helvetica Neue',Helvetica,Arial,sans-serif", officeFont: "Ginto Copilot", category: "sans-serif" },
51402
+ "Ginto Copilot Light": { cssFallback: "'Ginto Copilot Light','Helvetica Neue Light','Helvetica Neue',Arial,sans-serif", officeFont: "Ginto Copilot Light", category: "sans-serif" },
51403
+ "Ginto Copilot 400": { cssFallback: "'Ginto Copilot 400','Helvetica Neue',Helvetica,Arial,sans-serif", officeFont: "Ginto Copilot 400", category: "sans-serif" },
51404
+ "Ginto Copilot Medium": { cssFallback: "'Ginto Copilot Medium','Ginto Copilot','Helvetica Neue',Arial,sans-serif", officeFont: "Ginto Copilot Medium", category: "sans-serif" },
51405
+ "Ginto Copilot Black": { cssFallback: "'Ginto Copilot Black','Ginto Copilot','Helvetica Neue',Arial,sans-serif", officeFont: "Ginto Copilot Black", category: "sans-serif" },
51406
+ "Ginto Copilot Thin": { cssFallback: "'Ginto Copilot Thin','Ginto Copilot Light','Helvetica Neue',Arial,sans-serif", officeFont: "Ginto Copilot Thin", category: "sans-serif" },
51407
+ // ---- Common system fonts ----
51408
+ "Arial": { cssFallback: "Arial,'Helvetica Neue',Helvetica,sans-serif", officeFont: "Arial", category: "sans-serif" },
51409
+ "Arial Black": { cssFallback: "'Arial Black','Helvetica Neue',Helvetica,Arial,sans-serif", officeFont: "Arial Black", category: "sans-serif" },
51410
+ "Georgia": { cssFallback: "Georgia,'Times New Roman',serif", officeFont: "Georgia", category: "serif" },
51411
+ "Georgia Regular": { cssFallback: "'Georgia Regular',Georgia,'Times New Roman',serif", officeFont: "Georgia", category: "serif" },
51412
+ "Courier New": { cssFallback: "'Courier New',Courier,monospace", officeFont: "Courier New", category: "monospace" },
51413
+ "Times": { cssFallback: "Times,'Times New Roman',serif", officeFont: "Times", category: "serif" },
51414
+ "Tahoma": { cssFallback: "'Tahoma','Verdana','Geneva',sans-serif", officeFont: "Tahoma", category: "sans-serif" },
51415
+ "Verdana": { cssFallback: "'Verdana','Geneva',sans-serif", officeFont: "Verdana", category: "sans-serif" },
51416
+ "Helvetica Neue Light": { cssFallback: "'Helvetica Neue Light','Helvetica Neue',Helvetica,Arial,sans-serif", officeFont: "Helvetica Neue Light", category: "sans-serif" },
51417
+ // ---- Symbol fonts ----
51418
+ "Wingdings": { cssFallback: "'Wingdings','Zapf Dingbats',sans-serif", officeFont: "Wingdings", category: "sans-serif" },
51419
+ "Wingdings 2": { cssFallback: "'Wingdings 2','Zapf Dingbats',sans-serif", officeFont: "Wingdings 2", category: "sans-serif" },
51420
+ "Wingdings 3": { cssFallback: "'Wingdings 3','Zapf Dingbats',sans-serif", officeFont: "Wingdings 3", category: "sans-serif" }
51421
+ };
51422
+ var FONT_MAP_LOWER = {};
51423
+ for (const [key2, entry] of Object.entries(FONT_MAP)) {
51424
+ FONT_MAP_LOWER[key2.toLowerCase()] = entry;
51425
+ }
51426
+ function cssFontFamily(fontName) {
51427
+ const entry = FONT_MAP[fontName];
51428
+ if (entry)
51429
+ return entry.cssFallback;
51430
+ const entryLower = FONT_MAP_LOWER[fontName.toLowerCase()];
51431
+ if (entryLower)
51432
+ return entryLower.cssFallback;
51433
+ if (fontName.includes(",")) {
51434
+ return fontName.split(",").map((f) => {
51435
+ const trimmed = f.trim();
51436
+ const lower = trimmed.toLowerCase();
51437
+ if (lower === "sans-serif" || lower === "serif" || lower === "monospace" || lower === "cursive" || lower === "fantasy") {
51438
+ return lower;
51439
+ }
51440
+ return `'${trimmed}'`;
51441
+ }).join(",");
51442
+ }
51443
+ return `'${fontName}',sans-serif`;
51444
+ }
51445
+ function mapToOfficeFont(fontFamily) {
51446
+ const normalized = fontFamily.toLowerCase().trim();
51447
+ const entry = FONT_MAP_LOWER[normalized];
51448
+ return entry ? entry.officeFont : fontFamily;
51449
+ }
51450
+ function extractFontFace(fontFamily) {
51451
+ if (!fontFamily)
51452
+ return void 0;
51453
+ const firstFont = fontFamily.split(",")[0].replace(/['"]/g, "").trim();
51454
+ return mapToOfficeFont(firstFont);
51455
+ }
51456
+ var CATEGORY_ALT_FONT = {
51457
+ "sans-serif": "Arial",
51458
+ "serif": "Georgia",
51459
+ "monospace": "Courier New",
51460
+ "cursive": "Comic Sans MS"
51461
+ };
51462
+ var SYSTEM_FONTS = /* @__PURE__ */ new Set([
51463
+ "arial",
51464
+ "arial black",
51465
+ "calibri",
51466
+ "calibri light",
51467
+ "cambria",
51468
+ "cambria math",
51469
+ "consolas",
51470
+ "courier new",
51471
+ "georgia",
51472
+ "georgia regular",
51473
+ "times",
51474
+ "times new roman",
51475
+ "tahoma",
51476
+ "verdana",
51477
+ "comic sans ms",
51478
+ "impact",
51479
+ "wingdings",
51480
+ "wingdings 2",
51481
+ "wingdings 3",
51482
+ "segoe ui",
51483
+ "aptos"
51484
+ ]);
51485
+ function getAltFont(fontFace) {
51486
+ if (!fontFace)
51487
+ return void 0;
51488
+ const normalized = fontFace.toLowerCase().trim();
51489
+ if (SYSTEM_FONTS.has(normalized))
51490
+ return void 0;
51491
+ const entry = FONT_MAP_LOWER[normalized];
51492
+ if (entry) {
51493
+ const alt = CATEGORY_ALT_FONT[entry.category];
51494
+ return alt.toLowerCase() === normalized ? void 0 : alt;
51495
+ }
51496
+ return "Arial";
51497
+ }
51498
+ function getFontReplacementEntries() {
51499
+ const entries2 = [];
51500
+ for (const [fontName, entry] of Object.entries(FONT_MAP)) {
51501
+ if (entry.officeFont.toLowerCase() !== fontName.toLowerCase()) {
51502
+ entries2.push([fontName, `${entry.officeFont}, ${entry.category}`]);
51503
+ }
51504
+ }
51505
+ return entries2;
51506
+ }
51507
+
51316
51508
  // packages/docs/convert.js
51317
51509
  var PARAGRAPH_SPACING = {
51318
51510
  line: 408,
@@ -51468,10 +51660,11 @@ var docgen = (() => {
51468
51660
  rPr.addChildElement(new XmlElement("w:szCs", { "w:val": options.size.toString() }));
51469
51661
  }
51470
51662
  if (options.font) {
51663
+ const officeFont = mapToOfficeFont(options.font);
51471
51664
  rPr.addChildElement(new XmlElement("w:rFonts", {
51472
- "w:ascii": options.font,
51473
- "w:hAnsi": options.font,
51474
- "w:cs": options.font
51665
+ "w:ascii": officeFont,
51666
+ "w:hAnsi": officeFont,
51667
+ "w:cs": officeFont
51475
51668
  }));
51476
51669
  }
51477
51670
  const fallbackColor = options.fallbackColor || options.gradient.stops[0]?.color;
@@ -51505,6 +51698,7 @@ var docgen = (() => {
51505
51698
  const result = [];
51506
51699
  for (const run of runs) {
51507
51700
  const parts = run.text.split("\n");
51701
+ const font = run.fontFamily ? mapToOfficeFont(run.fontFamily) : void 0;
51508
51702
  const underlineConfig = run.underline ? {
51509
51703
  type: getUnderlineType(run.underline.type),
51510
51704
  color: run.underline.color
@@ -51518,7 +51712,7 @@ var docgen = (() => {
51518
51712
  italics: run.italic,
51519
51713
  color: run.color,
51520
51714
  size: run.size,
51521
- font: run.fontFamily,
51715
+ font,
51522
51716
  superScript: run.superscript,
51523
51717
  subScript: run.subscript,
51524
51718
  strike: run.strike,
@@ -51539,7 +51733,7 @@ var docgen = (() => {
51539
51733
  bold: run.bold,
51540
51734
  italics: run.italic,
51541
51735
  size: run.size,
51542
- font: run.fontFamily,
51736
+ font,
51543
51737
  fallbackColor: run.color
51544
51738
  // Solid color fallback for LibreOffice
51545
51739
  }));
@@ -51550,7 +51744,7 @@ var docgen = (() => {
51550
51744
  italics: run.italic,
51551
51745
  color: run.color,
51552
51746
  size: run.size,
51553
- font: run.fontFamily,
51747
+ font,
51554
51748
  superScript: run.superscript,
51555
51749
  subScript: run.subscript,
51556
51750
  strike: run.strike,
@@ -51597,7 +51791,7 @@ var docgen = (() => {
51597
51791
  // Use header text color for header rows, otherwise use run's color
51598
51792
  color: isHeaderRow && headerTextColor ? headerTextColor : run.color,
51599
51793
  size: run.size,
51600
- font: run.fontFamily,
51794
+ font: run.fontFamily ? mapToOfficeFont(run.fontFamily) : void 0,
51601
51795
  superScript: run.superscript,
51602
51796
  subScript: run.subscript,
51603
51797
  strike: run.strike,
@@ -51701,7 +51895,7 @@ var docgen = (() => {
51701
51895
  textRunOptions.color = element.color;
51702
51896
  }
51703
51897
  if (element.fontFamily) {
51704
- textRunOptions.font = element.fontFamily;
51898
+ textRunOptions.font = mapToOfficeFont(element.fontFamily);
51705
51899
  }
51706
51900
  if (element.fontSize) {
51707
51901
  textRunOptions.size = element.fontSize;
@@ -51755,7 +51949,7 @@ var docgen = (() => {
51755
51949
  bold: element.bold,
51756
51950
  italics: element.italic,
51757
51951
  color: element.color,
51758
- font: element.fontFamily
51952
+ font: element.fontFamily ? mapToOfficeFont(element.fontFamily) : void 0
51759
51953
  })
51760
51954
  ];
51761
51955
  const alignment = textAlignmentToDocx(element.alignment);
@@ -51883,7 +52077,7 @@ var docgen = (() => {
51883
52077
  bold: innerElement.bold,
51884
52078
  italics: innerElement.italic,
51885
52079
  color: paragraphColor,
51886
- font: innerElement.fontFamily
52080
+ font: innerElement.fontFamily ? mapToOfficeFont(innerElement.fontFamily) : void 0
51887
52081
  })
51888
52082
  ];
51889
52083
  cellContent.push(new Paragraph({
@@ -61856,7 +62050,25 @@ var docgen = (() => {
61856
62050
  triple: "double",
61857
62051
  thick: "solid",
61858
62052
  nil: "none",
61859
- none: "none"
62053
+ none: "none",
62054
+ // Compound border types - rendered as double for visual distinction
62055
+ thinThickSmallGap: "double",
62056
+ thickThinSmallGap: "double",
62057
+ thinThickMedGap: "double",
62058
+ thickThinMedGap: "double",
62059
+ thinThickLargeGap: "double",
62060
+ thickThinLargeGap: "double",
62061
+ thinThickThinSmallGap: "double",
62062
+ thinThickThinMedGap: "double",
62063
+ thinThickThinLargeGap: "double",
62064
+ // Wave borders
62065
+ wave: "solid",
62066
+ doubleWave: "double",
62067
+ // 3D borders
62068
+ threeDEmboss: "ridge",
62069
+ threeDEngrave: "groove",
62070
+ outset: "outset",
62071
+ inset: "inset"
61860
62072
  };
61861
62073
  return styleMap[style] ?? "solid";
61862
62074
  }
@@ -62166,6 +62378,45 @@ var docgen = (() => {
62166
62378
  }
62167
62379
  }
62168
62380
  const styleEls = stylesDoc.getElementsByTagName("w:style");
62381
+ for (let i = 0; i < styleEls.length; i++) {
62382
+ const styleEl = styleEls[i];
62383
+ const styleType = styleEl.getAttribute("w:type");
62384
+ const isDefault = styleEl.getAttribute("w:default");
62385
+ if (styleType === "table" && isDefault === "1") {
62386
+ const tblPr = findChild(styleEl, "tblPr");
62387
+ if (tblPr) {
62388
+ const tblCellMar = findChild(tblPr, "tblCellMar");
62389
+ if (tblCellMar) {
62390
+ defaults.tableCellMargins = {};
62391
+ const topEl = findChild(tblCellMar, "top");
62392
+ const bottomEl = findChild(tblCellMar, "bottom");
62393
+ const leftEl = findChild(tblCellMar, "left") || findChild(tblCellMar, "start");
62394
+ const rightEl = findChild(tblCellMar, "right") || findChild(tblCellMar, "end");
62395
+ if (topEl) {
62396
+ const w = topEl.getAttribute("w:w");
62397
+ if (w)
62398
+ defaults.tableCellMargins.top = parseInt(w, 10);
62399
+ }
62400
+ if (bottomEl) {
62401
+ const w = bottomEl.getAttribute("w:w");
62402
+ if (w)
62403
+ defaults.tableCellMargins.bottom = parseInt(w, 10);
62404
+ }
62405
+ if (leftEl) {
62406
+ const w = leftEl.getAttribute("w:w");
62407
+ if (w)
62408
+ defaults.tableCellMargins.left = parseInt(w, 10);
62409
+ }
62410
+ if (rightEl) {
62411
+ const w = rightEl.getAttribute("w:w");
62412
+ if (w)
62413
+ defaults.tableCellMargins.right = parseInt(w, 10);
62414
+ }
62415
+ }
62416
+ }
62417
+ break;
62418
+ }
62419
+ }
62169
62420
  for (let i = 0; i < styleEls.length; i++) {
62170
62421
  const styleEl = styleEls[i];
62171
62422
  const styleId = styleEl.getAttribute("w:styleId");
@@ -62601,7 +62852,7 @@ var docgen = (() => {
62601
62852
  borders.right = parseBorder(findChild(pBdr, "right"));
62602
62853
  return borders;
62603
62854
  }
62604
- function parseParagraphProps(pPr) {
62855
+ function parseParagraphProps(pPr, themeColors, themeFonts) {
62605
62856
  const props = {};
62606
62857
  const pStyle = findChild(pPr, "pStyle");
62607
62858
  if (pStyle) {
@@ -62666,6 +62917,10 @@ var docgen = (() => {
62666
62917
  props.shading = "#" + fill;
62667
62918
  }
62668
62919
  }
62920
+ const rPr = findChild(pPr, "rPr");
62921
+ if (rPr && themeColors && themeFonts) {
62922
+ props.rPr = parseRunProps(rPr, themeColors, themeFonts);
62923
+ }
62669
62924
  return props;
62670
62925
  }
62671
62926
  function parseRunProps(rPr, themeColors, themeFonts) {
@@ -62776,7 +63031,7 @@ var docgen = (() => {
62776
63031
  }
62777
63032
  function parseParagraph(p, themeColors, themeFonts) {
62778
63033
  const pPr = findChild(p, "pPr");
62779
- const props = pPr ? parseParagraphProps(pPr) : {};
63034
+ const props = pPr ? parseParagraphProps(pPr, themeColors, themeFonts) : {};
62780
63035
  const runs = [];
62781
63036
  const processElement = (el) => {
62782
63037
  for (let i = 0; i < el.children.length; i++) {
@@ -62836,6 +63091,10 @@ var docgen = (() => {
62836
63091
  cell.vAlign = val;
62837
63092
  }
62838
63093
  }
63094
+ const noWrap = findChild(tcPr, "noWrap");
63095
+ if (noWrap) {
63096
+ cell.noWrap = true;
63097
+ }
62839
63098
  }
62840
63099
  const collectParagraphs = (parent) => {
62841
63100
  const result = [];
@@ -62932,6 +63191,34 @@ var docgen = (() => {
62932
63191
  table.tableIndent = parseInt(w, 10);
62933
63192
  }
62934
63193
  }
63194
+ const tblCellMar = findChild(tblPr, "tblCellMar");
63195
+ if (tblCellMar) {
63196
+ table.cellMargins = {};
63197
+ const topMar = findChild(tblCellMar, "top");
63198
+ const bottomMar = findChild(tblCellMar, "bottom");
63199
+ const leftMar = findChild(tblCellMar, "left") || findChild(tblCellMar, "start");
63200
+ const rightMar = findChild(tblCellMar, "right") || findChild(tblCellMar, "end");
63201
+ if (topMar) {
63202
+ const w = topMar.getAttribute("w:w");
63203
+ if (w)
63204
+ table.cellMargins.top = parseInt(w, 10);
63205
+ }
63206
+ if (bottomMar) {
63207
+ const w = bottomMar.getAttribute("w:w");
63208
+ if (w)
63209
+ table.cellMargins.bottom = parseInt(w, 10);
63210
+ }
63211
+ if (leftMar) {
63212
+ const w = leftMar.getAttribute("w:w");
63213
+ if (w)
63214
+ table.cellMargins.left = parseInt(w, 10);
63215
+ }
63216
+ if (rightMar) {
63217
+ const w = rightMar.getAttribute("w:w");
63218
+ if (w)
63219
+ table.cellMargins.right = parseInt(w, 10);
63220
+ }
63221
+ }
62935
63222
  }
62936
63223
  const tblGrid = findChild(tbl, "tblGrid");
62937
63224
  if (tblGrid) {
@@ -62951,6 +63238,14 @@ var docgen = (() => {
62951
63238
  const val = trHeight.getAttribute("w:val");
62952
63239
  if (val)
62953
63240
  row.height = parseInt(val, 10);
63241
+ const hRule = trHeight.getAttribute("w:hRule");
63242
+ if (hRule === "exact") {
63243
+ row.heightRule = "exact";
63244
+ } else if (hRule === "auto") {
63245
+ row.heightRule = "auto";
63246
+ } else {
63247
+ row.heightRule = "atLeast";
63248
+ }
62954
63249
  }
62955
63250
  }
62956
63251
  const tcs = findChildren(tr, "tc");
@@ -63337,10 +63632,8 @@ var docgen = (() => {
63337
63632
  }
63338
63633
  }
63339
63634
  const styleAttr = styles.length > 0 ? ` style="${styles.join(";")}"` : "";
63340
- if (!content) {
63341
- return `<${tag}${styleAttr}>&nbsp;</${tag}>`;
63342
- }
63343
- return `<${tag}${styleAttr}>${content}</${tag}>`;
63635
+ const finalContent = content || "&nbsp;";
63636
+ return `<${tag}${styleAttr}>${finalContent}</${tag}>`;
63344
63637
  }
63345
63638
  function renderTableToHtml(table, styleMap, numberingMap, themeColors, imageMap, docDefaults = {}) {
63346
63639
  const styles = [
@@ -63355,23 +63648,111 @@ var docgen = (() => {
63355
63648
  styles.push(`margin-left:${twipsToPx(table.tableIndent)}px`);
63356
63649
  }
63357
63650
  let html = `<table style="${styles.join(";")}">`;
63651
+ const rowspanMap = /* @__PURE__ */ new Map();
63652
+ for (let rowIdx = 0; rowIdx < table.rows.length; rowIdx++) {
63653
+ let colIdx = 0;
63654
+ for (const cell of table.rows[rowIdx].cells) {
63655
+ if (cell.vMerge === "restart") {
63656
+ let span = 1;
63657
+ for (let nextRow = rowIdx + 1; nextRow < table.rows.length; nextRow++) {
63658
+ let nextColIdx = 0;
63659
+ let foundContinue = false;
63660
+ for (const nextCell of table.rows[nextRow].cells) {
63661
+ if (nextColIdx === colIdx) {
63662
+ if (nextCell.vMerge === "continue") {
63663
+ span++;
63664
+ foundContinue = true;
63665
+ }
63666
+ break;
63667
+ }
63668
+ nextColIdx += nextCell.gridSpan ?? 1;
63669
+ }
63670
+ if (!foundContinue)
63671
+ break;
63672
+ }
63673
+ if (span > 1) {
63674
+ rowspanMap.set(`${rowIdx}-${colIdx}`, span);
63675
+ }
63676
+ }
63677
+ colIdx += cell.gridSpan ?? 1;
63678
+ }
63679
+ }
63358
63680
  let colIndex = 0;
63359
- for (const row of table.rows) {
63681
+ for (let rowIdx = 0; rowIdx < table.rows.length; rowIdx++) {
63682
+ const row = table.rows[rowIdx];
63360
63683
  const rowStyles = [];
63361
63684
  if (row.height) {
63362
63685
  rowStyles.push(`height:${twipsToPx(row.height)}px`);
63363
63686
  }
63364
63687
  html += `<tr${rowStyles.length > 0 ? ` style="${rowStyles.join(";")}"` : ""}>`;
63688
+ let emptyParagraphsToDistribute = [];
63365
63689
  colIndex = 0;
63366
63690
  for (const cell of row.cells) {
63367
63691
  if (cell.vMerge === "continue") {
63368
63692
  colIndex += cell.gridSpan ?? 1;
63369
63693
  continue;
63370
63694
  }
63371
- const cellStyles = ["padding:4px 8px"];
63695
+ const rowspan = rowspanMap.get(`${rowIdx}-${colIndex}`);
63696
+ if (rowspan && rowspan > 1) {
63697
+ const emptyParas = [];
63698
+ for (const para of cell.paragraphs) {
63699
+ const isEmpty = !para.runs || para.runs.length === 0 || para.runs.every((run) => !run.text || run.text.trim() === "");
63700
+ if (isEmpty) {
63701
+ emptyParas.push(para);
63702
+ }
63703
+ }
63704
+ let linesInNextRows = 0;
63705
+ for (let r = rowIdx + 1; r < rowIdx + rowspan && r < table.rows.length; r++) {
63706
+ let colIdx = 0;
63707
+ for (const nextRowCell of table.rows[r].cells) {
63708
+ if (nextRowCell.vMerge !== "continue") {
63709
+ for (const para of nextRowCell.paragraphs) {
63710
+ const isEmpty = !para.runs || para.runs.length === 0 || para.runs.every((run) => !run.text || run.text.trim() === "");
63711
+ if (!isEmpty) {
63712
+ linesInNextRows++;
63713
+ }
63714
+ }
63715
+ break;
63716
+ }
63717
+ colIdx += nextRowCell.gridSpan ?? 1;
63718
+ }
63719
+ }
63720
+ const countToDistribute = Math.max(0, emptyParas.length - linesInNextRows);
63721
+ for (let i = 0; i < countToDistribute; i++) {
63722
+ emptyParagraphsToDistribute.push(emptyParas[i]);
63723
+ }
63724
+ }
63725
+ colIndex += cell.gridSpan ?? 1;
63726
+ }
63727
+ colIndex = 0;
63728
+ for (const cell of row.cells) {
63729
+ if (cell.vMerge === "continue") {
63730
+ colIndex += cell.gridSpan ?? 1;
63731
+ continue;
63732
+ }
63733
+ const cellStyles = [];
63372
63734
  const cellAttrs = [];
63735
+ if (table.cellMargins) {
63736
+ const top = table.cellMargins.top !== void 0 ? twipsToPx(table.cellMargins.top) : 0;
63737
+ const right = table.cellMargins.right !== void 0 ? twipsToPx(table.cellMargins.right) : 0;
63738
+ const bottom = table.cellMargins.bottom !== void 0 ? twipsToPx(table.cellMargins.bottom) : 0;
63739
+ const left = table.cellMargins.left !== void 0 ? twipsToPx(table.cellMargins.left) : 0;
63740
+ cellStyles.push(`padding:${top}px ${right}px ${bottom}px ${left}px`);
63741
+ } else if (docDefaults.tableCellMargins) {
63742
+ const margins = docDefaults.tableCellMargins;
63743
+ const top = margins.top !== void 0 ? twipsToPx(margins.top) : 0;
63744
+ const right = margins.right !== void 0 ? twipsToPx(margins.right) : 7;
63745
+ const bottom = margins.bottom !== void 0 ? twipsToPx(margins.bottom) : 0;
63746
+ const left = margins.left !== void 0 ? twipsToPx(margins.left) : 7;
63747
+ cellStyles.push(`padding:${top}px ${right}px ${bottom}px ${left}px`);
63748
+ } else {
63749
+ cellStyles.push("padding:0 7px");
63750
+ }
63373
63751
  const vAlign = cell.vAlign ?? "top";
63374
63752
  cellStyles.push(`vertical-align:${vAlign}`);
63753
+ if (cell.noWrap) {
63754
+ cellStyles.push("white-space:nowrap");
63755
+ }
63375
63756
  if (cell.width) {
63376
63757
  cellStyles.push(`width:${twipsToPx(cell.width)}px`);
63377
63758
  } else if (table.columnWidths && table.columnWidths[colIndex]) {
@@ -63387,6 +63768,10 @@ var docgen = (() => {
63387
63768
  if (cell.gridSpan && cell.gridSpan > 1) {
63388
63769
  cellAttrs.push(`colspan="${cell.gridSpan}"`);
63389
63770
  }
63771
+ const rowspan = rowspanMap.get(`${rowIdx}-${colIndex}`);
63772
+ if (rowspan && rowspan > 1) {
63773
+ cellAttrs.push(`rowspan="${rowspan}"`);
63774
+ }
63390
63775
  if (cell.shading) {
63391
63776
  cellStyles.push(`background-color:${cell.shading}`);
63392
63777
  }
@@ -63427,14 +63812,25 @@ var docgen = (() => {
63427
63812
  }
63428
63813
  const attrsStr = cellAttrs.length > 0 ? " " + cellAttrs.join(" ") : "";
63429
63814
  html += `<td${attrsStr} style="${cellStyles.join(";")}">`;
63815
+ const isRowspanCell = rowspan && rowspan > 1;
63816
+ let cellContent = "";
63430
63817
  for (const para of cell.paragraphs) {
63431
- html += renderParagraphToHtml(para, styleMap, numberingMap, imageMap, docDefaults);
63818
+ cellContent += renderParagraphToHtml(para, styleMap, numberingMap, imageMap, docDefaults);
63819
+ }
63820
+ if (!isRowspanCell && emptyParagraphsToDistribute.length > 0) {
63821
+ for (const para of emptyParagraphsToDistribute) {
63822
+ cellContent += renderParagraphToHtml(para, styleMap, numberingMap, imageMap, docDefaults);
63823
+ }
63432
63824
  }
63433
63825
  if (cell.nestedTables) {
63434
63826
  for (const nestedTable of cell.nestedTables) {
63435
- html += renderTableToHtml(nestedTable, styleMap, numberingMap, themeColors, imageMap, docDefaults);
63827
+ cellContent += renderTableToHtml(nestedTable, styleMap, numberingMap, themeColors, imageMap, docDefaults);
63436
63828
  }
63437
63829
  }
63830
+ if (!cellContent.trim()) {
63831
+ cellContent = "&nbsp;";
63832
+ }
63833
+ html += cellContent;
63438
63834
  html += "</td>";
63439
63835
  colIndex += cell.gridSpan ?? 1;
63440
63836
  }
@@ -63660,6 +64056,7 @@ var docgen = (() => {
63660
64056
  const headingStyles = /* @__PURE__ */ new Map();
63661
64057
  cssRules.push(`p { margin: 0 0 10pt 0; }`);
63662
64058
  cssRules.push(`table { margin: 10pt 0; border-collapse: collapse; }`);
64059
+ cssRules.push(`td p { margin: 0; line-height: 1.15; }`);
63663
64060
  cssRules.push(`img { max-width: 100%; }`);
63664
64061
  cssRules.push(`ul, ol { margin: 0 0 10pt 0; padding-left: 24px; }`);
63665
64062
  cssRules.push(`li { margin: 0 0 4pt 0; }`);
@@ -63966,156 +64363,6 @@ ${generateStylesCss(styleMap, themeFonts)}
63966
64363
  return `<li${styleAttr}>${content || "&nbsp;"}</li>`;
63967
64364
  }
63968
64365
 
63969
- // packages/slides/fonts.js
63970
- var FONT_MAP = {
63971
- // ---- Microsoft Office fonts ----
63972
- "Calibri": { cssFallback: "'Calibri','Carlito','Helvetica Neue',Helvetica,Arial,sans-serif", officeFont: "Calibri", category: "sans-serif" },
63973
- "Calibri Light": { cssFallback: "'Calibri Light','Carlito','Helvetica Neue Light','Helvetica Neue',Arial,sans-serif", officeFont: "Calibri Light", category: "sans-serif" },
63974
- "Cambria": { cssFallback: "'Cambria','Caladea','Times New Roman',Georgia,serif", officeFont: "Cambria", category: "serif" },
63975
- "Cambria Math": { cssFallback: "'Cambria Math','Caladea','Times New Roman',serif", officeFont: "Cambria Math", category: "serif" },
63976
- "Consolas": { cssFallback: "'Consolas','Courier New',monospace", officeFont: "Consolas", category: "monospace" },
63977
- "Aptos": { cssFallback: "'Aptos','Carlito','Helvetica Neue',Arial,sans-serif", officeFont: "Aptos", category: "sans-serif" },
63978
- "Times New Roman": { cssFallback: "'Times New Roman','Liberation Serif',Georgia,serif", officeFont: "Times New Roman", category: "serif" },
63979
- // ---- Handwriting / decorative fonts ----
63980
- "MV Boli": { cssFallback: "'MV Boli','Comic Sans MS','Marker Felt',cursive", officeFont: "MV Boli", category: "cursive" },
63981
- "Kristen ITC": { cssFallback: "'Kristen ITC','Comic Sans MS','Marker Felt',cursive", officeFont: "Kristen ITC", category: "cursive" },
63982
- "Stylus BT": { cssFallback: "'Stylus BT','Brush Script MT','Snell Roundhand',cursive", officeFont: "Stylus BT", category: "cursive" },
63983
- "Caveat": { cssFallback: "'Caveat','Comic Sans MS','Marker Felt',cursive", officeFont: "Caveat", category: "cursive" },
63984
- // ---- Japanese sans-serif fonts ----
63985
- "MS Gothic": { cssFallback: "'MS Gothic','Noto Sans CJK JP','Hiragino Kaku Gothic ProN','Yu Gothic',sans-serif", officeFont: "MS Gothic", category: "sans-serif" },
63986
- "MS PGothic": { cssFallback: "'MS PGothic','Noto Sans CJK JP','Hiragino Kaku Gothic ProN','Yu Gothic',sans-serif", officeFont: "MS PGothic", category: "sans-serif" },
63987
- "\uFF2D\uFF33 \uFF30\u30B4\u30B7\u30C3\u30AF": { cssFallback: "'\uFF2D\uFF33 \uFF30\u30B4\u30B7\u30C3\u30AF','Noto Sans CJK JP','Hiragino Kaku Gothic ProN','Yu Gothic',sans-serif", officeFont: "\uFF2D\uFF33 \uFF30\u30B4\u30B7\u30C3\u30AF", category: "sans-serif" },
63988
- "\uFF2D\uFF33 \u30B4\u30B7\u30C3\u30AF": { cssFallback: "'\uFF2D\uFF33 \u30B4\u30B7\u30C3\u30AF','Noto Sans CJK JP','Hiragino Kaku Gothic ProN','Yu Gothic',sans-serif", officeFont: "\uFF2D\uFF33 \u30B4\u30B7\u30C3\u30AF", category: "sans-serif" },
63989
- "Kozuka Gothic Pro R": { cssFallback: "'Kozuka Gothic Pro R','Noto Sans CJK JP','Hiragino Kaku Gothic ProN',sans-serif", officeFont: "Kozuka Gothic Pro R", category: "sans-serif" },
63990
- "Kozuka Gothic Pro B": { cssFallback: "'Kozuka Gothic Pro B','Noto Sans CJK JP Bold','Hiragino Kaku Gothic ProN',sans-serif", officeFont: "Kozuka Gothic Pro B", category: "sans-serif" },
63991
- "Kozuka Gothic Pro M": { cssFallback: "'Kozuka Gothic Pro M','Noto Sans CJK JP Medium','Hiragino Kaku Gothic ProN',sans-serif", officeFont: "Kozuka Gothic Pro M", category: "sans-serif" },
63992
- "Kozuka Gothic Pro EL": { cssFallback: "'Kozuka Gothic Pro EL','Noto Sans CJK JP Light','Hiragino Kaku Gothic ProN',sans-serif", officeFont: "Kozuka Gothic Pro EL", category: "sans-serif" },
63993
- "HGSKyokashotai": { cssFallback: "'HGSKyokashotai','Noto Sans CJK JP','Hiragino Kaku Gothic ProN',sans-serif", officeFont: "HGSKyokashotai", category: "sans-serif" },
63994
- // ---- Japanese serif fonts ----
63995
- "MS Mincho": { cssFallback: "'MS Mincho','Noto Serif CJK JP','Hiragino Mincho ProN','Yu Mincho',serif", officeFont: "MS Mincho", category: "serif" },
63996
- "MS PMincho": { cssFallback: "'MS PMincho','Noto Serif CJK JP','Hiragino Mincho ProN','Yu Mincho',serif", officeFont: "MS PMincho", category: "serif" },
63997
- // ---- CJK fonts (Chinese, Korean) ----
63998
- "\u5B8B\u4F53": { cssFallback: "'\u5B8B\u4F53','Noto Serif CJK SC','Songti SC','STSong',serif", officeFont: "\u5B8B\u4F53", category: "serif" },
63999
- "\u65B0\u7D30\u660E\u9AD4": { cssFallback: "'\u65B0\u7D30\u660E\u9AD4','Noto Serif CJK TC','Songti TC',serif", officeFont: "\u65B0\u7D30\u660E\u9AD4", category: "serif" },
64000
- "\u9ED1\u4F53": { cssFallback: "'\u9ED1\u4F53','Noto Sans CJK SC','Heiti SC','STHeiti',sans-serif", officeFont: "\u9ED1\u4F53", category: "sans-serif" },
64001
- "\u5FAE\u8EDF\u6B63\u9ED1\u9AD4": { cssFallback: "'\u5FAE\u8EDF\u6B63\u9ED1\u9AD4','Noto Sans CJK TC','Heiti TC',sans-serif", officeFont: "\u5FAE\u8EDF\u6B63\u9ED1\u9AD4", category: "sans-serif" },
64002
- "\uB9D1\uC740 \uACE0\uB515": { cssFallback: "'\uB9D1\uC740 \uACE0\uB515','Apple SD Gothic Neo',sans-serif", officeFont: "\uB9D1\uC740 \uACE0\uB515", category: "sans-serif" },
64003
- // ---- UI / system fonts ----
64004
- "Lucida Sans Unicode": { cssFallback: "'Lucida Sans Unicode','Lucida Grande','Lucida Sans',sans-serif", officeFont: "Lucida Sans Unicode", category: "sans-serif" },
64005
- "Segoe UI": { cssFallback: "'Segoe UI','-apple-system','Helvetica Neue',sans-serif", officeFont: "Segoe UI", category: "sans-serif" },
64006
- "Segoe Sans Display": { cssFallback: "'Segoe Sans Display','-apple-system','Helvetica Neue',Arial,sans-serif", officeFont: "Segoe Sans Display", category: "sans-serif" },
64007
- "Segoe Sans Display Semibold": { cssFallback: "'Segoe Sans Display Semibold','-apple-system','Helvetica Neue',Arial,sans-serif", officeFont: "Segoe Sans Display Semibold", category: "sans-serif" },
64008
- "Segoe Sans Small Regular": { cssFallback: "'Segoe Sans Small Regular','Segoe UI','-apple-system','Helvetica Neue',sans-serif", officeFont: "Segoe Sans Small Regular", category: "sans-serif" },
64009
- "Segoe Sans Text Regular": { cssFallback: "'Segoe Sans Text Regular','Segoe UI','-apple-system','Helvetica Neue',sans-serif", officeFont: "Segoe Sans Text Regular", category: "sans-serif" },
64010
- "Grandview": { cssFallback: "'Grandview','Helvetica Neue',Arial,sans-serif", officeFont: "Grandview", category: "sans-serif" },
64011
- "Nirmala UI": { cssFallback: "'Nirmala UI','Helvetica Neue',Arial,sans-serif", officeFont: "Nirmala UI", category: "sans-serif" },
64012
- "Ebrima": { cssFallback: "'Ebrima','Helvetica Neue',Arial,sans-serif", officeFont: "Ebrima", category: "sans-serif" },
64013
- // ---- Google Fonts / web fonts (sans-serif) ----
64014
- // Preserve original font names in PPTX export for maximum fidelity.
64015
- // PowerPoint will render these correctly if the fonts are installed,
64016
- // and fall back gracefully if not. The cssFallback stack provides
64017
- // alternatives for HTML rendering (import side) only.
64018
- "Inter": { cssFallback: "'Inter','Helvetica Neue',Helvetica,Arial,sans-serif", officeFont: "Inter", category: "sans-serif" },
64019
- "Inter Light": { cssFallback: "'Inter Light','Inter','Helvetica Neue',Arial,sans-serif", officeFont: "Inter Light", category: "sans-serif" },
64020
- "Inter ExtraBold": { cssFallback: "'Inter ExtraBold','Inter','Helvetica Neue',Arial,sans-serif", officeFont: "Inter ExtraBold", category: "sans-serif" },
64021
- "Roboto": { cssFallback: "'Roboto','Helvetica Neue',Helvetica,Arial,sans-serif", officeFont: "Roboto", category: "sans-serif" },
64022
- "Open Sans": { cssFallback: "'Open Sans','Helvetica Neue',Helvetica,Arial,sans-serif", officeFont: "Open Sans", category: "sans-serif" },
64023
- "Lato": { cssFallback: "'Lato','Helvetica Neue',Helvetica,Arial,sans-serif", officeFont: "Lato", category: "sans-serif" },
64024
- "Montserrat": { cssFallback: "'Montserrat','Helvetica Neue',Helvetica,Arial,sans-serif", officeFont: "Montserrat", category: "sans-serif" },
64025
- "Montserrat SemiBold": { cssFallback: "'Montserrat SemiBold','Montserrat','Helvetica Neue',Arial,sans-serif", officeFont: "Montserrat SemiBold", category: "sans-serif" },
64026
- "Montserrat ExtraBold": { cssFallback: "'Montserrat ExtraBold','Montserrat','Helvetica Neue',Arial,sans-serif", officeFont: "Montserrat ExtraBold", category: "sans-serif" },
64027
- "Poppins": { cssFallback: "'Poppins','Helvetica Neue',Helvetica,Arial,sans-serif", officeFont: "Poppins", category: "sans-serif" },
64028
- "Source Sans Pro": { cssFallback: "'Source Sans Pro','Helvetica Neue',Helvetica,Arial,sans-serif", officeFont: "Source Sans Pro", category: "sans-serif" },
64029
- "Nunito": { cssFallback: "'Nunito','Helvetica Neue',Helvetica,Arial,sans-serif", officeFont: "Nunito", category: "sans-serif" },
64030
- "Raleway": { cssFallback: "'Raleway','Helvetica Neue',Helvetica,Arial,sans-serif", officeFont: "Raleway", category: "sans-serif" },
64031
- "Ubuntu": { cssFallback: "'Ubuntu','Helvetica Neue',Helvetica,Arial,sans-serif", officeFont: "Ubuntu", category: "sans-serif" },
64032
- "PT Sans": { cssFallback: "'PT Sans','Helvetica Neue',Helvetica,Arial,sans-serif", officeFont: "PT Sans", category: "sans-serif" },
64033
- "Noto Sans": { cssFallback: "'Noto Sans','Helvetica Neue',Helvetica,Arial,sans-serif", officeFont: "Noto Sans", category: "sans-serif" },
64034
- "Fira Sans": { cssFallback: "'Fira Sans','Helvetica Neue',Helvetica,Arial,sans-serif", officeFont: "Fira Sans", category: "sans-serif" },
64035
- "Work Sans": { cssFallback: "'Work Sans','Helvetica Neue',Helvetica,Arial,sans-serif", officeFont: "Work Sans", category: "sans-serif" },
64036
- "Space Grotesk": { cssFallback: "'Space Grotesk','Helvetica Neue',Helvetica,Arial,sans-serif", officeFont: "Space Grotesk", category: "sans-serif" },
64037
- "Oswald": { cssFallback: "'Oswald','Helvetica Neue',Helvetica,Arial,sans-serif", officeFont: "Oswald", category: "sans-serif" },
64038
- "Archivo": { cssFallback: "'Archivo','Helvetica Neue',Helvetica,Arial,sans-serif", officeFont: "Archivo", category: "sans-serif" },
64039
- "Economica": { cssFallback: "'Economica','Helvetica Neue',Arial,sans-serif", officeFont: "Economica", category: "sans-serif" },
64040
- "Syncopate": { cssFallback: "'Syncopate','Helvetica Neue',Helvetica,Arial,sans-serif", officeFont: "Syncopate", category: "sans-serif" },
64041
- // ---- Google Fonts / web fonts (serif) ----
64042
- "Playfair Display": { cssFallback: "'Playfair Display','Georgia','Times New Roman',serif", officeFont: "Playfair Display", category: "serif" },
64043
- "Playfair Display SemiBold": { cssFallback: "'Playfair Display SemiBold','Playfair Display','Georgia',serif", officeFont: "Playfair Display SemiBold", category: "serif" },
64044
- "Libre Baskerville": { cssFallback: "'Libre Baskerville','Georgia','Times New Roman',serif", officeFont: "Libre Baskerville", category: "serif" },
64045
- "Merriweather": { cssFallback: "'Merriweather','Georgia','Times New Roman',serif", officeFont: "Merriweather", category: "serif" },
64046
- "PT Serif": { cssFallback: "'PT Serif','Georgia','Times New Roman',serif", officeFont: "PT Serif", category: "serif" },
64047
- "Noto Serif": { cssFallback: "'Noto Serif','Georgia','Times New Roman',serif", officeFont: "Noto Serif", category: "serif" },
64048
- "Lora": { cssFallback: "'Lora','Georgia','Times New Roman',serif", officeFont: "Lora", category: "serif" },
64049
- // ---- Google Fonts / web fonts (monospace) ----
64050
- "Fira Code": { cssFallback: "'Fira Code','Courier New',monospace", officeFont: "Fira Code", category: "monospace" },
64051
- "Source Code Pro": { cssFallback: "'Source Code Pro','Courier New',monospace", officeFont: "Source Code Pro", category: "monospace" },
64052
- "JetBrains Mono": { cssFallback: "'JetBrains Mono','Courier New',monospace", officeFont: "JetBrains Mono", category: "monospace" },
64053
- // ---- GitHub Copilot fonts ----
64054
- "Ginto Copilot": { cssFallback: "'Ginto Copilot','Helvetica Neue',Helvetica,Arial,sans-serif", officeFont: "Ginto Copilot", category: "sans-serif" },
64055
- "Ginto Copilot Light": { cssFallback: "'Ginto Copilot Light','Helvetica Neue Light','Helvetica Neue',Arial,sans-serif", officeFont: "Ginto Copilot Light", category: "sans-serif" },
64056
- "Ginto Copilot 400": { cssFallback: "'Ginto Copilot 400','Helvetica Neue',Helvetica,Arial,sans-serif", officeFont: "Ginto Copilot 400", category: "sans-serif" },
64057
- "Ginto Copilot Medium": { cssFallback: "'Ginto Copilot Medium','Ginto Copilot','Helvetica Neue',Arial,sans-serif", officeFont: "Ginto Copilot Medium", category: "sans-serif" },
64058
- "Ginto Copilot Black": { cssFallback: "'Ginto Copilot Black','Ginto Copilot','Helvetica Neue',Arial,sans-serif", officeFont: "Ginto Copilot Black", category: "sans-serif" },
64059
- "Ginto Copilot Thin": { cssFallback: "'Ginto Copilot Thin','Ginto Copilot Light','Helvetica Neue',Arial,sans-serif", officeFont: "Ginto Copilot Thin", category: "sans-serif" },
64060
- // ---- Common system fonts ----
64061
- "Arial": { cssFallback: "Arial,'Helvetica Neue',Helvetica,sans-serif", officeFont: "Arial", category: "sans-serif" },
64062
- "Arial Black": { cssFallback: "'Arial Black','Helvetica Neue',Helvetica,Arial,sans-serif", officeFont: "Arial Black", category: "sans-serif" },
64063
- "Georgia": { cssFallback: "Georgia,'Times New Roman',serif", officeFont: "Georgia", category: "serif" },
64064
- "Georgia Regular": { cssFallback: "'Georgia Regular',Georgia,'Times New Roman',serif", officeFont: "Georgia", category: "serif" },
64065
- "Courier New": { cssFallback: "'Courier New',Courier,monospace", officeFont: "Courier New", category: "monospace" },
64066
- "Times": { cssFallback: "Times,'Times New Roman',serif", officeFont: "Times", category: "serif" },
64067
- "Tahoma": { cssFallback: "'Tahoma','Verdana','Geneva',sans-serif", officeFont: "Tahoma", category: "sans-serif" },
64068
- "Verdana": { cssFallback: "'Verdana','Geneva',sans-serif", officeFont: "Verdana", category: "sans-serif" },
64069
- "Helvetica Neue Light": { cssFallback: "'Helvetica Neue Light','Helvetica Neue',Helvetica,Arial,sans-serif", officeFont: "Helvetica Neue Light", category: "sans-serif" },
64070
- // ---- Symbol fonts ----
64071
- "Wingdings": { cssFallback: "'Wingdings','Zapf Dingbats',sans-serif", officeFont: "Wingdings", category: "sans-serif" },
64072
- "Wingdings 2": { cssFallback: "'Wingdings 2','Zapf Dingbats',sans-serif", officeFont: "Wingdings 2", category: "sans-serif" },
64073
- "Wingdings 3": { cssFallback: "'Wingdings 3','Zapf Dingbats',sans-serif", officeFont: "Wingdings 3", category: "sans-serif" }
64074
- };
64075
- var FONT_MAP_LOWER = {};
64076
- for (const [key2, entry] of Object.entries(FONT_MAP)) {
64077
- FONT_MAP_LOWER[key2.toLowerCase()] = entry;
64078
- }
64079
- function cssFontFamily(fontName) {
64080
- const entry = FONT_MAP[fontName];
64081
- if (entry)
64082
- return entry.cssFallback;
64083
- const entryLower = FONT_MAP_LOWER[fontName.toLowerCase()];
64084
- if (entryLower)
64085
- return entryLower.cssFallback;
64086
- if (fontName.includes(",")) {
64087
- return fontName.split(",").map((f) => {
64088
- const trimmed = f.trim();
64089
- const lower = trimmed.toLowerCase();
64090
- if (lower === "sans-serif" || lower === "serif" || lower === "monospace" || lower === "cursive" || lower === "fantasy") {
64091
- return lower;
64092
- }
64093
- return `'${trimmed}'`;
64094
- }).join(",");
64095
- }
64096
- return `'${fontName}',sans-serif`;
64097
- }
64098
- function mapToOfficeFont(fontFamily) {
64099
- const normalized = fontFamily.toLowerCase().trim();
64100
- const entry = FONT_MAP_LOWER[normalized];
64101
- return entry ? entry.officeFont : fontFamily;
64102
- }
64103
- function extractFontFace(fontFamily) {
64104
- if (!fontFamily)
64105
- return void 0;
64106
- const firstFont = fontFamily.split(",")[0].replace(/['"]/g, "").trim();
64107
- return mapToOfficeFont(firstFont);
64108
- }
64109
- function getFontReplacementEntries() {
64110
- const entries2 = [];
64111
- for (const [fontName, entry] of Object.entries(FONT_MAP)) {
64112
- if (entry.officeFont.toLowerCase() !== fontName.toLowerCase()) {
64113
- entries2.push([fontName, `${entry.officeFont}, ${entry.category}`]);
64114
- }
64115
- }
64116
- return entries2;
64117
- }
64118
-
64119
64366
  // packages/slides/parse.js
64120
64367
  var PT_PER_PX = 0.75;
64121
64368
  var PX_PER_IN = 96;
@@ -67039,6 +67286,16 @@ ${generateStylesCss(styleMap, themeFonts)}
67039
67286
  }
67040
67287
 
67041
67288
  // packages/slides/convert.js
67289
+ function addAltFonts(runs) {
67290
+ for (const run of runs) {
67291
+ if (run.options?.fontFace && !run.options.altFont) {
67292
+ const alt = getAltFont(run.options.fontFace);
67293
+ if (alt)
67294
+ run.options.altFont = alt;
67295
+ }
67296
+ }
67297
+ return runs;
67298
+ }
67042
67299
  function sleep(ms) {
67043
67300
  return new Promise((resolve) => setTimeout(resolve, ms));
67044
67301
  }
@@ -67359,8 +67616,12 @@ ${generateStylesCss(styleMap, themeFonts)}
67359
67616
  if (el.style) {
67360
67617
  if (el.style.fontSize)
67361
67618
  shapeOptions.fontSize = el.style.fontSize;
67362
- if (el.style.fontFace)
67619
+ if (el.style.fontFace) {
67363
67620
  shapeOptions.fontFace = el.style.fontFace;
67621
+ const alt = getAltFont(el.style.fontFace);
67622
+ if (alt)
67623
+ shapeOptions.altFont = alt;
67624
+ }
67364
67625
  if (el.style.color)
67365
67626
  shapeOptions.color = el.style.color;
67366
67627
  if (el.style.bold)
@@ -67390,7 +67651,7 @@ ${generateStylesCss(styleMap, themeFonts)}
67390
67651
  }
67391
67652
  }
67392
67653
  if (el.textRuns && el.textRuns.length > 0) {
67393
- slide.addText(el.textRuns, shapeOptions);
67654
+ slide.addText(addAltFonts(el.textRuns), shapeOptions);
67394
67655
  } else {
67395
67656
  slide.addText(el.text || "", shapeOptions);
67396
67657
  }
@@ -67404,6 +67665,7 @@ ${generateStylesCss(styleMap, themeFonts)}
67404
67665
  h: adjustedH,
67405
67666
  fontSize: el.style.fontSize,
67406
67667
  fontFace: el.style.fontFace,
67668
+ altFont: el.style.fontFace ? getAltFont(el.style.fontFace) : void 0,
67407
67669
  color: el.style.color ?? void 0,
67408
67670
  align: el.style.align,
67409
67671
  valign: "top",
@@ -67415,7 +67677,7 @@ ${generateStylesCss(styleMap, themeFonts)}
67415
67677
  };
67416
67678
  if (el.style.margin)
67417
67679
  listOptions.margin = el.style.margin;
67418
- slide.addText(el.items, listOptions);
67680
+ slide.addText(addAltFonts(el.items), listOptions);
67419
67681
  } else {
67420
67682
  const lineHeightPt = el.style.lineSpacing || (el.style.fontSize ?? 0) * 1.2;
67421
67683
  const heightPt = el.position.h * 72;
@@ -67459,6 +67721,7 @@ ${generateStylesCss(styleMap, themeFonts)}
67459
67721
  h: adjustedH,
67460
67722
  fontSize: el.style.fontSize,
67461
67723
  fontFace: el.style.fontFace,
67724
+ altFont: el.style.fontFace ? getAltFont(el.style.fontFace) : void 0,
67462
67725
  color: el.style.color ?? void 0,
67463
67726
  bold: el.style.bold,
67464
67727
  italic: el.style.italic,
@@ -67496,7 +67759,8 @@ ${generateStylesCss(styleMap, themeFonts)}
67496
67759
  if (el.style.textShadow) {
67497
67760
  textOptions.shadow = el.style.textShadow;
67498
67761
  }
67499
- slide.addText(el.text, textOptions);
67762
+ const text = Array.isArray(el.text) ? addAltFonts(el.text) : el.text;
67763
+ slide.addText(text, textOptions);
67500
67764
  }
67501
67765
  }
67502
67766
  }
@@ -74483,7 +74747,8 @@ ${String(ex)}`);
74483
74747
  if (opts.glow)
74484
74748
  runProps += `<a:effectLst>${createGlowElement(opts.glow, DEF_TEXT_GLOW)}</a:effectLst>`;
74485
74749
  if (opts.fontFace) {
74486
- runProps += `<a:latin typeface="${opts.fontFace}" pitchFamily="34" charset="0"/><a:ea typeface="${opts.fontFace}" pitchFamily="34" charset="-122"/><a:cs typeface="${opts.fontFace}" pitchFamily="34" charset="-120"/>`;
74750
+ var altAttr = opts.altFont ? ' altFont="' + opts.altFont + '"' : "";
74751
+ runProps += `<a:latin typeface="${opts.fontFace}"${altAttr} pitchFamily="34" charset="0"/><a:ea typeface="${opts.fontFace}"${altAttr} pitchFamily="34" charset="-122"/><a:cs typeface="${opts.fontFace}"${altAttr} pitchFamily="34" charset="-120"/>`;
74487
74752
  }
74488
74753
  }
74489
74754
  if (opts.hyperlink) {