@evotecit/officeimo 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -10
- package/bundles/officeimo-canopyx.js +813 -358
- package/bundles/officeimo-canopyx.mjs +700 -246
- package/bundles/officeimo-csv.js +29 -19
- package/bundles/officeimo-csv.mjs +17 -7
- package/bundles/officeimo-datatables.js +806 -360
- package/bundles/officeimo-datatables.mjs +694 -249
- package/bundles/officeimo-execution.js +35 -25
- package/bundles/officeimo-execution.mjs +17 -7
- package/bundles/officeimo-pdf.js +734 -289
- package/bundles/officeimo-pdf.mjs +685 -241
- package/bundles/officeimo-xlsx.js +88 -77
- package/bundles/officeimo-xlsx.mjs +22 -11
- package/bundles/officeimo.js +790 -344
- package/bundles/officeimo.mjs +680 -235
- package/dist/core/index.d.ts +2 -0
- package/dist/core/iteration.js +2 -2
- package/dist/core/sinks.js +2 -1
- package/dist/integrations/canopyx/source.js +13 -7
- package/dist/integrations/datatables/snapshot.js +3 -3
- package/dist/internal/rows.js +13 -4
- package/dist/pdf/document-grouped.js +72 -22
- package/dist/pdf/font-resources.js +2 -1
- package/dist/pdf/inline-text.js +50 -9
- package/dist/pdf/objects.js +188 -11
- package/dist/pdf/pages.js +25 -26
- package/dist/pdf/paragraph-layout.d.ts +2 -0
- package/dist/pdf/paragraph-layout.js +9 -4
- package/dist/pdf/session.js +1 -1
- package/dist/pdf/settings.d.ts +2 -0
- package/dist/pdf/settings.js +27 -2
- package/dist/pdf/structure.js +80 -28
- package/dist/pdf/table-band-flow.js +26 -11
- package/dist/pdf/table-band-plan.js +1 -3
- package/dist/pdf/table-layout.d.ts +4 -0
- package/dist/pdf/table-layout.js +22 -10
- package/dist/pdf/table-structure.js +28 -12
- package/dist/pdf/text.js +5 -0
- package/dist/pdf/types.d.ts +4 -2
- package/dist/pdf/xref.d.ts +1 -0
- package/dist/pdf/xref.js +30 -0
- package/dist/xlsx/values.js +3 -2
- package/dist/zip/entry.js +1 -1
- package/dist/zip/index.js +1 -1
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
const _m2 = (() => {
|
|
3
3
|
function checkAbort(signal) {
|
|
4
4
|
if (signal?.aborted)
|
|
5
|
-
throw signal.reason
|
|
5
|
+
throw signal.reason;
|
|
6
6
|
}
|
|
7
7
|
/** Race a pending producer or sink operation without leaving abort listeners behind. */
|
|
8
8
|
function withAbort(promise, signal) {
|
|
@@ -10,7 +10,7 @@ function withAbort(promise, signal) {
|
|
|
10
10
|
return Promise.resolve(promise);
|
|
11
11
|
return new Promise((resolve, reject) => {
|
|
12
12
|
const cleanup = () => signal.removeEventListener("abort", abort);
|
|
13
|
-
const abort = () => { cleanup(); reject(signal.reason
|
|
13
|
+
const abort = () => { cleanup(); reject(signal.reason); };
|
|
14
14
|
signal.addEventListener("abort", abort, { once: true });
|
|
15
15
|
Promise.resolve(promise).then(value => { cleanup(); resolve(value); }, error => { cleanup(); reject(error); });
|
|
16
16
|
if (signal.aborted)
|
|
@@ -214,8 +214,9 @@ async function withDestination(destination, operation) {
|
|
|
214
214
|
// Native streams can belong to another browser realm; constructor identity is not portable.
|
|
215
215
|
if (destination && typeof destination.getWriter === "function") {
|
|
216
216
|
const writer = destination.getWriter();
|
|
217
|
+
// Native streams may retain accepted chunks after write resolves.
|
|
217
218
|
try {
|
|
218
|
-
return await operation({ write: bytes => writer.write(bytes) });
|
|
219
|
+
return await operation({ write: bytes => writer.write(new Uint8Array(bytes)) });
|
|
219
220
|
}
|
|
220
221
|
finally {
|
|
221
222
|
writer.releaseLock();
|
|
@@ -621,7 +622,7 @@ class EntryWriter {
|
|
|
621
622
|
closed = false;
|
|
622
623
|
cleaned = false;
|
|
623
624
|
lifetime = new AbortController();
|
|
624
|
-
abort = () => { this.fail(this.signal?.reason
|
|
625
|
+
abort = () => { this.fail(this.signal?.reason); };
|
|
625
626
|
constructor(compression, sink, signal) {
|
|
626
627
|
this.sink = sink;
|
|
627
628
|
this.signal = signal;
|
|
@@ -785,7 +786,7 @@ class ZipWriter {
|
|
|
785
786
|
/** Pending header/directory writes and source reads must also stop on explicit discard. */
|
|
786
787
|
async acceptance(operation) {
|
|
787
788
|
const signal = this.options.signal;
|
|
788
|
-
const abort = () => this.lifetime.abort(signal?.reason
|
|
789
|
+
const abort = () => this.lifetime.abort(signal?.reason);
|
|
789
790
|
signal?.addEventListener("abort", abort, { once: true });
|
|
790
791
|
try {
|
|
791
792
|
checkAbort(signal);
|
|
@@ -1843,12 +1844,13 @@ function sheetName(requested, names, policy, register = true) {
|
|
|
1843
1844
|
throw new TypeError("Sheet name must be a string.");
|
|
1844
1845
|
// Validate and deduplicate the decoded literal value, before ST_Xstring attribute encoding.
|
|
1845
1846
|
// A requested _xHHHH_ token is literal text; the serializer protects its leading underscore.
|
|
1846
|
-
let base = cleanXml(requested, policy).replace(/[\[\]:*?/\\]/g, "_").
|
|
1847
|
+
let base = cleanXml(requested, policy).replace(/[\[\]:*?/\\]/g, "_").replace(/^[\s']+|[\s']+$/g, "");
|
|
1848
|
+
// Clipping can expose an internal apostrophe or the reserved History name.
|
|
1849
|
+
base = clipName(base, 31).replace(/[\s']+$/g, "");
|
|
1847
1850
|
if (!base)
|
|
1848
1851
|
base = "Sheet";
|
|
1849
1852
|
if (base.toLowerCase() === "history")
|
|
1850
1853
|
base += "_";
|
|
1851
|
-
base = clipName(base, 31);
|
|
1852
1854
|
let name = base, suffix = 2;
|
|
1853
1855
|
while (names.has(name.toLowerCase())) {
|
|
1854
1856
|
const tail = " (" + suffix++ + ")";
|
|
@@ -1887,11 +1889,18 @@ function createRowProjector(columns, worksheet, signal, validate = assertExportV
|
|
|
1887
1889
|
const getters = columns.some(column => column.value);
|
|
1888
1890
|
return (row, rowIndex = 0) => {
|
|
1889
1891
|
if (Array.isArray(row) && !getters) {
|
|
1890
|
-
|
|
1892
|
+
const length = row.length;
|
|
1893
|
+
if (length > columns.length)
|
|
1891
1894
|
throw new RangeError("Row has more values than declared columns.");
|
|
1892
|
-
|
|
1895
|
+
// Resolve each positional value once, just like key/value projections. Returning the
|
|
1896
|
+
// source array would let an accessor change a value after the portable-value check.
|
|
1897
|
+
const values = new Array(length);
|
|
1898
|
+
for (let index = 0; index < length; index++) {
|
|
1899
|
+
const value = row[index];
|
|
1893
1900
|
validate(value);
|
|
1894
|
-
|
|
1901
|
+
values[index] = value;
|
|
1902
|
+
}
|
|
1903
|
+
return values;
|
|
1895
1904
|
}
|
|
1896
1905
|
if (!row || typeof row !== "object" || isDate(row))
|
|
1897
1906
|
throw new TypeError("A row must be an array or object.");
|
|
@@ -1920,7 +1929,7 @@ function createRowProjector(columns, worksheet, signal, validate = assertExportV
|
|
|
1920
1929
|
};
|
|
1921
1930
|
}
|
|
1922
1931
|
/** @internal Shared metadata fields for full columns and adapter-owned partial overrides. */
|
|
1923
|
-
const columnOptionFields = ["header", "key", "value", "width", "type", "format", "wrapText", "alignment", "groups", "style", "valueFormatter"];
|
|
1932
|
+
const columnOptionFields = ["header", "key", "value", "width", "type", "format", "wrapText", "alignment", "rowHeader", "groups", "style", "valueFormatter"];
|
|
1924
1933
|
function copyColumns(columns, workbookStyles = false) {
|
|
1925
1934
|
if (!Array.isArray(columns))
|
|
1926
1935
|
throw new TypeError("Declare the columns in export order.");
|
|
@@ -1936,6 +1945,8 @@ function copyColumns(columns, workbookStyles = false) {
|
|
|
1936
1945
|
throw new TypeError("Each column needs a string header and an optional string key.");
|
|
1937
1946
|
if (captured.value !== undefined && typeof captured.value !== "function")
|
|
1938
1947
|
throw new TypeError("Column value getters must be functions.");
|
|
1948
|
+
if (captured.rowHeader !== undefined && typeof captured.rowHeader !== "boolean")
|
|
1949
|
+
throw new TypeError("Column rowHeader must be boolean.");
|
|
1939
1950
|
if (captured.groups !== undefined) {
|
|
1940
1951
|
if (!Array.isArray(captured.groups))
|
|
1941
1952
|
throw new TypeError("Column groups must be an array of strings.");
|