@a3s-lab/office 0.26.0 → 0.28.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.
Files changed (87) hide show
  1. package/README.md +89 -2
  2. package/dist/0~4595.js +16 -2
  3. package/dist/0~5093.js +563 -201
  4. package/dist/0~6090.js +77 -77
  5. package/dist/{0~2805.js → 0~7043.js} +305 -2
  6. package/dist/0~document-editor.js +2633 -976
  7. package/dist/0~spreadsheet-editor.js +1324 -378
  8. package/dist/0~work-docx-export.js +737 -17
  9. package/dist/0~work-docx-import.js +173 -98
  10. package/dist/0~work-office-diagnostics.js +250 -5
  11. package/dist/{164.js → 1544.js} +1083 -785
  12. package/dist/4104.js +145 -29
  13. package/dist/5184.js +13 -0
  14. package/dist/6282.js +1898 -345
  15. package/dist/core.js +1 -1
  16. package/dist/index.js +1 -1
  17. package/dist/internal/features/work/editors/document-command-catalog.d.ts +102 -0
  18. package/dist/internal/features/work/editors/document-font-dialog-model.d.ts +111 -0
  19. package/dist/internal/features/work/editors/document-font-dialog-script-font-model.d.ts +18 -0
  20. package/dist/internal/features/work/editors/document-font-dialog.d.ts +9 -0
  21. package/dist/internal/features/work/editors/document-home-ribbon.d.ts +2 -1
  22. package/dist/internal/features/work/editors/document-page-chrome-editor.d.ts +6 -0
  23. package/dist/internal/features/work/editors/document-page-chrome-ribbon.d.ts +2 -1
  24. package/dist/internal/features/work/editors/document-strike-ribbon.d.ts +7 -0
  25. package/dist/internal/features/work/editors/document-text-case-ribbon.d.ts +4 -0
  26. package/dist/internal/features/work/editors/document-toolbar.d.ts +3 -1
  27. package/dist/internal/features/work/editors/document-underline-ribbon.d.ts +9 -0
  28. package/dist/internal/features/work/editors/document-wps-shortcuts.d.ts +1 -0
  29. package/dist/internal/features/work/editors/spreadsheet-cell-fill-format.d.ts +11 -0
  30. package/dist/internal/features/work/editors/spreadsheet-cell-format.d.ts +2 -1
  31. package/dist/internal/features/work/editors/spreadsheet-format-cells-dialog-model.d.ts +13 -2
  32. package/dist/internal/features/work/editors/spreadsheet-format-cells-fill-panel.d.ts +13 -0
  33. package/dist/internal/features/work/editors/spreadsheet-format-cells-fill-preview.d.ts +6 -0
  34. package/dist/internal/features/work/editors/spreadsheet-format-painter.d.ts +1 -1
  35. package/dist/internal/features/work/editors/work-office-chrome.d.ts +9 -1
  36. package/dist/internal/features/work/work-document-character-formatting.d.ts +16 -1
  37. package/dist/internal/features/work/work-document-character-position.d.ts +9 -0
  38. package/dist/internal/features/work/work-document-character-scale.d.ts +8 -0
  39. package/dist/internal/features/work/work-document-character-spacing.d.ts +8 -0
  40. package/dist/internal/features/work/work-document-emphasis.d.ts +7 -0
  41. package/dist/internal/features/work/work-document-equations.d.ts +2 -1
  42. package/dist/internal/features/work/work-document-format-changes.d.ts +20 -2
  43. package/dist/internal/features/work/work-document-hidden-text.d.ts +5 -0
  44. package/dist/internal/features/work/work-document-kerning.d.ts +10 -0
  45. package/dist/internal/features/work/work-document-legacy-text-effects.d.ts +27 -0
  46. package/dist/internal/features/work/work-document-script-font-extension.d.ts +2 -0
  47. package/dist/internal/features/work/work-document-script-fonts.d.ts +51 -0
  48. package/dist/internal/features/work/work-document-strike.d.ts +21 -0
  49. package/dist/internal/features/work/work-document-text-case.d.ts +10 -0
  50. package/dist/internal/features/work/work-document-underline.d.ts +37 -0
  51. package/dist/internal/features/work/work-document-word-line-metrics.d.ts +16 -0
  52. package/dist/internal/features/work/work-docx-character-position.d.ts +2 -0
  53. package/dist/internal/features/work/work-docx-character-scale.d.ts +2 -0
  54. package/dist/internal/features/work/work-docx-character-spacing.d.ts +4 -0
  55. package/dist/internal/features/work/work-docx-emphasis-diagnostics.d.ts +3 -0
  56. package/dist/internal/features/work/work-docx-emphasis.d.ts +14 -0
  57. package/dist/internal/features/work/work-docx-hidden-text-diagnostics.d.ts +3 -0
  58. package/dist/internal/features/work/work-docx-hidden-text-export.d.ts +17 -0
  59. package/dist/internal/features/work/work-docx-hidden-text.d.ts +11 -0
  60. package/dist/internal/features/work/work-docx-kerning-diagnostics.d.ts +3 -0
  61. package/dist/internal/features/work/work-docx-kerning.d.ts +14 -0
  62. package/dist/internal/features/work/work-docx-legacy-text-effects-diagnostics.d.ts +3 -0
  63. package/dist/internal/features/work/work-docx-legacy-text-effects-export.d.ts +18 -0
  64. package/dist/internal/features/work/work-docx-legacy-text-effects.d.ts +12 -0
  65. package/dist/internal/features/work/work-docx-run-fonts-diagnostics.d.ts +3 -0
  66. package/dist/internal/features/work/work-docx-run-fonts-export.d.ts +14 -0
  67. package/dist/internal/features/work/work-docx-run-fonts.d.ts +13 -0
  68. package/dist/internal/features/work/work-docx-run-formatting-import.d.ts +27 -2
  69. package/dist/internal/features/work/work-docx-run-property-order.d.ts +2 -0
  70. package/dist/internal/features/work/work-docx-run-script-font-import.d.ts +9 -0
  71. package/dist/internal/features/work/work-docx-strike.d.ts +8 -0
  72. package/dist/internal/features/work/work-docx-theme-reference.d.ts +1 -1
  73. package/dist/internal/features/work/work-docx-twips.d.ts +6 -0
  74. package/dist/internal/features/work/work-docx-underline.d.ts +3 -0
  75. package/dist/internal/features/work/work-spreadsheet-gradient-fill-canvas.d.ts +10 -0
  76. package/dist/internal/features/work/work-spreadsheet-native-fill-canvas.d.ts +8 -0
  77. package/dist/internal/features/work/work-spreadsheet-pattern-fill-canvas.d.ts +8 -0
  78. package/dist/internal/features/work/work-xlsx-cell-style-origin.d.ts +2 -1
  79. package/dist/internal/features/work/work-xlsx-cell-style-writer.d.ts +3 -0
  80. package/dist/internal/features/work/work-xlsx-cell-styles.d.ts +4 -0
  81. package/dist/internal/features/work/work-xlsx-gradient-fill.d.ts +31 -0
  82. package/dist/internal/features/work/work-xlsx-native-fill.d.ts +17 -0
  83. package/dist/internal/features/work/work-xlsx-pattern-fill.d.ts +21 -0
  84. package/dist/office-kernel.wasm +0 -0
  85. package/dist/styles.css +809 -78
  86. package/docs/latest/en/browser-editor-architecture.md +24 -0
  87. package/package.json +35 -1
@@ -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,23 @@ export declare function restoreDocumentCharacterFormatting(transaction: Transact
13
18
  export declare function importedDocumentCharacterFormatting(formatting: {
14
19
  bold?: boolean;
15
20
  italic?: boolean;
16
- underline?: boolean;
17
- strike?: boolean;
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;
34
+ legacyTextOutline?: boolean;
35
+ legacyTextShadow?: boolean;
36
+ legacyTextEmboss?: boolean;
37
+ legacyTextImprint?: boolean;
21
38
  wordLineHeightFactor?: number;
22
39
  wordSnapToGrid?: boolean;
23
40
  fontSize?: number;
@@ -25,4 +42,5 @@ export declare function importedDocumentCharacterFormatting(formatting: {
25
42
  backgroundColor?: string;
26
43
  themeColor?: string;
27
44
  themeFill?: string;
45
+ textCase?: WorkDocumentTextCase;
28
46
  }): 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;
@@ -0,0 +1,27 @@
1
+ export declare const DOCUMENT_LEGACY_TEXT_OUTLINE_ATTRIBUTE = "data-office-legacy-text-outline";
2
+ export declare const DOCUMENT_LEGACY_TEXT_SHADOW_ATTRIBUTE = "data-office-legacy-text-shadow";
3
+ export declare const DOCUMENT_LEGACY_TEXT_EMBOSS_ATTRIBUTE = "data-office-legacy-text-emboss";
4
+ export declare const DOCUMENT_LEGACY_TEXT_IMPRINT_ATTRIBUTE = "data-office-legacy-text-imprint";
5
+ export declare const DOCUMENT_LEGACY_TEXT_EFFECT_NAMES: readonly ["outline", "shadow", "emboss", "imprint"];
6
+ export type WorkDocumentLegacyTextEffectName = (typeof DOCUMENT_LEGACY_TEXT_EFFECT_NAMES)[number];
7
+ export interface WorkDocumentLegacyTextEffects {
8
+ outline?: boolean;
9
+ shadow?: boolean;
10
+ emboss?: boolean;
11
+ imprint?: boolean;
12
+ }
13
+ export interface WorkDocumentLegacyTextEffectCss {
14
+ WebkitTextFillColor?: string;
15
+ WebkitTextStroke?: string;
16
+ paintOrder?: string;
17
+ textShadow?: string;
18
+ }
19
+ export declare function normalizeDocumentLegacyTextEffect(value: unknown): boolean | null;
20
+ export declare function normalizeDocumentLegacyTextEffects(value: unknown): WorkDocumentLegacyTextEffects | null;
21
+ export declare function documentLegacyTextEffectsConflict(effects: WorkDocumentLegacyTextEffects): boolean;
22
+ export declare function documentLegacyTextEffectFromElement(element: HTMLElement, effect: WorkDocumentLegacyTextEffectName): boolean | null;
23
+ export declare function documentLegacyTextEffectsFromElement(element: HTMLElement): WorkDocumentLegacyTextEffects | null;
24
+ export declare function documentLegacyTextEffectsFromTextStyleAttributes(attributes: Record<string, unknown>): WorkDocumentLegacyTextEffects | null;
25
+ export declare function documentLegacyTextEffectsDomAttributes(value: WorkDocumentLegacyTextEffects): Record<string, string>;
26
+ export declare function documentLegacyTextEffectsCss(value: WorkDocumentLegacyTextEffects): WorkDocumentLegacyTextEffectCss;
27
+ export declare function documentLegacyTextStyleAttributeName(effect: WorkDocumentLegacyTextEffectName): string;
@@ -0,0 +1,2 @@
1
+ import { Extension } from '@tiptap/core';
2
+ export declare const DocumentScriptFontFormatting: Extension<any, any>;
@@ -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,25 @@
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
+ legacyTextOutline?: boolean | null;
13
+ legacyTextShadow?: boolean | null;
14
+ legacyTextEmboss?: boolean | null;
15
+ legacyTextImprint?: boolean | null;
16
+ kerningThresholdHalfPoints?: number | null;
17
+ scriptFonts?: string | null;
18
+ scriptFontSlot?: WorkDocumentScriptFontSlot | null;
4
19
  wordLineHeightFactor?: number | null;
5
20
  wordSnapToGrid?: boolean | null;
6
21
  themeColor?: string | null;
22
+ textCase?: WorkDocumentTextCase | null;
7
23
  }
8
24
  }
9
25
  export declare function documentWordLineHeightFactor(fontFamily: unknown): number;
@@ -0,0 +1,2 @@
1
+ export declare function docxCharacterPositionValue(value: unknown): string | undefined;
2
+ export declare function docxCharacterPositionHalfPointsFromProperties(properties: Element | null | undefined): number | undefined;
@@ -0,0 +1,2 @@
1
+ export declare function docxCharacterScaleValue(value: unknown): number | undefined;
2
+ export declare function docxCharacterScalePercentFromProperties(properties: Element | null | undefined): number | undefined;
@@ -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,3 @@
1
+ import { type OoxmlPackage } from './work-ooxml-package';
2
+ import type { WorkCompatibilityIssue } from './work-types';
3
+ export declare function diagnoseDocxEmphasisMarks(archive: OoxmlPackage, document: Document): Promise<WorkCompatibilityIssue[]>;
@@ -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,3 @@
1
+ import { type OoxmlPackage } from './work-ooxml-package';
2
+ import type { WorkCompatibilityIssue } from './work-types';
3
+ export declare function diagnoseDocxHiddenText(archive: OoxmlPackage, document: Document): Promise<WorkCompatibilityIssue[]>;
@@ -0,0 +1,17 @@
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
+ lookup(marker: string | undefined): DocxHiddenTextPatch | undefined;
15
+ private originalStyle;
16
+ }
17
+ 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,3 @@
1
+ import { type OoxmlPackage } from './work-ooxml-package';
2
+ import type { WorkCompatibilityIssue } from './work-types';
3
+ export declare function diagnoseDocxKerning(archive: OoxmlPackage, document: Document): Promise<WorkCompatibilityIssue[]>;
@@ -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,3 @@
1
+ import { type OoxmlPackage } from './work-ooxml-package';
2
+ import type { WorkCompatibilityIssue } from './work-types';
3
+ export declare function diagnoseDocxLegacyTextEffects(archive: OoxmlPackage, document: Document): Promise<WorkCompatibilityIssue[]>;
@@ -0,0 +1,18 @@
1
+ import { type WorkDocumentLegacyTextEffects } from './work-document-legacy-text-effects';
2
+ export interface DocxLegacyTextEffectsPatch {
3
+ marker: string;
4
+ style?: string;
5
+ effects: WorkDocumentLegacyTextEffects;
6
+ }
7
+ export declare class DocxLegacyTextEffectsPatchCollector {
8
+ readonly patches: DocxLegacyTextEffectsPatch[];
9
+ private nextMarker;
10
+ private readonly occupied;
11
+ private readonly patchesByMarker;
12
+ private readonly markersByEffectsAndStyle;
13
+ constructor(source: string);
14
+ marker(value: WorkDocumentLegacyTextEffects, inheritedStyle?: string): string;
15
+ lookup(marker: string | undefined): DocxLegacyTextEffectsPatch | undefined;
16
+ private originalStyle;
17
+ }
18
+ export declare function patchDocxLegacyTextEffects(buffer: ArrayBuffer, patches: readonly DocxLegacyTextEffectsPatch[]): Promise<ArrayBuffer>;
@@ -0,0 +1,12 @@
1
+ import { type WorkDocumentLegacyTextEffects } from './work-document-legacy-text-effects';
2
+ export type DocxLegacyTextEffectsInspection = {
3
+ status: 'absent';
4
+ } | {
5
+ status: 'invalid';
6
+ } | {
7
+ status: 'valid';
8
+ value: WorkDocumentLegacyTextEffects;
9
+ };
10
+ export declare function inspectDocxLegacyTextEffects(properties: Element | null | undefined): DocxLegacyTextEffectsInspection;
11
+ export declare function docxLegacyTextEffectsFromProperties(properties: Element | null | undefined): WorkDocumentLegacyTextEffects | undefined;
12
+ export declare function resolveDocxLegacyTextEffects(propertySources: readonly Element[]): WorkDocumentLegacyTextEffects | undefined;
@@ -0,0 +1,3 @@
1
+ import { type OoxmlPackage } from './work-ooxml-package';
2
+ import type { WorkCompatibilityIssue } from './work-types';
3
+ export declare function diagnoseDocxRunFonts(archive: OoxmlPackage, document: Document): Promise<WorkCompatibilityIssue[]>;
@@ -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,32 @@
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?: boolean;
9
- strike?: boolean;
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;
23
+ legacyTextOutline?: boolean;
24
+ legacyTextShadow?: boolean;
25
+ legacyTextEmboss?: boolean;
26
+ legacyTextImprint?: boolean;
12
27
  fontFamily?: string;
28
+ scriptFonts?: WorkDocumentScriptFonts;
29
+ scriptFontSlot?: WorkDocumentScriptFontSlot;
13
30
  wordLineHeightFactor?: number;
14
31
  wordSnapToGrid?: boolean;
15
32
  fontSize?: number;
@@ -17,6 +34,7 @@ export interface ImportedDocxRunFormatting {
17
34
  backgroundColor?: string;
18
35
  themeColor?: DocxThemeColorReference;
19
36
  themeFill?: DocxThemeColorReference;
37
+ textCase?: WorkDocumentTextCase;
20
38
  }
21
39
  export interface ImportedDocxRunFormattingMarker {
22
40
  startMarker: string;
@@ -33,7 +51,14 @@ export interface ImportedDocxRunFormattingChange {
33
51
  export interface ImportedDocxRunFormattingMarkers {
34
52
  runs: ImportedDocxRunFormattingMarker[];
35
53
  }
54
+ export interface ImportedDocxRunFormattingMarkerState {
55
+ markers: ImportedDocxRunFormattingMarkers;
56
+ nextMarker: number;
57
+ occupiedText: string;
58
+ }
36
59
  export declare function markDocxRunFormatting(document: Document, styleSource?: DocxParagraphStyleSource, themeSource?: DocxThemeSource, tableStyleSource?: DocxTableStyleSource): ImportedDocxRunFormattingMarkers;
60
+ export declare function createImportedDocxRunFormattingMarkerState(documents: readonly Document[]): ImportedDocxRunFormattingMarkerState;
61
+ export declare function markDocxRunFormattingIntoState(document: Document, state: ImportedDocxRunFormattingMarkerState, styleSource?: DocxParagraphStyleSource, themeSource?: DocxThemeSource, tableStyleSource?: DocxTableStyleSource): void;
37
62
  export declare function applyImportedDocxRunFormattingMarkers(document: Document, markers: ImportedDocxRunFormattingMarkers): void;
38
63
  export declare function hasImportedDocxRunFormattingMarkers(markers: ImportedDocxRunFormattingMarkers): boolean;
39
64
  export declare function isSupportedDocxRunFormattingChange(change: Element): boolean;
@@ -0,0 +1,2 @@
1
+ export declare const DOCX_RUN_PROPERTY_ORDER: readonly ["rStyle", "rFonts", "b", "bCs", "i", "iCs", "caps", "smallCaps", "strike", "dstrike", "outline", "shadow", "emboss", "imprint", "noProof", "snapToGrid", "vanish", "webHidden", "color", "spacing", "w", "kern", "position", "sz", "szCs", "highlight", "u", "effect", "bdr", "shd", "fitText", "vertAlign", "rtl", "cs", "em", "lang", "eastAsianLayout", "specVanish", "rPrChange"];
2
+ export declare const DOCX_RUN_PROPERTY_RANK: Map<string, number>;
@@ -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;
@@ -5,6 +5,12 @@ export declare function parseDocxTwipsMeasure(source: string, options: {
5
5
  signed: boolean;
6
6
  strict: boolean;
7
7
  }): number | null;
8
+ export declare function parseDocxHalfPointsMeasure(source: string, options: {
9
+ minimum: number;
10
+ maximum: number;
11
+ signed: boolean;
12
+ strict: boolean;
13
+ }): number | null;
8
14
  export declare function parseBoundedDocxInteger(source: string, options: {
9
15
  minimum: number;
10
16
  maximum: number;
@@ -0,0 +1,3 @@
1
+ import { type WorkDocumentUnderlineFormatting } from './work-document-underline';
2
+ import { type DocxThemeResolver } from './work-docx-theme';
3
+ export declare function importedDocxUnderline(element: Element, theme?: DocxThemeResolver): WorkDocumentUnderlineFormatting;
@@ -0,0 +1,10 @@
1
+ import type { XlsxGradientFill } from './work-xlsx-gradient-fill';
2
+ export interface SpreadsheetGradientFillBounds {
3
+ endX: number;
4
+ endY: number;
5
+ startX: number;
6
+ startY: number;
7
+ }
8
+ type SpreadsheetGradientFillRect = CanvasRenderingContext2D['fillRect'];
9
+ export declare function drawSpreadsheetGradientFill(context: CanvasRenderingContext2D, bounds: SpreadsheetGradientFillBounds, fill: XlsxGradientFill, fillRect?: SpreadsheetGradientFillRect): void;
10
+ export {};
@@ -0,0 +1,8 @@
1
+ import type { XlsxNativeFill } from './work-xlsx-native-fill';
2
+ /**
3
+ * Fortune Sheet paints a cell background immediately after beforeRenderCell.
4
+ * Intercepting only that first viewport paint keeps native fills behind text
5
+ * and avoids any fill work for cells outside the visible Canvas.
6
+ */
7
+ export declare function beginSpreadsheetNativeFillRender(fill: XlsxNativeFill | undefined, context: CanvasRenderingContext2D): void;
8
+ export declare function finishSpreadsheetNativeFillRender(context: CanvasRenderingContext2D): void;
@@ -0,0 +1,8 @@
1
+ import type { XlsxPatternFill } from './work-xlsx-pattern-fill';
2
+ export interface SpreadsheetPatternFillBounds {
3
+ endX: number;
4
+ endY: number;
5
+ startX: number;
6
+ startY: number;
7
+ }
8
+ export declare function drawSpreadsheetPatternFillOverlay(context: CanvasRenderingContext2D, bounds: SpreadsheetPatternFillBounds, fill: XlsxPatternFill): void;
@@ -41,5 +41,6 @@ export declare function xlsxColorElementMatchesOrigin(element: Element | undefin
41
41
  export declare function applyXlsxSemanticColorOrigin(element: Element, origin: XlsxSemanticColorOrigin): void;
42
42
  export declare function xlsxSemanticColorOriginKey(origin: XlsxSemanticColorOrigin | undefined): string;
43
43
  export declare function xlsxSemanticColorOriginSupported(origin: XlsxSemanticColorOrigin, palette: XlsxSemanticPalette | undefined): boolean;
44
- export declare function prepareXlsxSemanticPalette(styles: Document, theme: Document | null, origins: Iterable<XlsxCellStyleOrigin>): PreparedXlsxSemanticPalette;
44
+ export declare function prepareXlsxSemanticPalette(styles: Document, theme: Document | null, colors: Iterable<XlsxSemanticColorOrigin>): PreparedXlsxSemanticPalette;
45
+ export declare function xlsxCellStyleOriginSemanticColors(origin: XlsxCellStyleOrigin): XlsxSemanticColorOrigin[];
45
46
  export declare function normalizeXlsxSemanticColorOrigin(value: unknown): XlsxSemanticColorOrigin | undefined;
@@ -18,6 +18,9 @@ export declare class XlsxDirectCellStyleWriter {
18
18
  styleId(baseStyleId: number, cell: Cell, border?: XlsxCellBorder): number;
19
19
  private fontId;
20
20
  private fillId;
21
+ private gradientFillId;
22
+ private exportGradientFill;
23
+ private fillColorElement;
21
24
  private borderId;
22
25
  private updateCounts;
23
26
  }
@@ -2,11 +2,15 @@ import type { Cell, Sheet } from '@fortune-sheet/core';
2
2
  import { type XlsxCellBorder } from './work-xlsx-cell-borders';
3
3
  import { type XlsxDirectCellStyleWriter } from './work-xlsx-cell-style-writer';
4
4
  import { type XlsxCellStyleOrigin } from './work-xlsx-cell-style-origin';
5
+ import { type XlsxGradientFill } from './work-xlsx-gradient-fill';
6
+ import { type XlsxPatternFill } from './work-xlsx-pattern-fill';
5
7
  export { XlsxDirectCellStyleWriter } from './work-xlsx-cell-style-writer';
6
8
  export interface XlsxDirectCellStyle {
7
9
  border?: XlsxCellBorder;
8
10
  column: number;
11
+ gradientFill?: XlsxGradientFill;
9
12
  origin?: XlsxCellStyleOrigin;
13
+ patternFill?: XlsxPatternFill;
10
14
  row: number;
11
15
  style: Partial<Cell>;
12
16
  }