@coco-vexel/coco-office-editor 0.0.0-stage → 1.0.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/LICENSE +202 -0
- package/README.md +510 -2
- package/THIRD_PARTY_NOTICES.md +212 -0
- package/dist/index.cjs +26401 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +12 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +26192 -0
- package/dist/index.js.map +1 -0
- package/dist/model-DB6aN6uJ.d.cts +321 -0
- package/dist/model-DB6aN6uJ.d.ts +321 -0
- package/dist/native-B6B649CC.d.ts +1111 -0
- package/dist/native-Ct9nN06K.d.cts +1111 -0
- package/dist/ppt-native.cjs +5334 -0
- package/dist/ppt-native.cjs.map +1 -0
- package/dist/ppt-native.d.cts +2 -0
- package/dist/ppt-native.d.ts +2 -0
- package/dist/ppt-native.js +5332 -0
- package/dist/ppt-native.js.map +1 -0
- package/dist/ppt.cjs +5426 -0
- package/dist/ppt.cjs.map +1 -0
- package/dist/ppt.d.cts +306 -0
- package/dist/ppt.d.ts +306 -0
- package/dist/ppt.js +5410 -0
- package/dist/ppt.js.map +1 -0
- package/dist/spreadsheet.cjs +4276 -0
- package/dist/spreadsheet.cjs.map +1 -0
- package/dist/spreadsheet.d.cts +676 -0
- package/dist/spreadsheet.d.ts +676 -0
- package/dist/spreadsheet.js +4213 -0
- package/dist/spreadsheet.js.map +1 -0
- package/dist/word-editing.cjs +812 -0
- package/dist/word-editing.cjs.map +1 -0
- package/dist/word-editing.d.cts +149 -0
- package/dist/word-editing.d.ts +149 -0
- package/dist/word-editing.js +803 -0
- package/dist/word-editing.js.map +1 -0
- package/dist/word-native.cjs +13400 -0
- package/dist/word-native.cjs.map +1 -0
- package/dist/word-native.d.cts +4 -0
- package/dist/word-native.d.ts +4 -0
- package/dist/word-native.js +13293 -0
- package/dist/word-native.js.map +1 -0
- package/dist/word-prosemirror.cjs +489 -0
- package/dist/word-prosemirror.cjs.map +1 -0
- package/dist/word-prosemirror.d.cts +21 -0
- package/dist/word-prosemirror.d.ts +21 -0
- package/dist/word-prosemirror.js +483 -0
- package/dist/word-prosemirror.js.map +1 -0
- package/dist/word.cjs +16764 -0
- package/dist/word.cjs.map +1 -0
- package/dist/word.d.cts +84 -0
- package/dist/word.d.ts +84 -0
- package/dist/word.js +16632 -0
- package/dist/word.js.map +1 -0
- package/package.json +106 -3
- package/src/styles/editor.css +1507 -0
package/dist/word.d.cts
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { e as EditorDocumentView, p as EditorParagraphFormat, v as EditorRunFormat, D as EditorTableCellView, j as EditorHyperlink } from './model-DB6aN6uJ.cjs';
|
|
2
|
+
export { E as EditorBlockView, a as EditorBoxEdges, b as EditorCommentSpan, c as EditorContentSegment, d as EditorDocumentDefaults, f as EditorDrawingSegment, g as EditorFieldSegment, h as EditorHeaderFooterRef, i as EditorHeaderFooterStoryView, k as EditorImageSegment, l as EditorNumberingFormat, m as EditorPageLayout, n as EditorParagraphBorder, o as EditorParagraphBorders, q as EditorParagraphSpan, r as EditorParagraphView, s as EditorPlaceholderSegment, t as EditorRevisionSegment, u as EditorRevisionSpan, w as EditorSectionView, x as EditorSegmentKind, y as EditorShading, z as EditorSpanKind, A as EditorTabStop, B as EditorTableBorder, C as EditorTableBorders, F as EditorTableLayout, G as EditorTableLook, H as EditorTableRowView, I as EditorTableView, J as EditorTextSegment, K as EditorTextSpan } from './model-DB6aN6uJ.cjs';
|
|
3
|
+
import { Package } from '@coco-vexel/coco-office/pack';
|
|
4
|
+
import { PackageIndices } from '@coco-vexel/coco-office/word-view';
|
|
5
|
+
export { RevisionInfo } from '@coco-vexel/coco-office/word-view';
|
|
6
|
+
import { B as NativeWordDocument, L as NativeWordParagraphNode, J as NativeWordListType, x as NativeWordBlockNode } from './native-Ct9nN06K.cjs';
|
|
7
|
+
export { N as NativeAnchorLayoutMetadata, a as NativeBlockRangeReplacement, b as NativeCursorPoint, c as NativeDocumentReflowMeasurement, d as NativeParagraphLocation, e as NativePlainTextReplacement, f as NativeSelectedImage, g as NativeTableCellFormatPatch, h as NativeTableCellLocation, i as NativeTableCellPoint, j as NativeTableCellPosition, k as NativeTableCellRange, l as NativeTableClipboardCell, m as NativeTableEditResult, n as NativeTableLocation, o as NativeTablePaginationSummary, p as NativeTableRangeEditResult, q as NativeTableRowBlockSplitPlan, r as NativeTableRowBlockSplitResult, s as NativeTableRowPaginationAnalysis, t as NativeTableRowPaginationKind, u as NativeTableRowPaginationRisk, v as NativeTableRowTextSplitPlan, w as NativeTableStructureOperation, y as NativeWordChange, z as NativeWordChangeApplyResult, A as NativeWordCommentMark, C as NativeWordDrawingNode, D as NativeWordEditor, E as NativeWordFieldNode, F as NativeWordFormatRevisionMark, G as NativeWordHeaderFooterStory, H as NativeWordImageNode, I as NativeWordInlineNode, K as NativeWordPageBreakNode, M as NativeWordRevisionMark, O as NativeWordTableCellNode, P as NativeWordTableNode, Q as NativeWordTableRowNode, R as NativeWordTextMark, S as NativeWordTextNode, T as ResolvedWordOoxmlPatchTarget, U as SkippedWordOoxmlPatch, V as UnresolvedWordOoxmlPatchTarget, W as UnsupportedNativeWordChange, X as WordEditorChangeEvent, Y as WordEditorCommand, Z as WordEditorCommandState, _ as WordEditorEngineKind, $ as WordEditorFormatValue, a0 as WordEditorHyperlink, a1 as WordEditorImageInsertOptions, a2 as WordEditorImageState, a3 as WordEditorLineSpacingState, a4 as WordEditorRuntime, a5 as WordEditorRuntimeEvent, a6 as WordEditorRuntimeEventMap, a7 as WordEditorRuntimeOptions, a8 as WordEditorSearchMatch, a9 as WordEditorSearchOptions, aa as WordEditorSearchState, ab as WordEditorSelection, ac as WordEditorSelectionChangeEvent, ad as WordEditorSelectionPoint, ae as WordEditorTableCellPoint, af as WordEditorTableState, ag as WordOoxmlPatch, ah as WordOoxmlPatchApplyResult, ai as WordOoxmlPatchKind, aj as WordOoxmlPatchPlan, ak as WordOoxmlPatchTargetResolution, al as adjacentNativeListNumbering, am as allNativeParagraphs, an as analyzeNativeTableRowPagination, ao as applyNativeWordChangesToPackage, ap as applyWordOoxmlPatches, aq as bodyParagraphs, ar as canDispatchNativeWordCommand, as as clearNativeImageSelection, at as cloneNativeWordBlocks, au as createNativeListNumbering, av as createNativeParaId, aw as createNativeSelectionRange, ax as createNativeTextRange, ay as createNativeWordDocument, az as currentNativeCursor, aA as currentNativeSelection, aB as defineNativeWordElements, aC as findNativeParagraph, aD as findNativeParagraphLocation, aE as findNativeTableCellLocation, aF as findNativeTableLocation, aG as getNativeWordCommandState, aH as imageOffset, aI as layoutNativePageAnnotationBubbles, aJ as measureNativeDocumentReflowFromParagraph, aK as nativeAddComment, aL as nativeAddFormatRevision, aM as nativeAddRevision, aN as nativeAnchorLayoutMetadata, aO as nativeClearRunFormat, aP as nativeClearTableCellRange, aQ as nativeCopyBlockRange, aR as nativeCursorFromPoint, aS as nativeDeleteBackward, aT as nativeDeleteComment, aU as nativeDeleteForward, aV as nativeDeleteImage, aW as nativeDeleteRange, aX as nativeDeleteTable, aY as nativeDeleteTextRangeAcrossParagraphs, aZ as nativeDrawingWidthCss, a_ as nativeEditTableStructure, a$ as nativeInsertImage, b0 as nativeInsertPageBreak, b1 as nativeInsertTable, b2 as nativeInsertText, b3 as nativeListIndent, b4 as nativeListType, b5 as nativeMergeTableCells, b6 as nativeNumberingAtLevel, b7 as nativePageBreakAt, b8 as nativeParagraphText, b9 as nativeRangeContainsPageBreak, ba as nativeReplaceBlockRangeAcrossParagraphs, bb as nativeReplaceRange, bc as nativeReplaceRangeWithBlocks, bd as nativeReplaceTableCellRangeContent, be as nativeReplaceTableCellRangeText, bf as nativeReplaceTextRangeAcrossParagraphs, bg as nativeReplaceTextRangeWithParagraphs, bh as nativeResolveFormatRevision, bi as nativeResolveImageFormatRevision, bj as nativeResolveImageRevision, bk as nativeResolveRevision, bl as nativeSelection, bm as nativeSelectionFromCursor, bn as nativeSetHyperlink, bo as nativeSetImageSize, bp as nativeSetParagraphFormat, bq as nativeSetParagraphList, br as nativeSetRunFormat, bs as nativeSetTableCellFormat, bt as nativeSetTableCellRangeFormat, bu as nativeSplitParagraph, bv as nativeSplitTableCell, bw as nativeSyncParagraphText, bx as nativeTableCellsInRange, by as nativeTableSupportsStructuralEditing, bz as nativeTextRangeIsBold, bA as nativeUpdateComment, bB as paginateNativeDocument, bC as parentNativeParagraph, bD as planWordOoxmlPatch, bE as planWordOoxmlPatches, bF as previousNativeParagraphId, bG as rebuildNativeTableFragmentsFromParagraph, bH as reflowNativeDocumentFromParagraph, bI as refreshNativeNumberingLabels, bJ as refreshNativePageCommentBubbles, bK as renderNativeBlock, bL as renderNativeDocument, bM as renderNativeImage, bN as renderNativeParagraph, bO as renderNativeTable, bP as renderNativeWordEditor, bQ as resolveNativeSectionPageNumberStarts, bR as resolveNativeTableCellBorders, bS as resolveWordOoxmlPatchTargets, bT as restoreNativeCursor, bU as restoreNativeElementSelection, bV as restoreNativeTextSelection, bW as searchNativeWordDocument, bX as selectNativeImage, bY as splitNativeTableRowAtBlockBoundary, bZ as splitNativeTableRowAtTextOffset, b_ as summarizeNativeTablePagination } from './native-Ct9nN06K.cjs';
|
|
8
|
+
export { WordAnnotationEditChangeDraft, WordAnnotationEditOperation, WordBlockEditChangeDraft, WordBlockEditOperation, WordBlockSnapshot, WordChangeSet, WordChangeStatus, WordChangeTarget, WordContent, WordContentEditChangeDraft, WordContentEditOperation, WordEditChange, WordEditChangeBase, WordEditChangeDraft, WordEditMark, WordEditingPluginOptions, WordEditorRange, WordImageContent, WordMarkEditChangeDraft, WordParagraphAlignment, WordParagraphBlockSnapshot, WordParagraphEditChangeDraft, WordParagraphRange, WordRevisionEditChangeDraft, WordRevisionEditOperation, WordSelectedParagraph, WordSelectionInfo, WordTableBlockSnapshot, WordTableEditChangeDraft, WordTableEditOperation, WordTextContent, WordTextEditChangeDraft, WordTextEditOperation, createWordEditingPlugin, getWordChangeSet, getWordSelectionInfo, setColor, setFontSize, setParagraphAlign, toggleBold, wordEditingPluginKey } from './word-editing.cjs';
|
|
9
|
+
import 'prosemirror-state';
|
|
10
|
+
import 'prosemirror-view';
|
|
11
|
+
|
|
12
|
+
interface WordDocumentLike {
|
|
13
|
+
_getPackage(): Package;
|
|
14
|
+
_getIndices(): PackageIndices;
|
|
15
|
+
}
|
|
16
|
+
/** Build the editor view directly from browser-friendly DOCX package bytes. */
|
|
17
|
+
declare function buildWordEditorViewFromDocx(bytes: Uint8Array | ArrayBuffer): Promise<EditorDocumentView>;
|
|
18
|
+
/** Build the editor view directly from a browser/Electron Flat OPC payload. */
|
|
19
|
+
declare function buildWordEditorViewFromFlatOpc(xml: string): EditorDocumentView;
|
|
20
|
+
declare function buildWordEditorView(doc: WordDocumentLike): Promise<EditorDocumentView>;
|
|
21
|
+
declare function buildWordEditorViewFromPackage(pkg: Package, indices: PackageIndices): EditorDocumentView;
|
|
22
|
+
|
|
23
|
+
interface WordEditorCoverage {
|
|
24
|
+
topLevelBlocks: number;
|
|
25
|
+
topLevelParagraphs: number;
|
|
26
|
+
tableBlocks: number;
|
|
27
|
+
tableParagraphs: number;
|
|
28
|
+
allParagraphs: number;
|
|
29
|
+
topLevelImages: number;
|
|
30
|
+
tableImages: number;
|
|
31
|
+
allImages: number;
|
|
32
|
+
topLevelDrawings: number;
|
|
33
|
+
tableDrawings: number;
|
|
34
|
+
allDrawings: number;
|
|
35
|
+
pageBreaks: number;
|
|
36
|
+
}
|
|
37
|
+
interface NativeWordCoverage {
|
|
38
|
+
editor: WordEditorCoverage;
|
|
39
|
+
native: {
|
|
40
|
+
blocks: number;
|
|
41
|
+
paragraphs: number;
|
|
42
|
+
images: number;
|
|
43
|
+
drawings: number;
|
|
44
|
+
pageBreaks: number;
|
|
45
|
+
};
|
|
46
|
+
missing: {
|
|
47
|
+
paragraphs: number;
|
|
48
|
+
images: number;
|
|
49
|
+
drawings: number;
|
|
50
|
+
pageBreaks: number;
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
declare function summarizeEditorCoverage(wordView: EditorDocumentView): WordEditorCoverage;
|
|
54
|
+
declare function summarizeNativeCoverage(wordView: EditorDocumentView, nativeDocument: NativeWordDocument | undefined): NativeWordCoverage;
|
|
55
|
+
declare function collectNativeParagraphs(nativeDocument: NativeWordDocument): NativeWordParagraphNode[];
|
|
56
|
+
|
|
57
|
+
interface ResolvedStyle {
|
|
58
|
+
declarations: Record<string, string>;
|
|
59
|
+
cssText: string;
|
|
60
|
+
}
|
|
61
|
+
declare function resolveParagraphStyle(format: EditorParagraphFormat | undefined | null): ResolvedStyle;
|
|
62
|
+
declare function resolveRunStyle(format: EditorRunFormat | undefined | null): ResolvedStyle;
|
|
63
|
+
declare function resolveTableCellStyle(cell: Pick<EditorTableCellView, 'margin' | 'borders' | 'shading' | 'verticalAlignment' | 'noWrap' | 'width'>): ResolvedStyle;
|
|
64
|
+
declare function colorToCss(color: string | undefined): string | null;
|
|
65
|
+
|
|
66
|
+
declare const NATIVE_BLOCK_CLIPBOARD_TYPE = "application/x-coco-word-blocks+json";
|
|
67
|
+
interface NativeClipboardRun {
|
|
68
|
+
from: number;
|
|
69
|
+
to: number;
|
|
70
|
+
format: Partial<EditorRunFormat>;
|
|
71
|
+
hyperlink?: EditorHyperlink;
|
|
72
|
+
}
|
|
73
|
+
interface NativeClipboardParagraph {
|
|
74
|
+
text: string;
|
|
75
|
+
runs: NativeClipboardRun[];
|
|
76
|
+
listType?: NativeWordListType;
|
|
77
|
+
}
|
|
78
|
+
declare function parseNativeClipboardHtml(html: string): NativeClipboardParagraph[];
|
|
79
|
+
declare function serializeNativeClipboardHtml(paragraphs: NativeClipboardParagraph[]): string;
|
|
80
|
+
declare function serializeNativeBlockClipboard(blocks: readonly NativeWordBlockNode[]): string;
|
|
81
|
+
declare function parseNativeBlockClipboard(value: string): NativeWordBlockNode[] | null;
|
|
82
|
+
declare function nativeBlockClipboardText(blocks: readonly NativeWordBlockNode[]): string;
|
|
83
|
+
|
|
84
|
+
export { EditorDocumentView, EditorHyperlink, EditorParagraphFormat, EditorRunFormat, EditorTableCellView, NATIVE_BLOCK_CLIPBOARD_TYPE, type NativeClipboardParagraph, type NativeClipboardRun, NativeWordBlockNode, type NativeWordCoverage, NativeWordDocument, NativeWordListType, NativeWordParagraphNode, type ResolvedStyle, type WordDocumentLike, type WordEditorCoverage, buildWordEditorView, buildWordEditorViewFromDocx, buildWordEditorViewFromFlatOpc, buildWordEditorViewFromPackage, collectNativeParagraphs, colorToCss, nativeBlockClipboardText, parseNativeBlockClipboard, parseNativeClipboardHtml, resolveParagraphStyle, resolveRunStyle, resolveTableCellStyle, serializeNativeBlockClipboard, serializeNativeClipboardHtml, summarizeEditorCoverage, summarizeNativeCoverage };
|
package/dist/word.d.ts
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { e as EditorDocumentView, p as EditorParagraphFormat, v as EditorRunFormat, D as EditorTableCellView, j as EditorHyperlink } from './model-DB6aN6uJ.js';
|
|
2
|
+
export { E as EditorBlockView, a as EditorBoxEdges, b as EditorCommentSpan, c as EditorContentSegment, d as EditorDocumentDefaults, f as EditorDrawingSegment, g as EditorFieldSegment, h as EditorHeaderFooterRef, i as EditorHeaderFooterStoryView, k as EditorImageSegment, l as EditorNumberingFormat, m as EditorPageLayout, n as EditorParagraphBorder, o as EditorParagraphBorders, q as EditorParagraphSpan, r as EditorParagraphView, s as EditorPlaceholderSegment, t as EditorRevisionSegment, u as EditorRevisionSpan, w as EditorSectionView, x as EditorSegmentKind, y as EditorShading, z as EditorSpanKind, A as EditorTabStop, B as EditorTableBorder, C as EditorTableBorders, F as EditorTableLayout, G as EditorTableLook, H as EditorTableRowView, I as EditorTableView, J as EditorTextSegment, K as EditorTextSpan } from './model-DB6aN6uJ.js';
|
|
3
|
+
import { Package } from '@coco-vexel/coco-office/pack';
|
|
4
|
+
import { PackageIndices } from '@coco-vexel/coco-office/word-view';
|
|
5
|
+
export { RevisionInfo } from '@coco-vexel/coco-office/word-view';
|
|
6
|
+
import { B as NativeWordDocument, L as NativeWordParagraphNode, J as NativeWordListType, x as NativeWordBlockNode } from './native-B6B649CC.js';
|
|
7
|
+
export { N as NativeAnchorLayoutMetadata, a as NativeBlockRangeReplacement, b as NativeCursorPoint, c as NativeDocumentReflowMeasurement, d as NativeParagraphLocation, e as NativePlainTextReplacement, f as NativeSelectedImage, g as NativeTableCellFormatPatch, h as NativeTableCellLocation, i as NativeTableCellPoint, j as NativeTableCellPosition, k as NativeTableCellRange, l as NativeTableClipboardCell, m as NativeTableEditResult, n as NativeTableLocation, o as NativeTablePaginationSummary, p as NativeTableRangeEditResult, q as NativeTableRowBlockSplitPlan, r as NativeTableRowBlockSplitResult, s as NativeTableRowPaginationAnalysis, t as NativeTableRowPaginationKind, u as NativeTableRowPaginationRisk, v as NativeTableRowTextSplitPlan, w as NativeTableStructureOperation, y as NativeWordChange, z as NativeWordChangeApplyResult, A as NativeWordCommentMark, C as NativeWordDrawingNode, D as NativeWordEditor, E as NativeWordFieldNode, F as NativeWordFormatRevisionMark, G as NativeWordHeaderFooterStory, H as NativeWordImageNode, I as NativeWordInlineNode, K as NativeWordPageBreakNode, M as NativeWordRevisionMark, O as NativeWordTableCellNode, P as NativeWordTableNode, Q as NativeWordTableRowNode, R as NativeWordTextMark, S as NativeWordTextNode, T as ResolvedWordOoxmlPatchTarget, U as SkippedWordOoxmlPatch, V as UnresolvedWordOoxmlPatchTarget, W as UnsupportedNativeWordChange, X as WordEditorChangeEvent, Y as WordEditorCommand, Z as WordEditorCommandState, _ as WordEditorEngineKind, $ as WordEditorFormatValue, a0 as WordEditorHyperlink, a1 as WordEditorImageInsertOptions, a2 as WordEditorImageState, a3 as WordEditorLineSpacingState, a4 as WordEditorRuntime, a5 as WordEditorRuntimeEvent, a6 as WordEditorRuntimeEventMap, a7 as WordEditorRuntimeOptions, a8 as WordEditorSearchMatch, a9 as WordEditorSearchOptions, aa as WordEditorSearchState, ab as WordEditorSelection, ac as WordEditorSelectionChangeEvent, ad as WordEditorSelectionPoint, ae as WordEditorTableCellPoint, af as WordEditorTableState, ag as WordOoxmlPatch, ah as WordOoxmlPatchApplyResult, ai as WordOoxmlPatchKind, aj as WordOoxmlPatchPlan, ak as WordOoxmlPatchTargetResolution, al as adjacentNativeListNumbering, am as allNativeParagraphs, an as analyzeNativeTableRowPagination, ao as applyNativeWordChangesToPackage, ap as applyWordOoxmlPatches, aq as bodyParagraphs, ar as canDispatchNativeWordCommand, as as clearNativeImageSelection, at as cloneNativeWordBlocks, au as createNativeListNumbering, av as createNativeParaId, aw as createNativeSelectionRange, ax as createNativeTextRange, ay as createNativeWordDocument, az as currentNativeCursor, aA as currentNativeSelection, aB as defineNativeWordElements, aC as findNativeParagraph, aD as findNativeParagraphLocation, aE as findNativeTableCellLocation, aF as findNativeTableLocation, aG as getNativeWordCommandState, aH as imageOffset, aI as layoutNativePageAnnotationBubbles, aJ as measureNativeDocumentReflowFromParagraph, aK as nativeAddComment, aL as nativeAddFormatRevision, aM as nativeAddRevision, aN as nativeAnchorLayoutMetadata, aO as nativeClearRunFormat, aP as nativeClearTableCellRange, aQ as nativeCopyBlockRange, aR as nativeCursorFromPoint, aS as nativeDeleteBackward, aT as nativeDeleteComment, aU as nativeDeleteForward, aV as nativeDeleteImage, aW as nativeDeleteRange, aX as nativeDeleteTable, aY as nativeDeleteTextRangeAcrossParagraphs, aZ as nativeDrawingWidthCss, a_ as nativeEditTableStructure, a$ as nativeInsertImage, b0 as nativeInsertPageBreak, b1 as nativeInsertTable, b2 as nativeInsertText, b3 as nativeListIndent, b4 as nativeListType, b5 as nativeMergeTableCells, b6 as nativeNumberingAtLevel, b7 as nativePageBreakAt, b8 as nativeParagraphText, b9 as nativeRangeContainsPageBreak, ba as nativeReplaceBlockRangeAcrossParagraphs, bb as nativeReplaceRange, bc as nativeReplaceRangeWithBlocks, bd as nativeReplaceTableCellRangeContent, be as nativeReplaceTableCellRangeText, bf as nativeReplaceTextRangeAcrossParagraphs, bg as nativeReplaceTextRangeWithParagraphs, bh as nativeResolveFormatRevision, bi as nativeResolveImageFormatRevision, bj as nativeResolveImageRevision, bk as nativeResolveRevision, bl as nativeSelection, bm as nativeSelectionFromCursor, bn as nativeSetHyperlink, bo as nativeSetImageSize, bp as nativeSetParagraphFormat, bq as nativeSetParagraphList, br as nativeSetRunFormat, bs as nativeSetTableCellFormat, bt as nativeSetTableCellRangeFormat, bu as nativeSplitParagraph, bv as nativeSplitTableCell, bw as nativeSyncParagraphText, bx as nativeTableCellsInRange, by as nativeTableSupportsStructuralEditing, bz as nativeTextRangeIsBold, bA as nativeUpdateComment, bB as paginateNativeDocument, bC as parentNativeParagraph, bD as planWordOoxmlPatch, bE as planWordOoxmlPatches, bF as previousNativeParagraphId, bG as rebuildNativeTableFragmentsFromParagraph, bH as reflowNativeDocumentFromParagraph, bI as refreshNativeNumberingLabels, bJ as refreshNativePageCommentBubbles, bK as renderNativeBlock, bL as renderNativeDocument, bM as renderNativeImage, bN as renderNativeParagraph, bO as renderNativeTable, bP as renderNativeWordEditor, bQ as resolveNativeSectionPageNumberStarts, bR as resolveNativeTableCellBorders, bS as resolveWordOoxmlPatchTargets, bT as restoreNativeCursor, bU as restoreNativeElementSelection, bV as restoreNativeTextSelection, bW as searchNativeWordDocument, bX as selectNativeImage, bY as splitNativeTableRowAtBlockBoundary, bZ as splitNativeTableRowAtTextOffset, b_ as summarizeNativeTablePagination } from './native-B6B649CC.js';
|
|
8
|
+
export { WordAnnotationEditChangeDraft, WordAnnotationEditOperation, WordBlockEditChangeDraft, WordBlockEditOperation, WordBlockSnapshot, WordChangeSet, WordChangeStatus, WordChangeTarget, WordContent, WordContentEditChangeDraft, WordContentEditOperation, WordEditChange, WordEditChangeBase, WordEditChangeDraft, WordEditMark, WordEditingPluginOptions, WordEditorRange, WordImageContent, WordMarkEditChangeDraft, WordParagraphAlignment, WordParagraphBlockSnapshot, WordParagraphEditChangeDraft, WordParagraphRange, WordRevisionEditChangeDraft, WordRevisionEditOperation, WordSelectedParagraph, WordSelectionInfo, WordTableBlockSnapshot, WordTableEditChangeDraft, WordTableEditOperation, WordTextContent, WordTextEditChangeDraft, WordTextEditOperation, createWordEditingPlugin, getWordChangeSet, getWordSelectionInfo, setColor, setFontSize, setParagraphAlign, toggleBold, wordEditingPluginKey } from './word-editing.js';
|
|
9
|
+
import 'prosemirror-state';
|
|
10
|
+
import 'prosemirror-view';
|
|
11
|
+
|
|
12
|
+
interface WordDocumentLike {
|
|
13
|
+
_getPackage(): Package;
|
|
14
|
+
_getIndices(): PackageIndices;
|
|
15
|
+
}
|
|
16
|
+
/** Build the editor view directly from browser-friendly DOCX package bytes. */
|
|
17
|
+
declare function buildWordEditorViewFromDocx(bytes: Uint8Array | ArrayBuffer): Promise<EditorDocumentView>;
|
|
18
|
+
/** Build the editor view directly from a browser/Electron Flat OPC payload. */
|
|
19
|
+
declare function buildWordEditorViewFromFlatOpc(xml: string): EditorDocumentView;
|
|
20
|
+
declare function buildWordEditorView(doc: WordDocumentLike): Promise<EditorDocumentView>;
|
|
21
|
+
declare function buildWordEditorViewFromPackage(pkg: Package, indices: PackageIndices): EditorDocumentView;
|
|
22
|
+
|
|
23
|
+
interface WordEditorCoverage {
|
|
24
|
+
topLevelBlocks: number;
|
|
25
|
+
topLevelParagraphs: number;
|
|
26
|
+
tableBlocks: number;
|
|
27
|
+
tableParagraphs: number;
|
|
28
|
+
allParagraphs: number;
|
|
29
|
+
topLevelImages: number;
|
|
30
|
+
tableImages: number;
|
|
31
|
+
allImages: number;
|
|
32
|
+
topLevelDrawings: number;
|
|
33
|
+
tableDrawings: number;
|
|
34
|
+
allDrawings: number;
|
|
35
|
+
pageBreaks: number;
|
|
36
|
+
}
|
|
37
|
+
interface NativeWordCoverage {
|
|
38
|
+
editor: WordEditorCoverage;
|
|
39
|
+
native: {
|
|
40
|
+
blocks: number;
|
|
41
|
+
paragraphs: number;
|
|
42
|
+
images: number;
|
|
43
|
+
drawings: number;
|
|
44
|
+
pageBreaks: number;
|
|
45
|
+
};
|
|
46
|
+
missing: {
|
|
47
|
+
paragraphs: number;
|
|
48
|
+
images: number;
|
|
49
|
+
drawings: number;
|
|
50
|
+
pageBreaks: number;
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
declare function summarizeEditorCoverage(wordView: EditorDocumentView): WordEditorCoverage;
|
|
54
|
+
declare function summarizeNativeCoverage(wordView: EditorDocumentView, nativeDocument: NativeWordDocument | undefined): NativeWordCoverage;
|
|
55
|
+
declare function collectNativeParagraphs(nativeDocument: NativeWordDocument): NativeWordParagraphNode[];
|
|
56
|
+
|
|
57
|
+
interface ResolvedStyle {
|
|
58
|
+
declarations: Record<string, string>;
|
|
59
|
+
cssText: string;
|
|
60
|
+
}
|
|
61
|
+
declare function resolveParagraphStyle(format: EditorParagraphFormat | undefined | null): ResolvedStyle;
|
|
62
|
+
declare function resolveRunStyle(format: EditorRunFormat | undefined | null): ResolvedStyle;
|
|
63
|
+
declare function resolveTableCellStyle(cell: Pick<EditorTableCellView, 'margin' | 'borders' | 'shading' | 'verticalAlignment' | 'noWrap' | 'width'>): ResolvedStyle;
|
|
64
|
+
declare function colorToCss(color: string | undefined): string | null;
|
|
65
|
+
|
|
66
|
+
declare const NATIVE_BLOCK_CLIPBOARD_TYPE = "application/x-coco-word-blocks+json";
|
|
67
|
+
interface NativeClipboardRun {
|
|
68
|
+
from: number;
|
|
69
|
+
to: number;
|
|
70
|
+
format: Partial<EditorRunFormat>;
|
|
71
|
+
hyperlink?: EditorHyperlink;
|
|
72
|
+
}
|
|
73
|
+
interface NativeClipboardParagraph {
|
|
74
|
+
text: string;
|
|
75
|
+
runs: NativeClipboardRun[];
|
|
76
|
+
listType?: NativeWordListType;
|
|
77
|
+
}
|
|
78
|
+
declare function parseNativeClipboardHtml(html: string): NativeClipboardParagraph[];
|
|
79
|
+
declare function serializeNativeClipboardHtml(paragraphs: NativeClipboardParagraph[]): string;
|
|
80
|
+
declare function serializeNativeBlockClipboard(blocks: readonly NativeWordBlockNode[]): string;
|
|
81
|
+
declare function parseNativeBlockClipboard(value: string): NativeWordBlockNode[] | null;
|
|
82
|
+
declare function nativeBlockClipboardText(blocks: readonly NativeWordBlockNode[]): string;
|
|
83
|
+
|
|
84
|
+
export { EditorDocumentView, EditorHyperlink, EditorParagraphFormat, EditorRunFormat, EditorTableCellView, NATIVE_BLOCK_CLIPBOARD_TYPE, type NativeClipboardParagraph, type NativeClipboardRun, NativeWordBlockNode, type NativeWordCoverage, NativeWordDocument, NativeWordListType, NativeWordParagraphNode, type ResolvedStyle, type WordDocumentLike, type WordEditorCoverage, buildWordEditorView, buildWordEditorViewFromDocx, buildWordEditorViewFromFlatOpc, buildWordEditorViewFromPackage, collectNativeParagraphs, colorToCss, nativeBlockClipboardText, parseNativeBlockClipboard, parseNativeClipboardHtml, resolveParagraphStyle, resolveRunStyle, resolveTableCellStyle, serializeNativeBlockClipboard, serializeNativeClipboardHtml, summarizeEditorCoverage, summarizeNativeCoverage };
|