@bendyline/squisq-formats 2.5.1 → 2.6.1
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/NOTICE.md +10 -9
- package/dist/{chunk-TVUX3RUC.js → chunk-2OCP46K5.js} +10 -3
- package/dist/{chunk-2LT3JL7U.js → chunk-3ITGQRL5.js} +8 -8
- package/dist/{chunk-FMQWNPCV.js → chunk-AGGNLRHV.js} +6 -6
- package/dist/{chunk-AONELFLA.js → chunk-B7GEAZBI.js} +6 -1
- package/dist/chunk-CKSTGNVZ.js +724 -0
- package/dist/chunk-DXYWKZ52.js +57 -0
- package/dist/chunk-FLR2ARKC.js +240 -0
- package/dist/{chunk-5JQ5NDRC.js → chunk-JPU5GPGG.js} +64 -12
- package/dist/{chunk-RX55T5HO.js → chunk-OBADJV7C.js} +136 -415
- package/dist/{chunk-T4PX33AG.js → chunk-POO3PJFH.js} +23 -3
- package/dist/{chunk-AD2WT564.js → chunk-Q77KNJIN.js} +45 -0
- package/dist/{chunk-6RQOV3B3.js → chunk-VPWPEMZJ.js} +1 -1
- package/dist/{chunk-FIOSE4BO.js → chunk-XJNOZTAY.js} +6 -6
- package/dist/csv/index.d.ts +67 -1
- package/dist/csv/index.js +10 -3
- package/dist/data/index.d.ts +78 -0
- package/dist/data/index.js +30 -0
- package/dist/docx/index.js +3 -3
- package/dist/epub/index.js +4 -4
- package/dist/{export-Boq78GMq.d.ts → export-6iQXd-lQ.d.ts} +98 -2
- package/dist/html/index.d.ts +2 -8
- package/dist/html/index.js +3 -3
- package/dist/{images-ESPQKVTW.js → images-JLBFCDD4.js} +1 -1
- package/dist/{import-B0gBYUmd.d.ts → import-D59rxNTj.d.ts} +11 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +29 -26
- package/dist/infer/index.js +6 -6
- package/dist/materialize-A34OZGEU.js +11 -0
- package/dist/outside-in/index.d.ts +4 -4
- package/dist/outside-in/index.js +2 -2
- package/dist/pdf/index.js +2 -2
- package/dist/pptx/index.js +3 -3
- package/dist/registry/index.d.ts +4 -4
- package/dist/registry/index.js +1 -1
- package/dist/{types-bwP9PBSk.d.ts → types-BD23kHNG.d.ts} +5 -5
- package/dist/xlsx/index.d.ts +85 -4
- package/dist/xlsx/index.js +21 -4
- package/package.json +17 -2
- package/dist/{chunk-KMBBO5H7.js → chunk-7DQP2I57.js} +4 -4
- package/dist/{chunk-M7XPXGXW.js → chunk-ROF7SSQP.js} +3 -3
|
@@ -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
|
-
/**
|
|
45
|
-
|
|
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) */
|
|
@@ -56,6 +59,11 @@ interface HtmlExportOptions {
|
|
|
56
59
|
* lower-third. Omitted = captions off (mount default).
|
|
57
60
|
*/
|
|
58
61
|
captionStyle?: 'standard' | 'social';
|
|
62
|
+
/**
|
|
63
|
+
* Caption placement over the frame, passed through to `SquisqPlayer.mount`.
|
|
64
|
+
* Omitted = the style's classic spot (standard: top; social: lower band).
|
|
65
|
+
*/
|
|
66
|
+
captionPosition?: 'top' | 'center' | 'bottom';
|
|
59
67
|
/**
|
|
60
68
|
* Squisq theme ID to apply (e.g., 'documentary', 'cinematic').
|
|
61
69
|
* When set, the theme is assigned to the Doc before rendering,
|
|
@@ -78,7 +86,7 @@ declare function collectImagePaths(doc: Doc): Set<string>;
|
|
|
78
86
|
* @param options - Export options (playerScript is not embedded, referenced via src)
|
|
79
87
|
* @returns Complete HTML string
|
|
80
88
|
*/
|
|
81
|
-
declare function generateExternalHtml(doc: Doc, options: Pick<HtmlExportOptions, 'mode' | 'title' | 'autoPlay' | 'showCodeCopyButton' | 'captionStyle' | 'themeId' | 'themeRegistry' | 'basePath'> & {
|
|
89
|
+
declare function generateExternalHtml(doc: Doc, options: Pick<HtmlExportOptions, 'mode' | 'title' | 'autoPlay' | 'showCodeCopyButton' | 'captionStyle' | 'captionPosition' | 'themeId' | 'themeRegistry' | 'basePath'> & {
|
|
82
90
|
/** Relative path to the player JS file (e.g., 'squisq-player.js') */
|
|
83
91
|
playerScriptPath: string;
|
|
84
92
|
/** Map of original image paths to their rewritten relative paths in the ZIP */
|
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-BD23kHNG.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-
|
|
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-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-POO3PJFH.js";
|
|
1
9
|
import {
|
|
2
10
|
docToEpub,
|
|
3
11
|
markdownDocToEpub
|
|
4
|
-
} from "./chunk-
|
|
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-
|
|
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-
|
|
34
|
+
} from "./chunk-2OCP46K5.js";
|
|
24
35
|
import {
|
|
25
36
|
DEFAULT_CONVERSION_LIMITS,
|
|
26
37
|
convert,
|
|
@@ -29,43 +40,45 @@ import {
|
|
|
29
40
|
defaultRegistry,
|
|
30
41
|
prepareConversion,
|
|
31
42
|
resolveConversionLimits
|
|
32
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-JPU5GPGG.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-
|
|
53
|
+
} from "./chunk-XJNOZTAY.js";
|
|
46
54
|
import {
|
|
47
55
|
docToPptx,
|
|
48
56
|
markdownDocToPptx,
|
|
49
57
|
pptxToDoc,
|
|
50
58
|
pptxToMarkdownDoc
|
|
51
|
-
} from "./chunk-
|
|
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
|
-
gridToTables,
|
|
57
66
|
markdownDocToXlsx,
|
|
58
|
-
xlsxToDoc
|
|
67
|
+
xlsxToDoc
|
|
68
|
+
} from "./chunk-CKSTGNVZ.js";
|
|
69
|
+
import "./chunk-AVOZAKGP.js";
|
|
70
|
+
import {
|
|
71
|
+
gridToTables,
|
|
59
72
|
xlsxToMarkdownDoc,
|
|
60
73
|
xlsxToTables
|
|
61
|
-
} from "./chunk-
|
|
62
|
-
import "./chunk-AVOZAKGP.js";
|
|
74
|
+
} from "./chunk-OBADJV7C.js";
|
|
63
75
|
import {
|
|
64
76
|
csvToDoc,
|
|
65
77
|
csvToMarkdownDoc,
|
|
66
78
|
markdownDocToCsv,
|
|
67
79
|
parseCsv
|
|
68
|
-
} from "./chunk-
|
|
80
|
+
} from "./chunk-Q77KNJIN.js";
|
|
81
|
+
import "./chunk-DXYWKZ52.js";
|
|
69
82
|
import "./chunk-OK622ILP.js";
|
|
70
83
|
import "./chunk-ILCJ3WFD.js";
|
|
71
84
|
import "./chunk-JU2RHXUB.js";
|
|
@@ -79,20 +92,10 @@ import {
|
|
|
79
92
|
markdownDocToPdf,
|
|
80
93
|
pdfToDoc,
|
|
81
94
|
pdfToMarkdownDoc
|
|
82
|
-
} from "./chunk-
|
|
95
|
+
} from "./chunk-ROF7SSQP.js";
|
|
96
|
+
import "./chunk-BXWNU4T5.js";
|
|
83
97
|
import "./chunk-IIQYS2YH.js";
|
|
84
98
|
import "./chunk-USU6HTKB.js";
|
|
85
|
-
import {
|
|
86
|
-
collectImagePaths,
|
|
87
|
-
docToHtml,
|
|
88
|
-
docToHtmlZip,
|
|
89
|
-
htmlToMarkdown,
|
|
90
|
-
htmlToMarkdownDoc,
|
|
91
|
-
htmlToMarkdownDocSync
|
|
92
|
-
} from "./chunk-T4PX33AG.js";
|
|
93
|
-
import "./chunk-6RQOV3B3.js";
|
|
94
|
-
import "./chunk-AONELFLA.js";
|
|
95
|
-
import "./chunk-BXWNU4T5.js";
|
|
96
99
|
export {
|
|
97
100
|
BUILTIN_FORMAT_IDS,
|
|
98
101
|
ConversionError,
|
package/dist/infer/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
inferThemeFromFile
|
|
3
|
-
} from "../chunk-
|
|
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-
|
|
3
|
+
import { c as ConvertOptions, b as ConversionResult } from '../types-BD23kHNG.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-6iQXd-lQ.js';
|
|
11
11
|
import '../csv/index.js';
|
|
12
12
|
import '../pdf/index.js';
|
|
13
|
-
import '../import-
|
|
13
|
+
import '../import-D59rxNTj.js';
|
|
14
14
|
import '../epub/index.js';
|
|
15
15
|
import '../container/index.js';
|
|
16
16
|
|
|
@@ -30,7 +30,7 @@ import '../container/index.js';
|
|
|
30
30
|
* the portable path/frontmatter contract plus registry-backed import/export.
|
|
31
31
|
*/
|
|
32
32
|
|
|
33
|
-
declare const OUTSIDE_IN_FORMAT_IDS: readonly ["html", "docx", "pdf", "pptx", "xlsx"];
|
|
33
|
+
declare const OUTSIDE_IN_FORMAT_IDS: readonly ["html", "docx", "pdf", "pptx", "xlsx", "csv"];
|
|
34
34
|
type OutsideInFormatId = (typeof OUTSIDE_IN_FORMAT_IDS)[number];
|
|
35
35
|
declare const OUTSIDE_IN_UPDATE_FROM_MARKDOWN_KEY = "squisq-updatefrommarkdown";
|
|
36
36
|
interface OutsideInLayout {
|
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-2OCP46K5.js";
|
|
14
|
+
import "../chunk-JPU5GPGG.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-
|
|
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,
|
package/dist/pptx/index.js
CHANGED
|
@@ -4,12 +4,14 @@ import {
|
|
|
4
4
|
pptxToContainer,
|
|
5
5
|
pptxToDoc,
|
|
6
6
|
pptxToMarkdownDoc
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-AGGNLRHV.js";
|
|
8
8
|
import {
|
|
9
9
|
analyzePptxLayouts,
|
|
10
10
|
inspectPptxLayouts
|
|
11
11
|
} from "../chunk-6N2J7C2B.js";
|
|
12
|
+
import "../chunk-VPWPEMZJ.js";
|
|
12
13
|
import "../chunk-A6N6IN3I.js";
|
|
14
|
+
import "../chunk-B7GEAZBI.js";
|
|
13
15
|
import "../chunk-AVOZAKGP.js";
|
|
14
16
|
import "../chunk-ILCJ3WFD.js";
|
|
15
17
|
import "../chunk-JU2RHXUB.js";
|
|
@@ -17,8 +19,6 @@ import "../chunk-S5PCVMKU.js";
|
|
|
17
19
|
import "../chunk-7AWFHP5U.js";
|
|
18
20
|
import "../chunk-IIQYS2YH.js";
|
|
19
21
|
import "../chunk-USU6HTKB.js";
|
|
20
|
-
import "../chunk-6RQOV3B3.js";
|
|
21
|
-
import "../chunk-AONELFLA.js";
|
|
22
22
|
export {
|
|
23
23
|
analyzePptxLayouts,
|
|
24
24
|
docToPptx,
|
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-BD23kHNG.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-BD23kHNG.js';
|
|
3
3
|
import '@bendyline/squisq/schemas';
|
|
4
4
|
import '@bendyline/squisq/transform';
|
|
5
5
|
import '@bendyline/squisq/markdown';
|
|
@@ -8,10 +8,10 @@ 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-6iQXd-lQ.js';
|
|
12
12
|
import '../csv/index.js';
|
|
13
13
|
import '../pdf/index.js';
|
|
14
|
-
import '../import-
|
|
14
|
+
import '../import-D59rxNTj.js';
|
|
15
15
|
import '../epub/index.js';
|
|
16
16
|
import '../container/index.js';
|
|
17
17
|
|
package/dist/registry/index.js
CHANGED
|
@@ -4,10 +4,10 @@ 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 {
|
|
8
|
-
import {
|
|
7
|
+
import { j as XlsxContainerOptions, X as XlsxExportOptions } from './export-6iQXd-lQ.js';
|
|
8
|
+
import { CsvContainerOptions, CsvExportOptions } from './csv/index.js';
|
|
9
9
|
import { PdfImportOptions, PdfExportOptions } from './pdf/index.js';
|
|
10
|
-
import { a as HtmlImportOptions, H as HtmlExportOptions } from './import-
|
|
10
|
+
import { a as HtmlImportOptions, H as HtmlExportOptions } from './import-D59rxNTj.js';
|
|
11
11
|
import { EpubExportOptions } from './epub/index.js';
|
|
12
12
|
import { ContainerToZipOptions } from './container/index.js';
|
|
13
13
|
import { c as ZipSafetyLimits } from './zipLimits-BOKCB7qk.js';
|
|
@@ -67,8 +67,8 @@ interface BuiltinFormatOptions {
|
|
|
67
67
|
md: MarkdownFormatOptions;
|
|
68
68
|
docx: DocxImportOptions & DocxExportOptions;
|
|
69
69
|
pptx: PptxImportOptions & PptxExportOptions;
|
|
70
|
-
xlsx:
|
|
71
|
-
csv:
|
|
70
|
+
xlsx: XlsxContainerOptions & XlsxExportOptions;
|
|
71
|
+
csv: CsvContainerOptions & CsvExportOptions;
|
|
72
72
|
pdf: PdfImportOptions & PdfExportOptions;
|
|
73
73
|
html: HtmlImportOptions & Partial<Omit<HtmlExportOptions, 'playerScript'>>;
|
|
74
74
|
htmlzip: Partial<Omit<HtmlExportOptions, 'playerScript'>>;
|
package/dist/xlsx/index.d.ts
CHANGED
|
@@ -1,10 +1,91 @@
|
|
|
1
1
|
import { Doc } from '@bendyline/squisq/schemas';
|
|
2
|
-
import { a as XlsxImportOptions } from '../export-
|
|
3
|
-
export { X as XlsxExportOptions, 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-
|
|
2
|
+
import { a as XlsxImportOptions } from '../export-6iQXd-lQ.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-6iQXd-lQ.js';
|
|
4
|
+
import { O as OoxmlOpenOptions } from '../reader-B_m1aKZC.js';
|
|
4
5
|
import '@bendyline/squisq/markdown';
|
|
5
|
-
import '
|
|
6
|
+
import '@bendyline/squisq/storage';
|
|
6
7
|
import '../zipLimits-BOKCB7qk.js';
|
|
7
8
|
|
|
9
|
+
/**
|
|
10
|
+
* XLSX in-place cell-value patching — the grid's XLSX save path.
|
|
11
|
+
*
|
|
12
|
+
* `patchXlsxCellValues(bytes, patches)` rewrites ONLY the worksheet parts a
|
|
13
|
+
* patch touches (plus `xl/workbook.xml` for the calc flag) and copies every
|
|
14
|
+
* other archive member through untouched, so charts, pivot caches, styles,
|
|
15
|
+
* macros and anything else this library does not model survive a save
|
|
16
|
+
* byte-for-byte (uncompressed content — the archive itself is re-deflated).
|
|
17
|
+
*
|
|
18
|
+
* All-or-nothing: any per-cell refusal throws `XlsxPatchRefusal` BEFORE any
|
|
19
|
+
* output is produced. Refusals, and their whys:
|
|
20
|
+
* - `sheet-missing` / `cell-ref-invalid` — the patch addresses nothing.
|
|
21
|
+
* - `formula-cell` — overwriting `<v>` under an `<f>` silently desyncs the
|
|
22
|
+
* cached value from the formula; deleting the `<f>` destroys authored
|
|
23
|
+
* logic. Formula editing arrives with the calculation engine (Phase 3).
|
|
24
|
+
* - `shared-formula-follower` — worse: the cell LOOKS empty (`<f t="shared"
|
|
25
|
+
* si="…"/>` with no text) but is the fill-down continuation of a master
|
|
26
|
+
* formula; distinguished from `formula-cell` so a UI can explain it.
|
|
27
|
+
* - `date-value-unsupported` — a date-styled cell stores a serial number
|
|
28
|
+
* whose meaning depends on the workbook epoch and format code; writing a
|
|
29
|
+
* naive number or string produces a silently wrong date. Clearing
|
|
30
|
+
* (value `null`) is allowed — it keeps the style.
|
|
31
|
+
*
|
|
32
|
+
* Values write the way Excel does: number → `<v>` with no `t`; boolean →
|
|
33
|
+
* `t="b"`; string → `t="inlineStr"` (a shared-string cell is switched to
|
|
34
|
+
* inlineStr — orphaned sst entries are legal per ECMA-376); `null` clears
|
|
35
|
+
* content but keeps the cell and its style. After a successful patch the
|
|
36
|
+
* workbook's `<calcPr fullCalcOnLoad="1"/>` is set (inserted in CT_Workbook
|
|
37
|
+
* sequence position when absent) so Excel recomputes every formula on open
|
|
38
|
+
* instead of trusting caches that may reference patched inputs.
|
|
39
|
+
*
|
|
40
|
+
* XML is parsed AND serialized with the package-owned xmldom in every
|
|
41
|
+
* environment — browser DOMParser/XMLSerializer output differs across
|
|
42
|
+
* engines, and a deterministic writer is what makes the untouched-member and
|
|
43
|
+
* zero-patch guardrail tests meaningful. The XML declaration is re-prefixed
|
|
44
|
+
* from the original bytes (a serializer never reproduces it verbatim).
|
|
45
|
+
*/
|
|
46
|
+
|
|
47
|
+
interface XlsxCellPatch {
|
|
48
|
+
/** Sheet name, exactly as the workbook lists it. */
|
|
49
|
+
sheet: string;
|
|
50
|
+
/** A1-style cell reference (e.g. `B4`). */
|
|
51
|
+
ref: string;
|
|
52
|
+
/**
|
|
53
|
+
* New cell value; `null` clears the cell's content, keeping its style.
|
|
54
|
+
* Mutually exclusive with `formula`.
|
|
55
|
+
*/
|
|
56
|
+
value?: number | boolean | string | null;
|
|
57
|
+
/**
|
|
58
|
+
* New formula source WITHOUT the leading `=` — the grid's formula-editing
|
|
59
|
+
* save path. The cell's `<f>` is replaced (a shared-formula FOLLOWER's
|
|
60
|
+
* membership is self-contained, so overwriting it simply removes that
|
|
61
|
+
* cell from the group; a shared MASTER is refused — its followers'
|
|
62
|
+
* `si` would dangle). Pair with `cachedValue` so viewers that don't
|
|
63
|
+
* recalculate still show the engine's result; `fullCalcOnLoad` makes
|
|
64
|
+
* Excel recompute regardless.
|
|
65
|
+
*/
|
|
66
|
+
formula?: string;
|
|
67
|
+
/** Engine-computed result stored beside `formula` as the cached `<v>`. */
|
|
68
|
+
cachedValue?: number | boolean | string;
|
|
69
|
+
}
|
|
70
|
+
type XlsxPatchRefusalCode = 'sheet-missing' | 'cell-ref-invalid' | 'formula-cell' | 'shared-formula-follower' | 'shared-formula-master' | 'date-value-unsupported' | 'number-not-finite' | 'patch-invalid';
|
|
71
|
+
/** A per-cell condition that makes the whole patch refuse (all-or-nothing). */
|
|
72
|
+
declare class XlsxPatchRefusal extends Error {
|
|
73
|
+
readonly code: XlsxPatchRefusalCode;
|
|
74
|
+
readonly sheet: string;
|
|
75
|
+
readonly ref: string;
|
|
76
|
+
constructor(code: XlsxPatchRefusalCode, sheet: string, ref: string, message: string);
|
|
77
|
+
}
|
|
78
|
+
type XlsxPatchOptions = OoxmlOpenOptions;
|
|
79
|
+
/**
|
|
80
|
+
* Apply cell-value patches to an XLSX file in place.
|
|
81
|
+
*
|
|
82
|
+
* @param bytes - The original workbook bytes.
|
|
83
|
+
* @param patches - Cell writes; all applied, or none (`XlsxPatchRefusal`).
|
|
84
|
+
* @param options - Zip safety limits (same contract as import).
|
|
85
|
+
* @returns The patched workbook as a new ArrayBuffer.
|
|
86
|
+
*/
|
|
87
|
+
declare function patchXlsxCellValues(bytes: ArrayBuffer, patches: readonly XlsxCellPatch[], options?: XlsxPatchOptions): Promise<ArrayBuffer>;
|
|
88
|
+
|
|
8
89
|
/**
|
|
9
90
|
* @bendyline/squisq-formats XLSX Module
|
|
10
91
|
*
|
|
@@ -26,4 +107,4 @@ import '../zipLimits-BOKCB7qk.js';
|
|
|
26
107
|
*/
|
|
27
108
|
declare function xlsxToDoc(data: ArrayBuffer | Blob, options?: XlsxImportOptions): Promise<Doc>;
|
|
28
109
|
|
|
29
|
-
export { XlsxImportOptions, xlsxToDoc };
|
|
110
|
+
export { type XlsxCellPatch, XlsxImportOptions, type XlsxPatchOptions, XlsxPatchRefusal, type XlsxPatchRefusalCode, patchXlsxCellValues, xlsxToDoc };
|
package/dist/xlsx/index.js
CHANGED
|
@@ -1,20 +1,37 @@
|
|
|
1
1
|
import {
|
|
2
|
+
XlsxPatchRefusal,
|
|
2
3
|
docToXlsx,
|
|
3
|
-
gridToTables,
|
|
4
4
|
markdownDocToXlsx,
|
|
5
|
-
|
|
5
|
+
patchXlsxCellValues,
|
|
6
|
+
xlsxToDoc
|
|
7
|
+
} from "../chunk-CKSTGNVZ.js";
|
|
8
|
+
import "../chunk-AVOZAKGP.js";
|
|
9
|
+
import {
|
|
10
|
+
formatCellRef,
|
|
11
|
+
gridToTables,
|
|
12
|
+
listSheetParts,
|
|
13
|
+
parseCellRef,
|
|
14
|
+
xlsxToCellGrids,
|
|
15
|
+
xlsxToContainer,
|
|
6
16
|
xlsxToMarkdownDoc,
|
|
7
17
|
xlsxToTables
|
|
8
|
-
} from "../chunk-
|
|
9
|
-
import "../chunk-
|
|
18
|
+
} from "../chunk-OBADJV7C.js";
|
|
19
|
+
import "../chunk-DXYWKZ52.js";
|
|
10
20
|
import "../chunk-ILCJ3WFD.js";
|
|
11
21
|
import "../chunk-JU2RHXUB.js";
|
|
12
22
|
import "../chunk-S5PCVMKU.js";
|
|
13
23
|
import "../chunk-7AWFHP5U.js";
|
|
14
24
|
export {
|
|
25
|
+
XlsxPatchRefusal,
|
|
15
26
|
docToXlsx,
|
|
27
|
+
formatCellRef,
|
|
16
28
|
gridToTables,
|
|
29
|
+
listSheetParts,
|
|
17
30
|
markdownDocToXlsx,
|
|
31
|
+
parseCellRef,
|
|
32
|
+
patchXlsxCellValues,
|
|
33
|
+
xlsxToCellGrids,
|
|
34
|
+
xlsxToContainer,
|
|
18
35
|
xlsxToDoc,
|
|
19
36
|
xlsxToMarkdownDoc,
|
|
20
37
|
xlsxToTables
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bendyline/squisq-formats",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.1",
|
|
4
4
|
"description": "Document format converters — DOCX, PDF, OOXML import/export",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Bendyline",
|
|
@@ -63,6 +63,11 @@
|
|
|
63
63
|
"import": "./dist/csv/index.js",
|
|
64
64
|
"default": "./dist/csv/index.js"
|
|
65
65
|
},
|
|
66
|
+
"./data": {
|
|
67
|
+
"types": "./dist/data/index.d.ts",
|
|
68
|
+
"import": "./dist/data/index.js",
|
|
69
|
+
"default": "./dist/data/index.js"
|
|
70
|
+
},
|
|
66
71
|
"./ooxml": {
|
|
67
72
|
"types": "./dist/ooxml/index.d.ts",
|
|
68
73
|
"import": "./dist/ooxml/index.js",
|
|
@@ -110,16 +115,26 @@
|
|
|
110
115
|
"typecheck": "tsc --noEmit"
|
|
111
116
|
},
|
|
112
117
|
"dependencies": {
|
|
118
|
+
"@bendyline/squisq": "2.11.1",
|
|
113
119
|
"@pdf-lib/fontkit": "1.1.1",
|
|
114
120
|
"@pdf-lib/upng": "1.0.1",
|
|
115
121
|
"@xmldom/xmldom": "0.9.12",
|
|
116
|
-
"@bendyline/squisq": "2.10.0",
|
|
117
122
|
"jszip": "3.10.1",
|
|
118
123
|
"pdf-lib": "1.17.1",
|
|
119
124
|
"pdfjs-dist": "4.10.38"
|
|
120
125
|
},
|
|
126
|
+
"peerDependencies": {
|
|
127
|
+
"hyparquet": "^1.29.1"
|
|
128
|
+
},
|
|
129
|
+
"peerDependenciesMeta": {
|
|
130
|
+
"hyparquet": {
|
|
131
|
+
"optional": true
|
|
132
|
+
}
|
|
133
|
+
},
|
|
121
134
|
"devDependencies": {
|
|
122
135
|
"@fortawesome/fontawesome-free": "7.2.0",
|
|
136
|
+
"hyparquet": "1.29.1",
|
|
137
|
+
"hyparquet-writer": "0.16.6",
|
|
123
138
|
"tsup": "8.5.1",
|
|
124
139
|
"typescript": "5.9.3"
|
|
125
140
|
}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
colorHintsFromExtraction,
|
|
3
|
+
compileExtractedTheme
|
|
4
|
+
} from "./chunk-2JJ5RFDZ.js";
|
|
1
5
|
import {
|
|
2
6
|
ConversionError
|
|
3
7
|
} from "./chunk-KXOZMWBS.js";
|
|
@@ -6,10 +10,6 @@ import {
|
|
|
6
10
|
extractPptxTheme,
|
|
7
11
|
extractXlsxTheme
|
|
8
12
|
} from "./chunk-WATAOG4Y.js";
|
|
9
|
-
import {
|
|
10
|
-
colorHintsFromExtraction,
|
|
11
|
-
compileExtractedTheme
|
|
12
|
-
} from "./chunk-2JJ5RFDZ.js";
|
|
13
13
|
import {
|
|
14
14
|
openPackage,
|
|
15
15
|
throwIfOoxmlAborted
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
FootnoteIndex
|
|
3
|
+
} from "./chunk-BXWNU4T5.js";
|
|
1
4
|
import {
|
|
2
5
|
buildContainer
|
|
3
6
|
} from "./chunk-IIQYS2YH.js";
|
|
@@ -6,9 +9,6 @@ import {
|
|
|
6
9
|
fontAwesomeFaces,
|
|
7
10
|
fontAwesomeGlyph
|
|
8
11
|
} from "./chunk-USU6HTKB.js";
|
|
9
|
-
import {
|
|
10
|
-
FootnoteIndex
|
|
11
|
-
} from "./chunk-BXWNU4T5.js";
|
|
12
12
|
|
|
13
13
|
// src/pdf/export.ts
|
|
14
14
|
import { PDFDocument, StandardFonts, rgb, PDFString } from "pdf-lib";
|