@bendyline/squisq-formats 2.6.2 → 2.6.3
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/{chunk-OBADJV7C.js → chunk-ATWVNF7D.js} +5 -4
- package/dist/{chunk-AGGNLRHV.js → chunk-MIK4NMOP.js} +2 -1
- package/dist/{chunk-JPU5GPGG.js → chunk-ONG4DBRZ.js} +1 -1
- package/dist/{chunk-CKSTGNVZ.js → chunk-Q5RENHYS.js} +1 -1
- package/dist/{chunk-FLR2ARKC.js → chunk-UXEANVBI.js} +1 -1
- package/dist/{chunk-2OCP46K5.js → chunk-XLJAHVWL.js} +1 -1
- package/dist/data/index.js +2 -2
- package/dist/{export-6iQXd-lQ.d.ts → export-C4bBD3Mx.d.ts} +6 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +5 -5
- package/dist/{materialize-A34OZGEU.js → materialize-G4WC5UG3.js} +2 -2
- package/dist/outside-in/index.d.ts +2 -2
- package/dist/outside-in/index.js +2 -2
- package/dist/pptx/index.js +1 -1
- package/dist/registry/index.d.ts +3 -3
- package/dist/registry/index.js +1 -1
- package/dist/{types-BD23kHNG.d.ts → types-kgE_mzON.d.ts} +1 -1
- package/dist/xlsx/index.d.ts +2 -2
- package/dist/xlsx/index.js +2 -2
- package/package.json +2 -2
|
@@ -928,14 +928,16 @@ async function workbookToMarkdown(data, options, spill) {
|
|
|
928
928
|
const withFormulas = options.formulas !== false;
|
|
929
929
|
for (const sheet of selected) {
|
|
930
930
|
const { cells, merges } = await sheetToCells(pkg, sheet.path, shared, styles, date1904);
|
|
931
|
-
|
|
931
|
+
const includeSheetHeading = !single && options.sheetHeadings !== false;
|
|
932
|
+
const depth = includeSheetHeading ? 2 : 1;
|
|
933
|
+
if (includeSheetHeading) {
|
|
932
934
|
children.push({ type: "heading", depth: 1, children: [{ type: "text", value: sheet.name }] });
|
|
933
935
|
}
|
|
934
936
|
if (cells.length === 0) continue;
|
|
935
937
|
if (!useRegions) {
|
|
936
938
|
if (spill && shouldSpillGrid(spill, cells)) {
|
|
937
939
|
children.push(
|
|
938
|
-
annotatedHeading(
|
|
940
|
+
annotatedHeading(depth, sheet.name, { src: spill.src, sheet: sheet.name }),
|
|
939
941
|
sidecarLinkParagraph(spill)
|
|
940
942
|
);
|
|
941
943
|
spill.used = true;
|
|
@@ -953,7 +955,7 @@ async function workbookToMarkdown(data, options, spill) {
|
|
|
953
955
|
if (plan.degraded || plan.regions.length === 0 && plan.strays.length === 0) {
|
|
954
956
|
if (spill && shouldSpillGrid(spill, cells)) {
|
|
955
957
|
children.push(
|
|
956
|
-
annotatedHeading(
|
|
958
|
+
annotatedHeading(depth, sheet.name, { src: spill.src, sheet: sheet.name }),
|
|
957
959
|
sidecarLinkParagraph(spill)
|
|
958
960
|
);
|
|
959
961
|
spill.used = true;
|
|
@@ -962,7 +964,6 @@ async function workbookToMarkdown(data, options, spill) {
|
|
|
962
964
|
children.push(cellsToTable(cells));
|
|
963
965
|
continue;
|
|
964
966
|
}
|
|
965
|
-
const depth = single ? 1 : 2;
|
|
966
967
|
for (const region of plan.regions) {
|
|
967
968
|
const slice = sliceRect(cells, region.rect, EMPTY_CELL);
|
|
968
969
|
const anchor = formatCellRef(region.rect.top, region.rect.left);
|
|
@@ -676,7 +676,8 @@ function buildLayerShape(layer, shapeId) {
|
|
|
676
676
|
return `<p:sp><p:nvSpPr><p:cNvPr id="${shapeId}" name="${escapeXml(layer.id)}"/><p:cNvSpPr/><p:nvPr/></p:nvSpPr><p:spPr><a:xfrm><a:off x="${rect.x}" y="${rect.y}"/><a:ext cx="${rect.width}" cy="${rect.height}"/></a:xfrm><a:prstGeom prst="${geometry}"><a:avLst/></a:prstGeom>` + fill + stroke + `</p:spPr></p:sp>`;
|
|
677
677
|
}
|
|
678
678
|
function buildTableLayerShapes(layer, ctx) {
|
|
679
|
-
const
|
|
679
|
+
const visibleBodyRows = layer.content.maxVisibleRows ? layer.content.rows.slice(0, Math.max(1, Math.floor(layer.content.maxVisibleRows))) : layer.content.rows;
|
|
680
|
+
const rows = [layer.content.headers, ...visibleBodyRows];
|
|
680
681
|
const columnCount = Math.max(1, ...rows.map((row) => row.length));
|
|
681
682
|
const rowCount = Math.max(1, rows.length);
|
|
682
683
|
const rect = resolveLayerRect(layer.position, 1920, 1080);
|
|
@@ -451,7 +451,7 @@ function defaultFormats() {
|
|
|
451
451
|
},
|
|
452
452
|
async exportDoc(input, options) {
|
|
453
453
|
const { markdownDocToXlsx } = await import("./xlsx/index.js");
|
|
454
|
-
const { materializeDataReferences } = await import("./materialize-
|
|
454
|
+
const { materializeDataReferences } = await import("./materialize-G4WC5UG3.js");
|
|
455
455
|
const warnings = [];
|
|
456
456
|
const markdownDoc = await materializeDataReferences(
|
|
457
457
|
await markdownOf(input),
|
package/dist/data/index.js
CHANGED
|
@@ -4,8 +4,8 @@ import {
|
|
|
4
4
|
materializeDataReferences,
|
|
5
5
|
parquetDataReader,
|
|
6
6
|
xlsxDataReader
|
|
7
|
-
} from "../chunk-
|
|
8
|
-
import "../chunk-
|
|
7
|
+
} from "../chunk-UXEANVBI.js";
|
|
8
|
+
import "../chunk-ATWVNF7D.js";
|
|
9
9
|
import "../chunk-Q77KNJIN.js";
|
|
10
10
|
import {
|
|
11
11
|
docSlugForFileName,
|
|
@@ -188,6 +188,12 @@ declare function gridToTables(sheet: string, grid: readonly (readonly XlsxCell[]
|
|
|
188
188
|
interface XlsxImportOptions extends OoxmlOpenOptions {
|
|
189
189
|
/** Which sheet to import (0-based index or sheet name). Default: all sheets. */
|
|
190
190
|
sheet?: number | string;
|
|
191
|
+
/**
|
|
192
|
+
* Emit a plain level-1 heading for each sheet when importing all sheets.
|
|
193
|
+
* Default true. Set false when each data region should be a top-level block
|
|
194
|
+
* without a separate sheet cover block.
|
|
195
|
+
*/
|
|
196
|
+
sheetHeadings?: boolean;
|
|
191
197
|
/**
|
|
192
198
|
* Split each sheet into its contiguous data islands, one block each, anchored
|
|
193
199
|
* with `{[dataTable sheet=… anchor=…]}`. Default true. Set false for the
|
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-
|
|
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-kgE_mzON.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
13
|
export { H as HtmlExportOptions, a as HtmlImportOptions, c as collectImagePaths, h as htmlToMarkdown, b as htmlToMarkdownDoc, d as htmlToMarkdownDocSync } from './import-D59rxNTj.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, 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-
|
|
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-C4bBD3Mx.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
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
resolveOutsideInLayout,
|
|
32
32
|
withOutsideInMarkdownEditing,
|
|
33
33
|
withOutsideInMetadata
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-XLJAHVWL.js";
|
|
35
35
|
import {
|
|
36
36
|
DEFAULT_CONVERSION_LIMITS,
|
|
37
37
|
convert,
|
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
defaultRegistry,
|
|
41
41
|
prepareConversion,
|
|
42
42
|
resolveConversionLimits
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-ONG4DBRZ.js";
|
|
44
44
|
import {
|
|
45
45
|
ConversionError
|
|
46
46
|
} from "./chunk-KXOZMWBS.js";
|
|
@@ -56,7 +56,7 @@ import {
|
|
|
56
56
|
markdownDocToPptx,
|
|
57
57
|
pptxToDoc,
|
|
58
58
|
pptxToMarkdownDoc
|
|
59
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-MIK4NMOP.js";
|
|
60
60
|
import "./chunk-6N2J7C2B.js";
|
|
61
61
|
import "./chunk-VPWPEMZJ.js";
|
|
62
62
|
import "./chunk-A6N6IN3I.js";
|
|
@@ -65,13 +65,13 @@ import {
|
|
|
65
65
|
docToXlsx,
|
|
66
66
|
markdownDocToXlsx,
|
|
67
67
|
xlsxToDoc
|
|
68
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-Q5RENHYS.js";
|
|
69
69
|
import "./chunk-AVOZAKGP.js";
|
|
70
70
|
import {
|
|
71
71
|
gridToTables,
|
|
72
72
|
xlsxToMarkdownDoc,
|
|
73
73
|
xlsxToTables
|
|
74
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-ATWVNF7D.js";
|
|
75
75
|
import {
|
|
76
76
|
csvToDoc,
|
|
77
77
|
csvToMarkdownDoc,
|
|
@@ -1,13 +1,13 @@
|
|
|
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-
|
|
3
|
+
import { c as ConvertOptions, b as ConversionResult } from '../types-kgE_mzON.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-
|
|
10
|
+
import '../export-C4bBD3Mx.js';
|
|
11
11
|
import '../csv/index.js';
|
|
12
12
|
import '../pdf/index.js';
|
|
13
13
|
import '../import-D59rxNTj.js';
|
package/dist/outside-in/index.js
CHANGED
|
@@ -10,8 +10,8 @@ import {
|
|
|
10
10
|
resolveOutsideInLayout,
|
|
11
11
|
withOutsideInMarkdownEditing,
|
|
12
12
|
withOutsideInMetadata
|
|
13
|
-
} from "../chunk-
|
|
14
|
-
import "../chunk-
|
|
13
|
+
} from "../chunk-XLJAHVWL.js";
|
|
14
|
+
import "../chunk-ONG4DBRZ.js";
|
|
15
15
|
import "../chunk-KXOZMWBS.js";
|
|
16
16
|
import "../chunk-7AWFHP5U.js";
|
|
17
17
|
export {
|
package/dist/pptx/index.js
CHANGED
package/dist/registry/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { f as FormatId, g as FormatRegistry, F as FormatDefinition, d as ConvertSource, c as ConvertOptions, b as ConversionResult, P as PreparedConversion } from '../types-
|
|
2
|
-
export { B as BUILTIN_FORMAT_IDS, a as BuiltinFormatOptions, C as ConversionLimits, D as DEFAULT_CONVERSION_LIMITS, e as DbkFormatOptions, M as MarkdownFormatOptions, N as NormalizedInput, h as PreparedExportOptions, r as resolveConversionLimits } from '../types-
|
|
1
|
+
import { f as FormatId, g as FormatRegistry, F as FormatDefinition, d as ConvertSource, c as ConvertOptions, b as ConversionResult, P as PreparedConversion } from '../types-kgE_mzON.js';
|
|
2
|
+
export { B as BUILTIN_FORMAT_IDS, a as BuiltinFormatOptions, C as ConversionLimits, D as DEFAULT_CONVERSION_LIMITS, e as DbkFormatOptions, M as MarkdownFormatOptions, N as NormalizedInput, h as PreparedExportOptions, r as resolveConversionLimits } from '../types-kgE_mzON.js';
|
|
3
3
|
import '@bendyline/squisq/schemas';
|
|
4
4
|
import '@bendyline/squisq/transform';
|
|
5
5
|
import '@bendyline/squisq/markdown';
|
|
@@ -8,7 +8,7 @@ import '../docx/index.js';
|
|
|
8
8
|
import '../reader-B_m1aKZC.js';
|
|
9
9
|
import '../zipLimits-BOKCB7qk.js';
|
|
10
10
|
import '../import-C16E8Y4X.js';
|
|
11
|
-
import '../export-
|
|
11
|
+
import '../export-C4bBD3Mx.js';
|
|
12
12
|
import '../csv/index.js';
|
|
13
13
|
import '../pdf/index.js';
|
|
14
14
|
import '../import-D59rxNTj.js';
|
package/dist/registry/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { ParseOptions, StringifyOptions, MarkdownDocument } from '@bendyline/squ
|
|
|
4
4
|
import { ContentContainer } from '@bendyline/squisq/storage';
|
|
5
5
|
import { DocxImportOptions, DocxExportOptions } from './docx/index.js';
|
|
6
6
|
import { a as PptxImportOptions, P as PptxExportOptions } from './import-C16E8Y4X.js';
|
|
7
|
-
import { j as XlsxContainerOptions, X as XlsxExportOptions } from './export-
|
|
7
|
+
import { j as XlsxContainerOptions, X as XlsxExportOptions } from './export-C4bBD3Mx.js';
|
|
8
8
|
import { CsvContainerOptions, CsvExportOptions } from './csv/index.js';
|
|
9
9
|
import { PdfImportOptions, PdfExportOptions } from './pdf/index.js';
|
|
10
10
|
import { a as HtmlImportOptions, H as HtmlExportOptions } from './import-D59rxNTj.js';
|
package/dist/xlsx/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Doc } from '@bendyline/squisq/schemas';
|
|
2
|
-
import { a as XlsxImportOptions } from '../export-
|
|
3
|
-
export { C as CellRect, S as SheetRef, h as XlsxCell, i as XlsxCellKind, j as XlsxContainerOptions, X as XlsxExportOptions, k as XlsxSheetGrid, b as XlsxTable, c as XlsxTableColumn, d as XlsxTablesOptions, l as XlsxWorkbookGrids, e as docToXlsx, n as formatCellRef, g as gridToTables, o as listSheetParts, m as markdownDocToXlsx, p as parseCellRef, q as xlsxToCellGrids, r as xlsxToContainer, x as xlsxToMarkdownDoc, f as xlsxToTables } from '../export-
|
|
2
|
+
import { a as XlsxImportOptions } from '../export-C4bBD3Mx.js';
|
|
3
|
+
export { C as CellRect, S as SheetRef, h as XlsxCell, i as XlsxCellKind, j as XlsxContainerOptions, X as XlsxExportOptions, k as XlsxSheetGrid, b as XlsxTable, c as XlsxTableColumn, d as XlsxTablesOptions, l as XlsxWorkbookGrids, e as docToXlsx, n as formatCellRef, g as gridToTables, o as listSheetParts, m as markdownDocToXlsx, p as parseCellRef, q as xlsxToCellGrids, r as xlsxToContainer, x as xlsxToMarkdownDoc, f as xlsxToTables } from '../export-C4bBD3Mx.js';
|
|
4
4
|
import { O as OoxmlOpenOptions } from '../reader-B_m1aKZC.js';
|
|
5
5
|
import '@bendyline/squisq/markdown';
|
|
6
6
|
import '@bendyline/squisq/storage';
|
package/dist/xlsx/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
markdownDocToXlsx,
|
|
5
5
|
patchXlsxCellValues,
|
|
6
6
|
xlsxToDoc
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-Q5RENHYS.js";
|
|
8
8
|
import "../chunk-AVOZAKGP.js";
|
|
9
9
|
import {
|
|
10
10
|
formatCellRef,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
xlsxToContainer,
|
|
16
16
|
xlsxToMarkdownDoc,
|
|
17
17
|
xlsxToTables
|
|
18
|
-
} from "../chunk-
|
|
18
|
+
} from "../chunk-ATWVNF7D.js";
|
|
19
19
|
import "../chunk-DXYWKZ52.js";
|
|
20
20
|
import "../chunk-ILCJ3WFD.js";
|
|
21
21
|
import "../chunk-JU2RHXUB.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bendyline/squisq-formats",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.3",
|
|
4
4
|
"description": "Document format converters — DOCX, PDF, OOXML import/export",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Bendyline",
|
|
@@ -115,7 +115,7 @@
|
|
|
115
115
|
"typecheck": "tsc --noEmit"
|
|
116
116
|
},
|
|
117
117
|
"dependencies": {
|
|
118
|
-
"@bendyline/squisq": "2.11.
|
|
118
|
+
"@bendyline/squisq": "2.11.3",
|
|
119
119
|
"@pdf-lib/fontkit": "1.1.1",
|
|
120
120
|
"@pdf-lib/upng": "1.0.1",
|
|
121
121
|
"@xmldom/xmldom": "0.9.12",
|