ooxml-ui 1.20.0 → 1.21.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/dist/{chunk-4XPAPETH.js → chunk-VWN37QJI.js} +2 -1
- package/dist/{chunk-UB36NYDT.js → chunk-ZUDY7TXD.js} +1 -1
- package/dist/docx/building-blocks-actions.d.ts +54 -0
- package/dist/docx/building-blocks-status.d.ts +34 -0
- package/dist/docx/building-blocks.d.ts +20 -4
- package/dist/docx/editor-core.d.ts +5 -0
- package/dist/docx/element-api.d.ts +12 -0
- package/dist/docx/index.d.ts +3 -1
- package/dist/docx/insert-controller.d.ts +2 -0
- package/dist/docx/locales/en-app.d.ts +1 -0
- package/dist/docx/locales/en.d.ts +1 -0
- package/dist/docx/localization-strings.d.ts +1 -0
- package/dist/docx/surface-navigation.d.ts +8 -0
- package/dist/docx.js +337 -11
- package/dist/index.js +2 -2
- package/dist/pptx/{chunk-ABDWUQRQ.cjs → chunk-F4IP3UEX.cjs} +182 -5
- package/dist/pptx/{chunk-F6P7VS5I.mjs → chunk-L4HCXIRC.mjs} +174 -6
- package/dist/pptx/dom/index.cjs +209 -209
- package/dist/pptx/dom/index.mjs +2 -2
- package/dist/pptx/index.cjs +2922 -2886
- package/dist/pptx/index.mjs +1 -1
- package/dist/pptx/render/collaboration-options.d.ts +11 -9
- package/dist/pptx/render/collaboration-options.d.ts.map +1 -1
- package/dist/pptx/render/collaboration-owned-session.d.ts +34 -0
- package/dist/pptx/render/collaboration-owned-session.d.ts.map +1 -0
- package/dist/pptx/render/collaboration-state.d.ts +37 -0
- package/dist/pptx/render/collaboration-state.d.ts.map +1 -0
- package/dist/pptx/render/index.d.ts +2 -0
- package/dist/pptx/render/index.d.ts.map +1 -1
- package/dist/pptx/render/morph-predicates.d.ts +7 -0
- package/dist/pptx/render/morph-predicates.d.ts.map +1 -1
- package/dist/pptx/render/viewer-props-manifest.d.ts.map +1 -1
- package/dist/pptx/types.d.ts +15 -1
- package/dist/pptx/types.d.ts.map +1 -1
- package/dist/teams.js +1 -1
- package/dist/visio/building-blocks-shapes.d.ts +9 -0
- package/dist/visio/building-blocks-toolbar.d.ts +87 -0
- package/dist/visio/building-blocks.d.ts +9 -32
- package/dist/visio/canvas-editing.d.ts +36 -0
- package/dist/visio/canvas-keys.d.ts +9 -0
- package/dist/visio/canvas-services.d.ts +18 -0
- package/dist/visio/collaboration-types.d.ts +2 -2
- package/dist/visio/controller.d.ts +25 -0
- package/dist/visio/diagram-tool.d.ts +6 -0
- package/dist/visio/index.d.ts +1 -1
- package/dist/visio/viewer-clipboard.d.ts +7 -1
- package/dist/visio/viewer-delete.d.ts +10 -0
- package/dist/visio/viewer-presence-overlay.d.ts +12 -0
- package/dist/visio/viewer-presence.d.ts +19 -0
- package/dist/visio/viewer-share-sync.d.ts +14 -10
- package/dist/visio/viewer-share.d.ts +9 -7
- package/dist/visio/viewer-stencil.d.ts +8 -0
- package/dist/visio/viewer-write-back.d.ts +27 -0
- package/dist/visio.js +19887 -19227
- package/dist/xlsx/building-blocks.d.ts +32 -0
- package/dist/xlsx/editor-core.d.ts +8 -0
- package/dist/xlsx/element-api.d.ts +12 -1
- package/dist/xlsx/events.d.ts +12 -1
- package/dist/xlsx/index.d.ts +2 -1
- package/dist/xlsx/surface-actions.d.ts +26 -0
- package/dist/xlsx.js +138 -20
- package/package.json +2 -2
|
@@ -1993,7 +1993,8 @@ var XLSX_EDITOR_EVENTS = [
|
|
|
1993
1993
|
"sheet-change",
|
|
1994
1994
|
"dirty-change",
|
|
1995
1995
|
"collaboration-change",
|
|
1996
|
-
"office-ribbon-add-in"
|
|
1996
|
+
"office-ribbon-add-in",
|
|
1997
|
+
"validation-error"
|
|
1997
1998
|
];
|
|
1998
1999
|
var CANCELABLE = /* @__PURE__ */ new Set(["file-command"]);
|
|
1999
2000
|
function emitEvent(target, type, detail) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineSmartArt } from './chunk-QBXYGKPB.js';
|
|
2
|
-
import { TEAMS_TAGS, registerTeams } from './chunk-
|
|
2
|
+
import { TEAMS_TAGS, registerTeams } from './chunk-VWN37QJI.js';
|
|
3
3
|
import { installOfficeUiTheme } from './chunk-T5ARELU2.js';
|
|
4
4
|
import { registerControls } from './chunk-TJ245GDD.js';
|
|
5
5
|
import { definePresence } from './chunk-YZH2QS7J.js';
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { EditorCore } from './editor-core.js';
|
|
2
|
+
import { type SearchStatus } from './search-controller.js';
|
|
3
|
+
/** What a host dialog gets to edit the link at the selection. The host draws the dialog. */
|
|
4
|
+
export interface HyperlinkRequest {
|
|
5
|
+
/** The link target at the selection, or null when the selection is not a link. */
|
|
6
|
+
readonly href: string | null;
|
|
7
|
+
/** The selected text, which becomes the link text. */
|
|
8
|
+
readonly text: string;
|
|
9
|
+
/** Applies `href`; `text` replaces the selection (or inserts at the caret) when given. */
|
|
10
|
+
apply(href: string, text?: string): boolean;
|
|
11
|
+
remove(): boolean;
|
|
12
|
+
}
|
|
13
|
+
/** Find and replace over the document. Find works while read-only; replace needs edit permission. */
|
|
14
|
+
export interface FindReplaceRequest {
|
|
15
|
+
readonly status: SearchStatus;
|
|
16
|
+
readonly canReplace: boolean;
|
|
17
|
+
search(query: string, caseSensitive?: boolean): SearchStatus;
|
|
18
|
+
findNext(): boolean;
|
|
19
|
+
findPrevious(): boolean;
|
|
20
|
+
replaceOne(replacement: string): boolean;
|
|
21
|
+
replaceAll(replacement: string): number;
|
|
22
|
+
}
|
|
23
|
+
/** A host picture picker hands the chosen file back through `insert`. */
|
|
24
|
+
export interface ImagePickerRequest {
|
|
25
|
+
insert(file: File): Promise<boolean>;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Host-owned workflows for the surface. Each is named like the PowerPoint building blocks'
|
|
29
|
+
* `onOpen...` callbacks. A workflow without its callback reports as not enabled; the library never
|
|
30
|
+
* mounts a dialog of its own in surface mode.
|
|
31
|
+
*/
|
|
32
|
+
export interface SurfaceHostActions {
|
|
33
|
+
onOpenHyperlinkDialog?: ((request: HyperlinkRequest) => void) | undefined;
|
|
34
|
+
onOpenFindReplace?: ((request: FindReplaceRequest) => void) | undefined;
|
|
35
|
+
onOpenImagePicker?: ((request: ImagePickerRequest) => void) | undefined;
|
|
36
|
+
}
|
|
37
|
+
/** Enabled flags and openers for the host's link, find/replace and picture workflows. */
|
|
38
|
+
export declare function wordHostActionProps(core: EditorCore): {
|
|
39
|
+
/** Which workflows the host supplied a callback for, whether or not they are usable now. */
|
|
40
|
+
hostWorkflows: {
|
|
41
|
+
hyperlink: boolean;
|
|
42
|
+
findReplace: boolean;
|
|
43
|
+
picture: boolean;
|
|
44
|
+
};
|
|
45
|
+
canInsertLink: boolean;
|
|
46
|
+
canFindReplace: boolean;
|
|
47
|
+
canInsertPicture: boolean;
|
|
48
|
+
/** Opens the host's link dialog for the selection. Returns false when not enabled. */
|
|
49
|
+
openHyperlinkDialog: () => boolean;
|
|
50
|
+
/** Opens the host's find and replace workflow. Returns false when not enabled. */
|
|
51
|
+
openFindReplace: () => boolean;
|
|
52
|
+
/** Opens the host's picture picker. Returns false when not enabled. */
|
|
53
|
+
openImagePicker: () => boolean;
|
|
54
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { EditorCore } from './editor-core.js';
|
|
2
|
+
/**
|
|
3
|
+
* Page navigation state for custom controls. Pages exist only in Print Layout; in Draft the
|
|
4
|
+
* document is one continuous page and `pagesAvailable` is false.
|
|
5
|
+
*/
|
|
6
|
+
export declare function wordNavigationProps(core: EditorCore): {
|
|
7
|
+
labels: Record<string, string>;
|
|
8
|
+
viewMode: "draft" | "print";
|
|
9
|
+
/** False in Draft, where there are no pages to move between. */
|
|
10
|
+
pagesAvailable: boolean;
|
|
11
|
+
page: number;
|
|
12
|
+
pageCount: number;
|
|
13
|
+
pageText: string;
|
|
14
|
+
canGoPrevious: boolean;
|
|
15
|
+
canGoNext: boolean;
|
|
16
|
+
onGoToPage: (target: number) => boolean;
|
|
17
|
+
onPreviousPage: () => boolean;
|
|
18
|
+
onNextPage: () => boolean;
|
|
19
|
+
onViewModeChange: (mode: 'draft' | 'print') => boolean;
|
|
20
|
+
};
|
|
21
|
+
export type WordNavigationProps = ReturnType<typeof wordNavigationProps>;
|
|
22
|
+
/** Word count and zoom state for custom status controls. */
|
|
23
|
+
export declare function wordStatusProps(core: EditorCore): {
|
|
24
|
+
labels: Record<string, string>;
|
|
25
|
+
words: number;
|
|
26
|
+
wordText: string;
|
|
27
|
+
zoom: number;
|
|
28
|
+
minZoom: number;
|
|
29
|
+
maxZoom: number;
|
|
30
|
+
onZoomChange: (percent: number) => boolean;
|
|
31
|
+
onZoomIn: () => boolean;
|
|
32
|
+
onZoomOut: () => boolean;
|
|
33
|
+
};
|
|
34
|
+
export type WordStatusProps = ReturnType<typeof wordStatusProps>;
|
|
@@ -1,11 +1,27 @@
|
|
|
1
1
|
import type { EditorCore } from './editor-core.js';
|
|
2
|
+
export type WordAlignment = 'left' | 'center' | 'right' | 'justify';
|
|
3
|
+
/** The list kinds a control can apply; `remove` takes a paragraph out of its list. */
|
|
4
|
+
export type WordListChoice = 'bullet' | 'number';
|
|
5
|
+
/** The list the selection is in: a kind a control can apply, `other` for custom lists, or none. */
|
|
6
|
+
export type WordListState = WordListChoice | 'other' | null;
|
|
2
7
|
/** A snapshot of the current editor selection, with commands bound to the same editor. */
|
|
3
8
|
export declare function wordToolbarProps(core: EditorCore): {
|
|
9
|
+
hostWorkflows: {
|
|
10
|
+
hyperlink: boolean;
|
|
11
|
+
findReplace: boolean;
|
|
12
|
+
picture: boolean;
|
|
13
|
+
};
|
|
14
|
+
canInsertLink: boolean;
|
|
15
|
+
canFindReplace: boolean;
|
|
16
|
+
canInsertPicture: boolean;
|
|
17
|
+
openHyperlinkDialog: () => boolean;
|
|
18
|
+
openFindReplace: () => boolean;
|
|
19
|
+
openImagePicker: () => boolean;
|
|
4
20
|
labels: {
|
|
5
21
|
[k: string]: string;
|
|
6
22
|
};
|
|
7
23
|
canEdit: boolean;
|
|
8
|
-
list:
|
|
24
|
+
list: WordListState;
|
|
9
25
|
selection: {
|
|
10
26
|
from: number;
|
|
11
27
|
to: number;
|
|
@@ -15,7 +31,7 @@ export declare function wordToolbarProps(core: EditorCore): {
|
|
|
15
31
|
underline: boolean | null;
|
|
16
32
|
fontFamily: string | null;
|
|
17
33
|
fontSize: number | null;
|
|
18
|
-
alignment:
|
|
34
|
+
alignment: WordAlignment | null;
|
|
19
35
|
canUndo: boolean;
|
|
20
36
|
canRedo: boolean;
|
|
21
37
|
onBold: () => boolean;
|
|
@@ -23,8 +39,8 @@ export declare function wordToolbarProps(core: EditorCore): {
|
|
|
23
39
|
onUnderline: () => boolean;
|
|
24
40
|
onFontFamilyChange: (family: string) => boolean;
|
|
25
41
|
onFontSizeChange: (size: number) => boolean;
|
|
26
|
-
onAlignmentChange: (alignment:
|
|
27
|
-
onListChange: (kind:
|
|
42
|
+
onAlignmentChange: (alignment: WordAlignment) => boolean;
|
|
43
|
+
onListChange: (kind: WordListChoice | 'remove') => boolean;
|
|
28
44
|
onUndo: () => boolean;
|
|
29
45
|
onRedo: () => boolean;
|
|
30
46
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { SurfaceHostActions } from './building-blocks-actions.js';
|
|
1
2
|
import type { RibbonAddInTab } from '../ribbon/add-in-tabs.js';
|
|
2
3
|
import { FormatDialogs } from './format-dialogs.js';
|
|
3
4
|
import type { EditorState, Transaction } from 'prosemirror-state';
|
|
@@ -42,6 +43,8 @@ export interface ShellParts {
|
|
|
42
43
|
printNoteEditing?: () => void;
|
|
43
44
|
/** Selection frame and gestures for floating pictures on the pages. */
|
|
44
45
|
printFloats?: PrintFloats;
|
|
46
|
+
/** Detaches read-only selection and keyboard navigation of the surface. */
|
|
47
|
+
surfaceNavigation?: () => void;
|
|
45
48
|
navigator?: PageNavigator;
|
|
46
49
|
headings?: HeadingNavigator;
|
|
47
50
|
}
|
|
@@ -62,6 +65,8 @@ export declare class EditorCore {
|
|
|
62
65
|
readOnly: boolean;
|
|
63
66
|
/** Set before mounting to render only the document surface. */
|
|
64
67
|
surfaceOnly: boolean;
|
|
68
|
+
/** Host-owned workflows for surface mode (link, find and replace, picture picker). */
|
|
69
|
+
surfaceActions: SurfaceHostActions;
|
|
65
70
|
locale: EditorLocale;
|
|
66
71
|
reviewAuthor: string;
|
|
67
72
|
theme: EditorThemeMode;
|
|
@@ -5,6 +5,8 @@ import type { DocxCollaborationState } from './collaboration-types.js';
|
|
|
5
5
|
import type { EditorCore } from './editor-core.js';
|
|
6
6
|
import { type RibbonActionId, type RibbonActionInput } from 'ooxml-core/docx/ui';
|
|
7
7
|
import { type WordToolbarProps } from './building-blocks.js';
|
|
8
|
+
import { type WordNavigationProps, type WordStatusProps } from './building-blocks-status.js';
|
|
9
|
+
import type { SurfaceHostActions } from './building-blocks-actions.js';
|
|
8
10
|
declare const HTMLElementBase: typeof HTMLElement;
|
|
9
11
|
/**
|
|
10
12
|
* Save, collaboration, dirty-tracking and UI-customisation surface of `<docx-editor>`.
|
|
@@ -15,6 +17,16 @@ export declare abstract class DocxEditorApi extends HTMLElementBase {
|
|
|
15
17
|
get surfaceOnly(): boolean;
|
|
16
18
|
set surfaceOnly(value: boolean);
|
|
17
19
|
getToolbarProps(): WordToolbarProps;
|
|
20
|
+
/** Page, view mode and navigation callbacks for custom page controls. */
|
|
21
|
+
getNavigationProps(): WordNavigationProps;
|
|
22
|
+
/** Word count and zoom for custom status controls. */
|
|
23
|
+
getStatusProps(): WordStatusProps;
|
|
24
|
+
/**
|
|
25
|
+
* Host-owned dialogs for surface mode: `onOpenHyperlinkDialog`, `onOpenFindReplace` and
|
|
26
|
+
* `onOpenImagePicker`. A workflow without its callback is reported as not enabled.
|
|
27
|
+
*/
|
|
28
|
+
get surfaceActions(): SurfaceHostActions;
|
|
29
|
+
set surfaceActions(value: SurfaceHostActions);
|
|
18
30
|
get loading(): boolean;
|
|
19
31
|
/** Selection and formatting updates, including changes which do not dirty the document. */
|
|
20
32
|
subscribeEditorState(listener: () => void): () => void;
|
package/dist/docx/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { DocxEditorElement, registerDocxEditor } from './component.js';
|
|
2
|
-
export type { WordToolbarProps } from './building-blocks.js';
|
|
2
|
+
export type { WordAlignment, WordListChoice, WordListState, WordToolbarProps, } from './building-blocks.js';
|
|
3
|
+
export type { WordNavigationProps, WordStatusProps } from './building-blocks-status.js';
|
|
4
|
+
export type { FindReplaceRequest, HyperlinkRequest, ImagePickerRequest, SurfaceHostActions, } from './building-blocks-actions.js';
|
|
3
5
|
export { DOCX_EDITOR_EVENTS } from './events.js';
|
|
4
6
|
export type { RibbonAction } from './ribbon.js';
|
|
5
7
|
export { RIBBON_ACTION_IDS, RIBBON_ACTION_LABELS, normalizeRibbonActions, isRibbonActionId, } from 'ooxml-core/docx/ui';
|
|
@@ -50,4 +50,6 @@ export declare class InsertController {
|
|
|
50
50
|
private applyRulerChange;
|
|
51
51
|
private setShowHidden;
|
|
52
52
|
private insertSelectedPicture;
|
|
53
|
+
/** Stages `file` and inserts it at the selection; false when it could not be inserted. */
|
|
54
|
+
insertPictureFile(file: File): Promise<boolean>;
|
|
53
55
|
}
|
|
@@ -124,6 +124,7 @@ export declare const enApp: {
|
|
|
124
124
|
readonly 'Next page section break': 'Next page section break';
|
|
125
125
|
readonly 'Continuous section break': 'Continuous section break';
|
|
126
126
|
readonly 'Next page': 'Next page';
|
|
127
|
+
readonly 'Previous page': 'Previous page';
|
|
127
128
|
readonly Continuous: 'Continuous';
|
|
128
129
|
readonly 'Page numbers': 'Page numbers';
|
|
129
130
|
readonly 'Page number format': 'Page number format';
|
|
@@ -287,6 +287,7 @@ export declare const en: {
|
|
|
287
287
|
readonly 'Next page section break': 'Next page section break';
|
|
288
288
|
readonly 'Continuous section break': 'Continuous section break';
|
|
289
289
|
readonly 'Next page': 'Next page';
|
|
290
|
+
readonly 'Previous page': 'Previous page';
|
|
290
291
|
readonly Continuous: 'Continuous';
|
|
291
292
|
readonly 'Page numbers': 'Page numbers';
|
|
292
293
|
readonly 'Page number format': 'Page number format';
|
|
@@ -284,6 +284,7 @@ export declare const strings: {
|
|
|
284
284
|
readonly 'Next page section break': 'Next page section break';
|
|
285
285
|
readonly 'Continuous section break': 'Continuous section break';
|
|
286
286
|
readonly 'Next page': 'Next page';
|
|
287
|
+
readonly 'Previous page': 'Previous page';
|
|
287
288
|
readonly Continuous: 'Continuous';
|
|
288
289
|
readonly 'Page numbers': 'Page numbers';
|
|
289
290
|
readonly 'Page number format': 'Page number format';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { EditorCore } from './editor-core.js';
|
|
2
|
+
/**
|
|
3
|
+
* A read-only surface still lets the reader focus the document, select text, move a caret with the
|
|
4
|
+
* keyboard and copy. ProseMirror renders a non-editable document without a caret, so the browser's
|
|
5
|
+
* own selection is followed and mirrored into the editor state: custom controls then see it through
|
|
6
|
+
* `selection` and the formatting snapshot. Nothing here writes to the document. Returns a disposer.
|
|
7
|
+
*/
|
|
8
|
+
export declare function attachSurfaceNavigation(core: EditorCore): () => void;
|