@a3s-lab/office 0.29.0 → 0.31.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/README.md +117 -3
- package/dist/{0~7043.js → 0~4808.js} +347 -2
- package/dist/0~5050.js +10 -1
- package/dist/{0~5093.js → 0~7240.js} +465 -55
- package/dist/0~document-editor.js +1694 -187
- package/dist/0~spreadsheet-editor.js +183 -34
- package/dist/0~work-docx-export.js +507 -31
- package/dist/0~work-docx-import.js +41 -7
- package/dist/0~work-office-diagnostics.js +146 -5
- package/dist/1544.js +13 -1
- package/dist/4104.js +29 -6
- package/dist/4121.js +2340 -1
- package/dist/6282.js +1072 -1148
- package/dist/internal/features/work/editors/document-command-catalog.d.ts +45 -0
- package/dist/internal/features/work/editors/document-dom-selection.d.ts +7 -0
- package/dist/internal/features/work/editors/document-editor-support.d.ts +1 -0
- package/dist/internal/features/work/editors/document-font-dialog-model.d.ts +5 -2
- package/dist/internal/features/work/editors/document-font-dialog-run-shading-model.d.ts +23 -0
- package/dist/internal/features/work/editors/document-font-dialog-run-shading-section.d.ts +8 -0
- package/dist/internal/features/work/editors/document-index-dialog.d.ts +10 -0
- package/dist/internal/features/work/editors/document-index-entry-dialog.d.ts +10 -0
- package/dist/internal/features/work/editors/document-page-chrome-ribbon.d.ts +2 -1
- package/dist/internal/features/work/editors/document-proofing-dialog-model.d.ts +22 -0
- package/dist/internal/features/work/editors/document-proofing-dialog.d.ts +7 -0
- package/dist/internal/features/work/editors/document-references-ribbon.d.ts +19 -0
- package/dist/internal/features/work/editors/document-table-of-contents-dialog.d.ts +10 -0
- package/dist/internal/features/work/editors/document-toolbar.d.ts +6 -1
- package/dist/internal/features/work/editors/spreadsheet-data-validation.d.ts +7 -1
- package/dist/internal/features/work/editors/use-document-insert-commands.d.ts +5 -0
- package/dist/internal/features/work/work-document-character-formatting.d.ts +8 -0
- package/dist/internal/features/work/work-document-format-changes.d.ts +6 -0
- package/dist/internal/features/work/work-document-highlight.d.ts +9 -0
- package/dist/internal/features/work/work-document-index-fields.d.ts +19 -0
- package/dist/internal/features/work/work-document-index-nodes.d.ts +32 -0
- package/dist/internal/features/work/work-document-index.d.ts +63 -0
- package/dist/internal/features/work/work-document-outline.d.ts +1 -0
- package/dist/internal/features/work/work-document-paragraph-shading.d.ts +6 -0
- package/dist/internal/features/work/work-document-proofing.d.ts +19 -0
- package/dist/internal/features/work/work-document-run-shading.d.ts +12 -0
- package/dist/internal/features/work/work-document-table-of-contents-node.d.ts +18 -0
- package/dist/internal/features/work/work-document-table-of-contents.d.ts +51 -0
- package/dist/internal/features/work/work-document-word-line-metrics.d.ts +3 -0
- package/dist/internal/features/work/work-docx-field-instructions.d.ts +1 -1
- package/dist/internal/features/work/work-docx-import.d.ts +5 -1
- package/dist/internal/features/work/work-docx-index-export.d.ts +14 -0
- package/dist/internal/features/work/work-docx-index-import.d.ts +23 -0
- package/dist/internal/features/work/work-docx-proofing-diagnostics.d.ts +3 -0
- package/dist/internal/features/work/work-docx-proofing.d.ts +38 -0
- package/dist/internal/features/work/work-docx-run-formatting-import.d.ts +7 -0
- package/dist/internal/features/work/work-docx-run-shading-diagnostics.d.ts +3 -0
- package/dist/internal/features/work/work-docx-run-shading-export.d.ts +17 -0
- package/dist/internal/features/work/work-docx-run-shading.d.ts +20 -0
- package/dist/internal/features/work/work-docx-table-of-contents-export.d.ts +11 -0
- package/dist/internal/features/work/work-docx-table-of-contents-import.d.ts +15 -0
- package/dist/internal/features/work/work-spreadsheet-data-validation.d.ts +7 -0
- package/dist/internal/features/work/work-types.d.ts +9 -0
- package/dist/internal/kernel/office-kernel-protocol.d.ts +1 -0
- package/dist/office-kernel.wasm +0 -0
- package/dist/styles.css +607 -4
- package/docs/latest/en/browser-editor-architecture.md +64 -1
- package/package.json +15 -2
|
@@ -598,6 +598,51 @@ export declare const documentCommandCatalog: {
|
|
|
598
598
|
readonly editor: readonly ["Mod-Shift-e"];
|
|
599
599
|
};
|
|
600
600
|
};
|
|
601
|
+
readonly tableOfContents: {
|
|
602
|
+
readonly id: "references.tableOfContents";
|
|
603
|
+
readonly label: "插入或自定义目录";
|
|
604
|
+
readonly location: {
|
|
605
|
+
readonly area: "ribbon";
|
|
606
|
+
readonly tab: "references";
|
|
607
|
+
readonly group: "tableOfContents";
|
|
608
|
+
};
|
|
609
|
+
};
|
|
610
|
+
readonly refreshTableOfContents: {
|
|
611
|
+
readonly id: "references.refreshTableOfContents";
|
|
612
|
+
readonly label: "更新目录";
|
|
613
|
+
readonly location: {
|
|
614
|
+
readonly area: "ribbon";
|
|
615
|
+
readonly tab: "references";
|
|
616
|
+
readonly group: "tableOfContents";
|
|
617
|
+
};
|
|
618
|
+
};
|
|
619
|
+
readonly markIndexEntry: {
|
|
620
|
+
readonly id: "references.markIndexEntry";
|
|
621
|
+
readonly label: "标记索引项";
|
|
622
|
+
readonly location: {
|
|
623
|
+
readonly area: "ribbon";
|
|
624
|
+
readonly tab: "references";
|
|
625
|
+
readonly group: "index";
|
|
626
|
+
};
|
|
627
|
+
};
|
|
628
|
+
readonly index: {
|
|
629
|
+
readonly id: "references.index";
|
|
630
|
+
readonly label: "插入或自定义索引";
|
|
631
|
+
readonly location: {
|
|
632
|
+
readonly area: "ribbon";
|
|
633
|
+
readonly tab: "references";
|
|
634
|
+
readonly group: "index";
|
|
635
|
+
};
|
|
636
|
+
};
|
|
637
|
+
readonly refreshIndex: {
|
|
638
|
+
readonly id: "references.refreshIndex";
|
|
639
|
+
readonly label: "更新索引";
|
|
640
|
+
readonly location: {
|
|
641
|
+
readonly area: "ribbon";
|
|
642
|
+
readonly tab: "references";
|
|
643
|
+
readonly group: "index";
|
|
644
|
+
};
|
|
645
|
+
};
|
|
601
646
|
readonly refreshFields: {
|
|
602
647
|
readonly id: "references.refreshFields";
|
|
603
648
|
readonly label: "更新域";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Editor } from '@tiptap/core';
|
|
2
|
+
/**
|
|
3
|
+
* Reconciles a visible browser text selection before a capture-phase command
|
|
4
|
+
* snapshots editor state. Selection-change delivery can lag behind a keyboard
|
|
5
|
+
* shortcut under load, leaving ProseMirror with an older collapsed selection.
|
|
6
|
+
*/
|
|
7
|
+
export declare function synchronizeDocumentEditorSelectionFromDom(editor: Editor): boolean;
|
|
@@ -28,3 +28,4 @@ interface CustomSelectionMenuItem<Context> {
|
|
|
28
28
|
export declare function customSelectionMenuItems<Context>(items: readonly CustomSelectionMenuItem<Context>[], createAction: () => CustomSelectionAction<Context>): WorkspaceContextMenuItem[];
|
|
29
29
|
export declare function documentPageCount(editor: Editor): number;
|
|
30
30
|
export declare function documentCurrentPage(editor: Editor): number;
|
|
31
|
+
export declare function documentHasRefreshableFields(editor: Editor): boolean;
|
|
@@ -2,6 +2,7 @@ import type { Editor } from '@tiptap/core';
|
|
|
2
2
|
import { type WorkDocumentEmphasisMark } from '../work-document-emphasis';
|
|
3
3
|
import { type DocumentFontDialogScriptFontPatch, type DocumentFontFamilySource } from './document-font-dialog-script-font-model';
|
|
4
4
|
import { type DocumentFontDialogRunBorderDraft, type DocumentFontDialogRunBorderPatch, type DocumentFontDialogRunBorderSource } from './document-font-dialog-run-border-model';
|
|
5
|
+
import { type DocumentFontDialogRunShadingDraft, type DocumentFontDialogRunShadingPatch, type DocumentFontDialogRunShadingSource } from './document-font-dialog-run-shading-model';
|
|
5
6
|
export type { DocumentFontFamilySource } from './document-font-dialog-script-font-model';
|
|
6
7
|
export type DocumentCharacterSpacingMode = 'condensed' | 'expanded' | 'mixed' | 'normal';
|
|
7
8
|
export type DocumentCharacterPositionMode = 'lowered' | 'mixed' | 'normal' | 'raised';
|
|
@@ -49,6 +50,7 @@ export interface DocumentFontDialogSource {
|
|
|
49
50
|
value: boolean | null;
|
|
50
51
|
};
|
|
51
52
|
runBorder: DocumentFontDialogRunBorderSource;
|
|
53
|
+
runShading: DocumentFontDialogRunShadingSource;
|
|
52
54
|
latinFont: DocumentFontFamilySource;
|
|
53
55
|
eastAsiaFont: DocumentFontFamilySource;
|
|
54
56
|
complexScriptFont: DocumentFontFamilySource;
|
|
@@ -57,7 +59,7 @@ export interface DocumentFontDialogSource {
|
|
|
57
59
|
previewText: string;
|
|
58
60
|
selectedCharacters: number;
|
|
59
61
|
}
|
|
60
|
-
export interface DocumentFontDialogDraft extends DocumentFontDialogRunBorderDraft {
|
|
62
|
+
export interface DocumentFontDialogDraft extends DocumentFontDialogRunBorderDraft, DocumentFontDialogRunShadingDraft {
|
|
61
63
|
characterScaleMode: DocumentCharacterScaleMode;
|
|
62
64
|
characterScalePercent: string;
|
|
63
65
|
characterPositionMode: DocumentCharacterPositionMode;
|
|
@@ -76,7 +78,7 @@ export interface DocumentFontDialogDraft extends DocumentFontDialogRunBorderDraf
|
|
|
76
78
|
eastAsiaFont: string;
|
|
77
79
|
complexScriptFont: string;
|
|
78
80
|
}
|
|
79
|
-
export interface DocumentFontDialogPatch extends DocumentFontDialogScriptFontPatch, DocumentFontDialogRunBorderPatch {
|
|
81
|
+
export interface DocumentFontDialogPatch extends DocumentFontDialogScriptFontPatch, DocumentFontDialogRunBorderPatch, DocumentFontDialogRunShadingPatch {
|
|
80
82
|
characterScalePercent?: number;
|
|
81
83
|
characterPositionHalfPoints?: number;
|
|
82
84
|
characterSpacingTwips?: number;
|
|
@@ -101,6 +103,7 @@ export interface DocumentFontDialogTouched {
|
|
|
101
103
|
legacyTextEmboss: boolean;
|
|
102
104
|
legacyTextImprint: boolean;
|
|
103
105
|
runBorder: boolean;
|
|
106
|
+
runShading: boolean;
|
|
104
107
|
kerning: boolean;
|
|
105
108
|
latinFont: boolean;
|
|
106
109
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
2
|
+
import { type DocumentRunShading, type DocumentRunShadingPattern } from '../work-document-run-shading';
|
|
3
|
+
export type DocumentFontDialogRunShadingMode = 'inherit' | 'mixed' | 'none' | 'value';
|
|
4
|
+
export interface DocumentFontDialogRunShadingSource {
|
|
5
|
+
mixed: boolean;
|
|
6
|
+
value: DocumentRunShading | null;
|
|
7
|
+
}
|
|
8
|
+
export interface DocumentFontDialogRunShadingDraft {
|
|
9
|
+
runShadingMode: DocumentFontDialogRunShadingMode;
|
|
10
|
+
runShadingPattern: Exclude<DocumentRunShadingPattern, 'nil'>;
|
|
11
|
+
runShadingColor: 'auto' | `#${string}`;
|
|
12
|
+
runShadingFill: 'auto' | `#${string}`;
|
|
13
|
+
}
|
|
14
|
+
export interface DocumentFontDialogRunShadingPatch {
|
|
15
|
+
runShading?: DocumentRunShading | null;
|
|
16
|
+
}
|
|
17
|
+
export declare function addDocumentFontDialogRunShadingValue(values: Map<string, DocumentRunShading | null>, source: unknown): void;
|
|
18
|
+
export declare function selectedDocumentFontDialogRunShadingValue(values: ReadonlyMap<string, DocumentRunShading | null>): DocumentFontDialogRunShadingSource;
|
|
19
|
+
export declare function createDocumentFontDialogRunShadingDraft(source: DocumentFontDialogRunShadingSource): DocumentFontDialogRunShadingDraft;
|
|
20
|
+
export declare function documentFontDialogRunShadingDraftError(draft: DocumentFontDialogRunShadingDraft): string | null;
|
|
21
|
+
export declare function documentFontDialogRunShadingPatch(source: DocumentFontDialogRunShadingSource, draft: DocumentFontDialogRunShadingDraft, touched: boolean): DocumentFontDialogRunShadingPatch;
|
|
22
|
+
export declare function documentFontDialogRunShadingFromDraft(source: DocumentFontDialogRunShadingSource, draft: DocumentFontDialogRunShadingDraft): DocumentRunShading | null;
|
|
23
|
+
export declare function documentFontDialogRunShadingPreviewStyle(source: DocumentFontDialogRunShadingSource, draft: DocumentFontDialogRunShadingDraft): CSSProperties;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { DocumentFontDialogRunShadingDraft, DocumentFontDialogRunShadingSource } from './document-font-dialog-run-shading-model';
|
|
2
|
+
export declare function DocumentFontDialogRunShadingSection({ source, draft, touched, onDraftChange, onTouched, }: {
|
|
3
|
+
source: DocumentFontDialogRunShadingSource;
|
|
4
|
+
draft: DocumentFontDialogRunShadingDraft;
|
|
5
|
+
touched: boolean;
|
|
6
|
+
onDraftChange: (patch: Partial<DocumentFontDialogRunShadingDraft>) => void;
|
|
7
|
+
onTouched: () => void;
|
|
8
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { WorkDocumentIndexOptions } from '../work-document-index';
|
|
2
|
+
export interface DocumentIndexDialogProps {
|
|
3
|
+
editing: boolean;
|
|
4
|
+
options: WorkDocumentIndexOptions;
|
|
5
|
+
restoreFocusTarget: () => HTMLElement | null;
|
|
6
|
+
onCancel: () => void;
|
|
7
|
+
onOptionsChange: (options: WorkDocumentIndexOptions) => void;
|
|
8
|
+
onSubmit: () => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function DocumentIndexDialog({ editing, options, restoreFocusTarget, onCancel, onOptionsChange, onSubmit, }: DocumentIndexDialogProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { WorkDocumentIndexEntryDraft } from '../work-document-index';
|
|
2
|
+
export interface DocumentIndexEntryDialogProps {
|
|
3
|
+
editing: boolean;
|
|
4
|
+
value: WorkDocumentIndexEntryDraft;
|
|
5
|
+
restoreFocusTarget: () => HTMLElement | null;
|
|
6
|
+
onCancel: () => void;
|
|
7
|
+
onChange: (value: WorkDocumentIndexEntryDraft) => void;
|
|
8
|
+
onSubmit: () => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function DocumentIndexEntryDialog({ editing, value, restoreFocusTarget, onCancel, onChange, onSubmit, }: DocumentIndexEntryDialogProps): import("react").JSX.Element;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { Editor } from '@tiptap/core';
|
|
2
2
|
export type DocumentPageChromeEditingPart = 'footer' | 'header';
|
|
3
|
-
export declare function DocumentPageChromeRibbon({ editor, editingPart, showPageNumber, onEditingPartChange, onTogglePageNumber, onOpenFontDialog, onClose, }: {
|
|
3
|
+
export declare function DocumentPageChromeRibbon({ editor, editingPart, showPageNumber, onEditingPartChange, onTogglePageNumber, onOpenFontDialog, onOpenProofingDialog, onClose, }: {
|
|
4
4
|
editor: Editor;
|
|
5
5
|
editingPart: DocumentPageChromeEditingPart;
|
|
6
6
|
showPageNumber: boolean;
|
|
7
7
|
onEditingPartChange: (part: DocumentPageChromeEditingPart) => void;
|
|
8
8
|
onTogglePageNumber: () => void;
|
|
9
9
|
onOpenFontDialog?: () => void;
|
|
10
|
+
onOpenProofingDialog?: () => void;
|
|
10
11
|
onClose: () => void;
|
|
11
12
|
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Editor } from '@tiptap/core';
|
|
2
|
+
import { type WorkDocumentProofingLanguageSlot } from '../work-document-proofing';
|
|
3
|
+
export interface DocumentProofingDialogValue<T> {
|
|
4
|
+
mixed: boolean;
|
|
5
|
+
value: T | null;
|
|
6
|
+
}
|
|
7
|
+
export interface DocumentProofingDialogSource {
|
|
8
|
+
latin: DocumentProofingDialogValue<string>;
|
|
9
|
+
eastAsia: DocumentProofingDialogValue<string>;
|
|
10
|
+
bidi: DocumentProofingDialogValue<string>;
|
|
11
|
+
noProof: DocumentProofingDialogValue<boolean>;
|
|
12
|
+
selectedCharacters: number;
|
|
13
|
+
}
|
|
14
|
+
export interface DocumentProofingDialogPatch {
|
|
15
|
+
languages?: Partial<Record<WorkDocumentProofingLanguageSlot, string | null>>;
|
|
16
|
+
noProof?: boolean | null;
|
|
17
|
+
}
|
|
18
|
+
export declare function documentProofingDialogSource(editor: Editor): DocumentProofingDialogSource;
|
|
19
|
+
export declare function applyDocumentProofingDialogPatch(editor: Editor, selection: {
|
|
20
|
+
from: number;
|
|
21
|
+
to: number;
|
|
22
|
+
}, patch: DocumentProofingDialogPatch): boolean;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DocumentProofingDialogPatch, DocumentProofingDialogSource } from './document-proofing-dialog-model';
|
|
2
|
+
export declare function DocumentProofingDialog({ source, restoreFocusTarget, onApply, onClose, }: {
|
|
3
|
+
source: DocumentProofingDialogSource;
|
|
4
|
+
restoreFocusTarget: () => HTMLElement | null;
|
|
5
|
+
onApply: (patch: DocumentProofingDialogPatch) => boolean;
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Editor } from '@tiptap/core';
|
|
2
|
+
import type { WorkDocumentCaptionKind } from '../work-document-captions';
|
|
3
|
+
import type { WorkDocumentNoteKind } from '../work-document-notes';
|
|
4
|
+
export interface DocumentReferencesRibbonProps {
|
|
5
|
+
editor: Editor;
|
|
6
|
+
citationsOpen: boolean;
|
|
7
|
+
citationSourceCount: number;
|
|
8
|
+
onInsertNote: (kind: WorkDocumentNoteKind) => void;
|
|
9
|
+
onInsertCaption: (kind: WorkDocumentCaptionKind) => void;
|
|
10
|
+
onInsertCrossReference: () => void;
|
|
11
|
+
onOpenTableOfContents: () => void;
|
|
12
|
+
onRefreshTableOfContents: () => void;
|
|
13
|
+
onOpenIndexEntry: () => void;
|
|
14
|
+
onOpenIndex: () => void;
|
|
15
|
+
onRefreshIndex: () => void;
|
|
16
|
+
onToggleCitations: () => void;
|
|
17
|
+
onRefreshFields: () => void;
|
|
18
|
+
}
|
|
19
|
+
export declare function DocumentReferencesRibbon({ editor, citationsOpen, citationSourceCount, onInsertNote, onInsertCaption, onInsertCrossReference, onOpenTableOfContents, onRefreshTableOfContents, onOpenIndexEntry, onOpenIndex, onRefreshIndex, onToggleCitations, onRefreshFields, }: DocumentReferencesRibbonProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { WorkDocumentTableOfContentsOptions } from '../work-document-table-of-contents';
|
|
2
|
+
export interface DocumentTableOfContentsDialogProps {
|
|
3
|
+
editing: boolean;
|
|
4
|
+
options: WorkDocumentTableOfContentsOptions;
|
|
5
|
+
restoreFocusTarget: () => HTMLElement | null;
|
|
6
|
+
onCancel: () => void;
|
|
7
|
+
onOptionsChange: (options: WorkDocumentTableOfContentsOptions) => void;
|
|
8
|
+
onSubmit: () => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function DocumentTableOfContentsDialog({ editing, options, restoreFocusTarget, onCancel, onOptionsChange, onSubmit, }: DocumentTableOfContentsDialogProps): import("react").JSX.Element;
|
|
@@ -57,11 +57,16 @@ interface DocumentToolbarProps {
|
|
|
57
57
|
onInsertNote: (kind: WorkDocumentNoteKind) => void;
|
|
58
58
|
onInsertCaption: (kind: WorkDocumentCaptionKind) => void;
|
|
59
59
|
onInsertCrossReference: () => void;
|
|
60
|
+
onOpenTableOfContents: () => void;
|
|
61
|
+
onOpenIndexEntry: () => void;
|
|
62
|
+
onOpenIndex: () => void;
|
|
60
63
|
citationsOpen: boolean;
|
|
61
64
|
citationSourceCount: number;
|
|
62
65
|
onToggleCitations: () => void;
|
|
63
66
|
onInsertField: (kind: WorkDocumentFieldKind) => void;
|
|
64
67
|
onRefreshFields: () => void;
|
|
68
|
+
onRefreshIndex: () => void;
|
|
69
|
+
onRefreshTableOfContents: () => void;
|
|
65
70
|
canInsertComment: boolean;
|
|
66
71
|
onInsertComment: () => void;
|
|
67
72
|
commentsOpen: boolean;
|
|
@@ -79,5 +84,5 @@ interface DocumentToolbarProps {
|
|
|
79
84
|
onOpenWordCount: () => void;
|
|
80
85
|
onOpenFindReplace: (mode: DocumentFindReplaceMode) => void;
|
|
81
86
|
}
|
|
82
|
-
export declare function DocumentToolbar({ editor, defaultRibbonCollapsed, reviewOnly, suggestionOnly, history, layoutOpen, layout, layoutFonts, navigationOpen, pageColor, showPageNumbers, showHiddenText, showRulers, spellcheckEnabled, viewMode, zoom, pageChromeEditor, pageChromeEditingPart, pageChromeShowPageNumber, onRequestImage, onPageChromeEditingPartChange, onClosePageChrome, onTogglePageChromePageNumber, onToggleLayout, onLayoutChange, onOpenLayout, onToggleNavigation, onTogglePageNumbers, onToggleHiddenText, onToggleRulers, onPageColorChange, onToggleSpellcheck, onViewModeChange, onZoomChange, onZoomFit, onInsertSection, onInsertNote, onInsertCaption, onInsertCrossReference, citationsOpen, citationSourceCount, onToggleCitations, onInsertField, onRefreshFields, canInsertComment, onInsertComment, commentsOpen, commentCount, onToggleComments, trackChanges, changesOpen, changeCount, findReplaceMode, fileActions, onRibbonTabChange, onToggleTrackChanges, onToggleChanges, onDecideChange, onOpenWordCount, onOpenFindReplace, }: DocumentToolbarProps): import("react").JSX.Element;
|
|
87
|
+
export declare function DocumentToolbar({ editor, defaultRibbonCollapsed, reviewOnly, suggestionOnly, history, layoutOpen, layout, layoutFonts, navigationOpen, pageColor, showPageNumbers, showHiddenText, showRulers, spellcheckEnabled, viewMode, zoom, pageChromeEditor, pageChromeEditingPart, pageChromeShowPageNumber, onRequestImage, onPageChromeEditingPartChange, onClosePageChrome, onTogglePageChromePageNumber, onToggleLayout, onLayoutChange, onOpenLayout, onToggleNavigation, onTogglePageNumbers, onToggleHiddenText, onToggleRulers, onPageColorChange, onToggleSpellcheck, onViewModeChange, onZoomChange, onZoomFit, onInsertSection, onInsertNote, onInsertCaption, onInsertCrossReference, onOpenTableOfContents, onOpenIndexEntry, onOpenIndex, citationsOpen, citationSourceCount, onToggleCitations, onInsertField, onRefreshFields, onRefreshIndex, onRefreshTableOfContents, canInsertComment, onInsertComment, commentsOpen, commentCount, onToggleComments, trackChanges, changesOpen, changeCount, findReplaceMode, fileActions, onRibbonTabChange, onToggleTrackChanges, onToggleChanges, onDecideChange, onOpenWordCount, onOpenFindReplace, }: DocumentToolbarProps): import("react").JSX.Element;
|
|
83
88
|
export {};
|
|
@@ -1,12 +1,18 @@
|
|
|
1
|
-
import type { WorkSpreadsheetContent, WorkSpreadsheetDataValidationItem, WorkSpreadsheetSheet } from '../work-types';
|
|
1
|
+
import type { WorkSpreadsheetContent, WorkSpreadsheetDataValidationErrorStyle, WorkSpreadsheetDataValidationItem, WorkSpreadsheetSheet } from '../work-types';
|
|
2
2
|
import { type SpreadsheetCellRange } from './spreadsheet-cell-range';
|
|
3
3
|
export declare const MAX_SPREADSHEET_DATA_VALIDATION_CELLS = 10000;
|
|
4
4
|
export type SpreadsheetDataValidationType = 'date' | 'dropdown' | 'number' | 'number_integer' | 'text_length';
|
|
5
5
|
export type SpreadsheetDataValidationOperator = 'between' | 'equal' | 'greaterOrEqualTo' | 'lessThan' | 'lessThanOrEqualTo' | 'moreThanThe' | 'noEarlierThan' | 'noLaterThan' | 'notBetween' | 'notEqualTo' | 'earlierThan' | 'laterThan';
|
|
6
6
|
export interface SpreadsheetDataValidationDialogValue {
|
|
7
|
+
allowBlank: boolean;
|
|
8
|
+
errorMessage: string;
|
|
9
|
+
errorStyle: WorkSpreadsheetDataValidationErrorStyle;
|
|
10
|
+
errorTitle: string;
|
|
7
11
|
hintShow: boolean;
|
|
12
|
+
hintTitle: string;
|
|
8
13
|
hintValue: string;
|
|
9
14
|
prohibitInput: boolean;
|
|
15
|
+
showDropdownArrow: boolean;
|
|
10
16
|
type: SpreadsheetDataValidationType;
|
|
11
17
|
type2: SpreadsheetDataValidationOperator | '';
|
|
12
18
|
value1: string;
|
|
@@ -11,7 +11,12 @@ export interface DocumentInsertCommands {
|
|
|
11
11
|
insertField: (kind: WorkDocumentFieldKind) => void;
|
|
12
12
|
insertImage: (file: File) => Promise<void>;
|
|
13
13
|
insertNote: (kind: WorkDocumentNoteKind) => boolean;
|
|
14
|
+
openIndexEntry: () => void;
|
|
15
|
+
openIndex: () => void;
|
|
16
|
+
openTableOfContents: () => void;
|
|
14
17
|
refreshFields: () => boolean;
|
|
18
|
+
refreshIndex: () => boolean;
|
|
19
|
+
refreshTableOfContents: () => boolean;
|
|
15
20
|
}
|
|
16
21
|
export declare function useDocumentInsertCommands({ contentRef, editor, resolveFieldContext, }: {
|
|
17
22
|
contentRef: MutableRefObject<WorkDocumentContent>;
|
|
@@ -2,6 +2,8 @@ import { Extension, type Editor } from '@tiptap/core';
|
|
|
2
2
|
import { type WorkDocumentEmphasisMark } from './work-document-emphasis';
|
|
3
3
|
import { type WorkDocumentTextCase } from './work-document-text-case';
|
|
4
4
|
import { type DocumentRunBorder } from './work-document-run-border';
|
|
5
|
+
import { type DocumentRunShading } from './work-document-run-shading';
|
|
6
|
+
import { type WorkDocumentProofingLanguages } from './work-document-proofing';
|
|
5
7
|
declare module '@tiptap/core' {
|
|
6
8
|
interface Commands<ReturnType> {
|
|
7
9
|
documentCharacterFormatting: {
|
|
@@ -22,6 +24,12 @@ declare module '@tiptap/core' {
|
|
|
22
24
|
setDocumentRunBorder: (border: DocumentRunBorder) => ReturnType;
|
|
23
25
|
unsetDocumentRunBorder: () => ReturnType;
|
|
24
26
|
toggleDocumentRunBorder: () => ReturnType;
|
|
27
|
+
setDocumentRunShading: (shading: DocumentRunShading) => ReturnType;
|
|
28
|
+
unsetDocumentRunShading: () => ReturnType;
|
|
29
|
+
setDocumentProofingLanguages: (languages: WorkDocumentProofingLanguages) => ReturnType;
|
|
30
|
+
unsetDocumentProofingLanguages: () => ReturnType;
|
|
31
|
+
setDocumentNoProof: (noProof: boolean) => ReturnType;
|
|
32
|
+
unsetDocumentNoProof: () => ReturnType;
|
|
25
33
|
};
|
|
26
34
|
}
|
|
27
35
|
}
|
|
@@ -5,6 +5,8 @@ import { type WorkDocumentTextCase } from './work-document-text-case';
|
|
|
5
5
|
import { type WorkDocumentUnderlineFormatting } from './work-document-underline';
|
|
6
6
|
import { type WorkDocumentStrikeFormatting } from './work-document-strike';
|
|
7
7
|
import { type WorkDocumentScriptFontSlot, type WorkDocumentScriptFonts } from './work-document-script-fonts';
|
|
8
|
+
import { type WorkDocumentHighlight } from './work-document-highlight';
|
|
9
|
+
import { type WorkDocumentProofingLanguages } from './work-document-proofing';
|
|
8
10
|
export declare const DOCUMENT_CHARACTER_FORMAT_MARKS: readonly ["bold", "italic", "underline", "strike", "subscript", "superscript", "textStyle", "highlight"];
|
|
9
11
|
export type DocumentCharacterFormatMarkName = (typeof DOCUMENT_CHARACTER_FORMAT_MARKS)[number];
|
|
10
12
|
export interface DocumentCharacterFormatMark {
|
|
@@ -36,6 +38,9 @@ export declare function importedDocumentCharacterFormatting(formatting: {
|
|
|
36
38
|
legacyTextEmboss?: boolean;
|
|
37
39
|
legacyTextImprint?: boolean;
|
|
38
40
|
runBorder?: string;
|
|
41
|
+
runShading?: string;
|
|
42
|
+
proofingLanguages?: WorkDocumentProofingLanguages;
|
|
43
|
+
noProof?: boolean;
|
|
39
44
|
wordLineHeightFactor?: number;
|
|
40
45
|
wordSnapToGrid?: boolean;
|
|
41
46
|
fontSize?: number;
|
|
@@ -43,5 +48,6 @@ export declare function importedDocumentCharacterFormatting(formatting: {
|
|
|
43
48
|
backgroundColor?: string;
|
|
44
49
|
themeColor?: string;
|
|
45
50
|
themeFill?: string;
|
|
51
|
+
highlight?: WorkDocumentHighlight;
|
|
46
52
|
textCase?: WorkDocumentTextCase;
|
|
47
53
|
}): string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const DOCUMENT_HIGHLIGHT_ATTRIBUTE = "data-office-highlight";
|
|
2
|
+
export type WorkDocumentHighlight = 'black' | 'blue' | 'cyan' | 'darkBlue' | 'darkCyan' | 'darkGray' | 'darkGreen' | 'darkMagenta' | 'darkRed' | 'darkYellow' | 'green' | 'lightGray' | 'magenta' | 'none' | 'red' | 'white' | 'yellow';
|
|
3
|
+
export declare const DOCUMENT_HIGHLIGHT_VALUES: Set<WorkDocumentHighlight>;
|
|
4
|
+
export declare function normalizeDocumentHighlight(source: unknown): WorkDocumentHighlight | null;
|
|
5
|
+
export declare function documentHighlightFromDocxValue(source: unknown): WorkDocumentHighlight | null;
|
|
6
|
+
export declare function documentHighlightCssColor(source: unknown): string | null;
|
|
7
|
+
export declare function documentHighlightForCssColor(source: unknown): WorkDocumentHighlight | null;
|
|
8
|
+
export declare function documentHighlightFromElement(element: HTMLElement): WorkDocumentHighlight | null;
|
|
9
|
+
export declare function documentHighlightDomAttributes(source: unknown): Record<string, string>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type WorkDocumentIndexEntryDraft, type WorkDocumentIndexOptions } from './work-document-index';
|
|
2
|
+
export type WorkDocumentIndexEntryInstructionResult = {
|
|
3
|
+
supported: true;
|
|
4
|
+
value: WorkDocumentIndexEntryDraft;
|
|
5
|
+
} | {
|
|
6
|
+
supported: false;
|
|
7
|
+
reason: 'not-index-entry' | 'invalid-instruction' | 'invalid-entry' | 'unsupported-switch';
|
|
8
|
+
};
|
|
9
|
+
export type WorkDocumentIndexInstructionResult = {
|
|
10
|
+
supported: true;
|
|
11
|
+
options: WorkDocumentIndexOptions;
|
|
12
|
+
} | {
|
|
13
|
+
supported: false;
|
|
14
|
+
reason: 'not-index' | 'invalid-instruction' | 'invalid-columns' | 'unsupported-switch';
|
|
15
|
+
};
|
|
16
|
+
export declare function parseDocumentIndexEntryInstruction(instruction: string): WorkDocumentIndexEntryInstructionResult;
|
|
17
|
+
export declare function documentIndexEntryInstruction(source: WorkDocumentIndexEntryDraft): string;
|
|
18
|
+
export declare function parseDocumentIndexInstruction(instruction: string): WorkDocumentIndexInstructionResult;
|
|
19
|
+
export declare function documentIndexInstruction(source: WorkDocumentIndexOptions): string;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Node, type CommandProps } from '@tiptap/core';
|
|
2
|
+
import { type WorkDocumentIndexBuildOptions, type WorkDocumentIndexEntry, type WorkDocumentIndexEntryDraft, type WorkDocumentIndexOptions } from './work-document-index';
|
|
3
|
+
declare module '@tiptap/core' {
|
|
4
|
+
interface Commands<ReturnType> {
|
|
5
|
+
documentIndexEntry: {
|
|
6
|
+
markDocumentIndexEntry: (value: WorkDocumentIndexEntryDraft) => ReturnType;
|
|
7
|
+
updateDocumentIndexEntry: (value: WorkDocumentIndexEntryDraft) => ReturnType;
|
|
8
|
+
};
|
|
9
|
+
documentIndex: {
|
|
10
|
+
insertDocumentIndex: (options?: WorkDocumentIndexOptions, buildOptions?: WorkDocumentIndexBuildOptions) => ReturnType;
|
|
11
|
+
updateDocumentIndex: (options: WorkDocumentIndexOptions, buildOptions?: WorkDocumentIndexBuildOptions) => ReturnType;
|
|
12
|
+
refreshDocumentIndexes: (buildOptions?: WorkDocumentIndexBuildOptions) => ReturnType;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
export declare const DocumentIndexEntry: Node<any, any>;
|
|
17
|
+
export declare const DocumentIndex: Node<any, any>;
|
|
18
|
+
export declare function selectedDocumentIndexEntry(editor: {
|
|
19
|
+
state: CommandProps['state'];
|
|
20
|
+
}): WorkDocumentIndexEntry | null;
|
|
21
|
+
export declare function selectedDocumentIndexOptions(editor: {
|
|
22
|
+
state: CommandProps['state'];
|
|
23
|
+
}): WorkDocumentIndexOptions | null;
|
|
24
|
+
export declare function selectedDocumentIndexDraft(editor: {
|
|
25
|
+
state: CommandProps['state'];
|
|
26
|
+
}): WorkDocumentIndexEntryDraft | null;
|
|
27
|
+
export declare function documentHasIndexEntries(editor: {
|
|
28
|
+
state: CommandProps['state'];
|
|
29
|
+
}): boolean;
|
|
30
|
+
export declare function documentHasIndex(editor: {
|
|
31
|
+
state: CommandProps['state'];
|
|
32
|
+
}): boolean;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { Node as ProseMirrorNode } from '@tiptap/pm/model';
|
|
2
|
+
import type { WorkDocumentFieldContextResolver } from './work-document-fields';
|
|
3
|
+
export type WorkDocumentIndexLeader = 'dot' | 'dash' | 'underline' | 'none';
|
|
4
|
+
export type WorkDocumentIndexFormat = 'indented' | 'run-in';
|
|
5
|
+
export interface WorkDocumentIndexEntryDraft {
|
|
6
|
+
mainEntry: string;
|
|
7
|
+
subEntry: string;
|
|
8
|
+
crossReference: string;
|
|
9
|
+
pageBold: boolean;
|
|
10
|
+
pageItalic: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface WorkDocumentIndexEntry extends WorkDocumentIndexEntryDraft {
|
|
13
|
+
id: string;
|
|
14
|
+
}
|
|
15
|
+
export interface WorkDocumentIndexPage {
|
|
16
|
+
pageNumber: number;
|
|
17
|
+
pageBold: boolean;
|
|
18
|
+
pageItalic: boolean;
|
|
19
|
+
targetIds: string[];
|
|
20
|
+
}
|
|
21
|
+
export interface WorkDocumentIndexGeneratedEntry {
|
|
22
|
+
mainEntry: string;
|
|
23
|
+
subEntry: string;
|
|
24
|
+
crossReference: string;
|
|
25
|
+
pages: WorkDocumentIndexPage[];
|
|
26
|
+
}
|
|
27
|
+
export interface WorkDocumentIndexOptions {
|
|
28
|
+
columns: number;
|
|
29
|
+
format: WorkDocumentIndexFormat;
|
|
30
|
+
rightAlignPageNumbers: boolean;
|
|
31
|
+
leader: WorkDocumentIndexLeader;
|
|
32
|
+
}
|
|
33
|
+
export interface WorkDocumentIndexValue {
|
|
34
|
+
id: string;
|
|
35
|
+
options: WorkDocumentIndexOptions;
|
|
36
|
+
entries: WorkDocumentIndexGeneratedEntry[];
|
|
37
|
+
truncated: boolean;
|
|
38
|
+
}
|
|
39
|
+
export interface WorkDocumentIndexBuildOptions {
|
|
40
|
+
resolveContext?: WorkDocumentFieldContextResolver;
|
|
41
|
+
}
|
|
42
|
+
export declare const DEFAULT_DOCUMENT_INDEX_OPTIONS: WorkDocumentIndexOptions;
|
|
43
|
+
export declare const MAX_DOCUMENT_INDEX_ENTRIES = 512;
|
|
44
|
+
export declare const MAX_DOCUMENT_INDEX_MARKERS = 2048;
|
|
45
|
+
export declare const MAX_DOCUMENT_INDEX_TERM_LENGTH = 240;
|
|
46
|
+
export declare function normalizeDocumentIndexEntryDraft(source: Partial<WorkDocumentIndexEntryDraft> | null | undefined): WorkDocumentIndexEntryDraft | null;
|
|
47
|
+
export declare function normalizeDocumentIndexEntry(source: Partial<WorkDocumentIndexEntry> | null | undefined, fallbackId?: string): WorkDocumentIndexEntry | null;
|
|
48
|
+
export declare function normalizeDocumentIndexOptions(source: Partial<WorkDocumentIndexOptions> | null | undefined): WorkDocumentIndexOptions;
|
|
49
|
+
export declare function normalizeDocumentIndexValue(source: Omit<WorkDocumentIndexValue, 'truncated'> & {
|
|
50
|
+
truncated?: boolean;
|
|
51
|
+
}): WorkDocumentIndexValue;
|
|
52
|
+
export declare function buildDocumentIndexEntries(document: ProseMirrorNode, options?: WorkDocumentIndexBuildOptions): {
|
|
53
|
+
entries: WorkDocumentIndexGeneratedEntry[];
|
|
54
|
+
truncated: boolean;
|
|
55
|
+
};
|
|
56
|
+
export declare function documentIndexEntryHtml(source: Partial<WorkDocumentIndexEntry>): string;
|
|
57
|
+
export declare function documentIndexHtml(source: Omit<WorkDocumentIndexValue, 'truncated'> & {
|
|
58
|
+
truncated?: boolean;
|
|
59
|
+
}): string;
|
|
60
|
+
export declare function documentIndexEntryFromElement(element: HTMLElement, index?: number): WorkDocumentIndexEntry | null;
|
|
61
|
+
export declare function documentIndexValueFromElement(element: HTMLElement, index?: number): WorkDocumentIndexValue;
|
|
62
|
+
export declare function normalizeDocumentIndexesHtml(source: string): string;
|
|
63
|
+
export declare function indexLeader(value: unknown): WorkDocumentIndexLeader | null;
|
|
@@ -10,5 +10,6 @@ export interface WorkDocumentOutlineItem {
|
|
|
10
10
|
hasChildren: boolean;
|
|
11
11
|
}
|
|
12
12
|
export declare function collectWorkDocumentOutline(document: ProseMirrorNode): WorkDocumentOutlineItem[];
|
|
13
|
+
export declare function workDocumentOutlineLevel(node: ProseMirrorNode): number | null;
|
|
13
14
|
export declare function currentWorkDocumentOutlineItem(items: readonly WorkDocumentOutlineItem[], position: number): WorkDocumentOutlineItem | null;
|
|
14
15
|
export declare function visibleWorkDocumentOutlineItems(items: readonly WorkDocumentOutlineItem[], collapsedIds: ReadonlySet<string>, rawQuery: string): WorkDocumentOutlineItem[];
|
|
@@ -16,3 +16,9 @@ export declare function parseDocumentParagraphShading(source: unknown): Document
|
|
|
16
16
|
export declare function serializeDocumentParagraphShading(source: unknown): string | undefined;
|
|
17
17
|
export declare function parseDocumentParagraphShadingElement(element: HTMLElement): DocumentParagraphShading | null;
|
|
18
18
|
export declare function documentParagraphShadingDomAttributes(source: unknown): Record<string, string>;
|
|
19
|
+
export declare function documentParagraphShadingPresentation(shading: DocumentParagraphShading): {
|
|
20
|
+
backgroundColor: string;
|
|
21
|
+
backgroundImage?: string;
|
|
22
|
+
backgroundSize?: string;
|
|
23
|
+
};
|
|
24
|
+
export declare function paragraphShadingBackgroundUsesForeground(shading: DocumentParagraphShading): boolean;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type WorkDocumentScriptFontSlot } from './work-document-script-fonts';
|
|
2
|
+
export declare const DOCUMENT_PROOFING_LANGUAGES_ATTRIBUTE = "data-office-proofing-languages";
|
|
3
|
+
export declare const DOCUMENT_NO_PROOF_ATTRIBUTE = "data-office-no-proof";
|
|
4
|
+
export interface WorkDocumentProofingLanguages {
|
|
5
|
+
latin?: string;
|
|
6
|
+
eastAsia?: string;
|
|
7
|
+
bidi?: string;
|
|
8
|
+
}
|
|
9
|
+
export type WorkDocumentProofingLanguageSlot = keyof WorkDocumentProofingLanguages;
|
|
10
|
+
export declare function normalizeDocumentLanguageTag(source: unknown): string | null;
|
|
11
|
+
export declare function normalizeDocumentProofingLanguages(source: unknown): WorkDocumentProofingLanguages | null;
|
|
12
|
+
export declare function serializeDocumentProofingLanguages(source: unknown): string | undefined;
|
|
13
|
+
export declare function parseDocumentProofingLanguages(source: unknown): WorkDocumentProofingLanguages | null;
|
|
14
|
+
export declare function normalizeDocumentNoProof(source: unknown): boolean | null;
|
|
15
|
+
export declare function documentProofingLanguagesFromElement(element: HTMLElement): WorkDocumentProofingLanguages | null;
|
|
16
|
+
export declare function documentNoProofFromElement(element: HTMLElement): boolean | null;
|
|
17
|
+
export declare function documentProofingLanguageForScript(source: unknown, slot?: WorkDocumentScriptFontSlot | null): string | undefined;
|
|
18
|
+
export declare function documentProofingDomAttributes(languagesSource: unknown, noProofSource?: unknown, slot?: WorkDocumentScriptFontSlot | null): Record<string, string>;
|
|
19
|
+
export declare function patchDocumentProofingLanguages(source: unknown, patch: Partial<Record<WorkDocumentProofingLanguageSlot, string | null>>): WorkDocumentProofingLanguages | null;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type DocumentParagraphShading, type DocumentParagraphShadingColor, type DocumentParagraphShadingPattern } from './work-document-paragraph-shading';
|
|
2
|
+
export declare const DOCUMENT_RUN_SHADING_ATTRIBUTE = "data-office-run-shading";
|
|
3
|
+
export type DocumentRunShading = DocumentParagraphShading;
|
|
4
|
+
export type DocumentRunShadingColor = DocumentParagraphShadingColor;
|
|
5
|
+
export type DocumentRunShadingPattern = DocumentParagraphShadingPattern;
|
|
6
|
+
export declare const DOCUMENT_RUN_SHADING_PATTERNS: Set<DocumentParagraphShadingPattern>;
|
|
7
|
+
export declare function normalizeDocumentRunShading(source: unknown): DocumentRunShading | null;
|
|
8
|
+
export declare function parseDocumentRunShading(source: unknown): DocumentRunShading | null;
|
|
9
|
+
export declare function serializeDocumentRunShading(source: unknown): string | undefined;
|
|
10
|
+
export declare function parseDocumentRunShadingElement(element: HTMLElement): DocumentRunShading | null;
|
|
11
|
+
export declare function documentRunShadingDomAttributes(source: unknown): Record<string, string>;
|
|
12
|
+
export declare function documentRunShadingIsVisible(source: unknown): boolean;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Node, type CommandProps } from '@tiptap/core';
|
|
2
|
+
import { type WorkDocumentTableOfContentsBuildOptions, type WorkDocumentTableOfContentsOptions } from './work-document-table-of-contents';
|
|
3
|
+
declare module '@tiptap/core' {
|
|
4
|
+
interface Commands<ReturnType> {
|
|
5
|
+
documentTableOfContents: {
|
|
6
|
+
insertDocumentTableOfContents: (options?: WorkDocumentTableOfContentsOptions, buildOptions?: WorkDocumentTableOfContentsBuildOptions) => ReturnType;
|
|
7
|
+
updateDocumentTableOfContents: (options: WorkDocumentTableOfContentsOptions, buildOptions?: WorkDocumentTableOfContentsBuildOptions) => ReturnType;
|
|
8
|
+
refreshDocumentTablesOfContents: (buildOptions?: WorkDocumentTableOfContentsBuildOptions) => ReturnType;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export declare const DocumentTableOfContents: Node<any, any>;
|
|
13
|
+
export declare function selectedDocumentTableOfContentsOptions(editor: {
|
|
14
|
+
state: CommandProps['state'];
|
|
15
|
+
}): WorkDocumentTableOfContentsOptions | null;
|
|
16
|
+
export declare function documentHasTableOfContents(editor: {
|
|
17
|
+
state: CommandProps['state'];
|
|
18
|
+
}): boolean;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { Node as ProseMirrorNode } from '@tiptap/pm/model';
|
|
2
|
+
import type { WorkDocumentFieldContextResolver } from './work-document-fields';
|
|
3
|
+
export type WorkDocumentTableOfContentsLeader = 'dot' | 'dash' | 'underline' | 'none';
|
|
4
|
+
export interface WorkDocumentTableOfContentsOptions {
|
|
5
|
+
minLevel: number;
|
|
6
|
+
maxLevel: number;
|
|
7
|
+
hyperlinks: boolean;
|
|
8
|
+
showPageNumbers: boolean;
|
|
9
|
+
rightAlignPageNumbers: boolean;
|
|
10
|
+
leader: WorkDocumentTableOfContentsLeader;
|
|
11
|
+
}
|
|
12
|
+
export interface WorkDocumentTableOfContentsEntry {
|
|
13
|
+
targetId: string;
|
|
14
|
+
title: string;
|
|
15
|
+
level: number;
|
|
16
|
+
pageNumber: number;
|
|
17
|
+
}
|
|
18
|
+
export interface WorkDocumentTableOfContentsValue {
|
|
19
|
+
id: string;
|
|
20
|
+
options: WorkDocumentTableOfContentsOptions;
|
|
21
|
+
entries: WorkDocumentTableOfContentsEntry[];
|
|
22
|
+
truncated: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface WorkDocumentTableOfContentsBuildOptions {
|
|
25
|
+
resolveContext?: WorkDocumentFieldContextResolver;
|
|
26
|
+
}
|
|
27
|
+
export type WorkDocumentTableOfContentsInstructionResult = {
|
|
28
|
+
supported: true;
|
|
29
|
+
options: WorkDocumentTableOfContentsOptions;
|
|
30
|
+
} | {
|
|
31
|
+
supported: false;
|
|
32
|
+
reason: 'not-table-of-contents' | 'invalid-instruction' | 'invalid-level-range' | 'unsupported-switch' | 'unsupported-page-range' | 'unsupported-separator';
|
|
33
|
+
};
|
|
34
|
+
export declare const DEFAULT_DOCUMENT_TABLE_OF_CONTENTS_OPTIONS: WorkDocumentTableOfContentsOptions;
|
|
35
|
+
export declare const MAX_DOCUMENT_TABLE_OF_CONTENTS_ENTRIES = 512;
|
|
36
|
+
export declare function normalizeDocumentTableOfContentsOptions(source: Partial<WorkDocumentTableOfContentsOptions> | null | undefined): WorkDocumentTableOfContentsOptions;
|
|
37
|
+
export declare function buildDocumentTableOfContentsEntries(document: ProseMirrorNode, options: WorkDocumentTableOfContentsOptions, buildOptions?: WorkDocumentTableOfContentsBuildOptions): {
|
|
38
|
+
entries: WorkDocumentTableOfContentsEntry[];
|
|
39
|
+
truncated: boolean;
|
|
40
|
+
};
|
|
41
|
+
export declare function documentTableOfContentsHtml(source: Omit<WorkDocumentTableOfContentsValue, 'truncated'> & {
|
|
42
|
+
truncated?: boolean;
|
|
43
|
+
}): string;
|
|
44
|
+
export declare function normalizeDocumentTableOfContentsHtml(source: string): string;
|
|
45
|
+
export declare function documentTableOfContentsValueFromElement(element: HTMLElement, index?: number): WorkDocumentTableOfContentsValue;
|
|
46
|
+
export declare function parseDocumentTableOfContentsInstruction(instruction: string): WorkDocumentTableOfContentsInstructionResult;
|
|
47
|
+
export declare function documentTableOfContentsInstruction(source: WorkDocumentTableOfContentsOptions): string;
|
|
48
|
+
export declare function tableOfContentsLeader(value: unknown): WorkDocumentTableOfContentsLeader | null;
|
|
49
|
+
export declare function normalizeDocumentTableOfContentsValue(source: Omit<WorkDocumentTableOfContentsValue, 'truncated'> & {
|
|
50
|
+
truncated?: boolean;
|
|
51
|
+
}): WorkDocumentTableOfContentsValue;
|
|
@@ -14,6 +14,9 @@ declare module '@tiptap/extension-text-style' {
|
|
|
14
14
|
legacyTextEmboss?: boolean | null;
|
|
15
15
|
legacyTextImprint?: boolean | null;
|
|
16
16
|
runBorder?: string | null;
|
|
17
|
+
runShading?: string | null;
|
|
18
|
+
proofingLanguages?: string | null;
|
|
19
|
+
noProof?: boolean | null;
|
|
17
20
|
kerningThresholdHalfPoints?: number | null;
|
|
18
21
|
scriptFonts?: string | null;
|
|
19
22
|
scriptFontSlot?: WorkDocumentScriptFontSlot | null;
|
|
@@ -12,5 +12,5 @@ export interface DocxFieldOccurrence {
|
|
|
12
12
|
export declare function docxFieldInstructions(root: ParentNode): string[];
|
|
13
13
|
export declare function docxFieldOccurrences(root: ParentNode): DocxFieldOccurrence[];
|
|
14
14
|
export declare function docxFieldOccurrenceIsInlineEditable(field: DocxFieldOccurrence): boolean;
|
|
15
|
-
export declare function hasInvalidDocxFieldStructure(root: ParentNode): boolean;
|
|
15
|
+
export declare function hasInvalidDocxFieldStructure(root: ParentNode, ignore?: (field: DocxFieldOccurrence) => boolean): boolean;
|
|
16
16
|
export declare function docxFieldResultText(field: DocxFieldOccurrence): string;
|