@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
|
@@ -5,10 +5,10 @@ const officeimo = root.OfficeIMO || (root.OfficeIMO = {});
|
|
|
5
5
|
const cacheKey = Symbol.for("@evotecit/officeimo/modules");
|
|
6
6
|
const _modules = officeimo[cacheKey] || new Map();
|
|
7
7
|
if (!officeimo[cacheKey]) Object.defineProperty(officeimo, cacheKey, { value: _modules });
|
|
8
|
-
const _m2 = _modules.get("
|
|
8
|
+
const _m2 = _modules.get("87c24efeaa0f1579c19afeeb4918caeb4f8f65a88d24a246e2cfd712b37dbac3") ?? (() => {
|
|
9
9
|
function checkAbort(signal) {
|
|
10
10
|
if (signal?.aborted)
|
|
11
|
-
throw signal.reason
|
|
11
|
+
throw signal.reason;
|
|
12
12
|
}
|
|
13
13
|
/** Race a pending producer or sink operation without leaving abort listeners behind. */
|
|
14
14
|
function withAbort(promise, signal) {
|
|
@@ -16,7 +16,7 @@ function withAbort(promise, signal) {
|
|
|
16
16
|
return Promise.resolve(promise);
|
|
17
17
|
return new Promise((resolve, reject) => {
|
|
18
18
|
const cleanup = () => signal.removeEventListener("abort", abort);
|
|
19
|
-
const abort = () => { cleanup(); reject(signal.reason
|
|
19
|
+
const abort = () => { cleanup(); reject(signal.reason); };
|
|
20
20
|
signal.addEventListener("abort", abort, { once: true });
|
|
21
21
|
Promise.resolve(promise).then(value => { cleanup(); resolve(value); }, error => { cleanup(); reject(error); });
|
|
22
22
|
if (signal.aborted)
|
|
@@ -156,7 +156,7 @@ function pause() {
|
|
|
156
156
|
});
|
|
157
157
|
}
|
|
158
158
|
const _exports = Object.freeze({ checkAbort: checkAbort, withAbort: withAbort, inputRows: inputRows, rowsFromBatches: rowsFromBatches, concatRows: concatRows, consumeRows: consumeRows, beginTask: beginTask, taskYieldDue: taskYieldDue, pause: pause });
|
|
159
|
-
_modules.set("
|
|
159
|
+
_modules.set("87c24efeaa0f1579c19afeeb4918caeb4f8f65a88d24a246e2cfd712b37dbac3", _exports);
|
|
160
160
|
return _exports;
|
|
161
161
|
})();
|
|
162
162
|
|
|
@@ -197,7 +197,7 @@ _modules.set("d5c945064d81fdd257960f48c421125e106e5f270427d170bb05587dd96a44ea",
|
|
|
197
197
|
return _exports;
|
|
198
198
|
})();
|
|
199
199
|
|
|
200
|
-
const _m3 = _modules.get("
|
|
200
|
+
const _m3 = _modules.get("5337d1e3bd5ae0c1d10a476fcd31540d20337ccf7aa93c7e9e26c2b1a7dab92b") ?? (() => {
|
|
201
201
|
const { checkAbort, consumeRows, withAbort, pause, taskYieldDue } = _m2;
|
|
202
202
|
|
|
203
203
|
const { OfficeIMOError } = _m4;
|
|
@@ -207,8 +207,9 @@ async function withDestination(destination, operation) {
|
|
|
207
207
|
// Native streams can belong to another browser realm; constructor identity is not portable.
|
|
208
208
|
if (destination && typeof destination.getWriter === "function") {
|
|
209
209
|
const writer = destination.getWriter();
|
|
210
|
+
// Native streams may retain accepted chunks after write resolves.
|
|
210
211
|
try {
|
|
211
|
-
return await operation({ write: bytes => writer.write(bytes) });
|
|
212
|
+
return await operation({ write: bytes => writer.write(new Uint8Array(bytes)) });
|
|
212
213
|
}
|
|
213
214
|
finally {
|
|
214
215
|
writer.releaseLock();
|
|
@@ -302,7 +303,7 @@ async function writeBytes(source, sink, signal) {
|
|
|
302
303
|
});
|
|
303
304
|
}
|
|
304
305
|
const _exports = Object.freeze({ withDestination: withDestination, BlobByteSink: BlobByteSink, ChunkedTextSink: ChunkedTextSink, writeBytes: writeBytes });
|
|
305
|
-
_modules.set("
|
|
306
|
+
_modules.set("5337d1e3bd5ae0c1d10a476fcd31540d20337ccf7aa93c7e9e26c2b1a7dab92b", _exports);
|
|
306
307
|
return _exports;
|
|
307
308
|
})();
|
|
308
309
|
|
|
@@ -515,7 +516,7 @@ _modules.set("42faf379960e5674a6fdfa8c8fca0bb68bbd74587231248d2524d7004def3671",
|
|
|
515
516
|
return _exports;
|
|
516
517
|
})();
|
|
517
518
|
|
|
518
|
-
const _m14 = _modules.get("
|
|
519
|
+
const _m14 = _modules.get("0391fe35ea7d02b25804ab4d0e7543136d6bb615f368f268c74aa135f23aa6bc") ?? (() => {
|
|
519
520
|
const { assertExportValue } = _m8;
|
|
520
521
|
|
|
521
522
|
const { checkAbort } = _m2;
|
|
@@ -528,11 +529,18 @@ function createRowProjector(columns, worksheet, signal, validate = assertExportV
|
|
|
528
529
|
const getters = columns.some(column => column.value);
|
|
529
530
|
return (row, rowIndex = 0) => {
|
|
530
531
|
if (Array.isArray(row) && !getters) {
|
|
531
|
-
|
|
532
|
+
const length = row.length;
|
|
533
|
+
if (length > columns.length)
|
|
532
534
|
throw new RangeError("Row has more values than declared columns.");
|
|
533
|
-
|
|
535
|
+
// Resolve each positional value once, just like key/value projections. Returning the
|
|
536
|
+
// source array would let an accessor change a value after the portable-value check.
|
|
537
|
+
const values = new Array(length);
|
|
538
|
+
for (let index = 0; index < length; index++) {
|
|
539
|
+
const value = row[index];
|
|
534
540
|
validate(value);
|
|
535
|
-
|
|
541
|
+
values[index] = value;
|
|
542
|
+
}
|
|
543
|
+
return values;
|
|
536
544
|
}
|
|
537
545
|
if (!row || typeof row !== "object" || isDate(row))
|
|
538
546
|
throw new TypeError("A row must be an array or object.");
|
|
@@ -561,7 +569,7 @@ function createRowProjector(columns, worksheet, signal, validate = assertExportV
|
|
|
561
569
|
};
|
|
562
570
|
}
|
|
563
571
|
/** @internal Shared metadata fields for full columns and adapter-owned partial overrides. */
|
|
564
|
-
const columnOptionFields = ["header", "key", "value", "width", "type", "format", "wrapText", "alignment", "groups", "style", "valueFormatter"];
|
|
572
|
+
const columnOptionFields = ["header", "key", "value", "width", "type", "format", "wrapText", "alignment", "rowHeader", "groups", "style", "valueFormatter"];
|
|
565
573
|
function copyColumns(columns, workbookStyles = false) {
|
|
566
574
|
if (!Array.isArray(columns))
|
|
567
575
|
throw new TypeError("Declare the columns in export order.");
|
|
@@ -577,6 +585,8 @@ function copyColumns(columns, workbookStyles = false) {
|
|
|
577
585
|
throw new TypeError("Each column needs a string header and an optional string key.");
|
|
578
586
|
if (captured.value !== undefined && typeof captured.value !== "function")
|
|
579
587
|
throw new TypeError("Column value getters must be functions.");
|
|
588
|
+
if (captured.rowHeader !== undefined && typeof captured.rowHeader !== "boolean")
|
|
589
|
+
throw new TypeError("Column rowHeader must be boolean.");
|
|
580
590
|
if (captured.groups !== undefined) {
|
|
581
591
|
if (!Array.isArray(captured.groups))
|
|
582
592
|
throw new TypeError("Column groups must be an array of strings.");
|
|
@@ -589,7 +599,7 @@ function copyColumns(columns, workbookStyles = false) {
|
|
|
589
599
|
});
|
|
590
600
|
}
|
|
591
601
|
const _exports = Object.freeze({ createRowProjector: createRowProjector, columnOptionFields: columnOptionFields, copyColumns: copyColumns });
|
|
592
|
-
_modules.set("
|
|
602
|
+
_modules.set("0391fe35ea7d02b25804ab4d0e7543136d6bb615f368f268c74aa135f23aa6bc", _exports);
|
|
593
603
|
return _exports;
|
|
594
604
|
})();
|
|
595
605
|
|
|
@@ -663,7 +673,7 @@ _modules.set("e95bb0e3f342d1379b67a3d541fa808e06361da8460169a6aec152ee7deb69b2",
|
|
|
663
673
|
return _exports;
|
|
664
674
|
})();
|
|
665
675
|
|
|
666
|
-
const _m11 = _modules.get("
|
|
676
|
+
const _m11 = _modules.get("046b305cdccf817d847addb75a778131622de23f2840830bbe1c0c26053a68c0") ?? (() => {
|
|
667
677
|
const { ExportCell, assertScalar } = _m8;
|
|
668
678
|
|
|
669
679
|
const { isDate } = _m9;
|
|
@@ -925,11 +935,11 @@ function createGroupedReport(rows, options) {
|
|
|
925
935
|
return source;
|
|
926
936
|
}
|
|
927
937
|
const _exports = Object.freeze({ assertGroupedReportSource: assertGroupedReportSource, groupedReportEvents: groupedReportEvents, groupedReportOperation: groupedReportOperation, createGroupedReport: createGroupedReport });
|
|
928
|
-
_modules.set("
|
|
938
|
+
_modules.set("046b305cdccf817d847addb75a778131622de23f2840830bbe1c0c26053a68c0", _exports);
|
|
929
939
|
return _exports;
|
|
930
940
|
})();
|
|
931
941
|
|
|
932
|
-
const _m7 = _modules.get("
|
|
942
|
+
const _m7 = _modules.get("81b3d47c02b7d8443b79e02b3cfb52032d6b73d9a3fb592b777ebe028ad0ef00") ?? (() => {
|
|
933
943
|
|
|
934
944
|
|
|
935
945
|
|
|
@@ -974,11 +984,11 @@ function saveBlob(blob, fileName) {
|
|
|
974
984
|
}
|
|
975
985
|
}
|
|
976
986
|
const _exports = Object.freeze({ OfficeIMOError: _m4.OfficeIMOError, NotSupportedError: _m4.NotSupportedError, BlobByteSink: _m3.BlobByteSink, ChunkedTextSink: _m3.ChunkedTextSink, writeBytes: _m3.writeBytes, ExportCell: _m8.ExportCell, createGroupedReport: _m11.createGroupedReport, checkAbort: _m2.checkAbort, withAbort: _m2.withAbort, inputRows: _m2.inputRows, pause: _m2.pause, detectFeatures: detectFeatures, saveBlob: saveBlob });
|
|
977
|
-
_modules.set("
|
|
987
|
+
_modules.set("81b3d47c02b7d8443b79e02b3cfb52032d6b73d9a3fb592b777ebe028ad0ef00", _exports);
|
|
978
988
|
return _exports;
|
|
979
989
|
})();
|
|
980
990
|
|
|
981
|
-
const _m6 = _modules.get("
|
|
991
|
+
const _m6 = _modules.get("3aeb365cb54a2f47af0ef0db0c06b8eab1c49f3bb740e70535ee0115d45ce698") ?? (() => {
|
|
982
992
|
const { ExportCell, NotSupportedError, OfficeIMOError } = _m7;
|
|
983
993
|
|
|
984
994
|
const { assertExportValue, assertScalar, copyCellPresentation } = _m8;
|
|
@@ -1157,11 +1167,11 @@ function result(value) {
|
|
|
1157
1167
|
return { rows: value.rows, columns: value.columns, bytes: value.bytes };
|
|
1158
1168
|
}
|
|
1159
1169
|
const _exports = Object.freeze({ protocol: protocol, message: message, bounds: bounds, captureInput: captureInput, captureRow: captureRow, restoreRows: restoreRows, captureProgress: captureProgress, wireError: wireError, restoreError: restoreError, result: result });
|
|
1160
|
-
_modules.set("
|
|
1170
|
+
_modules.set("3aeb365cb54a2f47af0ef0db0c06b8eab1c49f3bb740e70535ee0115d45ce698", _exports);
|
|
1161
1171
|
return _exports;
|
|
1162
1172
|
})();
|
|
1163
1173
|
|
|
1164
|
-
const _m1 = _modules.get("
|
|
1174
|
+
const _m1 = _modules.get("5eb1b2f44c2625f90d0da30bfaacdba77d42da043ff12996de9c650d4ea249fe") ?? (() => {
|
|
1165
1175
|
const { checkAbort, inputRows, withAbort } = _m2;
|
|
1166
1176
|
|
|
1167
1177
|
const { withDestination } = _m3;
|
|
@@ -1333,11 +1343,11 @@ async function executeWorkerExport(endpoint, rows, destination, options = {}) {
|
|
|
1333
1343
|
}
|
|
1334
1344
|
}
|
|
1335
1345
|
const _exports = Object.freeze({ executeWorkerExport: executeWorkerExport });
|
|
1336
|
-
_modules.set("
|
|
1346
|
+
_modules.set("5eb1b2f44c2625f90d0da30bfaacdba77d42da043ff12996de9c650d4ea249fe", _exports);
|
|
1337
1347
|
return _exports;
|
|
1338
1348
|
})();
|
|
1339
1349
|
|
|
1340
|
-
const _m17 = _modules.get("
|
|
1350
|
+
const _m17 = _modules.get("1debadc47480abb9b6d830fe7108967a2b45877aa9ce0e2ae81914f343463ede") ?? (() => {
|
|
1341
1351
|
const { checkAbort, withAbort } = _m2;
|
|
1342
1352
|
|
|
1343
1353
|
const { OfficeIMOError } = _m4;
|
|
@@ -1489,14 +1499,14 @@ function handleWorkerExports(endpoint, operation) {
|
|
|
1489
1499
|
} };
|
|
1490
1500
|
}
|
|
1491
1501
|
const _exports = Object.freeze({ handleWorkerExports: handleWorkerExports });
|
|
1492
|
-
_modules.set("
|
|
1502
|
+
_modules.set("1debadc47480abb9b6d830fe7108967a2b45877aa9ce0e2ae81914f343463ede", _exports);
|
|
1493
1503
|
return _exports;
|
|
1494
1504
|
})();
|
|
1495
1505
|
|
|
1496
|
-
const _m0 = _modules.get("
|
|
1506
|
+
const _m0 = _modules.get("85e009dee350af7c8594b36740a1100f30104a08ab6b887240ef3113714be29e") ?? (() => {
|
|
1497
1507
|
|
|
1498
1508
|
const _exports = Object.freeze({ executeWorkerExport: _m1.executeWorkerExport, handleWorkerExports: _m17.handleWorkerExports });
|
|
1499
|
-
_modules.set("
|
|
1509
|
+
_modules.set("85e009dee350af7c8594b36740a1100f30104a08ab6b887240ef3113714be29e", _exports);
|
|
1500
1510
|
return _exports;
|
|
1501
1511
|
})();
|
|
1502
1512
|
Object.assign(officeimo, _m0);
|
|
@@ -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)
|
|
@@ -199,8 +199,9 @@ async function withDestination(destination, operation) {
|
|
|
199
199
|
// Native streams can belong to another browser realm; constructor identity is not portable.
|
|
200
200
|
if (destination && typeof destination.getWriter === "function") {
|
|
201
201
|
const writer = destination.getWriter();
|
|
202
|
+
// Native streams may retain accepted chunks after write resolves.
|
|
202
203
|
try {
|
|
203
|
-
return await operation({ write: bytes => writer.write(bytes) });
|
|
204
|
+
return await operation({ write: bytes => writer.write(new Uint8Array(bytes)) });
|
|
204
205
|
}
|
|
205
206
|
finally {
|
|
206
207
|
writer.releaseLock();
|
|
@@ -513,11 +514,18 @@ function createRowProjector(columns, worksheet, signal, validate = assertExportV
|
|
|
513
514
|
const getters = columns.some(column => column.value);
|
|
514
515
|
return (row, rowIndex = 0) => {
|
|
515
516
|
if (Array.isArray(row) && !getters) {
|
|
516
|
-
|
|
517
|
+
const length = row.length;
|
|
518
|
+
if (length > columns.length)
|
|
517
519
|
throw new RangeError("Row has more values than declared columns.");
|
|
518
|
-
|
|
520
|
+
// Resolve each positional value once, just like key/value projections. Returning the
|
|
521
|
+
// source array would let an accessor change a value after the portable-value check.
|
|
522
|
+
const values = new Array(length);
|
|
523
|
+
for (let index = 0; index < length; index++) {
|
|
524
|
+
const value = row[index];
|
|
519
525
|
validate(value);
|
|
520
|
-
|
|
526
|
+
values[index] = value;
|
|
527
|
+
}
|
|
528
|
+
return values;
|
|
521
529
|
}
|
|
522
530
|
if (!row || typeof row !== "object" || isDate(row))
|
|
523
531
|
throw new TypeError("A row must be an array or object.");
|
|
@@ -546,7 +554,7 @@ function createRowProjector(columns, worksheet, signal, validate = assertExportV
|
|
|
546
554
|
};
|
|
547
555
|
}
|
|
548
556
|
/** @internal Shared metadata fields for full columns and adapter-owned partial overrides. */
|
|
549
|
-
const columnOptionFields = ["header", "key", "value", "width", "type", "format", "wrapText", "alignment", "groups", "style", "valueFormatter"];
|
|
557
|
+
const columnOptionFields = ["header", "key", "value", "width", "type", "format", "wrapText", "alignment", "rowHeader", "groups", "style", "valueFormatter"];
|
|
550
558
|
function copyColumns(columns, workbookStyles = false) {
|
|
551
559
|
if (!Array.isArray(columns))
|
|
552
560
|
throw new TypeError("Declare the columns in export order.");
|
|
@@ -562,6 +570,8 @@ function copyColumns(columns, workbookStyles = false) {
|
|
|
562
570
|
throw new TypeError("Each column needs a string header and an optional string key.");
|
|
563
571
|
if (captured.value !== undefined && typeof captured.value !== "function")
|
|
564
572
|
throw new TypeError("Column value getters must be functions.");
|
|
573
|
+
if (captured.rowHeader !== undefined && typeof captured.rowHeader !== "boolean")
|
|
574
|
+
throw new TypeError("Column rowHeader must be boolean.");
|
|
565
575
|
if (captured.groups !== undefined) {
|
|
566
576
|
if (!Array.isArray(captured.groups))
|
|
567
577
|
throw new TypeError("Column groups must be an array of strings.");
|