@bendyline/squisq-formats 1.3.0 → 1.3.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/dist/container/index.d.ts +7 -5
- package/dist/container/index.js +39 -70
- package/dist/container/index.js.map +1 -1
- package/dist/docx/index.d.ts +128 -15
- package/dist/docx/index.js +17 -22
- package/dist/docx/index.js.map +1 -1
- package/dist/epub/index.d.ts +66 -11
- package/dist/epub/index.js +10 -18
- package/dist/epub/index.js.map +1 -1
- package/dist/html/index.d.ts +278 -15
- package/dist/html/index.js +26 -165
- package/dist/html/index.js.map +1 -1
- package/dist/index.d.ts +9 -38
- package/dist/index.js +62 -37
- package/dist/index.js.map +1 -1
- package/dist/ooxml/index.d.ts +353 -14
- package/dist/ooxml/index.js +116 -22
- package/dist/ooxml/index.js.map +1 -1
- package/dist/pdf/index.d.ts +143 -17
- package/dist/pdf/index.js +16 -25
- package/dist/pdf/index.js.map +1 -1
- package/dist/pptx/index.d.ts +83 -8
- package/dist/pptx/index.js +14 -34
- package/dist/pptx/index.js.map +1 -1
- package/dist/xlsx/index.d.ts +12 -9
- package/dist/xlsx/index.js +12 -44
- package/dist/xlsx/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/__tests__/container.test.d.ts +0 -8
- package/dist/__tests__/container.test.d.ts.map +0 -1
- package/dist/__tests__/container.test.js +0 -147
- package/dist/__tests__/container.test.js.map +0 -1
- package/dist/__tests__/docxExport.test.d.ts +0 -8
- package/dist/__tests__/docxExport.test.d.ts.map +0 -1
- package/dist/__tests__/docxExport.test.js +0 -383
- package/dist/__tests__/docxExport.test.js.map +0 -1
- package/dist/__tests__/docxImport.test.d.ts +0 -8
- package/dist/__tests__/docxImport.test.d.ts.map +0 -1
- package/dist/__tests__/docxImport.test.js +0 -309
- package/dist/__tests__/docxImport.test.js.map +0 -1
- package/dist/__tests__/epub.test.d.ts +0 -8
- package/dist/__tests__/epub.test.d.ts.map +0 -1
- package/dist/__tests__/epub.test.js +0 -472
- package/dist/__tests__/epub.test.js.map +0 -1
- package/dist/__tests__/html.test.d.ts +0 -8
- package/dist/__tests__/html.test.d.ts.map +0 -1
- package/dist/__tests__/html.test.js +0 -317
- package/dist/__tests__/html.test.js.map +0 -1
- package/dist/__tests__/ooxml.test.d.ts +0 -5
- package/dist/__tests__/ooxml.test.d.ts.map +0 -1
- package/dist/__tests__/ooxml.test.js +0 -152
- package/dist/__tests__/ooxml.test.js.map +0 -1
- package/dist/__tests__/pdfExport.test.d.ts +0 -8
- package/dist/__tests__/pdfExport.test.d.ts.map +0 -1
- package/dist/__tests__/pdfExport.test.js +0 -275
- package/dist/__tests__/pdfExport.test.js.map +0 -1
- package/dist/__tests__/pdfImport.test.d.ts +0 -11
- package/dist/__tests__/pdfImport.test.d.ts.map +0 -1
- package/dist/__tests__/pdfImport.test.js +0 -254
- package/dist/__tests__/pdfImport.test.js.map +0 -1
- package/dist/__tests__/plainHtml.test.d.ts +0 -5
- package/dist/__tests__/plainHtml.test.d.ts.map +0 -1
- package/dist/__tests__/plainHtml.test.js +0 -327
- package/dist/__tests__/plainHtml.test.js.map +0 -1
- package/dist/__tests__/plainHtmlBundle.test.d.ts +0 -11
- package/dist/__tests__/plainHtmlBundle.test.d.ts.map +0 -1
- package/dist/__tests__/plainHtmlBundle.test.js +0 -210
- package/dist/__tests__/plainHtmlBundle.test.js.map +0 -1
- package/dist/__tests__/roundTrip.test.d.ts +0 -7
- package/dist/__tests__/roundTrip.test.d.ts.map +0 -1
- package/dist/__tests__/roundTrip.test.js +0 -173
- package/dist/__tests__/roundTrip.test.js.map +0 -1
- package/dist/container/index.d.ts.map +0 -1
- package/dist/docx/export.d.ts +0 -69
- package/dist/docx/export.d.ts.map +0 -1
- package/dist/docx/export.js +0 -985
- package/dist/docx/export.js.map +0 -1
- package/dist/docx/import.d.ts +0 -65
- package/dist/docx/import.d.ts.map +0 -1
- package/dist/docx/import.js +0 -779
- package/dist/docx/import.js.map +0 -1
- package/dist/docx/index.d.ts.map +0 -1
- package/dist/docx/styles.d.ts +0 -68
- package/dist/docx/styles.d.ts.map +0 -1
- package/dist/docx/styles.js +0 -125
- package/dist/docx/styles.js.map +0 -1
- package/dist/epub/export.d.ts +0 -72
- package/dist/epub/export.d.ts.map +0 -1
- package/dist/epub/export.js +0 -698
- package/dist/epub/export.js.map +0 -1
- package/dist/epub/index.d.ts.map +0 -1
- package/dist/html/docsHtmlBundle.d.ts +0 -53
- package/dist/html/docsHtmlBundle.d.ts.map +0 -1
- package/dist/html/docsHtmlBundle.js +0 -299
- package/dist/html/docsHtmlBundle.js.map +0 -1
- package/dist/html/htmlTemplate.d.ts +0 -70
- package/dist/html/htmlTemplate.d.ts.map +0 -1
- package/dist/html/htmlTemplate.js +0 -282
- package/dist/html/htmlTemplate.js.map +0 -1
- package/dist/html/imageUtils.d.ts +0 -29
- package/dist/html/imageUtils.d.ts.map +0 -1
- package/dist/html/imageUtils.js +0 -63
- package/dist/html/imageUtils.js.map +0 -1
- package/dist/html/index.d.ts.map +0 -1
- package/dist/html/plainHtml.d.ts +0 -79
- package/dist/html/plainHtml.d.ts.map +0 -1
- package/dist/html/plainHtml.js +0 -614
- package/dist/html/plainHtml.js.map +0 -1
- package/dist/html/plainHtmlBundle.d.ts +0 -93
- package/dist/html/plainHtmlBundle.d.ts.map +0 -1
- package/dist/html/plainHtmlBundle.js +0 -357
- package/dist/html/plainHtmlBundle.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/ooxml/index.d.ts.map +0 -1
- package/dist/ooxml/namespaces.d.ts +0 -77
- package/dist/ooxml/namespaces.d.ts.map +0 -1
- package/dist/ooxml/namespaces.js +0 -104
- package/dist/ooxml/namespaces.js.map +0 -1
- package/dist/ooxml/reader.d.ts +0 -52
- package/dist/ooxml/reader.d.ts.map +0 -1
- package/dist/ooxml/reader.js +0 -190
- package/dist/ooxml/reader.js.map +0 -1
- package/dist/ooxml/types.d.ts +0 -82
- package/dist/ooxml/types.d.ts.map +0 -1
- package/dist/ooxml/types.js +0 -9
- package/dist/ooxml/types.js.map +0 -1
- package/dist/ooxml/writer.d.ts +0 -71
- package/dist/ooxml/writer.d.ts.map +0 -1
- package/dist/ooxml/writer.js +0 -200
- package/dist/ooxml/writer.js.map +0 -1
- package/dist/ooxml/xmlUtils.d.ts +0 -76
- package/dist/ooxml/xmlUtils.d.ts.map +0 -1
- package/dist/ooxml/xmlUtils.js +0 -108
- package/dist/ooxml/xmlUtils.js.map +0 -1
- package/dist/pdf/export.d.ts +0 -56
- package/dist/pdf/export.d.ts.map +0 -1
- package/dist/pdf/export.js +0 -768
- package/dist/pdf/export.js.map +0 -1
- package/dist/pdf/import.d.ts +0 -94
- package/dist/pdf/import.d.ts.map +0 -1
- package/dist/pdf/import.js +0 -796
- package/dist/pdf/import.js.map +0 -1
- package/dist/pdf/index.d.ts.map +0 -1
- package/dist/pdf/styles.d.ts +0 -142
- package/dist/pdf/styles.d.ts.map +0 -1
- package/dist/pdf/styles.js +0 -145
- package/dist/pdf/styles.js.map +0 -1
- package/dist/pptx/export.d.ts +0 -75
- package/dist/pptx/export.d.ts.map +0 -1
- package/dist/pptx/export.js +0 -724
- package/dist/pptx/export.js.map +0 -1
- package/dist/pptx/index.d.ts.map +0 -1
- package/dist/pptx/styles.d.ts +0 -54
- package/dist/pptx/styles.d.ts.map +0 -1
- package/dist/pptx/styles.js +0 -73
- package/dist/pptx/styles.js.map +0 -1
- package/dist/pptx/templates.d.ts +0 -24
- package/dist/pptx/templates.d.ts.map +0 -1
- package/dist/pptx/templates.js +0 -158
- package/dist/pptx/templates.js.map +0 -1
- package/dist/xlsx/index.d.ts.map +0 -1
package/dist/pdf/index.d.ts
CHANGED
|
@@ -1,26 +1,152 @@
|
|
|
1
|
+
import { Doc } from '@bendyline/squisq/schemas';
|
|
2
|
+
import { MarkdownDocument } from '@bendyline/squisq/markdown';
|
|
3
|
+
import { ContentContainer } from '@bendyline/squisq/storage';
|
|
4
|
+
|
|
1
5
|
/**
|
|
2
|
-
*
|
|
6
|
+
* PDF Export
|
|
3
7
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
8
|
+
* Converts a squisq MarkdownDocument (or Doc) into a PDF file
|
|
9
|
+
* using pdf-lib. Generates paginated, styled output with support for
|
|
10
|
+
* headings, paragraphs, inline formatting, lists, code blocks,
|
|
11
|
+
* blockquotes, tables, thematic breaks, and hyperlinks.
|
|
6
12
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
13
|
+
* Uses only the 14 standard PDF fonts (no font embedding required),
|
|
14
|
+
* keeping output size small and rendering fast.
|
|
9
15
|
*
|
|
10
|
-
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* import { parseMarkdown } from '@bendyline/squisq/markdown';
|
|
19
|
+
* import { markdownDocToPdf } from '@bendyline/squisq-formats/pdf';
|
|
20
|
+
*
|
|
21
|
+
* const md = parseMarkdown('# Hello\n\nWorld **bold** text');
|
|
22
|
+
* const buffer = await markdownDocToPdf(md);
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
/** Page size presets. */
|
|
27
|
+
type PdfPageSize = 'letter' | 'a4';
|
|
28
|
+
/**
|
|
29
|
+
* Options for PDF export.
|
|
30
|
+
*/
|
|
31
|
+
interface PdfExportOptions {
|
|
32
|
+
/** Document title (PDF metadata). */
|
|
33
|
+
title?: string;
|
|
34
|
+
/** Document author (PDF metadata). */
|
|
35
|
+
author?: string;
|
|
36
|
+
/** Page size preset. Default: "letter". */
|
|
37
|
+
pageSize?: PdfPageSize;
|
|
38
|
+
/** Page margins in points. Default: 72 (1 inch). */
|
|
39
|
+
margin?: number;
|
|
40
|
+
/** Default body font size in points. Default: 11. */
|
|
41
|
+
defaultFontSize?: number;
|
|
42
|
+
/**
|
|
43
|
+
* Squisq theme ID to apply (e.g., 'documentary', 'cinematic').
|
|
44
|
+
* When set, overrides heading, text, and link colors with the theme palette.
|
|
45
|
+
* Font changes are not supported (pdf-lib uses standard 14 PDF fonts only).
|
|
46
|
+
*/
|
|
47
|
+
themeId?: string;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Convert a MarkdownDocument to a PDF ArrayBuffer.
|
|
51
|
+
*/
|
|
52
|
+
declare function markdownDocToPdf(doc: MarkdownDocument, options?: PdfExportOptions): Promise<ArrayBuffer>;
|
|
53
|
+
/**
|
|
54
|
+
* Convert a squisq Doc to a PDF ArrayBuffer.
|
|
55
|
+
*
|
|
56
|
+
* Convenience wrapper: Doc → MarkdownDocument → PDF.
|
|
57
|
+
*/
|
|
58
|
+
declare function docToPdf(doc: Doc, options?: PdfExportOptions): Promise<ArrayBuffer>;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* PDF Import
|
|
62
|
+
*
|
|
63
|
+
* Parses a PDF file and converts its content into a squisq
|
|
64
|
+
* MarkdownDocument (or Doc) using heuristic detection of headings,
|
|
65
|
+
* lists, code blocks, tables, blockquotes, and hyperlinks.
|
|
66
|
+
*
|
|
67
|
+
* Uses pdfjs-dist (Mozilla pdf.js) for text extraction — a battle-tested,
|
|
68
|
+
* browser-compatible PDF parser. Since PDFs encode positioned glyphs
|
|
69
|
+
* rather than semantic structure, all structure detection is inherently
|
|
70
|
+
* heuristic and works best on simply-formatted documents.
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```ts
|
|
74
|
+
* import { pdfToMarkdownDoc } from '@bendyline/squisq-formats/pdf';
|
|
75
|
+
*
|
|
76
|
+
* const response = await fetch('document.pdf');
|
|
77
|
+
* const data = await response.arrayBuffer();
|
|
78
|
+
* const doc = await pdfToMarkdownDoc(data);
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Options for PDF import.
|
|
84
|
+
*/
|
|
85
|
+
interface PdfImportOptions {
|
|
86
|
+
/**
|
|
87
|
+
* Hint for the body font size used in the PDF (in points).
|
|
88
|
+
* Text items larger than this are considered headings.
|
|
89
|
+
* If not provided, the importer detects the most common font size.
|
|
90
|
+
*/
|
|
91
|
+
bodyFontSize?: number;
|
|
92
|
+
/** Whether to detect tables from column-aligned text. Default: true. */
|
|
93
|
+
detectTables?: boolean;
|
|
94
|
+
/** Whether to detect code blocks from monospace fonts. Default: true. */
|
|
95
|
+
detectCodeBlocks?: boolean;
|
|
96
|
+
/** Whether to detect blockquotes from indentation. Default: true. */
|
|
97
|
+
detectBlockquotes?: boolean;
|
|
98
|
+
/** Whether to detect URLs in text and convert to links. Default: true. */
|
|
99
|
+
detectLinks?: boolean;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Convert a PDF file to a MarkdownDocument.
|
|
103
|
+
*
|
|
104
|
+
* Structure detection is heuristic — results are best-effort.
|
|
105
|
+
*
|
|
106
|
+
* @param data - The raw PDF file as ArrayBuffer, Uint8Array, or Blob
|
|
107
|
+
* @param options - Import options
|
|
108
|
+
* @returns A MarkdownDocument representing the detected content
|
|
109
|
+
*/
|
|
110
|
+
declare function pdfToMarkdownDoc(data: ArrayBuffer | Uint8Array | Blob, options?: PdfImportOptions): Promise<MarkdownDocument>;
|
|
111
|
+
/**
|
|
112
|
+
* Convert a PDF file to a squisq Doc.
|
|
113
|
+
*
|
|
114
|
+
* Convenience wrapper: PDF → MarkdownDocument → Doc.
|
|
115
|
+
*/
|
|
116
|
+
declare function pdfToDoc(data: ArrayBuffer | Uint8Array | Blob, options?: PdfImportOptions): Promise<Doc>;
|
|
117
|
+
/**
|
|
118
|
+
* Convert a PDF file to a ContentContainer with markdown + extracted images.
|
|
119
|
+
*
|
|
120
|
+
* The container will contain:
|
|
121
|
+
* - The primary markdown document (index.md)
|
|
122
|
+
* - Any embedded images under images/ (e.g., images/image1.png)
|
|
123
|
+
*
|
|
124
|
+
* Image extraction uses pdfjs-dist's operator list API and requires a browser
|
|
125
|
+
* environment (canvas is used to encode pixel data to PNG).
|
|
126
|
+
*
|
|
127
|
+
* @param data - The raw PDF file as ArrayBuffer, Uint8Array, or Blob
|
|
128
|
+
* @param options - Import options
|
|
129
|
+
* @returns A ContentContainer with the document and its media
|
|
130
|
+
*/
|
|
131
|
+
declare function pdfToContainer(data: ArrayBuffer | Uint8Array | Blob, options?: PdfImportOptions): Promise<ContentContainer>;
|
|
132
|
+
/**
|
|
133
|
+
* Configure the pdfjs-dist PDF worker source URL.
|
|
134
|
+
*
|
|
135
|
+
* pdfjs-dist requires a worker for PDF parsing. In the **browser**, bundlers
|
|
136
|
+
* (Vite, webpack) typically handle this automatically, or you can point to a
|
|
137
|
+
* CDN-hosted worker script. In **Node.js / SSR / test** environments, call
|
|
138
|
+
* this with a `file://` URL to the worker module **before** any import call.
|
|
11
139
|
*
|
|
12
140
|
* @example
|
|
13
141
|
* ```ts
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
142
|
+
* // Browser — CDN
|
|
143
|
+
* configurePdfWorker('https://cdn.jsdelivr.net/npm/pdfjs-dist@4/legacy/build/pdf.worker.min.mjs');
|
|
144
|
+
*
|
|
145
|
+
* // Node / vitest — file URL
|
|
146
|
+
* import { pathToFileURL } from 'url';
|
|
147
|
+
* configurePdfWorker(pathToFileURL(require.resolve('pdfjs-dist/legacy/build/pdf.worker.mjs')).href);
|
|
20
148
|
* ```
|
|
21
149
|
*/
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
export {
|
|
25
|
-
export type { PdfImportOptions } from './import.js';
|
|
26
|
-
//# sourceMappingURL=index.d.ts.map
|
|
150
|
+
declare function configurePdfWorker(workerSrc: string): void;
|
|
151
|
+
|
|
152
|
+
export { type PdfExportOptions, type PdfImportOptions, configurePdfWorker, docToPdf, markdownDocToPdf, pdfToContainer, pdfToDoc, pdfToMarkdownDoc };
|
package/dist/pdf/index.js
CHANGED
|
@@ -1,26 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
* pdfToMarkdownDoc,
|
|
18
|
-
* pdfToDoc,
|
|
19
|
-
* } from '@bendyline/squisq-formats/pdf';
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
// Export
|
|
23
|
-
export { markdownDocToPdf, docToPdf } from './export.js';
|
|
24
|
-
// Import
|
|
25
|
-
export { pdfToMarkdownDoc, pdfToDoc, pdfToContainer, configurePdfWorker } from './import.js';
|
|
1
|
+
import {
|
|
2
|
+
configurePdfWorker,
|
|
3
|
+
docToPdf,
|
|
4
|
+
markdownDocToPdf,
|
|
5
|
+
pdfToContainer,
|
|
6
|
+
pdfToDoc,
|
|
7
|
+
pdfToMarkdownDoc
|
|
8
|
+
} from "../chunk-S3Y7H2BK.js";
|
|
9
|
+
export {
|
|
10
|
+
configurePdfWorker,
|
|
11
|
+
docToPdf,
|
|
12
|
+
markdownDocToPdf,
|
|
13
|
+
pdfToContainer,
|
|
14
|
+
pdfToDoc,
|
|
15
|
+
pdfToMarkdownDoc
|
|
16
|
+
};
|
|
26
17
|
//# sourceMappingURL=index.js.map
|
package/dist/pdf/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/pptx/index.d.ts
CHANGED
|
@@ -1,3 +1,80 @@
|
|
|
1
|
+
import { Doc } from '@bendyline/squisq/schemas';
|
|
2
|
+
import { MarkdownDocument } from '@bendyline/squisq/markdown';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* PPTX Export
|
|
6
|
+
*
|
|
7
|
+
* Converts a squisq MarkdownDocument (or Doc) into a .pptx file
|
|
8
|
+
* by generating PresentationML + DrawingML XML and assembling the
|
|
9
|
+
* OOXML package.
|
|
10
|
+
*
|
|
11
|
+
* Slide segmentation: each H1 or H2 heading starts a new slide.
|
|
12
|
+
* The heading becomes the slide title; content below becomes the body.
|
|
13
|
+
*
|
|
14
|
+
* Supports:
|
|
15
|
+
* - Theme-based styling (background, text colors, fonts from squisq themes)
|
|
16
|
+
* - Image embedding (pass images as ArrayBuffers via options)
|
|
17
|
+
* - Inline formatting (bold, italic, strikethrough, code, links)
|
|
18
|
+
* - Lists, code blocks, blockquotes, tables, math
|
|
19
|
+
*
|
|
20
|
+
* No third-party pptx library — all XML is generated directly using
|
|
21
|
+
* the shared ooxml/ infrastructure.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* import { parseMarkdown } from '@bendyline/squisq/markdown';
|
|
26
|
+
* import { markdownDocToPptx } from '@bendyline/squisq-formats/pptx';
|
|
27
|
+
*
|
|
28
|
+
* const md = parseMarkdown('# Slide 1\n\nHello world\n\n## Slide 2\n\nMore content');
|
|
29
|
+
* const blob = await markdownDocToPptx(md, { themeId: 'documentary' });
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Options for PPTX export.
|
|
35
|
+
*/
|
|
36
|
+
interface PptxExportOptions {
|
|
37
|
+
/** Presentation title (appears in core properties) */
|
|
38
|
+
title?: string;
|
|
39
|
+
/** Presentation author */
|
|
40
|
+
author?: string;
|
|
41
|
+
/** Presentation description */
|
|
42
|
+
description?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Which heading depth triggers a new slide.
|
|
45
|
+
* - `'h1'` — only H1 headings start slides
|
|
46
|
+
* - `'h2'` — H1 and H2 headings start slides (default)
|
|
47
|
+
* - `'heading'` — any heading (H1–H6) starts a slide
|
|
48
|
+
*/
|
|
49
|
+
slideBreak?: 'h1' | 'h2' | 'heading';
|
|
50
|
+
/** Default body font family. Default: "Calibri" */
|
|
51
|
+
defaultFont?: string;
|
|
52
|
+
/** Default body font size in points. Default: 18 */
|
|
53
|
+
defaultFontSize?: number;
|
|
54
|
+
/**
|
|
55
|
+
* Squisq theme ID to apply (e.g., 'documentary', 'cinematic', 'bold').
|
|
56
|
+
* Controls slide background, text colors, and fonts.
|
|
57
|
+
* Falls back to the document's frontmatter `themeId` if not set here.
|
|
58
|
+
*/
|
|
59
|
+
themeId?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Image data keyed by the path/URL used in markdown.
|
|
62
|
+
* When provided, images are embedded as picture shapes instead of
|
|
63
|
+
* showing `[Image: alt]` placeholders.
|
|
64
|
+
*/
|
|
65
|
+
images?: Map<string, ArrayBuffer>;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Convert a MarkdownDocument to a .pptx ArrayBuffer.
|
|
69
|
+
*/
|
|
70
|
+
declare function markdownDocToPptx(doc: MarkdownDocument, options?: PptxExportOptions): Promise<ArrayBuffer>;
|
|
71
|
+
/**
|
|
72
|
+
* Convert a squisq Doc to a .pptx ArrayBuffer.
|
|
73
|
+
*
|
|
74
|
+
* Convenience wrapper: Doc -> MarkdownDocument -> PPTX.
|
|
75
|
+
*/
|
|
76
|
+
declare function docToPptx(doc: Doc, options?: PptxExportOptions): Promise<ArrayBuffer>;
|
|
77
|
+
|
|
1
78
|
/**
|
|
2
79
|
* @bendyline/squisq-formats PPTX Module
|
|
3
80
|
*
|
|
@@ -14,14 +91,11 @@
|
|
|
14
91
|
* import { markdownDocToPptx } from '@bendyline/squisq-formats/pptx';
|
|
15
92
|
* ```
|
|
16
93
|
*/
|
|
17
|
-
|
|
18
|
-
export type { PptxExportOptions } from './export.js';
|
|
19
|
-
import type { MarkdownDocument } from '@bendyline/squisq/markdown';
|
|
20
|
-
import type { Doc } from '@bendyline/squisq/schemas';
|
|
94
|
+
|
|
21
95
|
/**
|
|
22
96
|
* Options for PPTX import (placeholder).
|
|
23
97
|
*/
|
|
24
|
-
|
|
98
|
+
interface PptxImportOptions {
|
|
25
99
|
/** Whether to extract embedded images as data URIs */
|
|
26
100
|
extractImages?: boolean;
|
|
27
101
|
}
|
|
@@ -30,11 +104,12 @@ export interface PptxImportOptions {
|
|
|
30
104
|
*
|
|
31
105
|
* @throws Error — PPTX import is not yet implemented
|
|
32
106
|
*/
|
|
33
|
-
|
|
107
|
+
declare function pptxToMarkdownDoc(_data: ArrayBuffer | Blob, _options?: PptxImportOptions): Promise<MarkdownDocument>;
|
|
34
108
|
/**
|
|
35
109
|
* Convert a .pptx file to a squisq Doc.
|
|
36
110
|
*
|
|
37
111
|
* @throws Error — PPTX import is not yet implemented
|
|
38
112
|
*/
|
|
39
|
-
|
|
40
|
-
|
|
113
|
+
declare function pptxToDoc(_data: ArrayBuffer | Blob, _options?: PptxImportOptions): Promise<Doc>;
|
|
114
|
+
|
|
115
|
+
export { type PptxExportOptions, type PptxImportOptions, docToPptx, markdownDocToPptx, pptxToDoc, pptxToMarkdownDoc };
|
package/dist/pptx/index.js
CHANGED
|
@@ -1,35 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
* ```
|
|
16
|
-
*/
|
|
17
|
-
// Export
|
|
18
|
-
export { markdownDocToPptx, docToPptx } from './export.js';
|
|
19
|
-
/**
|
|
20
|
-
* Convert a .pptx file to a MarkdownDocument.
|
|
21
|
-
*
|
|
22
|
-
* @throws Error — PPTX import is not yet implemented
|
|
23
|
-
*/
|
|
24
|
-
export async function pptxToMarkdownDoc(_data, _options) {
|
|
25
|
-
throw new Error('PPTX import is not yet implemented');
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Convert a .pptx file to a squisq Doc.
|
|
29
|
-
*
|
|
30
|
-
* @throws Error — PPTX import is not yet implemented
|
|
31
|
-
*/
|
|
32
|
-
export async function pptxToDoc(_data, _options) {
|
|
33
|
-
throw new Error('PPTX import is not yet implemented');
|
|
34
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
docToPptx,
|
|
3
|
+
markdownDocToPptx,
|
|
4
|
+
pptxToDoc,
|
|
5
|
+
pptxToMarkdownDoc
|
|
6
|
+
} from "../chunk-VN2KEOYB.js";
|
|
7
|
+
import "../chunk-7DEUGIOO.js";
|
|
8
|
+
import "../chunk-U4MRIFKL.js";
|
|
9
|
+
export {
|
|
10
|
+
docToPptx,
|
|
11
|
+
markdownDocToPptx,
|
|
12
|
+
pptxToDoc,
|
|
13
|
+
pptxToMarkdownDoc
|
|
14
|
+
};
|
|
35
15
|
//# sourceMappingURL=index.js.map
|
package/dist/pptx/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/xlsx/index.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { MarkdownDocument } from '@bendyline/squisq/markdown';
|
|
2
|
+
import { Doc } from '@bendyline/squisq/schemas';
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
5
|
* @bendyline/squisq-formats XLSX Module (Stub)
|
|
3
6
|
*
|
|
@@ -10,12 +13,11 @@
|
|
|
10
13
|
* import { markdownDocToXlsx } from '@bendyline/squisq-formats/xlsx';
|
|
11
14
|
* ```
|
|
12
15
|
*/
|
|
13
|
-
|
|
14
|
-
import type { Doc } from '@bendyline/squisq/schemas';
|
|
16
|
+
|
|
15
17
|
/**
|
|
16
18
|
* Options for XLSX export (placeholder).
|
|
17
19
|
*/
|
|
18
|
-
|
|
20
|
+
interface XlsxExportOptions {
|
|
19
21
|
/** Workbook title */
|
|
20
22
|
title?: string;
|
|
21
23
|
/** Workbook author */
|
|
@@ -24,7 +26,7 @@ export interface XlsxExportOptions {
|
|
|
24
26
|
/**
|
|
25
27
|
* Options for XLSX import (placeholder).
|
|
26
28
|
*/
|
|
27
|
-
|
|
29
|
+
interface XlsxImportOptions {
|
|
28
30
|
/** Which sheet to import (0-based index or name). Default: 0 */
|
|
29
31
|
sheet?: number | string;
|
|
30
32
|
}
|
|
@@ -33,23 +35,24 @@ export interface XlsxImportOptions {
|
|
|
33
35
|
*
|
|
34
36
|
* @throws Error — XLSX support is not yet implemented
|
|
35
37
|
*/
|
|
36
|
-
|
|
38
|
+
declare function markdownDocToXlsx(_doc: MarkdownDocument, _options?: XlsxExportOptions): Promise<Blob>;
|
|
37
39
|
/**
|
|
38
40
|
* Convert a squisq Doc to a .xlsx Blob.
|
|
39
41
|
*
|
|
40
42
|
* @throws Error — XLSX support is not yet implemented
|
|
41
43
|
*/
|
|
42
|
-
|
|
44
|
+
declare function docToXlsx(_doc: Doc, _options?: XlsxExportOptions): Promise<Blob>;
|
|
43
45
|
/**
|
|
44
46
|
* Convert a .xlsx file to a MarkdownDocument.
|
|
45
47
|
*
|
|
46
48
|
* @throws Error — XLSX support is not yet implemented
|
|
47
49
|
*/
|
|
48
|
-
|
|
50
|
+
declare function xlsxToMarkdownDoc(_data: ArrayBuffer | Blob, _options?: XlsxImportOptions): Promise<MarkdownDocument>;
|
|
49
51
|
/**
|
|
50
52
|
* Convert a .xlsx file to a squisq Doc.
|
|
51
53
|
*
|
|
52
54
|
* @throws Error — XLSX support is not yet implemented
|
|
53
55
|
*/
|
|
54
|
-
|
|
55
|
-
|
|
56
|
+
declare function xlsxToDoc(_data: ArrayBuffer | Blob, _options?: XlsxImportOptions): Promise<Doc>;
|
|
57
|
+
|
|
58
|
+
export { type XlsxExportOptions, type XlsxImportOptions, docToXlsx, markdownDocToXlsx, xlsxToDoc, xlsxToMarkdownDoc };
|
package/dist/xlsx/index.js
CHANGED
|
@@ -1,45 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Convert a MarkdownDocument to a .xlsx Blob.
|
|
15
|
-
*
|
|
16
|
-
* @throws Error — XLSX support is not yet implemented
|
|
17
|
-
*/
|
|
18
|
-
export async function markdownDocToXlsx(_doc, _options) {
|
|
19
|
-
throw new Error('XLSX export is not yet implemented');
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Convert a squisq Doc to a .xlsx Blob.
|
|
23
|
-
*
|
|
24
|
-
* @throws Error — XLSX support is not yet implemented
|
|
25
|
-
*/
|
|
26
|
-
export async function docToXlsx(_doc, _options) {
|
|
27
|
-
throw new Error('XLSX export is not yet implemented');
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Convert a .xlsx file to a MarkdownDocument.
|
|
31
|
-
*
|
|
32
|
-
* @throws Error — XLSX support is not yet implemented
|
|
33
|
-
*/
|
|
34
|
-
export async function xlsxToMarkdownDoc(_data, _options) {
|
|
35
|
-
throw new Error('XLSX import is not yet implemented');
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Convert a .xlsx file to a squisq Doc.
|
|
39
|
-
*
|
|
40
|
-
* @throws Error — XLSX support is not yet implemented
|
|
41
|
-
*/
|
|
42
|
-
export async function xlsxToDoc(_data, _options) {
|
|
43
|
-
throw new Error('XLSX import is not yet implemented');
|
|
44
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
docToXlsx,
|
|
3
|
+
markdownDocToXlsx,
|
|
4
|
+
xlsxToDoc,
|
|
5
|
+
xlsxToMarkdownDoc
|
|
6
|
+
} from "../chunk-67KIJHV2.js";
|
|
7
|
+
export {
|
|
8
|
+
docToXlsx,
|
|
9
|
+
markdownDocToXlsx,
|
|
10
|
+
xlsxToDoc,
|
|
11
|
+
xlsxToMarkdownDoc
|
|
12
|
+
};
|
|
45
13
|
//# sourceMappingURL=index.js.map
|
package/dist/xlsx/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bendyline/squisq-formats",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "Document format converters — DOCX, PDF, OOXML import/export",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Bendyline",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"typecheck": "tsc --noEmit"
|
|
85
85
|
},
|
|
86
86
|
"dependencies": {
|
|
87
|
-
"@bendyline/squisq": "1.4.
|
|
87
|
+
"@bendyline/squisq": "1.4.1",
|
|
88
88
|
"jszip": "3.10.1",
|
|
89
89
|
"pdf-lib": "1.17.1",
|
|
90
90
|
"pdfjs-dist": "4.10.38"
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tests for container ZIP serialization: containerToZip, zipToContainer.
|
|
3
|
-
*
|
|
4
|
-
* Verifies round-trip fidelity: write files to a container, serialize to ZIP,
|
|
5
|
-
* deserialize back, and confirm all files are intact.
|
|
6
|
-
*/
|
|
7
|
-
export {};
|
|
8
|
-
//# sourceMappingURL=container.test.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"container.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/container.test.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|