ooxml-ui 1.20.0 → 1.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/README.md +18 -9
  2. package/dist/{chunk-4XPAPETH.js → chunk-DRBAJ5UO.js} +2 -1
  3. package/dist/{chunk-UB36NYDT.js → chunk-REJECZGV.js} +1 -1
  4. package/dist/docx/building-blocks-actions.d.ts +54 -0
  5. package/dist/docx/building-blocks-status.d.ts +34 -0
  6. package/dist/docx/building-blocks.d.ts +20 -4
  7. package/dist/docx/editor-core.d.ts +5 -0
  8. package/dist/docx/element-api.d.ts +12 -0
  9. package/dist/docx/index.d.ts +3 -1
  10. package/dist/docx/insert-controller.d.ts +2 -0
  11. package/dist/docx/locales/en-app.d.ts +1 -0
  12. package/dist/docx/locales/en.d.ts +1 -0
  13. package/dist/docx/localization-strings.d.ts +1 -0
  14. package/dist/docx/surface-navigation.d.ts +8 -0
  15. package/dist/docx.js +337 -11
  16. package/dist/index.js +2 -2
  17. package/dist/parse-worker.js +5 -1
  18. package/dist/pptx/{chunk-ABDWUQRQ.cjs → chunk-72NIN6QF.cjs} +275 -60
  19. package/dist/pptx/{chunk-F6P7VS5I.mjs → chunk-VGOIAVPA.mjs} +266 -61
  20. package/dist/pptx/dom/index.cjs +209 -209
  21. package/dist/pptx/dom/index.mjs +2 -2
  22. package/dist/pptx/index.cjs +2926 -2886
  23. package/dist/pptx/index.mjs +1 -1
  24. package/dist/pptx/render/collaboration-options.d.ts +11 -9
  25. package/dist/pptx/render/collaboration-options.d.ts.map +1 -1
  26. package/dist/pptx/render/collaboration-owned-session.d.ts +34 -0
  27. package/dist/pptx/render/collaboration-owned-session.d.ts.map +1 -0
  28. package/dist/pptx/render/collaboration-state.d.ts +47 -0
  29. package/dist/pptx/render/collaboration-state.d.ts.map +1 -0
  30. package/dist/pptx/render/collaboration-writeback.d.ts +28 -1
  31. package/dist/pptx/render/collaboration-writeback.d.ts.map +1 -1
  32. package/dist/pptx/render/index.d.ts +2 -0
  33. package/dist/pptx/render/index.d.ts.map +1 -1
  34. package/dist/pptx/render/morph-predicates.d.ts +7 -0
  35. package/dist/pptx/render/morph-predicates.d.ts.map +1 -1
  36. package/dist/pptx/render/viewer-props-manifest.d.ts.map +1 -1
  37. package/dist/pptx/types.d.ts +25 -2
  38. package/dist/pptx/types.d.ts.map +1 -1
  39. package/dist/pptx/web-components/office-aliases.d.ts +1 -1
  40. package/dist/teams.js +1 -1
  41. package/dist/visio/building-blocks-shapes.d.ts +9 -0
  42. package/dist/visio/building-blocks-toolbar.d.ts +87 -0
  43. package/dist/visio/building-blocks.d.ts +9 -32
  44. package/dist/visio/canvas-editing.d.ts +45 -0
  45. package/dist/visio/canvas-keys.d.ts +9 -0
  46. package/dist/visio/canvas-services.d.ts +18 -0
  47. package/dist/visio/collaboration-types.d.ts +2 -2
  48. package/dist/visio/controller.d.ts +31 -1
  49. package/dist/visio/diagram-tool.d.ts +11 -0
  50. package/dist/visio/index.d.ts +1 -1
  51. package/dist/visio/viewer-clipboard.d.ts +7 -1
  52. package/dist/visio/viewer-delete.d.ts +10 -0
  53. package/dist/visio/viewer-presence-overlay.d.ts +12 -0
  54. package/dist/visio/viewer-presence.d.ts +19 -0
  55. package/dist/visio/viewer-share-sync.d.ts +15 -10
  56. package/dist/visio/viewer-share.d.ts +9 -7
  57. package/dist/visio/viewer-stencil.d.ts +8 -0
  58. package/dist/visio/viewer-write-back.d.ts +32 -0
  59. package/dist/visio/worker-parser.d.ts +11 -1
  60. package/dist/visio.js +19930 -19210
  61. package/dist/xlsx/building-blocks.d.ts +34 -0
  62. package/dist/xlsx/editor-core.d.ts +8 -0
  63. package/dist/xlsx/element-api.d.ts +12 -1
  64. package/dist/xlsx/events.d.ts +12 -1
  65. package/dist/xlsx/grid/alert-route.d.ts +21 -0
  66. package/dist/xlsx/index.d.ts +2 -1
  67. package/dist/xlsx/surface-actions.d.ts +73 -0
  68. package/dist/xlsx.js +190 -23
  69. package/package.json +2 -2
@@ -39,6 +39,13 @@ export declare function conflictingMorphNames(a: PptxElement, b: PptxElement): b
39
39
  export declare function mediaIdentity(el: PptxElement): string | undefined;
40
40
  /** Euclidean distance between two elements' top-left corners (slide space). */
41
41
  export declare function centreDistance(a: PptxElement, b: PptxElement): number;
42
+ /**
43
+ * Whether both elements are pictures painting provably different images. Two
44
+ * nearby pictures of different artwork are not the same object, and pairing
45
+ * them spins and stretches one into the other (a rotated icon turning into an
46
+ * unrelated flat picture). Unknown media on either side vetoes nothing.
47
+ */
48
+ export declare function differentMedia(a: PptxElement, b: PptxElement): boolean;
42
49
  /** Whether two elements are the same kind of picture painting the same media. */
43
50
  export declare function sameMediaPicture(a: PptxElement, b: PptxElement): boolean;
44
51
  /** The `shapeStyle` paint fields that decide what an element looks like. */
@@ -1 +1 @@
1
- {"version":3,"file":"morph-predicates.d.ts","sourceRoot":"","sources":["../../../src/pptx/render/morph-predicates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AA8BnD;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,WAAW,GAAG,OAAO,CAMrE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,WAAW,GAAG,OAAO,CAO7E;AAED,4EAA4E;AAC5E,wBAAgB,aAAa,CAAC,EAAE,EAAE,WAAW,GAAG,MAAM,GAAG,SAAS,CAQjE;AAED,+EAA+E;AAC/E,wBAAgB,cAAc,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,WAAW,GAAG,MAAM,CAIrE;AAED,iFAAiF;AACjF,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,WAAW,GAAG,OAAO,CAaxE;AAED,4EAA4E;AAC5E,eAAO,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;;GAKG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,WAAW,GAAG,OAAO,CAOtE;AAED,iFAAiF;AACjF,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,WAAW,GAAG,OAAO,CAaxE;AAED,4EAA4E;AAC5E,eAAO,MAAM,eAAe,YAC3B,UAAU,EACV,WAAW,EACX,aAAa,EACb,aAAa,EACb,aAAa,EACb,eAAe,EACf,YAAY,CACH,CAAC;AAEX;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,WAAW,GAAG,OAAO,CAMzD;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,WAAW,GAAG,MAAM,CAU3D;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,WAAW,GAAG,OAAO,CAyBxE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,uBAAuB,CACtC,MAAM,EAAE,WAAW,EACnB,IAAI,EAAE,WAAW,EACjB,YAAY,EAAE,SAAS,WAAW,EAAE,EACpC,UAAU,EAAE,SAAS,WAAW,EAAE,EAClC,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,EAC7B,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,GACzB,OAAO,CAQT"}
@@ -1 +1 @@
1
- {"version":3,"file":"viewer-props-manifest.d.ts","sourceRoot":"","sources":["../../../src/pptx/render/viewer-props-manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,eAAO,MAAM,eAAe,YAAI,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,CAAU,CAAC;AACzF,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAE7D,MAAM,WAAW,kBAAkB;IAClC,+CAA+C;IAC/C,Q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AC,aAAa,EAAE,gBAAgB,CAAC,CAAC,GAC1D,kBAAkB,EAAE,CAKtB"}
@@ -6,6 +6,7 @@ import type { PptxElement, PptxSlide } from 'ooxml-core/pptx';
6
6
  * packages; this is the canonical copy. Each binding layers its own
7
7
  * framework-specific prop/event/handle types on top of these.
8
8
  */
9
+ import type { ProviderFactory, WebrtcOptions, WriteBackRetry } from 'ooxml-core/collab';
9
10
  import type { ExternalCollaborationSession } from './render/collaboration-external-session.js';
10
11
  import type { ElementUpdate, ElementUpdateOptions } from './render/element-update-batch.js';
11
12
  /** Canvas dimensions in pixels. */
@@ -180,7 +181,9 @@ export type CollaborationSessionIntent = 'create' | 'join';
180
181
  * shared `CollaborationOptions` contract (`session`, `user`, `intent`) that Word, Excel
181
182
  * and Visio take; see `CollaborationInput` and `resolveCollaborationConfig`. A host
182
183
  * `CollabSession` from `ooxml-core/collab` is borrowed (never destroyed) and becomes
183
- * `externalSession`. `provider` and the BroadcastChannel fallback are not supported here.
184
+ * `externalSession`. A `provider`, or a room with neither `serverUrl` nor `transport: 'webrtc'`
185
+ * (a BroadcastChannel between windows of this browser), is opened by the viewer as a session it
186
+ * owns and destroys; see `openOwnedCollaboration`.
184
187
  */
185
188
  export interface CollaborationConfig {
186
189
  /** Unique identifier for the collaboration room (alphanumeric, hyphens, underscores). */
@@ -199,6 +202,17 @@ export interface CollaborationConfig {
199
202
  * these resources. Keep this object stable and report readiness via subscribe.
200
203
  */
201
204
  externalSession?: ExternalCollaborationSession;
205
+ /**
206
+ * A provider factory of your own (the shared `CollaborationOptions.provider`). Wins over
207
+ * `serverUrl`; the viewer creates and destroys the session around it.
208
+ */
209
+ provider?: ProviderFactory;
210
+ /**
211
+ * Peer-to-peer over the host's own `y-webrtc` class (the shared `CollaborationOptions.webrtc`).
212
+ * After `provider`, before `serverUrl`; the viewer creates and destroys the session around it,
213
+ * with `authToken` as the room password unless `webrtc.password` is set.
214
+ */
215
+ webrtc?: WebrtcOptions;
202
216
  /**
203
217
  * WebRTC signaling server URLs (only used when `transport` is `'webrtc'`).
204
218
  * Defaults to y-webrtc's built-in public signaling list. Same-browser tabs
@@ -230,13 +244,22 @@ export interface CollaborationConfig {
230
244
  * callback so the host can persist the snapshot. Only one writer (the owner)
231
245
  * does this; other collaborators never trigger write-back, eliminating the
232
246
  * last-save-wins problem.
247
+ *
248
+ * Return a promise to acknowledge durable storage: the viewer reports `saving`, `saved` or
249
+ * `failed` in `collaborationState.writeBack` and retries a rejection as `writeBackRetry`
250
+ * says. A plain return counts as acknowledged at once. A pending write-back is flushed on
251
+ * `pagehide` and when the page is hidden, but browsers do not wait for asynchronous work
252
+ * then: a write that needs a network round trip should use `navigator.sendBeacon` or
253
+ * `fetch(url, { keepalive: true })` to survive a close.
233
254
  */
234
- onWriteBack?: (bytes: Uint8Array) => void;
255
+ onWriteBack?: (bytes: Uint8Array) => void | Promise<void>;
235
256
  /**
236
257
  * Debounce delay (ms) between the last Y.Doc change and the write-back
237
258
  * invocation. Defaults to 5000 ms. Set to 0 to write back on every change
238
259
  * (not recommended for large documents).
239
260
  */
240
261
  writeBackDebounceMs?: number;
262
+ /** Retries of a rejected `onWriteBack` with exponential backoff. Default: none. */
263
+ writeBackRetry?: WriteBackRetry;
241
264
  }
242
265
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/pptx/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC9D;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,yCAAyC,CAAC;AAC5F,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAEzF,mCAAmC;AACnC,MAAM,WAAW,UAAU;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CACf;AAMD,8EAA8E;AAC9E,M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7B,mFAAmF;IACnF,cAAc,CAAC,EAAE,cAAc,CAAC;CAChC"}
@@ -5,7 +5,7 @@ import type { OFFICE_ALIAS_TAGS } from './office-token-bridge.js';
5
5
  * subclass of the shared element, registered under the published pptx name so bindings, tests
6
6
  * and hosts keep the same attributes, properties, events and test ids. Differences are translated
7
7
  * here, never in callers: event names and test ids through the shared elements' static fields,
8
- * i18n keys and positioning through the `state` setter. See `docs/ooxml-ui-plan.md` in ooxml.
8
+ * i18n keys and positioning through the `state` setter. The alias decision is recorded in `docs/ooxml-ui-plan.md` (pptx tags).
9
9
  */
10
10
  type Ctor = CustomElementConstructor;
11
11
  export declare function base(registry: CustomElementRegistry, define: (r: CustomElementRegistry) => void, tag: string): Ctor;
package/dist/teams.js CHANGED
@@ -1,4 +1,4 @@
1
- export { EMOJI, OfficeUiActivityFeed, OfficeUiAppRail, OfficeUiAvatar, OfficeUiCalendarAgenda, OfficeUiCalendarView, OfficeUiCallControls, OfficeUiCallGrid, OfficeUiChannelList, OfficeUiChatComposer, OfficeUiChatList, OfficeUiChatSidebar, OfficeUiPeoplePicker, OfficeUiPrejoin, QUICK_REACTIONS, TEAMS_TAGS, TeamsApp, TeamsChannelTab, TeamsContentPreview, TeamsController, TeamsElement, TeamsFilesPanel, TeamsSettings, activityTime, applyTeamsProps, colorFor, createTeams, dayKind, dayLabel, defineActivityFeed, defineAppRail, defineAvatar, defineCalendarAgenda, defineCalendarView, defineCallControls, defineCallGrid, defineChannelList, defineChatComposer, defineChatList, defineChatSidebar, definePeoplePicker, definePrejoin, defineTeamsApp, defineTeamsChannelTab, defineTeamsContentPreview, defineTeamsFilesPanel, defineTeamsSettings, formatElapsed, formatSize, formatTime, formatWhen, icon, listenTeamsEvents, loadConfig, loadIdentity, parseIceLines, registerTeams, safeStorage, saveConfig, saveIdentity, withStyles } from './chunk-4XPAPETH.js';
1
+ export { EMOJI, OfficeUiActivityFeed, OfficeUiAppRail, OfficeUiAvatar, OfficeUiCalendarAgenda, OfficeUiCalendarView, OfficeUiCallControls, OfficeUiCallGrid, OfficeUiChannelList, OfficeUiChatComposer, OfficeUiChatList, OfficeUiChatSidebar, OfficeUiPeoplePicker, OfficeUiPrejoin, QUICK_REACTIONS, TEAMS_TAGS, TeamsApp, TeamsChannelTab, TeamsContentPreview, TeamsController, TeamsElement, TeamsFilesPanel, TeamsSettings, activityTime, applyTeamsProps, colorFor, createTeams, dayKind, dayLabel, defineActivityFeed, defineAppRail, defineAvatar, defineCalendarAgenda, defineCalendarView, defineCallControls, defineCallGrid, defineChannelList, defineChatComposer, defineChatList, defineChatSidebar, definePeoplePicker, definePrejoin, defineTeamsApp, defineTeamsChannelTab, defineTeamsContentPreview, defineTeamsFilesPanel, defineTeamsSettings, formatElapsed, formatSize, formatTime, formatWhen, icon, listenTeamsEvents, loadConfig, loadIdentity, parseIceLines, registerTeams, safeStorage, saveConfig, saveIdentity, withStyles } from './chunk-DRBAJ5UO.js';
2
2
  export { TeamsPresentationPreview, defineTeamsPresentationPreview } from './chunk-FHO7TEWA.js';
3
3
  import './chunk-T5ARELU2.js';
4
4
  import './chunk-TJ245GDD.js';
@@ -0,0 +1,9 @@
1
+ import type { ViewerController } from './controller.js';
2
+ /**
3
+ * The Shapes window (Search shapes, the drawing's own stencil and the built-in stencils), mounted
4
+ * on its own. Dragging a master onto the mounted canvas, or pressing Enter on it, creates the shape
5
+ * through the same flow as the full viewer, so it obeys the same edit permission.
6
+ */
7
+ export declare function mountDiagramShapes(host: HTMLElement, controller: ViewerController, options?: {
8
+ locale?: string | undefined;
9
+ }): () => void;
@@ -0,0 +1,87 @@
1
+ import { type ViewerController, type ViewerState } from './controller.js';
2
+ import { type DiagramTool } from './diagram-tool.js';
3
+ /** Every label a custom toolbar may show; each has an entry in every Visio locale. */
4
+ export declare const DIAGRAM_TOOLBAR_LABEL_KEYS: readonly ['Undo', 'Redo', 'Fit to Window', 'Page', 'Zoom In', 'Zoom Out', 'Duplicate', 'Group', 'Ungroup', 'Delete', 'Cut', 'Copy', 'Paste', 'Find', 'Previous Result', 'Next Result', 'Shapes', 'Pointer Tool', 'Rectangle', 'Ellipse', 'Line', 'Freeform', 'Arc', 'Pencil', 'Text', 'Connector', 'Open', 'Page Setup', 'Options', 'Share'];
5
+ export type DiagramToolbarLabelKey = (typeof DIAGRAM_TOOLBAR_LABEL_KEYS)[number];
6
+ export type DiagramToolbarLabels = Readonly<Record<DiagramToolbarLabelKey, string>>;
7
+ /** What the host may do with the diagram right now: 'view' also covers legacy, source-less files. */
8
+ export type DiagramMode = 'edit' | 'view';
9
+ /**
10
+ * Dialogs are host-owned, as in the PowerPoint building blocks: the library never opens one in
11
+ * surface mode. A workflow whose callback is omitted reports not-enabled (`canOpen...` is false
12
+ * and no `onOpen...` is returned).
13
+ */
14
+ export interface DiagramToolbarHostCallbacks {
15
+ onOpenFile?: (() => void) | undefined;
16
+ onOpenPageSetup?: (() => void) | undefined;
17
+ onOpenSettings?: (() => void) | undefined;
18
+ onOpenShareDialog?: (() => void) | undefined;
19
+ }
20
+ export interface DiagramToolSummary {
21
+ readonly id: DiagramTool;
22
+ readonly label: string;
23
+ readonly active: boolean;
24
+ }
25
+ /** Whether the diagram can be edited at all: host permission and a source-backed drawing. */
26
+ export declare function diagramMode(state: Pick<ViewerState, 'canEdit' | 'edit'>): DiagramMode;
27
+ export declare function diagramToolbarProps(controller: ViewerController, fit: () => void, locale?: string, callbacks?: DiagramToolbarHostCallbacks): {
28
+ labels: Readonly<Record<"Arc" | "Connector" | "Copy" | "Cut" | "Delete" | "Duplicate" | "Ellipse" | "Find" | "Fit to Window" | "Freeform" | "Group" | "Line" | "Next Result" | "Open" | "Options" | "Page" | "Page Setup" | "Paste" | "Pencil" | "Pointer Tool" | "Previous Result" | "Rectangle" | "Redo" | "Shapes" | "Share" | "Text" | "Undo" | "Ungroup" | "Zoom In" | "Zoom Out", string>>;
29
+ mode: DiagramMode;
30
+ canEdit: boolean;
31
+ pageIndex: number;
32
+ pages: {
33
+ id: string;
34
+ name: string;
35
+ }[];
36
+ zoom: number;
37
+ selection: readonly import("ooxml-core/visio/ui").VisioShapeSelection[];
38
+ canUndo: boolean;
39
+ canRedo: boolean;
40
+ canDuplicate: boolean;
41
+ canGroup: boolean;
42
+ canUngroup: boolean;
43
+ canDelete: boolean;
44
+ canCut: boolean;
45
+ canCopy: boolean;
46
+ canPaste: boolean;
47
+ /** Whether the shape-creation tools and the shapes pane may add shapes. */
48
+ canDraw: boolean;
49
+ canZoomIn: boolean;
50
+ canZoomOut: boolean;
51
+ tool: DiagramTool;
52
+ tools: DiagramToolSummary[];
53
+ search: {
54
+ query: string;
55
+ resultCount: number;
56
+ activeIndex: number;
57
+ truncated: boolean;
58
+ };
59
+ onPageChange: (index: number) => void;
60
+ onZoomChange: (zoom: number) => void;
61
+ onZoomIn: () => void;
62
+ onZoomOut: () => void;
63
+ onFit: () => void;
64
+ onUndo: () => Promise<void>;
65
+ onRedo: () => Promise<void>;
66
+ onDuplicate: () => Promise<void>;
67
+ onGroup: () => Promise<void>;
68
+ onUngroup: () => Promise<void>;
69
+ onDelete: () => Promise<void>;
70
+ onCut: () => Promise<void>;
71
+ onCopy: () => Promise<void>;
72
+ onPaste: () => Promise<void>;
73
+ onToolChange: (tool: DiagramTool) => void;
74
+ onTextChange: (pageId: string, shapeId: string, text: string) => Promise<void>;
75
+ onSearchChange: (query: string) => void;
76
+ onNextSearchResult: () => void;
77
+ onPreviousSearchResult: () => void;
78
+ canOpenFile: boolean;
79
+ canOpenPageSetup: boolean;
80
+ canOpenSettings: boolean;
81
+ canOpenShareDialog: boolean;
82
+ onOpenFile?: () => void;
83
+ onOpenPageSetup?: () => void;
84
+ onOpenSettings?: () => void;
85
+ onOpenShareDialog?: () => void;
86
+ };
87
+ export type DiagramToolbarProps = ReturnType<typeof diagramToolbarProps>;
@@ -1,37 +1,14 @@
1
1
  import type { ViewerController } from './controller.js';
2
+ export { diagramToolbarProps, diagramMode } from './building-blocks-toolbar.js';
3
+ export type { DiagramToolbarProps, DiagramToolbarLabels, DiagramToolbarHostCallbacks, DiagramMode, DiagramToolSummary, } from './building-blocks-toolbar.js';
4
+ export { mountDiagramShapes } from './building-blocks-shapes.js';
5
+ export { DIAGRAM_DRAW_TOOLS, DIAGRAM_OBJECT_TOOLS, DIAGRAM_TOOLS, type DiagramTool, type DiagramDrawTool, type DiagramObjectTool, } from './diagram-tool.js';
2
6
  export declare function fitDiagramCanvas(host: HTMLElement, controller: ViewerController, mode?: 'page' | 'width'): void;
3
7
  /** The existing non-mutating selection inspector, independently mounted. */
4
8
  export declare function mountDiagramInspector(host: HTMLElement, controller: ViewerController): () => void;
5
- /** The shared drawing engine, without application chrome or file/settings handlers. */
9
+ /**
10
+ * The shared drawing engine, without application chrome or file/settings handlers. Moving,
11
+ * inline text, resize, rotate, line end points and the draw tools are the full viewer's own
12
+ * gestures, and all of them stand down unless the controller may edit.
13
+ */
6
14
  export declare function mountDiagramCanvas(host: HTMLElement, controller: ViewerController): () => void;
7
- export declare function diagramToolbarProps(controller: ViewerController, fit: () => void, locale?: string): {
8
- labels: {
9
- [k: string]: string;
10
- };
11
- canEdit: boolean;
12
- pageIndex: number;
13
- pages: {
14
- id: string;
15
- name: string;
16
- }[];
17
- zoom: number;
18
- selection: readonly import("ooxml-core/visio/ui").VisioShapeSelection[];
19
- canUndo: boolean;
20
- canRedo: boolean;
21
- canDuplicate: boolean;
22
- canGroup: boolean;
23
- canUngroup: boolean;
24
- onPageChange: (index: number) => void;
25
- onZoomChange: (zoom: number) => void;
26
- onFit: () => void;
27
- onUndo: () => Promise<void>;
28
- onRedo: () => Promise<void>;
29
- onDuplicate: () => Promise<void>;
30
- onGroup: () => Promise<void>;
31
- onUngroup: () => Promise<void>;
32
- onTextChange: (pageId: string, shapeId: string, text: string) => Promise<void>;
33
- onSearchChange: (query: string) => void;
34
- onNextSearchResult: () => void;
35
- onPreviousSearchResult: () => void;
36
- };
37
- export type DiagramToolbarProps = ReturnType<typeof diagramToolbarProps>;
@@ -0,0 +1,45 @@
1
+ import type { ViewerController, ViewerState } from './controller.js';
2
+ import { ViewerInlineText } from './viewer-inline-text.js';
3
+ import { ViewerLineEndpoints } from './viewer-line-endpoints.js';
4
+ import { ViewerPointerGestures } from './viewer-pointer-gestures.js';
5
+ import { ViewerResizeHandles } from './viewer-resize-handles.js';
6
+ import { ViewerRotationHandle } from './viewer-rotation-handle.js';
7
+ import { ShapeDrawTool } from './viewer-draw-tool.js';
8
+ import { ViewerTextTool } from './viewer-text-tool.js';
9
+ import { ViewerConnectorTool } from './viewer-connector-tool.js';
10
+ import type { DiagramTool } from './diagram-tool.js';
11
+ export interface CanvasEditingOptions {
12
+ /** Whether the pointer tool is the active one: handles and gestures stand down otherwise. */
13
+ pointerActive(): boolean;
14
+ announce(message: string): void;
15
+ snap?: ConstructorParameters<typeof ViewerPointerGestures>[2]['snap'];
16
+ clearSnap?: ConstructorParameters<typeof ViewerPointerGestures>[2]['clearSnap'];
17
+ /**
18
+ * The active tool, present only where the tools live in this wiring (the standalone canvas).
19
+ * The full viewer owns its tools in its commands and leaves this out.
20
+ */
21
+ tool?: () => DiagramTool;
22
+ }
23
+ /**
24
+ * The editing gestures every canvas shares: moving, inline text, line end points, rotation and
25
+ * resize handles, plus ordinary shape drawing when a draw tool is supplied. The full viewer and
26
+ * the standalone building-block canvas both build their surface from this, so the two behave alike
27
+ * and both stay behind the controller's edit permission.
28
+ */
29
+ export declare function createCanvasEditing(viewport: HTMLElement, controller: ViewerController, options: CanvasEditingOptions): {
30
+ pointer: ViewerPointerGestures;
31
+ lineEndpoints: ViewerLineEndpoints;
32
+ rotation: ViewerRotationHandle;
33
+ resize: ViewerResizeHandles;
34
+ edit: ViewerInlineText;
35
+ draw: ShapeDrawTool | undefined;
36
+ text: ViewerTextTool | undefined;
37
+ connector: ViewerConnectorTool | undefined;
38
+ /** Stop any gesture in progress, as when the tool changes or Escape is pressed. */
39
+ cancelTools(): void;
40
+ /** Redraw the selection handles after a state or tool change. */
41
+ renderHandles(state: ViewerState): void;
42
+ render(state: ViewerState): void;
43
+ wire(): () => void;
44
+ };
45
+ export type CanvasEditing = ReturnType<typeof createCanvasEditing>;
@@ -0,0 +1,9 @@
1
+ import { type ViewerController } from './controller.js';
2
+ import type { CanvasEditing } from './canvas-editing.js';
3
+ /** Delete the selection through the controller; false when there is nothing deletable. */
4
+ export declare function deleteDiagramSelection(controller: ViewerController, announce: (message: string) => void): Promise<void>;
5
+ /**
6
+ * The few keys a bare drawing surface answers, gated like the full viewer's: Delete removes the
7
+ * selection, Escape drops the draw tool, Ctrl+Z and Ctrl+Y walk the history.
8
+ */
9
+ export declare function wireCanvasKeys(viewport: HTMLElement, controller: ViewerController, editing: CanvasEditing, announce: (message: string) => void): () => void;
@@ -0,0 +1,18 @@
1
+ import type { ViewerController } from './controller.js';
2
+ import type { ClipboardOperation } from './viewer-clipboard.js';
3
+ /**
4
+ * What a mounted standalone canvas can do beyond the controller: the browser clipboard transport
5
+ * and the drawing surface. Toolbar props and the shapes pane look these up by controller, so a
6
+ * custom UI never reaches into the canvas element.
7
+ */
8
+ export interface CanvasServices {
9
+ readonly viewport: HTMLElement;
10
+ /** Run a clipboard operation; rejects with the reason when it is unavailable. */
11
+ clipboard(operation: ClipboardOperation): Promise<void>;
12
+ announce(message: string): void;
13
+ }
14
+ export declare function registerCanvasServices(controller: ViewerController, services: CanvasServices): () => void;
15
+ /** Follow the canvas mounted on a controller: called now, and whenever one mounts or unmounts. */
16
+ export declare function watchCanvasServices(controller: ViewerController, watcher: (services: CanvasServices | undefined) => void): () => void;
17
+ /** The services of the canvas mounted on this controller, if any. */
18
+ export declare function canvasServices(controller: ViewerController): CanvasServices | undefined;
@@ -1,3 +1,3 @@
1
- import type { CollaborationOptions, CollaborationState } from 'ooxml-core/collab';
2
- export type VisioCollaborationOptions = CollaborationOptions;
1
+ import type { CollaborationState } from 'ooxml-core/collab';
2
+ export type { VisioCollaborationOptions, VisioPresence, VisioWriteBackOptions, } from 'ooxml-core/visio/ui';
3
3
  export type VisioCollaborationState = CollaborationState;
@@ -7,6 +7,7 @@ import { type CancellableClipboardCapture } from './worker-clipboard.js';
7
7
  import { type ViewerCreationToken } from './creation-token.js';
8
8
  import { type LayerVisibilityOverride } from './viewer-layers.js';
9
9
  import type { CancellableParser } from './worker-parser.js';
10
+ import type { DiagramTool } from './diagram-tool.js';
10
11
  import type { ViewerEvents, VisioShapeSelection } from 'ooxml-core/visio/ui';
11
12
  import { type TextSearchState } from 'ooxml-core/visio/ui';
12
13
  import { type ViewerTextReplaceToken, type ViewerTextReplaceScope, type ViewerTextReplacementInput } from './replacement-token.js';
@@ -28,11 +29,25 @@ export interface ViewerState {
28
29
  readonly selectedShapes: readonly VisioShapeSelection[];
29
30
  /** Prepared source selection availability for native clipboard gestures. Payload stays private. */
30
31
  readonly clipboard: ViewerClipboardState;
32
+ /** The standalone canvas's active tool; it falls back to the pointer whenever editing stops. */
33
+ readonly tool: DiagramTool;
31
34
  }
32
35
  /** Effective mutation availability shared by every diagram UI tool. */
33
36
  export declare function canEditDiagram(state: Pick<ViewerState, 'canEdit' | 'edit'>): boolean;
34
37
  type Parser = CancellableParser;
35
38
  type EventListener = <K extends keyof ViewerEvents>(name: K, detail: ViewerEvents[K]) => void;
39
+ /** What differs between the open drawing and a shared package, when only page content does. */
40
+ export interface RemoteSourceChange {
41
+ /** Ids of the pages whose content changed. */
42
+ readonly pages: readonly string[];
43
+ }
44
+ /** Undo and redo of a shared drawing: they act on the local user's edits only. */
45
+ export interface SharedHistory {
46
+ undo(): Promise<boolean>;
47
+ redo(): Promise<boolean>;
48
+ canUndo(): boolean;
49
+ canRedo(): boolean;
50
+ }
36
51
  export declare class ViewerController {
37
52
  #private;
38
53
  private readonly parser;
@@ -47,6 +62,8 @@ export declare class ViewerController {
47
62
  subscribe(listener: (state: ViewerState) => void): () => void;
48
63
  get canEdit(): boolean;
49
64
  set canEdit(value: boolean);
65
+ /** Pick the canvas tool. A drawing tool needs edit permission and a source-backed drawing. */
66
+ setTool(tool: DiagramTool): void;
50
67
  onEvent(listener: EventListener): () => void;
51
68
  setDocument(document: VisioDocument | null): void;
52
69
  setPage(index: number): void;
@@ -127,14 +144,27 @@ export declare class ViewerController {
127
144
  /** Number of undo steps kept (File > Options > Advanced); applies to the open drawing at once. */
128
145
  get undoLevels(): number | undefined;
129
146
  set undoLevels(levels: number | undefined);
147
+ /**
148
+ * While set (a shared drawing), undo and redo go to `history` instead of the package history,
149
+ * and the edit state reports its stacks. Pass null to restore the package history.
150
+ */
151
+ setSharedHistory(history: SharedHistory | null): void;
152
+ /** Re-reads the undo and redo availability of a shared history. */
153
+ refreshHistory(): void;
130
154
  undo(): Promise<void>;
131
155
  /**
132
156
  * Adopt a package from a shared session as one undoable history step. Emits `document-change`
133
157
  * with kind `remote`, which a session must not publish back.
134
158
  */
135
- applyRemoteSource(bytes: Uint8Array): Promise<void>;
159
+ applyRemoteSource(bytes: Uint8Array, change?: RemoteSourceChange): Promise<void>;
136
160
  redo(): Promise<void>;
137
161
  cancelEdit(): void;
162
+ /**
163
+ * Declare the current content saved, for hosts that persist `exportVsdx()` themselves. Clears
164
+ * `edit.dirty` and emits `document-change` with `dirty: false` and kind `save`. Later edits
165
+ * and undo steps are measured against this point.
166
+ */
167
+ markClean(): void;
138
168
  exportVsdx(): VsdxExportResult;
139
169
  }
140
170
  export {};
@@ -0,0 +1,11 @@
1
+ /** The drawing tools a standalone diagram canvas offers; every one needs edit permission. */
2
+ export declare const DIAGRAM_DRAW_TOOLS: readonly ['rectangle', 'ellipse', 'line', 'freeform', 'arc', 'pencil'];
3
+ export type DiagramDrawTool = (typeof DIAGRAM_DRAW_TOOLS)[number];
4
+ /** The text box and connector tools: the full viewer's own, beside the shape drawing tools. */
5
+ export declare const DIAGRAM_OBJECT_TOOLS: readonly ['text', 'connector'];
6
+ export type DiagramObjectTool = (typeof DIAGRAM_OBJECT_TOOLS)[number];
7
+ /** Every non-pointer tool a standalone canvas offers, in toolbar order. */
8
+ export declare const DIAGRAM_TOOLS: readonly ["rectangle", "ellipse", "line", "freeform", "arc", "pencil", "text", "connector"];
9
+ /** The active canvas tool: the pointer, a drawing tool, the text tool or the connector tool. */
10
+ export type DiagramTool = 'pointer' | DiagramDrawTool | DiagramObjectTool;
11
+ export declare function isDiagramTool(value: unknown): value is DiagramTool;
@@ -1,5 +1,5 @@
1
1
  export { ViewerController, type ViewerState } from './controller.js';
2
- export { mountDiagramCanvas, fitDiagramCanvas, mountDiagramInspector, diagramToolbarProps, type DiagramToolbarProps, } from './building-blocks.js';
2
+ export { mountDiagramCanvas, fitDiagramCanvas, mountDiagramInspector, mountDiagramShapes, diagramToolbarProps, diagramMode, DIAGRAM_DRAW_TOOLS, DIAGRAM_OBJECT_TOOLS, DIAGRAM_TOOLS, type DiagramToolbarProps, type DiagramToolbarLabels, type DiagramToolbarHostCallbacks, type DiagramMode, type DiagramToolSummary, type DiagramTool, type DiagramDrawTool, type DiagramObjectTool, } from './building-blocks.js';
3
3
  export type { CreateVsdxOptions } from 'ooxml-core/visio';
4
4
  export type { ViewerClipboardState, ViewerClipboardToken } from './clipboard-capture.js';
5
5
  export { mountViewer, type MountedViewer } from './binding.js';
@@ -14,8 +14,14 @@ export declare class ViewerClipboard {
14
14
  private baseReason;
15
15
  private selectionReason;
16
16
  private hasPromiseWrite;
17
+ /** Why the operation is unavailable now, or an empty string when it can run. */
18
+ reason(operation: ClipboardOperation, state: ViewerState): string;
17
19
  private operationReason;
18
20
  run(operation: ClipboardOperation, event?: ClipboardEvent): Promise<void>;
19
- wire(): () => void;
21
+ /**
22
+ * Listen for the browser's clipboard events. By default they become ribbon actions; a surface
23
+ * without a ribbon passes its own `dispatch`.
24
+ */
25
+ wire(dispatch?: (operation: ClipboardOperation, event: ClipboardEvent) => void): () => void;
20
26
  render(state: ViewerState): void;
21
27
  }
@@ -0,0 +1,10 @@
1
+ import type { VisioEdit } from 'ooxml-core/visio';
2
+ import type { ViewerState } from './controller.js';
3
+ /**
4
+ * The edits that delete the current selection, with the generated graphics and callout leaders
5
+ * that belong to it, and the sentence to announce. Undefined when nothing can be deleted.
6
+ */
7
+ export declare function planDeleteSelection(state: ViewerState): {
8
+ edits: VisioEdit[];
9
+ message: string;
10
+ } | undefined;
@@ -0,0 +1,12 @@
1
+ import type { VisioPage } from 'ooxml-core/visio';
2
+ import type { RemotePresence } from 'ooxml-core/collab';
3
+ import { type VisioPresence } from 'ooxml-core/visio/ui';
4
+ export type PeerPresence = RemotePresence<VisioPresence>;
5
+ /** Pixels per drawing unit of `svg`, from its screen matrix (96 per inch at 100% as fallback). */
6
+ export declare function presenceScale(svg: SVGSVGElement, zoom: number): number;
7
+ /**
8
+ * Draws the collaborators on `page` into one `<g data-presence-overlay>` of the page SVG, in
9
+ * drawing units so zoom and pan move it with the drawing; pixel sizes are divided by `scale`.
10
+ * Replaces any previous overlay and removes it when nobody is on the page.
11
+ */
12
+ export declare function renderPresenceOverlay(svg: SVGSVGElement, page: VisioPage, peers: readonly PeerPresence[], scale: number): void;
@@ -0,0 +1,19 @@
1
+ import type { VisioPresence } from 'ooxml-core/visio/ui';
2
+ import type { CollabSession } from 'ooxml-core/collab';
3
+ import type { ViewerController } from './controller.js';
4
+ import { type PeerPresence } from './viewer-presence-overlay.js';
5
+ /**
6
+ * Live cursors and selections of one shared drawing: publishes this window's page, pointer and
7
+ * selection through the session's presence (already throttled there) and draws the peers that
8
+ * are on the same page over the canvas. It borrows the session; the caller owns its lifetime.
9
+ */
10
+ export declare class ViewerPresence {
11
+ #private;
12
+ private readonly session;
13
+ private readonly controller;
14
+ private readonly viewport;
15
+ constructor(session: CollabSession<VisioPresence>, controller: ViewerController, viewport: HTMLElement | null);
16
+ /** The remote collaborators currently drawn (same page or not). */
17
+ get peers(): readonly PeerPresence[];
18
+ dispose(): void;
19
+ }
@@ -1,23 +1,28 @@
1
+ import type { CollabSession } from 'ooxml-core/collab';
2
+ import type { DrawingEditor } from 'ooxml-core/visio/collab';
1
3
  import type { ViewerController } from './controller.js';
2
4
  export type Collab = typeof import('ooxml-core/collab');
5
+ export type DrawingCollab = typeof import('ooxml-core/visio/collab');
3
6
  export type Session = ReturnType<Collab['createCollabSession']>;
4
- export interface PackageSyncOptions {
7
+ export interface DrawingSyncOptions {
5
8
  /** `join` never seeds an empty room with the drawing this window already has open. */
6
9
  join: boolean;
7
- /** Reports an adoption failure. */
10
+ /** Reports a failure to share or apply a change. */
8
11
  fail(message: string): void;
9
12
  }
13
+ /** The DOM-free editor the shared-drawing binding drives, over a viewer controller. */
14
+ export declare function controllerEditor(controller: ViewerController): DrawingEditor;
10
15
  /**
11
- * Whole-package sync of one drawing over a shared session: the VSDX bytes live in
12
- * `session.doc.getMap('package')` and the last writer wins. Remote changes arrive as one undoable
13
- * history step. It borrows the session; the caller owns its lifetime.
16
+ * Property-level sync of one drawing over a shared session (`ooxml-core/visio/collab`): pages,
17
+ * shapes (per cell, row and section), connectors, masters and media merge per item; styles, theme
18
+ * and document settings are shared whole. Undo and redo act on this
19
+ * window's own edits. It borrows the session; the caller owns its lifetime.
14
20
  */
15
- export declare class PackageSync {
21
+ export declare class DrawingSync {
16
22
  #private;
17
- private readonly collab;
18
- private readonly session;
19
23
  private readonly controller;
20
- private readonly options;
21
- constructor(collab: Collab, session: Session, controller: ViewerController, options: PackageSyncOptions);
24
+ constructor(drawing: DrawingCollab, session: Pick<CollabSession<object>, 'doc' | 'synced' | 'canWrite' | 'on'>, controller: ViewerController, options: DrawingSyncOptions);
25
+ /** Resolves when queued publishing and applying has finished. */
26
+ idle(): Promise<void>;
22
27
  dispose(): void;
23
28
  }
@@ -1,30 +1,32 @@
1
- import type { CollaborationOptions, CollaborationState } from 'ooxml-core/collab';
1
+ import type { CollaborationState } from 'ooxml-core/collab';
2
2
  import type { OfficeProfile } from '../controls.js';
3
3
  import type { ViewerController } from './controller.js';
4
- import { type Collab } from './viewer-share-sync.js';
4
+ import { type Collab, type DrawingCollab } from './viewer-share-sync.js';
5
+ import type { VisioCollaborationOptions } from './collaboration-types.js';
5
6
  /** Not sharing: what `collaborationState` reports before a join and after a leave. */
6
7
  export declare const NOT_SHARING: CollaborationState;
7
8
  /**
8
9
  * Sharing of one `<visio-viewer>` over `ooxml-core/collab` (Yjs): the File > Share panel and the
9
- * host's `collaboration` property drive the same session. Peers share the whole VSDX package
10
- * (see `PackageSync`). The collab runtime loads only when sharing starts.
10
+ * host's `collaboration` property drive the same session. Peers merge pages, shapes and
11
+ * connectors item by item (see `DrawingSync`). The collab runtime loads only when sharing starts.
11
12
  */
12
13
  export declare class ViewerShare {
13
14
  #private;
14
15
  private readonly controller;
15
16
  private readonly profile;
16
17
  private readonly loadCollab;
18
+ private readonly loadDrawing;
17
19
  /** Called whenever `state` may have changed. */
18
20
  onChange: (state: CollaborationState) => void;
19
21
  /** Called with the failure of a declarative join. */
20
22
  onError: (error: Error) => void;
21
- constructor(root: ShadowRoot, controller: ViewerController, profile: () => OfficeProfile, loadCollab?: () => Promise<Collab>);
23
+ constructor(root: ShadowRoot, controller: ViewerController, profile: () => OfficeProfile, loadCollab?: () => Promise<Collab>, loadDrawing?: () => Promise<DrawingCollab>);
22
24
  get active(): boolean;
23
25
  /** The options of the declarative `collaboration` property, if set. */
24
- get wanted(): CollaborationOptions | null;
26
+ get wanted(): VisioCollaborationOptions | null;
25
27
  get state(): CollaborationState;
26
28
  /** Declarative sharing: while set, the drawing is shared; null leaves the room. */
27
- want(options: CollaborationOptions | null): void;
29
+ want(options: VisioCollaborationOptions | null): void;
28
30
  /** Leaves the room and forgets the `collaboration` property. */
29
31
  stop(): void;
30
32
  reconnect(): void;
@@ -7,3 +7,11 @@ import type { ViewerController } from './controller.js';
7
7
  * Stencil and the stencils it docks.
8
8
  */
9
9
  export declare function wireStencil(pane: HTMLElement, viewport: HTMLElement, controller: ViewerController, announce: (message: string) => void): () => void;
10
+ /**
11
+ * The Shapes window without a fixed page: `attach` makes a canvas the one masters are dropped on
12
+ * (and placed by), so a pane mounted on its own can follow whichever canvas is mounted.
13
+ */
14
+ export declare function wireStencilPane(pane: HTMLElement, controller: ViewerController, announce: (message: string) => void): {
15
+ attach(viewport: HTMLElement): () => void;
16
+ dispose(): void;
17
+ };