@a3s-lab/office 0.29.0 → 0.30.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 +100 -3
- package/dist/{0~7043.js → 0~7231.js} +160 -2
- package/dist/{0~5093.js → 0~7360.js} +233 -52
- package/dist/0~document-editor.js +1159 -149
- package/dist/0~spreadsheet-editor.js +183 -34
- package/dist/0~work-docx-export.js +299 -11
- package/dist/0~work-docx-import.js +30 -7
- package/dist/0~work-office-diagnostics.js +125 -5
- package/dist/1544.js +13 -1
- package/dist/4104.js +29 -6
- package/dist/4121.js +1939 -1
- package/dist/6282.js +501 -1006
- package/dist/internal/features/work/editors/document-command-catalog.d.ts +18 -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-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-table-of-contents-dialog.d.ts +10 -0
- package/dist/internal/features/work/editors/document-toolbar.d.ts +3 -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 +2 -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-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 +3 -1
- 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 +311 -4
- package/docs/latest/en/browser-editor-architecture.md +50 -1
- package/package.json +12 -2
|
@@ -598,6 +598,24 @@ 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
|
+
};
|
|
601
619
|
readonly refreshFields: {
|
|
602
620
|
readonly id: "references.refreshFields";
|
|
603
621
|
readonly label: "更新域";
|
|
@@ -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;
|
|
@@ -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,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,13 @@ interface DocumentToolbarProps {
|
|
|
57
57
|
onInsertNote: (kind: WorkDocumentNoteKind) => void;
|
|
58
58
|
onInsertCaption: (kind: WorkDocumentCaptionKind) => void;
|
|
59
59
|
onInsertCrossReference: () => void;
|
|
60
|
+
onOpenTableOfContents: () => void;
|
|
60
61
|
citationsOpen: boolean;
|
|
61
62
|
citationSourceCount: number;
|
|
62
63
|
onToggleCitations: () => void;
|
|
63
64
|
onInsertField: (kind: WorkDocumentFieldKind) => void;
|
|
64
65
|
onRefreshFields: () => void;
|
|
66
|
+
onRefreshTableOfContents: () => void;
|
|
65
67
|
canInsertComment: boolean;
|
|
66
68
|
onInsertComment: () => void;
|
|
67
69
|
commentsOpen: boolean;
|
|
@@ -79,5 +81,5 @@ interface DocumentToolbarProps {
|
|
|
79
81
|
onOpenWordCount: () => void;
|
|
80
82
|
onOpenFindReplace: (mode: DocumentFindReplaceMode) => void;
|
|
81
83
|
}
|
|
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;
|
|
84
|
+
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, citationsOpen, citationSourceCount, onToggleCitations, onInsertField, onRefreshFields, onRefreshTableOfContents, canInsertComment, onInsertComment, commentsOpen, commentCount, onToggleComments, trackChanges, changesOpen, changeCount, findReplaceMode, fileActions, onRibbonTabChange, onToggleTrackChanges, onToggleChanges, onDecideChange, onOpenWordCount, onOpenFindReplace, }: DocumentToolbarProps): import("react").JSX.Element;
|
|
83
85
|
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,9 @@ export interface DocumentInsertCommands {
|
|
|
11
11
|
insertField: (kind: WorkDocumentFieldKind) => void;
|
|
12
12
|
insertImage: (file: File) => Promise<void>;
|
|
13
13
|
insertNote: (kind: WorkDocumentNoteKind) => boolean;
|
|
14
|
+
openTableOfContents: () => void;
|
|
14
15
|
refreshFields: () => boolean;
|
|
16
|
+
refreshTableOfContents: () => boolean;
|
|
15
17
|
}
|
|
16
18
|
export declare function useDocumentInsertCommands({ contentRef, editor, resolveFieldContext, }: {
|
|
17
19
|
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>;
|
|
@@ -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;
|
|
@@ -5,6 +5,7 @@ import { type ImportedDocxCitationMarkers } from './work-docx-citation-import';
|
|
|
5
5
|
import { type ImportedDocxCommentMarkers } from './work-docx-comment-import';
|
|
6
6
|
import { type ImportedDocxEquationMarkers } from './work-docx-equation-import';
|
|
7
7
|
import { type ImportedDocxFieldMarkers } from './work-docx-field-import';
|
|
8
|
+
import { type ImportedDocxTableOfContentsMarkers } from './work-docx-table-of-contents-import';
|
|
8
9
|
import { type ImportedDocxImageLayoutMarkers } from './work-docx-image-layout-import';
|
|
9
10
|
import { type ImportedDocxListMarkers } from './work-docx-list-import';
|
|
10
11
|
import { type ImportedDocxParagraphAlignmentMarkers } from './work-docx-paragraph-alignment-import';
|
|
@@ -36,6 +37,7 @@ export interface PreparedDocxImport {
|
|
|
36
37
|
changeMarkers: ImportedDocxChangeMarkers;
|
|
37
38
|
commentMarkers: ImportedDocxCommentMarkers;
|
|
38
39
|
fieldMarkers: ImportedDocxFieldMarkers;
|
|
40
|
+
tableOfContentsMarkers: ImportedDocxTableOfContentsMarkers;
|
|
39
41
|
equationMarkers: ImportedDocxEquationMarkers;
|
|
40
42
|
citationMarkers: ImportedDocxCitationMarkers;
|
|
41
43
|
listMarkers: ImportedDocxListMarkers;
|
|
@@ -58,6 +60,6 @@ export interface PreparedDocxImport {
|
|
|
58
60
|
trackChanges: boolean;
|
|
59
61
|
}
|
|
60
62
|
export declare function prepareDocxImport(buffer: ArrayBuffer, sourcePackage?: OoxmlPackage): Promise<PreparedDocxImport>;
|
|
61
|
-
export declare function applyDocxSectionsToHtml(html: string, sections: PreparedDocxImport['sections'], captionMarkers?: ImportedDocxCaptionMarkers, bookmarkMarkers?: ImportedDocxBookmarkMarkers, changeMarkers?: ImportedDocxChangeMarkers, commentMarkers?: ImportedDocxCommentMarkers, fieldMarkers?: ImportedDocxFieldMarkers, equationMarkers?: ImportedDocxEquationMarkers, citationMarkers?: ImportedDocxCitationMarkers, listMarkers?: ImportedDocxListMarkers, imageLayoutMarkers?: ImportedDocxImageLayoutMarkers, paragraphIdentityMarkers?: ImportedDocxParagraphIdentityMarkers, paragraphFormattingChangeMarkers?: ImportedDocxParagraphFormattingChangeMarkers, paragraphAlignmentMarkers?: ImportedDocxParagraphAlignmentMarkers, runFormattingMarkers?: ImportedDocxRunFormattingMarkers, paragraphDirectionMarkers?: ImportedDocxParagraphDirectionMarkers, paragraphIndentMarkers?: ImportedDocxParagraphIndentMarkers, paragraphSpacingMarkers?: ImportedDocxParagraphSpacingMarkers, paragraphBorderMarkers?: ImportedDocxParagraphBorderMarkers, paragraphShadingMarkers?: ImportedDocxParagraphShadingMarkers, paragraphPaginationMarkers?: ImportedDocxParagraphPaginationMarkers, bibliography?: WorkDocumentContent['bibliography'], tabStopMarkers?: ImportedDocxParagraphTabStopMarkers, tableCellMarkers?: ImportedDocxTableCellMarkers, tableRowMarkers?: ImportedDocxTableRowMarkers, tableSizingMarkers?: ImportedDocxTableSizingMarkers): string;
|
|
63
|
+
export declare function applyDocxSectionsToHtml(html: string, sections: PreparedDocxImport['sections'], captionMarkers?: ImportedDocxCaptionMarkers, bookmarkMarkers?: ImportedDocxBookmarkMarkers, changeMarkers?: ImportedDocxChangeMarkers, commentMarkers?: ImportedDocxCommentMarkers, fieldMarkers?: ImportedDocxFieldMarkers, tableOfContentsMarkers?: ImportedDocxTableOfContentsMarkers, equationMarkers?: ImportedDocxEquationMarkers, citationMarkers?: ImportedDocxCitationMarkers, listMarkers?: ImportedDocxListMarkers, imageLayoutMarkers?: ImportedDocxImageLayoutMarkers, paragraphIdentityMarkers?: ImportedDocxParagraphIdentityMarkers, paragraphFormattingChangeMarkers?: ImportedDocxParagraphFormattingChangeMarkers, paragraphAlignmentMarkers?: ImportedDocxParagraphAlignmentMarkers, runFormattingMarkers?: ImportedDocxRunFormattingMarkers, paragraphDirectionMarkers?: ImportedDocxParagraphDirectionMarkers, paragraphIndentMarkers?: ImportedDocxParagraphIndentMarkers, paragraphSpacingMarkers?: ImportedDocxParagraphSpacingMarkers, paragraphBorderMarkers?: ImportedDocxParagraphBorderMarkers, paragraphShadingMarkers?: ImportedDocxParagraphShadingMarkers, paragraphPaginationMarkers?: ImportedDocxParagraphPaginationMarkers, bibliography?: WorkDocumentContent['bibliography'], tabStopMarkers?: ImportedDocxParagraphTabStopMarkers, tableCellMarkers?: ImportedDocxTableCellMarkers, tableRowMarkers?: ImportedDocxTableRowMarkers, tableSizingMarkers?: ImportedDocxTableSizingMarkers): string;
|
|
62
64
|
export declare function readDocxLayout(buffer: ArrayBuffer): Promise<ImportedDocumentLayout>;
|
|
63
65
|
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type WorkDocumentProofingLanguages } from './work-document-proofing';
|
|
2
|
+
export interface DocxProofingLanguageOptions {
|
|
3
|
+
value?: string;
|
|
4
|
+
eastAsia?: string;
|
|
5
|
+
bidirectional?: string;
|
|
6
|
+
}
|
|
7
|
+
export type DocxProofingLanguagesInspection = {
|
|
8
|
+
status: 'absent';
|
|
9
|
+
spoofedCount: number;
|
|
10
|
+
} | {
|
|
11
|
+
status: 'invalid';
|
|
12
|
+
spoofedCount: number;
|
|
13
|
+
} | {
|
|
14
|
+
status: 'valid';
|
|
15
|
+
value: WorkDocumentProofingLanguages;
|
|
16
|
+
spoofedCount: number;
|
|
17
|
+
};
|
|
18
|
+
export type DocxNoProofInspection = {
|
|
19
|
+
status: 'absent';
|
|
20
|
+
spoofedCount: number;
|
|
21
|
+
} | {
|
|
22
|
+
status: 'invalid';
|
|
23
|
+
spoofedCount: number;
|
|
24
|
+
} | {
|
|
25
|
+
status: 'valid';
|
|
26
|
+
value: boolean;
|
|
27
|
+
spoofedCount: number;
|
|
28
|
+
};
|
|
29
|
+
export interface ResolvedDocxProofing {
|
|
30
|
+
languages: WorkDocumentProofingLanguages | undefined;
|
|
31
|
+
noProof: boolean | undefined;
|
|
32
|
+
invalidCount: number;
|
|
33
|
+
spoofedCount: number;
|
|
34
|
+
}
|
|
35
|
+
export declare function inspectDocxProofingLanguages(properties: Element | null | undefined): DocxProofingLanguagesInspection;
|
|
36
|
+
export declare function inspectDocxNoProof(properties: Element | null | undefined): DocxNoProofInspection;
|
|
37
|
+
export declare function resolveDocxProofing(propertySources: readonly Element[]): ResolvedDocxProofing;
|
|
38
|
+
export declare function documentProofingLanguageDocxOptions(source: unknown): DocxProofingLanguageOptions | undefined;
|
|
@@ -8,6 +8,9 @@ import { type WorkDocumentUnderlineFormatting } from './work-document-underline'
|
|
|
8
8
|
import { type WorkDocumentStrikeFormatting } from './work-document-strike';
|
|
9
9
|
import { type WorkDocumentScriptFontSlot, type WorkDocumentScriptFonts } from './work-document-script-fonts';
|
|
10
10
|
import { type DocumentRunBorder } from './work-document-run-border';
|
|
11
|
+
import { type DocumentRunShading } from './work-document-run-shading';
|
|
12
|
+
import { type WorkDocumentHighlight } from './work-document-highlight';
|
|
13
|
+
import { type WorkDocumentProofingLanguages } from './work-document-proofing';
|
|
11
14
|
export interface ImportedDocxRunFormatting {
|
|
12
15
|
bold?: boolean;
|
|
13
16
|
italic?: boolean;
|
|
@@ -33,10 +36,14 @@ export interface ImportedDocxRunFormatting {
|
|
|
33
36
|
fontSize?: number;
|
|
34
37
|
color?: string;
|
|
35
38
|
backgroundColor?: string;
|
|
39
|
+
highlight?: WorkDocumentHighlight;
|
|
36
40
|
themeColor?: DocxThemeColorReference;
|
|
37
41
|
themeFill?: DocxThemeColorReference;
|
|
38
42
|
textCase?: WorkDocumentTextCase;
|
|
39
43
|
runBorder?: DocumentRunBorder;
|
|
44
|
+
runShading?: DocumentRunShading;
|
|
45
|
+
proofingLanguages?: WorkDocumentProofingLanguages;
|
|
46
|
+
noProof?: boolean;
|
|
40
47
|
}
|
|
41
48
|
export interface ImportedDocxRunFormattingMarker {
|
|
42
49
|
startMarker: string;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { IRunOptions } from 'docx';
|
|
2
|
+
import { type DocumentRunShading } from './work-document-run-shading';
|
|
3
|
+
export interface DocxRunShadingPatch {
|
|
4
|
+
marker: string;
|
|
5
|
+
shading: DocumentRunShading;
|
|
6
|
+
}
|
|
7
|
+
export declare class DocxRunShadingPatchCollector {
|
|
8
|
+
readonly patches: DocxRunShadingPatch[];
|
|
9
|
+
private nextMarker;
|
|
10
|
+
private readonly usedColors;
|
|
11
|
+
constructor(sourceHtml: string);
|
|
12
|
+
marker(source: unknown): string | null;
|
|
13
|
+
hasMarker(value: string | null | undefined): value is string;
|
|
14
|
+
}
|
|
15
|
+
export declare function documentRunShadingDocxOptions(source: unknown, collector: DocxRunShadingPatchCollector): Pick<IRunOptions, 'shading'>;
|
|
16
|
+
export declare function patchDocxRunShading(buffer: ArrayBuffer, patches: readonly DocxRunShadingPatch[]): Promise<ArrayBuffer>;
|
|
17
|
+
export declare function setDocxRunShadingAttributes(document: Document, element: Element, source: unknown): boolean;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { DocumentRunShading } from './work-document-run-shading';
|
|
2
|
+
import { type DocxThemeSource } from './work-docx-theme';
|
|
3
|
+
export type DocxRunShadingInspection = {
|
|
4
|
+
status: 'absent';
|
|
5
|
+
spoofedCount: number;
|
|
6
|
+
} | {
|
|
7
|
+
status: 'invalid';
|
|
8
|
+
spoofedCount: number;
|
|
9
|
+
} | {
|
|
10
|
+
status: 'valid';
|
|
11
|
+
value: DocumentRunShading;
|
|
12
|
+
spoofedCount: number;
|
|
13
|
+
};
|
|
14
|
+
export interface ResolvedDocxRunShading {
|
|
15
|
+
shading: DocumentRunShading | undefined;
|
|
16
|
+
invalidCount: number;
|
|
17
|
+
spoofedCount: number;
|
|
18
|
+
}
|
|
19
|
+
export declare function inspectDocxRunShading(properties: Element | null | undefined, themeSource?: DocxThemeSource): DocxRunShadingInspection;
|
|
20
|
+
export declare function resolveDocxRunShading(propertySources: readonly Element[], themeSource?: DocxThemeSource): ResolvedDocxRunShading;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type WorkDocumentTableOfContentsEntry, type WorkDocumentTableOfContentsOptions } from './work-document-table-of-contents';
|
|
2
|
+
export interface DocxTableOfContentsPatch {
|
|
3
|
+
options: WorkDocumentTableOfContentsOptions;
|
|
4
|
+
entries: WorkDocumentTableOfContentsEntry[];
|
|
5
|
+
}
|
|
6
|
+
export declare class DocxTableOfContentsPatchCollector {
|
|
7
|
+
readonly patches: DocxTableOfContentsPatch[];
|
|
8
|
+
add(element: HTMLElement): DocxTableOfContentsPatch;
|
|
9
|
+
}
|
|
10
|
+
export declare function docxTableOfContents(element: HTMLElement, docx: typeof import('docx'), collector: DocxTableOfContentsPatchCollector): InstanceType<typeof docx.TableOfContents>;
|
|
11
|
+
export declare function patchDocxTableOfContents(buffer: ArrayBuffer, patches: readonly DocxTableOfContentsPatch[]): Promise<ArrayBuffer>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type WorkDocumentTableOfContentsEntry, type WorkDocumentTableOfContentsOptions } from './work-document-table-of-contents';
|
|
2
|
+
import { type DocxFieldOccurrence } from './work-docx-field-instructions';
|
|
3
|
+
export interface ImportedDocxTableOfContentsMarkers {
|
|
4
|
+
tables: ImportedDocxTableOfContentsMarker[];
|
|
5
|
+
}
|
|
6
|
+
export interface ImportedDocxTableOfContentsMarker {
|
|
7
|
+
marker: string;
|
|
8
|
+
id: string;
|
|
9
|
+
options: WorkDocumentTableOfContentsOptions;
|
|
10
|
+
entries: WorkDocumentTableOfContentsEntry[];
|
|
11
|
+
}
|
|
12
|
+
export declare function markDocxTablesOfContents(document: Document): ImportedDocxTableOfContentsMarkers;
|
|
13
|
+
export declare function applyImportedDocxTableOfContentsMarkers(document: Document, markers: ImportedDocxTableOfContentsMarkers): void;
|
|
14
|
+
export declare function hasImportedDocxTableOfContentsMarkers(markers: ImportedDocxTableOfContentsMarkers): boolean;
|
|
15
|
+
export declare function supportedDocxTableOfContentsField(field: DocxFieldOccurrence): boolean;
|
|
@@ -1,2 +1,9 @@
|
|
|
1
|
+
import type { WorkSpreadsheetDataValidationErrorStyle } from './work-types';
|
|
2
|
+
export declare const SPREADSHEET_DATA_VALIDATION_TITLE_LIMIT = 32;
|
|
3
|
+
export declare const SPREADSHEET_DATA_VALIDATION_HINT_LIMIT = 255;
|
|
4
|
+
export declare const SPREADSHEET_DATA_VALIDATION_ERROR_LIMIT = 225;
|
|
5
|
+
export declare const SPREADSHEET_DATA_VALIDATION_ERROR_STYLES: readonly ["stop", "warning", "information"];
|
|
6
|
+
export declare function normalizeSpreadsheetDataValidationErrorStyle(value: unknown): WorkSpreadsheetDataValidationErrorStyle;
|
|
7
|
+
export declare function boundedSpreadsheetDataValidationText(value: unknown, limit: number): string;
|
|
1
8
|
export declare function normalizeSpreadsheetDateValidationBoundary(value: string, uses1904DateSystem?: boolean): string | null;
|
|
2
9
|
export declare function spreadsheetDateValidationFormula(value: string): string;
|