ooxml-core 1.23.0 → 1.24.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/automation/index.cjs +553 -335
- package/dist/automation/index.d.ts +1 -0
- package/dist/automation/index.d.ts.map +1 -1
- package/dist/automation/index.mjs +552 -336
- package/dist/automation/live.d.ts +89 -0
- package/dist/automation/live.d.ts.map +1 -0
- package/dist/docx/ui/customization.d.ts +30 -0
- package/dist/docx/ui/customization.d.ts.map +1 -0
- package/dist/docx/ui/index.cjs +51 -0
- package/dist/docx/ui/index.d.ts +1 -0
- package/dist/docx/ui/index.d.ts.map +1 -1
- package/dist/docx/ui/index.mjs +46 -1
- package/dist/embedding/backstage.d.ts +48 -0
- package/dist/embedding/backstage.d.ts.map +1 -0
- package/dist/embedding/capabilities.d.ts +60 -0
- package/dist/embedding/capabilities.d.ts.map +1 -0
- package/dist/embedding/customization.d.ts +32 -0
- package/dist/embedding/customization.d.ts.map +1 -0
- package/dist/embedding/index.cjs +229 -0
- package/dist/embedding/index.d.ts +7 -0
- package/dist/embedding/index.d.ts.map +1 -0
- package/dist/embedding/index.mjs +204 -0
- package/dist/embedding/menu-commands.d.ts +66 -0
- package/dist/embedding/menu-commands.d.ts.map +1 -0
- package/dist/embedding/regions.d.ts +58 -0
- package/dist/embedding/regions.d.ts.map +1 -0
- package/dist/embedding/storage.d.ts +111 -0
- package/dist/embedding/storage.d.ts.map +1 -0
- package/dist/index.cjs +233 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +233 -1
- package/dist/visio/collab/compose.d.ts.map +1 -1
- package/dist/visio/collab/fixups.d.ts.map +1 -1
- package/dist/visio/collab/index.cjs +167 -62
- package/dist/visio/collab/index.mjs +167 -62
- package/dist/visio/collab/keys.d.ts +2 -0
- package/dist/visio/collab/keys.d.ts.map +1 -1
- package/dist/visio/collab/pieces.d.ts +7 -0
- package/dist/visio/collab/pieces.d.ts.map +1 -1
- package/dist/visio/collab/read-ids.d.ts +7 -1
- package/dist/visio/collab/read-ids.d.ts.map +1 -1
- package/dist/visio/collab/read-parts.d.ts.map +1 -1
- package/dist/visio/collab/read-shapes.d.ts +0 -1
- package/dist/visio/collab/read-shapes.d.ts.map +1 -1
- package/dist/visio/collab/read.d.ts.map +1 -1
- package/dist/visio/collab/schema.d.ts +1 -1
- package/dist/visio/collab/schema.d.ts.map +1 -1
- package/dist/visio/collab/snapshot-contents.d.ts.map +1 -1
- package/dist/visio/collab/write-shapes.d.ts.map +1 -1
- package/dist/visio/collab/zip-store.d.ts +4 -0
- package/dist/visio/collab/zip-store.d.ts.map +1 -0
- package/dist/visio/document-level.d.ts +57 -0
- package/dist/visio/document-level.d.ts.map +1 -0
- package/dist/visio/index.cjs +543 -444
- package/dist/visio/index.d.ts +1 -0
- package/dist/visio/index.d.ts.map +1 -1
- package/dist/visio/index.mjs +543 -444
- package/dist/visio/layers.d.ts +3 -0
- package/dist/visio/layers.d.ts.map +1 -1
- package/dist/visio/package.d.ts +9 -0
- package/dist/visio/package.d.ts.map +1 -1
- package/dist/visio/parser.d.ts +7 -0
- package/dist/visio/parser.d.ts.map +1 -1
- package/dist/visio/shape-metadata.d.ts +3 -0
- package/dist/visio/shape-metadata.d.ts.map +1 -1
- package/dist/visio/ui/contract.d.ts +27 -2
- package/dist/visio/ui/contract.d.ts.map +1 -1
- package/dist/visio/ui/customization.d.ts +46 -0
- package/dist/visio/ui/customization.d.ts.map +1 -0
- package/dist/visio/ui/index.cjs +454 -316
- package/dist/visio/ui/index.d.ts +1 -0
- package/dist/visio/ui/index.d.ts.map +1 -1
- package/dist/visio/ui/index.mjs +452 -317
- package/dist/xlsx/ui/commands.d.ts +2 -0
- package/dist/xlsx/ui/commands.d.ts.map +1 -1
- package/dist/xlsx/ui/customization.d.ts +49 -0
- package/dist/xlsx/ui/customization.d.ts.map +1 -0
- package/dist/xlsx/ui/index.cjs +39 -1
- package/dist/xlsx/ui/index.d.ts +1 -0
- package/dist/xlsx/ui/index.d.ts.map +1 -1
- package/dist/xlsx/ui/index.mjs +37 -2
- package/package.json +6 -1
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import type { AutomationFormat, AutomationTool } from './tools/types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Runs the headless document tools against editors that are open on screen. A host's own
|
|
4
|
+
* assistant (or the suite's) registers each mounted editor under an id it chooses, and every call
|
|
5
|
+
* names the document it acts on: there is no "current document", so a chat that spans several
|
|
6
|
+
* tabs can never edit the wrong one. The tools are the same definitions the MCP servers use;
|
|
7
|
+
* this only adds the snapshot and load-back around them.
|
|
8
|
+
*/
|
|
9
|
+
/** What a mounted editor must offer. The editor elements fit it through `liveEditorFromElement`. */
|
|
10
|
+
export interface LiveEditor {
|
|
11
|
+
readonly format: AutomationFormat;
|
|
12
|
+
/** The open document as a file, including unsaved edits. */
|
|
13
|
+
save(): Promise<Uint8Array> | Uint8Array;
|
|
14
|
+
/** Replaces the open document with `bytes`. */
|
|
15
|
+
load(bytes: Uint8Array): Promise<void> | void;
|
|
16
|
+
/** True while the editor refuses edits (a read-only role, a locked document). */
|
|
17
|
+
readonly readOnly?: boolean;
|
|
18
|
+
}
|
|
19
|
+
/** A tool call: the target document, then the tool's own parameters. */
|
|
20
|
+
export interface LiveToolCall {
|
|
21
|
+
/** The id the editor was registered under. Required: there is no default document. */
|
|
22
|
+
target: string;
|
|
23
|
+
params?: unknown;
|
|
24
|
+
}
|
|
25
|
+
export interface LiveToolResult {
|
|
26
|
+
target: string;
|
|
27
|
+
tool: string;
|
|
28
|
+
/** What the tool returned: a read's view, an edit's report. */
|
|
29
|
+
result: unknown;
|
|
30
|
+
/** True when an edit changed the open document. */
|
|
31
|
+
changed: boolean;
|
|
32
|
+
}
|
|
33
|
+
/** What an edit is about to do, for a host that wants to confirm it first. */
|
|
34
|
+
export interface LiveEditProposal {
|
|
35
|
+
target: string;
|
|
36
|
+
tool: string;
|
|
37
|
+
params: unknown;
|
|
38
|
+
/** The tool's report for the edit (warnings, results). */
|
|
39
|
+
result: unknown;
|
|
40
|
+
/** The file before and after, for a diff. */
|
|
41
|
+
before: Uint8Array;
|
|
42
|
+
after: Uint8Array;
|
|
43
|
+
}
|
|
44
|
+
export interface LiveToolHostOptions {
|
|
45
|
+
/**
|
|
46
|
+
* Called with each edit before it reaches the editor. Return false to discard it. Leave it out
|
|
47
|
+
* to apply edits straight away.
|
|
48
|
+
*/
|
|
49
|
+
review?(proposal: LiveEditProposal): boolean | Promise<boolean>;
|
|
50
|
+
}
|
|
51
|
+
export interface LiveToolDescriptor {
|
|
52
|
+
name: string;
|
|
53
|
+
description: string;
|
|
54
|
+
kind: 'read' | 'edit';
|
|
55
|
+
format: AutomationFormat;
|
|
56
|
+
/** JSON Schema of the parameters, with the required `target` added. */
|
|
57
|
+
inputSchema: Record<string, unknown>;
|
|
58
|
+
}
|
|
59
|
+
export interface LiveToolHost {
|
|
60
|
+
/** Registers an editor under `id`. Returns a function that removes it. */
|
|
61
|
+
register(id: string, editor: LiveEditor): () => void;
|
|
62
|
+
/** The registered documents, so an assistant can offer them to the model. */
|
|
63
|
+
targets(): {
|
|
64
|
+
id: string;
|
|
65
|
+
format: AutomationFormat;
|
|
66
|
+
readOnly: boolean;
|
|
67
|
+
}[];
|
|
68
|
+
/** The read and edit tools that apply to the registered documents, as function-calling specs. */
|
|
69
|
+
describe(): LiveToolDescriptor[];
|
|
70
|
+
call(name: string, call: LiveToolCall): Promise<LiveToolResult>;
|
|
71
|
+
}
|
|
72
|
+
/** `tools` is the catalogue to serve: `automationTools.docx`, `pptxTools` and so on, in any mix. */
|
|
73
|
+
export declare function createLiveToolHost(tools: readonly AutomationTool[], options?: LiveToolHostOptions): LiveToolHost;
|
|
74
|
+
/** The members of an editor element that `liveEditorFromElement` uses. */
|
|
75
|
+
export interface LiveEditorElement {
|
|
76
|
+
saveBytes?(): Promise<Uint8Array> | Uint8Array;
|
|
77
|
+
exportVsdx?(): Promise<{
|
|
78
|
+
bytes: Uint8Array;
|
|
79
|
+
}>;
|
|
80
|
+
load(bytes: Uint8Array, name?: string): Promise<unknown> | unknown;
|
|
81
|
+
commitEdit?(): boolean;
|
|
82
|
+
readOnly?: boolean;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Adapts a mounted editor element (`<docx-editor>`, `<xlsx-editor>`, `<pptx-editor>`,
|
|
86
|
+
* `<visio-editor>`) so it can be registered with a host. `name` is the file name the editor shows.
|
|
87
|
+
*/
|
|
88
|
+
export declare function liveEditorFromElement(format: AutomationFormat, element: LiveEditorElement, name?: string): LiveEditor;
|
|
89
|
+
//# sourceMappingURL=live.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"live.d.ts","sourceRoot":"","sources":["../../automation/live.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEtE;;;;;;GAMG;AAEH,oGAAoG;AACpG,MAAM,WAAW,UAAU;IAC1B,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC;IAClC,4DAA4D;IAC5D,IAAI,IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,UAAU,CAAC;IACzC,+CAA+C;IAC/C,IAAI,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAC9C,iFAAiF;IACjF,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,wEAAwE;AACxE,MAAM,WAAW,YAAY;IAC5B,sFAAsF;IACtF,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,cAAc;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,+DAA+D;IAC/D,MAAM,EAAE,OAAO,CAAC;IAChB,mDAAmD;IACnD,OAAO,EAAE,OAAO,CAAC;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jC,SAAS,CAAC,IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,UAAU,CAAC;IAC/C,UAAU,CAAC,IAAI,OAAO,CAAC;QAAE,KAAK,EAAE,UAAU,CAAA;KAAE,CAAC,CAAC;IAC9C,IAAI,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;IACnE,UAAU,CAAC,IAAI,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CACpC,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,iBAAiB,EAC1B,IAAI,CAAC,EAAE,MAAM,GACX,UAAU,CAiBZ"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Word's half of the shared customization contract (`ooxml-core/embedding`): the capabilities
|
|
3
|
+
* `<docx-editor>` honours and what each one removes. DOM-free, so a host or a binding can read
|
|
4
|
+
* it without loading the editor.
|
|
5
|
+
*/
|
|
6
|
+
import type { CapabilityActionMap, EditorCapabilities, EditorCapabilityId } from '../../embedding/index.js';
|
|
7
|
+
import type { RibbonActionId } from './ribbon-action-ids.js';
|
|
8
|
+
/** The capabilities Word honours. */
|
|
9
|
+
export type WordCapabilityId = Extract<EditorCapabilityId, 'edit' | 'export' | 'print' | 'share' | 'copy' | 'comment' | 'review' | 'find' | 'open' | 'save' | 'settings'>;
|
|
10
|
+
/** Every Word capability, for hosts that build a policy screen. */
|
|
11
|
+
export declare const WORD_CAPABILITY_IDS: readonly ["edit", "export", "print", "share", "copy", "comment", "review", "find", "open", "save", "settings"];
|
|
12
|
+
/** Per-capability switches of `<docx-editor>`. */
|
|
13
|
+
export type WordCapabilities = EditorCapabilities<WordCapabilityId>;
|
|
14
|
+
/** The ribbon controls (`hiddenActions` ids) each disabled capability removes. */
|
|
15
|
+
export declare const WORD_CAPABILITY_ACTIONS: CapabilityActionMap<WordCapabilityId, RibbonActionId>;
|
|
16
|
+
/** A File command (title bar, File tab, shortcut) that a capability can remove. */
|
|
17
|
+
export type WordFileCommandId = 'new' | 'open' | 'save' | 'saveAs' | 'export' | 'exportText' | 'print' | 'share';
|
|
18
|
+
/** The File commands each disabled capability removes (and refuses to run). */
|
|
19
|
+
export declare const WORD_CAPABILITY_FILE_COMMANDS: CapabilityActionMap<WordCapabilityId, WordFileCommandId>;
|
|
20
|
+
/** A File tab navigation entry a capability can remove. */
|
|
21
|
+
export type WordBackstagePageId = 'new' | 'open' | 'save' | 'saveAs' | 'print' | 'export' | 'options';
|
|
22
|
+
/** The File tab entries each disabled capability removes. */
|
|
23
|
+
export declare const WORD_CAPABILITY_BACKSTAGE_PAGES: CapabilityActionMap<WordCapabilityId, WordBackstagePageId>;
|
|
24
|
+
/** A built-in keyboard shortcut a capability can turn off. */
|
|
25
|
+
export type WordShortcutId = 'find' | 'replace' | 'save' | 'print';
|
|
26
|
+
/** The shortcuts each disabled capability turns off. */
|
|
27
|
+
export declare const WORD_CAPABILITY_SHORTCUTS: CapabilityActionMap<WordCapabilityId, WordShortcutId>;
|
|
28
|
+
/** The built-in context-menu entries each disabled capability removes. */
|
|
29
|
+
export declare const WORD_CAPABILITY_MENU_ITEMS: CapabilityActionMap<WordCapabilityId, string>;
|
|
30
|
+
//# sourceMappingURL=customization.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customization.d.ts","sourceRoot":"","sources":["../../../docx/ui/customization.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EACX,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,qCAAqC;AACrC,MAAM,MAAM,gBAAgB,GAAG,OAAO,CACrC,kBAAkB,EAChB,MAAM,GACN,QAAQ,GACR,OAAO,GACP,OAAO,GACP,MAAM,GACN,SAAS,GACT,QAAQ,GACR,MAAM,GACN,MAAM,GACN,MAAM,GACN,UAAU,CACZ,CAAC;AAEF,mEAAmE;AACnE,eAAO,MAAM,mBAAmB,gHAYgB,CAAC;AAEjD,kDAAkD;AAClD,MAAM,MAAM,gBAAgB,GAAG,kBAAkB,CAAC,gBAAgB,CAAC,CAAC;AAEpE,kFAAkF;AAClF,eAAO,MAAM,uBAAuB,EAAE,mBAAmB,CAAC,gBAAgB,EAAE,cAAc,CAMzF,CAAC;AAEF,mFAAmF;AACnF,MAAM,MAAM,iBAAiB,GAC1B,KAAK,GACL,MAAM,GACN,MAAM,GACN,QAAQ,GACR,QAAQ,GACR,YAAY,GACZ,OAAO,GACP,OAAO,CAAC;AAEX,+EAA+E;AAC/E,eAAO,MAAM,6BAA6B,EAAE,mBAAmB,CAC9D,gBAAgB,EAChB,iBAAiB,CAOjB,CAAC;AAEF,2DAA2D;AAC3D,MAAM,MAAM,mBAAmB,GAC5B,KAAK,GACL,MAAM,GACN,MAAM,GACN,QAAQ,GACR,OAAO,GACP,QAAQ,GACR,SAAS,CAAC;AAEb,6DAA6D;AAC7D,eAAO,MAAM,+BAA+B,EAAE,mBAAmB,CAChE,gBAAgB,EAChB,mBAAmB,CAOnB,CAAC;AAEF,8DAA8D;AAC9D,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;AAEnE,wDAAwD;AACxD,eAAO,MAAM,yBAAyB,EAAE,mBAAmB,CAAC,gBAAgB,EAAE,cAAc,CAI3F,CAAC;AAEF,0EAA0E;AAC1E,eAAO,MAAM,0BAA0B,EAAE,mBAAmB,CAAC,gBAAgB,EAAE,MAAM,CAGpF,CAAC"}
|
package/dist/docx/ui/index.cjs
CHANGED
|
@@ -15259,6 +15259,51 @@ function createToggleFormat(schema, getModel = () => void 0) {
|
|
|
15259
15259
|
};
|
|
15260
15260
|
}
|
|
15261
15261
|
|
|
15262
|
+
// docx/ui/customization.ts
|
|
15263
|
+
var WORD_CAPABILITY_IDS = [
|
|
15264
|
+
"edit",
|
|
15265
|
+
"export",
|
|
15266
|
+
"print",
|
|
15267
|
+
"share",
|
|
15268
|
+
"copy",
|
|
15269
|
+
"comment",
|
|
15270
|
+
"review",
|
|
15271
|
+
"find",
|
|
15272
|
+
"open",
|
|
15273
|
+
"save",
|
|
15274
|
+
"settings"
|
|
15275
|
+
];
|
|
15276
|
+
var WORD_CAPABILITY_ACTIONS = {
|
|
15277
|
+
print: ["print"],
|
|
15278
|
+
copy: ["cut", "copy"],
|
|
15279
|
+
comment: ["add-comment", "delete-comment", "previous-comment", "next-comment", "comments"],
|
|
15280
|
+
review: ["track-changes", "tracking-options", "accept", "reject", "accept-all", "reject-all"],
|
|
15281
|
+
find: ["find-and-replace", "replace", "find-options"]
|
|
15282
|
+
};
|
|
15283
|
+
var WORD_CAPABILITY_FILE_COMMANDS = {
|
|
15284
|
+
open: ["new", "open"],
|
|
15285
|
+
save: ["save"],
|
|
15286
|
+
export: ["saveAs", "export", "exportText"],
|
|
15287
|
+
print: ["print"],
|
|
15288
|
+
share: ["share"]
|
|
15289
|
+
};
|
|
15290
|
+
var WORD_CAPABILITY_BACKSTAGE_PAGES = {
|
|
15291
|
+
open: ["new", "open"],
|
|
15292
|
+
save: ["save"],
|
|
15293
|
+
export: ["saveAs", "export"],
|
|
15294
|
+
print: ["print"],
|
|
15295
|
+
settings: ["options"]
|
|
15296
|
+
};
|
|
15297
|
+
var WORD_CAPABILITY_SHORTCUTS = {
|
|
15298
|
+
find: ["find", "replace"],
|
|
15299
|
+
save: ["save"],
|
|
15300
|
+
print: ["print"]
|
|
15301
|
+
};
|
|
15302
|
+
var WORD_CAPABILITY_MENU_ITEMS = {
|
|
15303
|
+
copy: ["cut", "copy"],
|
|
15304
|
+
comment: ["comment-add"]
|
|
15305
|
+
};
|
|
15306
|
+
|
|
15262
15307
|
// docx/ui/ribbon-action-ids.ts
|
|
15263
15308
|
var RIBBON_ACTION_IDS = [
|
|
15264
15309
|
"paste",
|
|
@@ -16514,6 +16559,12 @@ exports.RIBBON_ACTION_IDS = RIBBON_ACTION_IDS;
|
|
|
16514
16559
|
exports.RIBBON_ACTION_LABELS = RIBBON_ACTION_LABELS;
|
|
16515
16560
|
exports.SectionPartsStep = SectionPartsStep;
|
|
16516
16561
|
exports.THEME_KEYS = THEME_KEYS;
|
|
16562
|
+
exports.WORD_CAPABILITY_ACTIONS = WORD_CAPABILITY_ACTIONS;
|
|
16563
|
+
exports.WORD_CAPABILITY_BACKSTAGE_PAGES = WORD_CAPABILITY_BACKSTAGE_PAGES;
|
|
16564
|
+
exports.WORD_CAPABILITY_FILE_COMMANDS = WORD_CAPABILITY_FILE_COMMANDS;
|
|
16565
|
+
exports.WORD_CAPABILITY_IDS = WORD_CAPABILITY_IDS;
|
|
16566
|
+
exports.WORD_CAPABILITY_MENU_ITEMS = WORD_CAPABILITY_MENU_ITEMS;
|
|
16567
|
+
exports.WORD_CAPABILITY_SHORTCUTS = WORD_CAPABILITY_SHORTCUTS;
|
|
16517
16568
|
exports.WordYjsCollaboration = WordYjsCollaboration;
|
|
16518
16569
|
exports.WordYjsComments = WordYjsComments;
|
|
16519
16570
|
exports.WordYjsMedia = WordYjsMedia;
|
package/dist/docx/ui/index.d.ts
CHANGED
|
@@ -35,6 +35,7 @@ export { formattingRevision } from './review-formatting.js';
|
|
|
35
35
|
export { paragraphFormattingRevision } from './review-paragraph-formatting.js';
|
|
36
36
|
export * from './track-changes-mode.js';
|
|
37
37
|
export * from './toggle-format.js';
|
|
38
|
+
export * from './customization.js';
|
|
38
39
|
export * from './ribbon-action-ids.js';
|
|
39
40
|
export * from './ribbon-colors.js';
|
|
40
41
|
export * from './ribbon-legacy-labels.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../docx/ui/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,c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
|
};
|
|
15238
15238
|
}
|
|
15239
15239
|
|
|
15240
|
+
// docx/ui/customization.ts
|
|
15241
|
+
var WORD_CAPABILITY_IDS = [
|
|
15242
|
+
"edit",
|
|
15243
|
+
"export",
|
|
15244
|
+
"print",
|
|
15245
|
+
"share",
|
|
15246
|
+
"copy",
|
|
15247
|
+
"comment",
|
|
15248
|
+
"review",
|
|
15249
|
+
"find",
|
|
15250
|
+
"open",
|
|
15251
|
+
"save",
|
|
15252
|
+
"settings"
|
|
15253
|
+
];
|
|
15254
|
+
var WORD_CAPABILITY_ACTIONS = {
|
|
15255
|
+
print: ["print"],
|
|
15256
|
+
copy: ["cut", "copy"],
|
|
15257
|
+
comment: ["add-comment", "delete-comment", "previous-comment", "next-comment", "comments"],
|
|
15258
|
+
review: ["track-changes", "tracking-options", "accept", "reject", "accept-all", "reject-all"],
|
|
15259
|
+
find: ["find-and-replace", "replace", "find-options"]
|
|
15260
|
+
};
|
|
15261
|
+
var WORD_CAPABILITY_FILE_COMMANDS = {
|
|
15262
|
+
open: ["new", "open"],
|
|
15263
|
+
save: ["save"],
|
|
15264
|
+
export: ["saveAs", "export", "exportText"],
|
|
15265
|
+
print: ["print"],
|
|
15266
|
+
share: ["share"]
|
|
15267
|
+
};
|
|
15268
|
+
var WORD_CAPABILITY_BACKSTAGE_PAGES = {
|
|
15269
|
+
open: ["new", "open"],
|
|
15270
|
+
save: ["save"],
|
|
15271
|
+
export: ["saveAs", "export"],
|
|
15272
|
+
print: ["print"],
|
|
15273
|
+
settings: ["options"]
|
|
15274
|
+
};
|
|
15275
|
+
var WORD_CAPABILITY_SHORTCUTS = {
|
|
15276
|
+
find: ["find", "replace"],
|
|
15277
|
+
save: ["save"],
|
|
15278
|
+
print: ["print"]
|
|
15279
|
+
};
|
|
15280
|
+
var WORD_CAPABILITY_MENU_ITEMS = {
|
|
15281
|
+
copy: ["cut", "copy"],
|
|
15282
|
+
comment: ["comment-add"]
|
|
15283
|
+
};
|
|
15284
|
+
|
|
15240
15285
|
// docx/ui/ribbon-action-ids.ts
|
|
15241
15286
|
var RIBBON_ACTION_IDS = [
|
|
15242
15287
|
"paste",
|
|
@@ -16476,4 +16521,4 @@ function formFieldGuardPlugin(protection) {
|
|
|
16476
16521
|
});
|
|
16477
16522
|
}
|
|
16478
16523
|
|
|
16479
|
-
export { CONTROL_EDIT_META, CollaborationAuthority, CollaborationClient, DirtyState, EDITOR_THEME_MODES, FIELD_RESULT_REPAIR_META, FORM_FIELD_EDIT_META, HEADER_FOOTER_INPUT, NotePartsStep, PAGE_GAP, PARAGRAPH_KEEP_KEYS, REMOTE_TRANSACTION_META, RIBBON_ACTION_IDS, RIBBON_ACTION_LABELS, SectionPartsStep, THEME_KEYS, WordYjsCollaboration, WordYjsComments, WordYjsMedia, acceptAllChanges, acceptChangeAtCursor, acceptRevisionRange, addComment, appendInlineNode, applyMarkFormatting, applyRunFormattingPatch, applyThemeColors, applyWordLink, authorColor, backstageFocus, chartNodeSpec, chooseDate, chooseListItem, clearDirectRunFormatting, collectRevisionRanges, commentAnchors, commentHistoryAttributes, commentIdsAtSelection, commentIdsFromMarks, commentIdsFromNode, commentThreadsFromDoc, contentControlPlugin, controlAt, controlAtSelection, controlFromData, controlFromValue, controlOfMark, controlSpans, countWords, createCollaborationIdGenerator, createToggleFormat, cssBorderSide, darkTheme, deleteAroundMarkers, deleteComment, deleteFieldSelection, deleteToPlaceholder, dispatchIsolatedCommand, documentWordCount, emptySimpleFieldResult, everyControlSpan, exceedsFormTextLength, expectDefined, explicitOffFields, extraRunFields, extraRunProperties, fieldGuardPlugin, fieldMarkerNodeSpec, fieldResultRanges, fieldsBalanced, fitZoomPercent, formFieldBeside, formFieldGuardPlugin, formFieldLocked, formFieldNodeDisplay, formFieldOfNode, formTextResults, formattingRevision, freezeBatch, goToComment, goToNextChange, goToPreviousChange, hardBreakNodeSpec, hasAnyChange, hasChangeAtCursor, hasNoteRevisions, imageNodeSpec, inlineNodeRun, insertContentControl, insertWordHardBreak, insertedTextMarks, isFormsProtected, isNavigableHref, isRibbonActionId, isWordYjsRemoteTransaction, ligatureCss, ligatureStyle, lightTheme, linkFromMarks, linkMarkSpec, markSpecs, marksForRun, moveName, newControlId, nodeChart, nodeNumbering, normalizeRibbonActions, normalizeThemeMode, notePartsJson, noteReferenceNodeSpec, operatesFormField, pageBreakNodeSpec, paragraphAttrs, paragraphBoxCss, paragraphFormattingRevision, paragraphFromAttrs, parseBatch, parseBordersJson, pasteInCell, placementClass, positionalTabInputPlugin, refreshWordYjsPresence, rejectAllChanges, rejectChangeAtCursor, rejectRevisionRange, removeCommentAnchor, removeCommentThread, removeWordLink, repairCollaborativeDocumentIds, repairCollaborativeParagraphIds, replaceAroundMarkers, replaceControlContent, replyToComment, resolveCellVisuals, resolveComment, resolveNoteRevisions, restoreNoteParts, restoreSectionParts, reviewMarks, ribbonActionIdForLabel, runPropertiesMark, runToInlineNodes, sameJson2 as sameJson, sameRuns, sectionPartsJson, selectFormDropDownAt, setCommentThreads, setReviewRecordingPreferences, staysInFormFields, svgMarkupSpec, swatchColor, symbolFontPlugin, tableCellStyle, tableControlSpans, tableStructureGuardPlugin, tableStyle, themeDrawing, themeToCssVars, toggleCheckboxControl, toggleFormCheckboxAt, toggleTrackChanges, toggleTrackFormatting, toggleTrackMoves, trackChangesPlugin, trackChangesPluginKey, typeOverPlaceholder, updateCommentThreads, updateControlProperties, violatesControlLock, wordHighlightColors, wordLinkRangeAt, wordYjsPluginKey, wordYjsPresencePlugin, wordYjsRedo, wordYjsUndo };
|
|
16524
|
+
export { CONTROL_EDIT_META, CollaborationAuthority, CollaborationClient, DirtyState, EDITOR_THEME_MODES, FIELD_RESULT_REPAIR_META, FORM_FIELD_EDIT_META, HEADER_FOOTER_INPUT, NotePartsStep, PAGE_GAP, PARAGRAPH_KEEP_KEYS, REMOTE_TRANSACTION_META, RIBBON_ACTION_IDS, RIBBON_ACTION_LABELS, SectionPartsStep, THEME_KEYS, WORD_CAPABILITY_ACTIONS, WORD_CAPABILITY_BACKSTAGE_PAGES, WORD_CAPABILITY_FILE_COMMANDS, WORD_CAPABILITY_IDS, WORD_CAPABILITY_MENU_ITEMS, WORD_CAPABILITY_SHORTCUTS, WordYjsCollaboration, WordYjsComments, WordYjsMedia, acceptAllChanges, acceptChangeAtCursor, acceptRevisionRange, addComment, appendInlineNode, applyMarkFormatting, applyRunFormattingPatch, applyThemeColors, applyWordLink, authorColor, backstageFocus, chartNodeSpec, chooseDate, chooseListItem, clearDirectRunFormatting, collectRevisionRanges, commentAnchors, commentHistoryAttributes, commentIdsAtSelection, commentIdsFromMarks, commentIdsFromNode, commentThreadsFromDoc, contentControlPlugin, controlAt, controlAtSelection, controlFromData, controlFromValue, controlOfMark, controlSpans, countWords, createCollaborationIdGenerator, createToggleFormat, cssBorderSide, darkTheme, deleteAroundMarkers, deleteComment, deleteFieldSelection, deleteToPlaceholder, dispatchIsolatedCommand, documentWordCount, emptySimpleFieldResult, everyControlSpan, exceedsFormTextLength, expectDefined, explicitOffFields, extraRunFields, extraRunProperties, fieldGuardPlugin, fieldMarkerNodeSpec, fieldResultRanges, fieldsBalanced, fitZoomPercent, formFieldBeside, formFieldGuardPlugin, formFieldLocked, formFieldNodeDisplay, formFieldOfNode, formTextResults, formattingRevision, freezeBatch, goToComment, goToNextChange, goToPreviousChange, hardBreakNodeSpec, hasAnyChange, hasChangeAtCursor, hasNoteRevisions, imageNodeSpec, inlineNodeRun, insertContentControl, insertWordHardBreak, insertedTextMarks, isFormsProtected, isNavigableHref, isRibbonActionId, isWordYjsRemoteTransaction, ligatureCss, ligatureStyle, lightTheme, linkFromMarks, linkMarkSpec, markSpecs, marksForRun, moveName, newControlId, nodeChart, nodeNumbering, normalizeRibbonActions, normalizeThemeMode, notePartsJson, noteReferenceNodeSpec, operatesFormField, pageBreakNodeSpec, paragraphAttrs, paragraphBoxCss, paragraphFormattingRevision, paragraphFromAttrs, parseBatch, parseBordersJson, pasteInCell, placementClass, positionalTabInputPlugin, refreshWordYjsPresence, rejectAllChanges, rejectChangeAtCursor, rejectRevisionRange, removeCommentAnchor, removeCommentThread, removeWordLink, repairCollaborativeDocumentIds, repairCollaborativeParagraphIds, replaceAroundMarkers, replaceControlContent, replyToComment, resolveCellVisuals, resolveComment, resolveNoteRevisions, restoreNoteParts, restoreSectionParts, reviewMarks, ribbonActionIdForLabel, runPropertiesMark, runToInlineNodes, sameJson2 as sameJson, sameRuns, sectionPartsJson, selectFormDropDownAt, setCommentThreads, setReviewRecordingPreferences, staysInFormFields, svgMarkupSpec, swatchColor, symbolFontPlugin, tableCellStyle, tableControlSpans, tableStructureGuardPlugin, tableStyle, themeDrawing, themeToCssVars, toggleCheckboxControl, toggleFormCheckboxAt, toggleTrackChanges, toggleTrackFormatting, toggleTrackMoves, trackChangesPlugin, trackChangesPluginKey, typeOverPlaceholder, updateCommentThreads, updateControlProperties, violatesControlLock, wordHighlightColors, wordLinkRangeAt, wordYjsPluginKey, wordYjsPresencePlugin, wordYjsRedo, wordYjsUndo };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Host File tab (Backstage) pages: pages a host adds to an editor's File tab, after the
|
|
3
|
+
* built-in pages of their group. The page body is a host region (`backstage.host.<id>`), so it
|
|
4
|
+
* takes any renderer form of `HostRegionRenderer`; the navigation entry is plain data.
|
|
5
|
+
*/
|
|
6
|
+
/** Where a page's navigation entry sits: with the main pages, or next to Account and Options. */
|
|
7
|
+
export type HostBackstageGroup = 'main' | 'footer';
|
|
8
|
+
/**
|
|
9
|
+
* One host page of the File tab. `Renderer` is the product's region renderer type (a mount
|
|
10
|
+
* function over an `HTMLElement`, or a custom element), bound by each product.
|
|
11
|
+
*/
|
|
12
|
+
export interface HostBackstagePage<Renderer = unknown> {
|
|
13
|
+
/** Unique among host pages; the region id is `backstage.host.<id>`. A repeat is ignored. */
|
|
14
|
+
id: string;
|
|
15
|
+
/** The navigation label. The host localises it; the editor shows it as given. */
|
|
16
|
+
label: string;
|
|
17
|
+
/** `footer` places it next to Account and Options; default `main`. */
|
|
18
|
+
group?: HostBackstageGroup;
|
|
19
|
+
/**
|
|
20
|
+
* Sort key among the host pages of the same group (ascending, default 0). Host pages always
|
|
21
|
+
* come after the built-in pages of their group; equal keys keep the order they were given.
|
|
22
|
+
*/
|
|
23
|
+
order?: number;
|
|
24
|
+
/** The page body. */
|
|
25
|
+
render: Renderer;
|
|
26
|
+
}
|
|
27
|
+
/** The nav id of host page `id`, kept apart from every built-in page id. */
|
|
28
|
+
export declare function hostBackstageItemId(id: string): `host.${string}`;
|
|
29
|
+
/** The host page id of a nav id made by `hostBackstageItemId`, or undefined for a built-in. */
|
|
30
|
+
export declare function hostBackstagePageId(itemId: string): string | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* The host pages an editor shows, in display order: pages with an empty or repeated id are left
|
|
33
|
+
* out (the first one wins), then the rest sort by `order` (stable, so equal keys keep the host's
|
|
34
|
+
* order).
|
|
35
|
+
*/
|
|
36
|
+
export declare function acceptedHostBackstagePages<P extends HostBackstagePage<unknown>>(pages: readonly P[] | null | undefined): P[];
|
|
37
|
+
/** A nav entry with an optional group: what `placeHostBackstagePages` interleaves. */
|
|
38
|
+
export interface BackstageNavSlot {
|
|
39
|
+
id: string;
|
|
40
|
+
group?: HostBackstageGroup | undefined;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* The File tab navigation with host pages placed: each host entry goes after the last built-in
|
|
44
|
+
* entry of its group (at the end when its group has none). `toEntry` makes the product's nav
|
|
45
|
+
* entry for a page; `items` is not changed.
|
|
46
|
+
*/
|
|
47
|
+
export declare function placeHostBackstagePages<T extends BackstageNavSlot, P extends HostBackstagePage<unknown>>(items: readonly T[], pages: readonly P[] | null | undefined, toEntry: (page: P) => T): T[];
|
|
48
|
+
//# sourceMappingURL=backstage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backstage.d.ts","sourceRoot":"","sources":["../../embedding/backstage.ts"],"names":[],"mappings":"A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an embedded editor, one switch per capability.
|
|
3
|
+
*
|
|
4
|
+
* Each product supports a subset of the shared ids below (and may add its own, such as
|
|
5
|
+
* PowerPoint's `present`), so a product's capability type is a narrow union and a host that
|
|
6
|
+
* names an id the product does not honour gets a compile error rather than a silent no-op.
|
|
7
|
+
* `false` removes every UI path to the capability (ribbon controls, Backstage pages, menu
|
|
8
|
+
* entries, shortcuts); `true` or an omitted key leaves the editor's own rules in charge.
|
|
9
|
+
*
|
|
10
|
+
* Capabilities are UI policy, not document protection: a host that must prevent copying or
|
|
11
|
+
* export should not hand the bytes to the browser.
|
|
12
|
+
*/
|
|
13
|
+
/** Capability ids every editor understands the same way. A product honours a subset. */
|
|
14
|
+
export declare const EDITOR_CAPABILITY_IDS: readonly [
|
|
15
|
+
/** Changing the document. `false` opens it read-only, whatever the edit prop says. */
|
|
16
|
+
'edit',
|
|
17
|
+
/** Saving a copy in another format (File > Export, Save As, Download). */
|
|
18
|
+
'export',
|
|
19
|
+
/** Printing (File > Print, the Print commands and Ctrl+P). */
|
|
20
|
+
'print',
|
|
21
|
+
/** Sharing the document with other people (File > Share, Share buttons). */
|
|
22
|
+
'share',
|
|
23
|
+
/** Copying content out (Copy, Cut and their shortcuts). */
|
|
24
|
+
'copy',
|
|
25
|
+
/** Adding and editing comments. */
|
|
26
|
+
'comment',
|
|
27
|
+
/** Tracked changes: turning tracking on, accepting and rejecting. */
|
|
28
|
+
'review',
|
|
29
|
+
/** Find and Replace. */
|
|
30
|
+
'find',
|
|
31
|
+
/** File > New and File > Open. */
|
|
32
|
+
'open',
|
|
33
|
+
/** File > Save. */
|
|
34
|
+
'save',
|
|
35
|
+
/** File > Options and Customize Ribbon. */
|
|
36
|
+
'settings'];
|
|
37
|
+
/** One shared capability id. */
|
|
38
|
+
export type EditorCapabilityId = (typeof EDITOR_CAPABILITY_IDS)[number];
|
|
39
|
+
/**
|
|
40
|
+
* Per-capability switches for a product whose capability ids are `Id` (a subset of
|
|
41
|
+
* `EditorCapabilityId`, optionally widened with product ids).
|
|
42
|
+
*/
|
|
43
|
+
export type EditorCapabilities<Id extends string = EditorCapabilityId> = Partial<Record<Id, boolean>>;
|
|
44
|
+
/** True unless the host switched `id` off (`false`); an omitted key is enabled. */
|
|
45
|
+
export declare function isCapabilityEnabled<Id extends string>(capabilities: EditorCapabilities<Id> | null | undefined, id: NoInfer<Id>): boolean;
|
|
46
|
+
/** The ids the host switched off, in the order they were given. */
|
|
47
|
+
export declare function disabledCapabilities<Id extends string>(capabilities: EditorCapabilities<Id> | null | undefined): Id[];
|
|
48
|
+
/**
|
|
49
|
+
* What each capability removes in one product: the product's own action ids (ribbon controls,
|
|
50
|
+
* menu entries, Backstage pages, shortcuts), keyed by capability.
|
|
51
|
+
*/
|
|
52
|
+
export type CapabilityActionMap<Id extends string, Action extends string> = Readonly<Partial<Record<Id, readonly Action[]>>>;
|
|
53
|
+
/** Every action a disabled capability removes, deduplicated, in map order. */
|
|
54
|
+
export declare function capabilityHiddenActions<Id extends string, Action extends string>(capabilities: EditorCapabilities<Id> | null | undefined, map: CapabilityActionMap<Id, Action>): Action[];
|
|
55
|
+
/**
|
|
56
|
+
* The union of several hidden-action lists (the legacy `hiddenActions` prop, the ids disabled
|
|
57
|
+
* capabilities remove, the user's own Customize Ribbon choices), deduplicated in first-seen order.
|
|
58
|
+
*/
|
|
59
|
+
export declare function mergeHiddenActions<Action extends string>(...lists: ReadonlyArray<readonly Action[] | null | undefined>): Action[];
|
|
60
|
+
//# sourceMappingURL=capabilities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../embedding/capabilities.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,wFAAwF;AACxF,eAAO,MAAM,qBAAqB;AACjC,sFAAsF;AACtF,MAAM;AACN,0EAA0E;AAC1E,QAAQ;AACR,8DAA8D;AAC9D,OAAO;AACP,4EAA4E;AAC5E,OAAO;AACP,2DAA2D;AA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,MAAM,EACvD,GAAG,KAAK,EAAE,aAAa,CAAC,SAAS,MAAM,EAAE,GAAG,IAAI,GAAG,SAAS,CAAC,GAC3D,MAAM,EAAE,CAIV"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The shared shape of an editor's `customization` object. A host describes what its users see
|
|
3
|
+
* and may do in ONE plain object; every product (Word, Excel, PowerPoint, Visio) accepts the
|
|
4
|
+
* same sections through its element property and every framework binding forwards it as one
|
|
5
|
+
* prop. Every field is optional and every list defaults to "hide nothing", so an empty object
|
|
6
|
+
* (or none) is exactly the editor's default behaviour.
|
|
7
|
+
*
|
|
8
|
+
* Products bind the type parameters: `Capability` to the ids they honour, `Renderer` to their
|
|
9
|
+
* region renderer, `MenuContext` to the snapshot their context menu passes to host commands.
|
|
10
|
+
* PowerPoint's `ViewerCustomization` is a superset of this shape.
|
|
11
|
+
*/
|
|
12
|
+
import type { HostBackstagePage } from './backstage.js';
|
|
13
|
+
import type { EditorCapabilities } from './capabilities.js';
|
|
14
|
+
import type { HostMenuCommand } from './menu-commands.js';
|
|
15
|
+
/** File tab (Backstage) customisation every product supports. */
|
|
16
|
+
export interface EditorBackstageCustomization<Renderer> {
|
|
17
|
+
/** Host pages added after the built-in pages of their group. */
|
|
18
|
+
extraPages?: readonly HostBackstagePage<Renderer>[];
|
|
19
|
+
}
|
|
20
|
+
/** Right-click menu customisation every product supports. */
|
|
21
|
+
export interface EditorContextMenuCustomization<MenuContext> {
|
|
22
|
+
/** Host commands added to the document (cell, shape) context menu. */
|
|
23
|
+
extraCommands?: readonly HostMenuCommand<MenuContext>[];
|
|
24
|
+
}
|
|
25
|
+
/** The customisation sections every editor shares. */
|
|
26
|
+
export interface EditorCustomization<Capability extends string, Renderer, MenuContext> {
|
|
27
|
+
/** What the user may do; `false` removes every UI path to the capability. */
|
|
28
|
+
capabilities?: EditorCapabilities<Capability>;
|
|
29
|
+
backstage?: EditorBackstageCustomization<Renderer>;
|
|
30
|
+
contextMenu?: EditorContextMenuCustomization<MenuContext>;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=customization.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customization.d.ts","sourceRoot":"","sources":["../../embedding/customization.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD,iEAAiE;AACjE,MAAM,WAAW,4BAA4B,CAAC,QAAQ;IACrD,gEAAgE;IAChE,UAAU,CAAC,EAAE,SAAS,iBAAiB,CAAC,QAAQ,CAAC,EAAE,CAAC;CACpD;AAED,6DAA6D;AAC7D,MAAM,WAAW,8BAA8B,CAAC,WAAW;IAC1D,sEAAsE;IACtE,aAAa,CAAC,EAAE,SAAS,eAAe,CAAC,WAAW,CAAC,EAAE,CAAC;CACxD;AAED,sDAAsD;AACtD,MAAM,WAAW,mBAAmB,CAAC,UAAU,SAAS,MAAM,EAAE,QAAQ,EAAE,WAAW;IACpF,6EAA6E;IAC7E,YAAY,CAAC,EAAE,kBAAkB,CAAC,UAAU,CAAC,CAAC;IAC9C,SAAS,CAAC,EAAE,4BAA4B,CAAC,QAAQ,CAAC,CAAC;IACnD,WAAW,CAAC,EAAE,8BAA8B,CAAC,WAAW,CAAC,CAAC;CAC1D"}
|