documents.js 1.61.0 → 1.63.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 (236) hide show
  1. package/README.md +120 -47
  2. package/dist/{blr-types-CYYC3yYU.d.cts → blr-types-DVgO1DQ9.d.cts} +1 -1
  3. package/dist/{blr-types-CYYC3yYU.d.ts → blr-types-DVgO1DQ9.d.ts} +1 -1
  4. package/dist/convert/capability.cjs +1 -0
  5. package/dist/convert/capability.d.cts +1 -1
  6. package/dist/convert/capability.d.ts +1 -1
  7. package/dist/convert/capability.js +1 -0
  8. package/dist/convert/convert.cjs +92 -38
  9. package/dist/convert/convert.d.cts +11 -4
  10. package/dist/convert/convert.d.ts +11 -4
  11. package/dist/convert/convert.js +93 -39
  12. package/dist/convert/local.cjs +15 -2
  13. package/dist/convert/local.js +15 -2
  14. package/dist/convert/port.d.cts +8 -4
  15. package/dist/convert/port.d.ts +8 -4
  16. package/dist/edit/docx/content.cjs +75 -13
  17. package/dist/edit/docx/content.d.cts +8 -2
  18. package/dist/edit/docx/content.d.ts +8 -2
  19. package/dist/edit/docx/content.js +75 -13
  20. package/dist/edit/docx/paragraph.cjs +14 -0
  21. package/dist/edit/docx/paragraph.d.cts +5 -0
  22. package/dist/edit/docx/paragraph.d.ts +5 -0
  23. package/dist/edit/docx/paragraph.js +14 -0
  24. package/dist/edit/docx/run.cjs +1 -1
  25. package/dist/edit/docx/run.js +1 -1
  26. package/dist/edit/docx/table.cjs +41 -0
  27. package/dist/edit/docx/table.d.cts +7 -1
  28. package/dist/edit/docx/table.d.ts +7 -1
  29. package/dist/edit/docx/table.js +42 -1
  30. package/dist/edit/geometry.cjs +38 -0
  31. package/dist/edit/geometry.d.cts +7 -0
  32. package/dist/edit/geometry.d.ts +7 -0
  33. package/dist/edit/geometry.js +36 -0
  34. package/dist/edit/odg/content.cjs +15 -12
  35. package/dist/edit/odg/content.js +15 -12
  36. package/dist/edit/odg/editor.d.cts +1 -1
  37. package/dist/edit/odg/editor.d.ts +1 -1
  38. package/dist/edit/odg/page.d.cts +3 -3
  39. package/dist/edit/odg/page.d.ts +3 -3
  40. package/dist/edit/odg/vector.cjs +22 -13
  41. package/dist/edit/odg/vector.d.cts +1 -1
  42. package/dist/edit/odg/vector.d.ts +1 -1
  43. package/dist/edit/odg/vector.js +23 -14
  44. package/dist/edit/odp/content.cjs +15 -0
  45. package/dist/edit/odp/content.js +16 -1
  46. package/dist/edit/odp/editor.d.cts +1 -1
  47. package/dist/edit/odp/editor.d.ts +1 -1
  48. package/dist/edit/odp/image.d.cts +1 -1
  49. package/dist/edit/odp/image.d.ts +1 -1
  50. package/dist/edit/odp/shape.cjs +11 -30
  51. package/dist/edit/odp/shape.d.cts +2 -2
  52. package/dist/edit/odp/shape.d.ts +2 -2
  53. package/dist/edit/odp/shape.js +13 -33
  54. package/dist/edit/odp/slide.cjs +11 -0
  55. package/dist/edit/odp/slide.d.cts +14 -4
  56. package/dist/edit/odp/slide.d.ts +14 -4
  57. package/dist/edit/odp/slide.js +12 -1
  58. package/dist/edit/odt/content.cjs +56 -16
  59. package/dist/edit/odt/content.d.cts +4 -2
  60. package/dist/edit/odt/content.d.ts +4 -2
  61. package/dist/edit/odt/content.js +56 -17
  62. package/dist/edit/odt/editor.d.cts +1 -1
  63. package/dist/edit/odt/editor.d.ts +1 -1
  64. package/dist/edit/odt/table.cjs +36 -0
  65. package/dist/edit/odt/table.d.cts +1 -36
  66. package/dist/edit/odt/table.d.ts +1 -36
  67. package/dist/edit/odt/table.js +37 -1
  68. package/dist/edit/pptx/content.cjs +71 -3
  69. package/dist/edit/pptx/content.js +71 -3
  70. package/dist/edit/pptx/editor.d.cts +1 -1
  71. package/dist/edit/pptx/editor.d.ts +1 -1
  72. package/dist/edit/pptx/image.d.cts +1 -1
  73. package/dist/edit/pptx/image.d.ts +1 -1
  74. package/dist/edit/pptx/shape.cjs +23 -1
  75. package/dist/edit/pptx/shape.d.cts +2 -2
  76. package/dist/edit/pptx/shape.d.ts +2 -2
  77. package/dist/edit/pptx/shape.js +23 -3
  78. package/dist/edit/pptx/slide.cjs +10 -1
  79. package/dist/edit/pptx/slide.d.cts +11 -4
  80. package/dist/edit/pptx/slide.d.ts +11 -4
  81. package/dist/edit/pptx/slide.js +10 -1
  82. package/dist/edit/pptx/table.cjs +136 -0
  83. package/dist/edit/pptx/table.d.cts +2 -0
  84. package/dist/edit/pptx/table.d.ts +2 -0
  85. package/dist/edit/pptx/table.js +131 -0
  86. package/dist/firebird/backup.d.cts +1 -1
  87. package/dist/firebird/backup.d.ts +1 -1
  88. package/dist/firebird/blr-types.cjs +2 -2
  89. package/dist/firebird/blr-types.d.cts +1 -1
  90. package/dist/firebird/blr-types.d.ts +1 -1
  91. package/dist/firebird/blr-types.js +2 -2
  92. package/dist/firebird/data.cjs +68 -14
  93. package/dist/firebird/data.d.cts +1 -1
  94. package/dist/firebird/data.d.ts +1 -1
  95. package/dist/firebird/data.js +68 -14
  96. package/dist/firebird/schema.cjs +13 -1
  97. package/dist/firebird/schema.d.cts +1 -1
  98. package/dist/firebird/schema.d.ts +1 -1
  99. package/dist/firebird/schema.js +13 -1
  100. package/dist/fonts/obfuscation.cjs +50 -0
  101. package/dist/fonts/obfuscation.d.cts +9 -0
  102. package/dist/fonts/obfuscation.d.ts +9 -0
  103. package/dist/fonts/obfuscation.js +46 -0
  104. package/dist/fonts/odf.cjs +86 -0
  105. package/dist/fonts/odf.d.cts +9 -0
  106. package/dist/fonts/odf.d.ts +9 -0
  107. package/dist/fonts/odf.js +84 -0
  108. package/dist/fonts/ooxml.cjs +129 -0
  109. package/dist/fonts/ooxml.d.cts +9 -0
  110. package/dist/fonts/ooxml.d.ts +9 -0
  111. package/dist/fonts/ooxml.js +127 -0
  112. package/dist/fonts/registry.cjs +18 -0
  113. package/dist/fonts/registry.d.cts +2 -0
  114. package/dist/fonts/registry.d.ts +2 -0
  115. package/dist/fonts/registry.js +16 -0
  116. package/dist/{geometry-DvwdrIij.d.cts → geometry-DaJr8yQW.d.cts} +2 -2
  117. package/dist/{geometry-DvwdrIij.d.ts → geometry-DaJr8yQW.d.ts} +2 -2
  118. package/dist/hsqldb/binary-script.cjs +154 -0
  119. package/dist/hsqldb/binary-script.d.cts +15 -0
  120. package/dist/hsqldb/binary-script.d.ts +15 -0
  121. package/dist/hsqldb/binary-script.js +151 -0
  122. package/dist/hsqldb/cache.cjs +18 -11
  123. package/dist/hsqldb/cache.d.cts +9 -4
  124. package/dist/hsqldb/cache.d.ts +9 -4
  125. package/dist/hsqldb/cache.js +18 -11
  126. package/dist/hsqldb/rowformat.cjs +60 -16
  127. package/dist/hsqldb/rowformat.d.cts +2 -21
  128. package/dist/hsqldb/rowformat.d.ts +2 -21
  129. package/dist/hsqldb/rowformat.js +60 -17
  130. package/dist/{image-BZDy72Jb.d.cts → image-7snmKIxn.d.cts} +1 -1
  131. package/dist/{image-B-xQWYYS.d.ts → image-Cs8xF753.d.ts} +1 -1
  132. package/dist/{image-CeqwL-Qs.d.ts → image-DHcA9kaK.d.ts} +1 -1
  133. package/dist/{image-DWX6cNOD.d.cts → image-M5SezZVI.d.cts} +1 -1
  134. package/dist/index.cjs +86 -3
  135. package/dist/index.d.cts +33 -21
  136. package/dist/index.d.ts +33 -21
  137. package/dist/index.js +18 -5
  138. package/dist/layout/cell-typing.cjs +209 -0
  139. package/dist/layout/cell-typing.d.cts +22 -0
  140. package/dist/layout/cell-typing.d.ts +22 -0
  141. package/dist/layout/cell-typing.js +208 -0
  142. package/dist/layout/drawing.cjs +193 -17
  143. package/dist/layout/drawing.js +193 -17
  144. package/dist/layout/engine.cjs +46 -29
  145. package/dist/layout/engine.d.cts +0 -2
  146. package/dist/layout/engine.d.ts +0 -2
  147. package/dist/layout/engine.js +47 -30
  148. package/dist/layout/lattice.cjs +139 -0
  149. package/dist/layout/lattice.d.cts +20 -0
  150. package/dist/layout/lattice.d.ts +20 -0
  151. package/dist/layout/lattice.js +135 -0
  152. package/dist/layout/reconstruct.cjs +176 -113
  153. package/dist/layout/reconstruct.d.cts +2 -0
  154. package/dist/layout/reconstruct.d.ts +2 -0
  155. package/dist/layout/reconstruct.js +173 -110
  156. package/dist/layout/shared.cjs +52 -0
  157. package/dist/layout/shared.d.cts +4 -2
  158. package/dist/layout/shared.d.ts +4 -2
  159. package/dist/layout/shared.js +51 -1
  160. package/dist/layout/sheets.cjs +45 -11
  161. package/dist/layout/sheets.js +46 -12
  162. package/dist/layout/slides.cjs +7 -7
  163. package/dist/layout/slides.d.cts +0 -3
  164. package/dist/layout/slides.d.ts +0 -3
  165. package/dist/layout/slides.js +7 -7
  166. package/dist/markdown/write.cjs +19 -6
  167. package/dist/markdown/write.js +19 -6
  168. package/dist/mathml/layout.cjs +2 -2
  169. package/dist/mathml/layout.d.cts +1 -1
  170. package/dist/mathml/layout.d.ts +1 -1
  171. package/dist/mathml/layout.js +2 -2
  172. package/dist/model/embedded-drawing.cjs +32 -0
  173. package/dist/model/embedded-drawing.d.cts +8 -0
  174. package/dist/model/embedded-drawing.d.ts +8 -0
  175. package/dist/model/embedded-drawing.js +30 -0
  176. package/dist/model/formula.cjs +31 -0
  177. package/dist/model/formula.d.cts +6 -6
  178. package/dist/model/formula.d.ts +6 -6
  179. package/dist/model/formula.js +27 -0
  180. package/dist/model/geometry.d.cts +1 -1
  181. package/dist/model/geometry.d.ts +1 -1
  182. package/dist/model/paint-order.cjs +15 -0
  183. package/dist/model/paint-order.d.cts +14 -0
  184. package/dist/model/paint-order.d.ts +14 -0
  185. package/dist/model/paint-order.js +14 -0
  186. package/dist/odb/components.cjs +12 -0
  187. package/dist/odb/components.d.cts +6 -0
  188. package/dist/odb/components.d.ts +6 -0
  189. package/dist/odb/components.js +10 -0
  190. package/dist/odb/read.cjs +11 -7
  191. package/dist/odb/read.d.cts +3 -2
  192. package/dist/odb/read.d.ts +3 -2
  193. package/dist/odb/read.js +11 -7
  194. package/dist/odf/formula/detect.cjs +86 -18
  195. package/dist/odf/formula/detect.d.cts +10 -6
  196. package/dist/odf/formula/detect.d.ts +10 -6
  197. package/dist/odf/formula/detect.js +86 -19
  198. package/dist/odf/formula/read.cjs +4 -16
  199. package/dist/odf/formula/read.d.cts +4 -8
  200. package/dist/odf/formula/read.d.ts +4 -8
  201. package/dist/odf/formula/read.js +5 -17
  202. package/dist/odf/odp/read.cjs +9 -19
  203. package/dist/odf/odp/read.d.cts +2 -7
  204. package/dist/odf/odp/read.d.ts +2 -7
  205. package/dist/odf/odp/read.js +10 -20
  206. package/dist/odf/odt/read.cjs +63 -23
  207. package/dist/odf/odt/read.d.cts +2 -7
  208. package/dist/odf/odt/read.d.ts +2 -7
  209. package/dist/odf/odt/read.js +64 -24
  210. package/dist/omml/write.cjs +258 -0
  211. package/dist/omml/write.d.cts +2 -0
  212. package/dist/omml/write.d.ts +2 -0
  213. package/dist/omml/write.js +256 -0
  214. package/dist/registry-CrSqLIcn.d.ts +19 -0
  215. package/dist/registry-CtPhMD0f.d.cts +19 -0
  216. package/dist/rowformat-Cl2exlEh.d.cts +25 -0
  217. package/dist/rowformat-Cl2exlEh.d.ts +25 -0
  218. package/dist/{schema-Acco3Ezi.d.cts → schema-BeR_KJ0X.d.cts} +3 -1
  219. package/dist/{schema-VkAA6pF5.d.ts → schema-CSKwSb_v.d.ts} +3 -1
  220. package/dist/{shape-BUfjw5eZ.d.cts → shape-BhkP6HB8.d.cts} +6 -2
  221. package/dist/{shape-CTkl6kt8.d.ts → shape-BkVcwPcf.d.ts} +6 -2
  222. package/dist/{shape-BfN3m52m.d.ts → shape-CVXedeL7.d.ts} +3 -2
  223. package/dist/{shape-CN2ycxOo.d.cts → shape-CXZ6fejV.d.cts} +3 -2
  224. package/dist/table-C3CPZ--2.d.cts +35 -0
  225. package/dist/table-DjYcNOFm.d.cts +44 -0
  226. package/dist/table-DqfqMkVq.d.ts +44 -0
  227. package/dist/table-DvS_7UQS.d.ts +35 -0
  228. package/dist/{vector-ClohqsOe.d.cts → vector-Puuqu_IT.d.cts} +4 -0
  229. package/dist/{vector-ClohqsOe.d.ts → vector-Puuqu_IT.d.ts} +4 -0
  230. package/dist/write-DuyfnbL_.d.cts +16 -0
  231. package/dist/write-Zqwx6pka.d.ts +16 -0
  232. package/package.json +4 -4
  233. package/dist/odf/formula/placeholder.cjs +0 -36
  234. package/dist/odf/formula/placeholder.d.cts +0 -14
  235. package/dist/odf/formula/placeholder.d.ts +0 -14
  236. package/dist/odf/formula/placeholder.js +0 -36
@@ -0,0 +1,10 @@
1
+ import { readOdbForm, readOdbInventory, readOdbReport } from "odf.js";
2
+ //#region src/odb/components.ts
3
+ function readOdbForms(pkg) {
4
+ return readOdbInventory(pkg).forms.map((component) => readOdbForm(pkg, component.name));
5
+ }
6
+ function readOdbReports(pkg) {
7
+ return readOdbInventory(pkg).reports.map((component) => readOdbReport(pkg, component.name));
8
+ }
9
+ //#endregion
10
+ export { readOdbForms, readOdbReports };
package/dist/odb/read.cjs CHANGED
@@ -1,5 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_hsqldb_script = require("../hsqldb/script.cjs");
3
+ const require_hsqldb_binary_script = require("../hsqldb/binary-script.cjs");
3
4
  const require_hsqldb_cache = require("../hsqldb/cache.cjs");
4
5
  const require_firebird_backup = require("../firebird/backup.cjs");
5
6
  let odf_js = require("odf.js");
@@ -44,7 +45,7 @@ function classifyScriptBytes(bytes) {
44
45
  }
45
46
  return "text";
46
47
  }
47
- function readOdbTables(pkg) {
48
+ function readOdbTables(pkg, options) {
48
49
  const inventory = (0, odf_js.readOdbInventory)(pkg);
49
50
  if (inventory.connection === void 0 || inventory.connection.type === "external") throw new OdbNoEmbeddedDataSourceError(inventory.connection?.url);
50
51
  const url = inventory.connection.url;
@@ -65,21 +66,24 @@ function readOdbTables(pkg) {
65
66
  if (scriptPart.kind !== "binary") throw new Error(`readOdbTables: ${DATABASE_SCRIPT_PART} is not a binary part (found kind "${scriptPart.kind}") -- malformed .odb package`);
66
67
  const scriptBytes = (0, odf_js.base64ToBytes)(scriptPart.base64);
67
68
  const classification = classifyScriptBytes(scriptBytes);
68
- if (classification === "compressed") throw new OdbUnsupportedFormatError("hsqldb-compressed", "HSQLDB's compressed whole-script format (hsqldb.script_format=3) -- a zlib-wrapped copy of the same length-prefixed binary DDL/DML statement encoding hsqldb.script_format=1 uses, not compressed SQL text");
69
- if (classification === "binary") throw new OdbUnsupportedFormatError("hsqldb-binary", "HSQLDB's binary whole-script format (hsqldb.script_format=1) -- a length-prefixed, COMMAND-tagged binary encoding of the script's own DDL/DML statements themselves, a materially different and larger undertaking than CACHED-table row-store decoding (Tier 2)");
70
- return withCachedTableRows(pkg, require_hsqldb_script.parseHsqldbScript(scriptBytes), scriptBytes);
69
+ if (classification !== "text") {
70
+ const binaryBytes = classification === "compressed" ? require_hsqldb_binary_script.inflateHsqldbCompressedScript(scriptBytes) : scriptBytes;
71
+ const { scriptText, tables } = require_hsqldb_binary_script.parseHsqldbBinaryScript(binaryBytes, options);
72
+ return withCachedTableRows(pkg, tables, scriptText, options);
73
+ }
74
+ const scriptText = new TextDecoder("utf-8", { fatal: true }).decode(scriptBytes);
75
+ return withCachedTableRows(pkg, require_hsqldb_script.parseHsqldbScript(scriptBytes), scriptText, options);
71
76
  }
72
- function withCachedTableRows(pkg, tables, scriptBytes) {
77
+ function withCachedTableRows(pkg, tables, scriptText, options) {
73
78
  const dataPart = pkg.parts[DATABASE_DATA_PART];
74
79
  if (dataPart === void 0) return tables;
75
80
  if (dataPart.kind !== "binary") throw new Error(`readOdbTables: ${DATABASE_DATA_PART} is not a binary part (found kind "${dataPart.kind}") -- malformed .odb package`);
76
81
  const propertiesPart = pkg.parts[DATABASE_PROPERTIES_PART];
77
82
  if (propertiesPart === void 0) throw new Error(`readOdbTables: ${DATABASE_DATA_PART} is present but ${DATABASE_PROPERTIES_PART} is not -- malformed .odb package (a CACHED-table row store always ships alongside its own properties file, which this decoder needs for the cache file's own scale)`);
78
83
  if (propertiesPart.kind !== "binary") throw new Error(`readOdbTables: ${DATABASE_PROPERTIES_PART} is not a binary part (found kind "${propertiesPart.kind}") -- malformed .odb package`);
79
- const scriptText = new TextDecoder("utf-8", { fatal: true }).decode(scriptBytes);
80
84
  const dataBytes = (0, odf_js.base64ToBytes)(dataPart.base64);
81
85
  const propertiesText = new TextDecoder("utf-8", { fatal: true }).decode((0, odf_js.base64ToBytes)(propertiesPart.base64));
82
- return require_hsqldb_cache.decodeHsqldbCachedTables(tables, scriptText, dataBytes, propertiesText);
86
+ return require_hsqldb_cache.decodeHsqldbCachedTables(tables, scriptText, dataBytes, propertiesText, options);
83
87
  }
84
88
  //#endregion
85
89
  exports.OdbNoEmbeddedDataSourceError = OdbNoEmbeddedDataSourceError;
@@ -1,3 +1,4 @@
1
+ import { n as HsqldbDecodeOptions } from "../rowformat-Cl2exlEh.cjs";
1
2
  import { HsqldbTable } from "../hsqldb/script.cjs";
2
3
  import { Package } from "odf.js";
3
4
  //#region src/odb/read.d.ts
@@ -5,11 +6,11 @@ declare class OdbNoEmbeddedDataSourceError extends Error {
5
6
  readonly url: string | undefined;
6
7
  constructor(url: string | undefined);
7
8
  }
8
- type OdbUnsupportedFormat = 'hsqldb-binary' | 'hsqldb-compressed' | 'unrecognised-engine';
9
+ type OdbUnsupportedFormat = 'unrecognised-engine';
9
10
  declare class OdbUnsupportedFormatError extends Error {
10
11
  readonly format: OdbUnsupportedFormat;
11
12
  constructor(format: OdbUnsupportedFormat, detail: string);
12
13
  }
13
- declare function readOdbTables(pkg: Package): readonly HsqldbTable[];
14
+ declare function readOdbTables(pkg: Package, options?: HsqldbDecodeOptions): readonly HsqldbTable[];
14
15
  //#endregion
15
16
  export { OdbNoEmbeddedDataSourceError, OdbUnsupportedFormat, OdbUnsupportedFormatError, readOdbTables };
@@ -1,3 +1,4 @@
1
+ import { n as HsqldbDecodeOptions } from "../rowformat-Cl2exlEh.js";
1
2
  import { HsqldbTable } from "../hsqldb/script.js";
2
3
  import { Package } from "odf.js";
3
4
  //#region src/odb/read.d.ts
@@ -5,11 +6,11 @@ declare class OdbNoEmbeddedDataSourceError extends Error {
5
6
  readonly url: string | undefined;
6
7
  constructor(url: string | undefined);
7
8
  }
8
- type OdbUnsupportedFormat = 'hsqldb-binary' | 'hsqldb-compressed' | 'unrecognised-engine';
9
+ type OdbUnsupportedFormat = 'unrecognised-engine';
9
10
  declare class OdbUnsupportedFormatError extends Error {
10
11
  readonly format: OdbUnsupportedFormat;
11
12
  constructor(format: OdbUnsupportedFormat, detail: string);
12
13
  }
13
- declare function readOdbTables(pkg: Package): readonly HsqldbTable[];
14
+ declare function readOdbTables(pkg: Package, options?: HsqldbDecodeOptions): readonly HsqldbTable[];
14
15
  //#endregion
15
16
  export { OdbNoEmbeddedDataSourceError, OdbUnsupportedFormat, OdbUnsupportedFormatError, readOdbTables };
package/dist/odb/read.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { readManifest } from "../odf-package/manifest.js";
2
2
  import { parseHsqldbScript } from "../hsqldb/script.js";
3
+ import { inflateHsqldbCompressedScript, parseHsqldbBinaryScript } from "../hsqldb/binary-script.js";
3
4
  import { decodeHsqldbCachedTables } from "../hsqldb/cache.js";
4
5
  import { readFirebirdBackup } from "../firebird/backup.js";
5
6
  import { base64ToBytes, readOdbInventory } from "odf.js";
@@ -44,7 +45,7 @@ function classifyScriptBytes(bytes) {
44
45
  }
45
46
  return "text";
46
47
  }
47
- function readOdbTables(pkg) {
48
+ function readOdbTables(pkg, options) {
48
49
  const inventory = readOdbInventory(pkg);
49
50
  if (inventory.connection === void 0 || inventory.connection.type === "external") throw new OdbNoEmbeddedDataSourceError(inventory.connection?.url);
50
51
  const url = inventory.connection.url;
@@ -65,21 +66,24 @@ function readOdbTables(pkg) {
65
66
  if (scriptPart.kind !== "binary") throw new Error(`readOdbTables: ${DATABASE_SCRIPT_PART} is not a binary part (found kind "${scriptPart.kind}") -- malformed .odb package`);
66
67
  const scriptBytes = base64ToBytes(scriptPart.base64);
67
68
  const classification = classifyScriptBytes(scriptBytes);
68
- if (classification === "compressed") throw new OdbUnsupportedFormatError("hsqldb-compressed", "HSQLDB's compressed whole-script format (hsqldb.script_format=3) -- a zlib-wrapped copy of the same length-prefixed binary DDL/DML statement encoding hsqldb.script_format=1 uses, not compressed SQL text");
69
- if (classification === "binary") throw new OdbUnsupportedFormatError("hsqldb-binary", "HSQLDB's binary whole-script format (hsqldb.script_format=1) -- a length-prefixed, COMMAND-tagged binary encoding of the script's own DDL/DML statements themselves, a materially different and larger undertaking than CACHED-table row-store decoding (Tier 2)");
70
- return withCachedTableRows(pkg, parseHsqldbScript(scriptBytes), scriptBytes);
69
+ if (classification !== "text") {
70
+ const binaryBytes = classification === "compressed" ? inflateHsqldbCompressedScript(scriptBytes) : scriptBytes;
71
+ const { scriptText, tables } = parseHsqldbBinaryScript(binaryBytes, options);
72
+ return withCachedTableRows(pkg, tables, scriptText, options);
73
+ }
74
+ const scriptText = new TextDecoder("utf-8", { fatal: true }).decode(scriptBytes);
75
+ return withCachedTableRows(pkg, parseHsqldbScript(scriptBytes), scriptText, options);
71
76
  }
72
- function withCachedTableRows(pkg, tables, scriptBytes) {
77
+ function withCachedTableRows(pkg, tables, scriptText, options) {
73
78
  const dataPart = pkg.parts[DATABASE_DATA_PART];
74
79
  if (dataPart === void 0) return tables;
75
80
  if (dataPart.kind !== "binary") throw new Error(`readOdbTables: ${DATABASE_DATA_PART} is not a binary part (found kind "${dataPart.kind}") -- malformed .odb package`);
76
81
  const propertiesPart = pkg.parts[DATABASE_PROPERTIES_PART];
77
82
  if (propertiesPart === void 0) throw new Error(`readOdbTables: ${DATABASE_DATA_PART} is present but ${DATABASE_PROPERTIES_PART} is not -- malformed .odb package (a CACHED-table row store always ships alongside its own properties file, which this decoder needs for the cache file's own scale)`);
78
83
  if (propertiesPart.kind !== "binary") throw new Error(`readOdbTables: ${DATABASE_PROPERTIES_PART} is not a binary part (found kind "${propertiesPart.kind}") -- malformed .odb package`);
79
- const scriptText = new TextDecoder("utf-8", { fatal: true }).decode(scriptBytes);
80
84
  const dataBytes = base64ToBytes(dataPart.base64);
81
85
  const propertiesText = new TextDecoder("utf-8", { fatal: true }).decode(base64ToBytes(propertiesPart.base64));
82
- return decodeHsqldbCachedTables(tables, scriptText, dataBytes, propertiesText);
86
+ return decodeHsqldbCachedTables(tables, scriptText, dataBytes, propertiesText, options);
83
87
  }
84
88
  //#endregion
85
89
  export { OdbNoEmbeddedDataSourceError, OdbUnsupportedFormatError, readOdbTables };
@@ -5,25 +5,93 @@ let odf_js = require("odf.js");
5
5
  function subPackagePathFromHref(href) {
6
6
  return href.replace(/^#?\.\//, "");
7
7
  }
8
- function detectEmbeddedFormulaFrames(containerChildren, pkg) {
9
- const out = [];
10
- for (const child of containerChildren) {
11
- if (child.type !== "element" || child.tag !== "draw:frame") continue;
12
- const objectElement = (0, odf_js.childrenWithTag)(child, "draw:object")[0];
13
- if (objectElement === void 0) continue;
14
- const href = (0, odf_js.attrValue)(objectElement, "xlink:href");
15
- if (href === void 0) continue;
16
- const formula = require_odf_formula_read.readOdfEmbeddedFormula(pkg, subPackagePathFromHref(href));
17
- if (formula === void 0) continue;
18
- const shape = (0, odf_js.readDrawFrame)(child, [], pkg);
19
- if (shape === void 0) continue;
20
- out.push({
21
- frameElement: child,
22
- formula,
23
- frame: shape.frame
24
- });
8
+ function formulaOfFrame(frame, pkg) {
9
+ const objectElement = (0, odf_js.childrenWithTag)(frame, "draw:object")[0];
10
+ if (objectElement === void 0) return;
11
+ const href = (0, odf_js.attrValue)(objectElement, "xlink:href");
12
+ if (href === void 0) return;
13
+ return require_odf_formula_read.readOdfEmbeddedFormula(pkg, subPackagePathFromHref(href));
14
+ }
15
+ function flowAnchoredFrameBox(frame) {
16
+ const widthValue = (0, odf_js.attrValue)(frame, "svg:width");
17
+ const heightValue = (0, odf_js.attrValue)(frame, "svg:height");
18
+ if (widthValue === void 0 || heightValue === void 0) return;
19
+ const widthPt = (0, odf_js.parseOdfLength)(widthValue);
20
+ const heightPt = (0, odf_js.parseOdfLength)(heightValue);
21
+ if (widthPt === void 0 || heightPt === void 0) return;
22
+ return {
23
+ xPt: 0,
24
+ yPt: 0,
25
+ widthPt,
26
+ heightPt
27
+ };
28
+ }
29
+ function nestedGroupFunctions(group, groupFunctions) {
30
+ const value = (0, odf_js.attrValue)(group, "draw:transform");
31
+ const own = value === void 0 ? [] : (0, odf_js.parseOdfTransform)(value);
32
+ return own.length === 0 ? groupFunctions : [...own, ...groupFunctions];
33
+ }
34
+ function readFormulaFrame(frame, groupFunctions, pkg, allowFlowAnchored) {
35
+ const formula = formulaOfFrame(frame, pkg);
36
+ if (formula === void 0) return;
37
+ const box = (0, odf_js.readDrawFrame)(frame, groupFunctions, pkg)?.frame ?? (allowFlowAnchored ? flowAnchoredFrameBox(frame) : void 0);
38
+ if (box === void 0) return;
39
+ return {
40
+ frameElement: frame,
41
+ formula,
42
+ frame: box
43
+ };
44
+ }
45
+ function walkForFormulaFrames(nodes, groupFunctions, pkg, out) {
46
+ for (const node of nodes) {
47
+ if (node.type !== "element") continue;
48
+ if (node.tag === "draw:frame") {
49
+ const detected = readFormulaFrame(node, groupFunctions, pkg, true);
50
+ if (detected !== void 0) {
51
+ out.push(detected);
52
+ continue;
53
+ }
54
+ walkForFormulaFrames(node.children, groupFunctions, pkg, out);
55
+ continue;
56
+ }
57
+ if (node.tag === "draw:g") {
58
+ walkForFormulaFrames(node.children, nestedGroupFunctions(node, groupFunctions), pkg, out);
59
+ continue;
60
+ }
61
+ walkForFormulaFrames(node.children, groupFunctions, pkg, out);
25
62
  }
63
+ }
64
+ function collectFormulaFrames(nodes, pkg) {
65
+ const out = [];
66
+ walkForFormulaFrames(nodes, [], pkg, out);
67
+ return out;
68
+ }
69
+ function collectSlideFormulaFrames(pageChildren, pkg) {
70
+ const out = [];
71
+ const state = { nextShapeIndex: 0 };
72
+ const walk = (nodes, groupFunctions) => {
73
+ for (const node of nodes) {
74
+ if (node.type !== "element") continue;
75
+ if (node.tag === "draw:frame") {
76
+ const shape = (0, odf_js.readDrawFrame)(node, groupFunctions, pkg);
77
+ if (shape === void 0) continue;
78
+ const shapeIndex = state.nextShapeIndex;
79
+ state.nextShapeIndex += 1;
80
+ const formula = formulaOfFrame(node, pkg);
81
+ if (formula !== void 0) out.push({
82
+ frameElement: node,
83
+ formula,
84
+ frame: shape.frame,
85
+ shapeIndex
86
+ });
87
+ continue;
88
+ }
89
+ if (node.tag === "draw:g") walk(node.children, nestedGroupFunctions(node, groupFunctions));
90
+ }
91
+ };
92
+ walk(pageChildren, []);
26
93
  return out;
27
94
  }
28
95
  //#endregion
29
- exports.detectEmbeddedFormulaFrames = detectEmbeddedFormulaFrames;
96
+ exports.collectFormulaFrames = collectFormulaFrames;
97
+ exports.collectSlideFormulaFrames = collectSlideFormulaFrames;
@@ -1,12 +1,16 @@
1
- import { t as Box } from "../../geometry-DvwdrIij.cjs";
2
- import { EmbeddedFormula } from "../../model/formula.cjs";
1
+ import { t as Box$1 } from "../../geometry-DaJr8yQW.cjs";
2
+ import { ContentFormula } from "document-schema.js";
3
3
  import { Package, XmlElement, XmlNode } from "odf.js";
4
4
  //#region src/odf/formula/detect.d.ts
5
5
  interface DetectedFormulaFrame {
6
6
  readonly frameElement: XmlElement;
7
- readonly formula: EmbeddedFormula;
8
- readonly frame: Box;
7
+ readonly formula: ContentFormula;
8
+ readonly frame: Box$1;
9
9
  }
10
- declare function detectEmbeddedFormulaFrames(containerChildren: readonly XmlNode[], pkg: Package): readonly DetectedFormulaFrame[];
10
+ interface DetectedSlideFormulaFrame extends DetectedFormulaFrame {
11
+ readonly shapeIndex: number;
12
+ }
13
+ declare function collectFormulaFrames(nodes: readonly XmlNode[], pkg: Package): readonly DetectedFormulaFrame[];
14
+ declare function collectSlideFormulaFrames(pageChildren: readonly XmlNode[], pkg: Package): readonly DetectedSlideFormulaFrame[];
11
15
  //#endregion
12
- export { DetectedFormulaFrame, detectEmbeddedFormulaFrames };
16
+ export { DetectedFormulaFrame, DetectedSlideFormulaFrame, collectFormulaFrames, collectSlideFormulaFrames };
@@ -1,12 +1,16 @@
1
- import { t as Box } from "../../geometry-DvwdrIij.js";
2
- import { EmbeddedFormula } from "../../model/formula.js";
1
+ import { t as Box$1 } from "../../geometry-DaJr8yQW.js";
2
+ import { ContentFormula } from "document-schema.js";
3
3
  import { Package, XmlElement, XmlNode } from "odf.js";
4
4
  //#region src/odf/formula/detect.d.ts
5
5
  interface DetectedFormulaFrame {
6
6
  readonly frameElement: XmlElement;
7
- readonly formula: EmbeddedFormula;
8
- readonly frame: Box;
7
+ readonly formula: ContentFormula;
8
+ readonly frame: Box$1;
9
9
  }
10
- declare function detectEmbeddedFormulaFrames(containerChildren: readonly XmlNode[], pkg: Package): readonly DetectedFormulaFrame[];
10
+ interface DetectedSlideFormulaFrame extends DetectedFormulaFrame {
11
+ readonly shapeIndex: number;
12
+ }
13
+ declare function collectFormulaFrames(nodes: readonly XmlNode[], pkg: Package): readonly DetectedFormulaFrame[];
14
+ declare function collectSlideFormulaFrames(pageChildren: readonly XmlNode[], pkg: Package): readonly DetectedSlideFormulaFrame[];
11
15
  //#endregion
12
- export { DetectedFormulaFrame, detectEmbeddedFormulaFrames };
16
+ export { DetectedFormulaFrame, DetectedSlideFormulaFrame, collectFormulaFrames, collectSlideFormulaFrames };
@@ -1,28 +1,95 @@
1
1
  import { readOdfEmbeddedFormula } from "./read.js";
2
- import { attrValue, childrenWithTag, readDrawFrame } from "odf.js";
2
+ import { attrValue, childrenWithTag, parseOdfLength, parseOdfTransform, readDrawFrame } from "odf.js";
3
3
  //#region src/odf/formula/detect.ts
4
4
  function subPackagePathFromHref(href) {
5
5
  return href.replace(/^#?\.\//, "");
6
6
  }
7
- function detectEmbeddedFormulaFrames(containerChildren, pkg) {
8
- const out = [];
9
- for (const child of containerChildren) {
10
- if (child.type !== "element" || child.tag !== "draw:frame") continue;
11
- const objectElement = childrenWithTag(child, "draw:object")[0];
12
- if (objectElement === void 0) continue;
13
- const href = attrValue(objectElement, "xlink:href");
14
- if (href === void 0) continue;
15
- const formula = readOdfEmbeddedFormula(pkg, subPackagePathFromHref(href));
16
- if (formula === void 0) continue;
17
- const shape = readDrawFrame(child, [], pkg);
18
- if (shape === void 0) continue;
19
- out.push({
20
- frameElement: child,
21
- formula,
22
- frame: shape.frame
23
- });
7
+ function formulaOfFrame(frame, pkg) {
8
+ const objectElement = childrenWithTag(frame, "draw:object")[0];
9
+ if (objectElement === void 0) return;
10
+ const href = attrValue(objectElement, "xlink:href");
11
+ if (href === void 0) return;
12
+ return readOdfEmbeddedFormula(pkg, subPackagePathFromHref(href));
13
+ }
14
+ function flowAnchoredFrameBox(frame) {
15
+ const widthValue = attrValue(frame, "svg:width");
16
+ const heightValue = attrValue(frame, "svg:height");
17
+ if (widthValue === void 0 || heightValue === void 0) return;
18
+ const widthPt = parseOdfLength(widthValue);
19
+ const heightPt = parseOdfLength(heightValue);
20
+ if (widthPt === void 0 || heightPt === void 0) return;
21
+ return {
22
+ xPt: 0,
23
+ yPt: 0,
24
+ widthPt,
25
+ heightPt
26
+ };
27
+ }
28
+ function nestedGroupFunctions(group, groupFunctions) {
29
+ const value = attrValue(group, "draw:transform");
30
+ const own = value === void 0 ? [] : parseOdfTransform(value);
31
+ return own.length === 0 ? groupFunctions : [...own, ...groupFunctions];
32
+ }
33
+ function readFormulaFrame(frame, groupFunctions, pkg, allowFlowAnchored) {
34
+ const formula = formulaOfFrame(frame, pkg);
35
+ if (formula === void 0) return;
36
+ const box = readDrawFrame(frame, groupFunctions, pkg)?.frame ?? (allowFlowAnchored ? flowAnchoredFrameBox(frame) : void 0);
37
+ if (box === void 0) return;
38
+ return {
39
+ frameElement: frame,
40
+ formula,
41
+ frame: box
42
+ };
43
+ }
44
+ function walkForFormulaFrames(nodes, groupFunctions, pkg, out) {
45
+ for (const node of nodes) {
46
+ if (node.type !== "element") continue;
47
+ if (node.tag === "draw:frame") {
48
+ const detected = readFormulaFrame(node, groupFunctions, pkg, true);
49
+ if (detected !== void 0) {
50
+ out.push(detected);
51
+ continue;
52
+ }
53
+ walkForFormulaFrames(node.children, groupFunctions, pkg, out);
54
+ continue;
55
+ }
56
+ if (node.tag === "draw:g") {
57
+ walkForFormulaFrames(node.children, nestedGroupFunctions(node, groupFunctions), pkg, out);
58
+ continue;
59
+ }
60
+ walkForFormulaFrames(node.children, groupFunctions, pkg, out);
24
61
  }
62
+ }
63
+ function collectFormulaFrames(nodes, pkg) {
64
+ const out = [];
65
+ walkForFormulaFrames(nodes, [], pkg, out);
66
+ return out;
67
+ }
68
+ function collectSlideFormulaFrames(pageChildren, pkg) {
69
+ const out = [];
70
+ const state = { nextShapeIndex: 0 };
71
+ const walk = (nodes, groupFunctions) => {
72
+ for (const node of nodes) {
73
+ if (node.type !== "element") continue;
74
+ if (node.tag === "draw:frame") {
75
+ const shape = readDrawFrame(node, groupFunctions, pkg);
76
+ if (shape === void 0) continue;
77
+ const shapeIndex = state.nextShapeIndex;
78
+ state.nextShapeIndex += 1;
79
+ const formula = formulaOfFrame(node, pkg);
80
+ if (formula !== void 0) out.push({
81
+ frameElement: node,
82
+ formula,
83
+ frame: shape.frame,
84
+ shapeIndex
85
+ });
86
+ continue;
87
+ }
88
+ if (node.tag === "draw:g") walk(node.children, nestedGroupFunctions(node, groupFunctions));
89
+ }
90
+ };
91
+ walk(pageChildren, []);
25
92
  return out;
26
93
  }
27
94
  //#endregion
28
- export { detectEmbeddedFormulaFrames };
95
+ export { collectFormulaFrames, collectSlideFormulaFrames };
@@ -2,27 +2,15 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  let odf_js = require("odf.js");
3
3
  //#region src/odf/formula/read.ts
4
4
  function readOdfFormulaContent(pkg) {
5
- const formula = (0, odf_js.readOdfFormula)(pkg);
6
- return {
7
- mathml: formula.mathml,
8
- starMath: formula.starMath,
9
- metadata: formula.metadata
10
- };
5
+ return (0, odf_js.readOdfFormulaDocument)(pkg);
11
6
  }
12
7
  function readOdfEmbeddedFormula(outerPkg, subPackagePath) {
13
8
  const contentPart = outerPkg.parts[`${subPackagePath}/content.xml`];
14
9
  if (contentPart?.kind !== "xml") return;
15
- const metaPart = outerPkg.parts[`${subPackagePath}/meta.xml`];
16
- const subPkg = { parts: metaPart?.kind === "xml" ? {
17
- "content.xml": contentPart,
18
- "meta.xml": metaPart
19
- } : { "content.xml": contentPart } };
10
+ const subPkg = { parts: { "content.xml": contentPart } };
20
11
  try {
21
- const formula = (0, odf_js.readOdfFormula)(subPkg);
22
- return {
23
- mathml: formula.mathml,
24
- starMath: formula.starMath
25
- };
12
+ const document = (0, odf_js.readOdfFormulaDocument)(subPkg);
13
+ return document.kind === "formula" ? document.formula : void 0;
26
14
  } catch {
27
15
  return;
28
16
  }
@@ -1,11 +1,7 @@
1
- import { EmbeddedFormula } from "../../model/formula.cjs";
2
- import { LayoutMetadata } from "document-schema.js";
1
+ import { ContentDocument, ContentFormula } from "document-schema.js";
3
2
  import { Package } from "odf.js";
4
3
  //#region src/odf/formula/read.d.ts
5
- interface StandaloneFormulaContent extends EmbeddedFormula {
6
- readonly metadata: LayoutMetadata;
7
- }
8
- declare function readOdfFormulaContent(pkg: Package): StandaloneFormulaContent;
9
- declare function readOdfEmbeddedFormula(outerPkg: Package, subPackagePath: string): EmbeddedFormula | undefined;
4
+ declare function readOdfFormulaContent(pkg: Package): ContentDocument;
5
+ declare function readOdfEmbeddedFormula(outerPkg: Package, subPackagePath: string): ContentFormula | undefined;
10
6
  //#endregion
11
- export { StandaloneFormulaContent, readOdfEmbeddedFormula, readOdfFormulaContent };
7
+ export { readOdfEmbeddedFormula, readOdfFormulaContent };
@@ -1,11 +1,7 @@
1
- import { EmbeddedFormula } from "../../model/formula.js";
2
- import { LayoutMetadata } from "document-schema.js";
1
+ import { ContentDocument, ContentFormula } from "document-schema.js";
3
2
  import { Package } from "odf.js";
4
3
  //#region src/odf/formula/read.d.ts
5
- interface StandaloneFormulaContent extends EmbeddedFormula {
6
- readonly metadata: LayoutMetadata;
7
- }
8
- declare function readOdfFormulaContent(pkg: Package): StandaloneFormulaContent;
9
- declare function readOdfEmbeddedFormula(outerPkg: Package, subPackagePath: string): EmbeddedFormula | undefined;
4
+ declare function readOdfFormulaContent(pkg: Package): ContentDocument;
5
+ declare function readOdfEmbeddedFormula(outerPkg: Package, subPackagePath: string): ContentFormula | undefined;
10
6
  //#endregion
11
- export { StandaloneFormulaContent, readOdfEmbeddedFormula, readOdfFormulaContent };
7
+ export { readOdfEmbeddedFormula, readOdfFormulaContent };
@@ -1,27 +1,15 @@
1
- import { readOdfFormula } from "odf.js";
1
+ import { readOdfFormulaDocument } from "odf.js";
2
2
  //#region src/odf/formula/read.ts
3
3
  function readOdfFormulaContent(pkg) {
4
- const formula = readOdfFormula(pkg);
5
- return {
6
- mathml: formula.mathml,
7
- starMath: formula.starMath,
8
- metadata: formula.metadata
9
- };
4
+ return readOdfFormulaDocument(pkg);
10
5
  }
11
6
  function readOdfEmbeddedFormula(outerPkg, subPackagePath) {
12
7
  const contentPart = outerPkg.parts[`${subPackagePath}/content.xml`];
13
8
  if (contentPart?.kind !== "xml") return;
14
- const metaPart = outerPkg.parts[`${subPackagePath}/meta.xml`];
15
- const subPkg = { parts: metaPart?.kind === "xml" ? {
16
- "content.xml": contentPart,
17
- "meta.xml": metaPart
18
- } : { "content.xml": contentPart } };
9
+ const subPkg = { parts: { "content.xml": contentPart } };
19
10
  try {
20
- const formula = readOdfFormula(subPkg);
21
- return {
22
- mathml: formula.mathml,
23
- starMath: formula.starMath
24
- };
11
+ const document = readOdfFormulaDocument(subPkg);
12
+ return document.kind === "formula" ? document.formula : void 0;
25
13
  } catch {
26
14
  return;
27
15
  }
@@ -1,44 +1,34 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_model_formula = require("../../model/formula.cjs");
2
3
  const require_odf_formula_detect = require("../formula/detect.cjs");
3
- const require_odf_formula_placeholder = require("../formula/placeholder.cjs");
4
4
  let document_schema_js = require("document-schema.js");
5
5
  let odf_js = require("odf.js");
6
6
  //#region src/odf/odp/read.ts
7
7
  function readOdpContent(pkg) {
8
8
  const odpDoc = (0, odf_js.readOdp)(pkg);
9
- const formulas = /* @__PURE__ */ new Map();
10
9
  const contentPart = pkg.parts["content.xml"];
11
10
  if (contentPart?.kind === "xml") {
12
11
  const root = (0, odf_js.rootElement)(contentPart.nodes);
13
12
  const body = root === void 0 ? void 0 : (0, odf_js.findChildElement)(root.children, "office:body");
14
13
  const presentation = body === void 0 ? void 0 : (0, odf_js.findChildElement)(body.children, "office:presentation");
15
14
  (presentation === void 0 ? [] : (0, odf_js.childrenWithTag)(presentation, "draw:page")).forEach((pageElement, slideIndex) => {
16
- if ((0, odf_js.childrenWithTag)(pageElement, "draw:g").length > 0) return;
17
15
  const slide = odpDoc.slides[slideIndex];
18
16
  if (slide === void 0) return;
19
- const frameElements = (0, odf_js.childrenWithTag)(pageElement, "draw:frame");
20
- const detected = require_odf_formula_detect.detectEmbeddedFormulaFrames(frameElements, pkg);
21
- for (const found of detected) {
22
- const shapeIndex = frameElements.indexOf(found.frameElement);
23
- const shape = slide.shapes[shapeIndex];
17
+ for (const found of require_odf_formula_detect.collectSlideFormulaFrames(pageElement.children, pkg)) {
18
+ const shape = slide.shapes[found.shapeIndex];
24
19
  if (shape === void 0) continue;
25
- const sourcePath = `slides[${slideIndex}].shapes[${shapeIndex}]`;
26
- slide.shapes[shapeIndex] = {
20
+ slide.shapes[found.shapeIndex] = {
27
21
  ...shape,
28
- blocks: [require_odf_formula_placeholder.buildFormulaPlaceholderBlock(found.formula, found.frame, sourcePath)]
22
+ blocks: [require_model_formula.buildFormulaBlock(found.formula, found.frame, `slides[${slideIndex}].shapes[${found.shapeIndex}]`)]
29
23
  };
30
- formulas.set(sourcePath, found.formula);
31
24
  }
32
25
  });
33
26
  }
34
27
  return {
35
- document: {
36
- kind: "presentation",
37
- formatVersion: document_schema_js.CONTENT_FORMAT_VERSION,
38
- metadata: { ...odpDoc.metadata },
39
- slides: odpDoc.slides
40
- },
41
- formulas
28
+ kind: "presentation",
29
+ formatVersion: document_schema_js.CONTENT_FORMAT_VERSION,
30
+ metadata: { ...odpDoc.metadata },
31
+ slides: odpDoc.slides
42
32
  };
43
33
  }
44
34
  //#endregion
@@ -1,11 +1,6 @@
1
- import { EmbeddedFormula } from "../../model/formula.cjs";
2
1
  import { ContentDocument } from "document-schema.js";
3
2
  import { Package } from "odf.js";
4
3
  //#region src/odf/odp/read.d.ts
5
- interface OdpContentResult {
6
- readonly document: ContentDocument;
7
- readonly formulas: ReadonlyMap<string, EmbeddedFormula>;
8
- }
9
- declare function readOdpContent(pkg: Package): OdpContentResult;
4
+ declare function readOdpContent(pkg: Package): ContentDocument;
10
5
  //#endregion
11
- export { OdpContentResult, readOdpContent };
6
+ export { readOdpContent };
@@ -1,11 +1,6 @@
1
- import { EmbeddedFormula } from "../../model/formula.js";
2
1
  import { ContentDocument } from "document-schema.js";
3
2
  import { Package } from "odf.js";
4
3
  //#region src/odf/odp/read.d.ts
5
- interface OdpContentResult {
6
- readonly document: ContentDocument;
7
- readonly formulas: ReadonlyMap<string, EmbeddedFormula>;
8
- }
9
- declare function readOdpContent(pkg: Package): OdpContentResult;
4
+ declare function readOdpContent(pkg: Package): ContentDocument;
10
5
  //#endregion
11
- export { OdpContentResult, readOdpContent };
6
+ export { readOdpContent };