@bendyline/squisq-formats 2.5.0 → 2.6.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 (42) hide show
  1. package/NOTICE.md +10 -9
  2. package/dist/{chunk-2LT3JL7U.js → chunk-3ITGQRL5.js} +8 -8
  3. package/dist/{chunk-FMQWNPCV.js → chunk-AGGNLRHV.js} +6 -6
  4. package/dist/{chunk-AONELFLA.js → chunk-B7GEAZBI.js} +6 -1
  5. package/dist/chunk-CKSTGNVZ.js +724 -0
  6. package/dist/chunk-DXYWKZ52.js +57 -0
  7. package/dist/{chunk-T4PX33AG.js → chunk-EEDQRZ2M.js} +17 -1
  8. package/dist/chunk-FLR2ARKC.js +240 -0
  9. package/dist/{chunk-JTGWQK5V.js → chunk-GRKQTQOF.js} +64 -12
  10. package/dist/{chunk-A6LSCIO5.js → chunk-OBADJV7C.js} +286 -420
  11. package/dist/{chunk-AD2WT564.js → chunk-Q77KNJIN.js} +45 -0
  12. package/dist/{chunk-5PUIFU5I.js → chunk-VDTGQ4MW.js} +1 -1
  13. package/dist/{chunk-6RQOV3B3.js → chunk-VPWPEMZJ.js} +1 -1
  14. package/dist/{chunk-FIOSE4BO.js → chunk-XJNOZTAY.js} +6 -6
  15. package/dist/csv/index.d.ts +67 -1
  16. package/dist/csv/index.js +10 -3
  17. package/dist/data/index.d.ts +78 -0
  18. package/dist/data/index.js +30 -0
  19. package/dist/docx/index.js +3 -3
  20. package/dist/epub/index.js +4 -4
  21. package/dist/export-6iQXd-lQ.d.ts +366 -0
  22. package/dist/html/index.d.ts +2 -8
  23. package/dist/html/index.js +3 -3
  24. package/dist/{images-ESPQKVTW.js → images-JLBFCDD4.js} +1 -1
  25. package/dist/{import-B0gBYUmd.d.ts → import-C7c9tQHK.d.ts} +5 -2
  26. package/dist/index.d.ts +3 -3
  27. package/dist/index.js +33 -26
  28. package/dist/infer/index.js +6 -6
  29. package/dist/materialize-A34OZGEU.js +11 -0
  30. package/dist/outside-in/index.d.ts +3 -3
  31. package/dist/outside-in/index.js +2 -2
  32. package/dist/pdf/index.js +2 -2
  33. package/dist/pptx/index.js +3 -3
  34. package/dist/registry/index.d.ts +4 -4
  35. package/dist/registry/index.js +1 -1
  36. package/dist/{types-DByrrXeB.d.ts → types-Dzd_5H2A.d.ts} +5 -5
  37. package/dist/xlsx/index.d.ts +85 -4
  38. package/dist/xlsx/index.js +25 -4
  39. package/package.json +18 -3
  40. package/dist/export-m0tr9r9d.d.ts +0 -130
  41. package/dist/{chunk-KMBBO5H7.js → chunk-7DQP2I57.js} +4 -4
  42. package/dist/{chunk-M7XPXGXW.js → chunk-ROF7SSQP.js} +3 -3
@@ -0,0 +1,366 @@
1
+ import { MarkdownInlineNode, MarkdownDocument } from '@bendyline/squisq/markdown';
2
+ import { O as OoxmlOpenOptions, a as OoxmlPackage } from './reader-B_m1aKZC.js';
3
+ import { ContentContainer } from '@bendyline/squisq/storage';
4
+ import { Doc } from '@bendyline/squisq/schemas';
5
+
6
+ /**
7
+ * Shared SpreadsheetML cell model and A1-reference arithmetic.
8
+ *
9
+ * Import and export both need to move between a zero-based `(row, col)` grid
10
+ * and Excel's `"B7"` addressing. That logic used to exist twice — `colIndex`
11
+ * in `import.ts` and `columnLetter` in `export.ts` — as two halves of the same
12
+ * bijection that never met. It lives here now, together with the richer cell
13
+ * record the region splitter needs.
14
+ *
15
+ * {@link XlsxCell} carries three things the old plain-string grid could not:
16
+ * the cell's *kind* (so a header row can be told apart from a data row, and so
17
+ * export can safely re-emit a number as a number), and its *formula* (so a
18
+ * round trip through markdown keeps `=B2*C2` rather than freezing the cached
19
+ * result).
20
+ */
21
+
22
+ /** What a cell holds, beyond its display text. */
23
+ type XlsxCellKind = 'empty' | 'string' | 'number' | 'bool' | 'date' | 'error';
24
+ /** A single worksheet cell. */
25
+ interface XlsxCell {
26
+ /** Display text — the plain string, with all run formatting flattened out. */
27
+ text: string;
28
+ /** What the cell holds. `empty` iff `text` is `''`. */
29
+ kind: XlsxCellKind;
30
+ /** Formula source WITHOUT the leading `=`, when the cell carries one. */
31
+ formula?: string;
32
+ /**
33
+ * Inline markdown for a cell whose rich text carries formatting worth
34
+ * keeping — today, superscript/subscript runs (`Fresh<sup>1</sup>`).
35
+ *
36
+ * Deliberately additive: `text` remains the flattened string, so region
37
+ * detection, header sniffing, numeric inference and export placement all
38
+ * keep working on exactly the value they saw before. Only the markdown table
39
+ * cell reads this, and only when it is present.
40
+ */
41
+ richText?: MarkdownInlineNode[];
42
+ /**
43
+ * Set when the cell participates in a shared (fill-down) formula group:
44
+ * `'master'` holds the group's text, `'follower'` inherits by translation.
45
+ * Consumers that EDIT formulas need this — the in-place patcher refuses
46
+ * to replace a master (its followers' `si` would dangle) while a
47
+ * follower may safely leave its group.
48
+ */
49
+ sharedFormulaRole?: 'master' | 'follower';
50
+ /**
51
+ * The cell's value as the sheet stores it, before number formatting.
52
+ *
53
+ * `text` is a rendering for people, and rendering destroys information a
54
+ * consumer doing arithmetic needs: a percent-formatted `0.15` renders as
55
+ * `"15.0%"`, a date is a serial rendered as text, and a zero-padded `7`
56
+ * renders as `"007"`. Anything reading a sheet as *data* — rather than as a
57
+ * document — must read this instead.
58
+ *
59
+ * Normalized rather than literally raw, where a literal value would be
60
+ * useless: a date arrives as an ISO `YYYY-MM-DD` (or `YYYY-MM-DD HH:MM`)
61
+ * string rather than an Excel serial, because the serial's meaning depends
62
+ * on a workbook-level 1900/1904 epoch flag that no downstream consumer
63
+ * should have to carry. Numbers, booleans and strings are exact.
64
+ *
65
+ * Absent for `empty` and `error` cells, which have no value to speak of.
66
+ */
67
+ value?: number | boolean | string;
68
+ }
69
+ /** A zero-based, inclusive rectangle of cells. */
70
+ interface CellRect {
71
+ top: number;
72
+ left: number;
73
+ bottom: number;
74
+ right: number;
75
+ }
76
+ /** A parsed cell address. */
77
+ interface ParsedCellRef {
78
+ row: number;
79
+ col: number;
80
+ }
81
+ /**
82
+ * Parse a full cell ref into zero-based coordinates, rejecting anything that
83
+ * is not a plain in-range A1 address. `$` anchors are accepted and ignored —
84
+ * an anchor says how a ref behaves when copied, not where it points.
85
+ *
86
+ * Returns null for a malformed ref, a ref past `XFD1048576`, or a range.
87
+ */
88
+ declare function parseCellRef(ref: string): ParsedCellRef | null;
89
+ /** Format zero-based coordinates as a cell ref (`0, 1` → `"B1"`). */
90
+ declare function formatCellRef(row: number, col: number): string;
91
+
92
+ /**
93
+ * XLSX → typed tables, for consumers reading a workbook as **data**.
94
+ *
95
+ * `xlsxToMarkdownDoc` renders a workbook for people: it flattens each cell to
96
+ * the string the sheet displays. That rendering is lossy in exactly the ways
97
+ * arithmetic cares about — a percent-formatted `0.15` becomes `"15.0%"`, a
98
+ * date becomes text, a zero-padded `7` becomes `"007"` — so anything that
99
+ * needs to sum, average or compare must not go through it.
100
+ *
101
+ * This module is the other path. It reuses the same region detection (a sheet
102
+ * is not one table; it is several islands with labels and totals in the gaps)
103
+ * and emits each island's cells as their underlying values, with the type the
104
+ * sheet gave them.
105
+ *
106
+ * Two kinds of region are deliberately excluded from the result. A
107
+ * `formulas` companion is presentation — the same cells again, showing their
108
+ * expressions rather than their results — and a `loose` bucket is stray labels
109
+ * and notes, which have no columns to speak of. Both are useful to a reader
110
+ * and meaningless to a query, so a consumer asking for tables gets neither.
111
+ */
112
+
113
+ /** One column of a detected table. */
114
+ interface XlsxTableColumn {
115
+ /** Header text when the region has a header row; otherwise a column letter. */
116
+ name: string;
117
+ /**
118
+ * The dominant cell kind in the column's body, so a consumer can pick a
119
+ * storage type without re-sniffing. `mixed` when no single kind holds a
120
+ * majority — the honest answer for a column that really is heterogeneous.
121
+ */
122
+ kind: XlsxCellKind | 'mixed';
123
+ }
124
+ /** One data island, as values rather than as display text. */
125
+ interface XlsxTable {
126
+ /** Worksheet name. */
127
+ sheet: string;
128
+ /** A1 address of the region's top-left cell, e.g. `B4`. */
129
+ anchor: string;
130
+ /** Caption absorbed from directly above the region, when there was one. */
131
+ title?: string;
132
+ columns: XlsxTableColumn[];
133
+ /** True when row 0 was read as a header and is therefore not a data row. */
134
+ hasHeader: boolean;
135
+ /**
136
+ * Body rows, header excluded. A cell with no value — blank, or an error —
137
+ * is `null` rather than absent, so every row has the same arity as
138
+ * `columns`.
139
+ */
140
+ rows: (string | number | boolean | null)[][];
141
+ }
142
+ interface XlsxTablesOptions {
143
+ /** Restrict to one sheet, by zero-based index or by name. */
144
+ sheet?: number | string;
145
+ maxRegionsPerSheet?: number;
146
+ minRegionCells?: number;
147
+ /** Skip regions with fewer than this many body rows. Default 1. */
148
+ minRows?: number;
149
+ signal?: AbortSignal;
150
+ }
151
+ /**
152
+ * Split one sheet's grid into typed tables.
153
+ *
154
+ * Exported separately from the workbook entry point so a caller that already
155
+ * has a grid — a test, or a consumer streaming sheets itself — does not have
156
+ * to re-open the package.
157
+ */
158
+ declare function gridToTables(sheet: string, grid: readonly (readonly XlsxCell[])[], merges?: readonly CellRect[], options?: XlsxTablesOptions): XlsxTable[];
159
+
160
+ /**
161
+ * XLSX import — SpreadsheetML (.xlsx) → MarkdownDocument.
162
+ *
163
+ * Reuses the shared ooxml/ reader (zip + DOMParser). Reads the workbook's sheet
164
+ * list, resolves each sheet part via relationships, pulls shared strings, and
165
+ * turns each worksheet into markdown. By default every sheet is imported, each
166
+ * preceded by an H1 of the sheet name; pass `options.sheet` (index or name) to
167
+ * import just one.
168
+ *
169
+ * A sheet is NOT one table. It is usually several tables scattered across the
170
+ * grid with stray labels and notes in the gaps, so by default each worksheet is
171
+ * split into its contiguous data islands (see `regions.ts`) and every island
172
+ * becomes its own block:
173
+ *
174
+ * ```markdown
175
+ * ## Q3 Revenue {[dataTable sheet=Sales anchor=B7]}
176
+ * ```
177
+ *
178
+ * The `sheet`/`anchor` params on the heading annotation are what let
179
+ * `markdownDocToXlsx` put each table back where it came from, so the round trip
180
+ * reproduces addresses rather than piling everything at A1. A region holding
181
+ * formulas additionally emits a `role=formulas` companion table, and every
182
+ * left-over single cell on a sheet collects into one `role=loose` table.
183
+ *
184
+ * Pass `{ regions: false }` for the historical behavior: one table per sheet,
185
+ * spanning the whole used range.
186
+ */
187
+
188
+ interface XlsxImportOptions extends OoxmlOpenOptions {
189
+ /** Which sheet to import (0-based index or sheet name). Default: all sheets. */
190
+ sheet?: number | string;
191
+ /**
192
+ * Split each sheet into its contiguous data islands, one block each, anchored
193
+ * with `{[dataTable sheet=… anchor=…]}`. Default true. Set false for the
194
+ * historical one-table-per-sheet output.
195
+ */
196
+ regions?: boolean;
197
+ /**
198
+ * Emit a `role=formulas` companion table for regions that contain formulas.
199
+ * Default true. Ignored when `regions` is false.
200
+ */
201
+ formulas?: boolean;
202
+ /** Cap on region tables per sheet before the rest fold into loose cells. Default 64. */
203
+ maxRegionsPerSheet?: number;
204
+ /** Smallest island that stays a table of its own. Default 2 — single cells coalesce. */
205
+ minRegionCells?: number;
206
+ /**
207
+ * Sidecar spill mode — only honored by `xlsxToContainer`, which can actually
208
+ * write the sidecar file the reference points at. `'auto'` (default) spills a
209
+ * region past the inline thresholds to a `{[dataTable src=…]}` reference;
210
+ * `'always'` spills every region; `'never'` keeps everything inline
211
+ * (`xlsxToMarkdownDoc`'s only behavior — a doc-only import has nowhere to
212
+ * put the bytes, and a `src` with no sidecar is a broken reference).
213
+ */
214
+ sidecar?: 'auto' | 'always' | 'never';
215
+ /** Max data rows a region keeps inline before spilling (container import). Default 100. */
216
+ maxInlineRows?: number;
217
+ /** Max cells a region keeps inline before spilling (container import). Default 2000. */
218
+ maxInlineCells?: number;
219
+ }
220
+ /** Options for {@link xlsxToContainer}. */
221
+ interface XlsxContainerOptions extends XlsxImportOptions {
222
+ /**
223
+ * Source file name (e.g. `'Q3 Report.xlsx'`) — names the document
224
+ * (`q3-report.md`) and the sidecar path
225
+ * (`q3-report_files/data/Q3 Report.xlsx`). Default `'workbook.xlsx'`.
226
+ */
227
+ sourceName?: string;
228
+ }
229
+ interface SheetRef {
230
+ name: string;
231
+ path: string;
232
+ }
233
+ /**
234
+ * List the workbook's sheets — name plus resolved worksheet part path, in
235
+ * workbook order. Shared by import and the in-place cell patcher.
236
+ */
237
+ declare function listSheetParts(pkg: OoxmlPackage, mainPart: string): Promise<SheetRef[]>;
238
+ /**
239
+ * Read a workbook as typed tables rather than as a document.
240
+ *
241
+ * The data counterpart to {@link xlsxToMarkdownDoc}: same package, same sheet
242
+ * selection, same region detection — but each island's cells arrive as their
243
+ * underlying values, so a consumer can sum a column without first undoing a
244
+ * number format.
245
+ */
246
+ declare function xlsxToTables(data: ArrayBuffer | Blob, options?: XlsxImportOptions & XlsxTablesOptions): Promise<XlsxTable[]>;
247
+ /** One worksheet's raw cell grid, as parsed (formulas + cached values intact). */
248
+ interface XlsxSheetGrid {
249
+ name: string;
250
+ /** Row-major grid; rows may be ragged. Each cell keeps `formula` AND `value`. */
251
+ cells: XlsxCell[][];
252
+ merges: CellRect[];
253
+ }
254
+ /** A workbook as raw cell grids, plus the workbook-level calc facts. */
255
+ interface XlsxWorkbookGrids {
256
+ sheets: XlsxSheetGrid[];
257
+ date1904: boolean;
258
+ /**
259
+ * `<calcPr fullCalcOnLoad="1"/>`: the producer disowned its cached formula
260
+ * values. A cached-value oracle must skip such workbooks, and a consumer
261
+ * re-hosting the formulas in a calculation engine should recompute rather
262
+ * than trust `value`.
263
+ */
264
+ fullCalcOnLoad: boolean;
265
+ }
266
+ /**
267
+ * Read a workbook as raw cell grids — the lowest-level public view.
268
+ *
269
+ * Unlike {@link xlsxToTables} (typed regions, formulas dropped) and
270
+ * {@link xlsxToMarkdownDoc} (rendered for people), this hands over every
271
+ * parsed cell with its formula and cached value colocated. Two consumers:
272
+ * the corpus cached-value oracle (compare `formula` results against `value`)
273
+ * and calculation-engine feeding (`setUserInput`-style APIs need the raw
274
+ * grid, not a detected region).
275
+ */
276
+ declare function xlsxToCellGrids(data: ArrayBuffer | Blob, options?: XlsxImportOptions): Promise<XlsxWorkbookGrids>;
277
+ declare function xlsxToMarkdownDoc(data: ArrayBuffer | Blob, options?: XlsxImportOptions): Promise<MarkdownDocument>;
278
+ /**
279
+ * Import a workbook into a ContentContainer: the markdown document plus, when
280
+ * a region crossed the inline thresholds (or `sidecar: 'always'`), the
281
+ * ORIGINAL workbook bytes as a `<docbasename>_files/data/<name>` sidecar that
282
+ * spilled regions reference via `{[dataTable src=… sheet=… anchor=…]}`.
283
+ *
284
+ * Small regions emit byte-identically to `xlsxToMarkdownDoc` — the historical
285
+ * round-trip contract is untouched below the thresholds, and with
286
+ * `sidecar: 'never'` the container is just the doc-only import in a box.
287
+ */
288
+ declare function xlsxToContainer(data: ArrayBuffer | Blob, options?: XlsxContainerOptions): Promise<ContentContainer>;
289
+
290
+ /**
291
+ * XLSX export — MarkdownDocument → SpreadsheetML (.xlsx).
292
+ *
293
+ * Tables-only fidelity (honestly documented): every `table` node in the
294
+ * markdown AST becomes worksheet cells; all other content (prose, lists,
295
+ * images, …) is dropped, and headings survive only as sheet names and as the
296
+ * carrier of placement metadata.
297
+ *
298
+ * Placement has two modes, decided per table by `workbookPlan.ts`. A table
299
+ * whose heading carries `{[dataTable sheet=… anchor=…]}` — what
300
+ * `xlsxToMarkdownDoc` emits for every data island it finds — is placed on the
301
+ * named sheet at the named cell, so several mini tables share one worksheet at
302
+ * their original addresses and formulas ride along. A table with no such
303
+ * annotation keeps the historical behavior exactly: its own worksheet, named
304
+ * from the nearest preceding heading, starting at A1.
305
+ *
306
+ * Cells are emitted as inline strings (`t="inlineStr"`) by default so no
307
+ * sharedStrings part is needed and identifier-like numbers remain lossless.
308
+ * Callers can explicitly opt into conservative numeric inference. The package
309
+ * is assembled with the shared ooxml/ writer (auto-generates
310
+ * `[Content_Types].xml` + `_rels`), so only the SpreadsheetML-specific parts
311
+ * (workbook, worksheets, styles) are written here.
312
+ *
313
+ * @example
314
+ * ```ts
315
+ * import { parseMarkdown } from '@bendyline/squisq/markdown';
316
+ * import { markdownDocToXlsx } from '@bendyline/squisq-formats/xlsx';
317
+ *
318
+ * const md = parseMarkdown('# Metrics\n\n| A | B |\n| - | - |\n| 1 | 2 |');
319
+ * const buffer = await markdownDocToXlsx(md);
320
+ * ```
321
+ */
322
+
323
+ /**
324
+ * Options for XLSX export.
325
+ */
326
+ interface XlsxExportOptions {
327
+ /** Cancel at bounded export checkpoints. */
328
+ signal?: AbortSignal;
329
+ /** Maximum cells emitted. Default: 100,000. */
330
+ maxCells?: number;
331
+ /** Workbook title (written to core properties). */
332
+ title?: string;
333
+ /** Workbook author (written to core properties). */
334
+ author?: string;
335
+ /** Prefix used for auto-named sheets when no heading precedes a table. Default: "Sheet". */
336
+ sheetNamePrefix?: string;
337
+ /**
338
+ * Emit canonical, Excel-safe number strings as numeric cells.
339
+ *
340
+ * Defaults to false for hand-authored documents — markdown tables have no
341
+ * column schema, so preserving authored text is the only lossless choice —
342
+ * and to true when the document carries `sheet=` anchors, which only an XLSX
343
+ * import produces. Leading-zero and >15-significant-digit values remain
344
+ * strings either way. Set explicitly to override both defaults.
345
+ */
346
+ inferNumericCells?: boolean;
347
+ /**
348
+ * Called for each non-fatal placement problem (a malformed anchor, an
349
+ * overlapping region, an unusable loose-cell reference). Export never throws
350
+ * for these — a hand-edited markdown file must still convert.
351
+ */
352
+ onWarning?: (message: string) => void;
353
+ }
354
+ /**
355
+ * Convert a MarkdownDocument to a .xlsx file (tables-only fidelity).
356
+ *
357
+ * Each markdown `table` becomes one worksheet; a document with no tables
358
+ * yields a single empty sheet (a valid, openable file — never throws).
359
+ */
360
+ declare function markdownDocToXlsx(doc: MarkdownDocument, options?: XlsxExportOptions): Promise<ArrayBuffer>;
361
+ /**
362
+ * Convert a squisq Doc to a .xlsx file (via the markdown table model).
363
+ */
364
+ declare function docToXlsx(doc: Doc, options?: XlsxExportOptions): Promise<ArrayBuffer>;
365
+
366
+ export { type CellRect as C, type SheetRef as S, type XlsxExportOptions as X, type XlsxImportOptions as a, type XlsxTable as b, type XlsxTableColumn as c, type XlsxTablesOptions as d, docToXlsx as e, xlsxToTables as f, gridToTables as g, type XlsxCell as h, type XlsxCellKind as i, type XlsxContainerOptions as j, type XlsxSheetGrid as k, type XlsxWorkbookGrids as l, markdownDocToXlsx as m, formatCellRef as n, listSheetParts as o, parseCellRef as p, xlsxToCellGrids as q, xlsxToContainer as r, xlsxToMarkdownDoc as x };
@@ -1,6 +1,6 @@
1
1
  import { Theme, ThemeRegistry, Doc } from '@bendyline/squisq/schemas';
2
- import { H as HtmlExportOptions } from '../import-B0gBYUmd.js';
3
- export { a as HtmlImportOptions, c as collectImagePaths, g as generateExternalHtml, h as htmlToMarkdown, b as htmlToMarkdownDoc, d as htmlToMarkdownDocSync } from '../import-B0gBYUmd.js';
2
+ import { H as HtmlExportOptions } from '../import-C7c9tQHK.js';
3
+ export { a as HtmlImportOptions, c as collectImagePaths, g as generateExternalHtml, h as htmlToMarkdown, b as htmlToMarkdownDoc, d as htmlToMarkdownDocSync } from '../import-C7c9tQHK.js';
4
4
  import { HtmlPolicy, MarkdownDocument } from '@bendyline/squisq/markdown';
5
5
 
6
6
  /**
@@ -183,12 +183,6 @@ interface PlainHtmlBundleOptions {
183
183
  * references rewritten from `.md` to `.html`.
184
184
  */
185
185
  declare function markdownDocsToPlainHtmlBundle(options: PlainHtmlBundleOptions): Promise<Blob>;
186
- /**
187
- * Collect every `<a>`-style link URL referenced in a document. Markdown
188
- * `link` nodes plus any raw HTML `<a href>` tags. Returns the raw URLs
189
- * as authored, so callers can use them as both the linkMap *key* and
190
- * the basis for resolution.
191
- */
192
186
  declare function collectLinkRefs(doc: MarkdownDocument): Set<string>;
193
187
 
194
188
  /**
@@ -10,13 +10,13 @@ import {
10
10
  markdownDocToPlainHtml,
11
11
  markdownDocsToHtmlBundle,
12
12
  markdownDocsToPlainHtmlBundle
13
- } from "../chunk-T4PX33AG.js";
13
+ } from "../chunk-EEDQRZ2M.js";
14
14
  import {
15
15
  arrayBufferToBase64DataUrl,
16
16
  extractFilename,
17
17
  inferMimeType
18
- } from "../chunk-6RQOV3B3.js";
19
- import "../chunk-AONELFLA.js";
18
+ } from "../chunk-VPWPEMZJ.js";
19
+ import "../chunk-B7GEAZBI.js";
20
20
  import "../chunk-BXWNU4T5.js";
21
21
  export {
22
22
  arrayBufferToBase64DataUrl,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  extToMime
3
- } from "./chunk-AONELFLA.js";
3
+ } from "./chunk-B7GEAZBI.js";
4
4
  export {
5
5
  extToMime
6
6
  };
@@ -41,8 +41,11 @@ interface HtmlExportOptions {
41
41
  * Only used in ZIP exports — single HTML uses timer-based playback.
42
42
  */
43
43
  audio?: Map<string, ArrayBuffer>;
44
- /** Rendering mode: 'slideshow' (interactive, default) or 'static' (scrollable) */
45
- mode?: 'slideshow' | 'static';
44
+ /**
45
+ * Rendering mode: 'slideshow' (interactive, default), 'video' (timed
46
+ * auto-advance movie playback), or 'static' (scrollable).
47
+ */
48
+ mode?: 'slideshow' | 'video' | 'static';
46
49
  /** HTML page title (default: 'Squisq Document') */
47
50
  title?: string;
48
51
  /** Auto-play slideshow on load (default: false) */
package/dist/index.d.ts CHANGED
@@ -6,13 +6,13 @@ export { PdfExportOptions, PdfImportOptions, configurePdfWorker, docToPdf, markd
6
6
  export { HtmlZipExportOptions, docToHtml, docToHtmlZip } from './html/index.js';
7
7
  export { EpubExportOptions, docToEpub, markdownDocToEpub } from './epub/index.js';
8
8
  export { ExtractedFileTheme, InferSourceFormat, InferThemeOptions, InferredFileTheme, compileExtractedTheme, inferThemeFromFile } from './infer/index.js';
9
- export { B as BUILTIN_FORMAT_IDS, a as BuiltinFormatOptions, C as ConversionLimits, b as ConversionResult, c as ConvertOptions, d as ConvertSource, D as DEFAULT_CONVERSION_LIMITS, e as DbkFormatOptions, F as FormatDefinition, f as FormatId, g as FormatRegistry, M as MarkdownFormatOptions, N as NormalizedInput, P as PreparedConversion, h as PreparedExportOptions, r as resolveConversionLimits } from './types-DByrrXeB.js';
9
+ export { B as BUILTIN_FORMAT_IDS, a as BuiltinFormatOptions, C as ConversionLimits, b as ConversionResult, c as ConvertOptions, d as ConvertSource, D as DEFAULT_CONVERSION_LIMITS, e as DbkFormatOptions, F as FormatDefinition, f as FormatId, g as FormatRegistry, M as MarkdownFormatOptions, N as NormalizedInput, P as PreparedConversion, h as PreparedExportOptions, r as resolveConversionLimits } from './types-Dzd_5H2A.js';
10
10
  export { ConversionError, ConversionErrorCode, ConversionErrorOptions, convert, createRegistry, defaultFormats, defaultRegistry, prepareConversion } from './registry/index.js';
11
11
  export { ImportedOutsideInDocument, OUTSIDE_IN_FORMAT_IDS, OUTSIDE_IN_UPDATE_FROM_MARKDOWN_KEY, OutsideInFormatId, OutsideInLayout, OutsideInMetadata, RenderOutsideInOptions, chooseOutsideInMarkdownPath, importOutsideInDocument, isOutsideInMarkdownEditingEnabled, isOutsideInTargetPath, readOutsideInMetadata, renderOutsideInDocument, resolveOutsideInLayout, withOutsideInMarkdownEditing, withOutsideInMetadata } from './outside-in/index.js';
12
12
  export { Z as ZipSafetyError, a as ZipSafetyErrorCode, b as ZipSafetyErrorOptions, c as ZipSafetyLimits } from './zipLimits-BOKCB7qk.js';
13
- export { H as HtmlExportOptions, a as HtmlImportOptions, c as collectImagePaths, h as htmlToMarkdown, b as htmlToMarkdownDoc, d as htmlToMarkdownDocSync } from './import-B0gBYUmd.js';
13
+ export { H as HtmlExportOptions, a as HtmlImportOptions, c as collectImagePaths, h as htmlToMarkdown, b as htmlToMarkdownDoc, d as htmlToMarkdownDocSync } from './import-C7c9tQHK.js';
14
14
  export { P as PptxExportOptions, a as PptxImportOptions, d as docToPptx, m as markdownDocToPptx, p as pptxToMarkdownDoc } from './import-C16E8Y4X.js';
15
- export { X as XlsxExportOptions, a as XlsxImportOptions, d as docToXlsx, m as markdownDocToXlsx, x as xlsxToMarkdownDoc } from './export-m0tr9r9d.js';
15
+ export { X as XlsxExportOptions, a as XlsxImportOptions, b as XlsxTable, c as XlsxTableColumn, d as XlsxTablesOptions, e as docToXlsx, g as gridToTables, m as markdownDocToXlsx, x as xlsxToMarkdownDoc, f as xlsxToTables } from './export-6iQXd-lQ.js';
16
16
  import '@bendyline/squisq/schemas';
17
17
  import '@bendyline/squisq/markdown';
18
18
  import './reader-B_m1aKZC.js';
package/dist/index.js CHANGED
@@ -1,13 +1,24 @@
1
+ import {
2
+ collectImagePaths,
3
+ docToHtml,
4
+ docToHtmlZip,
5
+ htmlToMarkdown,
6
+ htmlToMarkdownDoc,
7
+ htmlToMarkdownDocSync
8
+ } from "./chunk-EEDQRZ2M.js";
1
9
  import {
2
10
  docToEpub,
3
11
  markdownDocToEpub
4
- } from "./chunk-2LT3JL7U.js";
12
+ } from "./chunk-3ITGQRL5.js";
5
13
  import {
6
14
  BUILTIN_FORMAT_IDS
7
15
  } from "./chunk-2P5HJAQL.js";
8
16
  import {
9
17
  inferThemeFromFile
10
- } from "./chunk-KMBBO5H7.js";
18
+ } from "./chunk-7DQP2I57.js";
19
+ import {
20
+ compileExtractedTheme
21
+ } from "./chunk-2JJ5RFDZ.js";
11
22
  import {
12
23
  OUTSIDE_IN_FORMAT_IDS,
13
24
  OUTSIDE_IN_UPDATE_FROM_MARKDOWN_KEY,
@@ -20,7 +31,7 @@ import {
20
31
  resolveOutsideInLayout,
21
32
  withOutsideInMarkdownEditing,
22
33
  withOutsideInMetadata
23
- } from "./chunk-5PUIFU5I.js";
34
+ } from "./chunk-VDTGQ4MW.js";
24
35
  import {
25
36
  DEFAULT_CONVERSION_LIMITS,
26
37
  convert,
@@ -29,41 +40,45 @@ import {
29
40
  defaultRegistry,
30
41
  prepareConversion,
31
42
  resolveConversionLimits
32
- } from "./chunk-JTGWQK5V.js";
43
+ } from "./chunk-GRKQTQOF.js";
33
44
  import {
34
45
  ConversionError
35
46
  } from "./chunk-KXOZMWBS.js";
36
47
  import "./chunk-WATAOG4Y.js";
37
- import {
38
- compileExtractedTheme
39
- } from "./chunk-2JJ5RFDZ.js";
40
48
  import {
41
49
  docToDocx,
42
50
  docxToDoc,
43
51
  docxToMarkdownDoc,
44
52
  markdownDocToDocx
45
- } from "./chunk-FIOSE4BO.js";
53
+ } from "./chunk-XJNOZTAY.js";
46
54
  import {
47
55
  docToPptx,
48
56
  markdownDocToPptx,
49
57
  pptxToDoc,
50
58
  pptxToMarkdownDoc
51
- } from "./chunk-FMQWNPCV.js";
59
+ } from "./chunk-AGGNLRHV.js";
52
60
  import "./chunk-6N2J7C2B.js";
61
+ import "./chunk-VPWPEMZJ.js";
53
62
  import "./chunk-A6N6IN3I.js";
63
+ import "./chunk-B7GEAZBI.js";
54
64
  import {
55
65
  docToXlsx,
56
66
  markdownDocToXlsx,
57
- xlsxToDoc,
58
- xlsxToMarkdownDoc
59
- } from "./chunk-A6LSCIO5.js";
67
+ xlsxToDoc
68
+ } from "./chunk-CKSTGNVZ.js";
60
69
  import "./chunk-AVOZAKGP.js";
70
+ import {
71
+ gridToTables,
72
+ xlsxToMarkdownDoc,
73
+ xlsxToTables
74
+ } from "./chunk-OBADJV7C.js";
61
75
  import {
62
76
  csvToDoc,
63
77
  csvToMarkdownDoc,
64
78
  markdownDocToCsv,
65
79
  parseCsv
66
- } from "./chunk-AD2WT564.js";
80
+ } from "./chunk-Q77KNJIN.js";
81
+ import "./chunk-DXYWKZ52.js";
67
82
  import "./chunk-OK622ILP.js";
68
83
  import "./chunk-ILCJ3WFD.js";
69
84
  import "./chunk-JU2RHXUB.js";
@@ -77,20 +92,10 @@ import {
77
92
  markdownDocToPdf,
78
93
  pdfToDoc,
79
94
  pdfToMarkdownDoc
80
- } from "./chunk-M7XPXGXW.js";
95
+ } from "./chunk-ROF7SSQP.js";
96
+ import "./chunk-BXWNU4T5.js";
81
97
  import "./chunk-IIQYS2YH.js";
82
98
  import "./chunk-USU6HTKB.js";
83
- import {
84
- collectImagePaths,
85
- docToHtml,
86
- docToHtmlZip,
87
- htmlToMarkdown,
88
- htmlToMarkdownDoc,
89
- htmlToMarkdownDocSync
90
- } from "./chunk-T4PX33AG.js";
91
- import "./chunk-6RQOV3B3.js";
92
- import "./chunk-AONELFLA.js";
93
- import "./chunk-BXWNU4T5.js";
94
99
  export {
95
100
  BUILTIN_FORMAT_IDS,
96
101
  ConversionError,
@@ -117,6 +122,7 @@ export {
117
122
  docToXlsx,
118
123
  docxToDoc,
119
124
  docxToMarkdownDoc,
125
+ gridToTables,
120
126
  htmlToMarkdown,
121
127
  htmlToMarkdownDoc,
122
128
  htmlToMarkdownDocSync,
@@ -143,5 +149,6 @@ export {
143
149
  withOutsideInMarkdownEditing,
144
150
  withOutsideInMetadata,
145
151
  xlsxToDoc,
146
- xlsxToMarkdownDoc
152
+ xlsxToMarkdownDoc,
153
+ xlsxToTables
147
154
  };
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  inferThemeFromFile
3
- } from "../chunk-KMBBO5H7.js";
3
+ } from "../chunk-7DQP2I57.js";
4
+ import {
5
+ colorHintsFromExtraction,
6
+ compileExtractedTheme,
7
+ extractedThemeToPartial
8
+ } from "../chunk-2JJ5RFDZ.js";
4
9
  import "../chunk-KXOZMWBS.js";
5
10
  import {
6
11
  extractDocxTheme,
7
12
  extractPptxTheme,
8
13
  extractXlsxTheme
9
14
  } from "../chunk-WATAOG4Y.js";
10
- import {
11
- colorHintsFromExtraction,
12
- compileExtractedTheme,
13
- extractedThemeToPartial
14
- } from "../chunk-2JJ5RFDZ.js";
15
15
  import "../chunk-OK622ILP.js";
16
16
  import "../chunk-S5PCVMKU.js";
17
17
  import "../chunk-7AWFHP5U.js";
@@ -0,0 +1,11 @@
1
+ import {
2
+ materializeDataReferences
3
+ } from "./chunk-FLR2ARKC.js";
4
+ import "./chunk-OBADJV7C.js";
5
+ import "./chunk-Q77KNJIN.js";
6
+ import "./chunk-DXYWKZ52.js";
7
+ import "./chunk-S5PCVMKU.js";
8
+ import "./chunk-7AWFHP5U.js";
9
+ export {
10
+ materializeDataReferences
11
+ };
@@ -1,16 +1,16 @@
1
1
  import { MarkdownDocument } from '@bendyline/squisq/markdown';
2
2
  import { ContentContainer } from '@bendyline/squisq/storage';
3
- import { c as ConvertOptions, b as ConversionResult } from '../types-DByrrXeB.js';
3
+ import { c as ConvertOptions, b as ConversionResult } from '../types-Dzd_5H2A.js';
4
4
  import '@bendyline/squisq/schemas';
5
5
  import '@bendyline/squisq/transform';
6
6
  import '../docx/index.js';
7
7
  import '../reader-B_m1aKZC.js';
8
8
  import '../zipLimits-BOKCB7qk.js';
9
9
  import '../import-C16E8Y4X.js';
10
- import '../export-m0tr9r9d.js';
10
+ import '../export-6iQXd-lQ.js';
11
11
  import '../csv/index.js';
12
12
  import '../pdf/index.js';
13
- import '../import-B0gBYUmd.js';
13
+ import '../import-C7c9tQHK.js';
14
14
  import '../epub/index.js';
15
15
  import '../container/index.js';
16
16
 
@@ -10,8 +10,8 @@ import {
10
10
  resolveOutsideInLayout,
11
11
  withOutsideInMarkdownEditing,
12
12
  withOutsideInMetadata
13
- } from "../chunk-5PUIFU5I.js";
14
- import "../chunk-JTGWQK5V.js";
13
+ } from "../chunk-VDTGQ4MW.js";
14
+ import "../chunk-GRKQTQOF.js";
15
15
  import "../chunk-KXOZMWBS.js";
16
16
  import "../chunk-7AWFHP5U.js";
17
17
  export {
package/dist/pdf/index.js CHANGED
@@ -5,10 +5,10 @@ import {
5
5
  pdfToContainer,
6
6
  pdfToDoc,
7
7
  pdfToMarkdownDoc
8
- } from "../chunk-M7XPXGXW.js";
8
+ } from "../chunk-ROF7SSQP.js";
9
+ import "../chunk-BXWNU4T5.js";
9
10
  import "../chunk-IIQYS2YH.js";
10
11
  import "../chunk-USU6HTKB.js";
11
- import "../chunk-BXWNU4T5.js";
12
12
  export {
13
13
  configurePdfWorker,
14
14
  docToPdf,