@shbernal/ts-pptx 3.3.0 → 3.4.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.
- package/dist/{autopage-D1sqK6j7.js → autopage-BYlTzX-l.js} +8 -5
- package/dist/autopage-BYlTzX-l.js.map +1 -0
- package/dist/browser.d.ts +4 -4
- package/dist/browser.js +11 -11
- package/dist/browser.js.map +1 -1
- package/dist/{diagnostics-B2yWpcjB.d.ts → diagnostics-B0OmTOoz.d.ts} +38 -6
- package/dist/diagnostics-B0OmTOoz.d.ts.map +1 -0
- package/dist/{diagnostics-H1QzgRSw.js → diagnostics-CPVADSL1.js} +29 -3
- package/dist/{diagnostics-H1QzgRSw.js.map → diagnostics-CPVADSL1.js.map} +1 -1
- package/dist/{fit-CYJ1jkQI.js → fit-TjpNbMru.js} +3 -3
- package/dist/{fit-CYJ1jkQI.js.map → fit-TjpNbMru.js.map} +1 -1
- package/dist/{html-dom-CzewEdE1.js → html-dom-yUSdCExA.js} +5 -5
- package/dist/html-dom-yUSdCExA.js.map +1 -0
- package/dist/html.d.ts +2 -2
- package/dist/html.js +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +16 -33
- package/dist/index.js.map +1 -1
- package/dist/inspect.js +5 -4
- package/dist/inspect.js.map +1 -1
- package/dist/measure.d.ts +1 -1
- package/dist/measure.js +1 -1
- package/dist/{st-enums-bVnezkMJ.js → namespaces-Sy_m7Nhd.js} +288 -200
- package/dist/namespaces-Sy_m7Nhd.js.map +1 -0
- package/dist/node.d.ts +4 -4
- package/dist/node.js +7 -19
- package/dist/node.js.map +1 -1
- package/dist/{notes-SCvpJz0l.js → notes-bWApshah.js} +221 -140
- package/dist/notes-bWApshah.js.map +1 -0
- package/dist/{pres-Cb-1xDne.d.ts → pres-Dybf7ZUl.d.ts} +2 -2
- package/dist/{pres-Cb-1xDne.d.ts.map → pres-Dybf7ZUl.d.ts.map} +1 -1
- package/dist/{presentation-DeKTJGHf.js → presentation-3rAKKRfm.js} +154 -230
- package/dist/presentation-3rAKKRfm.js.map +1 -0
- package/dist/{presentation-types-B50aOUFI.d.ts → presentation-types-D7cgT-eG.d.ts} +191 -16
- package/dist/presentation-types-D7cgT-eG.d.ts.map +1 -0
- package/dist/read.d.ts +3 -3
- package/dist/read.js +3 -3
- package/dist/script.d.ts +1 -1
- package/dist/script.d.ts.map +1 -1
- package/dist/script.js +67 -40
- package/dist/script.js.map +1 -1
- package/dist/{shapes-BXVgsk0F.js → shapes-Dyw5bxwO.js} +371 -52
- package/dist/shapes-Dyw5bxwO.js.map +1 -0
- package/dist/{slide-DWw9UoI6.d.ts → slide-B_aInw3N.d.ts} +208 -180
- package/dist/slide-B_aInw3N.d.ts.map +1 -0
- package/dist/{text-uM-zGton.js → text-DSN3anEh.js} +3563 -3437
- package/dist/text-DSN3anEh.js.map +1 -0
- package/dist/{units-internal-CGf4VrXy.js → units-internal-DNvK2I6o.js} +54 -34
- package/dist/{units-internal-CGf4VrXy.js.map → units-internal-DNvK2I6o.js.map} +1 -1
- package/package.json +4 -4
- package/dist/autopage-D1sqK6j7.js.map +0 -1
- package/dist/diagnostics-B2yWpcjB.d.ts.map +0 -1
- package/dist/html-dom-CzewEdE1.js.map +0 -1
- package/dist/notes-SCvpJz0l.js.map +0 -1
- package/dist/presentation-DeKTJGHf.js.map +0 -1
- package/dist/presentation-types-B50aOUFI.d.ts.map +0 -1
- package/dist/shapes-BXVgsk0F.js.map +0 -1
- package/dist/slide-DWw9UoI6.d.ts.map +0 -1
- package/dist/st-enums-bVnezkMJ.js.map +0 -1
- package/dist/text-uM-zGton.js.map +0 -1
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { r as warn } from "./diagnostics-CPVADSL1.js";
|
|
2
|
+
import { D as DEF_SLIDE_MARGIN_IN, F as LINEH_MODIFIER, a as inch2Emu, i as getSmartParseNumber, ot as EMU_PER_INCH, s as marginToEmu } from "./units-internal-DNvK2I6o.js";
|
|
3
3
|
//#region src/gen/table/autopage.ts
|
|
4
4
|
/**
|
|
5
5
|
* Break cell text into lines based upon table column width (e.g.: Magic Happens Here(tm))
|
|
6
6
|
* @param {TableCell} cell - table cell
|
|
7
7
|
* @param {number} colWidth - table column width (inches)
|
|
8
|
+
* @param {boolean} [verbose] - dump the four wrapping stages; carries `addTable({ verbose })`
|
|
9
|
+
* down, which is the only stage of the pager that flag did not reach
|
|
8
10
|
* @return {TableRow[]} - cell's text objects grouped into lines
|
|
9
11
|
*/
|
|
10
12
|
function parseTextToLines(cell, colWidth, verbose) {
|
|
11
13
|
const FOCO = 2.3 + (cell.options?.autoPageCharWeight ? cell.options.autoPageCharWeight : 0);
|
|
12
|
-
const CPL = Math.floor(colWidth
|
|
14
|
+
const CPL = Math.floor(colWidth * 72) / ((cell.options?.fontSize ? cell.options.fontSize : 12) / FOCO);
|
|
15
|
+
if (verbose) console.log(`[0/4] colWidth=${colWidth}in fontSize=${cell.options?.fontSize ?? 12} FOCO=${FOCO} CPL=${CPL}`);
|
|
13
16
|
const parsedLines = [];
|
|
14
17
|
let inputCells = [];
|
|
15
18
|
const inputLines1 = [];
|
|
@@ -286,7 +289,7 @@ function getSlidesForTableRows(tableRows = [], tableProps = {}, presLayout, mast
|
|
|
286
289
|
let totalColW = tableColW[iCell] ?? 0;
|
|
287
290
|
const cellColspan = cell.options?.colspan;
|
|
288
291
|
if (cellColspan) totalColW = tableColW.filter((_cell, idx) => idx >= iCell && idx < idx + cellColspan).reduce((prev, curr) => prev + curr);
|
|
289
|
-
newCell._lines = parseTextToLines(cell, totalColW,
|
|
292
|
+
newCell._lines = parseTextToLines(cell, totalColW, tableProps.verbose);
|
|
290
293
|
rowCellLines.push(newCell);
|
|
291
294
|
});
|
|
292
295
|
/** E: --==[[ PAGE DATA SET ]]==--
|
|
@@ -417,4 +420,4 @@ function getSlidesForTableRows(tableRows = [], tableProps = {}, presLayout, mast
|
|
|
417
420
|
//#endregion
|
|
418
421
|
export { getSlidesForTableRows as t };
|
|
419
422
|
|
|
420
|
-
//# sourceMappingURL=autopage-
|
|
423
|
+
//# sourceMappingURL=autopage-BYlTzX-l.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"autopage-BYlTzX-l.js","names":[],"sources":["../src/gen/table/autopage.ts"],"sourcesContent":["/**\n * ts-pptx: Table auto-paging core\n *\n * The DOM-independent heart of table generation: given rows that overflow a slide,\n * split them across as many slides as needed, measuring wrapped text to compute line\n * counts and row heights. `getSlidesForTableRows` is the in-memory core (fully\n * Node-testable); `parseTextToLines` is its private cell-wrapping helper.\n */\n\nimport { SlideObjectType } from '../../enums.js'\nimport { DEF_FONT_SIZE, DEF_SLIDE_MARGIN_IN, LINEH_MODIFIER } from '../../constants-internal.js'\nimport type {\n\tPresLayout,\n\tTableCell,\n\tTableToSlidesProps,\n\tTableRow,\n\tTableRowSlide,\n\tTableCellProps,\n} from '../../types/index.js'\nimport type { SlideLayoutInternal } from '../../types/internal.js'\nimport { getSmartParseNumber, inch2Emu, marginToEmu } from '../../units-internal.js'\nimport { warn } from '../../diagnostics.js'\nimport { EMU_PER_INCH, POINTS_PER_INCH } from '../../units.js'\n\ntype AutoPageCell = TableCell & {\n\t_lineHeight: number\n\t_lines: TableCell[][]\n\toptions: TableCellProps\n\ttext: TableCell[]\n}\n\n// ===== Cell text wrapping =====\n\n/**\n * Break cell text into lines based upon table column width (e.g.: Magic Happens Here(tm))\n * @param {TableCell} cell - table cell\n * @param {number} colWidth - table column width (inches)\n * @param {boolean} [verbose] - dump the four wrapping stages; carries `addTable({ verbose })`\n * down, which is the only stage of the pager that flag did not reach\n * @return {TableRow[]} - cell's text objects grouped into lines\n */\nfunction parseTextToLines(cell: TableCell, colWidth: number, verbose?: boolean): TableCell[][] {\n\t// FYI: CPL = Width / (font-size / font-constant)\n\t// FYI: CHAR:2.3, colWidth:10, fontSize:12 => CPL=138, (actual chars per line in PPT)=145 [14.5 CPI]\n\t// FYI: CHAR:2.3, colWidth:7 , fontSize:12 => CPL= 97, (actual chars per line in PPT)=100 [14.3 CPI]\n\t// FYI: CHAR:2.3, colWidth:9 , fontSize:16 => CPL= 96, (actual chars per line in PPT)=84 [ 9.3 CPI]\n\tconst FOCO = 2.3 + (cell.options?.autoPageCharWeight ? cell.options.autoPageCharWeight : 0) // Character Constant\n\t// `colWidth` is inches, so the column's width in points is `colWidth * 72`. This used to be\n\t// spelled `(colWidth / EMU_PER_POINT) * EMU_PER_INCH`, which is the same 72 with two EMU\n\t// constants that cancel -- except that the detour through EMU is not exact in binary floating\n\t// point, and `Math.floor` takes the hit. Over the 200,000 widths from 0.001in to 200in the two\n\t// forms disagree on 51, always by one point low: 6.625in is exactly 477 points, and the old\n\t// form floored 476.9999... to 476.\n\tconst CPL =\n\t\tMath.floor(colWidth * POINTS_PER_INCH) / ((cell.options?.fontSize ? cell.options.fontSize : DEF_FONT_SIZE) / FOCO) // Chars-Per-Line\n\n\t// The number the four dumps below exist to explain: every wrap decision in step 4 is\n\t// `strCurrLine.length + word.length > CPL`, so a wrap that looks wrong is almost always\n\t// a CPL that is wrong, and CPL is not recoverable from the lines themselves.\n\tif (verbose)\n\t\tconsole.log(\n\t\t\t`[0/4] colWidth=${colWidth}in fontSize=${cell.options?.fontSize ?? DEF_FONT_SIZE} FOCO=${FOCO} CPL=${CPL}`\n\t\t)\n\n\tconst parsedLines: TableCell[][] = []\n\tlet inputCells: TableCell[] = []\n\tconst inputLines1: TableCell[][] = []\n\tconst inputLines2: TableCell[][] = []\n\n\t/**\n\t * EX INPUTS: `cell.text`\n\t * - string....: \"Account Name Column\"\n\t * - object....: { text:\"Account Name Column\" }\n\t * - object[]..: [{ text:\"Account Name\", options:{ bold:true } }, { text:\" Column\" }]\n\t * - object[]..: [{ text:\"Account Name\", options:{ breakLine:true } }, { text:\"Input\" }]\n\t */\n\n\t/**\n\t * EX OUTPUTS:\n\t * - string....: [{ text:\"Account Name Column\" }]\n\t * - object....: [{ text:\"Account Name Column\" }]\n\t * - object[]..: [{ text:\"Account Name\", options:{ breakLine:true } }, { text:\"Input\" }]\n\t * - object[]..: [{ text:\"Account Name\", options:{ breakLine:true } }, { text:\"Input\" }]\n\t */\n\n\t// STEP 1: Ensure inputCells is an array of TableCells\n\tif (cell.text && cell.text.toString().trim().length === 0) {\n\t\t// Allow a single space/whitespace as cell text (user-requested feature)\n\t\tinputCells.push({ _type: SlideObjectType.tablecell, text: ' ' })\n\t} else if (typeof cell.text === 'number' || typeof cell.text === 'string') {\n\t\tinputCells.push({ _type: SlideObjectType.tablecell, text: (cell.text || '').toString().trim() })\n\t} else if (Array.isArray(cell.text)) {\n\t\tinputCells = cell.text\n\t}\n\tif (verbose) {\n\t\tconsole.log('[1/4] inputCells')\n\t\tinputCells.forEach((cell, idx) => console.log(`[1/4] [${idx + 1}] cell: ${JSON.stringify(cell)}`))\n\t}\n\n\t// STEP 2: Group table cells into lines based on \"\\n\" or `breakLine` prop\n\t/**\n\t * - EX: `[{ text:\"Input Output\" }, { text:\"Extra\" }]` == 1 line\n\t * - EX: `[{ text:\"Input\" }, { text:\"Output\", options:{ breakLine:true } }]` == 1 line\n\t * - EX: `[{ text:\"Input\\nOutput\" }]` == 2 lines\n\t * - EX: `[{ text:\"Input\", options:{ breakLine:true } }, { text:\"Output\" }]` == 2 lines\n\t */\n\tlet newLine: TableCell[] = []\n\tinputCells.forEach((cell) => {\n\t\tif (typeof cell.text !== 'string') return\n\n\t\tif (cell.text.includes('\\n')) {\n\t\t\t// Each non-last \\n-split part ends with a forced paragraph break; the last\n\t\t\t// part accumulates in newLine so subsequent runs stay on the same paragraph.\n\t\t\tconst parts = cell.text.split('\\n')\n\t\t\tparts.forEach((part, partIdx) => {\n\t\t\t\tconst isLastPart = partIdx === parts.length - 1\n\t\t\t\tif (isLastPart) {\n\t\t\t\t\tnewLine.push({ _type: SlideObjectType.tablecell, text: part, options: cell.options })\n\t\t\t\t} else {\n\t\t\t\t\tnewLine.push({\n\t\t\t\t\t\t_type: SlideObjectType.tablecell,\n\t\t\t\t\t\ttext: part,\n\t\t\t\t\t\toptions: { ...cell.options, breakLine: true },\n\t\t\t\t\t})\n\t\t\t\t\tinputLines1.push(newLine)\n\t\t\t\t\tnewLine = []\n\t\t\t\t}\n\t\t\t})\n\t\t} else {\n\t\t\tnewLine.push({ _type: SlideObjectType.tablecell, text: cell.text.trim(), options: cell.options })\n\t\t}\n\n\t\tif (cell.options?.breakLine) {\n\t\t\tif (verbose) console.log(`inputCells: new line > ${JSON.stringify(newLine)}`)\n\t\t\tinputLines1.push(newLine)\n\t\t\tnewLine = []\n\t\t}\n\t})\n\t// Flush remaining buffer after all cells are processed\n\tif (newLine.length > 0) {\n\t\tinputLines1.push(newLine)\n\t\tnewLine = []\n\t}\n\tif (verbose) {\n\t\tconsole.log(`[2/4] inputLines1 (${inputLines1.length})`)\n\t\tinputLines1.forEach((line, idx) => console.log(`[2/4] [${idx + 1}] line: ${JSON.stringify(line)}`))\n\t}\n\n\t// STEP 3: Tokenize every text object into words. All runs of one logical paragraph\n\t// are flattened into a single token list so step 4 tracks column position across\n\t// styled-run boundaries (fixes independent-reset bug for rich-text cells).\n\tinputLines1.forEach((line) => {\n\t\tconst lineTokens: TableCell[] = []\n\t\tline.forEach((cell) => {\n\t\t\tconst cellTextStr = String(cell.text) // force convert to string (compiled JS is better with this than a cast)\n\t\t\tconst lineWords = cellTextStr.split(' ')\n\n\t\t\tlineWords.forEach((word, idx) => {\n\t\t\t\tconst cellProps = { ...cell.options }\n\t\t\t\t// IMPORTANT: Handle `breakLine` prop - we cannot apply to each word - only apply to very last word!\n\t\t\t\tif (cellProps?.breakLine) cellProps.breakLine = idx + 1 === lineWords.length\n\t\t\t\tlineTokens.push({\n\t\t\t\t\t_type: SlideObjectType.tablecell,\n\t\t\t\t\ttext: word + (idx + 1 < lineWords.length ? ' ' : ''),\n\t\t\t\t\toptions: cellProps,\n\t\t\t\t})\n\t\t\t})\n\t\t})\n\t\tinputLines2.push(lineTokens)\n\t})\n\tif (verbose) {\n\t\tconsole.log(`[3/4] inputLines2 (${inputLines2.length})`)\n\t\tinputLines2.forEach((line) => console.log(`[3/4] line: ${JSON.stringify(line)}`))\n\t}\n\n\t// STEP 4: Group cells/words into lines based upon space consumed by word letters\n\tinputLines2.forEach((line) => {\n\t\tlet lineCells: TableCell[] = []\n\t\tlet strCurrLine = ''\n\n\t\tline.forEach((word) => {\n\t\t\tconst wordText = String(word.text || '')\n\t\t\t// A: create new line when horizontal space is exhausted\n\t\t\tif (strCurrLine.length + wordText.length > CPL) {\n\t\t\t\tparsedLines.push(lineCells)\n\t\t\t\tlineCells = []\n\t\t\t\tstrCurrLine = ''\n\t\t\t}\n\n\t\t\t// B: add current word to line cells\n\t\t\tlineCells.push(word)\n\n\t\t\t// C: add current word to `strCurrLine` which we use to keep track of line's char length\n\t\t\tstrCurrLine += wordText\n\t\t})\n\n\t\t// Flush buffer: Only create a line when there's text to avoid empty row\n\t\tif (lineCells.length > 0) parsedLines.push(lineCells)\n\t})\n\tif (verbose) {\n\t\tconsole.log(`[4/4] parsedLines (${parsedLines.length})`)\n\t\tparsedLines.forEach((line, idx) => console.log(`[4/4] [Line ${idx + 1}]:\\n${JSON.stringify(line)}`))\n\t\tconsole.log('...............................................\\n\\n')\n\t}\n\n\t// Done:\n\treturn parsedLines\n}\n\n// ===== Auto-page engine =====\n// The in-memory core (fully Node-testable). Internally signposted by the\n// `// STEP 1..7` markers below: margins → column count → widths → the main\n// row-iteration/overflow loop (STEP 6) → final-slide flush (STEP 7).\n\n/**\n * Takes an array of table rows and breaks into an array of slides, which contain the calculated amount of table rows that fit on that slide\n * @param {TableCell[][]} tableRows - table rows\n * @param {TableToSlidesProps} tableProps - table2slides properties\n * @param {PresLayout} presLayout - presentation layout\n * @param {SlideLayoutInternal} masterSlide - master slide\n * @return {TableRowSlide[]} array of table rows\n */\nexport function getSlidesForTableRows(\n\ttableRows: TableCell[][] = [],\n\ttableProps: TableToSlidesProps = {},\n\tpresLayout: PresLayout,\n\tmasterSlide?: SlideLayoutInternal | null\n): TableRowSlide[] {\n\tlet arrInchMargins = DEF_SLIDE_MARGIN_IN\n\tlet emuSlideTabW: number\n\tlet emuSlideTabH = EMU_PER_INCH * 1\n\tlet emuTabCurrH = 0\n\tlet numCols = 0\n\tlet warnedNoTabH = false\n\tconst tableRowSlides: TableRowSlide[] = []\n\tconst tablePropX = getSmartParseNumber(tableProps.x, 'X', presLayout)\n\tconst tablePropY = getSmartParseNumber(tableProps.y, 'Y', presLayout)\n\tconst tablePropW = getSmartParseNumber(tableProps.w, 'X', presLayout)\n\tconst tablePropH = getSmartParseNumber(tableProps.h, 'Y', presLayout)\n\tlet tableCalcW: number = tablePropW\n\n\tfunction calcSlideTabH(): void {\n\t\tlet emuStartY = 0\n\t\tif (tableRowSlides.length === 0) emuStartY = tablePropY || inch2Emu(arrInchMargins[0])\n\t\tif (tableRowSlides.length > 0) emuStartY = inch2Emu(tableProps.autoPageSlideStartY || arrInchMargins[0])\n\t\temuSlideTabH = (tablePropH || presLayout.height) - emuStartY - inch2Emu(arrInchMargins[2])\n\t\t// EXPLICIT-H FIX: an explicit `h` is the table's height (an extent), not a\n\t\t// bottom coordinate, so — unlike `presLayout.height` — the first slide must NOT subtract the\n\t\t// start-Y from it. Otherwise a table that begins mid-slide gets a tiny first page (only a few\n\t\t// rows) while later pages, which already clamp to `h`, render normally. Mirror the\n\t\t// subsequent-slide rule below: never let an explicit `h` shrink the usable height below `h`.\n\t\tif (tableRowSlides.length === 0 && tablePropH && emuSlideTabH < tablePropH) emuSlideTabH = tablePropH\n\t\tif (tableRowSlides.length > 1) {\n\t\t\t// D: RULE: Use margins for starting point after the initial Slide, not `opt.y`\n\t\t\tif (typeof tableProps.autoPageSlideStartY === 'number') {\n\t\t\t\temuSlideTabH = (tablePropH || presLayout.height) - inch2Emu(tableProps.autoPageSlideStartY + arrInchMargins[2])\n\t\t\t} else if (tablePropY) {\n\t\t\t\temuSlideTabH =\n\t\t\t\t\t(tablePropH || presLayout.height) -\n\t\t\t\t\tinch2Emu(\n\t\t\t\t\t\t(tablePropY / EMU_PER_INCH < arrInchMargins[0] ? tablePropY / EMU_PER_INCH : arrInchMargins[0]) +\n\t\t\t\t\t\t\tarrInchMargins[2]\n\t\t\t\t\t)\n\t\t\t\t// Use whichever is greater: area between margins or the table H provided (dont shrink usable area - the whole point of over-riding Y on paging is to *increase* usable space)\n\t\t\t\tif (emuSlideTabH < tablePropH) emuSlideTabH = tablePropH\n\t\t\t}\n\t\t}\n\n\t\t// GUARD: a non-positive height, or one too small to fit even a single line of the base font,\n\t\t// means no row ever fits. That previously emitted degenerate empty overflow pages (rows:[]),\n\t\t// which made the recursive addTable throw \"Array expected\", or — with `h` smaller than one\n\t\t// line — placed one row per slide forever. Ignore the unusable height, fall back to the full\n\t\t// slide area between margins, and warn once rather than emit a broken table.\n\t\tconst emuBaseLineH = inch2Emu(\n\t\t\t((typeof tableProps.fontSize === 'number' ? tableProps.fontSize : DEF_FONT_SIZE) *\n\t\t\t\t(LINEH_MODIFIER + (tableProps.autoPageLineWeight || 0))) /\n\t\t\t\t100\n\t\t)\n\t\tif (emuSlideTabH < emuBaseLineH) {\n\t\t\tconst emuStartY =\n\t\t\t\ttableRowSlides.length === 0\n\t\t\t\t\t? tablePropY || inch2Emu(arrInchMargins[0])\n\t\t\t\t\t: inch2Emu(tableProps.autoPageSlideStartY || arrInchMargins[0])\n\t\t\tconst fallbackH = presLayout.height - emuStartY - inch2Emu(arrInchMargins[2])\n\t\t\tif (!warnedNoTabH) {\n\t\t\t\twarn(\n\t\t\t\t\t'table/autopage-height-too-small',\n\t\t\t\t\t'addTable/autoPage: the table height (`h`) leaves no room to paginate; ignoring it and using the slide height. Increase `h` or decrease `y`.'\n\t\t\t\t)\n\t\t\t\twarnedNoTabH = true\n\t\t\t}\n\t\t\temuSlideTabH = fallbackH > 0 ? fallbackH : presLayout.height\n\t\t}\n\t}\n\n\tif (tableProps.verbose) {\n\t\tconsole.log('[[VERBOSE MODE]]')\n\t\tconsole.log('|-- TABLE PROPS --------------------------------------------------------|')\n\t\tconsole.log(`| presLayout.width ................................ = ${(presLayout.width / EMU_PER_INCH).toFixed(1)}`)\n\t\tconsole.log(\n\t\t\t`| presLayout.height ............................... = ${(presLayout.height / EMU_PER_INCH).toFixed(1)}`\n\t\t)\n\t\tconsole.log(\n\t\t\t`| tableProps.x .................................... = ${typeof tableProps.x === 'number' ? (tableProps.x / EMU_PER_INCH).toFixed(1) : tableProps.x}`\n\t\t)\n\t\tconsole.log(\n\t\t\t`| tableProps.y .................................... = ${typeof tableProps.y === 'number' ? (tableProps.y / EMU_PER_INCH).toFixed(1) : tableProps.y}`\n\t\t)\n\t\tconsole.log(\n\t\t\t`| tableProps.w .................................... = ${typeof tableProps.w === 'number' ? (tableProps.w / EMU_PER_INCH).toFixed(1) : tableProps.w}`\n\t\t)\n\t\tconsole.log(\n\t\t\t`| tableProps.h .................................... = ${typeof tableProps.h === 'number' ? (tableProps.h / EMU_PER_INCH).toFixed(1) : tableProps.h}`\n\t\t)\n\t\tconsole.log(\n\t\t\t`| tableProps.slideMargin .......................... = ${tableProps.slideMargin ? String(tableProps.slideMargin) : ''}`\n\t\t)\n\t\tconsole.log(`| tableProps.margin ............................... = ${String(tableProps.margin)}`)\n\t\tconsole.log(`| tableProps.colW ................................. = ${String(tableProps.colW)}`)\n\t\tconsole.log(`| tableProps.autoPageSlideStartY .................. = ${tableProps.autoPageSlideStartY}`)\n\t\tconsole.log(`| tableProps.autoPageCharWeight ................... = ${tableProps.autoPageCharWeight}`)\n\t\tconsole.log('|-- CALCULATIONS -------------------------------------------------------|')\n\t\tconsole.log(`| tablePropX ...................................... = ${tablePropX / EMU_PER_INCH}`)\n\t\tconsole.log(`| tablePropY ...................................... = ${tablePropY / EMU_PER_INCH}`)\n\t\tconsole.log(`| tablePropW ...................................... = ${tablePropW / EMU_PER_INCH}`)\n\t\tconsole.log(`| tablePropH ...................................... = ${tablePropH / EMU_PER_INCH}`)\n\t\tconsole.log(`| tableCalcW ...................................... = ${tableCalcW / EMU_PER_INCH}`)\n\t}\n\n\t// STEP 1: Calculate margins\n\t{\n\t\t// Important: Use default size as zero cell margin is causing our tables to be too large and touch bottom of slide!\n\t\tif (!tableProps.slideMargin && tableProps.slideMargin !== 0) tableProps.slideMargin = DEF_SLIDE_MARGIN_IN[0]\n\n\t\tif (masterSlide && typeof masterSlide._margin !== 'undefined') {\n\t\t\tif (Array.isArray(masterSlide._margin)) arrInchMargins = masterSlide._margin\n\t\t\telse if (!isNaN(Number(masterSlide._margin))) {\n\t\t\t\tarrInchMargins = [\n\t\t\t\t\tNumber(masterSlide._margin),\n\t\t\t\t\tNumber(masterSlide._margin),\n\t\t\t\t\tNumber(masterSlide._margin),\n\t\t\t\t\tNumber(masterSlide._margin),\n\t\t\t\t]\n\t\t\t}\n\t\t} else if (tableProps.slideMargin || tableProps.slideMargin === 0) {\n\t\t\tif (Array.isArray(tableProps.slideMargin)) arrInchMargins = tableProps.slideMargin\n\t\t\telse if (!isNaN(tableProps.slideMargin))\n\t\t\t\tarrInchMargins = [\n\t\t\t\t\ttableProps.slideMargin,\n\t\t\t\t\ttableProps.slideMargin,\n\t\t\t\t\ttableProps.slideMargin,\n\t\t\t\t\ttableProps.slideMargin,\n\t\t\t\t]\n\t\t}\n\n\t\tif (tableProps.verbose)\n\t\t\tconsole.log(`| arrInchMargins .................................. = [${arrInchMargins.join(', ')}]`)\n\t}\n\n\t// STEP 2: Calculate number of columns\n\t{\n\t\t// NOTE: Cells may have a colspan, so merely taking the length of the [0] (or any other) row is not\n\t\t// ....: sufficient to determine column count. Therefore, check each cell for a colspan and total cols as reqd\n\t\tconst firstRow = tableRows[0] || []\n\t\tfirstRow.forEach((cell) => {\n\t\t\tif (!cell) cell = { _type: SlideObjectType.tablecell }\n\t\t\tconst cellOpts = cell.options || null\n\t\t\tnumCols += Number(cellOpts?.colspan ? cellOpts.colspan : 1)\n\t\t})\n\t\tif (tableProps.verbose) console.log(`| numCols ......................................... = ${numCols}`)\n\t}\n\n\t// Track per-column remaining rowspan depths so we can suppress page breaks that would\n\t// fall inside a rowspan group. colSpanDepths[c] = how many more rows column c is still\n\t// occupied by a rowspan that started in a previous row.\n\tconst colSpanDepths: number[] = new Array<number>(numCols).fill(0)\n\n\t// STEP 3: Calculate width using tableProps.colW if possible\n\tif (!tablePropW && tableProps.colW) {\n\t\ttableCalcW = Array.isArray(tableProps.colW)\n\t\t\t? tableProps.colW.reduce((p, n) => p + n) * EMU_PER_INCH\n\t\t\t: tableProps.colW * numCols || 0\n\t\tif (tableProps.verbose)\n\t\t\tconsole.log(`| tableCalcW ...................................... = ${tableCalcW / EMU_PER_INCH}`)\n\t}\n\n\t// STEP 4: Calculate usable width now that total usable space is known (`emuSlideTabW`)\n\t{\n\t\temuSlideTabW =\n\t\t\ttableCalcW || inch2Emu((tablePropX ? tablePropX / EMU_PER_INCH : arrInchMargins[1]) + arrInchMargins[3])\n\t\tif (tableProps.verbose)\n\t\t\tconsole.log(`| emuSlideTabW .................................... = ${(emuSlideTabW / EMU_PER_INCH).toFixed(1)}`)\n\t}\n\n\t// STEP 5: Calculate column widths if not provided (emuSlideTabW will be used below to determine lines-per-col)\n\tif (!tableProps.colW || !Array.isArray(tableProps.colW)) {\n\t\tif (tableProps.colW && !isNaN(Number(tableProps.colW))) {\n\t\t\tconst arrColW: number[] = []\n\t\t\tconst colW = Number(tableProps.colW)\n\t\t\tconst firstRow = tableRows[0] || []\n\t\t\tfirstRow.forEach(() => arrColW.push(colW))\n\t\t\ttableProps.colW = []\n\t\t\tarrColW.forEach((val) => {\n\t\t\t\tif (Array.isArray(tableProps.colW)) tableProps.colW.push(val)\n\t\t\t})\n\t\t} else {\n\t\t\t// No column widths provided? Then distribute cols.\n\t\t\ttableProps.colW = []\n\t\t\tfor (let iCol = 0; iCol < numCols; iCol++) {\n\t\t\t\ttableProps.colW.push(emuSlideTabW / EMU_PER_INCH / numCols)\n\t\t\t}\n\t\t}\n\t}\n\n\t// Resolve a row's explicit height (inches) from the original `rowH` *array*, keyed by original\n\t// row index. A single-number `rowH` is left to propagate via table options (it applies uniformly,\n\t// so it needs no per-row remapping); only the array form is index-sensitive after pagination.\n\tconst resolveRowH = (origRowIdx: number): number | undefined =>\n\t\tArray.isArray(tableProps.rowH) && typeof tableProps.rowH[origRowIdx] === 'number'\n\t\t\t? tableProps.rowH[origRowIdx]\n\t\t\t: undefined\n\n\t// STEP 6: **MAIN** Iterate over rows, add table content, create new slides as rows overflow\n\tlet newTableRowSlide: TableRowSlide = { rows: [] as TableRow[], rowH: [] as Array<number | undefined> }\n\ttableRows.forEach((row, iRow) => {\n\t\t// A: Row variables — detect active rowspan at the start of this row so we can\n\t\t// suppress page breaks that would split a rowspan group across slides.\n\t\tconst hasActiveRowSpan = colSpanDepths.some((d) => d > 0)\n\t\tconst rowCellLines: AutoPageCell[] = []\n\t\tlet maxCellMarTopEmu = 0\n\t\tlet maxCellMarBtmEmu = 0\n\n\t\t// B: Create new row in data model, calc `maxCellMar*`\n\t\tlet currTableRow: TableRow = []\n\t\trow.forEach((cell) => {\n\t\t\tcurrTableRow.push({\n\t\t\t\t_type: SlideObjectType.tablecell,\n\t\t\t\ttext: [],\n\t\t\t\toptions: cell.options,\n\t\t\t})\n\n\t\t\t// Cell margins are inches (see `marginToEmu`); prefer the cell's own top/bottom margin, else the table's.\n\t\t\tconst cellMargin = Array.isArray(cell.options?.margin) ? cell.options.margin : undefined\n\t\t\tconst tableMargin = Array.isArray(tableProps.margin) ? tableProps.margin : null\n\t\t\tif (cellMargin?.[0] && marginToEmu(cellMargin[0]) > maxCellMarTopEmu)\n\t\t\t\tmaxCellMarTopEmu = marginToEmu(cellMargin[0])\n\t\t\telse if (tableMargin?.[0] && marginToEmu(tableMargin[0]) > maxCellMarTopEmu)\n\t\t\t\tmaxCellMarTopEmu = marginToEmu(tableMargin[0])\n\t\t\tif (cellMargin?.[2] && marginToEmu(cellMargin[2]) > maxCellMarBtmEmu)\n\t\t\t\tmaxCellMarBtmEmu = marginToEmu(cellMargin[2])\n\t\t\telse if (tableMargin?.[2] && marginToEmu(tableMargin[2]) > maxCellMarBtmEmu)\n\t\t\t\tmaxCellMarBtmEmu = marginToEmu(tableMargin[2])\n\t\t})\n\n\t\t// C: Calc usable vertical space/table height. Set default value first, adjust below when necessary.\n\t\tcalcSlideTabH()\n\t\temuTabCurrH += maxCellMarTopEmu + maxCellMarBtmEmu // Start row height with margins\n\t\tif (tableProps.verbose && iRow === 0)\n\t\t\tconsole.log(\n\t\t\t\t`| SLIDE [${tableRowSlides.length}]: emuSlideTabH ...... = ${(emuSlideTabH / EMU_PER_INCH).toFixed(1)} `\n\t\t\t)\n\n\t\t// D: --==[[ BUILD DATA SET ]]==-- (iterate over cells: split text into lines[], set `lineHeight`)\n\t\trow.forEach((cell, iCell) => {\n\t\t\tconst newCellOptions = cell.options || {}\n\t\t\tconst newCell: AutoPageCell = {\n\t\t\t\t_type: SlideObjectType.tablecell,\n\t\t\t\t_lines: [],\n\t\t\t\t_lineHeight: inch2Emu(\n\t\t\t\t\t((cell.options?.fontSize\n\t\t\t\t\t\t? cell.options.fontSize\n\t\t\t\t\t\t: tableProps.fontSize\n\t\t\t\t\t\t\t? tableProps.fontSize\n\t\t\t\t\t\t\t: DEF_FONT_SIZE) *\n\t\t\t\t\t\t(LINEH_MODIFIER + (tableProps.autoPageLineWeight ? tableProps.autoPageLineWeight : 0))) /\n\t\t\t\t\t\t100\n\t\t\t\t),\n\t\t\t\ttext: [],\n\t\t\t\toptions: newCellOptions,\n\t\t\t}\n\n\t\t\t// E-1: Exempt cells with `rowspan` from increasing lineHeight (or we could create a new slide when unecessary!)\n\t\t\tif (newCellOptions.rowspan) newCell._lineHeight = 0\n\n\t\t\t// E-2: The parseTextToLines method uses `autoPageCharWeight`, so inherit from table options\n\t\t\tnewCellOptions.autoPageCharWeight = tableProps.autoPageCharWeight || undefined\n\n\t\t\t// E-3: **MAIN** Parse cell contents into lines based upon col width, font, etc\n\t\t\tconst tableColW = Array.isArray(tableProps.colW) ? tableProps.colW : []\n\t\t\tlet totalColW = tableColW[iCell] ?? 0\n\t\t\tconst cellColspan = cell.options?.colspan\n\t\t\tif (cellColspan) {\n\t\t\t\ttotalColW = tableColW\n\t\t\t\t\t.filter((_cell, idx) => idx >= iCell && idx < idx + cellColspan)\n\t\t\t\t\t.reduce((prev, curr) => prev + curr)\n\t\t\t}\n\n\t\t\t// E-4: Create lines based upon available column width\n\t\t\tnewCell._lines = parseTextToLines(cell, totalColW, tableProps.verbose)\n\n\t\t\t// E-5: Add cell to array\n\t\t\trowCellLines.push(newCell)\n\t\t})\n\n\t\t/** E: --==[[ PAGE DATA SET ]]==--\n\t\t * Add text one-line-a-time to this row's cells until: lines are exhausted OR table height limit is hit\n\t\t *\n\t\t * Design:\n\t\t * - Building cells L-to-R/loop style wont work as one could be 100 lines and another 1 line\n\t\t * - Therefore, build the whole row, one-line-at-a-time, across each table columns\n\t\t * - Then, when the vertical size limit is hit is by any of the cells, make a new slide and continue adding any remaining lines\n\t\t *\n\t\t * Implementation:\n\t\t * - `rowCellLines` is an array of cells, one for each column in the table, with each cell containing an array of lines\n\t\t *\n\t\t * Sample Data:\n\t\t * - `rowCellLines` ..: [ TableCell, TableCell, TableCell ]\n\t\t * - `TableCell` .....: { _type: 'tablecell', _lines: TableCell[], _lineHeight: 10 }\n\t\t * - `_lines` ........: [ {_type: 'tablecell', text: 'cell-1,line-1', options: {…}}, {_type: 'tablecell', text: 'cell-1,line-2', options: {…}} }\n\t\t * - `_lines` is TableCell[] (the 1-N words in the line)\n\t\t * {\n\t\t * _lines: [{ text:'cell-1,line-1' }, { text:'cell-1,line-2' }], // TOTAL-CELL-HEIGHT = 2\n\t\t * _lines: [{ text:'cell-2,line-1' }, { text:'cell-2,line-2' }], // TOTAL-CELL-HEIGHT = 2\n\t\t * _lines: [{ text:'cell-3,line-1' }, { text:'cell-3,line-2' }, { text:'cell-3,line-3' }, { text:'cell-3,line-4' }], // TOTAL-CELL-HEIGHT = 4\n\t\t * }\n\t\t *\n\t\t * Example: 2 rows, with the firstrow overflowing onto a new slide\n\t\t * SLIDE 1:\n\t\t * |--------|--------|--------|--------|\n\t\t * | line-1 | line-1 | line-1 | line-1 |\n\t\t * | | | line-2 | |\n\t\t * | | | line-3 | |\n\t\t * |--------|--------|--------|--------|\n\t\t *\n\t\t * SLIDE 2:\n\t\t * |--------|--------|--------|--------|\n\t\t * | | | line-4 | |\n\t\t * |--------|--------|--------|--------|\n\t\t * | line-1 | line-1 | line-1 | line-1 |\n\t\t * |--------|--------|--------|--------|\n\t\t */\n\t\tif (tableProps.verbose) console.log(`\\n| SLIDE [${tableRowSlides.length}]: ROW [${iRow}]: START...`)\n\t\tlet currCellIdx = 0\n\t\tlet emuLineMaxH = 0\n\t\tlet isDone = false\n\t\twhile (!isDone) {\n\t\t\tconst srcCell = rowCellLines[currCellIdx]\n\t\t\tif (!srcCell) break\n\t\t\tlet tgtCell = currTableRow[currCellIdx] // NOTE: may be redefined below (a new row may be created, thus changing this value)\n\n\t\t\t// 1: calc emuLineMaxH\n\t\t\trowCellLines.forEach((cell) => {\n\t\t\t\tif (cell._lineHeight >= emuLineMaxH) emuLineMaxH = cell._lineHeight\n\t\t\t})\n\n\t\t\t// 2: create a new slide if there is insufficient room for the current row,\n\t\t\t// but never break inside a rowspan group — keep spanned rows together.\n\t\t\tif (emuTabCurrH + emuLineMaxH > emuSlideTabH && !hasActiveRowSpan) {\n\t\t\t\tif (tableProps.verbose) {\n\t\t\t\t\tconsole.log('\\n|-----------------------------------------------------------------------|')\n\t\t\t\t\t// prettier-ignore\n\t\t\t\t\tconsole.log(`|-- NEW SLIDE CREATED (currTabH+currLineH > maxH) => ${(emuTabCurrH / EMU_PER_INCH).toFixed(2)} + ${(srcCell._lineHeight / EMU_PER_INCH).toFixed(2)} > ${emuSlideTabH / EMU_PER_INCH}`)\n\t\t\t\t\tconsole.log('|-----------------------------------------------------------------------|\\n\\n')\n\t\t\t\t}\n\n\t\t\t\t// A: add current row slide or it will be lost (only if it has rows and text)\n\t\t\t\tif (\n\t\t\t\t\tcurrTableRow.length > 0 &&\n\t\t\t\t\tcurrTableRow.map((cell) => (Array.isArray(cell.text) ? cell.text.length : 0)).reduce((p, n) => p + n) > 0\n\t\t\t\t) {\n\t\t\t\t\tnewTableRowSlide.rows.push(currTableRow)\n\t\t\t\t\tnewTableRowSlide.rowH?.push(resolveRowH(iRow))\n\t\t\t\t}\n\n\t\t\t\t// B: add current slide to Slides array (never push an empty page: a row that does not\n\t\t\t\t// fit yet has no content here, and an empty `rows` slide crashes the recursive addTable)\n\t\t\t\tif (newTableRowSlide.rows.length > 0) tableRowSlides.push(newTableRowSlide)\n\n\t\t\t\t// C: reset working/curr slide to hold rows as they're created\n\t\t\t\tconst newRows: TableRow[] = []\n\t\t\t\tnewTableRowSlide = { rows: newRows, rowH: [] as Array<number | undefined> }\n\n\t\t\t\t// D: reset working/curr row\n\t\t\t\tcurrTableRow = []\n\t\t\t\trow.forEach((cell) => currTableRow.push({ _type: SlideObjectType.tablecell, text: [], options: cell.options }))\n\n\t\t\t\t// E: Calc usable vertical space/table height now as we may still be in the same row and code above (\"C: Calc usable vertical space/table height.\") calc may now be invalid\n\t\t\t\tcalcSlideTabH()\n\n\t\t\t\t// F: reset current table height for this new Slide, then re-charge the row's cell\n\t\t\t\t// margins onto it — the row is starting over here, so it owes them again.\n\t\t\t\t//\n\t\t\t\t// ORDER IS LOAD-BEARING. These two statements used to run the other way round: the\n\t\t\t\t// margins were added and then wiped by the reset, so the first row of every\n\t\t\t\t// continuation slide was the only row in the table that paid no margin. That let a\n\t\t\t\t// continuation slide accept one row more than it had room for, and the extra row\n\t\t\t\t// hung off the bottom of the slide (upstream gitbrent/PptxGenJS#1200). The symptom\n\t\t\t\t// is easy to miss because the pager is *self*-consistent per slide: it only shows\n\t\t\t\t// up as the first slide and the continuation slides disagreeing about how many\n\t\t\t\t// identical rows fit the identical space — which is what\n\t\t\t\t// test/regression/table-autopage-continuation-budget.test.js pins.\n\t\t\t\temuTabCurrH = maxCellMarTopEmu + maxCellMarBtmEmu\n\t\t\t\tif (tableProps.verbose)\n\t\t\t\t\tconsole.log(\n\t\t\t\t\t\t`| SLIDE [${tableRowSlides.length}]: emuSlideTabH ...... = ${(emuSlideTabH / EMU_PER_INCH).toFixed(1)} `\n\t\t\t\t\t)\n\n\t\t\t\t// G: handle repeat headers option /or/ Add new empty row to continue current lines into\n\t\t\t\tif (tableProps.autoPageRepeatHeader && tableProps._arrObjTabHeadRows) {\n\t\t\t\t\ttableProps._arrObjTabHeadRows.forEach((row, headIdx) => {\n\t\t\t\t\t\tconst newHeadRow: TableRow = []\n\t\t\t\t\t\tlet maxLineHeight = 0\n\t\t\t\t\t\trow.forEach((cell) => {\n\t\t\t\t\t\t\tnewHeadRow.push(cell)\n\t\t\t\t\t\t\tif ((cell._lineHeight || 0) > maxLineHeight) maxLineHeight = cell._lineHeight || 0\n\t\t\t\t\t\t})\n\t\t\t\t\t\tnewTableRowSlide.rows.push(newHeadRow)\n\t\t\t\t\t\t// Repeated header rows are the original leading rows, so carry their configured height.\n\t\t\t\t\t\tnewTableRowSlide.rowH?.push(resolveRowH(headIdx))\n\t\t\t\t\t\t// NOTE: possible imprecision — this accumulates line height only; cell top/bottom\n\t\t\t\t\t\t// margins are not added, so autoPage row-height estimates can run slightly short.\n\t\t\t\t\t\temuTabCurrH += maxLineHeight\n\t\t\t\t\t})\n\t\t\t\t}\n\n\t\t\t\t// WIP: NEW: TEST THIS!!\n\t\t\t\ttgtCell = currTableRow[currCellIdx]\n\t\t\t}\n\n\t\t\t// 3: set array of words that comprise this line\n\t\t\tconst currLine = srcCell._lines.shift()\n\n\t\t\t// 4: create new line by adding all words from curr line (or add empty if there are no words to avoid \"needs repair\" issue triggered when cells have null content)\n\t\t\tif (tgtCell && Array.isArray(tgtCell.text)) {\n\t\t\t\tif (currLine) tgtCell.text = tgtCell.text.concat(currLine)\n\t\t\t\telse if (tgtCell.text.length === 0)\n\t\t\t\t\ttgtCell.text = tgtCell.text.concat({ _type: SlideObjectType.tablecell, text: '' })\n\t\t\t\t// IMPORTANT: ^^^ add empty if there are no words to avoid \"needs repair\" issue triggered when cells have null content\n\t\t\t}\n\n\t\t\t// 5: increase table height by the curr line height (if we're on the last column)\n\t\t\tif (currCellIdx === rowCellLines.length - 1) emuTabCurrH += emuLineMaxH\n\n\t\t\t// 6: advance column/cell index (or circle back to first one to continue adding lines)\n\t\t\tcurrCellIdx = currCellIdx < rowCellLines.length - 1 ? currCellIdx + 1 : 0\n\n\t\t\t// 7: WIP: done?\n\t\t\tconst brent = rowCellLines.map((cell) => cell._lines.length).reduce((prev, next) => prev + next)\n\t\t\tif (brent === 0) isDone = true\n\t\t}\n\n\t\t// F: Flush/capture row buffer before it resets at the top of this loop\n\t\tif (currTableRow.length > 0) {\n\t\t\tnewTableRowSlide.rows.push(currTableRow)\n\t\t\tnewTableRowSlide.rowH?.push(resolveRowH(iRow))\n\t\t}\n\n\t\t// G: Update colSpanDepths for the next row's hasActiveRowSpan check.\n\t\t// Snapshot occupied columns *before* adding new spans from this row so that\n\t\t// cells in this row are placed correctly even when the row itself starts spans.\n\t\tconst occupiedBefore = [...colSpanDepths]\n\t\tlet colCursor = 0\n\t\trow.forEach((cell) => {\n\t\t\twhile (colCursor < numCols && (occupiedBefore[colCursor] ?? 0) > 0) colCursor++\n\t\t\tconst cellColspan = cell.options?.colspan ?? 1\n\t\t\tconst cellRowspan = cell.options?.rowspan ?? 1\n\t\t\tif (cellRowspan > 1) {\n\t\t\t\tfor (let c = 0; c < cellColspan && colCursor + c < numCols; c++) {\n\t\t\t\t\tcolSpanDepths[colCursor + c] = cellRowspan\n\t\t\t\t}\n\t\t\t}\n\t\t\tcolCursor += cellColspan\n\t\t})\n\t\t// Consume one row from every active span (including ones just opened above).\n\t\tfor (let c = 0; c < numCols; c++) {\n\t\t\tconst depth = colSpanDepths[c] ?? 0\n\t\t\tif (depth > 0) colSpanDepths[c] = depth - 1\n\t\t}\n\n\t\tif (tableProps.verbose) {\n\t\t\tconsole.log(\n\t\t\t\t`- SLIDE [${tableRowSlides.length}]: ROW [${iRow}]: ...COMPLETE ...... emuTabCurrH = ${(emuTabCurrH / EMU_PER_INCH).toFixed(2)} ( emuSlideTabH = ${(\n\t\t\t\t\temuSlideTabH / EMU_PER_INCH\n\t\t\t\t).toFixed(2)} )`\n\t\t\t)\n\t\t}\n\t})\n\n\t// STEP 7: Flush buffer / add final slide (skip an empty trailing buffer; always keep at least\n\t// one slide so a non-empty table is never reduced to zero pages)\n\tif (newTableRowSlide.rows.length > 0 || tableRowSlides.length === 0) tableRowSlides.push(newTableRowSlide)\n\n\tif (tableProps.verbose) {\n\t\tconsole.log('\\n|================================================|')\n\t\tconsole.log(`| FINAL: tableRowSlides.length = ${tableRowSlides.length}`)\n\t\ttableRowSlides.forEach((slide) => console.log(slide))\n\t\tconsole.log('|================================================|\\n\\n')\n\t}\n\n\t// LAST:\n\treturn tableRowSlides\n}\n"],"mappings":";;;;;;;;;;;AAyCA,SAAS,iBAAiB,MAAiB,UAAkB,SAAkC;CAK9F,MAAM,OAAO,OAAO,KAAK,SAAS,qBAAqB,KAAK,QAAQ,qBAAqB;CAOzF,MAAM,MACL,KAAK,MAAM,WAAA,EAA0B,MAAM,KAAK,SAAS,WAAW,KAAK,QAAQ,WAAA,MAA4B;CAK9G,IAAI,SACH,QAAQ,IACP,kBAAkB,SAAS,cAAc,KAAK,SAAS,YAAA,GAA0B,QAAQ,KAAK,OAAO,KACtG;CAED,MAAM,cAA6B,CAAC;CACpC,IAAI,aAA0B,CAAC;CAC/B,MAAM,cAA6B,CAAC;CACpC,MAAM,cAA6B,CAAC;;;;;;;;;;;;;;;CAmBpC,IAAI,KAAK,QAAQ,KAAK,KAAK,SAAS,CAAC,CAAC,KAAK,CAAC,CAAC,WAAW,GAEvD,WAAW,KAAK;EAAE,OAAA;EAAkC,MAAM;CAAI,CAAC;MACzD,IAAI,OAAO,KA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AS,KAC3D,cAAc,YAAY,KAAK;GAGjC,aAAa;EACd,CAAC;EAED,KAAK,IAAI,IAAI,GAAG,IAAI,SAAS,KAAK;GACjC,MAAM,QAAQ,cAAc,MAAM;GAClC,IAAI,QAAQ,GAAG,cAAc,KAAK,QAAQ;EAC3C;EAEA,IAAI,WAAW,SACd,QAAQ,IACP,YAAY,eAAe,OAAO,UAAU,KAAK,uCAAuC,cAAc,aAAA,CAAc,QAAQ,CAAC,EAAE,qBAC9H,eAAe,aAAA,CACd,QAAQ,CAAC,EAAE,GACd;CAEF,CAAC;CAID,IAAI,iBAAiB,KAAK,SAAS,KAAK,eAAe,WAAW,GAAG,eAAe,KAAK,gBAAgB;CAEzG,IAAI,WAAW,SAAS;EACvB,QAAQ,IAAI,sDAAsD;EAClE,QAAQ,IAAI,oCAAoC,eAAe,QAAQ;EACvE,eAAe,SAAS,UAAU,QAAQ,IAAI,KAAK,CAAC;EACpD,QAAQ,IAAI,wDAAwD;CACrE;CAGA,OAAO;AACR"}
|
package/dist/browser.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { C as isChartExType, S as connectorPresetFor, _ as TextAnchor, a as CONNECTOR_PRESETS, b as ZIP_OUTPUT_TYPE, c as OutputType, d as SCHEME_COLORS, f as SHAPE_NAME, g as TableStyle, h as SlideObjectType, i as CHART_NAME, l as PLACEHOLDER_TYPE, m as ShapeType, n as AlignV, o as CONNECTOR_PRESET_NAME, p as SchemeColor, r as BulletType, s as ChartType, t as AlignH, u as PlaceholderType, v as VALID_SHAPE_PRESETS, w as isChartType, x as asChartType, y as WRITE_OUTPUT_TYPE } from "./enums-CvRYniUA.js";
|
|
2
|
-
import { $ as
|
|
3
|
-
import { a as PresentationProps, c as WriteFileProps, d as ThemeProps, i as PresLayout, l as WriteProps, n as PackagePart, o as SectionProps, r as PartsProps, s as WriteBaseProps, t as CustomPropertyValue, u as ThemeColorScheme } from "./pres-
|
|
4
|
-
import { A as
|
|
2
|
+
import { $ as PositionProps, $t as CommentProps, A as TableToSlidesDocument, At as ChartPropsChartBar, B as Coord, Bt as ChartPropsChartWaterfall, C as TableCell, Ct as ChartLineDash, D as TableProps, Dt as ChartPropsAxisSer, E as TableCellProps, Et as ChartPropsAxisCat, F as MediaProps, Ft as ChartPropsChartPie, G as GradientStopProps, Gt as ChartPropsTitle, H as DataOrPathRequiredProps, Ht as ChartPropsDataTable, I as MediaType, It as ChartPropsChartRadar, J as ImageFillProps, Jt as OptsChartData, K as HAlign, Kt as ChartSeriesOpts, L as OleObjectProps, Lt as ChartPropsChartRegionMap, M as TableToSlidesProps, Mt as ChartPropsChartDoughnut, N as ImageBaseProps, Nt as ChartPropsChartHistogram, O as TableRow, Ot as ChartPropsAxisVal, P as ImageProps, Pt as ChartPropsChartLine, Q as PatternPreset, Qt as PlaceholderProps, R as BackgroundProps, Rt as ChartPropsChartStock, S as TransitionType, Sn as ShapeProps, St as ChartExStatistics, T as TableCellDiagonals, Tt as ChartOpts, U as GeometryPoint, Ut as ChartPropsFillLine, V as DataOrPathProps, Vt as ChartPropsDataLabel, W as GradientFillProps, Wt as ChartPropsLegend, X as Margin, Xt as ObjectLockProps, Y as LinearGradientFillProps, Yt as OptsChartGridLine, Z as PatternFillProps, Zt as ObjectNameProps, _ as AnimationProps, _n as ShapeAdjustHandlePolar, _t as ChartAxisTickMark, a as Slide, an as SlideComment, at as ConnectorProps, b as TransitionProps, bn as ShapeConnectionSite, bt as ChartExBinning, c as Model3dPoint, cn as TextBaseProps, ct as HyperlinkProps, d as MasterTextStyleLevel, dn as TextMeasurement, dt as ShapeLineProps, en as MeasureTextOptions, et as RadialGradientFillProps, f as MasterTextStyleProps, fn as TextProps, ft as BevelPresetType, g as SlideNumberProps, gn as ShapeAdjustHandle, gt as ChartAreaProps, h as SlideMasterProps, hn as textRuns, ht as PresetMaterialType, i as ObjectOptions, in as ResolvedCommentAuthor, it as BorderProps, j as TableToSlidesElement, jt as ChartPropsChartBoxWhisker, k as TableRowSlide, kt as ChartPropsBase, l as Model3dProps, ln as TextFitShrinkProps, lt as ShadowProps, m as SlideMasterObject, mn as textRun, mt as LightRigType, n as GroupChildProps, nn as NotesTextOptions, nt as ThemeColor, o as SlideLayout, on as TableCellLayout, ot as ConnectorType, p as SlideMasterChartProps, pn as TextPropsOptions, pt as LightRigDirection, q as HexColor, qt as LineCap, r as GroupProps, rn as OverflowBoxOptions, rt as VAlign, s as Model3dCameraProps, sn as TableLayoutResult, st as HyperlinkActionJump, t as AddSlideProps, tn as NotesProps, tt as TextVertType, u as MasterBulletProps, un as TextGlowProps, ut as ShapeFillProps, v as AnimationTrigger, vn as ShapeAdjustHandleXY, vt as ChartDataPointStyle, w as TableCell3DProps, wt as ChartMulti, x as TransitionSoundProps, xn as ShapeGuide, xt as ChartExGeography, y as PresetEffect, yn as ShapeAdjustValue, yt as ChartErrorBarOptions, z as Color, zt as ChartPropsChartSurface } from "./slide-B_aInw3N.js";
|
|
3
|
+
import { a as PresentationProps, c as WriteFileProps, d as ThemeProps, i as PresLayout, l as WriteProps, n as PackagePart, o as SectionProps, r as PartsProps, s as WriteBaseProps, t as CustomPropertyValue, u as ThemeColorScheme } from "./pres-Dybf7ZUl.js";
|
|
4
|
+
import { A as ptToHundredths, C as emuToInches, D as percentToEmu, E as inchesToEmu, M as SlideZoomProps, N as SummaryZoomProps, O as pixelsToEmu, P as ZoomBaseProps, S as coordToEmu, T as emuToPoints, _ as PERCENT_SCALE, a as ClipShape, b as StandardLayout, c as clipPath, d as DEFAULT_PX_PER_INCH, f as EMU_PER_INCH, g as HUNDREDTHS_PER_POINT, h as FIXED_PCT_PER_PERCENT, i as setDiagnosticHandler, j as SectionZoomProps, k as pointsToEmu, l as PresentationCore, m as Emu, n as DiagnosticHandler, o as FlatSide, p as EMU_PER_POINT, r as resetDiagnosticState, s as HalfDiscPreset, t as Diagnostic, u as ANGLE_UNITS_PER_DEGREE, v as POINTS_PER_INCH, w as emuToPixels, x as StandardLayoutName, y as STANDARD_LAYOUTS } from "./diagnostics-B0OmTOoz.js";
|
|
5
5
|
import { a as TsPptxError, c as DiagnosticCode, d as InvalidOptionErrorCode, f as MediaErrorCode, h as UnsupportedFeatureErrorCode, i as PackageReadError, l as ErrorCode, m as TsPptxCode, n as InvalidOptionError, o as TsPptxErrorOptions, p as PackageReadErrorCode, r as MediaError, s as UnsupportedFeatureError, t as InternalError, u as InternalErrorCode } from "./errors-fB1KDJKQ.js";
|
|
6
6
|
//#region src/browser.d.ts
|
|
7
7
|
/**
|
|
@@ -27,5 +27,5 @@ declare class TsPptx extends PresentationCore {
|
|
|
27
27
|
tableToSlides(eleId: string, options?: TableToSlidesProps): void;
|
|
28
28
|
}
|
|
29
29
|
//#endregion
|
|
30
|
-
export { ANGLE_UNITS_PER_DEGREE, AddSlideProps, AlignH, AlignV, AnimationProps, AnimationTrigger, BackgroundProps, type BevelPresetType, BorderProps, BulletType, CHART_NAME, CONNECTOR_PRESETS, CONNECTOR_PRESET_NAME, ChartAreaProps, ChartAxisTickMark, ChartDataPointStyle, ChartErrorBarOptions, ChartExBinning, ChartExGeography, ChartExStatistics, ChartLineDash, ChartMulti, ChartOpts, ChartPropsAxisCat, ChartPropsAxisSer, ChartPropsAxisVal, ChartPropsBase, ChartPropsChartBar, ChartPropsChartBoxWhisker, ChartPropsChartDoughnut, ChartPropsChartHistogram, ChartPropsChartLine, ChartPropsChartPie, ChartPropsChartRadar, ChartPropsChartRegionMap, ChartPropsChartStock, ChartPropsChartSurface, ChartPropsChartWaterfall, ChartPropsDataLabel, ChartPropsDataTable, ChartPropsFillLine, ChartPropsLegend, ChartPropsTitle, ChartSeriesOpts, ChartType, ClipShape, Color, CommentProps, ConnectorProps, ConnectorType, Coord, CustomPropertyValue, DEFAULT_PX_PER_INCH, DataOrPathProps, DataOrPathRequiredProps, type Diagnostic, type DiagnosticCode, type DiagnosticHandler, EMU_PER_INCH, EMU_PER_POINT, Emu, type ErrorCode, FIXED_PCT_PER_PERCENT, FlatSide, GeometryPoint, GradientFillProps, GradientStopProps, GroupChildProps, GroupProps, HAlign, HUNDREDTHS_PER_POINT, HalfDiscPreset, HexColor, HyperlinkActionJump, HyperlinkProps, ImageBaseProps, ImageFillProps, ImageProps, InternalError, type InternalErrorCode, InvalidOptionError, type InvalidOptionErrorCode, type LightRigDirection, type LightRigType, LineCap, LinearGradientFillProps, Margin, MasterBulletProps, MasterTextStyleLevel, MasterTextStyleProps, MeasureTextOptions, MediaError, type MediaErrorCode, MediaProps, MediaType, Model3dCameraProps, Model3dPoint, Model3dProps, NotesProps, NotesTextOptions, ObjectLockProps, ObjectNameProps, ObjectOptions, OleObjectProps, OptsChartData, OptsChartGridLine, OutputType, OverflowBoxOptions, PERCENT_SCALE, PLACEHOLDER_TYPE, POINTS_PER_INCH, PackagePart, PackageReadError, type PackageReadErrorCode, PartsProps, PatternFillProps, PatternPreset, PlaceholderProps, PlaceholderType, PositionProps, PresLayout, PresentationProps, PresetEffect, type PresetMaterialType, RadialGradientFillProps, ResolvedCommentAuthor, SCHEME_COLORS, SHAPE_NAME, STANDARD_LAYOUTS, SchemeColor, SectionProps, SectionZoomProps, ShadowProps, ShapeAdjustHandle, ShapeAdjustHandlePolar, ShapeAdjustHandleXY, ShapeAdjustValue, ShapeConnectionSite, ShapeFillProps, ShapeGuide, ShapeLineProps, ShapeProps, ShapeType, Slide, SlideComment, SlideLayout, SlideMasterChartProps, SlideMasterObject, SlideMasterProps, SlideNumberProps, SlideObjectType, SlideZoomProps, StandardLayout, StandardLayoutName, SummaryZoomProps, TableCell, TableCell3DProps, TableCellDiagonals, TableCellLayout, TableCellProps, TableLayoutResult, TableProps, TableRow, TableRowSlide, TableStyle, TableToSlidesDocument, TableToSlidesElement, TableToSlidesProps, TextAnchor, TextBaseProps, TextFitShrinkProps, TextGlowProps, TextMeasurement, TextProps, TextPropsOptions, TextVertType, ThemeColor, ThemeColorScheme, ThemeProps, TransitionProps, TransitionSoundProps, TransitionType, TsPptx, TsPptx as default, type TsPptxCode, TsPptxError, type TsPptxErrorOptions, UnsupportedFeatureError, type UnsupportedFeatureErrorCode, VALID_SHAPE_PRESETS, VAlign, WRITE_OUTPUT_TYPE, WriteBaseProps, WriteFileProps, WriteProps, ZIP_OUTPUT_TYPE, ZoomBaseProps, asChartType, clipPath, connectorPresetFor, coordToEmu, emuToInches, emuToPixels, emuToPoints, inchesToEmu, isChartExType, isChartType, percentToEmu, pixelsToEmu, pointsToEmu, ptToHundredths, setDiagnosticHandler, textRun, textRuns };
|
|
30
|
+
export { ANGLE_UNITS_PER_DEGREE, AddSlideProps, AlignH, AlignV, AnimationProps, AnimationTrigger, BackgroundProps, type BevelPresetType, BorderProps, BulletType, CHART_NAME, CONNECTOR_PRESETS, CONNECTOR_PRESET_NAME, ChartAreaProps, ChartAxisTickMark, ChartDataPointStyle, ChartErrorBarOptions, ChartExBinning, ChartExGeography, ChartExStatistics, ChartLineDash, ChartMulti, ChartOpts, ChartPropsAxisCat, ChartPropsAxisSer, ChartPropsAxisVal, ChartPropsBase, ChartPropsChartBar, ChartPropsChartBoxWhisker, ChartPropsChartDoughnut, ChartPropsChartHistogram, ChartPropsChartLine, ChartPropsChartPie, ChartPropsChartRadar, ChartPropsChartRegionMap, ChartPropsChartStock, ChartPropsChartSurface, ChartPropsChartWaterfall, ChartPropsDataLabel, ChartPropsDataTable, ChartPropsFillLine, ChartPropsLegend, ChartPropsTitle, ChartSeriesOpts, ChartType, ClipShape, Color, CommentProps, ConnectorProps, ConnectorType, Coord, CustomPropertyValue, DEFAULT_PX_PER_INCH, DataOrPathProps, DataOrPathRequiredProps, type Diagnostic, type DiagnosticCode, type DiagnosticHandler, EMU_PER_INCH, EMU_PER_POINT, Emu, type ErrorCode, FIXED_PCT_PER_PERCENT, FlatSide, GeometryPoint, GradientFillProps, GradientStopProps, GroupChildProps, GroupProps, HAlign, HUNDREDTHS_PER_POINT, HalfDiscPreset, HexColor, HyperlinkActionJump, HyperlinkProps, ImageBaseProps, ImageFillProps, ImageProps, InternalError, type InternalErrorCode, InvalidOptionError, type InvalidOptionErrorCode, type LightRigDirection, type LightRigType, LineCap, LinearGradientFillProps, Margin, MasterBulletProps, MasterTextStyleLevel, MasterTextStyleProps, MeasureTextOptions, MediaError, type MediaErrorCode, MediaProps, MediaType, Model3dCameraProps, Model3dPoint, Model3dProps, NotesProps, NotesTextOptions, ObjectLockProps, ObjectNameProps, ObjectOptions, OleObjectProps, OptsChartData, OptsChartGridLine, OutputType, OverflowBoxOptions, PERCENT_SCALE, PLACEHOLDER_TYPE, POINTS_PER_INCH, PackagePart, PackageReadError, type PackageReadErrorCode, PartsProps, PatternFillProps, PatternPreset, PlaceholderProps, PlaceholderType, PositionProps, PresLayout, PresentationProps, PresetEffect, type PresetMaterialType, RadialGradientFillProps, ResolvedCommentAuthor, SCHEME_COLORS, SHAPE_NAME, STANDARD_LAYOUTS, SchemeColor, SectionProps, SectionZoomProps, ShadowProps, ShapeAdjustHandle, ShapeAdjustHandlePolar, ShapeAdjustHandleXY, ShapeAdjustValue, ShapeConnectionSite, ShapeFillProps, ShapeGuide, ShapeLineProps, ShapeProps, ShapeType, Slide, SlideComment, SlideLayout, SlideMasterChartProps, SlideMasterObject, SlideMasterProps, SlideNumberProps, SlideObjectType, SlideZoomProps, StandardLayout, StandardLayoutName, SummaryZoomProps, TableCell, TableCell3DProps, TableCellDiagonals, TableCellLayout, TableCellProps, TableLayoutResult, TableProps, TableRow, TableRowSlide, TableStyle, TableToSlidesDocument, TableToSlidesElement, TableToSlidesProps, TextAnchor, TextBaseProps, TextFitShrinkProps, TextGlowProps, TextMeasurement, TextProps, TextPropsOptions, TextVertType, ThemeColor, ThemeColorScheme, ThemeProps, TransitionProps, TransitionSoundProps, TransitionType, TsPptx, TsPptx as default, type TsPptxCode, TsPptxError, type TsPptxErrorOptions, UnsupportedFeatureError, type UnsupportedFeatureErrorCode, VALID_SHAPE_PRESETS, VAlign, WRITE_OUTPUT_TYPE, WriteBaseProps, WriteFileProps, WriteProps, ZIP_OUTPUT_TYPE, ZoomBaseProps, asChartType, clipPath, connectorPresetFor, coordToEmu, emuToInches, emuToPixels, emuToPoints, inchesToEmu, isChartExType, isChartType, percentToEmu, pixelsToEmu, pointsToEmu, ptToHundredths, resetDiagnosticState, setDiagnosticHandler, textRun, textRuns };
|
|
31
31
|
//# sourceMappingURL=browser.d.ts.map
|
package/dist/browser.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as setDiagnosticHandler, t as resetDiagnosticState } from "./diagnostics-CPVADSL1.js";
|
|
2
2
|
import { a as TsPptxError, i as PackageReadError, n as InvalidOptionError, o as UnsupportedFeatureError, r as MediaError, t as InternalError } from "./errors-Bvln0H-7.js";
|
|
3
|
-
import { $ as
|
|
4
|
-
import {
|
|
5
|
-
import { t as genTableToSlides } from "./html-dom-
|
|
3
|
+
import { $ as VALID_SHAPE_PRESETS, G as ChartType, H as AlignV, J as SchemeColor, K as OutputType, M as IMG_SVG_PLACEHOLDER, Q as TextAnchor, U as BulletType, V as AlignH, W as CONNECTOR_PRESETS, X as SlideObjectType, Y as ShapeType, Z as TableStyle, _t as inchesToEmu, at as DEFAULT_PX_PER_INCH, bt as pointsToEmu, ct as FIXED_PCT_PER_PERCENT, dt as POINTS_PER_INCH, et as asChartType, ft as STANDARD_LAYOUTS, gt as emuToPoints, ht as emuToPixels, it as ANGLE_UNITS_PER_DEGREE, lt as HUNDREDTHS_PER_POINT, mt as emuToInches, nt as isChartExType, ot as EMU_PER_INCH, pt as coordToEmu, q as PlaceholderType, rt as isChartType, st as EMU_PER_POINT, tt as connectorPresetFor, ut as PERCENT_SCALE, vt as percentToEmu, xt as ptToHundredths, yt as pixelsToEmu } from "./units-internal-DNvK2I6o.js";
|
|
4
|
+
import { c as PresentationCore, i as fetchFontBytes, n as textRuns, r as clipPath, t as textRun } from "./text-DSN3anEh.js";
|
|
5
|
+
import { t as genTableToSlides } from "./html-dom-yUSdCExA.js";
|
|
6
6
|
//#region src/runtime/browser.ts
|
|
7
7
|
function createBrowserRuntime() {
|
|
8
8
|
return {
|
|
@@ -10,14 +10,14 @@ function createBrowserRuntime() {
|
|
|
10
10
|
loadMedia,
|
|
11
11
|
createSvgPngPreview,
|
|
12
12
|
writeFile,
|
|
13
|
-
loadFontData
|
|
13
|
+
loadFontData: fetchFontBytes
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Returns a `data:` URI, not raw base64 — see {@link RuntimeAdapter.loadMedia}. The `FileReader`
|
|
18
|
+
* is what makes this adapter's own implementation worth keeping: it decodes the blob off the main
|
|
19
|
+
* thread, where the shared `fetchMediaBase64` would encode the whole payload synchronously.
|
|
20
|
+
*/
|
|
21
21
|
async function loadMedia(rel) {
|
|
22
22
|
const response = await fetch(rel.path);
|
|
23
23
|
if (!response.ok) throw new MediaError("media/fetch-failed", `Unable to load image (fetch): ${rel.path}`);
|
|
@@ -105,6 +105,6 @@ var TsPptx = class extends PresentationCore {
|
|
|
105
105
|
}
|
|
106
106
|
};
|
|
107
107
|
//#endregion
|
|
108
|
-
export { ANGLE_UNITS_PER_DEGREE, AlignH, AlignV, BulletType, CONNECTOR_PRESETS, ChartType, DEFAULT_PX_PER_INCH, EMU_PER_INCH, EMU_PER_POINT, FIXED_PCT_PER_PERCENT, HUNDREDTHS_PER_POINT, InternalError, InvalidOptionError, MediaError, OutputType, PERCENT_SCALE, POINTS_PER_INCH, PackageReadError, PlaceholderType, STANDARD_LAYOUTS, SchemeColor, ShapeType, SlideObjectType, TableStyle, TextAnchor, TsPptx, TsPptx as default, TsPptxError, UnsupportedFeatureError, VALID_SHAPE_PRESETS, asChartType, clipPath, connectorPresetFor, coordToEmu, emuToInches, emuToPixels, emuToPoints, inchesToEmu, isChartExType, isChartType, percentToEmu, pixelsToEmu, pointsToEmu, ptToHundredths, setDiagnosticHandler, textRun, textRuns };
|
|
108
|
+
export { ANGLE_UNITS_PER_DEGREE, AlignH, AlignV, BulletType, CONNECTOR_PRESETS, ChartType, DEFAULT_PX_PER_INCH, EMU_PER_INCH, EMU_PER_POINT, FIXED_PCT_PER_PERCENT, HUNDREDTHS_PER_POINT, InternalError, InvalidOptionError, MediaError, OutputType, PERCENT_SCALE, POINTS_PER_INCH, PackageReadError, PlaceholderType, STANDARD_LAYOUTS, SchemeColor, ShapeType, SlideObjectType, TableStyle, TextAnchor, TsPptx, TsPptx as default, TsPptxError, UnsupportedFeatureError, VALID_SHAPE_PRESETS, asChartType, clipPath, connectorPresetFor, coordToEmu, emuToInches, emuToPixels, emuToPoints, inchesToEmu, isChartExType, isChartType, percentToEmu, pixelsToEmu, pointsToEmu, ptToHundredths, resetDiagnosticState, setDiagnosticHandler, textRun, textRuns };
|
|
109
109
|
|
|
110
110
|
//# sourceMappingURL=browser.js.map
|
package/dist/browser.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.js","names":[],"sources":["../src/runtime/browser.ts","../src/browser.ts"],"sourcesContent":["import { IMG_SVG_PLACEHOLDER } from '../constants-internal.js'\nimport { MediaError } from '../errors.js'\nimport type { SlideRelMedia } from '../types/internal.js'\nimport type { RuntimeAdapter } from './types.js'\n\nexport function createBrowserRuntime(): RuntimeAdapter {\n\treturn {\n\t\twriteFileOutputType: null,\n\t\tloadMedia,\n\t\tcreateSvgPngPreview,\n\t\twriteFile,\n\t\tloadFontData,\n\t}\n}\n\
|
|
1
|
+
{"version":3,"file":"browser.js","names":[],"sources":["../src/runtime/browser.ts","../src/browser.ts"],"sourcesContent":["import { IMG_SVG_PLACEHOLDER } from '../constants-internal.js'\nimport { MediaError } from '../errors.js'\nimport type { SlideRelMedia } from '../types/internal.js'\nimport type { RuntimeAdapter } from './types.js'\nimport { fetchFontBytes } from './fetch-media.js'\n\nexport function createBrowserRuntime(): RuntimeAdapter {\n\treturn {\n\t\twriteFileOutputType: null,\n\t\tloadMedia,\n\t\tcreateSvgPngPreview,\n\t\twriteFile,\n\t\tloadFontData: fetchFontBytes,\n\t}\n}\n\n/**\n * Returns a `data:` URI, not raw base64 — see {@link RuntimeAdapter.loadMedia}. The `FileReader`\n * is what makes this adapter's own implementation worth keeping: it decodes the blob off the main\n * thread, where the shared `fetchMediaBase64` would encode the whole payload synchronously.\n */\nasync function loadMedia(rel: SlideRelMedia & { path: string }): Promise<string> {\n\tconst response = await fetch(rel.path)\n\tif (!response.ok) throw new MediaError('media/fetch-failed', `Unable to load image (fetch): ${rel.path}`)\n\tconst blob = await response.blob()\n\n\treturn await new Promise<string>((resolve, reject) => {\n\t\tconst reader = new FileReader()\n\t\treader.onloadend = () => resolve(reader.result as string)\n\t\treader.onerror = () =>\n\t\t\treject(new MediaError('media/decode-failed', `Unable to load image (FileReader): ${rel.path}`))\n\t\treader.readAsDataURL(blob)\n\t})\n}\n\nasync function createSvgPngPreview(rel: SlideRelMedia): Promise<string> {\n\treturn await new Promise((resolve, reject) => {\n\t\tconst image = new Image()\n\t\tconst fail = (reason?: unknown) => {\n\t\t\trel.data = IMG_SVG_PLACEHOLDER\n\t\t\treject(\n\t\t\t\tnew MediaError(\n\t\t\t\t\t'media/svg-preview-failed',\n\t\t\t\t\t`Unable to load image (image.onerror): ${rel.path}${reason ? ` - ${String(reason)}` : ''}`\n\t\t\t\t)\n\t\t\t)\n\t\t}\n\n\t\timage.onload = () => {\n\t\t\tif (image.width + image.height === 0) {\n\t\t\t\tfail('h/w=0')\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst canvas = document.createElement('CANVAS') as HTMLCanvasElement\n\t\t\tconst ctx = canvas.getContext('2d')\n\t\t\tif (!ctx) {\n\t\t\t\tfail('canvas 2d context unavailable')\n\t\t\t\treturn\n\t\t\t}\n\t\t\tcanvas.width = image.width\n\t\t\tcanvas.height = image.height\n\t\t\tctx.drawImage(image, 0, 0)\n\t\t\ttry {\n\t\t\t\t// `rel.type` is `image/png`, not the SVG's type, so this is a valid canvas output\n\t\t\t\t// type and not an `image/svg+xml` that silently falls back to PNG.\n\t\t\t\t// `createSvgPngPreview` is only called on a rel flagged `isSvgPng` — all three\n\t\t\t\t// call sites in `gen/media.ts` filter on it — and the only two places that\n\t\t\t\t// create such a rel (`gen/define/image.ts`, `gen/define/text.ts`) set the\n\t\t\t\t// *fallback's* type, since that is the part this writes. The SVG keeps its own\n\t\t\t\t// rel beside it.\n\t\t\t\trel.data = canvas.toDataURL(rel.type)\n\t\t\t\tresolve('done')\n\t\t\t} catch (ex) {\n\t\t\t\tfail(ex)\n\t\t\t}\n\t\t}\n\t\timage.onerror = () => fail()\n\t\timage.src = typeof rel.data === 'string' ? rel.data : IMG_SVG_PLACEHOLDER\n\t})\n}\n\nasync function writeFile(fileName: string, data: string | ArrayBuffer | Blob | Uint8Array): Promise<string> {\n\tconst eleLink = document.createElement('a')\n\teleLink.setAttribute('style', 'display:none;')\n\teleLink.dataset['interception'] = 'off'\n\tdocument.body.appendChild(eleLink)\n\n\tconst url = window.URL.createObjectURL(\n\t\tnew Blob([data as Blob], { type: 'application/vnd.openxmlformats-officedocument.presentationml.presentation' })\n\t)\n\teleLink.href = url\n\teleLink.download = fileName\n\teleLink.click()\n\n\tsetTimeout(() => {\n\t\twindow.URL.revokeObjectURL(url)\n\t\tdocument.body.removeChild(eleLink)\n\t}, 100)\n\n\treturn fileName\n}\n","import PresentationCore from './presentation.js'\nimport { createBrowserRuntime } from './runtime/browser.js'\nimport { genTableToSlides } from './gen/table/html-dom.js'\nimport type { TableToSlidesProps } from './types/index.js'\n\n/**\n * The browser entry, reached through the `browser` export condition — a bundler resolving the\n * bare `@shbernal/ts-pptx` specifier for the web lands here without naming this subpath.\n *\n * Same authoring API as every other entry (see `entry-surface.ts`), plus one method that only\n * makes sense with a live DOM: {@link TsPptx.tableToSlides}. `writeFile` triggers a download\n * rather than touching a filesystem.\n */\nexport class TsPptx extends PresentationCore {\n\tconstructor() {\n\t\tsuper(createBrowserRuntime())\n\t}\n\n\t/**\n\t * Reproduces a rendered HTML `<table>` as a PowerPoint table — including column widths,\n\t * style, etc. — creating one or more slides as needed. Resolves `eleId` against the global\n\t * `document`, so it exists only on the browser/standalone build; the same conversion is\n\t * available anywhere there is a DOM as the free `tableToSlides` on `ts-pptx/html`, which\n\t * also takes the element directly. The in-memory `slide.addTable(rows, opts)` path remains\n\t * the platform-agnostic way to build a table from data you already hold.\n\t * @param {string} eleId - table HTML element ID\n\t * @param {TableToSlidesProps} options - generation options\n\t */\n\ttableToSlides(eleId: string, options: TableToSlidesProps = {}): void {\n\t\t// @note `options.verbose` (a documented dev-only flag on TableToSlidesProps) is read\n\t\t// inside genTableToSlides to trace the auto-paging layout process.\n\t\tgenTableToSlides(this, eleId, options)\n\t}\n}\n\nexport { TsPptx as default }\nexport * from './entry-surface.js'\n"],"mappings":";;;;;;AAMA,SAAgB,uBAAuC;CACtD,OAAO;EACN,qBAAqB;EACrB;EACA;EACA;EACA,cAAc;CACf;AACD;;;;;;AAOA,eAAe,UAAU,KAAwD;CAChF,MAAM,WAAW,MAAM,MAAM,IAAI,IAAI;CACrC,IAAI,CAAC,SAAS,IAAI,MAAM,IAAI,WAAW,sBAAsB,iCAAiC,IAAI,MAAM;CACxG,MAAM,OAAO,MAAM,SAAS,KAAK;CAEjC,OAAO,MAAM,IAAI,SAAiB,SAAS,WAAW;EACrD,MAAM,SAAS,IAAI,WAAW;EAC9B,OAAO,kBAAkB,QAAQ,OAAO,MAAgB;EACxD,OAAO,gBACN,OAAO,IAAI,WAAW,uBAAuB,sCAAsC,IAAI,MAAM,CAAC;EAC/F,OAAO,cAAc,IAAI;CAC1B,CAAC;AACF;AAEA,eAAe,oBAAoB,KAAqC;CACvE,OAAO,MAAM,IAAI,SAAS,SAAS,WAAW;EAC7C,MAAM,QAAQ,IAAI,MAAM;EACxB,MAAM,QAAQ,WAAqB;GAClC,IAAI,OAAO;GACX,OACC,IAAI,WACH,4BACA,yCAAyC,IAAI,OAAO,SAAS,MAAM,OAAO,MAAM,MAAM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AME, s as ChartType, y as WRITE_OUTPUT_TYPE } from "./enums-CvRYniUA.js";
|
|
2
|
-
import { C as TableCell, D as TableProps, F as MediaProps,
|
|
3
|
-
import { c as WriteFileProps, d as ThemeProps, i as PresLayout, l as WriteProps, n as PackagePart, o as SectionProps, r as PartsProps, s as WriteBaseProps, t as CustomPropertyValue } from "./pres-
|
|
4
|
-
import { a as ExtractedSlides,
|
|
2
|
+
import { $ as PositionProps, C as TableCell, D as TableProps, F as MediaProps, I as MediaType, Jt as OptsChartData, O as TableRow, R as BackgroundProps, Tt as ChartOpts, U as GeometryPoint, X as Margin, a as Slide, an as SlideComment, ct as HyperlinkProps, dn as TextMeasurement, en as MeasureTextOptions, f as MasterTextStyleProps, fn as TextProps, g as SlideNumberProps, h as SlideMasterProps, i as ObjectOptions, o as SlideLayout, rn as OverflowBoxOptions, sn as TableLayoutResult, t as AddSlideProps, wt as ChartMulti } from "./slide-B_aInw3N.js";
|
|
3
|
+
import { c as WriteFileProps, d as ThemeProps, i as PresLayout, l as WriteProps, n as PackagePart, o as SectionProps, r as PartsProps, s as WriteBaseProps, t as CustomPropertyValue } from "./pres-Dybf7ZUl.js";
|
|
4
|
+
import { a as ExtractedSlides, pn as EmbeddedFontSlot } from "./presentation-types-D7cgT-eG.js";
|
|
5
5
|
import { c as DiagnosticCode } from "./errors-fB1KDJKQ.js";
|
|
6
6
|
//#region src/types/zoom.d.ts
|
|
7
7
|
/** Options shared by all three zoom kinds. */
|
|
@@ -252,12 +252,28 @@ interface SlideLayoutInternal extends SlideBaseProps, SlideLayout {
|
|
|
252
252
|
//#region src/runtime/types.d.ts
|
|
253
253
|
type RuntimeAdapter = {
|
|
254
254
|
readonly writeFileOutputType: WRITE_OUTPUT_TYPE | null;
|
|
255
|
+
/**
|
|
256
|
+
* Load a media file into a base64 payload for `rel.data`.
|
|
257
|
+
*
|
|
258
|
+
* **Two encodings are accepted, deliberately.** Either raw base64 (`iVBORw0…`) or a full
|
|
259
|
+
* data URI (`data:image/png;base64,iVBORw0…`). The browser adapter returns the second
|
|
260
|
+
* because `FileReader.readAsDataURL` is what decodes a blob without blocking; Node and the
|
|
261
|
+
* neutral adapter return the first because neither has a `FileReader`. So an adapter may
|
|
262
|
+
* return whichever its host makes cheap: `gen/media.ts` puts the result through
|
|
263
|
+
* {@link toMediaDataUri} on the way into `rel.data`, and everything past that point sees one
|
|
264
|
+
* form. Do not add a third: that helper recognizes exactly these two.
|
|
265
|
+
*/
|
|
255
266
|
loadMedia: (rel: SlideRelMedia & {
|
|
256
267
|
path: string;
|
|
257
268
|
}) => Promise<string>;
|
|
258
269
|
createSvgPngPreview: (rel: SlideRelMedia) => Promise<string>;
|
|
259
270
|
writeFile: (fileName: string, data: string | ArrayBuffer | Blob | Uint8Array) => Promise<string>;
|
|
260
|
-
/**
|
|
271
|
+
/**
|
|
272
|
+
* Load a font file into raw bytes for `registerFontMetrics`.
|
|
273
|
+
*
|
|
274
|
+
* An `http:`/`https:` URL is fetched by every adapter. Anything else is a filesystem path,
|
|
275
|
+
* which only the Node adapter can read; elsewhere it is a load failure naming the path.
|
|
276
|
+
*/
|
|
261
277
|
loadFontData: (source: string) => Promise<Uint8Array>;
|
|
262
278
|
};
|
|
263
279
|
//#endregion
|
|
@@ -777,6 +793,22 @@ type DiagnosticHandler = (diagnostic: Diagnostic) => void;
|
|
|
777
793
|
* @param next - the receiver, or `null` to restore the console default
|
|
778
794
|
*/
|
|
779
795
|
declare function setDiagnosticHandler(next: DiagnosticHandler | null): void;
|
|
796
|
+
/**
|
|
797
|
+
* Clear the {@link warnOnce} dedupe set, so a condition already reported reports again.
|
|
798
|
+
*
|
|
799
|
+
* Call it between builds in a host that builds more than one deck per process and wants each
|
|
800
|
+
* build's diagnostics complete. Without it, deck two is silent about anything deck one already
|
|
801
|
+
* warned for, which reads as "no problems found" rather than as "already mentioned".
|
|
802
|
+
*
|
|
803
|
+
* It also bounds the set. Most `warnOnce` messages interpolate the offending value, so a server
|
|
804
|
+
* building decks from user input accumulates one entry per distinct bad value with no way to
|
|
805
|
+
* release them.
|
|
806
|
+
*
|
|
807
|
+
* This does not touch the handler — {@link setDiagnosticHandler} owns that, and the two are
|
|
808
|
+
* reset independently on purpose: a host usually installs its handler once and wants it to
|
|
809
|
+
* survive.
|
|
810
|
+
*/
|
|
811
|
+
declare function resetDiagnosticState(): void;
|
|
780
812
|
//#endregion
|
|
781
|
-
export {
|
|
782
|
-
//# sourceMappingURL=diagnostics-
|
|
813
|
+
export { ptToHundredths as A, emuToInches as C, percentToEmu as D, inchesToEmu as E, SlideZoomProps as M, SummaryZoomProps as N, pixelsToEmu as O, ZoomBaseProps as P, coordToEmu as S, emuToPoints as T, PERCENT_SCALE as _, ClipShape as a, StandardLayout as b, clipPath as c, DEFAULT_PX_PER_INCH as d, EMU_PER_INCH as f, HUNDREDTHS_PER_POINT as g, FIXED_PCT_PER_PERCENT as h, setDiagnosticHandler as i, SectionZoomProps as j, pointsToEmu as k, PresentationCore as l, Emu as m, DiagnosticHandler as n, FlatSide as o, EMU_PER_POINT as p, resetDiagnosticState as r, HalfDiscPreset as s, Diagnostic as t, ANGLE_UNITS_PER_DEGREE as u, POINTS_PER_INCH as v, emuToPixels as w, StandardLayoutName as x, STANDARD_LAYOUTS as y };
|
|
814
|
+
//# sourceMappingURL=diagnostics-B0OmTOoz.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnostics-B0OmTOoz.d.ts","names":[],"sources":["../src/types/zoom.ts","../src/types/internal.ts","../src/runtime/types.ts","../src/units.ts","../src/presentation.ts","../src/clip.ts","../src/diagnostics.ts"],"mappings":";;;;;;;UAiBiB,sBAAsB;;EAEtC;;;;;EAKA;IAAe;IAAe;;;;;;EAK9B;;EAEA;;;UAIgB,uBAAuB;;EAEvC,QAAQ;;;UAIQ,yBAAyB;;EAEzC;;;;;;KAOW,mBAAmB;;;UCjBd,8BAA8B;EAC9C;;EAEA;;UAEgB,0BAA0B;EAC1C,QAAQ,YAAY;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Y,eAAe,aAAa,MAAM,qBAAqB;;;;;;;;;;;EAcnE,aAAa,eAAe,aAAa,MAAM;;;;;;;;;;;;;;;;;;;EAuB/C,YAAY,MAAM,YAAY,MAAM,aAAa;;;;;;;;;EAc3C,QAAQ,QAAQ,iBAAiB,QAAQ;;;;;;EAazC,MAAM,QAAQ,aAAa,iBAAiB,cAAc,OAAO;;;;;;;;;;;;;;;;;EAwBjE,QAAQ,QAAQ,aAAa,QAAQ;;;;;;;EAYrC,UAAU,QAAQ,iBAAiB;;;;;;;EAoBzC,kBAAkB,cAAc,OAAO;;;;;;EAUvC,WAAW,SAAS;;;;;;EA+BpB,SAAS,UAAU,gBAAgB;;;;;;EAsEnC,aAAa,QAAQ;;;;;EAwBrB,kBAAkB,OAAO;;;;;;;;KCp9Bd;;;;;;;KAQA;;KAGA;;;;;;EAKT;EAAmB,MAAM;EAAU,SAAS;;;;;;;;;;;;;;;;;;;;;iBAiH/B,SAAS,OAAO,WAAW,WAAW,YAAY;;;;UC1IjD;;WAEP,MAAM;;WAEN;;;;;WAKA,SAAS,SAAS;;;KAIhB,qBAAqB,YAAY;;;;;;;;;;;;;;;;;;;;;iBAgC7B,qBAAqB,MAAM;;;;;;;;;;;;;;;;iBAuD3B"}
|
|
@@ -47,7 +47,15 @@ function warn(code, message, detail) {
|
|
|
47
47
|
}
|
|
48
48
|
const seen = /* @__PURE__ */ new Set();
|
|
49
49
|
/**
|
|
50
|
-
* Emit a library diagnostic at most once per distinct code+message
|
|
50
|
+
* Emit a library diagnostic at most once per distinct code+message.
|
|
51
|
+
*
|
|
52
|
+
* "Once" is **process-global**, the same scope {@link setDiagnosticHandler} has and for the
|
|
53
|
+
* same reason: the emitting code is a tree of free functions in `gen/**` with no presentation
|
|
54
|
+
* in scope. The consequence is different, though, and worth stating on its own — a process that
|
|
55
|
+
* builds several decks does not get a second report of a condition an earlier deck already
|
|
56
|
+
* tripped, so the second deck's diagnostics are incomplete rather than merely unattributed.
|
|
57
|
+
* {@link resetDiagnosticState} is how a host that cares gets each build a clean slate.
|
|
58
|
+
*
|
|
51
59
|
* @param code - the stable condition identifier ({@link DiagnosticCode})
|
|
52
60
|
* @param message - explanation (see {@link warn})
|
|
53
61
|
* @param detail - optional structured context
|
|
@@ -58,7 +66,25 @@ function warnOnce(code, message, detail) {
|
|
|
58
66
|
seen.add(key);
|
|
59
67
|
warn(code, message, detail);
|
|
60
68
|
}
|
|
69
|
+
/**
|
|
70
|
+
* Clear the {@link warnOnce} dedupe set, so a condition already reported reports again.
|
|
71
|
+
*
|
|
72
|
+
* Call it between builds in a host that builds more than one deck per process and wants each
|
|
73
|
+
* build's diagnostics complete. Without it, deck two is silent about anything deck one already
|
|
74
|
+
* warned for, which reads as "no problems found" rather than as "already mentioned".
|
|
75
|
+
*
|
|
76
|
+
* It also bounds the set. Most `warnOnce` messages interpolate the offending value, so a server
|
|
77
|
+
* building decks from user input accumulates one entry per distinct bad value with no way to
|
|
78
|
+
* release them.
|
|
79
|
+
*
|
|
80
|
+
* This does not touch the handler — {@link setDiagnosticHandler} owns that, and the two are
|
|
81
|
+
* reset independently on purpose: a host usually installs its handler once and wants it to
|
|
82
|
+
* survive.
|
|
83
|
+
*/
|
|
84
|
+
function resetDiagnosticState() {
|
|
85
|
+
seen.clear();
|
|
86
|
+
}
|
|
61
87
|
//#endregion
|
|
62
|
-
export {
|
|
88
|
+
export { warnOnce as i, setDiagnosticHandler as n, warn as r, resetDiagnosticState as t };
|
|
63
89
|
|
|
64
|
-
//# sourceMappingURL=diagnostics-
|
|
90
|
+
//# sourceMappingURL=diagnostics-CPVADSL1.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diagnostics-
|
|
1
|
+
{"version":3,"file":"diagnostics-CPVADSL1.js","names":[],"sources":["../src/diagnostics.ts"],"sourcesContent":["/**\n * Central sink for library diagnostics.\n *\n * Every user-facing warning is routed through {@link warn} / {@link warnOnce} rather than calling\n * `console.warn` directly, so there is one place to apply a consistent prefix and one place a\n * consumer can take over — see {@link setDiagnosticHandler}. This module has no *runtime* imports\n * so it can be used from anywhere without risking an import cycle; `codes.ts` is types only and is\n * erased at compile time, so it does not cost that property.\n *\n * **A diagnostic's `code` is API; its `message` is not.** The code is a stable identifier a\n * consumer may branch on (`if (d.code === 'chart/non-finite-value')`); the wording behind it is\n * free to improve in any release. The vocabulary lives in `codes.ts` and is shared with the thrown\n * surface (`errors.ts`), so a condition that can both warn and throw reads the same either way.\n */\n\nimport type { DiagnosticCode } from './codes.js'\n\nexport type { DiagnosticCode }\n\n/** One diagnostic emitted by the library. */\nexport interface Diagnostic {\n\t/** Stable condition identifier — see {@link DiagnosticCode}. Branch on this, not on the text. */\n\treadonly code: DiagnosticCode\n\t/** Human-readable explanation. Free to change in any release; do not parse it. */\n\treadonly message: string\n\t/**\n\t * Structured context for the condition, when a site has any to give. No site populates it\n\t * today; it exists so one can start to without a breaking signature change.\n\t */\n\treadonly detail?: Readonly<Record<string, unknown>>\n}\n\n/** Receives every {@link Diagnostic} the library emits. See {@link setDiagnosticHandler}. */\nexport type DiagnosticHandler = (diagnostic: Diagnostic) => void\n\n/** Prefix stamped on every warning so consumers can attribute console noise to this library. */\nconst WARN_PREFIX = 'ts-pptx'\n\n/** The default handler: one `console.warn` line per diagnostic, prefixed. */\nconst consoleHandler: DiagnosticHandler = (diagnostic) => {\n\tconsole.warn(`${WARN_PREFIX}: ${diagnostic.message}`)\n}\n\nlet handler: DiagnosticHandler = consoleHandler\n\n/**\n * Route every library diagnostic to `handler`, or pass `null` to restore the default\n * (one prefixed `console.warn` per diagnostic).\n *\n * This is process-global rather than per-presentation, deliberately: the emitting code is a tree\n * of free functions in `gen/**` with no presentation in scope, and threading a handler through\n * every signature would be a far larger and worse change than the problem warrants. The practical\n * consequence is that a process building several decks concurrently cannot attribute a diagnostic\n * to one of them; if that matters, correlate on `code` or set the handler around each build.\n *\n * A throwing handler propagates out of whatever library call emitted the diagnostic, which is the\n * supported way to make a specific condition fatal:\n *\n * ```ts\n * setDiagnosticHandler((d) => {\n * if (d.code === 'coord/bare-number-is-inches') throw new Error(d.message)\n * })\n * ```\n * @param next - the receiver, or `null` to restore the console default\n */\nexport function setDiagnosticHandler(next: DiagnosticHandler | null): void {\n\thandler = next ?? consoleHandler\n}\n\n/**\n * Emit a library diagnostic.\n * @param code - the stable condition identifier ({@link DiagnosticCode})\n * @param message - explanation, without a `ts-pptx:` prefix (the default handler adds one)\n * @param detail - optional structured context\n */\nexport function warn(code: DiagnosticCode, message: string, detail?: Readonly<Record<string, unknown>>): void {\n\thandler(detail === undefined ? { code, message } : { code, message, detail })\n}\n\n// Track diagnostics already emitted so a recurring condition (e.g. the same out-of-range fontSize\n// on every cell of a table) is reported once instead of flooding the handler. Keyed on code AND\n// message, so a *different* offending value under the same code still reports.\nconst seen = new Set<string>()\n\n/**\n * Emit a library diagnostic at most once per distinct code+message.\n *\n * \"Once\" is **process-global**, the same scope {@link setDiagnosticHandler} has and for the\n * same reason: the emitting code is a tree of free functions in `gen/**` with no presentation\n * in scope. The consequence is different, though, and worth stating on its own — a process that\n * builds several decks does not get a second report of a condition an earlier deck already\n * tripped, so the second deck's diagnostics are incomplete rather than merely unattributed.\n * {@link resetDiagnosticState} is how a host that cares gets each build a clean slate.\n *\n * @param code - the stable condition identifier ({@link DiagnosticCode})\n * @param message - explanation (see {@link warn})\n * @param detail - optional structured context\n */\nexport function warnOnce(code: DiagnosticCode, message: string, detail?: Readonly<Record<string, unknown>>): void {\n\tconst key = `${code}\\0${message}`\n\tif (seen.has(key)) return\n\tseen.add(key)\n\twarn(code, message, detail)\n}\n\n/**\n * Clear the {@link warnOnce} dedupe set, so a condition already reported reports again.\n *\n * Call it between builds in a host that builds more than one deck per process and wants each\n * build's diagnostics complete. Without it, deck two is silent about anything deck one already\n * warned for, which reads as \"no problems found\" rather than as \"already mentioned\".\n *\n * It also bounds the set. Most `warnOnce` messages interpolate the offending value, so a server\n * building decks from user input accumulates one entry per distinct bad value with no way to\n * release them.\n *\n * This does not touch the handler — {@link setDiagnosticHandler} owns that, and the two are\n * reset independently on purpose: a host usually installs its handler once and wants it to\n * survive.\n */\nexport function resetDiagnosticState(): void {\n\tseen.clear()\n}\n"],"mappings":";;AAoCA,MAAM,cAAc;;AAGpB,MAAM,kBAAqC,eAAe;CACzD,QAAQ,KAAK,GAAG,YAAY,IAAI,WAAW,SAAS;AACrD;AAEA,IAAI,UAA6B;;;;;;;;;;;;;;;;;;;;;AAsBjC,SAAgB,qBAAqB,MAAsC;CAC1E,UAAU,QAAQ;AACnB;;;;;;;AAQA,SAAgB,KAAK,MAAsB,SAAiB,QAAkD;CAC7G,QAAQ,WAAW,KAAA,IAAY;EAAE;EAAM;CAAQ,IAAI;EAAE;EAAM;EAAS;CAAO,CAAC;AAC7E;AAKA,MAAM,uBAAO,IAAI,IAAY;;;;;;;;;;;;;;;AAgB7B,SAAgB,SAAS,MAAsB,SAAiB,QAAkD;CACjH,MAAM,MAAM,GAAG,KAAK,IAAI;CACxB,IAAI,KAAK,IAAI,GAAG,GAAG;CACnB,KAAK,IAAI,GAAG;CACZ,KAAK,MAAM,SAAS,MAAM;AAC3B;;;;;;;;;;;;;;;;AAiBA,SAAgB,uBAA6B;CAC5C,KAAK,MAAM;AACZ"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as warn } from "./diagnostics-CPVADSL1.js";
|
|
2
2
|
import { n as InvalidOptionError, o as UnsupportedFeatureError, r as MediaError } from "./errors-Bvln0H-7.js";
|
|
3
|
-
import {
|
|
3
|
+
import { F as LINEH_MODIFIER, a as inch2Emu, i as getSmartParseNumber, mt as emuToInches, s as marginToEmu, st as EMU_PER_POINT, u as resolveTableColWidthsEmu, y as DEF_CELL_MARGIN_IN } from "./units-internal-DNvK2I6o.js";
|
|
4
4
|
//#region src/measure/font-collection.ts
|
|
5
5
|
/**
|
|
6
6
|
* Font **collection** (`.ttc` / `.otc`) support for the write-side metrics.
|
|
@@ -1353,4 +1353,4 @@ function applyMeasuredFit(slides, registry) {
|
|
|
1353
1353
|
//#endregion
|
|
1354
1354
|
export { parseFontMetrics as _, FONT_SCALE_STEP_PCT as a, SINGLE_LINE_PITCH as c, measureLayout as d, solveResize as f, makeRegistryResolver as g, getHeuristicFontMetrics as h, buildFitParagraphs as i, WIDTH_SAFETY_FACTOR as l, FontMetricsRegistry as m, measureText as n, HEIGHT_SAFETY_FACTOR as o, solveShrink as p, computeTableLayout as r, MIN_FONT_SCALE_PCT as s, applyMeasuredFit as t, measureHeightPt as u, isFontCollection as v, listFontFaces as y };
|
|
1355
1355
|
|
|
1356
|
-
//# sourceMappingURL=fit-
|
|
1356
|
+
//# sourceMappingURL=fit-TjpNbMru.js.map
|