@stll/docx-core 0.31.0 → 0.32.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.
@@ -23,12 +23,12 @@ type DocxProjectionRevisionStatus = readonly [status: "complete"] | readonly [st
23
23
  type DocxProjectionWire = readonly [schemaVersion: 5, paragraphs: readonly DocxProjectionParagraph[], structuralFacts: DocxProjectionStructuralFacts, revisionStatus: DocxProjectionRevisionStatus, formattingStatus: DocxProjectionFormattingStatus];
24
24
  type DocxReviewUnknownReason = "invalid-document" | "invalid-comments" | "invalid-comments-extended" | "resource-limit" | "unsupported-location";
25
25
  type DocxReviewFactSet<T> = readonly [status: "known", items: readonly T[]] | readonly [status: "unknown", reason: DocxReviewUnknownReason];
26
- type DocxRevisionKind = "insertion" | "deletion" | "moveFrom" | "moveTo" | "cellIns" | "cellDel" | "cellMerge" | "pPrChange" | "rPrChange" | "sectPrChange" | "tblPrChange" | "trPrChange" | "tcPrChange" | "tblGridChange" | "customXmlDelRangeStart" | "customXmlDelRangeEnd" | "customXmlInsRangeStart" | "customXmlInsRangeEnd" | "customXmlMoveFromRangeStart" | "customXmlMoveFromRangeEnd" | "customXmlMoveToRangeStart" | "customXmlMoveToRangeEnd";
26
+ type DocxRevisionKind = "insertion" | "deletion" | "moveFrom" | "moveTo" | "cellIns" | "cellDel" | "cellMerge" | "pPrChange" | "rPrChange" | "sectPrChange" | "tblPrChange" | "tblPrExChange" | "trPrChange" | "tcPrChange" | "tblGridChange" | "customXmlDelRangeStart" | "customXmlDelRangeEnd" | "customXmlInsRangeStart" | "customXmlInsRangeEnd" | "customXmlMoveFromRangeStart" | "customXmlMoveFromRangeEnd" | "customXmlMoveToRangeStart" | "customXmlMoveToRangeEnd";
27
27
  /**
28
28
  * Attributed revision wire tuple. Known content is flattened into the item so
29
29
  * one review fact creates one JavaScript array at the WASM boundary.
30
30
  */
31
- type DocxAttributedRevision = readonly [type: DocxRevisionKind, author: string, date: string | null, revisionId: string | null, contentStatus: "known", startParagraphOrdinal: number, startUtf8: number, startUtf16: number, endParagraphOrdinal: number, endUtf8: number, endUtf16: number, text: string, contentKind: "text" | "formatting-only"] | readonly [type: DocxRevisionKind, author: string, date: string | null, revisionId: string | null, contentStatus: "unknown", reason: DocxReviewUnknownReason];
31
+ type DocxAttributedRevision = readonly [type: DocxRevisionKind, author: string, date: string | null, revisionId: string | null, contentStatus: "known", startParagraphOrdinal: number, startUtf8: number, startUtf16: number, endParagraphOrdinal: number, endUtf8: number, endUtf16: number, text: string, contentKind: "text" | "formatting-only" | "paragraph-mark"] | readonly [type: DocxRevisionKind, author: string, date: string | null, revisionId: string | null, contentStatus: "unknown", reason: DocxReviewUnknownReason];
32
32
  /**
33
33
  * Attributed comment wire tuple. Known content is flattened into the item so
34
34
  * one review fact creates one JavaScript array at the WASM boundary.
@@ -0,0 +1,12 @@
1
+ import JSZip from "jszip";
2
+ //#region src/zip/writeZipPart.d.ts
3
+ type WriteZipPartOptions = {
4
+ zip: JSZip;
5
+ path: string;
6
+ data: Parameters<JSZip["loadAsync"]>[0];
7
+ options?: Omit<JSZip.JSZipFileOptions, "createFolders">;
8
+ };
9
+ /** Write exactly one entry, without synthesizing parent directory entries. */
10
+ declare const writeZipPart: ({ zip, path, data, options }: WriteZipPartOptions) => void;
11
+ //#endregion
12
+ export { writeZipPart };
@@ -0,0 +1,12 @@
1
+ //#region src/zip/writeZipPart.ts
2
+ const FIXED_ZIP_DATE_MS = Date.UTC(2e3, 0, 1);
3
+ /** Write exactly one entry, without synthesizing parent directory entries. */
4
+ const writeZipPart = ({ zip, path, data, options }) => {
5
+ zip.file(path, data, {
6
+ ...options,
7
+ date: options?.date ?? new Date(FIXED_ZIP_DATE_MS),
8
+ createFolders: false
9
+ });
10
+ };
11
+ //#endregion
12
+ export { writeZipPart };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stll/docx-core",
3
- "version": "0.31.0",
3
+ "version": "0.32.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",
@@ -51,6 +51,10 @@
51
51
  "./schema": {
52
52
  "types": "./dist/schema/sequenceChildren.d.ts",
53
53
  "import": "./dist/schema/sequenceChildren.js"
54
+ },
55
+ "./zip": {
56
+ "types": "./dist/zip/writeZipPart.d.ts",
57
+ "import": "./dist/zip/writeZipPart.js"
54
58
  }
55
59
  },
56
60
  "publishConfig": {