ooxml-core 1.42.0 → 1.44.0

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 (106) hide show
  1. package/dist/{PptxHandler-A2J4PCOB.mjs → PptxHandler-3VAVJDFB.mjs} +2 -2
  2. package/dist/{PptxHandler-73QIJ6SD.cjs → PptxHandler-V23RDNEX.cjs} +2 -2
  3. package/dist/{PptxHandler-OGLVLX2T.mjs → PptxHandler-WB3KL2WH.mjs} +1 -1
  4. package/dist/{PresentationBuilder-APJKCMVS.mjs → PresentationBuilder-7LJMTRJ6.mjs} +2 -2
  5. package/dist/{PresentationBuilder-6S5PJXXF.cjs → PresentationBuilder-KHL6GONR.cjs} +4 -4
  6. package/dist/{PresentationBuilder-F3BWDERK.mjs → PresentationBuilder-PY2GB4IG.mjs} +1 -1
  7. package/dist/automation/index.cjs +4 -2
  8. package/dist/automation/index.mjs +4 -2
  9. package/dist/chart/index.cjs +7 -4
  10. package/dist/chart/index.mjs +7 -4
  11. package/dist/{chunk-ZUEN4RQG.mjs → chunk-243ZYX2B.mjs} +1 -1
  12. package/dist/{chunk-VV724DWE.mjs → chunk-4LEVL6ZW.mjs} +12 -7
  13. package/dist/{chunk-XVB3CBNM.mjs → chunk-HLYOHD2Z.mjs} +11 -6
  14. package/dist/{chunk-MXA67O7R.mjs → chunk-JHYU7HGG.mjs} +1 -1
  15. package/dist/{chunk-N6X5CJZP.mjs → chunk-KCDLTVUI.mjs} +1 -1
  16. package/dist/{chunk-YNQRXFTC.cjs → chunk-RNZQ2OU4.cjs} +11 -6
  17. package/dist/{chunk-CPSTCCRD.mjs → chunk-WEAWSXUX.mjs} +4 -4
  18. package/dist/docx/index.cjs +7 -4
  19. package/dist/docx/index.mjs +7 -4
  20. package/dist/docx/layout/index.cjs +139 -4
  21. package/dist/docx/layout/index.d.ts +1 -0
  22. package/dist/docx/layout/index.d.ts.map +1 -1
  23. package/dist/docx/layout/index.mjs +139 -5
  24. package/dist/docx/layout/webfont-runs.d.ts +5 -0
  25. package/dist/docx/layout/webfont-runs.d.ts.map +1 -0
  26. package/dist/docx/ui/index.cjs +7 -4
  27. package/dist/docx/ui/index.mjs +7 -4
  28. package/dist/index.cjs +2403 -72
  29. package/dist/index.mjs +2404 -73
  30. package/dist/opc/declared-fonts.d.ts +9 -0
  31. package/dist/opc/declared-fonts.d.ts.map +1 -0
  32. package/dist/opc/index.cjs +84 -0
  33. package/dist/opc/index.d.ts +1 -0
  34. package/dist/opc/index.d.ts.map +1 -1
  35. package/dist/opc/index.mjs +85 -2
  36. package/dist/pptx/automation/index.cjs +11 -6
  37. package/dist/pptx/automation/index.d.ts +3 -3
  38. package/dist/pptx/automation/index.mjs +5 -5
  39. package/dist/pptx/chunks/{index-BJuR8GLL.d.ts → index-Bj-hur0D.d.ts} +2 -2
  40. package/dist/pptx/chunks/{index-BJuR8GLL.d.ts.map → index-Bj-hur0D.d.ts.map} +1 -1
  41. package/dist/pptx/chunks/{index-Rbvl2WaM.d.ts → index-CCJiD-Bm.d.ts} +3 -3
  42. package/dist/pptx/chunks/{index-Rbvl2WaM.d.ts.map → index-CCJiD-Bm.d.ts.map} +1 -1
  43. package/dist/pptx/chunks/{index-xoJGYTgQ.d.ts → index-CGNb1TV9.d.ts} +18 -2
  44. package/dist/pptx/chunks/index-CGNb1TV9.d.ts.map +1 -0
  45. package/dist/pptx/cli/index.cjs +11 -6
  46. package/dist/pptx/cli/index.mjs +4 -4
  47. package/dist/pptx/converter/index.d.ts +1 -1
  48. package/dist/pptx/converter/index.mjs +2 -2
  49. package/dist/pptx/editor/render/find-replace.d.ts +1 -1
  50. package/dist/pptx/editor/render/slide-operations.cjs +1 -1
  51. package/dist/pptx/editor/render/slide-operations.mjs +1 -1
  52. package/dist/pptx/index.cjs +11 -6
  53. package/dist/pptx/index.d.ts +3 -3
  54. package/dist/pptx/index.mjs +5 -5
  55. package/dist/pptx/node/index.d.ts +1 -1
  56. package/dist/text/css-font-family.d.ts.map +1 -1
  57. package/dist/text/index.cjs +2244 -0
  58. package/dist/text/index.d.ts +1 -0
  59. package/dist/text/index.d.ts.map +1 -1
  60. package/dist/text/index.mjs +2223 -1
  61. package/dist/text/metric-font-family.d.ts.map +1 -1
  62. package/dist/text/webfonts/font-weight-names.d.ts +66 -0
  63. package/dist/text/webfonts/font-weight-names.d.ts.map +1 -0
  64. package/dist/text/webfonts/google-fonts-catalogue.d.ts +14 -0
  65. package/dist/text/webfonts/google-fonts-catalogue.d.ts.map +1 -0
  66. package/dist/text/webfonts/google-fonts-lookup.d.ts +7 -0
  67. package/dist/text/webfonts/google-fonts-lookup.d.ts.map +1 -0
  68. package/dist/text/webfonts/google-fonts-request.d.ts +57 -0
  69. package/dist/text/webfonts/google-fonts-request.d.ts.map +1 -0
  70. package/dist/text/webfonts/index.d.ts +12 -0
  71. package/dist/text/webfonts/index.d.ts.map +1 -0
  72. package/dist/text/webfonts/metric-clones.d.ts +17 -0
  73. package/dist/text/webfonts/metric-clones.d.ts.map +1 -0
  74. package/dist/text/webfonts/webfont-faces.d.ts +24 -0
  75. package/dist/text/webfonts/webfont-faces.d.ts.map +1 -0
  76. package/dist/visio/index.cjs +56 -0
  77. package/dist/visio/index.d.ts +1 -0
  78. package/dist/visio/index.d.ts.map +1 -1
  79. package/dist/visio/index.mjs +56 -1
  80. package/dist/visio/webfont-runs.d.ts +27 -0
  81. package/dist/visio/webfont-runs.d.ts.map +1 -0
  82. package/dist/xlsx/index.cjs +2137 -10
  83. package/dist/xlsx/index.mjs +2133 -11
  84. package/dist/xlsx/layout/font-stack.d.ts +8 -0
  85. package/dist/xlsx/layout/font-stack.d.ts.map +1 -0
  86. package/dist/xlsx/layout/index.d.ts +3 -1
  87. package/dist/xlsx/layout/index.d.ts.map +1 -1
  88. package/dist/xlsx/layout/shape-view.d.ts.map +1 -1
  89. package/dist/xlsx/layout/style-view.d.ts +2 -0
  90. package/dist/xlsx/layout/style-view.d.ts.map +1 -1
  91. package/dist/xlsx/layout/webfont-runs.d.ts +11 -0
  92. package/dist/xlsx/layout/webfont-runs.d.ts.map +1 -0
  93. package/dist/xlsx/ui/commands/util.d.ts.map +1 -1
  94. package/dist/xlsx/ui/context.d.ts +5 -0
  95. package/dist/xlsx/ui/context.d.ts.map +1 -1
  96. package/dist/xlsx/ui/grid/cell-paint.d.ts +3 -2
  97. package/dist/xlsx/ui/grid/cell-paint.d.ts.map +1 -1
  98. package/dist/xlsx/ui/index.cjs +2061 -13
  99. package/dist/xlsx/ui/index.mjs +2061 -14
  100. package/dist/xlsx/ui/locales/de/options.d.ts.map +1 -1
  101. package/dist/xlsx/ui/locales/en/options.d.ts.map +1 -1
  102. package/dist/xlsx/ui/locales/es/options.d.ts.map +1 -1
  103. package/dist/xlsx/ui/locales/fr/options.d.ts.map +1 -1
  104. package/dist/xlsx/ui/locales/zh-CN/options.d.ts.map +1 -1
  105. package/package.json +1 -1
  106. package/dist/pptx/chunks/index-xoJGYTgQ.d.ts.map +0 -1
@@ -16084,10 +16084,13 @@ var FALLBACKS = {
16084
16084
  calibri: '"Calibri", "Carlito", "Segoe UI", Arial, sans-serif',
16085
16085
  "calibri light": '"Calibri Light", "Calibri", "Carlito", "Segoe UI", Arial, sans-serif',
16086
16086
  cambria: '"Cambria", "Caladea", Georgia, serif',
16087
- arial: 'Arial, "Liberation Sans", Helvetica, sans-serif',
16088
- "times new roman": '"Times New Roman", "Liberation Serif", Times, serif',
16089
- "courier new": '"Courier New", "Liberation Mono", monospace',
16090
- aptos: '"Aptos", "Calibri", "Carlito", "Segoe UI", sans-serif'
16087
+ arial: 'Arial, "Arimo", "Liberation Sans", Helvetica, sans-serif',
16088
+ "times new roman": '"Times New Roman", "Tinos", "Liberation Serif", Times, serif',
16089
+ "courier new": '"Courier New", "Cousine", "Liberation Mono", monospace',
16090
+ georgia: '"Georgia", "Gelasio", serif',
16091
+ aptos: '"Aptos", "Calibri", "Carlito", "Segoe UI", sans-serif',
16092
+ "aptos narrow": '"Aptos Narrow", "Aptos", "Calibri", "Carlito", "Segoe UI", sans-serif',
16093
+ "aptos display": '"Aptos Display", "Aptos", "Calibri", "Carlito", "Segoe UI", sans-serif'
16091
16094
  };
16092
16095
  function cssFontFamily(name2) {
16093
16096
  const known = FALLBACKS[name2.toLowerCase()];
@@ -21446,6 +21449,18 @@ function diagramColorTheme(theme) {
21446
21449
  }
21447
21450
 
21448
21451
  // docx/document-paragraphs.ts
21452
+ function documentBlockLists(model) {
21453
+ return [
21454
+ model.blocks,
21455
+ ...(model.sections ?? []).flatMap(
21456
+ (section) => [section.headers, section.footers].flatMap(
21457
+ (slots) => Object.values(slots ?? {}).flatMap((content) => content ? [content.blocks] : [])
21458
+ )
21459
+ ),
21460
+ ...Object.values(model.footnoteSeparators ?? {}).map((note) => note.blocks),
21461
+ ...[...model.footnotes ?? [], ...model.endnotes ?? []].map((note) => note.blocks)
21462
+ ];
21463
+ }
21449
21464
  function mapBlockParagraphs(blocks, map) {
21450
21465
  return blocks.map(
21451
21466
  (block) => block.type === "paragraph" ? map(block) : {
@@ -27548,6 +27563,12 @@ var METRIC_FONT_SUBSTITUTES = {
27548
27563
  calibri: { fallbacks: ["Carlito"], generic: "sans-serif" },
27549
27564
  "calibri light": { fallbacks: ["Carlito"], generic: "sans-serif" },
27550
27565
  cambria: { fallbacks: ["Caladea"], generic: "serif" },
27566
+ // Aptos, the Microsoft 365 default, has Calibri-close metrics; Carlito is the closest measured
27567
+ // clone (see `webfonts/metric-clones.ts`, which requests the same family).
27568
+ aptos: { fallbacks: ["Carlito"], generic: "sans-serif" },
27569
+ "aptos display": { fallbacks: ["Carlito"], generic: "sans-serif" },
27570
+ "aptos narrow": { fallbacks: ["Carlito"], generic: "sans-serif" },
27571
+ "aptos serif": { fallbacks: ["Caladea"], generic: "serif" },
27551
27572
  arial: { fallbacks: ["Arimo", "Liberation Sans"], generic: "sans-serif" },
27552
27573
  helvetica: { fallbacks: ["Arimo", "Liberation Sans"], generic: "sans-serif" },
27553
27574
  "times new roman": { fallbacks: ["Tinos", "Liberation Serif"], generic: "serif" },
@@ -27568,6 +27589,119 @@ function cssFontStack(family) {
27568
27589
  return metricFontFamily(family?.trim() || DEFAULT_FONT_FAMILY);
27569
27590
  }
27570
27591
 
27592
+ // docx/layout/webfont-runs.ts
27593
+ function collectDocxWebfontRuns(model) {
27594
+ const runs = [];
27595
+ const theme = model.theme;
27596
+ const labels = computeListLabels(model);
27597
+ const push = (run) => {
27598
+ if (run.text !== "") runs.push(run);
27599
+ };
27600
+ const familyOf = (formatting) => {
27601
+ const role = formatting.fontTheme?.ascii ?? formatting.fontTheme?.hAnsi;
27602
+ return formatting.fontFamily ?? (role && theme ? theme.fonts[role]?.latin : void 0);
27603
+ };
27604
+ const emptyRun = (formatting) => {
27605
+ runs.push({
27606
+ family: familyOf(formatting) ?? DEFAULT_FONT_FAMILY,
27607
+ bold: formatting.bold === true,
27608
+ italic: formatting.italic === true,
27609
+ text: ""
27610
+ });
27611
+ };
27612
+ const emit = (text2, formatting, family) => {
27613
+ const latin = family || DEFAULT_FONT_FAMILY;
27614
+ const eaRole = formatting.fontTheme?.eastAsia;
27615
+ const csRole = formatting.fontTheme?.cs;
27616
+ const bold = formatting.bold === true;
27617
+ const italic = formatting.italic === true;
27618
+ const fonts = {
27619
+ latin,
27620
+ eastAsia: formatting.fontFamilyEastAsia || eaRole && theme?.fonts[eaRole]?.eastAsia || latin,
27621
+ complexScript: formatting.fontFamilyComplexScript || csRole && theme?.fonts[csRole]?.complexScript || latin,
27622
+ symbol: latin
27623
+ };
27624
+ for (const piece of segmentByFont(text2, fonts))
27625
+ push({ family: piece.fontFamily, bold, italic, text: piece.text });
27626
+ };
27627
+ const paragraphRuns = (paragraph, tableStyleRun) => {
27628
+ const context = {
27629
+ runCatalog: model.characterStyles,
27630
+ paragraphCatalog: model.paragraphStyles,
27631
+ paragraphStyleId: paragraph.style,
27632
+ ...tableStyleRun ? { tableStyleRun } : {}
27633
+ };
27634
+ const label = labels.get(paragraph.id);
27635
+ const firstFormatting = resolveRunFormatting(paragraph.runs[0] ?? { text: "" }, context);
27636
+ if (label && !label.picture) {
27637
+ const marker = label.markerFormat;
27638
+ push({
27639
+ family: marker?.fontFamily ?? familyOf(firstFormatting) ?? DEFAULT_FONT_FAMILY,
27640
+ bold: marker?.bold ?? firstFormatting.bold === true,
27641
+ italic: marker?.italic ?? firstFormatting.italic === true,
27642
+ text: label.text
27643
+ });
27644
+ }
27645
+ if (paragraph.runs.every((run) => !run.text)) emptyRun(firstFormatting);
27646
+ for (const source of paragraph.runs) {
27647
+ for (const run of symbolSegments(source)) {
27648
+ const formatting = resolveRunFormatting(run, context);
27649
+ if (formatting.vanish) continue;
27650
+ const textBox = run.image?.textBoxText;
27651
+ if (textBox) emit(textBox.join("\n"), {}, DEFAULT_FONT_FAMILY);
27652
+ if (!run.text || run.image) continue;
27653
+ const family = symbolOnly(run) && run.symbol?.font || familyOf(formatting);
27654
+ emit(formatting.caps ? run.text.toUpperCase() : run.text, formatting, family);
27655
+ }
27656
+ }
27657
+ };
27658
+ const tableRuns = (table) => {
27659
+ const rowCount = table.rows.length;
27660
+ const columnCount = Math.max(
27661
+ 0,
27662
+ ...table.rows.map((row2) => row2.reduce((sum, cell) => sum + (cell.gridSpan ?? 1), 0))
27663
+ );
27664
+ table.rows.forEach((row2, rowIndex) => {
27665
+ let column = 0;
27666
+ for (const cell of row2) {
27667
+ const tableStyleRun = table.style ? resolveTableStyleFormatting(
27668
+ table.style,
27669
+ model.tableStyles,
27670
+ table.look,
27671
+ rowIndex,
27672
+ rowCount,
27673
+ column,
27674
+ columnCount
27675
+ ).run : void 0;
27676
+ for (const paragraph of cell.paragraphs) paragraphRuns(paragraph, tableStyleRun);
27677
+ const nestedBlocks = (cell.sourceBlocks ?? []).filter(
27678
+ (block) => block.type === "table"
27679
+ );
27680
+ for (const block of nestedBlocks) tableRuns(block);
27681
+ if (nestedBlocks.length === 0)
27682
+ for (const nested of cell.nestedTables ?? [])
27683
+ for (const nestedRow of nested.rows)
27684
+ for (const nestedCell of nestedRow) emit(nestedCell.text, {}, DEFAULT_FONT_FAMILY);
27685
+ column += cell.gridSpan ?? 1;
27686
+ }
27687
+ });
27688
+ };
27689
+ const blockRuns = (blocks) => {
27690
+ for (const block of blocks) {
27691
+ if (block.type === "paragraph") paragraphRuns(block);
27692
+ else tableRuns(block);
27693
+ }
27694
+ };
27695
+ for (const blocks of documentBlockLists(model)) blockRuns(blocks);
27696
+ emptyRun(
27697
+ resolveRunFormatting(
27698
+ { text: "" },
27699
+ { runCatalog: model.characterStyles, paragraphCatalog: model.paragraphStyles }
27700
+ )
27701
+ );
27702
+ return runs;
27703
+ }
27704
+
27571
27705
  // docx/layout/incremental-layout.ts
27572
27706
  var LOOKAHEAD_BLOCKS = 66;
27573
27707
  function paragraphBoxes(page) {
@@ -27736,4 +27870,4 @@ function createLayoutSession(measurer, options2 = {}) {
27736
27870
  };
27737
27871
  }
27738
27872
 
27739
- export { DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE_PT, DEFAULT_TAB_STOP_PX, FLOAT_WRAP_NOTE, NO_TWIPS, PageCursor, SINGLE_LINE_SPACING_UNITS, adaptDocumentModel, adjustForWidowOrphan, appendBreakMarker, cellVerticalOffset, createFakeMeasurer, createLayoutSession, cssFontStack, fieldDisplayText, floatOrigin, floatPosition, fontMetrics, headerFooterForPage, headerFooterSlotForPage, isEastAsianChar, layoutDocument, layoutDocumentModel, layoutParagraph, layoutRow, layoutSections, ligatureCss, pageNumberValues, pageNumbers, pageStyleRefs, paragraphFloats, placeParagraph, placeTab, placeTable, positionFloats, ptToPx, pxToTwips, reviewSourceLength, sectionPageCounts, splitRowAtHeight, suppressesSpacing, tokenizeRun, twipsToPx, widowControlEnabled };
27873
+ export { DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE_PT, DEFAULT_TAB_STOP_PX, FLOAT_WRAP_NOTE, NO_TWIPS, PageCursor, SINGLE_LINE_SPACING_UNITS, adaptDocumentModel, adjustForWidowOrphan, appendBreakMarker, cellVerticalOffset, collectDocxWebfontRuns, createFakeMeasurer, createLayoutSession, cssFontStack, fieldDisplayText, floatOrigin, floatPosition, fontMetrics, headerFooterForPage, headerFooterSlotForPage, isEastAsianChar, layoutDocument, layoutDocumentModel, layoutParagraph, layoutRow, layoutSections, ligatureCss, pageNumberValues, pageNumbers, pageStyleRefs, paragraphFloats, placeParagraph, placeTab, placeTable, positionFloats, ptToPx, pxToTwips, reviewSourceLength, sectionPageCounts, splitRowAtHeight, suppressesSpacing, tokenizeRun, twipsToPx, widowControlEnabled };
@@ -0,0 +1,5 @@
1
+ import type { WebfontRun } from '../../text/webfonts/index.js';
2
+ import type { DocumentModel } from '../model.js';
3
+ /** Every run of `model` as a `WebfontRun` (family, emphasis and the characters drawn). */
4
+ export declare function collectDocxWebfontRuns(model: DocumentModel): WebfontRun[];
5
+ //# sourceMappingURL=webfont-runs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webfont-runs.d.ts","sourceRoot":"","sources":["../../../docx/layout/webfont-runs.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEtD,OAAO,KAAK,EAAS,aAAa,EAAoB,MAAM,UAAU,CAAC;AAUvE,0FAA0F;AAC1F,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,aAAa,GAAG,UAAU,EAAE,CA6HzE"}
@@ -24918,10 +24918,13 @@ var FALLBACKS = {
24918
24918
  calibri: '"Calibri", "Carlito", "Segoe UI", Arial, sans-serif',
24919
24919
  "calibri light": '"Calibri Light", "Calibri", "Carlito", "Segoe UI", Arial, sans-serif',
24920
24920
  cambria: '"Cambria", "Caladea", Georgia, serif',
24921
- arial: 'Arial, "Liberation Sans", Helvetica, sans-serif',
24922
- "times new roman": '"Times New Roman", "Liberation Serif", Times, serif',
24923
- "courier new": '"Courier New", "Liberation Mono", monospace',
24924
- aptos: '"Aptos", "Calibri", "Carlito", "Segoe UI", sans-serif'
24921
+ arial: 'Arial, "Arimo", "Liberation Sans", Helvetica, sans-serif',
24922
+ "times new roman": '"Times New Roman", "Tinos", "Liberation Serif", Times, serif',
24923
+ "courier new": '"Courier New", "Cousine", "Liberation Mono", monospace',
24924
+ georgia: '"Georgia", "Gelasio", serif',
24925
+ aptos: '"Aptos", "Calibri", "Carlito", "Segoe UI", sans-serif',
24926
+ "aptos narrow": '"Aptos Narrow", "Aptos", "Calibri", "Carlito", "Segoe UI", sans-serif',
24927
+ "aptos display": '"Aptos Display", "Aptos", "Calibri", "Carlito", "Segoe UI", sans-serif'
24925
24928
  };
24926
24929
  function cssFontFamily(name2) {
24927
24930
  const known = FALLBACKS[name2.toLowerCase()];
@@ -24896,10 +24896,13 @@ var FALLBACKS = {
24896
24896
  calibri: '"Calibri", "Carlito", "Segoe UI", Arial, sans-serif',
24897
24897
  "calibri light": '"Calibri Light", "Calibri", "Carlito", "Segoe UI", Arial, sans-serif',
24898
24898
  cambria: '"Cambria", "Caladea", Georgia, serif',
24899
- arial: 'Arial, "Liberation Sans", Helvetica, sans-serif',
24900
- "times new roman": '"Times New Roman", "Liberation Serif", Times, serif',
24901
- "courier new": '"Courier New", "Liberation Mono", monospace',
24902
- aptos: '"Aptos", "Calibri", "Carlito", "Segoe UI", sans-serif'
24899
+ arial: 'Arial, "Arimo", "Liberation Sans", Helvetica, sans-serif',
24900
+ "times new roman": '"Times New Roman", "Tinos", "Liberation Serif", Times, serif',
24901
+ "courier new": '"Courier New", "Cousine", "Liberation Mono", monospace',
24902
+ georgia: '"Georgia", "Gelasio", serif',
24903
+ aptos: '"Aptos", "Calibri", "Carlito", "Segoe UI", sans-serif',
24904
+ "aptos narrow": '"Aptos Narrow", "Aptos", "Calibri", "Carlito", "Segoe UI", sans-serif',
24905
+ "aptos display": '"Aptos Display", "Aptos", "Calibri", "Carlito", "Segoe UI", sans-serif'
24903
24906
  };
24904
24907
  function cssFontFamily(name2) {
24905
24908
  const known = FALLBACKS[name2.toLowerCase()];