@stll/docx-core 0.36.3 → 0.38.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.
- package/dist/{document-CQ0oovh0.js → document-C02Ulybe.js} +27 -1
- package/dist/{document-YlRuGzLX.d.ts → document-wNmygRXS.d.ts} +23 -1
- package/dist/docx_kernel_bg.wasm +0 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +15 -14
- package/dist/model/document.d.ts +2 -2
- package/dist/model/document.js +2 -2
- package/dist/ops/documentOps.d.ts +43 -37
- package/dist/ops/documentOps.js +1149 -996
- package/dist/zip/writeZipPart.js +8 -3
- package/package.json +14 -7
package/dist/zip/writeZipPart.js
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
|
+
import { writeZipEntry } from "@stll/utf8-boundaries";
|
|
1
2
|
//#region src/zip/writeZipPart.ts
|
|
2
3
|
const FIXED_ZIP_DATE_MS = Date.UTC(2e3, 0, 1);
|
|
4
|
+
const UNIX_DIRECTORY_FLAG = 16384;
|
|
5
|
+
const DOS_DIRECTORY_FLAG = 16;
|
|
3
6
|
/** Write exactly one entry, without synthesizing parent directory entries. */
|
|
4
|
-
const writeZipPart = ({ zip, path, data, options }) => {
|
|
5
|
-
|
|
7
|
+
const writeZipPart = ({ zip, path, data, options = {} }) => {
|
|
8
|
+
const unixPermissions = typeof options.unixPermissions === "string" ? Number.parseInt(options.unixPermissions, 8) : options.unixPermissions ?? 0;
|
|
9
|
+
if (options.dir === true || (unixPermissions & UNIX_DIRECTORY_FLAG) !== 0 || ((options.dosPermissions ?? 0) & DOS_DIRECTORY_FLAG) !== 0) data = /* @__PURE__ */ new Uint8Array();
|
|
10
|
+
writeZipEntry(zip, path, data, {
|
|
6
11
|
...options,
|
|
7
|
-
date: options
|
|
12
|
+
date: options.date ?? new Date(FIXED_ZIP_DATE_MS),
|
|
8
13
|
createFolders: false
|
|
9
14
|
});
|
|
10
15
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stll/docx-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.38.0",
|
|
4
4
|
"description": "Typed OOXML/DOCX model, validation, serialization, legal-source compilation, and browser-native package projection.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"document-model",
|
|
@@ -34,27 +34,33 @@
|
|
|
34
34
|
"exports": {
|
|
35
35
|
".": {
|
|
36
36
|
"types": "./dist/index.d.ts",
|
|
37
|
-
"import": "./dist/index.js"
|
|
37
|
+
"import": "./dist/index.js",
|
|
38
|
+
"default": "./dist/index.js"
|
|
38
39
|
},
|
|
39
40
|
"./model": {
|
|
40
41
|
"types": "./dist/model/document.d.ts",
|
|
41
|
-
"import": "./dist/model/document.js"
|
|
42
|
+
"import": "./dist/model/document.js",
|
|
43
|
+
"default": "./dist/model/document.js"
|
|
42
44
|
},
|
|
43
45
|
"./ops": {
|
|
44
46
|
"types": "./dist/ops/documentOps.d.ts",
|
|
45
|
-
"import": "./dist/ops/documentOps.js"
|
|
47
|
+
"import": "./dist/ops/documentOps.js",
|
|
48
|
+
"default": "./dist/ops/documentOps.js"
|
|
46
49
|
},
|
|
47
50
|
"./projection": {
|
|
48
51
|
"types": "./dist/projection.d.ts",
|
|
49
|
-
"import": "./dist/projection.js"
|
|
52
|
+
"import": "./dist/projection.js",
|
|
53
|
+
"default": "./dist/projection.js"
|
|
50
54
|
},
|
|
51
55
|
"./schema": {
|
|
52
56
|
"types": "./dist/schema/sequenceChildren.d.ts",
|
|
53
|
-
"import": "./dist/schema/sequenceChildren.js"
|
|
57
|
+
"import": "./dist/schema/sequenceChildren.js",
|
|
58
|
+
"default": "./dist/schema/sequenceChildren.js"
|
|
54
59
|
},
|
|
55
60
|
"./zip": {
|
|
56
61
|
"types": "./dist/zip/writeZipPart.d.ts",
|
|
57
|
-
"import": "./dist/zip/writeZipPart.js"
|
|
62
|
+
"import": "./dist/zip/writeZipPart.js",
|
|
63
|
+
"default": "./dist/zip/writeZipPart.js"
|
|
58
64
|
}
|
|
59
65
|
},
|
|
60
66
|
"publishConfig": {
|
|
@@ -74,6 +80,7 @@
|
|
|
74
80
|
"dependencies": {
|
|
75
81
|
"@nodable/entities": "^3.0.0",
|
|
76
82
|
"@stll/docx-utils": "^0.1.0",
|
|
83
|
+
"@stll/utf8-boundaries": "0.1.0",
|
|
77
84
|
"better-result": "3.0.1",
|
|
78
85
|
"fast-xml-parser": "^5.10.1",
|
|
79
86
|
"jszip": "3.10.2",
|