@bendyline/squisq-formats 1.3.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (224) hide show
  1. package/dist/chunk-6M7Z25LA.js +46 -0
  2. package/dist/chunk-6M7Z25LA.js.map +1 -0
  3. package/dist/{chunk-S3Y7H2BK.js → chunk-APSIAEXL.js} +9 -8
  4. package/dist/chunk-APSIAEXL.js.map +1 -0
  5. package/dist/{chunk-UDS45KUJ.js → chunk-BJQIJ4S4.js} +36 -52
  6. package/dist/chunk-BJQIJ4S4.js.map +1 -0
  7. package/dist/{chunk-33YRFXZZ.js → chunk-CRTC6DEX.js} +259 -13
  8. package/dist/chunk-CRTC6DEX.js.map +1 -0
  9. package/dist/chunk-FMOIGA5T.js +201 -0
  10. package/dist/chunk-FMOIGA5T.js.map +1 -0
  11. package/dist/{chunk-VN2KEOYB.js → chunk-I2GFTEOV.js} +321 -91
  12. package/dist/chunk-I2GFTEOV.js.map +1 -0
  13. package/dist/chunk-JBNVE2GV.js +116 -0
  14. package/dist/chunk-JBNVE2GV.js.map +1 -0
  15. package/dist/chunk-L53YIGYS.js +141 -0
  16. package/dist/chunk-L53YIGYS.js.map +1 -0
  17. package/dist/{chunk-ERZ627GR.js → chunk-ON232HJR.js} +11 -26
  18. package/dist/chunk-ON232HJR.js.map +1 -0
  19. package/dist/chunk-PN52A5AA.js +32 -0
  20. package/dist/chunk-PN52A5AA.js.map +1 -0
  21. package/dist/{chunk-7DEUGIOO.js → chunk-QSE7EWE7.js} +12 -87
  22. package/dist/chunk-QSE7EWE7.js.map +1 -0
  23. package/dist/container/index.d.ts +7 -5
  24. package/dist/container/index.js +39 -70
  25. package/dist/container/index.js.map +1 -1
  26. package/dist/csv/index.d.ts +37 -0
  27. package/dist/csv/index.js +13 -0
  28. package/dist/csv/index.js.map +1 -0
  29. package/dist/docx/index.d.ts +128 -15
  30. package/dist/docx/index.js +19 -22
  31. package/dist/docx/index.js.map +1 -1
  32. package/dist/epub/index.d.ts +66 -11
  33. package/dist/epub/index.js +11 -18
  34. package/dist/epub/index.js.map +1 -1
  35. package/dist/html/index.d.ts +315 -15
  36. package/dist/html/index.js +32 -165
  37. package/dist/html/index.js.map +1 -1
  38. package/dist/index.d.ts +10 -38
  39. package/dist/index.js +80 -37
  40. package/dist/index.js.map +1 -1
  41. package/dist/ooxml/index.d.ts +353 -14
  42. package/dist/ooxml/index.js +116 -22
  43. package/dist/ooxml/index.js.map +1 -1
  44. package/dist/pdf/index.d.ts +143 -17
  45. package/dist/pdf/index.js +16 -25
  46. package/dist/pdf/index.js.map +1 -1
  47. package/dist/pptx/index.d.ts +98 -21
  48. package/dist/pptx/index.js +18 -34
  49. package/dist/pptx/index.js.map +1 -1
  50. package/dist/xlsx/index.d.ts +29 -25
  51. package/dist/xlsx/index.js +13 -44
  52. package/dist/xlsx/index.js.map +1 -1
  53. package/package.json +7 -2
  54. package/src/__tests__/csvImport.test.ts +51 -0
  55. package/src/__tests__/exportThemeReconciliation.test.ts +87 -0
  56. package/src/__tests__/htmlImport.test.ts +57 -0
  57. package/src/__tests__/plainHtml.test.ts +31 -0
  58. package/src/__tests__/pptxExport.test.ts +138 -0
  59. package/src/__tests__/pptxImport.test.ts +70 -0
  60. package/src/__tests__/roundTripMatrix.fixtures.ts +86 -0
  61. package/src/__tests__/roundTripMatrix.helpers.ts +154 -0
  62. package/src/__tests__/roundTripMatrix.test.ts +136 -0
  63. package/src/__tests__/xlsxImport.test.ts +80 -0
  64. package/src/csv/index.ts +165 -0
  65. package/src/docx/export.ts +27 -44
  66. package/src/docx/import.ts +1 -2
  67. package/src/epub/export.ts +10 -27
  68. package/src/html/import.ts +297 -0
  69. package/src/html/index.ts +4 -0
  70. package/src/html/plainHtml.ts +66 -16
  71. package/src/index.ts +10 -3
  72. package/src/ooxml/namespaces.ts +3 -0
  73. package/src/pdf/export.ts +10 -5
  74. package/src/pdf/import.ts +1 -1
  75. package/src/pptx/export.ts +225 -85
  76. package/src/pptx/import.ts +156 -0
  77. package/src/pptx/index.ts +10 -28
  78. package/src/shared/inlineRuns.ts +99 -0
  79. package/src/shared/text.ts +41 -0
  80. package/src/xlsx/import.ts +159 -0
  81. package/src/xlsx/index.ts +11 -28
  82. package/dist/__tests__/container.test.d.ts +0 -8
  83. package/dist/__tests__/container.test.d.ts.map +0 -1
  84. package/dist/__tests__/container.test.js +0 -147
  85. package/dist/__tests__/container.test.js.map +0 -1
  86. package/dist/__tests__/docxExport.test.d.ts +0 -8
  87. package/dist/__tests__/docxExport.test.d.ts.map +0 -1
  88. package/dist/__tests__/docxExport.test.js +0 -383
  89. package/dist/__tests__/docxExport.test.js.map +0 -1
  90. package/dist/__tests__/docxImport.test.d.ts +0 -8
  91. package/dist/__tests__/docxImport.test.d.ts.map +0 -1
  92. package/dist/__tests__/docxImport.test.js +0 -309
  93. package/dist/__tests__/docxImport.test.js.map +0 -1
  94. package/dist/__tests__/epub.test.d.ts +0 -8
  95. package/dist/__tests__/epub.test.d.ts.map +0 -1
  96. package/dist/__tests__/epub.test.js +0 -472
  97. package/dist/__tests__/epub.test.js.map +0 -1
  98. package/dist/__tests__/html.test.d.ts +0 -8
  99. package/dist/__tests__/html.test.d.ts.map +0 -1
  100. package/dist/__tests__/html.test.js +0 -317
  101. package/dist/__tests__/html.test.js.map +0 -1
  102. package/dist/__tests__/ooxml.test.d.ts +0 -5
  103. package/dist/__tests__/ooxml.test.d.ts.map +0 -1
  104. package/dist/__tests__/ooxml.test.js +0 -152
  105. package/dist/__tests__/ooxml.test.js.map +0 -1
  106. package/dist/__tests__/pdfExport.test.d.ts +0 -8
  107. package/dist/__tests__/pdfExport.test.d.ts.map +0 -1
  108. package/dist/__tests__/pdfExport.test.js +0 -275
  109. package/dist/__tests__/pdfExport.test.js.map +0 -1
  110. package/dist/__tests__/pdfImport.test.d.ts +0 -11
  111. package/dist/__tests__/pdfImport.test.d.ts.map +0 -1
  112. package/dist/__tests__/pdfImport.test.js +0 -254
  113. package/dist/__tests__/pdfImport.test.js.map +0 -1
  114. package/dist/__tests__/plainHtml.test.d.ts +0 -5
  115. package/dist/__tests__/plainHtml.test.d.ts.map +0 -1
  116. package/dist/__tests__/plainHtml.test.js +0 -327
  117. package/dist/__tests__/plainHtml.test.js.map +0 -1
  118. package/dist/__tests__/plainHtmlBundle.test.d.ts +0 -11
  119. package/dist/__tests__/plainHtmlBundle.test.d.ts.map +0 -1
  120. package/dist/__tests__/plainHtmlBundle.test.js +0 -210
  121. package/dist/__tests__/plainHtmlBundle.test.js.map +0 -1
  122. package/dist/__tests__/roundTrip.test.d.ts +0 -7
  123. package/dist/__tests__/roundTrip.test.d.ts.map +0 -1
  124. package/dist/__tests__/roundTrip.test.js +0 -173
  125. package/dist/__tests__/roundTrip.test.js.map +0 -1
  126. package/dist/chunk-33YRFXZZ.js.map +0 -1
  127. package/dist/chunk-67KIJHV2.js +0 -21
  128. package/dist/chunk-67KIJHV2.js.map +0 -1
  129. package/dist/chunk-7DEUGIOO.js.map +0 -1
  130. package/dist/chunk-ERZ627GR.js.map +0 -1
  131. package/dist/chunk-S3Y7H2BK.js.map +0 -1
  132. package/dist/chunk-UDS45KUJ.js.map +0 -1
  133. package/dist/chunk-VN2KEOYB.js.map +0 -1
  134. package/dist/chunk-YN5HFCEW.js +0 -120
  135. package/dist/chunk-YN5HFCEW.js.map +0 -1
  136. package/dist/container/index.d.ts.map +0 -1
  137. package/dist/docx/export.d.ts +0 -69
  138. package/dist/docx/export.d.ts.map +0 -1
  139. package/dist/docx/export.js +0 -985
  140. package/dist/docx/export.js.map +0 -1
  141. package/dist/docx/import.d.ts +0 -65
  142. package/dist/docx/import.d.ts.map +0 -1
  143. package/dist/docx/import.js +0 -779
  144. package/dist/docx/import.js.map +0 -1
  145. package/dist/docx/index.d.ts.map +0 -1
  146. package/dist/docx/styles.d.ts +0 -68
  147. package/dist/docx/styles.d.ts.map +0 -1
  148. package/dist/docx/styles.js +0 -125
  149. package/dist/docx/styles.js.map +0 -1
  150. package/dist/epub/export.d.ts +0 -72
  151. package/dist/epub/export.d.ts.map +0 -1
  152. package/dist/epub/export.js +0 -698
  153. package/dist/epub/export.js.map +0 -1
  154. package/dist/epub/index.d.ts.map +0 -1
  155. package/dist/html/docsHtmlBundle.d.ts +0 -53
  156. package/dist/html/docsHtmlBundle.d.ts.map +0 -1
  157. package/dist/html/docsHtmlBundle.js +0 -299
  158. package/dist/html/docsHtmlBundle.js.map +0 -1
  159. package/dist/html/htmlTemplate.d.ts +0 -70
  160. package/dist/html/htmlTemplate.d.ts.map +0 -1
  161. package/dist/html/htmlTemplate.js +0 -282
  162. package/dist/html/htmlTemplate.js.map +0 -1
  163. package/dist/html/imageUtils.d.ts +0 -29
  164. package/dist/html/imageUtils.d.ts.map +0 -1
  165. package/dist/html/imageUtils.js +0 -63
  166. package/dist/html/imageUtils.js.map +0 -1
  167. package/dist/html/index.d.ts.map +0 -1
  168. package/dist/html/plainHtml.d.ts +0 -79
  169. package/dist/html/plainHtml.d.ts.map +0 -1
  170. package/dist/html/plainHtml.js +0 -614
  171. package/dist/html/plainHtml.js.map +0 -1
  172. package/dist/html/plainHtmlBundle.d.ts +0 -93
  173. package/dist/html/plainHtmlBundle.d.ts.map +0 -1
  174. package/dist/html/plainHtmlBundle.js +0 -357
  175. package/dist/html/plainHtmlBundle.js.map +0 -1
  176. package/dist/index.d.ts.map +0 -1
  177. package/dist/ooxml/index.d.ts.map +0 -1
  178. package/dist/ooxml/namespaces.d.ts +0 -77
  179. package/dist/ooxml/namespaces.d.ts.map +0 -1
  180. package/dist/ooxml/namespaces.js +0 -104
  181. package/dist/ooxml/namespaces.js.map +0 -1
  182. package/dist/ooxml/reader.d.ts +0 -52
  183. package/dist/ooxml/reader.d.ts.map +0 -1
  184. package/dist/ooxml/reader.js +0 -190
  185. package/dist/ooxml/reader.js.map +0 -1
  186. package/dist/ooxml/types.d.ts +0 -82
  187. package/dist/ooxml/types.d.ts.map +0 -1
  188. package/dist/ooxml/types.js +0 -9
  189. package/dist/ooxml/types.js.map +0 -1
  190. package/dist/ooxml/writer.d.ts +0 -71
  191. package/dist/ooxml/writer.d.ts.map +0 -1
  192. package/dist/ooxml/writer.js +0 -200
  193. package/dist/ooxml/writer.js.map +0 -1
  194. package/dist/ooxml/xmlUtils.d.ts +0 -76
  195. package/dist/ooxml/xmlUtils.d.ts.map +0 -1
  196. package/dist/ooxml/xmlUtils.js +0 -108
  197. package/dist/ooxml/xmlUtils.js.map +0 -1
  198. package/dist/pdf/export.d.ts +0 -56
  199. package/dist/pdf/export.d.ts.map +0 -1
  200. package/dist/pdf/export.js +0 -768
  201. package/dist/pdf/export.js.map +0 -1
  202. package/dist/pdf/import.d.ts +0 -94
  203. package/dist/pdf/import.d.ts.map +0 -1
  204. package/dist/pdf/import.js +0 -796
  205. package/dist/pdf/import.js.map +0 -1
  206. package/dist/pdf/index.d.ts.map +0 -1
  207. package/dist/pdf/styles.d.ts +0 -142
  208. package/dist/pdf/styles.d.ts.map +0 -1
  209. package/dist/pdf/styles.js +0 -145
  210. package/dist/pdf/styles.js.map +0 -1
  211. package/dist/pptx/export.d.ts +0 -75
  212. package/dist/pptx/export.d.ts.map +0 -1
  213. package/dist/pptx/export.js +0 -724
  214. package/dist/pptx/export.js.map +0 -1
  215. package/dist/pptx/index.d.ts.map +0 -1
  216. package/dist/pptx/styles.d.ts +0 -54
  217. package/dist/pptx/styles.d.ts.map +0 -1
  218. package/dist/pptx/styles.js +0 -73
  219. package/dist/pptx/styles.js.map +0 -1
  220. package/dist/pptx/templates.d.ts +0 -24
  221. package/dist/pptx/templates.d.ts.map +0 -1
  222. package/dist/pptx/templates.js +0 -158
  223. package/dist/pptx/templates.js.map +0 -1
  224. package/dist/xlsx/index.d.ts.map +0 -1
@@ -1,104 +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
- // ============================================
8
- // Package-level namespaces (shared by all formats)
9
- // ============================================
10
- /** Relationships namespace (used in _rels/*.rels files) */
11
- export const NS_RELATIONSHIPS = 'http://schemas.openxmlformats.org/package/2006/relationships';
12
- /** Content Types namespace ([Content_Types].xml) */
13
- export const NS_CONTENT_TYPES = 'http://schemas.openxmlformats.org/package/2006/content-types';
14
- // ============================================
15
- // Relationship type URIs
16
- // ============================================
17
- /** Relationship type: Office document (main part) */
18
- export const REL_OFFICE_DOCUMENT = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument';
19
- /** Relationship type: Core properties */
20
- export const REL_CORE_PROPERTIES = 'http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties';
21
- /** Relationship type: Extended properties (app.xml) */
22
- export const REL_EXTENDED_PROPERTIES = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties';
23
- /** Relationship type: Styles */
24
- export const REL_STYLES = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles';
25
- /** Relationship type: Numbering */
26
- export const REL_NUMBERING = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering';
27
- /** Relationship type: Font table */
28
- export const REL_FONT_TABLE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable';
29
- /** Relationship type: Settings */
30
- export const REL_SETTINGS = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings';
31
- /** Relationship type: Hyperlink */
32
- export const REL_HYPERLINK = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink';
33
- /** Relationship type: Image */
34
- export const REL_IMAGE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/image';
35
- /** Relationship type: Footnotes */
36
- export const REL_FOOTNOTES = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes';
37
- /** Relationship type: Theme */
38
- export const REL_THEME = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme';
39
- // ============================================
40
- // WordprocessingML (DOCX)
41
- // ============================================
42
- /** WordprocessingML main namespace (w:) */
43
- export const NS_WML = 'http://schemas.openxmlformats.org/wordprocessingml/2006/main';
44
- // ============================================
45
- // PresentationML (PPTX)
46
- // ============================================
47
- /** PresentationML main namespace (p:) */
48
- export const NS_PML = 'http://schemas.openxmlformats.org/presentationml/2006/main';
49
- // ============================================
50
- // SpreadsheetML (XLSX)
51
- // ============================================
52
- /** SpreadsheetML main namespace */
53
- export const NS_SML = 'http://schemas.openxmlformats.org/spreadsheetml/2006/main';
54
- // ============================================
55
- // DrawingML (shared across formats)
56
- // ============================================
57
- /** DrawingML main namespace (a:) */
58
- export const NS_DRAWINGML = 'http://schemas.openxmlformats.org/drawingml/2006/main';
59
- /** DrawingML WordprocessingML drawing namespace (wp:) */
60
- export const NS_WP_DRAWING = 'http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing';
61
- /** DrawingML picture namespace (pic:) */
62
- export const NS_PICTURE = 'http://schemas.openxmlformats.org/drawingml/2006/picture';
63
- // ============================================
64
- // Dublin Core / Core Properties
65
- // ============================================
66
- /** Dublin Core elements namespace */
67
- export const NS_DC = 'http://purl.org/dc/elements/1.1/';
68
- /** Dublin Core terms namespace */
69
- export const NS_DCTERMS = 'http://purl.org/dc/terms/';
70
- /** Core properties namespace */
71
- export const NS_CORE_PROPERTIES = 'http://schemas.openxmlformats.org/package/2006/metadata/core-properties';
72
- /** XML Schema Instance namespace */
73
- export const NS_XSI = 'http://www.w3.org/2001/XMLSchema-instance';
74
- // ============================================
75
- // Markup Compatibility
76
- // ============================================
77
- /** Markup Compatibility namespace (mc:) */
78
- export const NS_MC = 'http://schemas.openxmlformats.org/markup-compatibility/2006';
79
- /** Office relationships namespace (r:) */
80
- export const NS_R = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships';
81
- // ============================================
82
- // Content type strings
83
- // ============================================
84
- export const CONTENT_TYPE_RELATIONSHIPS = 'application/vnd.openxmlformats-package.relationships+xml';
85
- export const CONTENT_TYPE_CORE_PROPERTIES = 'application/vnd.openxmlformats-package.core-properties+xml';
86
- export const CONTENT_TYPE_DOCX_DOCUMENT = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml';
87
- export const CONTENT_TYPE_DOCX_STYLES = 'application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml';
88
- export const CONTENT_TYPE_DOCX_NUMBERING = 'application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml';
89
- export const CONTENT_TYPE_DOCX_SETTINGS = 'application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml';
90
- export const CONTENT_TYPE_DOCX_FONT_TABLE = 'application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml';
91
- export const CONTENT_TYPE_DOCX_FOOTNOTES = 'application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml';
92
- export const CONTENT_TYPE_PPTX_PRESENTATION = 'application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml';
93
- export const CONTENT_TYPE_PPTX_SLIDE = 'application/vnd.openxmlformats-officedocument.presentationml.slide+xml';
94
- export const CONTENT_TYPE_PPTX_SLIDE_LAYOUT = 'application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml';
95
- export const CONTENT_TYPE_PPTX_SLIDE_MASTER = 'application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml';
96
- export const CONTENT_TYPE_PPTX_THEME = 'application/vnd.openxmlformats-officedocument.theme+xml';
97
- /** Relationship type: Slide */
98
- export const REL_SLIDE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide';
99
- /** Relationship type: Slide layout */
100
- export const REL_SLIDE_LAYOUT = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout';
101
- /** Relationship type: Slide master */
102
- export const REL_SLIDE_MASTER = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster';
103
- export const CONTENT_TYPE_XLSX_WORKBOOK = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml';
104
- //# sourceMappingURL=namespaces.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"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,6EAA6E,CAAC;AAEhF,MAAM,CAAC,MAAM,4BAA4B,GACvC,8EAA8E,CAAC;AAEjF,MAAM,CAAC,MAAM,2BAA2B,GACtC,8EAA8E,CAAC;AAEjF,MAAM,CAAC,MAAM,8BAA8B,GACzC,oFAAoF,CAAC;AAEvF,MAAM,CAAC,MAAM,uBAAuB,GAClC,wEAAwE,CAAC;AAE3E,MAAM,CAAC,MAAM,8BAA8B,GACzC,8EAA8E,CAAC;AAEjF,MAAM,CAAC,MAAM,8BAA8B,GACzC,8EAA8E,CAAC;AAEjF,MAAM,CAAC,MAAM,uBAAuB,GAAG,yDAAyD,CAAC;AAEjG,+BAA+B;AAC/B,MAAM,CAAC,MAAM,SAAS,GACpB,2EAA2E,CAAC;AAE9E,sCAAsC;AACtC,MAAM,CAAC,MAAM,gBAAgB,GAC3B,iFAAiF,CAAC;AAEpF,sCAAsC;AACtC,MAAM,CAAC,MAAM,gBAAgB,GAC3B,iFAAiF,CAAC;AAEpF,MAAM,CAAC,MAAM,0BAA0B,GACrC,4EAA4E,CAAC"}
@@ -1,52 +0,0 @@
1
- /**
2
- * OOXML Package Reader
3
- *
4
- * Opens OOXML archives (.docx, .pptx, .xlsx) and parses their
5
- * structural metadata: [Content_Types].xml, relationships, and
6
- * core properties.
7
- *
8
- * Uses JSZip to unzip and the browser's DOMParser to parse XML.
9
- */
10
- import type { OoxmlPackage, Relationship, CoreProperties } from './types.js';
11
- /**
12
- * Open an OOXML package from raw data.
13
- *
14
- * Parses the ZIP archive, [Content_Types].xml, and root relationships.
15
- *
16
- * @param data - The raw .docx/.pptx/.xlsx file as ArrayBuffer or Blob
17
- * @returns A parsed OoxmlPackage
18
- */
19
- export declare function openPackage(data: ArrayBuffer | Blob): Promise<OoxmlPackage>;
20
- /**
21
- * Parse relationships for a specific part.
22
- *
23
- * @param pkg - The OOXML package (or the zip directly)
24
- * @param partPath - The part path (e.g., "word/document.xml").
25
- * Use "" for root-level relationships (_rels/.rels).
26
- * @returns Array of relationship entries
27
- */
28
- export declare function getPartRelationships(pkg: OoxmlPackage, partPath: string): Promise<Relationship[]>;
29
- /**
30
- * Extract an XML part from the package and parse it as a DOM Document.
31
- *
32
- * @param pkg - The OOXML package
33
- * @param partPath - Path within the archive (e.g., "word/document.xml")
34
- * @returns Parsed XML Document, or null if the part doesn't exist
35
- */
36
- export declare function getPartXml(pkg: OoxmlPackage, partPath: string): Promise<Document | null>;
37
- /**
38
- * Extract a binary part from the package (e.g., an image from word/media/).
39
- *
40
- * @param pkg - The OOXML package
41
- * @param partPath - Path within the archive
42
- * @returns The binary content, or null if the part doesn't exist
43
- */
44
- export declare function getPartBinary(pkg: OoxmlPackage, partPath: string): Promise<ArrayBuffer | null>;
45
- /**
46
- * Parse core document properties from docProps/core.xml.
47
- *
48
- * @param pkg - The OOXML package
49
- * @returns Parsed core properties (all fields optional)
50
- */
51
- export declare function getCoreProperties(pkg: OoxmlPackage): Promise<CoreProperties>;
52
- //# sourceMappingURL=reader.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"reader.d.ts","sourceRoot":"","sources":["../../src/ooxml/reader.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAkB,YAAY,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAO7F;;;;;;;GAOG;AACH,wBAAsB,WAAW,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,GAAG,OAAO,CAAC,YAAY,CAAC,CAMjF;AA+CD;;;;;;;GAOG;AACH,wBAAsB,oBAAoB,CACxC,GAAG,EAAE,YAAY,EACjB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,YAAY,EAAE,CAAC,CAEzB;AA6DD;;;;;;GAMG;AACH,wBAAsB,UAAU,CAAC,GAAG,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAM9F;AAED;;;;;;GAMG;AACH,wBAAsB,aAAa,CACjC,GAAG,EAAE,YAAY,EACjB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAI7B;AAMD;;;;;GAKG;AACH,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,YAAY,GAAG,OAAO,CAAC,cAAc,CAAC,CAuBlF"}
@@ -1,190 +0,0 @@
1
- /**
2
- * OOXML Package Reader
3
- *
4
- * Opens OOXML archives (.docx, .pptx, .xlsx) and parses their
5
- * structural metadata: [Content_Types].xml, relationships, and
6
- * core properties.
7
- *
8
- * Uses JSZip to unzip and the browser's DOMParser to parse XML.
9
- */
10
- import JSZip from 'jszip';
11
- import { NS_RELATIONSHIPS, NS_DC, NS_DCTERMS, NS_CORE_PROPERTIES } from './namespaces.js';
12
- // ============================================
13
- // Package Opening
14
- // ============================================
15
- /**
16
- * Open an OOXML package from raw data.
17
- *
18
- * Parses the ZIP archive, [Content_Types].xml, and root relationships.
19
- *
20
- * @param data - The raw .docx/.pptx/.xlsx file as ArrayBuffer or Blob
21
- * @returns A parsed OoxmlPackage
22
- */
23
- export async function openPackage(data) {
24
- const zip = await JSZip.loadAsync(data);
25
- const contentTypes = await parseContentTypes(zip);
26
- const rootRelationships = await parseRelationships(zip, '');
27
- return { zip, contentTypes, rootRelationships };
28
- }
29
- // ============================================
30
- // Content Types
31
- // ============================================
32
- /**
33
- * Parse [Content_Types].xml from the archive.
34
- */
35
- async function parseContentTypes(zip) {
36
- const overrides = new Map();
37
- const defaults = new Map();
38
- const file = zip.file('[Content_Types].xml');
39
- if (!file)
40
- return { overrides, defaults };
41
- const text = await file.async('text');
42
- const doc = new DOMParser().parseFromString(text, 'application/xml');
43
- // Parse <Default Extension="rels" ContentType="..." />
44
- const defaultEls = doc.getElementsByTagName('Default');
45
- for (let i = 0; i < defaultEls.length; i++) {
46
- const el = defaultEls[i];
47
- const ext = el.getAttribute('Extension');
48
- const ct = el.getAttribute('ContentType');
49
- if (ext && ct)
50
- defaults.set(ext, ct);
51
- }
52
- // Parse <Override PartName="/word/document.xml" ContentType="..." />
53
- const overrideEls = doc.getElementsByTagName('Override');
54
- for (let i = 0; i < overrideEls.length; i++) {
55
- const el = overrideEls[i];
56
- const partName = el.getAttribute('PartName');
57
- const ct = el.getAttribute('ContentType');
58
- if (partName && ct) {
59
- // Normalize: strip leading slash
60
- overrides.set(partName.replace(/^\//, ''), ct);
61
- }
62
- }
63
- return { overrides, defaults };
64
- }
65
- // ============================================
66
- // Relationships
67
- // ============================================
68
- /**
69
- * Parse relationships for a specific part.
70
- *
71
- * @param pkg - The OOXML package (or the zip directly)
72
- * @param partPath - The part path (e.g., "word/document.xml").
73
- * Use "" for root-level relationships (_rels/.rels).
74
- * @returns Array of relationship entries
75
- */
76
- export async function getPartRelationships(pkg, partPath) {
77
- return parseRelationships(pkg.zip, partPath);
78
- }
79
- /**
80
- * Parse a _rels/*.rels file from the ZIP.
81
- *
82
- * For root relationships, relsPath = "_rels/.rels".
83
- * For part relationships, relsPath = "<dir>/_rels/<filename>.rels".
84
- */
85
- async function parseRelationships(zip, partPath) {
86
- const relsPath = partPath === '' ? '_rels/.rels' : buildRelsPath(partPath);
87
- const file = zip.file(relsPath);
88
- if (!file)
89
- return [];
90
- const text = await file.async('text');
91
- const doc = new DOMParser().parseFromString(text, 'application/xml');
92
- const result = [];
93
- const els = doc.getElementsByTagNameNS(NS_RELATIONSHIPS, 'Relationship');
94
- // Fallback in case namespace isn't used (some generators omit it)
95
- const fallbackEls = els.length > 0 ? els : doc.getElementsByTagName('Relationship');
96
- for (let i = 0; i < fallbackEls.length; i++) {
97
- const el = fallbackEls[i];
98
- const id = el.getAttribute('Id');
99
- const type = el.getAttribute('Type');
100
- const target = el.getAttribute('Target');
101
- if (id && type && target) {
102
- const targetMode = el.getAttribute('TargetMode');
103
- result.push({
104
- id,
105
- type,
106
- target,
107
- ...(targetMode ? { targetMode } : {}),
108
- });
109
- }
110
- }
111
- return result;
112
- }
113
- /**
114
- * Build the _rels path for a given part path.
115
- *
116
- * "word/document.xml" → "word/_rels/document.xml.rels"
117
- * "xl/workbook.xml" → "xl/_rels/workbook.xml.rels"
118
- */
119
- function buildRelsPath(partPath) {
120
- const lastSlash = partPath.lastIndexOf('/');
121
- if (lastSlash === -1) {
122
- return `_rels/${partPath}.rels`;
123
- }
124
- const dir = partPath.substring(0, lastSlash);
125
- const file = partPath.substring(lastSlash + 1);
126
- return `${dir}/_rels/${file}.rels`;
127
- }
128
- // ============================================
129
- // Part Access
130
- // ============================================
131
- /**
132
- * Extract an XML part from the package and parse it as a DOM Document.
133
- *
134
- * @param pkg - The OOXML package
135
- * @param partPath - Path within the archive (e.g., "word/document.xml")
136
- * @returns Parsed XML Document, or null if the part doesn't exist
137
- */
138
- export async function getPartXml(pkg, partPath) {
139
- const file = pkg.zip.file(partPath);
140
- if (!file)
141
- return null;
142
- const text = await file.async('text');
143
- return new DOMParser().parseFromString(text, 'application/xml');
144
- }
145
- /**
146
- * Extract a binary part from the package (e.g., an image from word/media/).
147
- *
148
- * @param pkg - The OOXML package
149
- * @param partPath - Path within the archive
150
- * @returns The binary content, or null if the part doesn't exist
151
- */
152
- export async function getPartBinary(pkg, partPath) {
153
- const file = pkg.zip.file(partPath);
154
- if (!file)
155
- return null;
156
- return file.async('arraybuffer');
157
- }
158
- // ============================================
159
- // Core Properties
160
- // ============================================
161
- /**
162
- * Parse core document properties from docProps/core.xml.
163
- *
164
- * @param pkg - The OOXML package
165
- * @returns Parsed core properties (all fields optional)
166
- */
167
- export async function getCoreProperties(pkg) {
168
- const doc = await getPartXml(pkg, 'docProps/core.xml');
169
- if (!doc)
170
- return {};
171
- function getText(ns, localName) {
172
- const els = doc.getElementsByTagNameNS(ns, localName);
173
- if (els.length > 0 && els[0].textContent) {
174
- return els[0].textContent;
175
- }
176
- return undefined;
177
- }
178
- return {
179
- title: getText(NS_DC, 'title'),
180
- subject: getText(NS_DC, 'subject'),
181
- creator: getText(NS_DC, 'creator'),
182
- description: getText(NS_DC, 'description'),
183
- keywords: getText(NS_CORE_PROPERTIES, 'keywords'),
184
- lastModifiedBy: getText(NS_CORE_PROPERTIES, 'lastModifiedBy'),
185
- revision: getText(NS_CORE_PROPERTIES, 'revision'),
186
- created: getText(NS_DCTERMS, 'created'),
187
- modified: getText(NS_DCTERMS, 'modified'),
188
- };
189
- }
190
- //# sourceMappingURL=reader.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"reader.js","sourceRoot":"","sources":["../../src/ooxml/reader.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE1F,+CAA+C;AAC/C,kBAAkB;AAClB,+CAA+C;AAE/C;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,IAAwB;IACxD,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IACxC,MAAM,YAAY,GAAG,MAAM,iBAAiB,CAAC,GAAG,CAAC,CAAC;IAClD,MAAM,iBAAiB,GAAG,MAAM,kBAAkB,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IAE5D,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,iBAAiB,EAAE,CAAC;AAClD,CAAC;AAED,+CAA+C;AAC/C,gBAAgB;AAChB,+CAA+C;AAE/C;;GAEG;AACH,KAAK,UAAU,iBAAiB,CAAC,GAAU;IACzC,MAAM,SAAS,GAAG,IAAI,GAAG,EAAkB,CAAC;IAC5C,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAkB,CAAC;IAE3C,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;IAC7C,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC;IAE1C,MAAM,IAAI,GAAG,MAAM,IAAI,CA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,EAAE,OAAO,CAAC,kBAAkB,EAAE,UAAU,CAAC;QACjD,OAAO,EAAE,OAAO,CAAC,UAAU,EAAE,SAAS,CAAC;QACvC,QAAQ,EAAE,OAAO,CAAC,UAAU,EAAE,UAAU,CAAC;KAC1C,CAAC;AACJ,CAAC"}
@@ -1,82 +0,0 @@
1
- /**
2
- * OOXML Types
3
- *
4
- * Shared type definitions for all Office Open XML formats (DOCX, PPTX, XLSX).
5
- * These model the common structural elements of the OOXML package format:
6
- * ZIP archive, relationships, content types, and core properties.
7
- */
8
- import type JSZip from 'jszip';
9
- /**
10
- * An opened OOXML package — wraps the JSZip archive plus parsed
11
- * structural metadata (content types, root relationships).
12
- */
13
- export interface OoxmlPackage {
14
- /** The underlying JSZip archive */
15
- zip: JSZip;
16
- /** Parsed [Content_Types].xml entries */
17
- contentTypes: ContentTypeMap;
18
- /** Root-level relationships (_rels/.rels) */
19
- rootRelationships: Relationship[];
20
- }
21
- /**
22
- * Content type map built from [Content_Types].xml.
23
- * Maps part paths → content type strings plus extension defaults.
24
- */
25
- export interface ContentTypeMap {
26
- /** Explicit overrides: partName → contentType */
27
- overrides: Map<string, string>;
28
- /** Default extensions: extension → contentType */
29
- defaults: Map<string, string>;
30
- }
31
- /**
32
- * An OOXML relationship entry (from any _rels/*.rels file).
33
- */
34
- export interface Relationship {
35
- /** Relationship ID (e.g., "rId1") */
36
- id: string;
37
- /** Relationship type URI (e.g., "http://...officedocument/...") */
38
- type: string;
39
- /** Target path or URL */
40
- target: string;
41
- /** "Internal" (default) or "External" for hyperlinks */
42
- targetMode?: 'Internal' | 'External';
43
- }
44
- /**
45
- * Document core properties from docProps/core.xml (Dublin Core metadata).
46
- */
47
- export interface CoreProperties {
48
- title?: string;
49
- subject?: string;
50
- creator?: string;
51
- keywords?: string;
52
- description?: string;
53
- lastModifiedBy?: string;
54
- revision?: string;
55
- created?: string;
56
- modified?: string;
57
- }
58
- /**
59
- * A part (file) that will be written into an OOXML package.
60
- */
61
- export interface PackagePart {
62
- /** Path within the ZIP (e.g., "word/document.xml") */
63
- path: string;
64
- /** XML or text content (mutually exclusive with binaryContent) */
65
- content?: string;
66
- /** Binary content (mutually exclusive with content) */
67
- binaryContent?: ArrayBuffer | Uint8Array;
68
- /** MIME content type for [Content_Types].xml */
69
- contentType: string;
70
- }
71
- /**
72
- * A relationship to be written into a _rels/*.rels file.
73
- * `sourcePart` identifies which part the relationship belongs to.
74
- * Use "" (empty string) for root-level relationships (_rels/.rels).
75
- */
76
- export interface PendingRelationship {
77
- /** The part this relationship belongs to ("" for root) */
78
- sourcePart: string;
79
- /** The relationship entry */
80
- relationship: Relationship;
81
- }
82
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/ooxml/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,mCAAmC;IACnC,GAAG,EAAE,KAAK,CAAC;IACX,yCAAyC;IACzC,YAAY,EAAE,cAAc,CAAC;IAC7B,6CAA6C;IAC7C,iBAAiB,EAAE,YAAY,EAAE,CAAC;CACnC;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,iDAAiD;IACjD,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,kDAAkD;IAClD,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B;AAMD;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,qCAAqC;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,mEAAmE;IACnE,IAAI,EAAE,MAAM,CAAC;IACb,yBAAyB;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,wDAAwD;IACxD,UAAU,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;CACtC;AAMD;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAMD;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,sDAAsD;IACtD,IAAI,EAAE,MAAM,CAAC;IACb,kEAAkE;IAClE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,uDAAuD;IACvD,aAAa,CAAC,EAAE,WAAW,GAAG,UAAU,CAAC;IACzC,gDAAgD;IAChD,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,0DAA0D;IAC1D,UAAU,EAAE,MAAM,CAAC;IACnB,6BAA6B;IAC7B,YAAY,EAAE,YAAY,CAAC;CAC5B"}
@@ -1,9 +0,0 @@
1
- /**
2
- * OOXML Types
3
- *
4
- * Shared type definitions for all Office Open XML formats (DOCX, PPTX, XLSX).
5
- * These model the common structural elements of the OOXML package format:
6
- * ZIP archive, relationships, content types, and core properties.
7
- */
8
- export {};
9
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/ooxml/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
@@ -1,71 +0,0 @@
1
- /**
2
- * OOXML Package Writer
3
- *
4
- * Builds OOXML archives (.docx, .pptx, .xlsx) from parts.
5
- * Handles automatic generation of [Content_Types].xml and
6
- * _rels/*.rels files from the registered parts and relationships.
7
- */
8
- import type { CoreProperties, Relationship } from './types.js';
9
- /**
10
- * Mutable builder for constructing an OOXML package.
11
- *
12
- * Add parts, relationships, and core properties, then call `toBlob()`
13
- * or `toArrayBuffer()` to produce the final ZIP archive.
14
- *
15
- * @example
16
- * ```ts
17
- * const builder = createPackage();
18
- * builder.addPart('word/document.xml', documentXml, CONTENT_TYPE_DOCX_DOCUMENT);
19
- * builder.addRelationship('', {
20
- * id: 'rId1',
21
- * type: REL_OFFICE_DOCUMENT,
22
- * target: 'word/document.xml',
23
- * });
24
- * const blob = await builder.toBlob();
25
- * ```
26
- */
27
- export interface OoxmlPackageBuilder {
28
- /**
29
- * Add an XML or text part to the package.
30
- *
31
- * @param path - Path within the archive (e.g., "word/document.xml")
32
- * @param content - XML string content
33
- * @param contentType - MIME content type for [Content_Types].xml
34
- */
35
- addPart(path: string, content: string, contentType: string): void;
36
- /**
37
- * Add a binary part to the package (e.g., an image).
38
- *
39
- * @param path - Path within the archive (e.g., "word/media/image1.png")
40
- * @param data - Binary content
41
- * @param contentType - MIME content type (e.g., "image/png")
42
- */
43
- addBinaryPart(path: string, data: ArrayBuffer | Uint8Array, contentType: string): void;
44
- /**
45
- * Register a relationship.
46
- *
47
- * @param sourcePart - The part this relationship belongs to (e.g., "word/document.xml").
48
- * Use "" (empty string) for root-level relationships (_rels/.rels).
49
- * @param rel - The relationship entry
50
- */
51
- addRelationship(sourcePart: string, rel: Relationship): void;
52
- /**
53
- * Set core document properties (docProps/core.xml).
54
- * Calling this multiple times overwrites previous values.
55
- */
56
- setCoreProperties(props: CoreProperties): void;
57
- /**
58
- * Assemble the final OOXML package as a Blob.
59
- * Generates [Content_Types].xml and all _rels/*.rels files automatically.
60
- */
61
- toBlob(): Promise<Blob>;
62
- /**
63
- * Assemble the final OOXML package as an ArrayBuffer.
64
- */
65
- toArrayBuffer(): Promise<ArrayBuffer>;
66
- }
67
- /**
68
- * Create a new OOXML package builder.
69
- */
70
- export declare function createPackage(): OoxmlPackageBuilder;
71
- //# sourceMappingURL=writer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"writer.d.ts","sourceRoot":"","sources":["../../src/ooxml/writer.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAoC,YAAY,EAAE,MAAM,YAAY,CAAC;AAkBjG;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;;;OAMG;IACH,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAElE;;;;;;OAMG;IACH,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,GAAG,UAAU,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAEvF;;;;;;OAMG;IACH,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,YAAY,GAAG,IAAI,CAAC;IAE7D;;;OAGG;IACH,iBAAiB,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI,CAAC;IAE/C;;;OAGG;IACH,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAExB;;OAEG;IACH,aAAa,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC;CACvC;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,mBAAmB,CAgCnD"}