wordinweb 0.3.5 → 0.3.6

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/collab.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
- import { X as XmlElement, D as DocxDocument, C as ClientMessage, S as ServerMessage, P as PresencePosition, R as RosterEntry, a as ParticipantProfile, I as Intent, b as IdSidecar, L as LineageHead, T as ToolbarFeature, c as ToolbarMode, d as DocxViewApi, M as MissingFont, W as WriteStatus, U as UndoOutcome } from './index-BunX2duN.js';
3
- export { e as bytesToB64, f as deriveEpochKeys, g as docKeyFromFragment, m as mintDocKey, s as sealCheckpoint, h as stretchShareCode } from './index-BunX2duN.js';
2
+ import { X as XmlElement, D as DocxDocument, C as ClientMessage, S as ServerMessage, P as PresencePosition, R as RosterEntry, a as ParticipantProfile, I as Intent, b as IdSidecar, L as LineageHead, T as ToolbarFeature, c as ToolbarMode, d as DocxViewApi, M as MissingFont, W as WriteStatus, U as UndoOutcome } from './index-BWmOQ4GG.js';
3
+ export { e as bytesToB64, f as deriveEpochKeys, g as docKeyFromFragment, m as mintDocKey, s as sealCheckpoint, h as stretchShareCode } from './index-BWmOQ4GG.js';
4
4
 
5
5
  /**
6
6
  * How much of the document an applied intent disturbed — the input to
package/dist/collab.js CHANGED
@@ -90,7 +90,7 @@ import {
90
90
  suggestMeta,
91
91
  validatePastedOoxml,
92
92
  validateRegisteredOperation
93
- } from "./chunk-QU3LB5BC.js";
93
+ } from "./chunk-WPQ6GPG4.js";
94
94
  import "./chunk-7D4SUZUM.js";
95
95
 
96
96
  // src/collab.tsx
@@ -1267,6 +1267,8 @@ declare class Package {
1267
1267
  private files;
1268
1268
  constructor(data: Uint8Array);
1269
1269
  static from(data: ArrayBuffer | Uint8Array): Package;
1270
+ /** A package over an already-unzipped entry map (DocxDocument.clone). */
1271
+ static fromFiles(files: Record<string, Uint8Array>): Package;
1270
1272
  has(name: string): boolean;
1271
1273
  binary(name: string): Uint8Array | undefined;
1272
1274
  text(name: string): string | undefined;
@@ -1852,6 +1854,8 @@ declare class DocxDocument {
1852
1854
  /** The header part roots, in package order. A watermark is authored into
1853
1855
  * every one of them: Word paints it on every page, and a document with a
1854
1856
  * first-page or even-page header has more than one header part. */
1857
+ /** The root of the header or footer part at `target`, if this document has one. */
1858
+ headerFooterRoot(target: string): XmlElement | undefined;
1855
1859
  headerRoots(): XmlElement[];
1856
1860
  /** The footer part roots, in package order — headerRoots' counterpart, for
1857
1861
  * operations that walk both bands (the page-number gallery's removal
@@ -1904,6 +1908,13 @@ declare class DocxDocument {
1904
1908
  private journalSetAttr;
1905
1909
  private normalizePercentageTableGrids;
1906
1910
  save(): Uint8Array;
1911
+ /**
1912
+ * An independent copy: what `DocxDocument.load(doc.save())` gives, without
1913
+ * zipping the package and unzipping it again. compareDocuments starts from a
1914
+ * copy of the revised document, and the round trip through the zip was a
1915
+ * third of its time on a document that had not changed at all.
1916
+ */
1917
+ clone(): DocxDocument;
1907
1918
  saveAsync(): Promise<Uint8Array>;
1908
1919
  private buildPackage;
1909
1920
  private buildPackageFiles;
@@ -1944,9 +1955,31 @@ declare class DocxDocument {
1944
1955
  */
1945
1956
  private ensureRelsRoot;
1946
1957
  /** Register an external hyperlink relationship and return its rId. */
1947
- addHyperlinkRel(url: string): string;
1958
+ /**
1959
+ * Copy the part that `source`'s main-document relationship `relId` points
1960
+ * at into this package, with every part it references in turn (a chart's
1961
+ * embedded workbook, SmartArt's layout, style and colour parts) and their
1962
+ * content types, and add a relationship to it. Returns the new
1963
+ * relationship id, or null when the source has no such internal part.
1964
+ *
1965
+ * compareDocuments needs this for struck content: a removed picture keeps
1966
+ * its w:drawing, and without its image part the result's reject-all
1967
+ * brought the picture back as an empty frame.
1968
+ */
1969
+ adoptRelFrom(source: DocxDocument, relId: string, scope?: {
1970
+ from?: string | null;
1971
+ into?: string | null;
1972
+ }): string | null;
1973
+ /** Give a part copied from `source` the content type it had there. */
1974
+ private adoptContentType;
1975
+ addHyperlinkRel(url: string, ownerPart?: string | null): string;
1948
1976
  /** Retarget an existing external relationship (hyperlink href edit). */
1949
1977
  setRelTarget(relId: string, url: string): boolean;
1978
+ /** The relationships owned by `part` (a header or footer part), or by the
1979
+ * document part when null; a header or footer gets a rels root on demand. */
1980
+ private relsOwnerOf;
1981
+ /** The relationships of `part` (a header or footer), or of the document part. */
1982
+ relationshipsOf(part?: string | null): Relationships;
1950
1983
  /** The relationships of the part that holds `source`: a header or footer
1951
1984
  * part when the element is inside one, else the document part. */
1952
1985
  private imageRelsOwner;
@@ -4013,7 +4046,9 @@ interface CompareNote {
4013
4046
  /** The documents share no paragraph at all; one paragraph mark goes untracked. */
4014
4047
  | "no-common-paragraph"
4015
4048
  /** Original-only content referencing a relationship the result does not have. */
4016
- | "unresolved-relationship";
4049
+ | "unresolved-relationship"
4050
+ /** An input held tracked changes; it was compared as if they were accepted. */
4051
+ | "existing-revisions-accepted";
4017
4052
  detail: string;
4018
4053
  }
4019
4054
 
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  import 'react';
2
- export { A as AgentDocumentViewBinding, i as COLLAB_IMAGE_EXTS, j as CompareResult, k as CompareWithFileOptions, l as CoverPageContent, D as DocxDocument, n as DocxToolbar, o as DocxToolbarProps, p as DocxView, d as DocxViewApi, q as DocxViewProps, r as DrawingTool, E as EncodedCaret, H as HostShortcutSection, t as INSERT_COMMANDS, u as ImageInsertResult, v as InsertCommandSpec, w as LineNumberingPatch, x as MergeRecord, N as NUMBERING_PRESETS, y as NumberingPresetId, z as PageLayoutPatch, B as ParagraphAlignment, F as RASTER_IMAGE_ACCEPT, G as RunFormatPatch, J as ScreenshotInsertResult, K as SelectionFormat, O as ShapePreset, T as ToolbarFeature, Q as ToolbarMenuSelect, V as ToolbarMenuSelectOption, Y as ToolbarMenuSelectProps, c as ToolbarMode, Z as WireRange, _ as compareWithFile, $ as comparedName, a0 as downloadDocx, a1 as layoutDocument, a2 as pickAndCompare, a3 as pickDocx, a4 as printPages, a5 as renderForPrint, a6 as renderToDom, a7 as useAgentDocumentSession } from './index-BunX2duN.js';
2
+ export { A as AgentDocumentViewBinding, i as COLLAB_IMAGE_EXTS, j as CompareResult, k as CompareWithFileOptions, l as CoverPageContent, D as DocxDocument, n as DocxToolbar, o as DocxToolbarProps, p as DocxView, d as DocxViewApi, q as DocxViewProps, r as DrawingTool, E as EncodedCaret, H as HostShortcutSection, t as INSERT_COMMANDS, u as ImageInsertResult, v as InsertCommandSpec, w as LineNumberingPatch, x as MergeRecord, N as NUMBERING_PRESETS, y as NumberingPresetId, z as PageLayoutPatch, B as ParagraphAlignment, F as RASTER_IMAGE_ACCEPT, G as RunFormatPatch, J as ScreenshotInsertResult, K as SelectionFormat, O as ShapePreset, T as ToolbarFeature, Q as ToolbarMenuSelect, V as ToolbarMenuSelectOption, Y as ToolbarMenuSelectProps, c as ToolbarMode, Z as WireRange, _ as compareWithFile, $ as comparedName, a0 as downloadDocx, a1 as layoutDocument, a2 as pickAndCompare, a3 as pickDocx, a4 as printPages, a5 as renderForPrint, a6 as renderToDom, a7 as useAgentDocumentSession } from './index-BWmOQ4GG.js';
package/dist/index.js CHANGED
@@ -17,7 +17,7 @@ import {
17
17
  renderForPrint,
18
18
  renderToDom,
19
19
  useAgentDocumentSession
20
- } from "./chunk-QU3LB5BC.js";
20
+ } from "./chunk-WPQ6GPG4.js";
21
21
  import "./chunk-7D4SUZUM.js";
22
22
  export {
23
23
  COLLAB_IMAGE_EXTS,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wordinweb",
3
- "version": "0.3.5",
3
+ "version": "0.3.6",
4
4
  "description": "React component for high-fidelity DOCX viewing and editing",
5
5
  "license": "MIT",
6
6
  "repository": {