@zeke-02/docx-editor 0.0.34 → 0.5.1
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 +34 -29
- package/dist/{ClipboardManager-C1l58nzE.d.ts → ClipboardManager-CVKX0v9q.d.ts} +1 -1
- package/dist/{ClipboardManager-Cjb_v74d.d.mts → ClipboardManager-V3aaMnWE.d.mts} +1 -1
- package/dist/{DocumentAgent-E8OX_8j0.d.mts → DocumentAgent-BWflKHpH.d.mts} +1 -1
- package/dist/{DocumentAgent-iedmc_8s.d.ts → DocumentAgent-DsdXtetF.d.ts} +1 -1
- package/dist/{FindReplaceDialog-YW3R4FHM.mjs → FindReplaceDialog-L3YF5HIS.mjs} +1 -1
- package/dist/FindReplaceDialog-SEBWC5P7.js +1 -0
- package/dist/{FootnotePropertiesDialog-LNFJXQUG.mjs → FootnotePropertiesDialog-TNVJJCY6.mjs} +1 -1
- package/dist/{FootnotePropertiesDialog-7QX54WQT.js → FootnotePropertiesDialog-XQ7NIFIU.js} +1 -1
- package/dist/{HyperlinkDialog-HNYTXDCB.mjs → HyperlinkDialog-FR4IZZ7E.mjs} +1 -1
- package/dist/HyperlinkDialog-WEK6JSAC.js +1 -0
- package/dist/{ImagePositionDialog-M65BYQQE.js → ImagePositionDialog-2YXRAGZS.js} +1 -1
- package/dist/{ImagePositionDialog-B4RLP2W5.mjs → ImagePositionDialog-JSZSIKF5.mjs} +1 -1
- package/dist/ImagePropertiesDialog-527MFLQO.mjs +1 -0
- package/dist/{ImagePropertiesDialog-O4WQSF5M.js → ImagePropertiesDialog-HG4K3IE7.js} +1 -1
- package/dist/PageSetupDialog-GALVJMUB.js +1 -0
- package/dist/PageSetupDialog-TGQIAMI7.mjs +1 -0
- package/dist/SplitCellDialog-JIAC3RYV.js +1 -0
- package/dist/SplitCellDialog-NP3JJYHD.mjs +1 -0
- package/dist/{TablePropertiesDialog-WOZ4ES3H.js → TablePropertiesDialog-T7D4HSVP.js} +1 -1
- package/dist/TablePropertiesDialog-TIK4AA5M.mjs +1 -0
- package/dist/{clipboard-BWhM0CRj.d.mts → TableToolbar-DUgmob2I.d.ts} +227 -135
- package/dist/{clipboard-BvkuNZub.d.ts → TableToolbar-YL74HNS1.d.mts} +227 -135
- package/dist/{agentApi-mv532p8I.d.mts → agentApi-DLt94vXk.d.mts} +83 -5
- package/dist/{agentApi-mv532p8I.d.ts → agentApi-DLt94vXk.d.ts} +83 -5
- package/dist/chunk-23SXXIZS.js +111 -0
- package/dist/chunk-3F52AP2Q.js +1 -0
- package/dist/chunk-42O5GXM5.mjs +82 -0
- package/dist/chunk-54ULJEHM.mjs +1 -0
- package/dist/chunk-5XK326FI.mjs +1 -0
- package/dist/chunk-76IYR7C7.mjs +1 -0
- package/dist/chunk-7BG7QY7I.js +182 -0
- package/dist/chunk-AGRIVA4G.js +1 -0
- package/dist/chunk-BTCQ2QI3.mjs +3 -0
- package/dist/chunk-BXRC4U3X.mjs +2 -0
- package/dist/chunk-CPAYKE6X.mjs +1 -0
- package/dist/chunk-DACWLFKI.mjs +1 -0
- package/dist/{chunk-377ZVTSE.js → chunk-EHFEG3TX.js} +1 -1
- package/dist/chunk-EPBFWE36.js +2 -0
- package/dist/chunk-FXES3YDB.js +82 -0
- package/dist/chunk-HI66BSGS.mjs +9 -0
- package/dist/chunk-INTPVEO6.mjs +9 -0
- package/dist/chunk-IOAGVW6Q.mjs +2 -0
- package/dist/chunk-JCEWC5QL.mjs +4 -0
- package/dist/chunk-JTIUFACT.js +1 -0
- package/dist/chunk-KUTCCI4X.mjs +182 -0
- package/dist/{chunk-KCOGY3V2.js → chunk-LUF7PWIC.js} +4 -4
- package/dist/chunk-LVGJKS7Y.mjs +24 -0
- package/dist/chunk-MGEN6GOE.mjs +2 -0
- package/dist/chunk-MOE2ZGUE.js +18 -0
- package/dist/chunk-MWLHJWB6.js +9 -0
- package/dist/chunk-OFYVDN3U.mjs +2 -0
- package/dist/chunk-P4VSHBGZ.js +2 -0
- package/dist/chunk-P5FQHIES.mjs +1 -0
- package/dist/chunk-PBC7XAYZ.js +3 -0
- package/dist/chunk-PEMB6SZT.js +2 -0
- package/dist/chunk-PKEOQIQO.mjs +2 -0
- package/dist/chunk-PQMSZTBB.js +9 -0
- package/dist/chunk-Q7UDQXAF.js +1 -0
- package/dist/chunk-QGTAIC5E.js +1 -0
- package/dist/chunk-R3QMYPL5.mjs +59 -0
- package/dist/chunk-RBUTXXQJ.mjs +18 -0
- package/dist/chunk-RRWYZ2TS.mjs +111 -0
- package/dist/{chunk-AU5NVRHP.js → chunk-SFUM35DH.js} +2 -2
- package/dist/chunk-SNLC6EK2.js +1 -0
- package/dist/chunk-TMTLIGLZ.js +59 -0
- package/dist/{chunk-RTFUE3KK.mjs → chunk-TSE2PWFX.mjs} +3 -3
- package/dist/chunk-UWYD42WV.js +4 -0
- package/dist/chunk-UXVACQCY.mjs +1 -0
- package/dist/{chunk-Z26WOH6R.mjs → chunk-W4EIKDM6.mjs} +2 -2
- package/dist/chunk-WNS2RBQD.js +2 -0
- package/dist/chunk-YC5KZSYD.js +24 -0
- package/dist/chunk-Z3KMSHUP.js +1 -0
- package/dist/core-plugins-reexport.d.mts +4 -4
- package/dist/core-plugins-reexport.d.ts +4 -4
- package/dist/core-plugins-reexport.js +1 -1
- package/dist/core-plugins-reexport.mjs +1 -1
- package/dist/core-reexport.d.mts +47 -16
- package/dist/core-reexport.d.ts +47 -16
- package/dist/core-reexport.js +1 -1
- package/dist/core-reexport.mjs +1 -1
- package/dist/{colorResolver-C5fQ4fxP.d.mts → documentSerializer-DtS_-oGA.d.mts} +378 -376
- package/dist/{colorResolver-Bp9flT3l.d.ts → documentSerializer-Wj1p2ASa.d.ts} +378 -376
- package/dist/executor-C3VXF7QA.mjs +1 -0
- package/dist/executor-GDBV3AGV.js +1 -0
- package/dist/headless-reexport.d.mts +14 -12
- package/dist/headless-reexport.d.ts +14 -12
- package/dist/headless-reexport.js +1 -4
- package/dist/headless-reexport.mjs +1 -4
- package/dist/index.css +1 -1
- package/dist/index.d.mts +284 -172
- package/dist/index.d.ts +284 -172
- package/dist/index.js +17 -9
- package/dist/index.mjs +17 -9
- package/dist/{fontLoader-0G00frKD.d.mts → insertOperations-BTH1Asas.d.mts} +86 -86
- package/dist/{fontLoader-DPdt4JvW.d.ts → insertOperations-CbUnXAXH.d.ts} +86 -86
- package/dist/layout-bridge-EA4DJ227.js +1 -0
- package/dist/layout-bridge-XDPSO6GO.mjs +1 -0
- package/dist/mcp-reexport.d.mts +2 -2
- package/dist/mcp-reexport.d.ts +2 -2
- package/dist/mcp-reexport.js +8 -8
- package/dist/mcp-reexport.mjs +7 -7
- package/dist/processTemplate-MJ2PCSO5.js +1 -0
- package/dist/{processTemplate-LRHXOWMZ.mjs → processTemplate-W2C5PXZB.mjs} +1 -1
- package/dist/{react-8budV7xv.d.mts → react-B0W16SV6.d.ts} +401 -166
- package/dist/{react-D6tMLo0R.d.ts → react-D0Pn1nww.d.mts} +401 -166
- package/dist/react.css +1 -1
- package/dist/react.d.mts +5 -5
- package/dist/react.d.ts +5 -5
- package/dist/react.js +1 -1
- package/dist/react.mjs +1 -1
- package/dist/{registry-BWGKcKc1.d.ts → registry-CH9V-IX0.d.ts} +1 -1
- package/dist/{registry-8XOdjHGC.d.mts → registry-CWBKYlNW.d.mts} +1 -1
- package/dist/styles.css +1 -1
- package/dist/{types-DIBvJ7AJ.d.mts → types-UDsUq8D3.d.mts} +1 -1
- package/dist/{types-CfAiObQo.d.ts → types-jbivc9Lj.d.ts} +1 -1
- package/dist/ui.d.mts +33 -83
- package/dist/ui.d.ts +33 -83
- package/dist/ui.js +1 -1
- package/dist/ui.mjs +1 -1
- package/dist/{variableDetector-DNO18eZ1.d.mts → variableDetector-CdQ7ZTzA.d.mts} +1 -1
- package/dist/{variableDetector-BIJFVpkl.d.ts → variableDetector-DsRV3A9z.d.ts} +1 -1
- package/i18n/de.json +49 -2
- package/i18n/en.json +55 -8
- package/i18n/he.json +792 -0
- package/i18n/pl.json +49 -2
- package/i18n/pt-BR.json +792 -0
- package/i18n/tr.json +792 -0
- package/i18n/zh-CN.json +792 -0
- package/package.json +17 -5
- package/dist/FindReplaceDialog-KNJETYJX.js +0 -1
- package/dist/HyperlinkDialog-GBAYMTUE.js +0 -1
- package/dist/ImagePropertiesDialog-JOGW3WDU.mjs +0 -1
- package/dist/PageSetupDialog-2GIBTKMJ.js +0 -1
- package/dist/PageSetupDialog-Q7SHEZIJ.mjs +0 -1
- package/dist/TablePropertiesDialog-LMXWX3FI.mjs +0 -1
- package/dist/chunk-2HDYCD2Q.mjs +0 -1
- package/dist/chunk-37SLIJPH.mjs +0 -58
- package/dist/chunk-3OKYQQQ5.js +0 -111
- package/dist/chunk-4VUZBV2S.js +0 -1
- package/dist/chunk-7MGFEP2R.mjs +0 -26
- package/dist/chunk-7QTNB64A.mjs +0 -9
- package/dist/chunk-AARNCPWR.js +0 -1
- package/dist/chunk-DC65PJYE.js +0 -4
- package/dist/chunk-DLNS7XC2.js +0 -261
- package/dist/chunk-DLVLK5FT.mjs +0 -24
- package/dist/chunk-EV3CM6TU.js +0 -1
- package/dist/chunk-FVUGBRDD.js +0 -1
- package/dist/chunk-FW5LYOOZ.mjs +0 -111
- package/dist/chunk-GZOCOWWB.mjs +0 -2
- package/dist/chunk-KUL2SDYC.js +0 -26
- package/dist/chunk-LYBG4YI7.mjs +0 -1
- package/dist/chunk-M5F4SK3W.mjs +0 -1
- package/dist/chunk-P7WEP4JU.js +0 -9
- package/dist/chunk-PB7VMDDP.js +0 -24
- package/dist/chunk-QAZ4233N.mjs +0 -1
- package/dist/chunk-QSUPYUOP.js +0 -2
- package/dist/chunk-QTSXJRP6.mjs +0 -1
- package/dist/chunk-SE5EN2QL.js +0 -1
- package/dist/chunk-X5A54T6S.mjs +0 -4
- package/dist/chunk-YKBSKEBS.mjs +0 -2
- package/dist/chunk-Z7ZLARCQ.mjs +0 -261
- package/dist/chunk-ZJNGMDRE.js +0 -58
- package/dist/executor-L2MVKMXO.js +0 -1
- package/dist/executor-XKBCCVNY.mjs +0 -1
- package/dist/processTemplate-5ZST2Q5L.js +0 -1
- package/dist/selectionRects-DEX5THEG.js +0 -1
- package/dist/selectionRects-SQTAHMCH.mjs +0 -1
|
@@ -1,5 +1,28 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
1
2
|
import React__default, { CSSProperties, ReactNode } from 'react';
|
|
2
|
-
import {
|
|
3
|
+
import { a3 as Theme, b as Run, a as Paragraph, e as Table, a0 as TableCell } from './agentApi-DLt94vXk.mjs';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Font Picker Component (Radix UI)
|
|
7
|
+
*
|
|
8
|
+
* A dropdown selector for choosing font families using Radix Select.
|
|
9
|
+
*/
|
|
10
|
+
interface FontOption {
|
|
11
|
+
name: string;
|
|
12
|
+
fontFamily: string;
|
|
13
|
+
category?: 'sans-serif' | 'serif' | 'monospace' | 'other';
|
|
14
|
+
}
|
|
15
|
+
interface FontPickerProps {
|
|
16
|
+
value?: string;
|
|
17
|
+
onChange?: (fontFamily: string) => void;
|
|
18
|
+
fonts?: FontOption[];
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
className?: string;
|
|
21
|
+
placeholder?: string;
|
|
22
|
+
width?: number | string;
|
|
23
|
+
showPreview?: boolean;
|
|
24
|
+
}
|
|
25
|
+
declare function FontPicker({ value, onChange, fonts, disabled, className, placeholder, width, showPreview, }: FontPickerProps): react_jsx_runtime.JSX.Element;
|
|
3
26
|
|
|
4
27
|
var _lang = "en";
|
|
5
28
|
var common = {
|
|
@@ -27,6 +50,10 @@ var toolbar = {
|
|
|
27
50
|
file: "File",
|
|
28
51
|
format: "Format",
|
|
29
52
|
insert: "Insert",
|
|
53
|
+
open: "Open",
|
|
54
|
+
openShortcut: "Ctrl+O",
|
|
55
|
+
save: "Save",
|
|
56
|
+
saveShortcut: "Ctrl+S",
|
|
30
57
|
print: "Print",
|
|
31
58
|
printShortcut: "Ctrl+P",
|
|
32
59
|
pageSetup: "Page setup",
|
|
@@ -36,7 +63,9 @@ var toolbar = {
|
|
|
36
63
|
table: "Table",
|
|
37
64
|
pageBreak: "Page break",
|
|
38
65
|
tableOfContents: "Table of contents",
|
|
39
|
-
symbol: "Symbol"
|
|
66
|
+
symbol: "Symbol",
|
|
67
|
+
help: "Help",
|
|
68
|
+
reportIssue: "Report issue"
|
|
40
69
|
};
|
|
41
70
|
var formattingBar = {
|
|
42
71
|
groups: {
|
|
@@ -230,6 +259,15 @@ var dialogs = {
|
|
|
230
259
|
insertButton: "Insert Table",
|
|
231
260
|
sizeSelector: "Table size selector"
|
|
232
261
|
},
|
|
262
|
+
splitCell: {
|
|
263
|
+
title: "Split Cell",
|
|
264
|
+
description: "Set how many rows and columns to split the selected cell into.",
|
|
265
|
+
rowsLabel: "Rows:",
|
|
266
|
+
columnsLabel: "Columns:",
|
|
267
|
+
currentMinimum: "Minimum from current span: {rows} row(s) x {cols} column(s)",
|
|
268
|
+
minValue: "Use at least {rows} row(s) and {cols} column(s).",
|
|
269
|
+
notOneByOne: "Choose at least two resulting cells."
|
|
270
|
+
},
|
|
233
271
|
insertImage: {
|
|
234
272
|
title: "Insert Image",
|
|
235
273
|
uploadAriaLabel: "Click or drag to upload image",
|
|
@@ -553,6 +591,9 @@ var documentOutline = {
|
|
|
553
591
|
var sidebar = {
|
|
554
592
|
ariaLabel: "Annotations sidebar"
|
|
555
593
|
};
|
|
594
|
+
var viewer = {
|
|
595
|
+
pageIndicator: "{current} of {total}"
|
|
596
|
+
};
|
|
556
597
|
var titleBar = {
|
|
557
598
|
untitled: "Untitled",
|
|
558
599
|
documentNameAriaLabel: "Document name",
|
|
@@ -661,13 +702,28 @@ var imageTransform = {
|
|
|
661
702
|
flipVertical: "Flip vertical"
|
|
662
703
|
};
|
|
663
704
|
var imageWrap = {
|
|
664
|
-
inline: "
|
|
665
|
-
floatLeft: "
|
|
666
|
-
floatRight: "
|
|
667
|
-
topAndBottom: "Top and
|
|
668
|
-
behindText: "Behind
|
|
669
|
-
inFrontOfText: "In
|
|
670
|
-
tooltipPrefix: "Wrap: {label}"
|
|
705
|
+
inline: "In Line with Text",
|
|
706
|
+
floatLeft: "Square Left",
|
|
707
|
+
floatRight: "Square Right",
|
|
708
|
+
topAndBottom: "Top and Bottom",
|
|
709
|
+
behindText: "Behind Text",
|
|
710
|
+
inFrontOfText: "In Front of Text",
|
|
711
|
+
tooltipPrefix: "Wrap: {label}",
|
|
712
|
+
menu: {
|
|
713
|
+
inLineWithText: "In Line with Text",
|
|
714
|
+
squareLeft: "Square Left",
|
|
715
|
+
squareRight: "Square Right",
|
|
716
|
+
behindText: "Behind Text",
|
|
717
|
+
inFrontOfText: "In Front of Text",
|
|
718
|
+
ariaLabel: "Image layout options"
|
|
719
|
+
},
|
|
720
|
+
menuDesc: {
|
|
721
|
+
inLineWithText: "Image flows in the line as a glyph",
|
|
722
|
+
squareLeft: "Image floats left, text wraps on the right",
|
|
723
|
+
squareRight: "Image floats right, text wraps on the left",
|
|
724
|
+
behindText: "Image paints behind body text",
|
|
725
|
+
inFrontOfText: "Image paints over body text"
|
|
726
|
+
}
|
|
671
727
|
};
|
|
672
728
|
var responsePreview = {
|
|
673
729
|
loading: "{action}...",
|
|
@@ -744,6 +800,20 @@ var unsaved = {
|
|
|
744
800
|
var loading = {
|
|
745
801
|
label: "Loading"
|
|
746
802
|
};
|
|
803
|
+
var agentPanel = {
|
|
804
|
+
defaultTitle: "Assistant",
|
|
805
|
+
toggle: "Open assistant",
|
|
806
|
+
close: "Close panel",
|
|
807
|
+
resizeHandle: "Resize agent panel",
|
|
808
|
+
thinking: "Assistant is thinking",
|
|
809
|
+
composerPlaceholder: "Ask the assistant…",
|
|
810
|
+
send: "Send",
|
|
811
|
+
timeline: {
|
|
812
|
+
working: "Working… {count, plural, one {# step} other {# steps}}",
|
|
813
|
+
summary: "{count, plural, one {# step} other {# steps}}",
|
|
814
|
+
earlier: "+ {count, plural, one {# earlier step} other {# earlier steps}}"
|
|
815
|
+
}
|
|
816
|
+
};
|
|
747
817
|
var en = {
|
|
748
818
|
_lang: _lang,
|
|
749
819
|
common: common,
|
|
@@ -763,6 +833,7 @@ var en = {
|
|
|
763
833
|
contextMenu: contextMenu,
|
|
764
834
|
documentOutline: documentOutline,
|
|
765
835
|
sidebar: sidebar,
|
|
836
|
+
viewer: viewer,
|
|
766
837
|
titleBar: titleBar,
|
|
767
838
|
errors: errors,
|
|
768
839
|
table: table,
|
|
@@ -778,7 +849,8 @@ var en = {
|
|
|
778
849
|
ruler: ruler,
|
|
779
850
|
print: print,
|
|
780
851
|
unsaved: unsaved,
|
|
781
|
-
loading: loading
|
|
852
|
+
loading: loading,
|
|
853
|
+
agentPanel: agentPanel
|
|
782
854
|
};
|
|
783
855
|
|
|
784
856
|
/** Auto-derived from en.json — never manually maintained */
|
|
@@ -886,6 +958,137 @@ declare function formatPageRange(range: {
|
|
|
886
958
|
*/
|
|
887
959
|
declare function isPrintSupported(): boolean;
|
|
888
960
|
|
|
961
|
+
/**
|
|
962
|
+
* Clipboard utilities for copy/paste with formatting
|
|
963
|
+
*
|
|
964
|
+
* Handles:
|
|
965
|
+
* - Copy: puts formatted HTML and plain text on clipboard
|
|
966
|
+
* - Paste: reads HTML clipboard, converts to runs with formatting
|
|
967
|
+
* - Handles paste from Word (cleans up Word HTML)
|
|
968
|
+
* - Ctrl+C, Ctrl+V, Ctrl+X keyboard shortcuts
|
|
969
|
+
*/
|
|
970
|
+
|
|
971
|
+
/**
|
|
972
|
+
* Clipboard content format
|
|
973
|
+
*/
|
|
974
|
+
interface ClipboardContent {
|
|
975
|
+
/** Plain text representation */
|
|
976
|
+
plainText: string;
|
|
977
|
+
/** HTML representation */
|
|
978
|
+
html: string;
|
|
979
|
+
/** Internal format (JSON) for preserving full formatting */
|
|
980
|
+
internal?: string;
|
|
981
|
+
}
|
|
982
|
+
/**
|
|
983
|
+
* Parsed clipboard content
|
|
984
|
+
*/
|
|
985
|
+
interface ParsedClipboardContent {
|
|
986
|
+
/** Runs parsed from clipboard */
|
|
987
|
+
runs: Run[];
|
|
988
|
+
/** Whether content came from Word */
|
|
989
|
+
fromWord: boolean;
|
|
990
|
+
/** Whether content came from our editor */
|
|
991
|
+
fromEditor: boolean;
|
|
992
|
+
/** Original plain text */
|
|
993
|
+
plainText: string;
|
|
994
|
+
}
|
|
995
|
+
/**
|
|
996
|
+
* Options for clipboard operations
|
|
997
|
+
*/
|
|
998
|
+
interface ClipboardOptions {
|
|
999
|
+
/** Whether to include formatting in copy */
|
|
1000
|
+
includeFormatting?: boolean;
|
|
1001
|
+
/** Whether to clean Word-specific formatting */
|
|
1002
|
+
cleanWordFormatting?: boolean;
|
|
1003
|
+
/** Callback for handling errors */
|
|
1004
|
+
onError?: (error: Error) => void;
|
|
1005
|
+
/** Document theme — required to resolve themed text/shading colors in HTML. */
|
|
1006
|
+
theme?: Theme | null;
|
|
1007
|
+
}
|
|
1008
|
+
/**
|
|
1009
|
+
* Custom MIME type for internal clipboard format
|
|
1010
|
+
*/
|
|
1011
|
+
declare const INTERNAL_CLIPBOARD_TYPE = "application/x-docx-editor";
|
|
1012
|
+
/**
|
|
1013
|
+
* Standard clipboard MIME types
|
|
1014
|
+
*/
|
|
1015
|
+
declare const CLIPBOARD_TYPES: {
|
|
1016
|
+
readonly HTML: "text/html";
|
|
1017
|
+
readonly PLAIN: "text/plain";
|
|
1018
|
+
};
|
|
1019
|
+
/**
|
|
1020
|
+
* Copy runs to clipboard with formatting
|
|
1021
|
+
*/
|
|
1022
|
+
declare function copyRuns(runs: Run[], options?: ClipboardOptions): Promise<boolean>;
|
|
1023
|
+
/**
|
|
1024
|
+
* Copy paragraphs to clipboard with formatting
|
|
1025
|
+
*/
|
|
1026
|
+
declare function copyParagraphs(paragraphs: Paragraph[], options?: ClipboardOptions): Promise<boolean>;
|
|
1027
|
+
/**
|
|
1028
|
+
* Convert runs to clipboard content (HTML and plain text).
|
|
1029
|
+
*
|
|
1030
|
+
* @param theme - Optional document theme. Pass it so themed text color and
|
|
1031
|
+
* shading resolve correctly in the HTML payload (matters when pasting into
|
|
1032
|
+
* Gmail/Word/etc.). Omit for rgb-only content.
|
|
1033
|
+
*/
|
|
1034
|
+
declare function runsToClipboardContent(runs: Run[], includeFormatting?: boolean, theme?: Theme | null): ClipboardContent;
|
|
1035
|
+
/**
|
|
1036
|
+
* Convert paragraphs to clipboard content.
|
|
1037
|
+
*
|
|
1038
|
+
* @param theme - See {@link runsToClipboardContent}.
|
|
1039
|
+
*/
|
|
1040
|
+
declare function paragraphsToClipboardContent(paragraphs: Paragraph[], includeFormatting?: boolean, theme?: Theme | null): ClipboardContent;
|
|
1041
|
+
/**
|
|
1042
|
+
* Write content to clipboard
|
|
1043
|
+
*/
|
|
1044
|
+
declare function writeToClipboard(content: ClipboardContent): Promise<boolean>;
|
|
1045
|
+
/**
|
|
1046
|
+
* Read content from clipboard
|
|
1047
|
+
*/
|
|
1048
|
+
declare function readFromClipboard(options?: ClipboardOptions): Promise<ParsedClipboardContent | null>;
|
|
1049
|
+
/**
|
|
1050
|
+
* Handle paste event
|
|
1051
|
+
*/
|
|
1052
|
+
declare function handlePasteEvent(event: ClipboardEvent, options?: ClipboardOptions): ParsedClipboardContent | null;
|
|
1053
|
+
/**
|
|
1054
|
+
* Parse HTML from clipboard
|
|
1055
|
+
*/
|
|
1056
|
+
declare function parseClipboardHtml(html: string, plainText: string, cleanWordFormatting?: boolean): ParsedClipboardContent;
|
|
1057
|
+
/**
|
|
1058
|
+
* Check if HTML is from Microsoft Word
|
|
1059
|
+
*/
|
|
1060
|
+
declare function isWordHtml(html: string): boolean;
|
|
1061
|
+
/**
|
|
1062
|
+
* Check if HTML is from our editor
|
|
1063
|
+
*/
|
|
1064
|
+
declare function isEditorHtml(html: string): boolean;
|
|
1065
|
+
/**
|
|
1066
|
+
* Clean Microsoft Word HTML
|
|
1067
|
+
*/
|
|
1068
|
+
declare function cleanWordHtml(html: string): string;
|
|
1069
|
+
/**
|
|
1070
|
+
* Convert HTML to runs
|
|
1071
|
+
*/
|
|
1072
|
+
declare function htmlToRuns(html: string, plainTextFallback: string): Run[];
|
|
1073
|
+
/**
|
|
1074
|
+
* Create clipboard keyboard handlers for an editor
|
|
1075
|
+
*/
|
|
1076
|
+
declare function createClipboardHandlers(options: {
|
|
1077
|
+
onCopy?: () => {
|
|
1078
|
+
runs: Run[];
|
|
1079
|
+
} | null;
|
|
1080
|
+
onCut?: () => {
|
|
1081
|
+
runs: Run[];
|
|
1082
|
+
} | null;
|
|
1083
|
+
onPaste?: (content: ParsedClipboardContent) => void;
|
|
1084
|
+
clipboardOptions?: ClipboardOptions;
|
|
1085
|
+
}): {
|
|
1086
|
+
handleCopy: (event: ClipboardEvent) => Promise<void>;
|
|
1087
|
+
handleCut: (event: ClipboardEvent) => Promise<void>;
|
|
1088
|
+
handlePaste: (event: ClipboardEvent) => void;
|
|
1089
|
+
handleKeyDown: (event: KeyboardEvent) => Promise<void>;
|
|
1090
|
+
};
|
|
1091
|
+
|
|
889
1092
|
/**
|
|
890
1093
|
* TableToolbar Component
|
|
891
1094
|
*
|
|
@@ -991,6 +1194,12 @@ interface TableContext {
|
|
|
991
1194
|
/** Total number of columns */
|
|
992
1195
|
columnCount: number;
|
|
993
1196
|
}
|
|
1197
|
+
interface TableSplitConfig {
|
|
1198
|
+
minRows: number;
|
|
1199
|
+
minCols: number;
|
|
1200
|
+
initialRows: number;
|
|
1201
|
+
initialCols: number;
|
|
1202
|
+
}
|
|
994
1203
|
/**
|
|
995
1204
|
* Props for TableToolbar component
|
|
996
1205
|
*/
|
|
@@ -1030,6 +1239,8 @@ declare function getColumnCount(table: Table): number;
|
|
|
1030
1239
|
* Get cell at specific row and column index
|
|
1031
1240
|
*/
|
|
1032
1241
|
declare function getCellAt(table: Table, rowIndex: number, columnIndex: number): TableCell | null;
|
|
1242
|
+
declare function getTableSplitCellDialogConfig(table: Table, rowIndex: number, columnIndex: number): TableSplitConfig | null;
|
|
1243
|
+
declare function splitTableCell(table: Table, rowIndex: number, columnIndex: number, rows: number, cols: number): Table;
|
|
1033
1244
|
/**
|
|
1034
1245
|
* Add a row to a table at the specified index
|
|
1035
1246
|
*/
|
|
@@ -1051,131 +1262,12 @@ declare function deleteColumn(table: Table, columnIndex: number): Table;
|
|
|
1051
1262
|
*/
|
|
1052
1263
|
declare function mergeCells(table: Table, selection: TableSelection): Table;
|
|
1053
1264
|
/**
|
|
1054
|
-
*
|
|
1055
|
-
|
|
1056
|
-
declare function splitCell(table: Table, rowIndex: number, columnIndex: number): Table;
|
|
1057
|
-
|
|
1058
|
-
/**
|
|
1059
|
-
* Clipboard utilities for copy/paste with formatting
|
|
1265
|
+
* Backward-compatible helper for callers that still use the older merged-cell
|
|
1266
|
+
* split behavior directly.
|
|
1060
1267
|
*
|
|
1061
|
-
*
|
|
1062
|
-
*
|
|
1063
|
-
* - Paste: reads HTML clipboard, converts to runs with formatting
|
|
1064
|
-
* - Handles paste from Word (cleans up Word HTML)
|
|
1065
|
-
* - Ctrl+C, Ctrl+V, Ctrl+X keyboard shortcuts
|
|
1066
|
-
*/
|
|
1067
|
-
|
|
1068
|
-
/**
|
|
1069
|
-
* Clipboard content format
|
|
1070
|
-
*/
|
|
1071
|
-
interface ClipboardContent {
|
|
1072
|
-
/** Plain text representation */
|
|
1073
|
-
plainText: string;
|
|
1074
|
-
/** HTML representation */
|
|
1075
|
-
html: string;
|
|
1076
|
-
/** Internal format (JSON) for preserving full formatting */
|
|
1077
|
-
internal?: string;
|
|
1078
|
-
}
|
|
1079
|
-
/**
|
|
1080
|
-
* Parsed clipboard content
|
|
1081
|
-
*/
|
|
1082
|
-
interface ParsedClipboardContent {
|
|
1083
|
-
/** Runs parsed from clipboard */
|
|
1084
|
-
runs: Run[];
|
|
1085
|
-
/** Whether content came from Word */
|
|
1086
|
-
fromWord: boolean;
|
|
1087
|
-
/** Whether content came from our editor */
|
|
1088
|
-
fromEditor: boolean;
|
|
1089
|
-
/** Original plain text */
|
|
1090
|
-
plainText: string;
|
|
1091
|
-
}
|
|
1092
|
-
/**
|
|
1093
|
-
* Options for clipboard operations
|
|
1094
|
-
*/
|
|
1095
|
-
interface ClipboardOptions {
|
|
1096
|
-
/** Whether to include formatting in copy */
|
|
1097
|
-
includeFormatting?: boolean;
|
|
1098
|
-
/** Whether to clean Word-specific formatting */
|
|
1099
|
-
cleanWordFormatting?: boolean;
|
|
1100
|
-
/** Callback for handling errors */
|
|
1101
|
-
onError?: (error: Error) => void;
|
|
1102
|
-
}
|
|
1103
|
-
/**
|
|
1104
|
-
* Custom MIME type for internal clipboard format
|
|
1105
|
-
*/
|
|
1106
|
-
declare const INTERNAL_CLIPBOARD_TYPE = "application/x-docx-editor";
|
|
1107
|
-
/**
|
|
1108
|
-
* Standard clipboard MIME types
|
|
1109
|
-
*/
|
|
1110
|
-
declare const CLIPBOARD_TYPES: {
|
|
1111
|
-
readonly HTML: "text/html";
|
|
1112
|
-
readonly PLAIN: "text/plain";
|
|
1113
|
-
};
|
|
1114
|
-
/**
|
|
1115
|
-
* Copy runs to clipboard with formatting
|
|
1116
|
-
*/
|
|
1117
|
-
declare function copyRuns(runs: Run[], options?: ClipboardOptions): Promise<boolean>;
|
|
1118
|
-
/**
|
|
1119
|
-
* Copy paragraphs to clipboard with formatting
|
|
1120
|
-
*/
|
|
1121
|
-
declare function copyParagraphs(paragraphs: Paragraph[], options?: ClipboardOptions): Promise<boolean>;
|
|
1122
|
-
/**
|
|
1123
|
-
* Convert runs to clipboard content (HTML and plain text)
|
|
1124
|
-
*/
|
|
1125
|
-
declare function runsToClipboardContent(runs: Run[], includeFormatting?: boolean): ClipboardContent;
|
|
1126
|
-
/**
|
|
1127
|
-
* Convert paragraphs to clipboard content
|
|
1128
|
-
*/
|
|
1129
|
-
declare function paragraphsToClipboardContent(paragraphs: Paragraph[], includeFormatting?: boolean): ClipboardContent;
|
|
1130
|
-
/**
|
|
1131
|
-
* Write content to clipboard
|
|
1132
|
-
*/
|
|
1133
|
-
declare function writeToClipboard(content: ClipboardContent): Promise<boolean>;
|
|
1134
|
-
/**
|
|
1135
|
-
* Read content from clipboard
|
|
1136
|
-
*/
|
|
1137
|
-
declare function readFromClipboard(options?: ClipboardOptions): Promise<ParsedClipboardContent | null>;
|
|
1138
|
-
/**
|
|
1139
|
-
* Handle paste event
|
|
1140
|
-
*/
|
|
1141
|
-
declare function handlePasteEvent(event: ClipboardEvent, options?: ClipboardOptions): ParsedClipboardContent | null;
|
|
1142
|
-
/**
|
|
1143
|
-
* Parse HTML from clipboard
|
|
1144
|
-
*/
|
|
1145
|
-
declare function parseClipboardHtml(html: string, plainText: string, cleanWordFormatting?: boolean): ParsedClipboardContent;
|
|
1146
|
-
/**
|
|
1147
|
-
* Check if HTML is from Microsoft Word
|
|
1268
|
+
* User-facing Split cell is now dialog-driven. For document-model tables, use
|
|
1269
|
+
* `getTableSplitCellDialogConfig()` and `splitTableCell()` instead.
|
|
1148
1270
|
*/
|
|
1149
|
-
declare function
|
|
1150
|
-
/**
|
|
1151
|
-
* Check if HTML is from our editor
|
|
1152
|
-
*/
|
|
1153
|
-
declare function isEditorHtml(html: string): boolean;
|
|
1154
|
-
/**
|
|
1155
|
-
* Clean Microsoft Word HTML
|
|
1156
|
-
*/
|
|
1157
|
-
declare function cleanWordHtml(html: string): string;
|
|
1158
|
-
/**
|
|
1159
|
-
* Convert HTML to runs
|
|
1160
|
-
*/
|
|
1161
|
-
declare function htmlToRuns(html: string, plainTextFallback: string): Run[];
|
|
1162
|
-
/**
|
|
1163
|
-
* Create clipboard keyboard handlers for an editor
|
|
1164
|
-
*/
|
|
1165
|
-
declare function createClipboardHandlers(options: {
|
|
1166
|
-
onCopy?: () => {
|
|
1167
|
-
runs: Run[];
|
|
1168
|
-
} | null;
|
|
1169
|
-
onCut?: () => {
|
|
1170
|
-
runs: Run[];
|
|
1171
|
-
} | null;
|
|
1172
|
-
onPaste?: (content: ParsedClipboardContent) => void;
|
|
1173
|
-
clipboardOptions?: ClipboardOptions;
|
|
1174
|
-
}): {
|
|
1175
|
-
handleCopy: (event: ClipboardEvent) => Promise<void>;
|
|
1176
|
-
handleCut: (event: ClipboardEvent) => Promise<void>;
|
|
1177
|
-
handlePaste: (event: ClipboardEvent) => void;
|
|
1178
|
-
handleKeyDown: (event: KeyboardEvent) => Promise<void>;
|
|
1179
|
-
};
|
|
1271
|
+
declare function splitCell(table: Table, rowIndex: number, columnIndex: number): Table;
|
|
1180
1272
|
|
|
1181
|
-
export {
|
|
1273
|
+
export { getCellAt as A, getColumnCount as B, CLIPBOARD_TYPES as C, getDefaultPrintOptions as D, getTableSplitCellDialogConfig as E, type FontOption as F, handlePasteEvent as G, htmlToRuns as H, INTERNAL_CLIPBOARD_TYPE as I, isEditorHtml as J, isPrintSupported as K, type LocaleStrings as L, isWordHtml as M, mergeCells as N, openPrintWindow as O, type ParsedClipboardContent as P, paragraphsToClipboardContent as Q, parseClipboardHtml as R, parsePageRange as S, type Translations as T, readFromClipboard as U, runsToClipboardContent as V, splitCell as W, splitTableCell as X, triggerPrint as Y, writeToClipboard as Z, type TranslationKey as a, type ClipboardContent as b, type ClipboardOptions as c, FontPicker as d, type FontPickerProps as e, type PartialLocaleStrings as f, PrintButton as g, type PrintButtonProps as h, type PrintOptions as i, PrintStyles as j, type TableAction as k, type TableContext as l, type TableSelection as m, type TableSplitConfig as n, TableToolbar as o, type TableToolbarProps as p, addColumn as q, addRow as r, cleanWordHtml as s, copyParagraphs as t, copyRuns as u, createClipboardHandlers as v, createTableContext as w, deleteColumn as x, deleteRow as y, formatPageRange as z };
|
|
@@ -178,6 +178,13 @@ type ParagraphAlignment = 'left' | 'center' | 'right' | 'both' | 'distribute' |
|
|
|
178
178
|
/**
|
|
179
179
|
* Complete paragraph formatting properties (w:pPr)
|
|
180
180
|
*/
|
|
181
|
+
/** Per-side flags identifying which `<w:spacing>` attrs were inline (not
|
|
182
|
+
* inherited from a style chain). Used to suppress style-only spacing on
|
|
183
|
+
* empty paragraphs per Word's behavior. */
|
|
184
|
+
type SpacingExplicit = {
|
|
185
|
+
before?: boolean;
|
|
186
|
+
after?: boolean;
|
|
187
|
+
};
|
|
181
188
|
interface ParagraphFormatting {
|
|
182
189
|
/** Paragraph alignment (w:jc) */
|
|
183
190
|
alignment?: ParagraphAlignment;
|
|
@@ -195,6 +202,12 @@ interface ParagraphFormatting {
|
|
|
195
202
|
beforeAutospacing?: boolean;
|
|
196
203
|
/** Auto space after (w:spacing/@w:afterAutospacing) */
|
|
197
204
|
afterAutospacing?: boolean;
|
|
205
|
+
/**
|
|
206
|
+
* Per-side flags marking which `<w:spacing>` attrs came from this
|
|
207
|
+
* paragraph's own pPr (vs inherited). Word collapses style-inherited
|
|
208
|
+
* spacing on empty paragraphs but honors the explicit values.
|
|
209
|
+
*/
|
|
210
|
+
spacingExplicit?: SpacingExplicit;
|
|
198
211
|
/** Left indent in twips (w:ind/@w:left) */
|
|
199
212
|
indentLeft?: number;
|
|
200
213
|
/** Right indent in twips (w:ind/@w:right) */
|
|
@@ -526,6 +539,20 @@ interface ListRendering {
|
|
|
526
539
|
markerFontFamily?: string;
|
|
527
540
|
/** Marker font size from numbering level rPr, in points */
|
|
528
541
|
markerFontSize?: number;
|
|
542
|
+
/**
|
|
543
|
+
* NumberFormat for each level from 0..ilvl (inclusive).
|
|
544
|
+
* Used to resolve multi-level templates like "%1.%2." where each %N
|
|
545
|
+
* may need a different format (e.g., upperRoman parent + decimal child).
|
|
546
|
+
*/
|
|
547
|
+
levelNumFmts?: NumberFormat[];
|
|
548
|
+
/** abstractNumId the paragraph's numId points to (counters key on this). */
|
|
549
|
+
abstractNumId?: number;
|
|
550
|
+
/**
|
|
551
|
+
* Start value from the numId's lvlOverride for the paragraph's ilvl, if any.
|
|
552
|
+
* Per ECMA-376 §17.9.18, this resets the shared abstractNum counter the
|
|
553
|
+
* first time the numId appears.
|
|
554
|
+
*/
|
|
555
|
+
startOverride?: number;
|
|
529
556
|
}
|
|
530
557
|
/**
|
|
531
558
|
* Complete numbering definitions
|
|
@@ -537,6 +564,16 @@ interface NumberingDefinitions {
|
|
|
537
564
|
nums: NumberingInstance[];
|
|
538
565
|
}
|
|
539
566
|
|
|
567
|
+
/**
|
|
568
|
+
* OOXML image wrap-type taxonomy.
|
|
569
|
+
*
|
|
570
|
+
* `wp:inline` flows in the line. `wp:anchor` covers all positioned variants:
|
|
571
|
+
* - `square` / `tight` / `through` — text wraps around the image
|
|
572
|
+
* - `topAndBottom` — text breaks above and below
|
|
573
|
+
* - `behind` / `inFront` (`wp:wrapNone`) — image paints out of flow
|
|
574
|
+
*/
|
|
575
|
+
type WrapType = 'inline' | 'square' | 'tight' | 'through' | 'topAndBottom' | 'behind' | 'inFront';
|
|
576
|
+
|
|
540
577
|
/**
|
|
541
578
|
* Document Content Model
|
|
542
579
|
*
|
|
@@ -751,7 +788,7 @@ interface ImageSize {
|
|
|
751
788
|
* Image wrap type for floating images
|
|
752
789
|
*/
|
|
753
790
|
interface ImageWrap {
|
|
754
|
-
type:
|
|
791
|
+
type: WrapType;
|
|
755
792
|
/** Wrap text direction */
|
|
756
793
|
wrapText?: 'bothSides' | 'left' | 'right' | 'largest';
|
|
757
794
|
/** Distance from text */
|
|
@@ -797,6 +834,19 @@ interface ImagePadding {
|
|
|
797
834
|
left?: number;
|
|
798
835
|
right?: number;
|
|
799
836
|
}
|
|
837
|
+
/**
|
|
838
|
+
* Image crop, expressed as fractions of the source image to trim from each
|
|
839
|
+
* edge. OOXML's `<a:srcRect l="10000" t="0" r="5000" b="0"/>` uses units of
|
|
840
|
+
* 1/100000 (so 10000 → 0.1 → 10% trimmed from the left). We store the
|
|
841
|
+
* normalised fraction so both the renderer and the saver can read it
|
|
842
|
+
* directly without re-parsing units.
|
|
843
|
+
*/
|
|
844
|
+
interface ImageCrop {
|
|
845
|
+
left?: number;
|
|
846
|
+
top?: number;
|
|
847
|
+
right?: number;
|
|
848
|
+
bottom?: number;
|
|
849
|
+
}
|
|
800
850
|
/**
|
|
801
851
|
* Embedded image (w:drawing)
|
|
802
852
|
*/
|
|
@@ -828,8 +878,25 @@ interface Image {
|
|
|
828
878
|
transform?: ImageTransform;
|
|
829
879
|
/** Padding around image */
|
|
830
880
|
padding?: ImagePadding;
|
|
881
|
+
/** Source-image crop (fractional, OOXML `a:srcRect`). */
|
|
882
|
+
crop?: ImageCrop;
|
|
883
|
+
/** Opacity in [0, 1] (OOXML `a:alphaModFix amt`). Undefined = fully opaque. */
|
|
884
|
+
opacity?: number;
|
|
831
885
|
/** Whether this is a decorative image */
|
|
832
886
|
decorative?: boolean;
|
|
887
|
+
/**
|
|
888
|
+
* `wp:anchor layoutInCell` — when true (default), an anchored image inside
|
|
889
|
+
* a table cell is constrained to the cell. When false, the image escapes
|
|
890
|
+
* the cell into the page area. Round-tripped on save.
|
|
891
|
+
*/
|
|
892
|
+
layoutInCell?: boolean;
|
|
893
|
+
/**
|
|
894
|
+
* `wp:anchor allowOverlap` — when true (default), anchored objects may
|
|
895
|
+
* overlap; when false, Word repositions them to avoid collisions. We
|
|
896
|
+
* don't currently reposition; we round-trip the flag so saving preserves
|
|
897
|
+
* the author's intent.
|
|
898
|
+
*/
|
|
899
|
+
allowOverlap?: boolean;
|
|
833
900
|
/** Hyperlink URL for clickable image */
|
|
834
901
|
hlinkHref?: string;
|
|
835
902
|
/** Image outline/border */
|
|
@@ -1288,6 +1355,8 @@ interface Paragraph {
|
|
|
1288
1355
|
content: ParagraphContent[];
|
|
1289
1356
|
/** Computed list rendering (if this is a list item) */
|
|
1290
1357
|
listRendering?: ListRendering;
|
|
1358
|
+
/** Word's cached layout says this paragraph started on a new rendered page. */
|
|
1359
|
+
renderedPageBreakBefore?: boolean;
|
|
1291
1360
|
/** Section properties (if this paragraph ends a section) */
|
|
1292
1361
|
sectionProperties?: SectionProperties;
|
|
1293
1362
|
}
|
|
@@ -1355,8 +1424,14 @@ interface Footnote {
|
|
|
1355
1424
|
id: number;
|
|
1356
1425
|
/** Special footnote type */
|
|
1357
1426
|
noteType?: 'normal' | 'separator' | 'continuationSeparator' | 'continuationNotice';
|
|
1358
|
-
/**
|
|
1359
|
-
|
|
1427
|
+
/**
|
|
1428
|
+
* Content. Per ECMA-376 §17.11.10 footnotes can hold the same blocks as
|
|
1429
|
+
* the body — paragraphs and tables. The parser previously only collected
|
|
1430
|
+
* <w:p> children which silently dropped any <w:tbl> inside a footnote;
|
|
1431
|
+
* widened to match HeaderFooter / TableCell shape so the body pipeline
|
|
1432
|
+
* (toProseDoc → toFlowBlocks) can render them uniformly.
|
|
1433
|
+
*/
|
|
1434
|
+
content: (Paragraph | Table)[];
|
|
1360
1435
|
}
|
|
1361
1436
|
/**
|
|
1362
1437
|
* Endnote (w:endnote)
|
|
@@ -1367,8 +1442,11 @@ interface Endnote {
|
|
|
1367
1442
|
id: number;
|
|
1368
1443
|
/** Special endnote type */
|
|
1369
1444
|
noteType?: 'normal' | 'separator' | 'continuationSeparator' | 'continuationNotice';
|
|
1370
|
-
/**
|
|
1371
|
-
|
|
1445
|
+
/**
|
|
1446
|
+
* Content. Per ECMA-376 §17.11.4 endnotes can hold the same blocks as
|
|
1447
|
+
* the body — paragraphs and tables. See note on `Footnote.content`.
|
|
1448
|
+
*/
|
|
1449
|
+
content: (Paragraph | Table)[];
|
|
1372
1450
|
}
|
|
1373
1451
|
/**
|
|
1374
1452
|
* Page orientation
|