@a3s-lab/office 0.25.0 → 0.27.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 +76 -2
- package/dist/0~4595.js +16 -2
- package/dist/0~5093.js +463 -201
- package/dist/0~6090.js +77 -77
- package/dist/{0~2805.js → 0~7043.js} +305 -2
- package/dist/0~document-editor.js +2451 -985
- package/dist/0~spreadsheet-editor.js +22113 -20117
- package/dist/0~work-docx-export.js +492 -10
- package/dist/0~work-docx-import.js +171 -98
- package/dist/0~work-office-diagnostics.js +198 -4
- package/dist/{164.js → 1544.js} +1412 -1055
- package/dist/4104.js +145 -29
- package/dist/6282.js +1920 -544
- package/dist/9424.js +16 -0
- package/dist/core.js +1 -1
- package/dist/index.js +1 -1
- package/dist/internal/features/work/editors/document-command-catalog.d.ts +102 -0
- package/dist/internal/features/work/editors/document-font-dialog-model.d.ts +83 -0
- package/dist/internal/features/work/editors/document-font-dialog-script-font-model.d.ts +18 -0
- package/dist/internal/features/work/editors/document-font-dialog.d.ts +9 -0
- package/dist/internal/features/work/editors/document-home-ribbon.d.ts +2 -1
- package/dist/internal/features/work/editors/document-page-chrome-editor.d.ts +6 -0
- package/dist/internal/features/work/editors/document-page-chrome-ribbon.d.ts +2 -1
- package/dist/internal/features/work/editors/document-strike-ribbon.d.ts +7 -0
- package/dist/internal/features/work/editors/document-text-case-ribbon.d.ts +4 -0
- package/dist/internal/features/work/editors/document-toolbar.d.ts +3 -1
- package/dist/internal/features/work/editors/document-underline-ribbon.d.ts +9 -0
- package/dist/internal/features/work/editors/document-wps-shortcuts.d.ts +1 -0
- package/dist/internal/features/work/editors/spreadsheet-cell-fill-format.d.ts +11 -0
- package/dist/internal/features/work/editors/spreadsheet-cell-format.d.ts +2 -1
- package/dist/internal/features/work/editors/spreadsheet-command-controller.d.ts +18 -9
- package/dist/internal/features/work/editors/spreadsheet-format-cells-dialog-model.d.ts +13 -2
- package/dist/internal/features/work/editors/spreadsheet-format-cells-fill-panel.d.ts +13 -0
- package/dist/internal/features/work/editors/spreadsheet-format-cells-fill-preview.d.ts +6 -0
- package/dist/internal/features/work/editors/spreadsheet-format-painter.d.ts +1 -1
- package/dist/internal/features/work/editors/spreadsheet-operation-projection.d.ts +6 -0
- package/dist/internal/features/work/editors/spreadsheet-rich-text-dom-selection.d.ts +11 -0
- package/dist/internal/features/work/editors/spreadsheet-rich-text-paste.d.ts +22 -0
- package/dist/internal/features/work/editors/spreadsheet-rich-text-selection-controller.d.ts +38 -0
- package/dist/internal/features/work/editors/spreadsheet-rich-text-selection-format.d.ts +26 -0
- package/dist/internal/features/work/editors/work-office-chrome.d.ts +9 -1
- package/dist/internal/features/work/work-css-color.d.ts +1 -0
- package/dist/internal/features/work/work-document-character-formatting.d.ts +16 -1
- package/dist/internal/features/work/work-document-character-position.d.ts +9 -0
- package/dist/internal/features/work/work-document-character-scale.d.ts +8 -0
- package/dist/internal/features/work/work-document-character-spacing.d.ts +8 -0
- package/dist/internal/features/work/work-document-emphasis.d.ts +7 -0
- package/dist/internal/features/work/work-document-equations.d.ts +2 -1
- package/dist/internal/features/work/work-document-format-changes.d.ts +16 -2
- package/dist/internal/features/work/work-document-hidden-text.d.ts +5 -0
- package/dist/internal/features/work/work-document-kerning.d.ts +10 -0
- package/dist/internal/features/work/work-document-paragraph-shading.d.ts +1 -1
- package/dist/internal/features/work/work-document-script-font-extension.d.ts +2 -0
- package/dist/internal/features/work/work-document-script-fonts.d.ts +51 -0
- package/dist/internal/features/work/work-document-strike.d.ts +21 -0
- package/dist/internal/features/work/work-document-text-case.d.ts +10 -0
- package/dist/internal/features/work/work-document-underline.d.ts +37 -0
- package/dist/internal/features/work/work-document-word-line-metrics.d.ts +12 -0
- package/dist/internal/features/work/work-docx-character-position.d.ts +2 -0
- package/dist/internal/features/work/work-docx-character-scale.d.ts +2 -0
- package/dist/internal/features/work/work-docx-character-spacing.d.ts +4 -0
- package/dist/internal/features/work/work-docx-emphasis-diagnostics.d.ts +3 -0
- package/dist/internal/features/work/work-docx-emphasis.d.ts +14 -0
- package/dist/internal/features/work/work-docx-hidden-text-diagnostics.d.ts +3 -0
- package/dist/internal/features/work/work-docx-hidden-text-export.d.ts +16 -0
- package/dist/internal/features/work/work-docx-hidden-text.d.ts +11 -0
- package/dist/internal/features/work/work-docx-kerning-diagnostics.d.ts +3 -0
- package/dist/internal/features/work/work-docx-kerning.d.ts +14 -0
- package/dist/internal/features/work/work-docx-run-fonts-diagnostics.d.ts +3 -0
- package/dist/internal/features/work/work-docx-run-fonts-export.d.ts +14 -0
- package/dist/internal/features/work/work-docx-run-fonts.d.ts +13 -0
- package/dist/internal/features/work/work-docx-run-formatting-import.d.ts +23 -2
- package/dist/internal/features/work/work-docx-run-script-font-import.d.ts +9 -0
- package/dist/internal/features/work/work-docx-strike.d.ts +8 -0
- package/dist/internal/features/work/work-docx-theme-reference.d.ts +1 -1
- package/dist/internal/features/work/work-docx-twips.d.ts +6 -0
- package/dist/internal/features/work/work-docx-underline.d.ts +3 -0
- package/dist/internal/features/work/work-spreadsheet-gradient-fill-canvas.d.ts +10 -0
- package/dist/internal/features/work/work-spreadsheet-native-fill-canvas.d.ts +8 -0
- package/dist/internal/features/work/work-spreadsheet-pattern-fill-canvas.d.ts +8 -0
- package/dist/internal/features/work/work-xlsx-cell-style-origin.d.ts +2 -1
- package/dist/internal/features/work/work-xlsx-cell-style-writer.d.ts +3 -0
- package/dist/internal/features/work/work-xlsx-cell-styles.d.ts +4 -0
- package/dist/internal/features/work/work-xlsx-gradient-fill.d.ts +31 -0
- package/dist/internal/features/work/work-xlsx-native-fill.d.ts +17 -0
- package/dist/internal/features/work/work-xlsx-pattern-fill.d.ts +21 -0
- package/dist/internal/features/work/work-xlsx-rich-text-edit.d.ts +28 -0
- package/dist/internal/features/work/work-xlsx-rich-text-model.d.ts +40 -0
- package/dist/internal/features/work/work-xlsx-rich-text.d.ts +4 -18
- package/dist/office-kernel.wasm +0 -0
- package/dist/styles.css +770 -80
- package/docs/latest/en/browser-editor-architecture.md +37 -0
- package/package.json +32 -1
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type Cell, type Selection } from '@fortune-sheet/core';
|
|
2
|
+
import type { WorkSpreadsheetContent } from '../work-types';
|
|
3
|
+
import { type SpreadsheetRichTextToggleAttribute } from './spreadsheet-rich-text-selection-format';
|
|
4
|
+
interface SpreadsheetRichTextSelectionSnapshot {
|
|
5
|
+
column: number;
|
|
6
|
+
consumed: boolean;
|
|
7
|
+
editor: HTMLElement;
|
|
8
|
+
end: number;
|
|
9
|
+
root: HTMLElement;
|
|
10
|
+
row: number;
|
|
11
|
+
sheetId: string;
|
|
12
|
+
sourceCell: Cell;
|
|
13
|
+
start: number;
|
|
14
|
+
}
|
|
15
|
+
export interface SpreadsheetRichTextSelectionCapture {
|
|
16
|
+
content: WorkSpreadsheetContent;
|
|
17
|
+
root: HTMLElement | null;
|
|
18
|
+
selection: Selection | null | undefined;
|
|
19
|
+
sheetId: string;
|
|
20
|
+
}
|
|
21
|
+
export declare class SpreadsheetRichTextSelectionController {
|
|
22
|
+
private restoreTimer;
|
|
23
|
+
private snapshot;
|
|
24
|
+
capture(options: SpreadsheetRichTextSelectionCapture): boolean;
|
|
25
|
+
clear(): void;
|
|
26
|
+
canApply(content: WorkSpreadsheetContent, attribute: keyof Cell, value: unknown): boolean;
|
|
27
|
+
apply(content: WorkSpreadsheetContent, onChange: (content: WorkSpreadsheetContent) => void, attribute: keyof Cell, value: unknown): boolean;
|
|
28
|
+
canToggle(content: WorkSpreadsheetContent, attribute: SpreadsheetRichTextToggleAttribute): boolean;
|
|
29
|
+
toggle(content: WorkSpreadsheetContent, onChange: (content: WorkSpreadsheetContent) => void, attribute: SpreadsheetRichTextToggleAttribute): boolean;
|
|
30
|
+
private applyRequest;
|
|
31
|
+
restore(): boolean;
|
|
32
|
+
private cancelScheduledRestore;
|
|
33
|
+
private request;
|
|
34
|
+
private toggleRequest;
|
|
35
|
+
}
|
|
36
|
+
export declare function isSpreadsheetRichTextFormatPointerTarget(target: EventTarget | null): boolean;
|
|
37
|
+
export declare function captureSpreadsheetRichTextSelection({ content, root, selection, sheetId, }: SpreadsheetRichTextSelectionCapture): SpreadsheetRichTextSelectionSnapshot | null;
|
|
38
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Cell } from '@fortune-sheet/core';
|
|
2
|
+
import type { WorkSpreadsheetContent } from '../work-types';
|
|
3
|
+
export type SpreadsheetRichTextFormatAttribute = 'bl' | 'cl' | 'fc' | 'ff' | 'fs' | 'it' | 'un';
|
|
4
|
+
export type SpreadsheetRichTextToggleAttribute = 'bl' | 'cl' | 'it' | 'un';
|
|
5
|
+
export interface SpreadsheetTextSelection {
|
|
6
|
+
end: number;
|
|
7
|
+
start: number;
|
|
8
|
+
}
|
|
9
|
+
export interface SpreadsheetRichTextSelectionFormatRequest {
|
|
10
|
+
attribute: SpreadsheetRichTextFormatAttribute;
|
|
11
|
+
column: number;
|
|
12
|
+
row: number;
|
|
13
|
+
selection: SpreadsheetTextSelection;
|
|
14
|
+
sheetId: string;
|
|
15
|
+
/**
|
|
16
|
+
* A cell reconstructed from the live editor before focus moves into a
|
|
17
|
+
* ribbon popover. It is intentionally internal and still passes through all
|
|
18
|
+
* text, run-count, coordinate, and formatting bounds below.
|
|
19
|
+
*/
|
|
20
|
+
sourceCell?: Cell;
|
|
21
|
+
value: unknown;
|
|
22
|
+
}
|
|
23
|
+
export declare function canApplySpreadsheetRichTextSelectionFormat(content: WorkSpreadsheetContent, request: SpreadsheetRichTextSelectionFormatRequest): boolean;
|
|
24
|
+
export declare function applySpreadsheetRichTextSelectionFormat(content: WorkSpreadsheetContent, request: SpreadsheetRichTextSelectionFormatRequest): WorkSpreadsheetContent | null;
|
|
25
|
+
export declare function formatSpreadsheetRichTextSelection(cell: Cell, selection: SpreadsheetTextSelection, attribute: SpreadsheetRichTextFormatAttribute, value: unknown): Cell | null;
|
|
26
|
+
export declare function spreadsheetRichTextSelectionToggleValue(cell: Cell, selection: SpreadsheetTextSelection, attribute: SpreadsheetRichTextToggleAttribute): 0 | 1 | null;
|
|
@@ -23,6 +23,12 @@ export interface WorkOfficeQuickAccessAction {
|
|
|
23
23
|
disabled?: boolean;
|
|
24
24
|
onSelect: () => void | Promise<void>;
|
|
25
25
|
}
|
|
26
|
+
interface WorkOfficeRibbonDialogLauncher {
|
|
27
|
+
label: string;
|
|
28
|
+
shortcut?: string;
|
|
29
|
+
ariaKeyShortcuts?: string;
|
|
30
|
+
onClick: () => void;
|
|
31
|
+
}
|
|
26
32
|
export declare function WorkOfficeRibbon<T extends string>({ ariaLabel, tabs, defaultTab, activeTab, onTabChange, panels, fileActions, quickAccessActions, adaptive, collapsible, collapsed: controlledCollapsed, defaultCollapsed, onCollapsedChange, className, toolbarClassName, }: {
|
|
27
33
|
ariaLabel: string;
|
|
28
34
|
tabs: readonly WorkOfficeRibbonTab<T>[];
|
|
@@ -47,9 +53,10 @@ export declare function WorkOfficePreviewBar({ ariaLabel, label, detail, fileAct
|
|
|
47
53
|
fileActions?: readonly WorkOfficeFileAction[];
|
|
48
54
|
className?: string;
|
|
49
55
|
}): import("react").JSX.Element;
|
|
50
|
-
export declare function WorkOfficeRibbonGroup({ label, priority, children, }: {
|
|
56
|
+
export declare function WorkOfficeRibbonGroup({ label, priority, dialogLauncher, children, }: {
|
|
51
57
|
label: string;
|
|
52
58
|
priority?: 'high' | 'normal' | 'low';
|
|
59
|
+
dialogLauncher?: WorkOfficeRibbonDialogLauncher;
|
|
53
60
|
children: ReactNode;
|
|
54
61
|
}): import("react").JSX.Element;
|
|
55
62
|
export declare function WorkOfficeRibbonButton({ label, visibleLabel, badge, active, displayLabel, className, title, children, ...props }: Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'aria-label' | 'children'> & {
|
|
@@ -78,3 +85,4 @@ export declare function WorkOfficeZoomControls({ zoom, minimum, maximum, step, d
|
|
|
78
85
|
sliderLabel: string;
|
|
79
86
|
onChange: (zoom: number) => void;
|
|
80
87
|
}): import("react").JSX.Element;
|
|
88
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function normalizeCssColor(source: string | null | undefined): 'transparent' | `#${string}` | null;
|
|
@@ -1,12 +1,27 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { Extension, type Editor } from '@tiptap/core';
|
|
2
|
+
import { type WorkDocumentEmphasisMark } from './work-document-emphasis';
|
|
3
|
+
import { type WorkDocumentTextCase } from './work-document-text-case';
|
|
2
4
|
declare module '@tiptap/core' {
|
|
3
5
|
interface Commands<ReturnType> {
|
|
4
6
|
documentCharacterFormatting: {
|
|
7
|
+
setDocumentCharacterScale: (characterScalePercent: number) => ReturnType;
|
|
5
8
|
toggleDocumentSubscript: () => ReturnType;
|
|
6
9
|
toggleDocumentSuperscript: () => ReturnType;
|
|
10
|
+
setDocumentCharacterSpacing: (characterSpacingTwips: number) => ReturnType;
|
|
11
|
+
setDocumentCharacterPosition: (characterPositionHalfPoints: number) => ReturnType;
|
|
12
|
+
setDocumentKerningThreshold: (kerningThresholdHalfPoints: number) => ReturnType;
|
|
13
|
+
unsetDocumentKerningThreshold: () => ReturnType;
|
|
14
|
+
setDocumentEmphasisMark: (emphasisMark: WorkDocumentEmphasisMark) => ReturnType;
|
|
15
|
+
unsetDocumentEmphasisMark: () => ReturnType;
|
|
16
|
+
setDocumentHiddenText: (hiddenText: boolean) => ReturnType;
|
|
17
|
+
unsetDocumentHiddenText: () => ReturnType;
|
|
18
|
+
toggleDocumentHiddenText: () => ReturnType;
|
|
19
|
+
setDocumentTextCase: (textCase: WorkDocumentTextCase) => ReturnType;
|
|
20
|
+
toggleDocumentTextCase: (textCase: Exclude<WorkDocumentTextCase, 'none'>) => ReturnType;
|
|
7
21
|
};
|
|
8
22
|
}
|
|
9
23
|
}
|
|
24
|
+
export declare const DocumentCharacterFormatting: Extension<any, any>;
|
|
10
25
|
export declare const DocumentSubscript: import("@tiptap/core").Mark<import("@tiptap/extension-subscript").SubscriptExtensionOptions, any>;
|
|
11
26
|
export declare const DocumentSuperscript: import("@tiptap/core").Mark<import("@tiptap/extension-superscript").SuperscriptExtensionOptions, any>;
|
|
12
27
|
export declare function toggleDocumentSubscript(editor: Editor): boolean;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const DOCUMENT_CHARACTER_POSITION_ATTRIBUTE = "data-office-character-position-half-points";
|
|
2
|
+
export declare const DOCUMENT_CHARACTER_POSITION_CSS_PROPERTY = "--work-document-character-position";
|
|
3
|
+
export declare const DOCUMENT_CHARACTER_POSITION_MAX_HALF_POINTS = 3168;
|
|
4
|
+
export declare const DOCUMENT_CHARACTER_POSITION_MIN_HALF_POINTS: number;
|
|
5
|
+
export declare function normalizeDocumentCharacterPositionHalfPoints(value: unknown): number | null;
|
|
6
|
+
export declare function documentCharacterPositionDomAttributes(value: unknown): Record<string, string>;
|
|
7
|
+
export declare function documentCharacterPositionHalfPointsFromElement(element: HTMLElement): number | null;
|
|
8
|
+
export declare function documentCharacterPositionHalfPointsFromCss(value: unknown): number | null;
|
|
9
|
+
export declare function documentCharacterPositionPoints(value: unknown): number | null;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const DOCUMENT_CHARACTER_SCALE_ATTRIBUTE = "data-office-character-scale-percent";
|
|
2
|
+
export declare const DOCUMENT_CHARACTER_SCALE_DEFAULT_PERCENT = 100;
|
|
3
|
+
export declare const DOCUMENT_CHARACTER_SCALE_MIN_PERCENT = 1;
|
|
4
|
+
export declare const DOCUMENT_CHARACTER_SCALE_MAX_PERCENT = 600;
|
|
5
|
+
export declare function normalizeDocumentCharacterScalePercent(value: unknown): number | null;
|
|
6
|
+
export declare function documentCharacterScaleDomAttributes(value: unknown): Record<string, string>;
|
|
7
|
+
export declare function documentCharacterScalePercentFromElement(element: HTMLElement): number | null;
|
|
8
|
+
export declare function documentCharacterScalePercentFromCss(value: unknown): number | null;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const DOCUMENT_CHARACTER_SPACING_ATTRIBUTE = "data-office-character-spacing-twips";
|
|
2
|
+
export declare const DOCUMENT_CHARACTER_SPACING_MAX_TWIPS = 31680;
|
|
3
|
+
export declare const DOCUMENT_CHARACTER_SPACING_MIN_TWIPS: number;
|
|
4
|
+
export declare function normalizeDocumentCharacterSpacingTwips(value: unknown): number | null;
|
|
5
|
+
export declare function documentCharacterSpacingDomAttributes(value: unknown): Record<string, string>;
|
|
6
|
+
export declare function documentCharacterSpacingTwipsFromElement(element: HTMLElement): number | null;
|
|
7
|
+
export declare function documentCharacterSpacingTwipsFromCss(value: unknown): number | null;
|
|
8
|
+
export declare function documentCharacterSpacingPoints(value: unknown): number | null;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const DOCUMENT_EMPHASIS_MARK_ATTRIBUTE = "data-office-emphasis-mark";
|
|
2
|
+
export declare const DOCUMENT_EMPHASIS_MARKS: readonly ["none", "dot", "comma", "circle", "underDot"];
|
|
3
|
+
export type WorkDocumentEmphasisMark = (typeof DOCUMENT_EMPHASIS_MARKS)[number];
|
|
4
|
+
export declare function normalizeDocumentEmphasisMark(value: unknown): WorkDocumentEmphasisMark | null;
|
|
5
|
+
export declare function documentEmphasisMarkCss(value: unknown): string;
|
|
6
|
+
export declare function documentEmphasisMarkDomAttributes(value: unknown): Record<string, string>;
|
|
7
|
+
export declare function documentEmphasisMarkFromElement(element: HTMLElement): WorkDocumentEmphasisMark | null;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Node } from '@tiptap/core';
|
|
2
|
+
import { type WorkDocumentEmphasisMark } from './work-document-emphasis';
|
|
2
3
|
export type WorkDocumentEquationDisplay = 'inline' | 'block';
|
|
3
4
|
export type WorkDocumentEquationJustification = 'left' | 'right' | 'center' | 'centerGroup';
|
|
4
5
|
export type WorkDocumentEquationBarPosition = 'top' | 'bottom';
|
|
@@ -203,7 +204,7 @@ export interface WorkDocumentEquationWordFitText {
|
|
|
203
204
|
id?: number;
|
|
204
205
|
}
|
|
205
206
|
export type WorkDocumentEquationWordVerticalAlignment = 'baseline' | 'superscript' | 'subscript';
|
|
206
|
-
export type WorkDocumentEquationWordEmphasisMark =
|
|
207
|
+
export type WorkDocumentEquationWordEmphasisMark = WorkDocumentEmphasisMark;
|
|
207
208
|
export interface WorkDocumentEquationWordLanguages {
|
|
208
209
|
latin?: string;
|
|
209
210
|
eastAsia?: string;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import type { Mark, Schema } from '@tiptap/pm/model';
|
|
2
2
|
import type { Transaction } from '@tiptap/pm/state';
|
|
3
|
+
import { type WorkDocumentEmphasisMark } from './work-document-emphasis';
|
|
4
|
+
import { type WorkDocumentTextCase } from './work-document-text-case';
|
|
5
|
+
import { type WorkDocumentUnderlineFormatting } from './work-document-underline';
|
|
6
|
+
import { type WorkDocumentStrikeFormatting } from './work-document-strike';
|
|
7
|
+
import { type WorkDocumentScriptFontSlot, type WorkDocumentScriptFonts } from './work-document-script-fonts';
|
|
3
8
|
export declare const DOCUMENT_CHARACTER_FORMAT_MARKS: readonly ["bold", "italic", "underline", "strike", "subscript", "superscript", "textStyle", "highlight"];
|
|
4
9
|
export type DocumentCharacterFormatMarkName = (typeof DOCUMENT_CHARACTER_FORMAT_MARKS)[number];
|
|
5
10
|
export interface DocumentCharacterFormatMark {
|
|
@@ -13,11 +18,19 @@ export declare function restoreDocumentCharacterFormatting(transaction: Transact
|
|
|
13
18
|
export declare function importedDocumentCharacterFormatting(formatting: {
|
|
14
19
|
bold?: boolean;
|
|
15
20
|
italic?: boolean;
|
|
16
|
-
underline?:
|
|
17
|
-
strike?:
|
|
21
|
+
underline?: WorkDocumentUnderlineFormatting;
|
|
22
|
+
strike?: WorkDocumentStrikeFormatting;
|
|
18
23
|
subscript?: boolean;
|
|
19
24
|
superscript?: boolean;
|
|
20
25
|
fontFamily?: string;
|
|
26
|
+
scriptFonts?: WorkDocumentScriptFonts;
|
|
27
|
+
scriptFontSlot?: WorkDocumentScriptFontSlot;
|
|
28
|
+
characterScalePercent?: number;
|
|
29
|
+
characterPositionHalfPoints?: number;
|
|
30
|
+
characterSpacingTwips?: number;
|
|
31
|
+
kerningThresholdHalfPoints?: number;
|
|
32
|
+
emphasisMark?: WorkDocumentEmphasisMark;
|
|
33
|
+
hiddenText?: boolean;
|
|
21
34
|
wordLineHeightFactor?: number;
|
|
22
35
|
wordSnapToGrid?: boolean;
|
|
23
36
|
fontSize?: number;
|
|
@@ -25,4 +38,5 @@ export declare function importedDocumentCharacterFormatting(formatting: {
|
|
|
25
38
|
backgroundColor?: string;
|
|
26
39
|
themeColor?: string;
|
|
27
40
|
themeFill?: string;
|
|
41
|
+
textCase?: WorkDocumentTextCase;
|
|
28
42
|
}): string;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const DOCUMENT_HIDDEN_TEXT_ATTRIBUTE = "data-office-hidden-text";
|
|
2
|
+
export declare const documentHiddenTextKeyboardShortcut = "Mod-Shift-h";
|
|
3
|
+
export declare function normalizeDocumentHiddenText(value: unknown): boolean | null;
|
|
4
|
+
export declare function documentHiddenTextFromElement(element: HTMLElement): boolean | null;
|
|
5
|
+
export declare function documentHiddenTextDomAttributes(value: unknown): Record<string, string>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const DOCUMENT_KERNING_THRESHOLD_ATTRIBUTE = "data-office-kerning-threshold-half-points";
|
|
2
|
+
export declare const DOCUMENT_KERNING_THRESHOLD_MIN_HALF_POINTS = 0;
|
|
3
|
+
export declare const DOCUMENT_KERNING_THRESHOLD_MAX_HALF_POINTS = 3277;
|
|
4
|
+
export declare const DOCUMENT_KERNING_DEFAULT_THRESHOLD_HALF_POINTS = 24;
|
|
5
|
+
export declare function normalizeDocumentKerningThresholdHalfPoints(value: unknown): number | null;
|
|
6
|
+
export declare function documentKerningThresholdPoints(value: unknown): number | null;
|
|
7
|
+
export declare function documentKerningIsEffective(thresholdValue: unknown, fontSizeValue: unknown): boolean;
|
|
8
|
+
export declare function documentKerningDomAttributes(thresholdValue: unknown, fontSizeValue?: unknown): Record<string, string>;
|
|
9
|
+
export declare function documentKerningThresholdHalfPointsFromElement(element: HTMLElement): number | null;
|
|
10
|
+
export declare function documentKerningFontSizePoints(value: unknown): number;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type DocxThemeColorReference } from './work-docx-theme-reference';
|
|
2
|
+
export { normalizeCssColor } from './work-css-color';
|
|
2
3
|
export type DocumentParagraphShadingPattern = 'nil' | 'clear' | 'solid' | 'horzStripe' | 'vertStripe' | 'reverseDiagStripe' | 'diagStripe' | 'horzCross' | 'diagCross' | 'thinHorzStripe' | 'thinVertStripe' | 'thinReverseDiagStripe' | 'thinDiagStripe' | 'thinHorzCross' | 'thinDiagCross' | 'pct5' | 'pct10' | 'pct12' | 'pct15' | 'pct20' | 'pct25' | 'pct30' | 'pct35' | 'pct37' | 'pct40' | 'pct45' | 'pct50' | 'pct55' | 'pct60' | 'pct62' | 'pct65' | 'pct70' | 'pct75' | 'pct80' | 'pct85' | 'pct87' | 'pct90' | 'pct95';
|
|
3
4
|
export interface DocumentParagraphShadingColor {
|
|
4
5
|
value: 'auto' | `#${string}`;
|
|
@@ -15,4 +16,3 @@ export declare function parseDocumentParagraphShading(source: unknown): Document
|
|
|
15
16
|
export declare function serializeDocumentParagraphShading(source: unknown): string | undefined;
|
|
16
17
|
export declare function parseDocumentParagraphShadingElement(element: HTMLElement): DocumentParagraphShading | null;
|
|
17
18
|
export declare function documentParagraphShadingDomAttributes(source: unknown): Record<string, string>;
|
|
18
|
-
export declare function normalizeCssColor(source: string | null | undefined): 'transparent' | `#${string}` | null;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export type WorkDocumentScriptFontSlot = 'ascii' | 'highAnsi' | 'eastAsia' | 'complexScript';
|
|
2
|
+
export type WorkDocumentScriptFontHint = 'default' | 'eastAsia' | 'cs';
|
|
3
|
+
export type WorkDocumentThemeFont = 'majorEastAsia' | 'majorBidi' | 'majorAscii' | 'majorHAnsi' | 'minorEastAsia' | 'minorBidi' | 'minorAscii' | 'minorHAnsi';
|
|
4
|
+
export interface WorkDocumentScriptFontFace {
|
|
5
|
+
/** Exact direct w:rFonts value, when present. */
|
|
6
|
+
name?: string;
|
|
7
|
+
/** Exact theme reference, when present. */
|
|
8
|
+
theme?: WorkDocumentThemeFont;
|
|
9
|
+
/** Browser-resolved family retained independently from source identity. */
|
|
10
|
+
resolved?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface WorkDocumentScriptFonts {
|
|
13
|
+
ascii?: WorkDocumentScriptFontFace;
|
|
14
|
+
highAnsi?: WorkDocumentScriptFontFace;
|
|
15
|
+
eastAsia?: WorkDocumentScriptFontFace;
|
|
16
|
+
complexScript?: WorkDocumentScriptFontFace;
|
|
17
|
+
hint?: WorkDocumentScriptFontHint;
|
|
18
|
+
}
|
|
19
|
+
export interface WorkDocumentScriptFontSegment {
|
|
20
|
+
from: number;
|
|
21
|
+
to: number;
|
|
22
|
+
slot: WorkDocumentScriptFontSlot;
|
|
23
|
+
}
|
|
24
|
+
export interface WorkDocumentScriptFontPatch {
|
|
25
|
+
latin?: string | null;
|
|
26
|
+
eastAsia?: string | null;
|
|
27
|
+
complexScript?: string | null;
|
|
28
|
+
}
|
|
29
|
+
export declare const DOCUMENT_SCRIPT_FONTS_ATTRIBUTE = "data-office-script-fonts";
|
|
30
|
+
export declare const DOCUMENT_SCRIPT_FONT_SLOT_ATTRIBUTE = "data-office-script-font-slot";
|
|
31
|
+
export declare function normalizeDocumentScriptFonts(source: unknown): WorkDocumentScriptFonts | null;
|
|
32
|
+
export declare function serializeDocumentScriptFonts(source: unknown): string | null;
|
|
33
|
+
export declare function parseDocumentScriptFonts(source: string | null | undefined): WorkDocumentScriptFonts | null;
|
|
34
|
+
export declare function documentScriptFontsFromElement(element: HTMLElement): WorkDocumentScriptFonts | null;
|
|
35
|
+
export declare function documentScriptFontSlotFromElement(element: HTMLElement): WorkDocumentScriptFontSlot | null;
|
|
36
|
+
export declare function documentScriptFontsDomAttributes(source: unknown, slot: unknown): Record<string, string>;
|
|
37
|
+
export declare function documentScriptFontFamily(source: unknown, slot: WorkDocumentScriptFontSlot): string | undefined;
|
|
38
|
+
export declare function documentScriptFontFallbackSlots(slot: WorkDocumentScriptFontSlot): readonly WorkDocumentScriptFontSlot[];
|
|
39
|
+
export declare function documentScriptFontFamilyForRendering(source: unknown, slot: WorkDocumentScriptFontSlot, currentFontFamily?: unknown): string | undefined;
|
|
40
|
+
export declare function documentScriptFontDirectFamily(source: unknown, slot: WorkDocumentScriptFontSlot): string | null;
|
|
41
|
+
export declare function documentScriptFontsForAllText(fontFamily: unknown): WorkDocumentScriptFonts | null;
|
|
42
|
+
export declare function patchDocumentScriptFonts(source: unknown, patch: WorkDocumentScriptFontPatch, fallbackFontFamily?: unknown): WorkDocumentScriptFonts | null;
|
|
43
|
+
export declare function documentScriptFontSegments(text: string, hint?: WorkDocumentScriptFontHint, forceComplexScript?: boolean): WorkDocumentScriptFontSegment[];
|
|
44
|
+
export declare function normalizeDocumentScriptFontSlot(value: unknown): WorkDocumentScriptFontSlot | null;
|
|
45
|
+
export declare function normalizeDocumentScriptFontHint(value: unknown): WorkDocumentScriptFontHint | null;
|
|
46
|
+
export declare function normalizeDocumentThemeFont(value: unknown): WorkDocumentThemeFont | null;
|
|
47
|
+
export declare function documentScriptFontSlotFromHint(hint: WorkDocumentScriptFontHint | undefined): WorkDocumentScriptFontSlot;
|
|
48
|
+
export declare function documentFontNameFromCssFamily(value: unknown): string | null;
|
|
49
|
+
export declare function cssDocumentFontFamily(value: unknown): string | null;
|
|
50
|
+
export declare function normalizeDocumentFontName(value: unknown): string | null;
|
|
51
|
+
export declare const scriptFontSlots: readonly ["ascii", "highAnsi", "eastAsia", "complexScript"];
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type Editor } from '@tiptap/core';
|
|
2
|
+
export declare const workDocumentStrikeStyles: readonly ["none", "single", "double"];
|
|
3
|
+
export type WorkDocumentStrikeStyle = (typeof workDocumentStrikeStyles)[number];
|
|
4
|
+
export interface WorkDocumentStrikeFormatting {
|
|
5
|
+
style: WorkDocumentStrikeStyle;
|
|
6
|
+
}
|
|
7
|
+
export declare const DOCUMENT_STRIKE_STYLE_ATTRIBUTE = "data-office-strike-style";
|
|
8
|
+
declare module '@tiptap/core' {
|
|
9
|
+
interface Commands<ReturnType> {
|
|
10
|
+
documentStrike: {
|
|
11
|
+
setDocumentStrike: (style: WorkDocumentStrikeStyle) => ReturnType;
|
|
12
|
+
toggleDocumentStrikeStyle: (style: Exclude<WorkDocumentStrikeStyle, 'none'>) => ReturnType;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
export declare const DocumentStrike: import("@tiptap/core").Mark<import("@tiptap/extension-strike").StrikeOptions, any>;
|
|
17
|
+
export declare function normalizeDocumentStrikeStyle(value: unknown): WorkDocumentStrikeStyle | null;
|
|
18
|
+
export declare function documentStrikeStyle(editor: Editor): WorkDocumentStrikeStyle;
|
|
19
|
+
export declare function documentStrikeFormatting(editor: Editor): WorkDocumentStrikeFormatting | null;
|
|
20
|
+
export declare function documentStrikeFormattingFromElement(element: HTMLElement): WorkDocumentStrikeFormatting | null;
|
|
21
|
+
export declare function documentStrikeDomAttributes(formatting: WorkDocumentStrikeFormatting): Record<string, string>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type WorkDocumentTextCase = 'none' | 'all-caps' | 'small-caps';
|
|
2
|
+
export declare const DOCUMENT_TEXT_CASE_ATTRIBUTE = "data-office-text-case";
|
|
3
|
+
export declare const documentTextCaseKeyboardShortcuts: {
|
|
4
|
+
readonly allCaps: "Mod-Shift-a";
|
|
5
|
+
readonly smallCaps: "Mod-Shift-k";
|
|
6
|
+
};
|
|
7
|
+
export declare function normalizeDocumentTextCase(value: unknown): WorkDocumentTextCase | null;
|
|
8
|
+
export declare function documentTextCaseFromWordFlags(allCaps: boolean | undefined, smallCaps: boolean | undefined): WorkDocumentTextCase | null;
|
|
9
|
+
export declare function applyDocumentTextCaseStyle(element: HTMLElement, textCase: WorkDocumentTextCase): void;
|
|
10
|
+
export declare function documentTextCaseCss(textCase: WorkDocumentTextCase): string;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type Editor } from '@tiptap/core';
|
|
2
|
+
import { type DocxThemeColorReference } from './work-docx-theme-reference';
|
|
3
|
+
export declare const workDocumentUnderlineStyles: readonly ["none", "single", "words", "double", "thick", "dotted", "dottedHeavy", "dash", "dashedHeavy", "dashLong", "dashLongHeavy", "dotDash", "dashDotHeavy", "dotDotDash", "dashDotDotHeavy", "wave", "wavyHeavy", "wavyDouble"];
|
|
4
|
+
export type WorkDocumentUnderlineStyle = (typeof workDocumentUnderlineStyles)[number];
|
|
5
|
+
export interface WorkDocumentUnderlineFormatting {
|
|
6
|
+
style: WorkDocumentUnderlineStyle;
|
|
7
|
+
color?: string;
|
|
8
|
+
themeColor?: DocxThemeColorReference;
|
|
9
|
+
}
|
|
10
|
+
export interface WorkDocumentUnderlineCommandOptions {
|
|
11
|
+
color?: string | null;
|
|
12
|
+
themeColor?: DocxThemeColorReference | string | null;
|
|
13
|
+
}
|
|
14
|
+
export declare const DOCUMENT_UNDERLINE_STYLE_ATTRIBUTE = "data-office-underline-style";
|
|
15
|
+
export declare const DOCUMENT_UNDERLINE_COLOR_ATTRIBUTE = "data-office-underline-color";
|
|
16
|
+
export declare const DOCUMENT_UNDERLINE_THEME_COLOR_ATTRIBUTE = "data-office-underline-theme-color";
|
|
17
|
+
export declare const documentUnderlineKeyboardShortcuts: {
|
|
18
|
+
readonly double: "Mod-Shift-d";
|
|
19
|
+
readonly words: "Mod-Shift-w";
|
|
20
|
+
};
|
|
21
|
+
declare module '@tiptap/core' {
|
|
22
|
+
interface Commands<ReturnType> {
|
|
23
|
+
documentUnderline: {
|
|
24
|
+
setDocumentUnderline: (style: WorkDocumentUnderlineStyle, options?: WorkDocumentUnderlineCommandOptions) => ReturnType;
|
|
25
|
+
setDocumentUnderlineColor: (color: string | null, themeColor?: DocxThemeColorReference | string | null) => ReturnType;
|
|
26
|
+
toggleDocumentUnderlineStyle: (style: Exclude<WorkDocumentUnderlineStyle, 'none'>) => ReturnType;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export declare const DocumentUnderline: import("@tiptap/core").Mark<import("@tiptap/extension-underline").UnderlineOptions, any>;
|
|
31
|
+
export declare function normalizeDocumentUnderlineStyle(value: unknown): WorkDocumentUnderlineStyle | null;
|
|
32
|
+
export declare function normalizeDocumentUnderlineColor(value: unknown): string | null;
|
|
33
|
+
export declare function documentUnderlineStyle(editor: Editor): WorkDocumentUnderlineStyle;
|
|
34
|
+
export declare function documentUnderlineColor(editor: Editor): string | null;
|
|
35
|
+
export declare function documentUnderlineFormatting(editor: Editor): WorkDocumentUnderlineFormatting | null;
|
|
36
|
+
export declare function documentUnderlineFormattingFromElement(element: HTMLElement): WorkDocumentUnderlineFormatting | null;
|
|
37
|
+
export declare function documentUnderlineDomAttributes(formatting: WorkDocumentUnderlineFormatting): Record<string, string>;
|
|
@@ -1,9 +1,21 @@
|
|
|
1
|
+
import { type WorkDocumentEmphasisMark } from './work-document-emphasis';
|
|
2
|
+
import { type WorkDocumentTextCase } from './work-document-text-case';
|
|
3
|
+
import { type WorkDocumentScriptFontSlot } from './work-document-script-fonts';
|
|
1
4
|
export declare const DOCUMENT_WORD_DEFAULT_SINGLE_LINE_HEIGHT = 1.15;
|
|
2
5
|
declare module '@tiptap/extension-text-style' {
|
|
3
6
|
interface TextStyleAttributes {
|
|
7
|
+
characterScalePercent?: number | null;
|
|
8
|
+
characterPositionHalfPoints?: number | null;
|
|
9
|
+
characterSpacingTwips?: number | null;
|
|
10
|
+
emphasisMark?: WorkDocumentEmphasisMark | null;
|
|
11
|
+
hiddenText?: boolean | null;
|
|
12
|
+
kerningThresholdHalfPoints?: number | null;
|
|
13
|
+
scriptFonts?: string | null;
|
|
14
|
+
scriptFontSlot?: WorkDocumentScriptFontSlot | null;
|
|
4
15
|
wordLineHeightFactor?: number | null;
|
|
5
16
|
wordSnapToGrid?: boolean | null;
|
|
6
17
|
themeColor?: string | null;
|
|
18
|
+
textCase?: WorkDocumentTextCase | null;
|
|
7
19
|
}
|
|
8
20
|
}
|
|
9
21
|
export declare function documentWordLineHeightFactor(fontFamily: unknown): number;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const DOCX_EXPLICIT_ZERO_CHARACTER_SPACING_SENTINEL: number;
|
|
2
|
+
export declare function docxCharacterSpacingValue(value: unknown): number | undefined;
|
|
3
|
+
export declare function docxCharacterSpacingTwipsFromProperties(properties: Element | null | undefined): number | undefined;
|
|
4
|
+
export declare function patchDocxExplicitZeroCharacterSpacing(buffer: ArrayBuffer): Promise<ArrayBuffer>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { IRunOptions } from 'docx';
|
|
2
|
+
import { type WorkDocumentEmphasisMark } from './work-document-emphasis';
|
|
3
|
+
export type DocxEmphasisMarkInspection = {
|
|
4
|
+
status: 'absent';
|
|
5
|
+
} | {
|
|
6
|
+
status: 'invalid';
|
|
7
|
+
} | {
|
|
8
|
+
status: 'valid';
|
|
9
|
+
value: WorkDocumentEmphasisMark;
|
|
10
|
+
};
|
|
11
|
+
export declare function docxEmphasisMarkFromProperties(properties: Element | null | undefined): WorkDocumentEmphasisMark | undefined;
|
|
12
|
+
export declare function resolveDocxEmphasisMark(propertySources: readonly Element[]): WorkDocumentEmphasisMark | undefined;
|
|
13
|
+
export declare function inspectDocxEmphasisMark(properties: Element | null | undefined): DocxEmphasisMarkInspection;
|
|
14
|
+
export declare function docxEmphasisMarkRunOptions(value: unknown): IRunOptions['emphasisMark'] | undefined;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface DocxHiddenTextPatch {
|
|
2
|
+
marker: string;
|
|
3
|
+
style?: string;
|
|
4
|
+
value: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare class DocxHiddenTextPatchCollector {
|
|
7
|
+
readonly patches: DocxHiddenTextPatch[];
|
|
8
|
+
private nextMarker;
|
|
9
|
+
private readonly occupied;
|
|
10
|
+
private readonly patchesByMarker;
|
|
11
|
+
private readonly markersByValueAndStyle;
|
|
12
|
+
constructor(source: string);
|
|
13
|
+
marker(value: boolean, inheritedStyle?: string): string;
|
|
14
|
+
private originalStyle;
|
|
15
|
+
}
|
|
16
|
+
export declare function patchDocxHiddenText(buffer: ArrayBuffer, patches: readonly DocxHiddenTextPatch[]): Promise<ArrayBuffer>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type DocxHiddenTextInspection = {
|
|
2
|
+
status: 'absent';
|
|
3
|
+
} | {
|
|
4
|
+
status: 'invalid';
|
|
5
|
+
} | {
|
|
6
|
+
status: 'valid';
|
|
7
|
+
value: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare function inspectDocxHiddenText(properties: Element | null | undefined): DocxHiddenTextInspection;
|
|
10
|
+
export declare function docxHiddenTextFromProperties(properties: Element | null | undefined): boolean | undefined;
|
|
11
|
+
export declare function resolveDocxHiddenText(propertySources: readonly Element[]): boolean | undefined;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const DOCX_EXPLICIT_ZERO_KERNING_THRESHOLD_SENTINEL: number;
|
|
2
|
+
export type DocxKerningThresholdInspection = {
|
|
3
|
+
status: 'absent';
|
|
4
|
+
} | {
|
|
5
|
+
status: 'invalid';
|
|
6
|
+
} | {
|
|
7
|
+
status: 'valid';
|
|
8
|
+
value: number;
|
|
9
|
+
};
|
|
10
|
+
export declare function docxKerningThresholdValue(value: unknown): number | undefined;
|
|
11
|
+
export declare function docxKerningThresholdHalfPointsFromProperties(properties: Element | null | undefined): number | undefined;
|
|
12
|
+
export declare function resolveDocxKerningThresholdHalfPoints(propertySources: readonly Element[]): number | undefined;
|
|
13
|
+
export declare function inspectDocxKerningThresholdHalfPoints(properties: Element | null | undefined): DocxKerningThresholdInspection;
|
|
14
|
+
export declare function patchDocxExplicitZeroKerningThresholds(buffer: ArrayBuffer): Promise<ArrayBuffer>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type WorkDocumentScriptFonts } from './work-document-script-fonts';
|
|
2
|
+
export interface DocxRunFontsPatch {
|
|
3
|
+
marker: string;
|
|
4
|
+
fonts: WorkDocumentScriptFonts;
|
|
5
|
+
}
|
|
6
|
+
export declare class DocxRunFontsPatchCollector {
|
|
7
|
+
readonly patches: DocxRunFontsPatch[];
|
|
8
|
+
private nextMarker;
|
|
9
|
+
private readonly occupied;
|
|
10
|
+
private readonly markersByFonts;
|
|
11
|
+
constructor(source: string);
|
|
12
|
+
marker(source: unknown, slot: unknown, currentFontFamily: string): string | null;
|
|
13
|
+
}
|
|
14
|
+
export declare function patchDocxRunFonts(buffer: ArrayBuffer, patches: readonly DocxRunFontsPatch[]): Promise<ArrayBuffer>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type WorkDocumentScriptFonts } from './work-document-script-fonts';
|
|
2
|
+
import { type DocxThemeResolver } from './work-docx-theme';
|
|
3
|
+
export type InspectedDocxRunFonts = {
|
|
4
|
+
status: 'absent';
|
|
5
|
+
} | {
|
|
6
|
+
status: 'invalid';
|
|
7
|
+
} | {
|
|
8
|
+
status: 'valid';
|
|
9
|
+
value: WorkDocumentScriptFonts | null;
|
|
10
|
+
};
|
|
11
|
+
export declare function inspectDocxRunFonts(properties: Element | null | undefined, theme?: DocxThemeResolver): InspectedDocxRunFonts;
|
|
12
|
+
export declare function resolveDocxRunFonts(propertySources: readonly Element[], theme: DocxThemeResolver): WorkDocumentScriptFonts | null;
|
|
13
|
+
export declare function parseDocxRunFontsElement(element: Element | undefined, theme?: DocxThemeResolver): WorkDocumentScriptFonts | null | undefined;
|
|
@@ -1,15 +1,28 @@
|
|
|
1
1
|
import { type DocxParagraphStyleSource } from './work-docx-paragraph-styles';
|
|
2
2
|
import { type DocxThemeSource } from './work-docx-theme';
|
|
3
3
|
import { type DocxTableStyleSource } from './work-docx-table-styles';
|
|
4
|
+
import { type WorkDocumentEmphasisMark } from './work-document-emphasis';
|
|
4
5
|
import { type DocxThemeColorReference } from './work-docx-theme-reference';
|
|
6
|
+
import { type WorkDocumentTextCase } from './work-document-text-case';
|
|
7
|
+
import { type WorkDocumentUnderlineFormatting } from './work-document-underline';
|
|
8
|
+
import { type WorkDocumentStrikeFormatting } from './work-document-strike';
|
|
9
|
+
import { type WorkDocumentScriptFontSlot, type WorkDocumentScriptFonts } from './work-document-script-fonts';
|
|
5
10
|
export interface ImportedDocxRunFormatting {
|
|
6
11
|
bold?: boolean;
|
|
7
12
|
italic?: boolean;
|
|
8
|
-
underline?:
|
|
9
|
-
strike?:
|
|
13
|
+
underline?: WorkDocumentUnderlineFormatting;
|
|
14
|
+
strike?: WorkDocumentStrikeFormatting;
|
|
10
15
|
subscript?: boolean;
|
|
11
16
|
superscript?: boolean;
|
|
17
|
+
characterScalePercent?: number;
|
|
18
|
+
characterPositionHalfPoints?: number;
|
|
19
|
+
characterSpacingTwips?: number;
|
|
20
|
+
kerningThresholdHalfPoints?: number;
|
|
21
|
+
emphasisMark?: WorkDocumentEmphasisMark;
|
|
22
|
+
hiddenText?: boolean;
|
|
12
23
|
fontFamily?: string;
|
|
24
|
+
scriptFonts?: WorkDocumentScriptFonts;
|
|
25
|
+
scriptFontSlot?: WorkDocumentScriptFontSlot;
|
|
13
26
|
wordLineHeightFactor?: number;
|
|
14
27
|
wordSnapToGrid?: boolean;
|
|
15
28
|
fontSize?: number;
|
|
@@ -17,6 +30,7 @@ export interface ImportedDocxRunFormatting {
|
|
|
17
30
|
backgroundColor?: string;
|
|
18
31
|
themeColor?: DocxThemeColorReference;
|
|
19
32
|
themeFill?: DocxThemeColorReference;
|
|
33
|
+
textCase?: WorkDocumentTextCase;
|
|
20
34
|
}
|
|
21
35
|
export interface ImportedDocxRunFormattingMarker {
|
|
22
36
|
startMarker: string;
|
|
@@ -33,7 +47,14 @@ export interface ImportedDocxRunFormattingChange {
|
|
|
33
47
|
export interface ImportedDocxRunFormattingMarkers {
|
|
34
48
|
runs: ImportedDocxRunFormattingMarker[];
|
|
35
49
|
}
|
|
50
|
+
export interface ImportedDocxRunFormattingMarkerState {
|
|
51
|
+
markers: ImportedDocxRunFormattingMarkers;
|
|
52
|
+
nextMarker: number;
|
|
53
|
+
occupiedText: string;
|
|
54
|
+
}
|
|
36
55
|
export declare function markDocxRunFormatting(document: Document, styleSource?: DocxParagraphStyleSource, themeSource?: DocxThemeSource, tableStyleSource?: DocxTableStyleSource): ImportedDocxRunFormattingMarkers;
|
|
56
|
+
export declare function createImportedDocxRunFormattingMarkerState(documents: readonly Document[]): ImportedDocxRunFormattingMarkerState;
|
|
57
|
+
export declare function markDocxRunFormattingIntoState(document: Document, state: ImportedDocxRunFormattingMarkerState, styleSource?: DocxParagraphStyleSource, themeSource?: DocxThemeSource, tableStyleSource?: DocxTableStyleSource): void;
|
|
37
58
|
export declare function applyImportedDocxRunFormattingMarkers(document: Document, markers: ImportedDocxRunFormattingMarkers): void;
|
|
38
59
|
export declare function hasImportedDocxRunFormattingMarkers(markers: ImportedDocxRunFormattingMarkers): boolean;
|
|
39
60
|
export declare function isSupportedDocxRunFormattingChange(change: Element): boolean;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ImportedDocxRunFormatting, ImportedDocxRunFormattingChange, ImportedDocxRunFormattingMarkerState } from './work-docx-run-formatting-import';
|
|
2
|
+
import type { WorkDocumentScriptFontSegment, WorkDocumentScriptFontSlot } from './work-document-script-fonts';
|
|
3
|
+
interface DocxRunFormattingMarkers {
|
|
4
|
+
endMarker: string;
|
|
5
|
+
startMarker: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function directDocxRunText(run: Element): string;
|
|
8
|
+
export declare function markSegmentedDocxRunFormatting(run: Element, state: ImportedDocxRunFormattingMarkerState, segments: readonly WorkDocumentScriptFontSegment[], formattingFor: (text: string, slot: WorkDocumentScriptFontSlot) => ImportedDocxRunFormatting, changeFor: (text: string, slot: WorkDocumentScriptFontSlot) => ImportedDocxRunFormattingChange | undefined, createMarkers: () => DocxRunFormattingMarkers): void;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { WorkDocumentStrikeFormatting } from './work-document-strike';
|
|
2
|
+
export interface ImportedDocxStrikeFlags {
|
|
3
|
+
double?: boolean;
|
|
4
|
+
single?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare function importedDocxStrikeFlags(properties: Element): ImportedDocxStrikeFlags;
|
|
7
|
+
export declare function importedDocxStrike(properties: Element): WorkDocumentStrikeFormatting | undefined;
|
|
8
|
+
export declare function resolvedDocxStrikeFormatting(single: boolean | undefined, double: boolean | undefined, materializeNone?: boolean): WorkDocumentStrikeFormatting | undefined;
|
|
@@ -4,7 +4,7 @@ export interface DocxThemeColorReference {
|
|
|
4
4
|
tint?: string;
|
|
5
5
|
shade?: string;
|
|
6
6
|
}
|
|
7
|
-
type DocxThemePatchKind = 'color' | 'fill' | 'border' | 'shadingColor';
|
|
7
|
+
type DocxThemePatchKind = 'color' | 'fill' | 'border' | 'shadingColor' | 'underline';
|
|
8
8
|
interface DocxThemePatch {
|
|
9
9
|
kind: DocxThemePatchKind;
|
|
10
10
|
marker: string;
|