@extend-ai/react-docx 0.9.0 → 0.9.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/dist/index.d.cts CHANGED
@@ -547,6 +547,11 @@ declare function buildDocModel(pkg: OoxmlPackage): Promise<DocModel>;
547
547
  declare function buildDocModelFromBytes(bytes: ArrayBuffer | Uint8Array): Promise<{
548
548
  package: OoxmlPackage;
549
549
  model: DocModel;
550
+ timings: {
551
+ parseMs: number;
552
+ buildModelMs: number;
553
+ totalMs: number;
554
+ };
550
555
  }>;
551
556
 
552
557
  interface LayoutOptions {
@@ -626,7 +631,7 @@ interface DocxImportResult {
626
631
  interface DocxImportOptions {
627
632
  signal?: AbortSignal;
628
633
  transferBuffer?: boolean;
629
- useWorker?: boolean;
634
+ useWorker?: boolean | "required";
630
635
  }
631
636
  interface DocxImportWorkerTimings {
632
637
  totalMs: number;
@@ -811,6 +816,7 @@ interface DocxHistoryRestoreRequest {
811
816
  nonce: number;
812
817
  selection: DocxEditorSelection;
813
818
  activeTextRange?: DocxTextRange;
819
+ textInput?: boolean;
814
820
  }
815
821
  type ParagraphLocation = DocxTextRangeLocation;
816
822
  type DocxImageLocation = ParagraphLocation & {
@@ -837,6 +843,8 @@ interface DocxSelectedFormField {
837
843
  }
838
844
  type DocxImageDropTarget = ParagraphLocation & {
839
845
  childIndex: number;
846
+ /** UTF-16 offset inside the target text run. */
847
+ textOffset?: number;
840
848
  };
841
849
  type DocxTrackedChangeKind = "insertion" | "deletion" | "move-from" | "move-to" | "format-change" | "paragraph-format-change";
842
850
  interface DocxTrackedChange {
@@ -1083,6 +1091,7 @@ interface DocxEditorController {
1083
1091
  setImageWrapMode: (location: DocxImageLocation, mode: DocxImageWrapMode, seedFloating?: Partial<NonNullable<ImageRunNode["floating"]>>) => void;
1084
1092
  moveFloatingImage: (location: DocxImageLocation, patch: Partial<NonNullable<ImageRunNode["floating"]>>, options?: {
1085
1093
  reparentToParagraphNodeIndex?: number;
1094
+ anchorTextOffset?: number;
1086
1095
  }) => void;
1087
1096
  moveSectionFloatingImage: (location: DocxSectionImageLocation, patch: Partial<NonNullable<ImageRunNode["floating"]>>) => void;
1088
1097
  moveParagraphDropCap: (nodeIndex: number, patch: Partial<NonNullable<NonNullable<ParagraphNode["style"]>["dropCap"]>>) => void;
@@ -1104,6 +1113,7 @@ interface DocxEditorController {
1104
1113
  moveTable: (tableIndex: number, targetNodeIndex: number) => void;
1105
1114
  setTableFloating: (tableIndex: number, patch: Partial<NonNullable<NonNullable<TableNode["style"]>["floating"]>>, options?: {
1106
1115
  moveToNodeIndex?: number;
1116
+ anchorTextOffset?: number;
1107
1117
  }) => void;
1108
1118
  moveEmbeddedTableToBody: (tableRuntimeKey: string, targetNodeIndex: number) => void;
1109
1119
  replaceExpandedSelection: (text: string, range?: DocxTextRange) => DocxTextRange | undefined;
package/dist/index.d.ts CHANGED
@@ -547,6 +547,11 @@ declare function buildDocModel(pkg: OoxmlPackage): Promise<DocModel>;
547
547
  declare function buildDocModelFromBytes(bytes: ArrayBuffer | Uint8Array): Promise<{
548
548
  package: OoxmlPackage;
549
549
  model: DocModel;
550
+ timings: {
551
+ parseMs: number;
552
+ buildModelMs: number;
553
+ totalMs: number;
554
+ };
550
555
  }>;
551
556
 
552
557
  interface LayoutOptions {
@@ -626,7 +631,7 @@ interface DocxImportResult {
626
631
  interface DocxImportOptions {
627
632
  signal?: AbortSignal;
628
633
  transferBuffer?: boolean;
629
- useWorker?: boolean;
634
+ useWorker?: boolean | "required";
630
635
  }
631
636
  interface DocxImportWorkerTimings {
632
637
  totalMs: number;
@@ -811,6 +816,7 @@ interface DocxHistoryRestoreRequest {
811
816
  nonce: number;
812
817
  selection: DocxEditorSelection;
813
818
  activeTextRange?: DocxTextRange;
819
+ textInput?: boolean;
814
820
  }
815
821
  type ParagraphLocation = DocxTextRangeLocation;
816
822
  type DocxImageLocation = ParagraphLocation & {
@@ -837,6 +843,8 @@ interface DocxSelectedFormField {
837
843
  }
838
844
  type DocxImageDropTarget = ParagraphLocation & {
839
845
  childIndex: number;
846
+ /** UTF-16 offset inside the target text run. */
847
+ textOffset?: number;
840
848
  };
841
849
  type DocxTrackedChangeKind = "insertion" | "deletion" | "move-from" | "move-to" | "format-change" | "paragraph-format-change";
842
850
  interface DocxTrackedChange {
@@ -1083,6 +1091,7 @@ interface DocxEditorController {
1083
1091
  setImageWrapMode: (location: DocxImageLocation, mode: DocxImageWrapMode, seedFloating?: Partial<NonNullable<ImageRunNode["floating"]>>) => void;
1084
1092
  moveFloatingImage: (location: DocxImageLocation, patch: Partial<NonNullable<ImageRunNode["floating"]>>, options?: {
1085
1093
  reparentToParagraphNodeIndex?: number;
1094
+ anchorTextOffset?: number;
1086
1095
  }) => void;
1087
1096
  moveSectionFloatingImage: (location: DocxSectionImageLocation, patch: Partial<NonNullable<ImageRunNode["floating"]>>) => void;
1088
1097
  moveParagraphDropCap: (nodeIndex: number, patch: Partial<NonNullable<NonNullable<ParagraphNode["style"]>["dropCap"]>>) => void;
@@ -1104,6 +1113,7 @@ interface DocxEditorController {
1104
1113
  moveTable: (tableIndex: number, targetNodeIndex: number) => void;
1105
1114
  setTableFloating: (tableIndex: number, patch: Partial<NonNullable<NonNullable<TableNode["style"]>["floating"]>>, options?: {
1106
1115
  moveToNodeIndex?: number;
1116
+ anchorTextOffset?: number;
1107
1117
  }) => void;
1108
1118
  moveEmbeddedTableToBody: (tableRuntimeKey: string, targetNodeIndex: number) => void;
1109
1119
  replaceExpandedSelection: (text: string, range?: DocxTextRange) => DocxTextRange | undefined;