@extend-ai/react-docx 0.8.0 → 0.8.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 +16 -6
- package/dist/{chunk-HWEQ63UE.js → chunk-YE7GQOST.js} +28 -3
- package/dist/chunk-YE7GQOST.js.map +1 -0
- package/dist/docx-import-worker.cjs.map +1 -1
- package/dist/docx-import-worker.js +1 -1
- package/dist/docx_wasm_bg.wasm +0 -0
- package/dist/index.cjs +2871 -538
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +186 -37
- package/dist/index.d.ts +186 -37
- package/dist/index.js +2834 -539
- package/dist/index.js.map +1 -1
- package/dist/{src-FCCRPRMV.js → src-AEHDFCS5.js} +2 -2
- package/package.json +1 -1
- package/dist/chunk-HWEQ63UE.js.map +0 -1
- /package/dist/{src-FCCRPRMV.js.map → src-AEHDFCS5.js.map} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -68,7 +68,34 @@ interface TextStyle {
|
|
|
68
68
|
highlight?: string;
|
|
69
69
|
backgroundColor?: string;
|
|
70
70
|
fontSizePt?: number;
|
|
71
|
+
/** Resolved single-family fallback retained for backwards compatibility. */
|
|
71
72
|
fontFamily?: string;
|
|
73
|
+
/** @internal Import-time fallback used to detect fontFamily edits. */
|
|
74
|
+
sourceFontFamily?: string;
|
|
75
|
+
/** Explicit OOXML w:rFonts slots. */
|
|
76
|
+
fontFamilyAscii?: string;
|
|
77
|
+
fontFamilyHAnsi?: string;
|
|
78
|
+
fontFamilyEastAsia?: string;
|
|
79
|
+
fontFamilyCs?: string;
|
|
80
|
+
fontThemeAscii?: string;
|
|
81
|
+
fontThemeHAnsi?: string;
|
|
82
|
+
fontThemeEastAsia?: string;
|
|
83
|
+
fontThemeCs?: string;
|
|
84
|
+
/** @internal Concrete families resolved from the document theme per slot. */
|
|
85
|
+
resolvedFontFamilyAscii?: string;
|
|
86
|
+
/** @internal Concrete families resolved from the document theme per slot. */
|
|
87
|
+
resolvedFontFamilyHAnsi?: string;
|
|
88
|
+
/** @internal Concrete families resolved from the document theme per slot. */
|
|
89
|
+
resolvedFontFamilyEastAsia?: string;
|
|
90
|
+
/** @internal Concrete families resolved from the document theme per slot. */
|
|
91
|
+
resolvedFontFamilyCs?: string;
|
|
92
|
+
fontHint?: string;
|
|
93
|
+
/** OOXML w:lang slots and complex-script direction controls. */
|
|
94
|
+
language?: string;
|
|
95
|
+
languageEastAsia?: string;
|
|
96
|
+
languageBidi?: string;
|
|
97
|
+
rightToLeft?: boolean;
|
|
98
|
+
complexScript?: boolean;
|
|
72
99
|
characterSpacingTwips?: number;
|
|
73
100
|
verticalAlign?: "superscript" | "subscript";
|
|
74
101
|
runBorder?: TextRunBorderStyle;
|
|
@@ -240,6 +267,22 @@ interface ParagraphNode {
|
|
|
240
267
|
style?: ParagraphStyle;
|
|
241
268
|
paragraphMarkDeleted?: boolean;
|
|
242
269
|
sourceXml?: string;
|
|
270
|
+
/** @internal Validated provenance for a surgical plain-text sourceXml patch. */
|
|
271
|
+
sourceTextPatch?: {
|
|
272
|
+
runs: Array<{
|
|
273
|
+
style?: TextStyle;
|
|
274
|
+
link?: string;
|
|
275
|
+
noteReference?: TextRunNode["noteReference"];
|
|
276
|
+
}>;
|
|
277
|
+
};
|
|
278
|
+
/** @internal Immutable import-time run metadata used by surgical editors. */
|
|
279
|
+
sourceRunProvenance?: {
|
|
280
|
+
runs: Array<{
|
|
281
|
+
style?: TextStyle;
|
|
282
|
+
link?: string;
|
|
283
|
+
noteReference?: TextRunNode["noteReference"];
|
|
284
|
+
}>;
|
|
285
|
+
};
|
|
243
286
|
}
|
|
244
287
|
interface TableBoxSpacing {
|
|
245
288
|
topTwips?: number;
|
|
@@ -318,6 +361,11 @@ interface TableNode {
|
|
|
318
361
|
rows: TableRowNode[];
|
|
319
362
|
style?: TableStyle;
|
|
320
363
|
sourceXml?: string;
|
|
364
|
+
/** @internal Validated text-only descendant replacements for sourceXml. */
|
|
365
|
+
sourceTextPatches?: Array<{
|
|
366
|
+
sourceParagraphXml: string;
|
|
367
|
+
paragraph: ParagraphNode;
|
|
368
|
+
}>;
|
|
321
369
|
}
|
|
322
370
|
type DocNode = ParagraphNode | TableNode;
|
|
323
371
|
interface HeaderSection {
|
|
@@ -409,6 +457,16 @@ interface DocumentCommentDefinition {
|
|
|
409
457
|
parentId?: number;
|
|
410
458
|
/** True when the comment thread is marked done in commentsExtended. */
|
|
411
459
|
resolved?: boolean;
|
|
460
|
+
/** @internal Original `w:comment` block retained for lossless serialization. */
|
|
461
|
+
sourceXml?: string;
|
|
462
|
+
/** @internal Final comment paragraph id used by `commentsExtended.xml`. */
|
|
463
|
+
extendedParagraphId?: string;
|
|
464
|
+
/** @internal Resolution state read from `commentsExtended.xml`. */
|
|
465
|
+
sourceResolved?: boolean;
|
|
466
|
+
/** @internal True when `resolved` differs from the imported state. */
|
|
467
|
+
resolutionDirty?: boolean;
|
|
468
|
+
/** @internal True for a comment created in the editor rather than imported. */
|
|
469
|
+
isNew?: boolean;
|
|
412
470
|
}
|
|
413
471
|
interface DocumentCompatibilitySettings {
|
|
414
472
|
suppressSpacingBeforeAfterPageBreak?: boolean;
|
|
@@ -541,6 +599,83 @@ interface LayoutPage {
|
|
|
541
599
|
}
|
|
542
600
|
declare function layoutDocument(model: DocModel, options?: LayoutOptions): LayoutPage[];
|
|
543
601
|
|
|
602
|
+
type AnnotationMutationFailureReason = "stale" | "unsupported" | "unsafe-xml";
|
|
603
|
+
type AnnotationMutationResult = {
|
|
604
|
+
ok: true;
|
|
605
|
+
model: DocModel;
|
|
606
|
+
} | {
|
|
607
|
+
ok: false;
|
|
608
|
+
reason: AnnotationMutationFailureReason;
|
|
609
|
+
};
|
|
610
|
+
type CommentCreationResult = {
|
|
611
|
+
ok: true;
|
|
612
|
+
model: DocModel;
|
|
613
|
+
commentId: number;
|
|
614
|
+
} | {
|
|
615
|
+
ok: false;
|
|
616
|
+
reason: AnnotationMutationFailureReason;
|
|
617
|
+
};
|
|
618
|
+
type ParagraphRevisionKind = "insertion" | "deletion" | "move-from" | "move-to" | "format-change" | "paragraph-format-change";
|
|
619
|
+
interface ParagraphRevisionTarget {
|
|
620
|
+
/** Top-level body node containing the revision. Table locations are unsupported. */
|
|
621
|
+
nodeIndex: number;
|
|
622
|
+
/** OOXML `w:id` from the `w:ins` or `w:del` wrapper. */
|
|
623
|
+
revisionId: string | number;
|
|
624
|
+
kind: ParagraphRevisionKind;
|
|
625
|
+
}
|
|
626
|
+
interface CreateParagraphCommentInput {
|
|
627
|
+
/** Top-level body paragraph index. */
|
|
628
|
+
nodeIndex: number;
|
|
629
|
+
/** UTF-16 offsets into the paragraph's plain text, matching DOM selection offsets. */
|
|
630
|
+
startOffset: number;
|
|
631
|
+
endOffset: number;
|
|
632
|
+
text: string;
|
|
633
|
+
author?: string;
|
|
634
|
+
initials?: string;
|
|
635
|
+
date?: string;
|
|
636
|
+
}
|
|
637
|
+
declare function acceptParagraphRevision(model: DocModel, target: ParagraphRevisionTarget): AnnotationMutationResult;
|
|
638
|
+
declare function rejectParagraphRevision(model: DocModel, target: ParagraphRevisionTarget): AnnotationMutationResult;
|
|
639
|
+
declare function setCommentResolved(model: DocModel, commentId: number, resolved: boolean): AnnotationMutationResult;
|
|
640
|
+
/**
|
|
641
|
+
* Creates a comment over a plain-text range in one top-level paragraph. The
|
|
642
|
+
* operation splits only the boundary runs and preserves their original rPr.
|
|
643
|
+
*/
|
|
644
|
+
declare function createParagraphComment(model: DocModel, input: CreateParagraphCommentInput): CommentCreationResult;
|
|
645
|
+
|
|
646
|
+
interface InsertParagraphOptions {
|
|
647
|
+
paragraphStyle?: ParagraphStyle;
|
|
648
|
+
runStyle?: TextStyle;
|
|
649
|
+
}
|
|
650
|
+
interface UpdateTextOptions {
|
|
651
|
+
insertedStyle?: TextStyle;
|
|
652
|
+
}
|
|
653
|
+
declare function splitParagraphChildrenAtTextOffsets(paragraph: ParagraphNode, text: string, startOffset: number, endOffset: number, options?: {
|
|
654
|
+
beforeInsertedStyle?: TextStyle;
|
|
655
|
+
afterInsertedStyle?: TextStyle;
|
|
656
|
+
}): {
|
|
657
|
+
beforeChildren: ParagraphNode["children"];
|
|
658
|
+
afterChildren: ParagraphNode["children"];
|
|
659
|
+
};
|
|
660
|
+
declare function insertParagraph(model: DocModel, text: string, index?: number, options?: InsertParagraphOptions): DocModel;
|
|
661
|
+
declare function removeParagraph(model: DocModel, index: number): DocModel;
|
|
662
|
+
declare function duplicateParagraph(model: DocModel, index: number): DocModel;
|
|
663
|
+
declare function updateParagraphText(model: DocModel, index: number, text: string, options?: UpdateTextOptions): DocModel;
|
|
664
|
+
declare function updateTableCellText(model: DocModel, tableIndex: number, rowIndex: number, cellIndex: number, text: string, options?: UpdateTextOptions): DocModel;
|
|
665
|
+
declare function updateTableCellParagraphText(model: DocModel, tableIndex: number, rowIndex: number, cellIndex: number, paragraphIndex: number, text: string, options?: UpdateTextOptions): DocModel;
|
|
666
|
+
declare function updateTableCellParagraphTextRecursive(model: DocModel, tableIndex: number, rowIndex: number, cellIndex: number, paragraphIndex: number, text: string, options?: UpdateTextOptions): DocModel;
|
|
667
|
+
declare function replaceText(model: DocModel, searchValue: string | RegExp, replacement: string): DocModel;
|
|
668
|
+
declare function setParagraphHeading(model: DocModel, nodeIndex: number, headingLevel?: HeadingLevel): DocModel;
|
|
669
|
+
declare function setParagraphAlignment(model: DocModel, nodeIndex: number, align?: ParagraphAlignment): DocModel;
|
|
670
|
+
declare function applyRunStyle(model: DocModel, nodeIndex: number, runIndex: number, style: Partial<TextStyle>): DocModel;
|
|
671
|
+
declare function toggleRunStyleFlag(model: DocModel, nodeIndex: number, runIndex: number, key: "bold" | "italic" | "underline" | "strike"): DocModel;
|
|
672
|
+
declare function setRunHighlight(model: DocModel, nodeIndex: number, runIndex: number, highlight?: string): DocModel;
|
|
673
|
+
declare function setRunColor(model: DocModel, nodeIndex: number, runIndex: number, color?: string): DocModel;
|
|
674
|
+
declare function copyParagraphs(model: DocModel, startIndex: number, endIndex?: number): ParagraphNode[];
|
|
675
|
+
declare function pasteParagraphs(model: DocModel, index: number, paragraphs: ParagraphNode[]): DocModel;
|
|
676
|
+
declare function serializeParagraphsForClipboard(paragraphs: ParagraphNode[]): string;
|
|
677
|
+
declare function parseParagraphsFromClipboard(input: string): ParagraphNode[] | undefined;
|
|
678
|
+
|
|
544
679
|
interface DocumentLayoutMetrics {
|
|
545
680
|
pageWidthPx: number;
|
|
546
681
|
pageHeightPx: number;
|
|
@@ -647,7 +782,15 @@ type DocxImageDropTarget = ParagraphLocation & {
|
|
|
647
782
|
type DocxTrackedChangeKind = "insertion" | "deletion" | "move-from" | "move-to" | "format-change" | "paragraph-format-change";
|
|
648
783
|
interface DocxTrackedChange {
|
|
649
784
|
id: string;
|
|
785
|
+
/** Document generation that produced this handle. */
|
|
786
|
+
documentLoadNonce: number;
|
|
787
|
+
/** Stable block identity used to reject shifted/stale handles. */
|
|
788
|
+
blockId?: string;
|
|
789
|
+
/** Opaque source-state signature used to fail closed after mutation. */
|
|
790
|
+
sourceFingerprint: string;
|
|
650
791
|
inlineAnchorId?: string;
|
|
792
|
+
/** OOXML `w:id` used by safe accept/reject operations. */
|
|
793
|
+
revisionId?: string;
|
|
651
794
|
kind: DocxTrackedChangeKind;
|
|
652
795
|
author?: string;
|
|
653
796
|
date?: string;
|
|
@@ -665,6 +808,12 @@ interface DocxTrackedChange {
|
|
|
665
808
|
interface DocxComment {
|
|
666
809
|
/** Stable identifier (unique per rendered anchor). */
|
|
667
810
|
id: string;
|
|
811
|
+
/** Document generation that produced this handle. */
|
|
812
|
+
documentLoadNonce: number;
|
|
813
|
+
/** Stable block identity used to reject shifted/stale handles. */
|
|
814
|
+
blockId?: string;
|
|
815
|
+
/** Opaque source/comment signature used to fail closed after mutation. */
|
|
816
|
+
sourceFingerprint: string;
|
|
668
817
|
/** Comment id from `word/comments.xml` (`w:id`). */
|
|
669
818
|
commentId: number;
|
|
670
819
|
author?: string;
|
|
@@ -681,6 +830,25 @@ interface DocxComment {
|
|
|
681
830
|
nodeIndex: number;
|
|
682
831
|
location: DocxTextRangeLocation;
|
|
683
832
|
}
|
|
833
|
+
type DocxAnnotationCommandFailureReason = AnnotationMutationFailureReason;
|
|
834
|
+
type DocxAnnotationCommandResult = {
|
|
835
|
+
ok: true;
|
|
836
|
+
} | {
|
|
837
|
+
ok: false;
|
|
838
|
+
reason: DocxAnnotationCommandFailureReason;
|
|
839
|
+
};
|
|
840
|
+
type DocxCommentCreationCommandResult = {
|
|
841
|
+
ok: true;
|
|
842
|
+
commentId: number;
|
|
843
|
+
} | {
|
|
844
|
+
ok: false;
|
|
845
|
+
reason: DocxAnnotationCommandFailureReason;
|
|
846
|
+
};
|
|
847
|
+
interface DocxCreateCommentOptions {
|
|
848
|
+
author?: string;
|
|
849
|
+
initials?: string;
|
|
850
|
+
date?: string;
|
|
851
|
+
}
|
|
684
852
|
type DocxLineSpacingRule = "auto" | "exact" | "atLeast";
|
|
685
853
|
type DocxSelectionSessionKind = "idle" | "pointer" | "keyboard" | "composition" | "command" | "history-restore";
|
|
686
854
|
interface DocxLineSpacingInfo {
|
|
@@ -798,6 +966,10 @@ interface DocxEditorController {
|
|
|
798
966
|
syncPaginationInfo: (pagination: DocxPaginationInfo) => void;
|
|
799
967
|
toggleShowTrackedChanges: () => void;
|
|
800
968
|
toggleShowComments: () => void;
|
|
969
|
+
acceptTrackedChange: (change: DocxTrackedChange) => DocxAnnotationCommandResult;
|
|
970
|
+
rejectTrackedChange: (change: DocxTrackedChange) => DocxAnnotationCommandResult;
|
|
971
|
+
createComment: (text: string, options?: DocxCreateCommentOptions) => DocxCommentCreationCommandResult;
|
|
972
|
+
setCommentResolved: (comment: DocxComment, resolved: boolean) => DocxAnnotationCommandResult;
|
|
801
973
|
importDocxFile: (file: File) => Promise<void>;
|
|
802
974
|
newDocument: () => void;
|
|
803
975
|
exportDocx: () => void;
|
|
@@ -1201,6 +1373,10 @@ interface DocxTrackedChangeCardRenderProps {
|
|
|
1201
1373
|
pageIndex: number;
|
|
1202
1374
|
/** Positioning style computed by the viewer. Apply this to the card root. */
|
|
1203
1375
|
style: React.CSSProperties;
|
|
1376
|
+
/** Accept this change. Unsupported or stale markup fails closed. */
|
|
1377
|
+
accept: () => DocxAnnotationCommandResult;
|
|
1378
|
+
/** Reject this change. Unsupported or stale markup fails closed. */
|
|
1379
|
+
reject: () => DocxAnnotationCommandResult;
|
|
1204
1380
|
}
|
|
1205
1381
|
interface DocxCommentCardRenderProps {
|
|
1206
1382
|
/** Comment data represented by the card. */
|
|
@@ -1217,6 +1393,8 @@ interface DocxCommentCardRenderProps {
|
|
|
1217
1393
|
pageIndex: number;
|
|
1218
1394
|
/** Positioning style computed by the viewer. Apply this to the card root. */
|
|
1219
1395
|
style: React.CSSProperties;
|
|
1396
|
+
/** Mark the comment resolved or reopen it. */
|
|
1397
|
+
setResolved: (resolved: boolean) => DocxAnnotationCommandResult;
|
|
1220
1398
|
}
|
|
1221
1399
|
/**
|
|
1222
1400
|
* Viewer interaction mode.
|
|
@@ -1261,6 +1439,8 @@ interface UseDocxTrackChangesResult {
|
|
|
1261
1439
|
toggleShowTrackedChanges: () => void;
|
|
1262
1440
|
changesByLocation: Map<string, DocxTrackedChange[]>;
|
|
1263
1441
|
getChangesForLocation: (location: DocxTextRangeLocation) => DocxTrackedChange[];
|
|
1442
|
+
acceptChange: (change: DocxTrackedChange) => DocxAnnotationCommandResult;
|
|
1443
|
+
rejectChange: (change: DocxTrackedChange) => DocxAnnotationCommandResult;
|
|
1264
1444
|
}
|
|
1265
1445
|
interface UseDocxCommentsResult {
|
|
1266
1446
|
comments: DocxComment[];
|
|
@@ -1269,6 +1449,8 @@ interface UseDocxCommentsResult {
|
|
|
1269
1449
|
toggleShowComments: () => void;
|
|
1270
1450
|
commentsByLocation: Map<string, DocxComment[]>;
|
|
1271
1451
|
getCommentsForLocation: (location: DocxTextRangeLocation) => DocxComment[];
|
|
1452
|
+
createComment: (text: string, options?: DocxCreateCommentOptions) => DocxCommentCreationCommandResult;
|
|
1453
|
+
setCommentResolved: (comment: DocxComment, resolved: boolean) => DocxAnnotationCommandResult;
|
|
1272
1454
|
}
|
|
1273
1455
|
interface DocxSectionColumnLayout {
|
|
1274
1456
|
count: number;
|
|
@@ -1473,50 +1655,17 @@ declare function useDocxImageWrapMenu(menu: Pick<DocxContextMenuRenderProps, "co
|
|
|
1473
1655
|
declare function useDocxLineSpacing(editor: Pick<DocxEditorController, "selectedLineSpacing" | "setLineSpacing">): UseDocxLineSpacingResult;
|
|
1474
1656
|
declare function useDocxBorders(editor: Pick<DocxEditorController, "selectedBorderContext" | "activeBorderPresets" | "applyBorderPreset">): UseDocxBordersResult;
|
|
1475
1657
|
declare function useDocxFormFields(editor: Pick<DocxEditorController, "model" | "selectedFormField" | "selectFormField" | "setFormFieldValue" | "toggleFormCheckbox" | "updateFormFieldWidget">): UseDocxFormFieldsResult;
|
|
1476
|
-
declare function useDocxTrackChanges(editor: Pick<DocxEditorController, "trackedChanges" | "showTrackedChanges" | "setShowTrackedChanges" | "toggleShowTrackedChanges">): UseDocxTrackChangesResult;
|
|
1658
|
+
declare function useDocxTrackChanges(editor: Pick<DocxEditorController, "trackedChanges" | "showTrackedChanges" | "setShowTrackedChanges" | "toggleShowTrackedChanges" | "acceptTrackedChange" | "rejectTrackedChange">): UseDocxTrackChangesResult;
|
|
1477
1659
|
/**
|
|
1478
1660
|
* Exposes document comments and the show/hide state, mirroring
|
|
1479
1661
|
* `useDocxTrackChanges`. Pair with `DocxEditorViewer`'s `renderCommentCard`
|
|
1480
1662
|
* to fully customize how comments render.
|
|
1481
1663
|
*/
|
|
1482
|
-
declare function useDocxComments(editor: Pick<DocxEditorController, "comments" | "showComments" | "setShowComments" | "toggleShowComments">): UseDocxCommentsResult;
|
|
1664
|
+
declare function useDocxComments(editor: Pick<DocxEditorController, "comments" | "showComments" | "setShowComments" | "toggleShowComments" | "createComment" | "setCommentResolved">): UseDocxCommentsResult;
|
|
1483
1665
|
declare function useDocxPageLayout(editor: Pick<DocxEditorController, "model">): UseDocxPageLayoutResult;
|
|
1484
1666
|
declare function useDocxPagination(editor: Pick<DocxEditorController, "currentPage" | "totalPages">): UseDocxPaginationResult;
|
|
1485
1667
|
declare function DocxEditorViewer({ editor, className, style, pageBackgroundColor, pageGapBackgroundColor, deferInitialPaginationPaint, loadingState, pageVirtualization, visiblePageRange, onPageCountChange, onRequestPageReveal, headingStyles, showTrackedChanges, renderTrackedChangeCard, showComments, renderCommentCard, renderTableContextMenu, renderContextMenu, onFormFieldDoubleClick, mode, }: DocxEditorViewerProps): React.JSX.Element;
|
|
1486
1668
|
|
|
1487
|
-
interface InsertParagraphOptions {
|
|
1488
|
-
paragraphStyle?: ParagraphStyle;
|
|
1489
|
-
runStyle?: TextStyle;
|
|
1490
|
-
}
|
|
1491
|
-
interface UpdateTextOptions {
|
|
1492
|
-
insertedStyle?: TextStyle;
|
|
1493
|
-
}
|
|
1494
|
-
declare function splitParagraphChildrenAtTextOffsets(paragraph: ParagraphNode, text: string, startOffset: number, endOffset: number, options?: {
|
|
1495
|
-
beforeInsertedStyle?: TextStyle;
|
|
1496
|
-
afterInsertedStyle?: TextStyle;
|
|
1497
|
-
}): {
|
|
1498
|
-
beforeChildren: ParagraphNode["children"];
|
|
1499
|
-
afterChildren: ParagraphNode["children"];
|
|
1500
|
-
};
|
|
1501
|
-
declare function insertParagraph(model: DocModel, text: string, index?: number, options?: InsertParagraphOptions): DocModel;
|
|
1502
|
-
declare function removeParagraph(model: DocModel, index: number): DocModel;
|
|
1503
|
-
declare function duplicateParagraph(model: DocModel, index: number): DocModel;
|
|
1504
|
-
declare function updateParagraphText(model: DocModel, index: number, text: string, options?: UpdateTextOptions): DocModel;
|
|
1505
|
-
declare function updateTableCellText(model: DocModel, tableIndex: number, rowIndex: number, cellIndex: number, text: string, options?: UpdateTextOptions): DocModel;
|
|
1506
|
-
declare function updateTableCellParagraphText(model: DocModel, tableIndex: number, rowIndex: number, cellIndex: number, paragraphIndex: number, text: string, options?: UpdateTextOptions): DocModel;
|
|
1507
|
-
declare function updateTableCellParagraphTextRecursive(model: DocModel, tableIndex: number, rowIndex: number, cellIndex: number, paragraphIndex: number, text: string, options?: UpdateTextOptions): DocModel;
|
|
1508
|
-
declare function replaceText(model: DocModel, searchValue: string | RegExp, replacement: string): DocModel;
|
|
1509
|
-
declare function setParagraphHeading(model: DocModel, nodeIndex: number, headingLevel?: HeadingLevel): DocModel;
|
|
1510
|
-
declare function setParagraphAlignment(model: DocModel, nodeIndex: number, align?: ParagraphAlignment): DocModel;
|
|
1511
|
-
declare function applyRunStyle(model: DocModel, nodeIndex: number, runIndex: number, style: Partial<TextStyle>): DocModel;
|
|
1512
|
-
declare function toggleRunStyleFlag(model: DocModel, nodeIndex: number, runIndex: number, key: "bold" | "italic" | "underline" | "strike"): DocModel;
|
|
1513
|
-
declare function setRunHighlight(model: DocModel, nodeIndex: number, runIndex: number, highlight?: string): DocModel;
|
|
1514
|
-
declare function setRunColor(model: DocModel, nodeIndex: number, runIndex: number, color?: string): DocModel;
|
|
1515
|
-
declare function copyParagraphs(model: DocModel, startIndex: number, endIndex?: number): ParagraphNode[];
|
|
1516
|
-
declare function pasteParagraphs(model: DocModel, index: number, paragraphs: ParagraphNode[]): DocModel;
|
|
1517
|
-
declare function serializeParagraphsForClipboard(paragraphs: ParagraphNode[]): string;
|
|
1518
|
-
declare function parseParagraphsFromClipboard(input: string): ParagraphNode[] | undefined;
|
|
1519
|
-
|
|
1520
1669
|
interface ResolvedModelSection {
|
|
1521
1670
|
startNodeIndex: number;
|
|
1522
1671
|
sectionPropertiesXml?: string;
|
|
@@ -1797,6 +1946,6 @@ interface UseDocxModelState {
|
|
|
1797
1946
|
error?: Error;
|
|
1798
1947
|
}
|
|
1799
1948
|
declare function useDocxModel(file?: ArrayBuffer): UseDocxModelState;
|
|
1800
|
-
declare function ReactDocxViewer({ file, model, className, layoutOptions, emptyState }: ReactDocxViewerProps): React.JSX.Element;
|
|
1949
|
+
declare function ReactDocxViewer({ file, model, className, layoutOptions, emptyState, }: ReactDocxViewerProps): React.JSX.Element;
|
|
1801
1950
|
|
|
1802
|
-
export { DEFAULT_MIN_PARAGRAPH_LINE_HEIGHT_PX, DEFAULT_PAGE_OVERFLOW_TOLERANCE_PX, type DocModel, type DocNode, type DocumentCommentDefinition, type DocumentCompatibilitySettings, type DocumentNoteDefinition, type DocumentPageNodeSegment, type DocumentPageRange, type DocumentPageSegmentationOptions, type DocumentSection, type DocxBorderContext, type DocxBorderPreset, type DocxBorderPresetState, type DocxComment, type DocxCommentCardRenderProps, type DocxContextMenuAction, type DocxContextMenuActionId, type DocxContextMenuContext, type DocxContextMenuRenderProps, type DocxDocumentTheme, type DocxEditorController, type DocxEditorSelection, DocxEditorViewer, type DocxEditorViewerMode, type DocxEditorViewerProps, type DocxFormFieldLocation, type DocxHeadingStyleMap, type DocxImageDropTarget, type DocxImageLocation, type DocxImageWrapMenuOption, type DocxImageWrapMode, type DocxImageWrapState, type DocxLineSpacingInfo, type DocxListType, type DocxPageLayoutInfo, type DocxPageThumbnailBounds, type DocxPageThumbnailItem, type DocxPageThumbnailRenderWindow, type DocxPageThumbnailResolution, type DocxPageThumbnailResolutionOptions, type DocxPageThumbnailStatus, type DocxPageVirtualizationOptions, type DocxPaginationInfo, type DocxSectionColumnLayout, type DocxSelectedFormField, type DocxTableContextMenuAction, type DocxTableContextMenuActionId, type DocxTableContextMenuContext, type DocxTableContextMenuRenderProps, type DocxTextRange, type DocxTextRangeLocation, type DocxTrackedChange, type DocxTrackedChangeCardRenderProps, type DocxTrackedChangeKind, type DocxViewerThumbnails, type DocxVisiblePageRange, type FooterSection, type FormFieldCheckboxWidgetSettings, type FormFieldDropdownWidgetSettings, type FormFieldOption, type FormFieldRunNode, type FormFieldSourceKind, type FormFieldTextWidgetSettings, type FormFieldType, type FormFieldWidgetSettings, type HeaderSection, type HeadingLevel, type ImageRunNode, type InsertParagraphOptions, type LayoutBlock, type LayoutFragmentSource, type LayoutImageRun, type LayoutOptions, type LayoutPage, type LayoutParagraphBlock, type LayoutRun, type LayoutSnapshot, type LayoutSnapshotBlockFragment, type LayoutSnapshotImageRun, type LayoutSnapshotMargins, type LayoutSnapshotOptions, type LayoutSnapshotPage, type LayoutSnapshotPageSize, type LayoutSnapshotParagraphFragment, type LayoutSnapshotRect, type LayoutSnapshotRun, type LayoutSnapshotTableCellFragment, type LayoutSnapshotTableFragment, type LayoutSnapshotTableRowFragment, type LayoutSnapshotTextRun, type LayoutTableBlock, type LayoutTableCell, type LayoutTableRow, type LayoutTextRun, type LegacyWasmOoxmlPackage, type LetterheadColumnSegmentGroup, type NumberingAbstractDefinition, type NumberingDefinitionSet, type NumberingInstanceDefinition, type NumberingLevelDefinition, type NumberingPictureBulletDefinition, type OoxmlPackage, type OoxmlPart, type OverflowBreakCollectionOptions, type PageSegmentationCallbacks, type PaginationSectionMetrics, type ParagraphAlignment, type ParagraphBorderSet, type ParagraphBorderStyle, type ParagraphChildNode, type ParagraphIndent, type ParagraphLineRange, type ParagraphNode, type ParagraphNumbering, type ParagraphSpacing, type ParagraphSplitControlOptions, type ParagraphStyle, type ParagraphStyleDefinition, type ParagraphTabStop, ReactDocxViewer, type ReactDocxViewerProps, type ResolvedDocument, type ResolvedDocumentSection, type ResolvedLayoutMetrics, type ResolvedModelSection, type TableBorderSet, type TableBorderStyle, type TableBoxSpacing, type TableCellContentNode, type TableCellNode, type TableCellStyle, type TableExplicitPageBreakInfo, type TableNode, type TableRowNode, type TableRowRange, type TableRowStyle, type TableStyle, type TextRunBorderStyle, type TextRunNode, type TextStyle, type UpdateTextOptions, type UseDocxBordersResult, type UseDocxCommentsResult, type UseDocxDocumentThemeResult, type UseDocxEditorOptions, type UseDocxFormFieldsResult, type UseDocxImageWrapMenuResult, type UseDocxLineSpacingResult, type UseDocxModelState, type UseDocxPageLayoutResult, type UseDocxPageThumbnailsOptions, type UseDocxPageThumbnailsResult, type UseDocxPaginationResult, type UseDocxParagraphStylesResult, type UseDocxTrackChangesResult, type UseDocxViewerThumbnailsOptions, type WasmOoxmlPackage, type WasmSource, allocateBlockId, applyRunStyle, buildDocModel, buildDocModelFromBytes, buildDocumentPageNodeSegments, buildDocumentPageRanges, buildLayoutSnapshot, cloneDocModel, cloneParagraphNode, cloneTableNode, collectDocxEstimatedOverflowBreakStartNodeIndexes, collectDocxHardPageBreakStartNodeIndexes, collectDocxLastRenderedPageBreakStartNodeIndexes, collectDuplicateDocModelBlockIds, collectTableExplicitPageBreakInfo, collectTopLevelExplicitPageBreakStartNodeIndexes, copyParagraphs, createMinimalDocxPackage, deepFreezeDocModel, defaultStarterModel, duplicateParagraph, ensureDocModelBlockIds, getPart, initWasm, insertParagraph, layoutDocument, modelToDocumentXml, normalizeDocModel, packageToArrayBuffer, paragraphAfterSpacingPx, paragraphBeforeSpacingPx, paragraphHasExplicitPageBreak, paragraphHasLastRenderedPageBreak, paragraphHasPageBreakBefore, paragraphLetterheadColumnGroupAtSegmentOffset, paragraphLetterheadFloatSideAtNodeIndex, paragraphStartsWithLastRenderedPageBreak, parseDocx, parseParagraphsFromClipboard, parseSectionLayout, pasteParagraphs, removeParagraph, replaceText, resolveDocumentForLayout, resolveDocumentLayout, resolveDocumentPageSegmentStartNodeIndex, resolveDocumentSectionsFromMetadata, resolveDocxPageThumbnailResolution, resolvePaginationSectionMetricsIndexForNodeIndex, resolveParagraphBeforeSpacingPx, resolveSectionIndexForNodeIndex, resolveSectionPropertiesXmlForNodeIndex, scalePaginationSectionMetricsHeights, scorePaginationAgainstStoredPageBreaks, sectionBreakAfterParagraphStartsNewPage, sectionBreakPropertiesStartNewPage, sectionTitlePageEnabled, selectSectionVariantForPage, serializeDocModel, serializeDocx, serializeParagraphsForClipboard, setParagraphAlignment, setParagraphHeading, setRunColor, setRunHighlight, setWasmSource, splitParagraphChildrenAtTextOffsets, toggleRunStyleFlag, updateParagraphText, updateTableCellParagraphText, updateTableCellParagraphTextRecursive, updateTableCellText, useDocxBorders, useDocxComments, useDocxDocumentTheme, useDocxEditor, useDocxFormFields, useDocxImageWrapMenu, useDocxLineSpacing, useDocxModel, useDocxPageLayout, useDocxPageThumbnails, useDocxPagination, useDocxParagraphStyles, useDocxTrackChanges, useDocxViewerThumbnails, withPart };
|
|
1951
|
+
export { type AnnotationMutationFailureReason, type AnnotationMutationResult, type CommentCreationResult, type CreateParagraphCommentInput, DEFAULT_MIN_PARAGRAPH_LINE_HEIGHT_PX, DEFAULT_PAGE_OVERFLOW_TOLERANCE_PX, type DocModel, type DocNode, type DocumentCommentDefinition, type DocumentCompatibilitySettings, type DocumentNoteDefinition, type DocumentPageNodeSegment, type DocumentPageRange, type DocumentPageSegmentationOptions, type DocumentSection, type DocxAnnotationCommandFailureReason, type DocxAnnotationCommandResult, type DocxBorderContext, type DocxBorderPreset, type DocxBorderPresetState, type DocxComment, type DocxCommentCardRenderProps, type DocxCommentCreationCommandResult, type DocxContextMenuAction, type DocxContextMenuActionId, type DocxContextMenuContext, type DocxContextMenuRenderProps, type DocxCreateCommentOptions, type DocxDocumentTheme, type DocxEditorController, type DocxEditorSelection, DocxEditorViewer, type DocxEditorViewerMode, type DocxEditorViewerProps, type DocxFormFieldLocation, type DocxHeadingStyleMap, type DocxImageDropTarget, type DocxImageLocation, type DocxImageWrapMenuOption, type DocxImageWrapMode, type DocxImageWrapState, type DocxLineSpacingInfo, type DocxListType, type DocxPageLayoutInfo, type DocxPageThumbnailBounds, type DocxPageThumbnailItem, type DocxPageThumbnailRenderWindow, type DocxPageThumbnailResolution, type DocxPageThumbnailResolutionOptions, type DocxPageThumbnailStatus, type DocxPageVirtualizationOptions, type DocxPaginationInfo, type DocxSectionColumnLayout, type DocxSelectedFormField, type DocxTableContextMenuAction, type DocxTableContextMenuActionId, type DocxTableContextMenuContext, type DocxTableContextMenuRenderProps, type DocxTextRange, type DocxTextRangeLocation, type DocxTrackedChange, type DocxTrackedChangeCardRenderProps, type DocxTrackedChangeKind, type DocxViewerThumbnails, type DocxVisiblePageRange, type FooterSection, type FormFieldCheckboxWidgetSettings, type FormFieldDropdownWidgetSettings, type FormFieldOption, type FormFieldRunNode, type FormFieldSourceKind, type FormFieldTextWidgetSettings, type FormFieldType, type FormFieldWidgetSettings, type HeaderSection, type HeadingLevel, type ImageRunNode, type InsertParagraphOptions, type LayoutBlock, type LayoutFragmentSource, type LayoutImageRun, type LayoutOptions, type LayoutPage, type LayoutParagraphBlock, type LayoutRun, type LayoutSnapshot, type LayoutSnapshotBlockFragment, type LayoutSnapshotImageRun, type LayoutSnapshotMargins, type LayoutSnapshotOptions, type LayoutSnapshotPage, type LayoutSnapshotPageSize, type LayoutSnapshotParagraphFragment, type LayoutSnapshotRect, type LayoutSnapshotRun, type LayoutSnapshotTableCellFragment, type LayoutSnapshotTableFragment, type LayoutSnapshotTableRowFragment, type LayoutSnapshotTextRun, type LayoutTableBlock, type LayoutTableCell, type LayoutTableRow, type LayoutTextRun, type LegacyWasmOoxmlPackage, type LetterheadColumnSegmentGroup, type NumberingAbstractDefinition, type NumberingDefinitionSet, type NumberingInstanceDefinition, type NumberingLevelDefinition, type NumberingPictureBulletDefinition, type OoxmlPackage, type OoxmlPart, type OverflowBreakCollectionOptions, type PageSegmentationCallbacks, type PaginationSectionMetrics, type ParagraphAlignment, type ParagraphBorderSet, type ParagraphBorderStyle, type ParagraphChildNode, type ParagraphIndent, type ParagraphLineRange, type ParagraphNode, type ParagraphNumbering, type ParagraphRevisionKind, type ParagraphRevisionTarget, type ParagraphSpacing, type ParagraphSplitControlOptions, type ParagraphStyle, type ParagraphStyleDefinition, type ParagraphTabStop, ReactDocxViewer, type ReactDocxViewerProps, type ResolvedDocument, type ResolvedDocumentSection, type ResolvedLayoutMetrics, type ResolvedModelSection, type TableBorderSet, type TableBorderStyle, type TableBoxSpacing, type TableCellContentNode, type TableCellNode, type TableCellStyle, type TableExplicitPageBreakInfo, type TableNode, type TableRowNode, type TableRowRange, type TableRowStyle, type TableStyle, type TextRunBorderStyle, type TextRunNode, type TextStyle, type UpdateTextOptions, type UseDocxBordersResult, type UseDocxCommentsResult, type UseDocxDocumentThemeResult, type UseDocxEditorOptions, type UseDocxFormFieldsResult, type UseDocxImageWrapMenuResult, type UseDocxLineSpacingResult, type UseDocxModelState, type UseDocxPageLayoutResult, type UseDocxPageThumbnailsOptions, type UseDocxPageThumbnailsResult, type UseDocxPaginationResult, type UseDocxParagraphStylesResult, type UseDocxTrackChangesResult, type UseDocxViewerThumbnailsOptions, type WasmOoxmlPackage, type WasmSource, acceptParagraphRevision, allocateBlockId, applyRunStyle, buildDocModel, buildDocModelFromBytes, buildDocumentPageNodeSegments, buildDocumentPageRanges, buildLayoutSnapshot, cloneDocModel, cloneParagraphNode, cloneTableNode, collectDocxEstimatedOverflowBreakStartNodeIndexes, collectDocxHardPageBreakStartNodeIndexes, collectDocxLastRenderedPageBreakStartNodeIndexes, collectDuplicateDocModelBlockIds, collectTableExplicitPageBreakInfo, collectTopLevelExplicitPageBreakStartNodeIndexes, copyParagraphs, createMinimalDocxPackage, createParagraphComment, deepFreezeDocModel, defaultStarterModel, duplicateParagraph, ensureDocModelBlockIds, getPart, initWasm, insertParagraph, layoutDocument, modelToDocumentXml, normalizeDocModel, packageToArrayBuffer, paragraphAfterSpacingPx, paragraphBeforeSpacingPx, paragraphHasExplicitPageBreak, paragraphHasLastRenderedPageBreak, paragraphHasPageBreakBefore, paragraphLetterheadColumnGroupAtSegmentOffset, paragraphLetterheadFloatSideAtNodeIndex, paragraphStartsWithLastRenderedPageBreak, parseDocx, parseParagraphsFromClipboard, parseSectionLayout, pasteParagraphs, rejectParagraphRevision, removeParagraph, replaceText, resolveDocumentForLayout, resolveDocumentLayout, resolveDocumentPageSegmentStartNodeIndex, resolveDocumentSectionsFromMetadata, resolveDocxPageThumbnailResolution, resolvePaginationSectionMetricsIndexForNodeIndex, resolveParagraphBeforeSpacingPx, resolveSectionIndexForNodeIndex, resolveSectionPropertiesXmlForNodeIndex, scalePaginationSectionMetricsHeights, scorePaginationAgainstStoredPageBreaks, sectionBreakAfterParagraphStartsNewPage, sectionBreakPropertiesStartNewPage, sectionTitlePageEnabled, selectSectionVariantForPage, serializeDocModel, serializeDocx, serializeParagraphsForClipboard, setCommentResolved, setParagraphAlignment, setParagraphHeading, setRunColor, setRunHighlight, setWasmSource, splitParagraphChildrenAtTextOffsets, toggleRunStyleFlag, updateParagraphText, updateTableCellParagraphText, updateTableCellParagraphTextRecursive, updateTableCellText, useDocxBorders, useDocxComments, useDocxDocumentTheme, useDocxEditor, useDocxFormFields, useDocxImageWrapMenu, useDocxLineSpacing, useDocxModel, useDocxPageLayout, useDocxPageThumbnails, useDocxPagination, useDocxParagraphStyles, useDocxTrackChanges, useDocxViewerThumbnails, withPart };
|