ooxml-ui 1.49.1 → 1.50.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -2
- package/dist/{chunk-3WJUMM5D.js → chunk-63ELC26U.js} +1 -1
- package/dist/docx/building-blocks-read-aloud.d.ts +24 -0
- package/dist/docx/building-blocks.d.ts +5 -0
- package/dist/docx/editor-core.d.ts +3 -0
- package/dist/docx/element-api.d.ts +7 -0
- package/dist/docx/index.d.ts +2 -0
- package/dist/docx/read-aloud-session.d.ts +39 -0
- package/dist/docx/read-aloud.d.ts +14 -1
- package/dist/docx/view-options.d.ts +3 -0
- package/dist/docx.js +272 -154
- package/dist/image-native-size.d.ts +1 -0
- package/dist/index.js +2 -2
- package/dist/pptx/{chunk-WBGU7BWD.cjs → chunk-2JR2CHTG.cjs} +31 -1
- package/dist/pptx/{chunk-UFJBHFSD.cjs → chunk-3JGYWDMR.cjs} +5 -0
- package/dist/pptx/{chunk-URAPHGDB.cjs → chunk-3YKUOEZ5.cjs} +42 -42
- package/dist/pptx/{chunk-ZFZNX62I.mjs → chunk-74ESWHDZ.mjs} +1 -1
- package/dist/pptx/{chunk-PJQNDNOH.cjs → chunk-N7RS46HM.cjs} +2412 -483
- package/dist/pptx/{chunk-ZZJ7KTSD.mjs → chunk-OWXWCDNG.mjs} +2320 -483
- package/dist/pptx/{chunk-PTIGQSTY.mjs → chunk-QYBBLVGY.mjs} +31 -1
- package/dist/pptx/{chunk-2P6TH4ZE.mjs → chunk-VOBKKF45.mjs} +5 -0
- package/dist/pptx/dom/index.cjs +375 -375
- package/dist/pptx/dom/index.mjs +7 -7
- package/dist/pptx/i18n/index.cjs +6 -6
- package/dist/pptx/i18n/index.mjs +1 -1
- package/dist/pptx/i18n/translations-en.d.ts.map +1 -1
- package/dist/pptx/index.cjs +3443 -3075
- package/dist/pptx/index.mjs +3 -3
- package/dist/pptx/render/building-block-actions.d.ts +106 -0
- package/dist/pptx/render/building-block-actions.d.ts.map +1 -0
- package/dist/pptx/render/building-block-custom-shows.d.ts +74 -0
- package/dist/pptx/render/building-block-custom-shows.d.ts.map +1 -0
- package/dist/pptx/render/building-block-document-properties.d.ts +78 -0
- package/dist/pptx/render/building-block-document-properties.d.ts.map +1 -0
- package/dist/pptx/render/building-block-font-embedding.d.ts +42 -0
- package/dist/pptx/render/building-block-font-embedding.d.ts.map +1 -0
- package/dist/pptx/render/building-block-password.d.ts +71 -0
- package/dist/pptx/render/building-block-password.d.ts.map +1 -0
- package/dist/pptx/render/building-block-show-dialogs.d.ts +61 -0
- package/dist/pptx/render/building-block-show-dialogs.d.ts.map +1 -0
- package/dist/pptx/render/building-block-show-settings.d.ts +61 -0
- package/dist/pptx/render/building-block-show-settings.d.ts.map +1 -0
- package/dist/pptx/render/building-block-signatures.d.ts +68 -0
- package/dist/pptx/render/building-block-signatures.d.ts.map +1 -0
- package/dist/pptx/render/building-blocks/action-groups.d.ts +61 -0
- package/dist/pptx/render/building-blocks/action-groups.d.ts.map +1 -0
- package/dist/pptx/render/building-blocks/actions-types.d.ts +110 -0
- package/dist/pptx/render/building-blocks/actions-types.d.ts.map +1 -0
- package/dist/pptx/render/building-blocks/find-bar-controller.d.ts +18 -0
- package/dist/pptx/render/building-blocks/find-bar-controller.d.ts.map +1 -0
- package/dist/pptx/render/building-blocks/find-highlight-dom.d.ts +20 -0
- package/dist/pptx/render/building-blocks/find-highlight-dom.d.ts.map +1 -0
- package/dist/pptx/render/building-blocks/find-layout.d.ts +62 -0
- package/dist/pptx/render/building-blocks/find-layout.d.ts.map +1 -0
- package/dist/pptx/render/building-blocks/groups/file-dialog-groups.d.ts +45 -0
- package/dist/pptx/render/building-blocks/groups/file-dialog-groups.d.ts.map +1 -0
- package/dist/pptx/render/building-blocks/groups/index.d.ts +25 -0
- package/dist/pptx/render/building-blocks/groups/index.d.ts.map +1 -0
- package/dist/pptx/render/building-blocks/groups/show-dialog-groups.d.ts +79 -0
- package/dist/pptx/render/building-blocks/groups/show-dialog-groups.d.ts.map +1 -0
- package/dist/pptx/render/building-blocks/hyperlink-edit-data.d.ts +57 -0
- package/dist/pptx/render/building-blocks/hyperlink-edit-data.d.ts.map +1 -0
- package/dist/pptx/render/building-blocks/index.d.ts +19 -0
- package/dist/pptx/render/building-blocks/index.d.ts.map +1 -0
- package/dist/pptx/render/building-blocks/media-element-from-file.d.ts +23 -0
- package/dist/pptx/render/building-blocks/media-element-from-file.d.ts.map +1 -0
- package/dist/pptx/render/building-blocks/mode.d.ts +11 -0
- package/dist/pptx/render/building-blocks/mode.d.ts.map +1 -0
- package/dist/pptx/render/building-blocks/requests.d.ts +96 -0
- package/dist/pptx/render/building-blocks/requests.d.ts.map +1 -0
- package/dist/pptx/render/building-blocks/session.d.ts +84 -0
- package/dist/pptx/render/building-blocks/session.d.ts.map +1 -0
- package/dist/pptx/render/building-blocks/toolbar.d.ts +56 -0
- package/dist/pptx/render/building-blocks/toolbar.d.ts.map +1 -0
- package/dist/pptx/render/controller/index.d.ts +4 -0
- package/dist/pptx/render/controller/index.d.ts.map +1 -1
- package/dist/pptx/render/controller/ribbon-display-controller.d.ts +80 -0
- package/dist/pptx/render/controller/ribbon-display-controller.d.ts.map +1 -0
- package/dist/pptx/render/controller/save-revision.d.ts +83 -0
- package/dist/pptx/render/controller/save-revision.d.ts.map +1 -0
- package/dist/pptx/render/editor-chrome/ribbon-css.d.ts +1 -1
- package/dist/pptx/render/editor-chrome/ribbon-css.d.ts.map +1 -1
- package/dist/pptx/render/font-catalog.cjs +3 -3
- package/dist/pptx/render/font-catalog.d.ts +27 -3
- package/dist/pptx/render/font-catalog.d.ts.map +1 -1
- package/dist/pptx/render/font-catalog.mjs +1 -1
- package/dist/pptx/render/index.d.ts +12 -0
- package/dist/pptx/render/index.d.ts.map +1 -1
- package/dist/pptx/render/insert-chart.d.ts +12 -0
- package/dist/pptx/render/insert-chart.d.ts.map +1 -1
- package/dist/pptx/render/read-only-recommendation.d.ts +2 -0
- package/dist/pptx/render/read-only-recommendation.d.ts.map +1 -1
- package/dist/pptx/render/ribbon-display.d.ts +50 -0
- package/dist/pptx/render/ribbon-display.d.ts.map +1 -0
- package/dist/pptx/render/ribbon-home-state-extras.d.ts.map +1 -1
- package/dist/pptx/render/stage-element-ids.d.ts +9 -0
- package/dist/pptx/render/stage-element-ids.d.ts.map +1 -1
- package/dist/pptx/render/viewer-props-manifest.d.ts.map +1 -1
- package/dist/pptx/render/viewer-zoom-store.d.ts.map +1 -1
- package/dist/pptx/render/viewport-navigation.d.ts +93 -0
- package/dist/pptx/render/viewport-navigation.d.ts.map +1 -0
- package/dist/pptx/render/zoom-step.d.ts +9 -2
- package/dist/pptx/render/zoom-step.d.ts.map +1 -1
- package/dist/pptx/{smartart-insert-preview-WYVZOCHF.cjs → smartart-insert-preview-WPIGM6UQ.cjs} +5 -5
- package/dist/pptx/{smartart-insert-preview-WXVMLDH4.mjs → smartart-insert-preview-ZHDQ5QDD.mjs} +4 -4
- package/dist/pptx/types.d.ts +20 -0
- package/dist/pptx/types.d.ts.map +1 -1
- package/dist/ribbon/color-preview.d.ts +0 -1
- package/dist/teams.js +1 -1
- package/dist/theme.d.ts +1 -0
- package/dist/visio/controller.d.ts +11 -0
- package/dist/visio/index.d.ts +1 -0
- package/dist/visio/text-edit-outcome.d.ts +41 -0
- package/dist/visio/viewer-inline-text.d.ts +7 -0
- package/dist/visio.js +133 -10
- package/dist/xlsx/building-blocks.d.ts +24 -0
- package/dist/xlsx/commands/test-support.d.ts +1 -0
- package/dist/xlsx/component.d.ts +7 -0
- package/dist/xlsx/context-menu/host-api.d.ts +55 -0
- package/dist/xlsx/context-menu/menu.d.ts +9 -0
- package/dist/xlsx/dialogs/find-replace.d.ts +2 -4
- package/dist/xlsx/editor-core.d.ts +2 -0
- package/dist/xlsx/host-find.d.ts +3 -0
- package/dist/xlsx/host-function.d.ts +3 -0
- package/dist/xlsx/host-open.d.ts +10 -0
- package/dist/xlsx/host-workflows.d.ts +9 -0
- package/dist/xlsx/index.d.ts +1 -0
- package/dist/xlsx/surface-actions.d.ts +20 -4
- package/dist/xlsx/surface-workflows.d.ts +132 -0
- package/dist/xlsx.js +539 -201
- package/package.json +2 -2
- /package/dist/{chunk-XWGWPYG5.js → chunk-BY7X2LNM.js} +0 -0
package/README.md
CHANGED
|
@@ -43,6 +43,14 @@ translation and focus-restoration policies. Dispose owned font scopes and sessio
|
|
|
43
43
|
when the host unmounts. Font selection and script segmentation are DOM-free APIs
|
|
44
44
|
in `ooxml-core/text`.
|
|
45
45
|
|
|
46
|
+
PowerPoint hosts can import `buildFontCatalog` from the DOM-free
|
|
47
|
+
`ooxml-ui/pptx/render/font-catalog` runtime entry. Set `includeWeightVariants: true`
|
|
48
|
+
to add `entry.variants` with supported `{ family, weight }` faces, for example
|
|
49
|
+
`DM Sans Medium` at 500; the 400 face keeps the plain family name. Omit the option
|
|
50
|
+
for the existing output. Embedded/custom and unknown families do not inherit Google
|
|
51
|
+
Fonts weights. All five PowerPoint dropdowns use the shared variant rows.
|
|
52
|
+
See [font loading](../../docs/font-loading.md#font-picker-weights) for the input/output table.
|
|
53
|
+
|
|
46
54
|
## How the elements are built
|
|
47
55
|
|
|
48
56
|
`office-ui-smartart` accepts `schemeFonts` (`major` and `minor` Latin typefaces)
|
|
@@ -124,7 +132,7 @@ button.addEventListener('office-command', (event) => console.log(event.detail));
|
|
|
124
132
|
document.body.append(button);
|
|
125
133
|
```
|
|
126
134
|
|
|
127
|
-
## API: entries (ESM
|
|
135
|
+
## API: entries (ESM, plus CJS for PowerPoint)
|
|
128
136
|
|
|
129
137
|
The shared `office-ui-gallery` also supports `mode="panel"` for modal pickers.
|
|
130
138
|
It displays labelled preview tiles directly, keeps focus when a pick refreshes the
|
|
@@ -152,7 +160,7 @@ uses it for Text Warp and Quick Styles, whose picks apply at once.
|
|
|
152
160
|
| `ooxml-ui/visio` | the Visio editor and viewer elements (`<visio-viewer>`) |
|
|
153
161
|
| `ooxml-ui/pptx` | the PowerPoint renderer, editor and web components; also `/pptx/theme`, `/loader`, `/i18n`, `/ai`, `/dom` |
|
|
154
162
|
|
|
155
|
-
|
|
163
|
+
Most entries declare an `import` and a `default` export condition, so CommonJS consumers on Node 20.19+ or 22.12+ load them through `require(esm)`; the `ooxml-ui/pptx` entries also declare a `require` condition for the CJS build.
|
|
156
164
|
|
|
157
165
|
`installOfficeUiTheme()` installs one theme stylesheet in the document by default. Pass a
|
|
158
166
|
`ShadowRoot` to install scoped mode and control rules inside an embedding app's shadow tree.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineSmartArt, defineSmartArtPicker, defineSmartArtTextPane } from './chunk-6FFZFH73.js';
|
|
2
|
-
import { TEAMS_TAGS, registerTeams } from './chunk-
|
|
2
|
+
import { TEAMS_TAGS, registerTeams } from './chunk-BY7X2LNM.js';
|
|
3
3
|
import { installOfficeUiTheme } from './chunk-N6AKS4ED.js';
|
|
4
4
|
import { registerControls } from './chunk-SRYBCJC2.js';
|
|
5
5
|
import { definePresence } from './chunk-Q6WZEGAM.js';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { EditorCore } from './editor-core.js';
|
|
2
|
+
import type { ReadAloudIssue, ReadAloudStart } from './read-aloud.js';
|
|
3
|
+
export type { ReadAloudIssue, ReadAloudStart };
|
|
4
|
+
/**
|
|
5
|
+
* State and commands for a host's own Read Aloud control. It reads the selection, or the caret to
|
|
6
|
+
* the end of the document, with the editor's own implementation, and works in a read-only
|
|
7
|
+
* document (it never edits or dirties). Callbacks read the live editor and never move focus or
|
|
8
|
+
* the selection.
|
|
9
|
+
*/
|
|
10
|
+
export declare function wordReadAloudProps(core: EditorCore): {
|
|
11
|
+
/** A document is on screen and the browser can speak. */
|
|
12
|
+
canReadAloud: boolean;
|
|
13
|
+
/** This editor is reading now. Another editor reading leaves it false. */
|
|
14
|
+
readingAloud: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Why Read Aloud is not or no longer playing: `unsupported` (no speech synthesis),
|
|
17
|
+
* `empty` (nothing to read) or `error` (the voice failed). Null otherwise. The host words it.
|
|
18
|
+
*/
|
|
19
|
+
readAloudIssue: ReadAloudIssue | null;
|
|
20
|
+
/** Starts reading, taking the voice over from another editor. Says why nothing started. */
|
|
21
|
+
onReadAloud: () => ReadAloudStart;
|
|
22
|
+
/** Stops this editor's playback. Returns whether it was playing. */
|
|
23
|
+
onStopReadAloud: () => boolean;
|
|
24
|
+
};
|
|
@@ -17,6 +17,11 @@ export declare function wordToolbarProps(core: EditorCore): {
|
|
|
17
17
|
openHyperlinkDialog: () => boolean;
|
|
18
18
|
openFindReplace: () => boolean;
|
|
19
19
|
openImagePicker: () => boolean;
|
|
20
|
+
canReadAloud: boolean;
|
|
21
|
+
readingAloud: boolean;
|
|
22
|
+
readAloudIssue: import("./read-aloud.js").ReadAloudIssue | null;
|
|
23
|
+
onReadAloud: () => import("./read-aloud.js").ReadAloudStart;
|
|
24
|
+
onStopReadAloud: () => boolean;
|
|
20
25
|
labels: {
|
|
21
26
|
[k: string]: string;
|
|
22
27
|
};
|
|
@@ -28,6 +28,7 @@ import type { PageNavigator } from './page-navigator.js';
|
|
|
28
28
|
import type { HeadingNavigator } from './heading-navigator.js';
|
|
29
29
|
import type { DocxChartFormatPane } from './chart-format-pane.js';
|
|
30
30
|
import { ViewOptions } from './view-options.js';
|
|
31
|
+
import { ReadAloudSession } from './read-aloud-session.js';
|
|
31
32
|
import { DocxWebfonts } from './docx-webfonts.js';
|
|
32
33
|
export type LoadedDocument = Awaited<ReturnType<typeof loadDocument>>;
|
|
33
34
|
/** DOM pieces created by the shell once the element connects. */
|
|
@@ -124,6 +125,8 @@ export declare class EditorCore {
|
|
|
124
125
|
readonly parts: PartsController;
|
|
125
126
|
readonly pages: PageController;
|
|
126
127
|
readonly viewOptions: ViewOptions;
|
|
128
|
+
/** This editor's Read Aloud playback; the browser's one voice is shared with other editors. */
|
|
129
|
+
readonly readAloud: ReadAloudSession;
|
|
127
130
|
/** The `googleFonts` option and this editor's webfont `<link>`. */
|
|
128
131
|
readonly webfonts: DocxWebfonts;
|
|
129
132
|
readonly dirtyState: DirtyState;
|
|
@@ -10,6 +10,7 @@ import { type WordToolbarProps } from './building-blocks.js';
|
|
|
10
10
|
import { type WordNavigationProps, type WordStatusProps } from './building-blocks-status.js';
|
|
11
11
|
import type { SurfaceHostActions } from './building-blocks-actions.js';
|
|
12
12
|
import type { GoogleFontsOption } from 'ooxml-core/text';
|
|
13
|
+
import type { ReadAloudOptions } from './read-aloud-session.js';
|
|
13
14
|
declare const HTMLElementBase: typeof HTMLElement;
|
|
14
15
|
/**
|
|
15
16
|
* Save, collaboration, dirty-tracking and UI-customisation surface of `<docx-editor>`.
|
|
@@ -81,6 +82,12 @@ export declare abstract class DocxEditorApi extends HTMLElementBase {
|
|
|
81
82
|
/** Shows the left rail of page thumbnails. Needs Print Layout; reflected to `show-thumbnails`. */
|
|
82
83
|
get showThumbnails(): boolean;
|
|
83
84
|
set showThumbnails(value: boolean);
|
|
85
|
+
/**
|
|
86
|
+
* Read Aloud options. `stopOnEdit` (default false) also stops playback when the document is
|
|
87
|
+
* edited; replacing or reloading the document and unmounting always stop it.
|
|
88
|
+
*/
|
|
89
|
+
get readAloud(): ReadAloudOptions | null;
|
|
90
|
+
set readAloud(value: ReadAloudOptions | null | undefined);
|
|
84
91
|
/**
|
|
85
92
|
* Tabs a host adds after Word's own, as an Office add-in does. Each command runs its `run`
|
|
86
93
|
* callback and dispatches `office-ribbon-add-in` (`{ tab, command }`) from the editor.
|
package/dist/docx/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { DocxEditorElement, registerDocxEditor } from './component.js';
|
|
2
2
|
export type { WordAlignment, WordListChoice, WordListState, WordToolbarProps, } from './building-blocks.js';
|
|
3
3
|
export type { WordNavigationProps, WordStatusProps } from './building-blocks-status.js';
|
|
4
|
+
export type { ReadAloudIssue, ReadAloudStart } from './building-blocks-read-aloud.js';
|
|
4
5
|
export type { FindReplaceRequest, HyperlinkRequest, ImagePickerRequest, SurfaceHostActions, } from './building-blocks-actions.js';
|
|
5
6
|
export { DOCX_EDITOR_EVENTS } from './events.js';
|
|
6
7
|
export type { RibbonAction } from './ribbon.js';
|
|
@@ -27,6 +28,7 @@ export type { RevisionRange } from './review-commands.js';
|
|
|
27
28
|
export { lightTheme, darkTheme, themeToCssVars } from 'ooxml-core/docx/ui';
|
|
28
29
|
export type { EditorTheme, EditorThemeMode } from 'ooxml-core/docx/ui';
|
|
29
30
|
export { RIBBON_ADD_IN_EVENT, type OfficeRibbonAddInEvent, type RibbonAddInCommand, type RibbonAddInCommandDetail, type RibbonAddInGroup, type RibbonAddInTab, } from '../ribbon/add-in-tabs.js';
|
|
31
|
+
export type { ReadAloudOptions } from './read-aloud-session.js';
|
|
30
32
|
export type { WordBackstagePage, WordCustomization, WordMenuCommand, WordMenuContext, WordRegionContext, WordRegionRenderer, } from './customization.js';
|
|
31
33
|
export { WORD_CAPABILITY_IDS } from 'ooxml-core/docx/ui';
|
|
32
34
|
export type { WordCapabilities, WordCapabilityId } from 'ooxml-core/docx/ui';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { EditorCore } from './editor-core.js';
|
|
2
|
+
import { type ReadAloudIssue, type ReadAloudStart } from './read-aloud.js';
|
|
3
|
+
/**
|
|
4
|
+
* Host options for Read Aloud. Playback always stops when the document is replaced or reloaded and
|
|
5
|
+
* when the editor unmounts; this only decides what an ordinary edit does.
|
|
6
|
+
*/
|
|
7
|
+
export interface ReadAloudOptions {
|
|
8
|
+
/**
|
|
9
|
+
* Stop playback when the document is edited, locally or by a collaborator. Default false:
|
|
10
|
+
* Microsoft's public Word documentation does not say that editing stops Read Aloud, so playback
|
|
11
|
+
* carries on with the text it started with.
|
|
12
|
+
*/
|
|
13
|
+
stopOnEdit?: boolean | undefined;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* One editor's Read Aloud: the playback it owns, and the last problem it ran into. The browser has
|
|
17
|
+
* a single voice, so starting here takes it over from another editor, and this session lets go of
|
|
18
|
+
* it when its document changes or the editor leaves the page.
|
|
19
|
+
*/
|
|
20
|
+
export declare class ReadAloudSession {
|
|
21
|
+
private readonly core;
|
|
22
|
+
private lastIssue;
|
|
23
|
+
constructor(core: EditorCore);
|
|
24
|
+
get playing(): boolean;
|
|
25
|
+
/** The last problem, or `unsupported` while the browser has no speech synthesis. */
|
|
26
|
+
get issue(): ReadAloudIssue | null;
|
|
27
|
+
/** True when a request can play now: speech exists and a document is on screen. */
|
|
28
|
+
get available(): boolean;
|
|
29
|
+
/** Reads the selection, or the caret to the end, restarting if it is already reading. */
|
|
30
|
+
start(): ReadAloudStart;
|
|
31
|
+
/** Stops this editor's playback and clears its problem. Returns whether it was playing. */
|
|
32
|
+
stop(): boolean;
|
|
33
|
+
/** The document was edited: stops only when the host chose `readAloud.stopOnEdit`. */
|
|
34
|
+
documentEdited(): void;
|
|
35
|
+
/** Starts, or stops when already playing. Returns whether it is playing now. */
|
|
36
|
+
toggle(): boolean;
|
|
37
|
+
private report;
|
|
38
|
+
private changed;
|
|
39
|
+
}
|
|
@@ -3,7 +3,20 @@ import type { EditorView } from 'prosemirror-view';
|
|
|
3
3
|
export declare function readAloudAvailable(): boolean;
|
|
4
4
|
/** What Word's Read Aloud reads: the selection, or everything from the caret to the end. */
|
|
5
5
|
export declare function textToRead(view: EditorView): string;
|
|
6
|
-
|
|
6
|
+
/** Why a Read Aloud request did not play, or that the voice failed while playing. */
|
|
7
|
+
export type ReadAloudIssue = 'unsupported' | 'empty' | 'error';
|
|
8
|
+
/** The result of a start request. */
|
|
9
|
+
export type ReadAloudStart = 'started' | ReadAloudIssue;
|
|
10
|
+
/** Whether `owner` (or, without one, anybody) is reading right now. */
|
|
11
|
+
export declare function isReadingAloud(owner?: object): boolean;
|
|
12
|
+
/** Stops the playback `owner` started, if it is the one playing. Returns whether it stopped one. */
|
|
13
|
+
export declare function stopReadAloud(owner?: object): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Reads `text` for `owner`. Starting while another owner is reading takes the voice over: that
|
|
16
|
+
* owner is told it stopped. Returns why nothing started (`unsupported`, `empty`, `error`) or
|
|
17
|
+
* `started`. `onChange` fires when playback starts and ends; `onError` when the voice fails.
|
|
18
|
+
*/
|
|
19
|
+
export declare function startReadAloud(owner: object, text: string, onChange: (speaking: boolean) => void, onError?: (issue: ReadAloudIssue) => void): ReadAloudStart;
|
|
7
20
|
/**
|
|
8
21
|
* Starts reading `text` with the browser's voice, or stops when it is already reading. Returns
|
|
9
22
|
* whether speech is now playing. `onChange` fires when it ends by itself.
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import type { EditorCore } from './editor-core.js';
|
|
2
|
+
import type { ReadAloudOptions } from './read-aloud-session.js';
|
|
2
3
|
import type { RibbonActionId } from 'ooxml-core/docx/ui';
|
|
3
4
|
import { type ResolvedWordCustomization, type WordCustomization } from './customization.js';
|
|
4
5
|
/** Host-controlled UI customisation; each value maps to one element property and attribute. */
|
|
5
6
|
export declare class ViewOptions {
|
|
6
7
|
showThumbnails: boolean;
|
|
7
8
|
showToolbar: boolean;
|
|
9
|
+
/** The host's Read Aloud options (`readAloud`); none keeps the defaults. */
|
|
10
|
+
readAloud: ReadAloudOptions | null;
|
|
8
11
|
hiddenActions: readonly RibbonActionId[];
|
|
9
12
|
/** The host's `customization` object, as given. */
|
|
10
13
|
customizationInput: WordCustomization | null;
|