@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.
Files changed (161) hide show
  1. package/dist/container/index.d.ts +7 -5
  2. package/dist/container/index.js +39 -70
  3. package/dist/container/index.js.map +1 -1
  4. package/dist/docx/index.d.ts +128 -15
  5. package/dist/docx/index.js +17 -22
  6. package/dist/docx/index.js.map +1 -1
  7. package/dist/epub/index.d.ts +66 -11
  8. package/dist/epub/index.js +10 -18
  9. package/dist/epub/index.js.map +1 -1
  10. package/dist/html/index.d.ts +278 -15
  11. package/dist/html/index.js +26 -165
  12. package/dist/html/index.js.map +1 -1
  13. package/dist/index.d.ts +9 -38
  14. package/dist/index.js +62 -37
  15. package/dist/index.js.map +1 -1
  16. package/dist/ooxml/index.d.ts +353 -14
  17. package/dist/ooxml/index.js +116 -22
  18. package/dist/ooxml/index.js.map +1 -1
  19. package/dist/pdf/index.d.ts +143 -17
  20. package/dist/pdf/index.js +16 -25
  21. package/dist/pdf/index.js.map +1 -1
  22. package/dist/pptx/index.d.ts +83 -8
  23. package/dist/pptx/index.js +14 -34
  24. package/dist/pptx/index.js.map +1 -1
  25. package/dist/xlsx/index.d.ts +12 -9
  26. package/dist/xlsx/index.js +12 -44
  27. package/dist/xlsx/index.js.map +1 -1
  28. package/package.json +2 -2
  29. package/dist/__tests__/container.test.d.ts +0 -8
  30. package/dist/__tests__/container.test.d.ts.map +0 -1
  31. package/dist/__tests__/container.test.js +0 -147
  32. package/dist/__tests__/container.test.js.map +0 -1
  33. package/dist/__tests__/docxExport.test.d.ts +0 -8
  34. package/dist/__tests__/docxExport.test.d.ts.map +0 -1
  35. package/dist/__tests__/docxExport.test.js +0 -383
  36. package/dist/__tests__/docxExport.test.js.map +0 -1
  37. package/dist/__tests__/docxImport.test.d.ts +0 -8
  38. package/dist/__tests__/docxImport.test.d.ts.map +0 -1
  39. package/dist/__tests__/docxImport.test.js +0 -309
  40. package/dist/__tests__/docxImport.test.js.map +0 -1
  41. package/dist/__tests__/epub.test.d.ts +0 -8
  42. package/dist/__tests__/epub.test.d.ts.map +0 -1
  43. package/dist/__tests__/epub.test.js +0 -472
  44. package/dist/__tests__/epub.test.js.map +0 -1
  45. package/dist/__tests__/html.test.d.ts +0 -8
  46. package/dist/__tests__/html.test.d.ts.map +0 -1
  47. package/dist/__tests__/html.test.js +0 -317
  48. package/dist/__tests__/html.test.js.map +0 -1
  49. package/dist/__tests__/ooxml.test.d.ts +0 -5
  50. package/dist/__tests__/ooxml.test.d.ts.map +0 -1
  51. package/dist/__tests__/ooxml.test.js +0 -152
  52. package/dist/__tests__/ooxml.test.js.map +0 -1
  53. package/dist/__tests__/pdfExport.test.d.ts +0 -8
  54. package/dist/__tests__/pdfExport.test.d.ts.map +0 -1
  55. package/dist/__tests__/pdfExport.test.js +0 -275
  56. package/dist/__tests__/pdfExport.test.js.map +0 -1
  57. package/dist/__tests__/pdfImport.test.d.ts +0 -11
  58. package/dist/__tests__/pdfImport.test.d.ts.map +0 -1
  59. package/dist/__tests__/pdfImport.test.js +0 -254
  60. package/dist/__tests__/pdfImport.test.js.map +0 -1
  61. package/dist/__tests__/plainHtml.test.d.ts +0 -5
  62. package/dist/__tests__/plainHtml.test.d.ts.map +0 -1
  63. package/dist/__tests__/plainHtml.test.js +0 -327
  64. package/dist/__tests__/plainHtml.test.js.map +0 -1
  65. package/dist/__tests__/plainHtmlBundle.test.d.ts +0 -11
  66. package/dist/__tests__/plainHtmlBundle.test.d.ts.map +0 -1
  67. package/dist/__tests__/plainHtmlBundle.test.js +0 -210
  68. package/dist/__tests__/plainHtmlBundle.test.js.map +0 -1
  69. package/dist/__tests__/roundTrip.test.d.ts +0 -7
  70. package/dist/__tests__/roundTrip.test.d.ts.map +0 -1
  71. package/dist/__tests__/roundTrip.test.js +0 -173
  72. package/dist/__tests__/roundTrip.test.js.map +0 -1
  73. package/dist/container/index.d.ts.map +0 -1
  74. package/dist/docx/export.d.ts +0 -69
  75. package/dist/docx/export.d.ts.map +0 -1
  76. package/dist/docx/export.js +0 -985
  77. package/dist/docx/export.js.map +0 -1
  78. package/dist/docx/import.d.ts +0 -65
  79. package/dist/docx/import.d.ts.map +0 -1
  80. package/dist/docx/import.js +0 -779
  81. package/dist/docx/import.js.map +0 -1
  82. package/dist/docx/index.d.ts.map +0 -1
  83. package/dist/docx/styles.d.ts +0 -68
  84. package/dist/docx/styles.d.ts.map +0 -1
  85. package/dist/docx/styles.js +0 -125
  86. package/dist/docx/styles.js.map +0 -1
  87. package/dist/epub/export.d.ts +0 -72
  88. package/dist/epub/export.d.ts.map +0 -1
  89. package/dist/epub/export.js +0 -698
  90. package/dist/epub/export.js.map +0 -1
  91. package/dist/epub/index.d.ts.map +0 -1
  92. package/dist/html/docsHtmlBundle.d.ts +0 -53
  93. package/dist/html/docsHtmlBundle.d.ts.map +0 -1
  94. package/dist/html/docsHtmlBundle.js +0 -299
  95. package/dist/html/docsHtmlBundle.js.map +0 -1
  96. package/dist/html/htmlTemplate.d.ts +0 -70
  97. package/dist/html/htmlTemplate.d.ts.map +0 -1
  98. package/dist/html/htmlTemplate.js +0 -282
  99. package/dist/html/htmlTemplate.js.map +0 -1
  100. package/dist/html/imageUtils.d.ts +0 -29
  101. package/dist/html/imageUtils.d.ts.map +0 -1
  102. package/dist/html/imageUtils.js +0 -63
  103. package/dist/html/imageUtils.js.map +0 -1
  104. package/dist/html/index.d.ts.map +0 -1
  105. package/dist/html/plainHtml.d.ts +0 -79
  106. package/dist/html/plainHtml.d.ts.map +0 -1
  107. package/dist/html/plainHtml.js +0 -614
  108. package/dist/html/plainHtml.js.map +0 -1
  109. package/dist/html/plainHtmlBundle.d.ts +0 -93
  110. package/dist/html/plainHtmlBundle.d.ts.map +0 -1
  111. package/dist/html/plainHtmlBundle.js +0 -357
  112. package/dist/html/plainHtmlBundle.js.map +0 -1
  113. package/dist/index.d.ts.map +0 -1
  114. package/dist/ooxml/index.d.ts.map +0 -1
  115. package/dist/ooxml/namespaces.d.ts +0 -77
  116. package/dist/ooxml/namespaces.d.ts.map +0 -1
  117. package/dist/ooxml/namespaces.js +0 -104
  118. package/dist/ooxml/namespaces.js.map +0 -1
  119. package/dist/ooxml/reader.d.ts +0 -52
  120. package/dist/ooxml/reader.d.ts.map +0 -1
  121. package/dist/ooxml/reader.js +0 -190
  122. package/dist/ooxml/reader.js.map +0 -1
  123. package/dist/ooxml/types.d.ts +0 -82
  124. package/dist/ooxml/types.d.ts.map +0 -1
  125. package/dist/ooxml/types.js +0 -9
  126. package/dist/ooxml/types.js.map +0 -1
  127. package/dist/ooxml/writer.d.ts +0 -71
  128. package/dist/ooxml/writer.d.ts.map +0 -1
  129. package/dist/ooxml/writer.js +0 -200
  130. package/dist/ooxml/writer.js.map +0 -1
  131. package/dist/ooxml/xmlUtils.d.ts +0 -76
  132. package/dist/ooxml/xmlUtils.d.ts.map +0 -1
  133. package/dist/ooxml/xmlUtils.js +0 -108
  134. package/dist/ooxml/xmlUtils.js.map +0 -1
  135. package/dist/pdf/export.d.ts +0 -56
  136. package/dist/pdf/export.d.ts.map +0 -1
  137. package/dist/pdf/export.js +0 -768
  138. package/dist/pdf/export.js.map +0 -1
  139. package/dist/pdf/import.d.ts +0 -94
  140. package/dist/pdf/import.d.ts.map +0 -1
  141. package/dist/pdf/import.js +0 -796
  142. package/dist/pdf/import.js.map +0 -1
  143. package/dist/pdf/index.d.ts.map +0 -1
  144. package/dist/pdf/styles.d.ts +0 -142
  145. package/dist/pdf/styles.d.ts.map +0 -1
  146. package/dist/pdf/styles.js +0 -145
  147. package/dist/pdf/styles.js.map +0 -1
  148. package/dist/pptx/export.d.ts +0 -75
  149. package/dist/pptx/export.d.ts.map +0 -1
  150. package/dist/pptx/export.js +0 -724
  151. package/dist/pptx/export.js.map +0 -1
  152. package/dist/pptx/index.d.ts.map +0 -1
  153. package/dist/pptx/styles.d.ts +0 -54
  154. package/dist/pptx/styles.d.ts.map +0 -1
  155. package/dist/pptx/styles.js +0 -73
  156. package/dist/pptx/styles.js.map +0 -1
  157. package/dist/pptx/templates.d.ts +0 -24
  158. package/dist/pptx/templates.d.ts.map +0 -1
  159. package/dist/pptx/templates.js +0 -158
  160. package/dist/pptx/templates.js.map +0 -1
  161. package/dist/xlsx/index.d.ts.map +0 -1
@@ -1,93 +0,0 @@
1
- /**
2
- * Recursive plain-HTML bundle export.
3
- *
4
- * `markdownDocsToPlainHtmlBundle` starts from a single entry markdown
5
- * file, walks its relative `[…](other.md)` links, recursively pulls in
6
- * any sibling/child documents (scope-limited to the entry doc's
7
- * directory tree), renders every visited file via
8
- * `markdownDocToPlainHtml`, rewrites cross-doc references from `.md`
9
- * to `.html`, and ships everything as a single ZIP.
10
- *
11
- * The function is provider-agnostic — callers pass `readDocument` and
12
- * `readBinary` callbacks that resolve relative paths against whatever
13
- * storage they use (`FileSystemContentContainer`, `MemoryContent-
14
- * Container`, in-memory map for tests, …). Failure to read any
15
- * discovered file aborts the whole export with a thrown error.
16
- */
17
- import type { MarkdownDocument } from '@bendyline/squisq/markdown';
18
- import type { Theme } from '@bendyline/squisq/schemas';
19
- export interface PlainHtmlBundleOptions {
20
- /** Entry document path relative to the container root (e.g. `'home.md'`). */
21
- entryPath: string;
22
- /** Reads a UTF-8 markdown file from the container. Returns null when absent. */
23
- readDocument: (path: string) => Promise<string | null>;
24
- /** Reads a binary asset (image) from the container. Returns null when absent. */
25
- readBinary: (path: string) => Promise<ArrayBuffer | null>;
26
- /** Optional document title for the entry. Others derive from filename. */
27
- title?: string;
28
- /** Optional theme applied uniformly to every page. Overrides {@link themeId}. */
29
- theme?: Theme;
30
- /**
31
- * Optional theme id (e.g. `'warm-earth'`, `'gezellig'`). Resolved via
32
- * `resolveTheme` and applied to every page. Convenient for callers
33
- * that track themes by id (like the host export dialog) without
34
- * having to resolve to a `Theme` object first. When both `theme` and
35
- * `themeId` are supplied, `theme` wins.
36
- */
37
- themeId?: string;
38
- /** Maximum recursion depth (default: unlimited; cycles always handled). */
39
- maxDepth?: number;
40
- /**
41
- * Emit the entry doc as `index.html` (preserving its parent directory)
42
- * instead of `<basename>.html`. Cross-doc links pointing at the entry
43
- * also rewrite to `index.html`, so a sibling `resume.md → home.md`
44
- * link doesn't 404 after the rename. Convenient for static-site
45
- * deploys where the landing page must be named `index.html`.
46
- * Default: false.
47
- */
48
- entryAsIndex?: boolean;
49
- }
50
- /**
51
- * Render an entry markdown document and every reachable sibling/child
52
- * `.md` document it links to, bundled as a single ZIP with plain-HTML
53
- * pages, per-document asset folders, and cross-doc `<a href>`
54
- * references rewritten from `.md` to `.html`.
55
- */
56
- export declare function markdownDocsToPlainHtmlBundle(options: PlainHtmlBundleOptions): Promise<Blob>;
57
- /**
58
- * Collect every `<a>`-style link URL referenced in a document. Markdown
59
- * `link` nodes plus any raw HTML `<a href>` tags. Returns the raw URLs
60
- * as authored, so callers can use them as both the linkMap *key* and
61
- * the basis for resolution.
62
- */
63
- export declare function collectLinkRefs(doc: MarkdownDocument): Set<string>;
64
- /**
65
- * Strip a path to its parent directory (POSIX-style). Returns `''`
66
- * for root-level files so subsequent joins read like a fresh path.
67
- */
68
- export declare function posixDirname(p: string): string;
69
- /**
70
- * Normalize a POSIX path: collapse `./`, resolve `..`, drop trailing
71
- * slashes, never produce a leading `/`. Returns null when the path
72
- * escapes the start ("..").
73
- */
74
- export declare function normalizePath(p: string): string | null;
75
- /**
76
- * Resolve `rel` against `baseDir`. Returns null when the result
77
- * escapes the container root via `..`.
78
- */
79
- export declare function resolveRelative(baseDir: string, rel: string): string | null;
80
- /**
81
- * True when `target` is inside `root` (or equal to it). Empty root
82
- * means "entire container is in scope".
83
- */
84
- export declare function isInScope(target: string, root: string): boolean;
85
- /**
86
- * Compute a relative path from `fromDir` to `toPath` (both POSIX-
87
- * normalized, container-relative). Used to emit hrefs that work after
88
- * unzipping anywhere — `home.md → subfolder/notes.md` becomes
89
- * `subfolder/notes.html`; `subfolder/intro.md → resume.md` becomes
90
- * `../resume.html`.
91
- */
92
- export declare function relativeFrom(fromDir: string, toPath: string): string;
93
- //# sourceMappingURL=plainHtmlBundle.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plainHtmlBundle.d.ts","sourceRoot":"","sources":["../../src/html/plainHtmlBundle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,OAAO,KAAK,EAAE,gBAAgB,EAAY,MAAM,4BAA4B,CAAC;AAC7E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAMvD,MAAM,WAAW,sBAAsB;IACrC,6EAA6E;IAC7E,SAAS,EAAE,MAAM,CAAC;IAClB,gFAAgF;IAChF,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACvD,iFAAiF;IACjF,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAC1D,0EAA0E;IAC1E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iFAAiF;IACjF,KAAK,CAAC,EAAE,KAAK,CAAC;IACd;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAID;;;;;GAKG;AACH,wBAAsB,6BAA6B,CACjD,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,IAAI,CAAC,CA+Gf;AAID;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,gBAAgB,GAAG,GAAG,CAAC,MAAM,CAAC,CA8BlE;AAuGD;;;GAGG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAG9C;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAatD;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAI3E;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAG/D;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAgBpE"}
@@ -1,357 +0,0 @@
1
- /**
2
- * Recursive plain-HTML bundle export.
3
- *
4
- * `markdownDocsToPlainHtmlBundle` starts from a single entry markdown
5
- * file, walks its relative `[…](other.md)` links, recursively pulls in
6
- * any sibling/child documents (scope-limited to the entry doc's
7
- * directory tree), renders every visited file via
8
- * `markdownDocToPlainHtml`, rewrites cross-doc references from `.md`
9
- * to `.html`, and ships everything as a single ZIP.
10
- *
11
- * The function is provider-agnostic — callers pass `readDocument` and
12
- * `readBinary` callbacks that resolve relative paths against whatever
13
- * storage they use (`FileSystemContentContainer`, `MemoryContent-
14
- * Container`, in-memory map for tests, …). Failure to read any
15
- * discovered file aborts the whole export with a thrown error.
16
- */
17
- import JSZip from 'jszip';
18
- import { parseMarkdown, inferDocumentTitle } from '@bendyline/squisq/markdown';
19
- import { resolveTheme } from '@bendyline/squisq/schemas';
20
- import { markdownDocToPlainHtml } from './plainHtml.js';
21
- // ── Public API ─────────────────────────────────────────────────────
22
- /**
23
- * Render an entry markdown document and every reachable sibling/child
24
- * `.md` document it links to, bundled as a single ZIP with plain-HTML
25
- * pages, per-document asset folders, and cross-doc `<a href>`
26
- * references rewritten from `.md` to `.html`.
27
- */
28
- export async function markdownDocsToPlainHtmlBundle(options) {
29
- const { entryPath, readDocument, readBinary, title, theme, themeId, maxDepth = Infinity, entryAsIndex = false, } = options;
30
- const resolvedTheme = theme ?? (themeId ? resolveTheme(themeId) : undefined);
31
- const entry = normalizePath(entryPath);
32
- if (!entry) {
33
- throw new Error('markdownDocsToPlainHtmlBundle: entryPath is required');
34
- }
35
- const scopeRoot = posixDirname(entry); // '' for root-level files
36
- // When `entryAsIndex`, the entry doc writes to `<entryDir>/index.html`
37
- // and every cross-doc link pointing at it rewrites to that path too.
38
- // Other docs keep the `<basename>.html` convention.
39
- const entryHtmlPath = entryAsIndex
40
- ? scopeRoot
41
- ? `${scopeRoot}/index.html`
42
- : 'index.html'
43
- : entry.slice(0, -3) + '.html';
44
- const htmlPathFor = (mdPath) => mdPath === entry ? entryHtmlPath : mdPath.slice(0, -3) + '.html';
45
- const zip = new JSZip();
46
- const visited = new Set();
47
- const queue = [{ path: entry, depth: 0 }];
48
- while (queue.length > 0) {
49
- const { path, depth } = queue.shift();
50
- if (visited.has(path))
51
- continue;
52
- visited.add(path);
53
- const source = await readDocument(path);
54
- if (source === null) {
55
- throw new Error(`markdownDocsToPlainHtmlBundle: failed to read "${path}"`);
56
- }
57
- const mdDoc = parseMarkdown(source);
58
- // Discover this doc's relative .md links — both for enqueueing new
59
- // targets and for building the per-doc link rewrite map. We resolve
60
- // each link to a canonical container-relative path so the same doc
61
- // referenced two different ways (./resume.md vs resume.md) is
62
- // visited once and rewritten consistently.
63
- const docDir = posixDirname(path);
64
- const linkMap = new Map();
65
- for (const raw of collectLinkRefs(mdDoc)) {
66
- const parsed = parseLinkRef(raw);
67
- if (!parsed)
68
- continue;
69
- const resolved = resolveRelative(docDir, parsed.path);
70
- if (resolved === null)
71
- continue; // escaped via ..
72
- if (!isInScope(resolved, scopeRoot))
73
- continue;
74
- if (!resolved.toLowerCase().endsWith('.md'))
75
- continue;
76
- // Compute the .html replacement relative to the current doc so
77
- // the rewritten href stays local (e.g. `subdir/notes.html`, not
78
- // an absolute container path). `htmlPathFor` also handles the
79
- // entry-as-index case so a sibling linking to the entry lands
80
- // on `index.html` after rename.
81
- const htmlTarget = htmlPathFor(resolved);
82
- const relHref = relativeFrom(docDir, htmlTarget) + parsed.fragment;
83
- linkMap.set(raw, relHref);
84
- if (depth + 1 <= maxDepth && !visited.has(resolved)) {
85
- queue.push({ path: resolved, depth: depth + 1 });
86
- }
87
- }
88
- // Walk images, fetch each one, write at the original relative path
89
- // resolved against the container root (so `resume_files/hero.png`
90
- // sits next to `resume.html` in the zip). Failures here are *not*
91
- // fatal — images can be missing without breaking the document
92
- // structure — but we surface them as console warnings.
93
- const images = await readImagesForDoc(mdDoc, docDir, readBinary);
94
- for (const [, { data, zipPath }] of images) {
95
- const safe = sanitizeZipPath(zipPath);
96
- if (!safe)
97
- continue;
98
- zip.file(safe, data);
99
- }
100
- // Render the document. The image rewrite map keys are the URLs
101
- // exactly as authored (so `markdownDocToPlainHtml` can match them
102
- // verbatim), and the values are paths relative to the rendered
103
- // doc's own location — so `<img src>` works after unzip without
104
- // any post-processing.
105
- const imageRewriteMap = new Map();
106
- for (const [authored, { zipPath }] of images) {
107
- imageRewriteMap.set(authored, relativeFrom(docDir, zipPath));
108
- }
109
- const docTitle = depth === 0 ? title : undefined;
110
- const html = markdownDocToPlainHtml(mdDoc, {
111
- title: docTitle ?? titleForFilename(path, mdDoc),
112
- images: imageRewriteMap,
113
- links: linkMap,
114
- theme: resolvedTheme,
115
- });
116
- const htmlPath = htmlPathFor(path);
117
- zip.file(htmlPath, html);
118
- }
119
- return zip.generateAsync({
120
- type: 'blob',
121
- compression: 'DEFLATE',
122
- compressionOptions: { level: 6 },
123
- });
124
- }
125
- // ── Link discovery ─────────────────────────────────────────────────
126
- /**
127
- * Collect every `<a>`-style link URL referenced in a document. Markdown
128
- * `link` nodes plus any raw HTML `<a href>` tags. Returns the raw URLs
129
- * as authored, so callers can use them as both the linkMap *key* and
130
- * the basis for resolution.
131
- */
132
- export function collectLinkRefs(doc) {
133
- const refs = new Set();
134
- function visitHtml(nodes) {
135
- for (const n of nodes) {
136
- if (n.type !== 'htmlElement')
137
- continue;
138
- if (n.tagName.toLowerCase() === 'a') {
139
- const href = n.attributes.href;
140
- if (typeof href === 'string' && href)
141
- refs.add(href);
142
- }
143
- visitHtml(n.children);
144
- }
145
- }
146
- function visit(node) {
147
- if (!node || typeof node !== 'object')
148
- return;
149
- const n = node;
150
- if (n.type === 'link' && typeof n.url === 'string' && n.url) {
151
- refs.add(n.url);
152
- }
153
- if ((n.type === 'htmlBlock' || n.type === 'htmlInline') && Array.isArray(n.htmlChildren)) {
154
- visitHtml(n.htmlChildren);
155
- }
156
- if (Array.isArray(n.children)) {
157
- for (const child of n.children)
158
- visit(child);
159
- }
160
- }
161
- for (const child of doc.children)
162
- visit(child);
163
- return refs;
164
- }
165
- function collectImageRefs(doc) {
166
- const refs = new Set();
167
- function visitHtml(nodes) {
168
- for (const n of nodes) {
169
- if (n.type !== 'htmlElement')
170
- continue;
171
- const tag = n.tagName.toLowerCase();
172
- // <img>/<video>/<audio>/<source> all reference media via `src`;
173
- // we feed them into the same `images` map (effectively a generic
174
- // media map — see header comment) so the export pipeline rewrites
175
- // and bundles each one the same way.
176
- if (tag === 'img' || tag === 'video' || tag === 'audio' || tag === 'source') {
177
- const src = n.attributes.src;
178
- if (typeof src === 'string' && src)
179
- refs.add(src);
180
- }
181
- if (tag === 'video' || tag === 'audio') {
182
- const poster = n.attributes.poster;
183
- if (typeof poster === 'string' && poster)
184
- refs.add(poster);
185
- }
186
- visitHtml(n.children);
187
- }
188
- }
189
- function visit(node) {
190
- if (!node || typeof node !== 'object')
191
- return;
192
- const n = node;
193
- if (n.type === 'image' && typeof n.url === 'string' && n.url)
194
- refs.add(n.url);
195
- if ((n.type === 'htmlBlock' || n.type === 'htmlInline') && Array.isArray(n.htmlChildren)) {
196
- visitHtml(n.htmlChildren);
197
- }
198
- if (Array.isArray(n.children))
199
- for (const c of n.children)
200
- visit(c);
201
- }
202
- for (const child of doc.children)
203
- visit(child);
204
- return refs;
205
- }
206
- /**
207
- * Split an authored URL into path + fragment, returning null for
208
- * external / non-document references (http(s), mailto, data, blob,
209
- * absolute paths, fragment-only). The fragment is preserved so a
210
- * link like `resume.md#experience` rewrites cleanly to
211
- * `resume.html#experience`.
212
- */
213
- function parseLinkRef(url) {
214
- if (!url)
215
- return null;
216
- if (url.startsWith('#'))
217
- return null; // intra-doc anchor
218
- if (/^[a-z][a-z0-9+.-]*:/.test(url) || // http:, https:, mailto:, ftp:, …
219
- url.startsWith('//') ||
220
- url.startsWith('/')) {
221
- return null;
222
- }
223
- const hashIdx = url.indexOf('#');
224
- const queryIdx = url.indexOf('?');
225
- const cut = hashIdx >= 0 && queryIdx >= 0 ? Math.min(hashIdx, queryIdx) : hashIdx >= 0 ? hashIdx : queryIdx;
226
- const path = cut >= 0 ? url.slice(0, cut) : url;
227
- const fragment = hashIdx >= 0 ? url.slice(hashIdx) : '';
228
- return { path, fragment };
229
- }
230
- // ── Image gathering ────────────────────────────────────────────────
231
- /**
232
- * Resolve every image referenced by a document to container-relative
233
- * paths and fetch their bytes. The returned map keys are the authored
234
- * URLs (so the renderer's `images` map can substitute them); the values
235
- * are tuples of `[bytes, zipPath]` where `zipPath` is the path used
236
- * inside the zip.
237
- *
238
- * Images that can't be read are silently dropped — the rendered HTML
239
- * will keep its `<img src>` pointing at the authored URL, which a
240
- * reader's browser will 404. That matches the user-facing "abort on
241
- * missing linked doc" rule which applies to `.md` links only.
242
- */
243
- async function readImagesForDoc(mdDoc, docDir, readBinary) {
244
- const out = new Map();
245
- for (const authored of collectImageRefs(mdDoc)) {
246
- if (/^[a-z][a-z0-9+.-]*:/.test(authored) || authored.startsWith('//'))
247
- continue;
248
- const cleanAuthored = authored.replace(/[#?].*$/, '');
249
- const resolved = resolveRelative(docDir, cleanAuthored);
250
- if (resolved === null)
251
- continue;
252
- const data = await readBinary(resolved);
253
- if (!data)
254
- continue;
255
- out.set(authored, { data, zipPath: resolved });
256
- }
257
- return out;
258
- }
259
- // ── Path helpers (POSIX-style, no Node `path`) ─────────────────────
260
- /**
261
- * Strip a path to its parent directory (POSIX-style). Returns `''`
262
- * for root-level files so subsequent joins read like a fresh path.
263
- */
264
- export function posixDirname(p) {
265
- const idx = p.lastIndexOf('/');
266
- return idx < 0 ? '' : p.slice(0, idx);
267
- }
268
- /**
269
- * Normalize a POSIX path: collapse `./`, resolve `..`, drop trailing
270
- * slashes, never produce a leading `/`. Returns null when the path
271
- * escapes the start ("..").
272
- */
273
- export function normalizePath(p) {
274
- const parts = p.split('/');
275
- const out = [];
276
- for (const segment of parts) {
277
- if (segment === '' || segment === '.')
278
- continue;
279
- if (segment === '..') {
280
- if (out.length === 0)
281
- return null;
282
- out.pop();
283
- continue;
284
- }
285
- out.push(segment);
286
- }
287
- return out.join('/');
288
- }
289
- /**
290
- * Resolve `rel` against `baseDir`. Returns null when the result
291
- * escapes the container root via `..`.
292
- */
293
- export function resolveRelative(baseDir, rel) {
294
- if (rel.startsWith('/'))
295
- return null; // absolute paths are out of scope
296
- const joined = baseDir ? `${baseDir}/${rel}` : rel;
297
- return normalizePath(joined);
298
- }
299
- /**
300
- * True when `target` is inside `root` (or equal to it). Empty root
301
- * means "entire container is in scope".
302
- */
303
- export function isInScope(target, root) {
304
- if (!root)
305
- return true;
306
- return target === root || target.startsWith(root + '/');
307
- }
308
- /**
309
- * Compute a relative path from `fromDir` to `toPath` (both POSIX-
310
- * normalized, container-relative). Used to emit hrefs that work after
311
- * unzipping anywhere — `home.md → subfolder/notes.md` becomes
312
- * `subfolder/notes.html`; `subfolder/intro.md → resume.md` becomes
313
- * `../resume.html`.
314
- */
315
- export function relativeFrom(fromDir, toPath) {
316
- const fromParts = fromDir ? fromDir.split('/') : [];
317
- const toParts = toPath.split('/');
318
- let common = 0;
319
- while (common < fromParts.length &&
320
- common < toParts.length - 1 &&
321
- fromParts[common] === toParts[common]) {
322
- common++;
323
- }
324
- const up = fromParts.length - common;
325
- const down = toParts.slice(common);
326
- const prefix = Array(up).fill('..').join('/');
327
- if (!prefix)
328
- return down.join('/');
329
- return `${prefix}/${down.join('/')}`;
330
- }
331
- /**
332
- * Sanitize a path for use as a zip entry. Strips leading slashes,
333
- * normalizes backslashes (Windows-authored paths), and rejects any
334
- * path containing `..` segments after normalization (defensive — the
335
- * resolver above already filters those out for links).
336
- */
337
- function sanitizeZipPath(path) {
338
- const normalized = path.replace(/\\/g, '/').replace(/^\/+/, '');
339
- if (!normalized)
340
- return null;
341
- if (normalized.split('/').some((seg) => seg === '..'))
342
- return null;
343
- return normalized;
344
- }
345
- /**
346
- * Derive a default page title for a non-entry doc: prefer frontmatter
347
- * `title`, fall back to the shallowest heading text, then the filename
348
- * without extension.
349
- */
350
- function titleForFilename(path, mdDoc) {
351
- const inferred = inferDocumentTitle(mdDoc);
352
- if (inferred)
353
- return inferred;
354
- const base = path.split('/').pop() ?? path;
355
- return base.replace(/\.md$/i, '');
356
- }
357
- //# sourceMappingURL=plainHtmlBundle.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plainHtmlBundle.js","sourceRoot":"","sources":["../../src/html/plainHtmlBundle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAG/E,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAoCxD,sEAAsE;AAEtE;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,6BAA6B,CACjD,OAA+B;IAE/B,MAAM,EACJ,SAAS,EACT,YAAY,EACZ,UAAU,EACV,KAAK,EACL,KAAK,EACL,OAAO,EACP,QAAQ,GAAG,QAAQ,EACnB,YAAY,GAAG,KAAK,GACrB,GAAG,OAAO,CAAC;IACZ,MAAM,aAAa,GAAG,KAAK,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAC7E,MAAM,KAAK,GAAG,aAAa,CAAC,SAAS,CAAC,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EACL,UAAU,EACV,kBAAkB,EAClB,MAAM,EACN,KAAK,EACL,IAAI,EACJ,0BAA0B,EAC1B,4BAA4B,EAC5B,0BAA0B,EAC1B,wBAAwB,EACxB,2BAA2B,EAC3B,0BAA0B,EAC1B,4BAA4B,EAC5B,2BAA2B,EAC3B,8BAA8B,EAC9B,uBAAuB,EACvB,8BAA8B,EAC9B,8BAA8B,EAC9B,uBAAuB,EACvB,SAAS,EACT,gBAAgB,EAChB,gBAAgB,EAChB,0BAA0B,GAC3B,MAAM,iBAAiB,CAAC"}
@@ -1,77 +0,0 @@
1
- /**
2
- * OOXML Namespace Constants
3
- *
4
- * All Office Open XML namespace URIs used across DOCX, PPTX, and XLSX.
5
- * Organized by category for easy reference.
6
- */
7
- /** Relationships namespace (used in _rels/*.rels files) */
8
- export declare const NS_RELATIONSHIPS = "http://schemas.openxmlformats.org/package/2006/relationships";
9
- /** Content Types namespace ([Content_Types].xml) */
10
- export declare const NS_CONTENT_TYPES = "http://schemas.openxmlformats.org/package/2006/content-types";
11
- /** Relationship type: Office document (main part) */
12
- export declare const REL_OFFICE_DOCUMENT = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument";
13
- /** Relationship type: Core properties */
14
- export declare const REL_CORE_PROPERTIES = "http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties";
15
- /** Relationship type: Extended properties (app.xml) */
16
- export declare const REL_EXTENDED_PROPERTIES = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties";
17
- /** Relationship type: Styles */
18
- export declare const REL_STYLES = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles";
19
- /** Relationship type: Numbering */
20
- export declare const REL_NUMBERING = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering";
21
- /** Relationship type: Font table */
22
- export declare const REL_FONT_TABLE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable";
23
- /** Relationship type: Settings */
24
- export declare const REL_SETTINGS = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings";
25
- /** Relationship type: Hyperlink */
26
- export declare const REL_HYPERLINK = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink";
27
- /** Relationship type: Image */
28
- export declare const REL_IMAGE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image";
29
- /** Relationship type: Footnotes */
30
- export declare const REL_FOOTNOTES = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes";
31
- /** Relationship type: Theme */
32
- export declare const REL_THEME = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme";
33
- /** WordprocessingML main namespace (w:) */
34
- export declare const NS_WML = "http://schemas.openxmlformats.org/wordprocessingml/2006/main";
35
- /** PresentationML main namespace (p:) */
36
- export declare const NS_PML = "http://schemas.openxmlformats.org/presentationml/2006/main";
37
- /** SpreadsheetML main namespace */
38
- export declare const NS_SML = "http://schemas.openxmlformats.org/spreadsheetml/2006/main";
39
- /** DrawingML main namespace (a:) */
40
- export declare const NS_DRAWINGML = "http://schemas.openxmlformats.org/drawingml/2006/main";
41
- /** DrawingML WordprocessingML drawing namespace (wp:) */
42
- export declare const NS_WP_DRAWING = "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing";
43
- /** DrawingML picture namespace (pic:) */
44
- export declare const NS_PICTURE = "http://schemas.openxmlformats.org/drawingml/2006/picture";
45
- /** Dublin Core elements namespace */
46
- export declare const NS_DC = "http://purl.org/dc/elements/1.1/";
47
- /** Dublin Core terms namespace */
48
- export declare const NS_DCTERMS = "http://purl.org/dc/terms/";
49
- /** Core properties namespace */
50
- export declare const NS_CORE_PROPERTIES = "http://schemas.openxmlformats.org/package/2006/metadata/core-properties";
51
- /** XML Schema Instance namespace */
52
- export declare const NS_XSI = "http://www.w3.org/2001/XMLSchema-instance";
53
- /** Markup Compatibility namespace (mc:) */
54
- export declare const NS_MC = "http://schemas.openxmlformats.org/markup-compatibility/2006";
55
- /** Office relationships namespace (r:) */
56
- export declare const NS_R = "http://schemas.openxmlformats.org/officeDocument/2006/relationships";
57
- export declare const CONTENT_TYPE_RELATIONSHIPS = "application/vnd.openxmlformats-package.relationships+xml";
58
- export declare const CONTENT_TYPE_CORE_PROPERTIES = "application/vnd.openxmlformats-package.core-properties+xml";
59
- export declare const CONTENT_TYPE_DOCX_DOCUMENT = "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml";
60
- export declare const CONTENT_TYPE_DOCX_STYLES = "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml";
61
- export declare const CONTENT_TYPE_DOCX_NUMBERING = "application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml";
62
- export declare const CONTENT_TYPE_DOCX_SETTINGS = "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml";
63
- export declare const CONTENT_TYPE_DOCX_FONT_TABLE = "application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml";
64
- export declare const CONTENT_TYPE_DOCX_FOOTNOTES = "application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml";
65
- export declare const CONTENT_TYPE_PPTX_PRESENTATION = "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml";
66
- export declare const CONTENT_TYPE_PPTX_SLIDE = "application/vnd.openxmlformats-officedocument.presentationml.slide+xml";
67
- export declare const CONTENT_TYPE_PPTX_SLIDE_LAYOUT = "application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml";
68
- export declare const CONTENT_TYPE_PPTX_SLIDE_MASTER = "application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml";
69
- export declare const CONTENT_TYPE_PPTX_THEME = "application/vnd.openxmlformats-officedocument.theme+xml";
70
- /** Relationship type: Slide */
71
- export declare const REL_SLIDE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide";
72
- /** Relationship type: Slide layout */
73
- export declare const REL_SLIDE_LAYOUT = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout";
74
- /** Relationship type: Slide master */
75
- export declare const REL_SLIDE_MASTER = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster";
76
- export declare const CONTENT_TYPE_XLSX_WORKBOOK = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml";
77
- //# sourceMappingURL=namespaces.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"namespaces.d.ts","sourceRoot":"","sources":["../../src/ooxml/namespaces.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,2DAA2D;AAC3D,eAAO,MAAM,gBAAgB,iEAAiE,CAAC;AAE/F,oDAAoD;AACpD,eAAO,MAAM,gBAAgB,iEAAiE,CAAC;AAM/F,qDAAqD;AACrD,eAAO,MAAM,mBAAmB,uFACsD,CAAC;AAEvF,yCAAyC;AACzC,eAAO,MAAM,mBAAmB,0FACyD,CAAC;AAE1F,uDAAuD;AACvD,eAAO,MAAM,uBAAuB,4FACuD,CAAC;AAE5F,gCAAgC;AAChC,eAAO,MAAM,UAAU,+EACuD,CAAC;AAE/E,mCAAmC;AACnC,eAAO,MAAM,aAAa,kFACuD,CAAC;AAElF,oCAAoC;AACpC,eAAO,MAAM,cAAc,kFACsD,CAAC;AAElF,kCAAkC;AAClC,eAAO,MAAM,YAAY,iFACuD,CAAC;AAEjF,mCAAmC;AACnC,eAAO,MAAM,aAAa,kFACuD,CAAC;AAElF,+BAA+B;AAC/B,eAAO,MAAM,SAAS,8EACuD,CAAC;AAE9E,mCAAmC;AACnC,eAAO,MAAM,aAAa,kFACuD,CAAC;AAElF,+BAA+B;AAC/B,eAAO,MAAM,SAAS,8EACuD,CAAC;AAM9E,2CAA2C;AAC3C,eAAO,MAAM,MAAM,iEAAiE,CAAC;AAMrF,yCAAyC;AACzC,eAAO,MAAM,MAAM,+DAA+D,CAAC;AAMnF,mCAAmC;AACnC,eAAO,MAAM,MAAM,8DAA8D,CAAC;AAMlF,oCAAoC;AACpC,eAAO,MAAM,YAAY,0DAA0D,CAAC;AAEpF,yDAAyD;AACzD,eAAO,MAAM,aAAa,2EACgD,CAAC;AAE3E,yC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