ooxml-ui 1.7.0 → 1.8.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 (143) hide show
  1. package/README.md +89 -36
  2. package/custom-elements.json +251 -4
  3. package/dist/chrome/ruler.d.ts +7 -1
  4. package/dist/chrome/ruler.d.ts.map +1 -1
  5. package/dist/chrome/task-pane.d.ts +2 -0
  6. package/dist/chrome/task-pane.d.ts.map +1 -1
  7. package/dist/chrome/title-bar.d.ts +2 -1
  8. package/dist/chrome/title-bar.d.ts.map +1 -1
  9. package/dist/{chunk-6UPGM3X2.js → chunk-7US5GCXF.js} +158 -153
  10. package/dist/{chunk-VAR6O7II.js → chunk-KF72ZA6V.js} +4 -2
  11. package/dist/{chunk-SCWCZSTE.js → chunk-O7APCA5N.js} +612 -69
  12. package/dist/chunk-W6AV3GHC.js +112 -0
  13. package/dist/controls.d.ts +8 -2
  14. package/dist/controls.d.ts.map +1 -1
  15. package/dist/controls.js +1 -1
  16. package/dist/dialog/dialog-footer.d.ts.map +1 -1
  17. package/dist/dialog/options-dialog.d.ts.map +1 -1
  18. package/dist/docx/editor-core.d.ts +3 -0
  19. package/dist/docx/editor-shell.d.ts +2 -0
  20. package/dist/docx/element-api.d.ts +7 -0
  21. package/dist/docx/events.d.ts +4 -1
  22. package/dist/docx/index.d.ts +1 -0
  23. package/dist/docx/ribbon-color-grid.d.ts +3 -4
  24. package/dist/docx.js +46 -78
  25. package/dist/edit-worker.js +52 -3
  26. package/dist/form/color-custom.d.ts +79 -0
  27. package/dist/form/color-custom.d.ts.map +1 -0
  28. package/dist/form/color-grid.d.ts +125 -0
  29. package/dist/form/color-grid.d.ts.map +1 -0
  30. package/dist/index.d.ts +2 -1
  31. package/dist/index.js +4 -3
  32. package/dist/menu/context-menu.d.ts.map +1 -1
  33. package/dist/menu/menu-button.d.ts +2 -1
  34. package/dist/menu/menu-button.d.ts.map +1 -1
  35. package/dist/notices/paste-options.d.ts.map +1 -1
  36. package/dist/notices/toasts.d.ts.map +1 -1
  37. package/dist/pptx/{chart-3d-view-scene-ERX2GRCD.mjs → chart-3d-view-scene-P6MAFEGL.mjs} +2 -2
  38. package/dist/pptx/{chart-3d-view-scene-55WDENSO.cjs → chart-3d-view-scene-V74F7ZOC.cjs} +38 -38
  39. package/dist/pptx/{chunk-G2YUKLRX.cjs → chunk-526IHNIH.cjs} +1 -1
  40. package/dist/pptx/{chunk-SVN6OBG4.mjs → chunk-DPOES4WM.mjs} +26 -11
  41. package/dist/pptx/{chunk-XGPLA2OY.cjs → chunk-GCS5KBMR.cjs} +481 -605
  42. package/dist/pptx/{chunk-RPRC2EG5.cjs → chunk-K3S2A64B.cjs} +13 -13
  43. package/dist/pptx/{chunk-RCTRRS6E.mjs → chunk-MCHPNO42.mjs} +264 -447
  44. package/dist/pptx/{chunk-AWQRQUPL.mjs → chunk-NAFUYAQP.mjs} +1 -1
  45. package/dist/pptx/{chunk-LCIXR7WE.cjs → chunk-VFPVEVF4.cjs} +26 -11
  46. package/dist/pptx/{chunk-TKATCPOK.mjs → chunk-ZAOYPCAM.mjs} +1 -1
  47. package/dist/pptx/dom/activex-controls-overlay.d.ts.map +1 -1
  48. package/dist/pptx/dom/elements/image.d.ts.map +1 -1
  49. package/dist/pptx/dom/elements/media.d.ts.map +1 -1
  50. package/dist/pptx/dom/elements/text-block.d.ts.map +1 -1
  51. package/dist/pptx/dom/elements/zoom.d.ts.map +1 -1
  52. package/dist/pptx/dom/index.cjs +252 -247
  53. package/dist/pptx/dom/index.mjs +11 -6
  54. package/dist/pptx/export/html2canvas-clone.cjs +2 -2
  55. package/dist/pptx/export/html2canvas-clone.mjs +1 -1
  56. package/dist/pptx/index.cjs +3059 -3023
  57. package/dist/pptx/index.mjs +4 -4
  58. package/dist/pptx/render/chart-combo-series.d.ts.map +1 -1
  59. package/dist/pptx/render/chart-combo-stock.cjs +3 -3
  60. package/dist/pptx/render/chart-combo-stock.mjs +1 -1
  61. package/dist/pptx/render/chart-marker-shape.d.ts.map +1 -1
  62. package/dist/pptx/render/chart-overlays.cjs +7 -7
  63. package/dist/pptx/render/chart-overlays.mjs +1 -1
  64. package/dist/pptx/render/chart-surface-treemap.cjs +4 -4
  65. package/dist/pptx/render/chart-surface-treemap.mjs +1 -1
  66. package/dist/pptx/render/chart-view-model.cjs +44 -44
  67. package/dist/pptx/render/chart-view-model.mjs +1 -1
  68. package/dist/pptx/render/chart-waterfall-map.cjs +6 -6
  69. package/dist/pptx/render/chart-waterfall-map.mjs +1 -1
  70. package/dist/pptx/render/connector-router-types.d.ts +4 -52
  71. package/dist/pptx/render/connector-router-types.d.ts.map +1 -1
  72. package/dist/pptx/render/connector-router.d.ts +4 -32
  73. package/dist/pptx/render/connector-router.d.ts.map +1 -1
  74. package/dist/pptx/render/index.d.ts +1 -0
  75. package/dist/pptx/render/index.d.ts.map +1 -1
  76. package/dist/pptx/render/ribbon-add-ins.d.ts +53 -0
  77. package/dist/pptx/render/ribbon-add-ins.d.ts.map +1 -0
  78. package/dist/pptx/web-components/index.d.ts +1 -0
  79. package/dist/pptx/web-components/index.d.ts.map +1 -1
  80. package/dist/pptx/web-components/ribbon-add-in.d.ts +20 -0
  81. package/dist/pptx/web-components/ribbon-add-in.d.ts.map +1 -0
  82. package/dist/ribbon/add-in-tabs.d.ts +36 -0
  83. package/dist/ribbon/group-overflow.d.ts +37 -0
  84. package/dist/ribbon/group-overflow.d.ts.map +1 -0
  85. package/dist/ribbon/ribbon-tabs.d.ts.map +1 -1
  86. package/dist/teams/app/index.d.ts +1 -1
  87. package/dist/teams.js +2 -2
  88. package/dist/visio/format-pane-fields.d.ts +42 -0
  89. package/dist/visio/format-pane-view.d.ts +44 -0
  90. package/dist/visio/index.d.ts +1 -0
  91. package/dist/visio/page-setup-action.d.ts +4 -0
  92. package/dist/visio/ribbon-action.d.ts +17 -6
  93. package/dist/visio/ribbon-change-shape.d.ts +17 -6
  94. package/dist/visio/ribbon-color-menu.d.ts +29 -0
  95. package/dist/visio/ribbon-inline-galleries.d.ts +20 -0
  96. package/dist/visio/ribbon-overflow.d.ts +7 -0
  97. package/dist/visio/ribbon-review.d.ts +5 -2
  98. package/dist/visio/ribbon-router.d.ts +3 -3
  99. package/dist/visio/ribbon-shape-styles.d.ts +4 -1
  100. package/dist/visio/ribbon-style-options.d.ts +4 -3
  101. package/dist/visio/shapes-document.d.ts +29 -0
  102. package/dist/visio/shapes-sections.d.ts +19 -5
  103. package/dist/visio/shapes-storage.d.ts +15 -0
  104. package/dist/visio/shapes-window.d.ts +7 -0
  105. package/dist/visio/stencil-catalog.d.ts +4 -0
  106. package/dist/visio/text-measurer.d.ts +25 -0
  107. package/dist/visio/viewer-auto-connect-parts.d.ts +12 -0
  108. package/dist/visio/viewer-auto-connect.d.ts +33 -0
  109. package/dist/visio/viewer-change-shape.d.ts +8 -4
  110. package/dist/visio/viewer-chrome.d.ts +3 -2
  111. package/dist/visio/viewer-color-menus.d.ts +34 -0
  112. package/dist/visio/viewer-commands.d.ts +4 -3
  113. package/dist/visio/viewer-connector-tool.d.ts +5 -3
  114. package/dist/visio/viewer-data-window.d.ts +5 -1
  115. package/dist/visio/viewer-draw-tool.d.ts +1 -11
  116. package/dist/visio/viewer-element.d.ts +8 -0
  117. package/dist/visio/viewer-format-pane.d.ts +26 -0
  118. package/dist/visio/viewer-guides.d.ts +3 -3
  119. package/dist/visio/viewer-layout-commands.d.ts +5 -1
  120. package/dist/visio/viewer-more-colors.d.ts +16 -0
  121. package/dist/visio/viewer-page-setup.d.ts +6 -0
  122. package/dist/visio/viewer-ruler-grid.d.ts +25 -0
  123. package/dist/visio/viewer-ruler.d.ts +11 -3
  124. package/dist/visio/viewer-snap-glue.d.ts +23 -0
  125. package/dist/visio/viewer-stencil.d.ts +4 -1
  126. package/dist/visio.js +6688 -5303
  127. package/dist/xlsx/component.d.ts +8 -0
  128. package/dist/xlsx/dialogs/format-cells/color-swatches.d.ts +4 -2
  129. package/dist/xlsx/dialogs/styles.d.ts +1 -1
  130. package/dist/xlsx/events.d.ts +4 -1
  131. package/dist/xlsx/index.d.ts +1 -0
  132. package/dist/xlsx/ribbon/color-grid.d.ts +25 -7
  133. package/dist/xlsx/ribbon/ribbon.d.ts +3 -0
  134. package/dist/xlsx.js +121 -163
  135. package/package.json +3 -2
  136. package/dist/pptx/render/connector-router-astar.d.ts +0 -24
  137. package/dist/pptx/render/connector-router-astar.d.ts.map +0 -1
  138. package/dist/pptx/render/connector-router-graph.d.ts +0 -38
  139. package/dist/pptx/render/connector-router-graph.d.ts.map +0 -1
  140. package/dist/visio/format-shape-dialog.d.ts +0 -21
  141. package/dist/visio/viewer-format-shape.d.ts +0 -16
  142. package/dist/visio/viewer-paint-dialog.d.ts +0 -28
  143. package/dist/visio/viewer-paint-properties.d.ts +0 -13
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Ribbon add-in tabs: tabs a host application adds after the product's own, as an Office add-in
3
+ * does (Visio's and Excel's ACROBAT tab). The host describes each tab with plain data; every
4
+ * product editor exposes the list as its `ribbonAddIns` property and renders it with
5
+ * `syncRibbonAddIns`, so one descriptor works in every editor. An add-in command never reaches
6
+ * the product's own command router: it runs its `run` callback and is announced with the
7
+ * `office-ribbon-add-in` event, which leaves the editor's shadow tree. The descriptor itself is
8
+ * DOM-free and lives in `ooxml-core/ribbon`, so the binding contracts in the core share it.
9
+ */
10
+ import { type RibbonAddInCommandDetail, type RibbonAddInTab } from 'ooxml-core/ribbon';
11
+ export { RIBBON_ADD_IN_EVENT, type RibbonAddInCommand, type RibbonAddInCommandDetail, type RibbonAddInGroup, type RibbonAddInTab, } from 'ooxml-core/ribbon';
12
+ /**
13
+ * Defines the shared elements an add-in panel is built from. A product whose own ribbon uses
14
+ * other controls (Word's is hand-built) never registered them, and an undefined
15
+ * `office-ui-button` is an empty, inert tag: the panel would show nothing.
16
+ */
17
+ export declare function defineRibbonAddInElements(registry: CustomElementRegistry | undefined): void;
18
+ /** Bubbling and composed, dispatched from the ribbon when an add-in command is chosen. */
19
+ export type OfficeRibbonAddInEvent = CustomEvent<RibbonAddInCommandDetail>;
20
+ export interface RibbonAddInOptions {
21
+ /** Class of each tab panel, for products that style their own panels (`ribbon-content`). */
22
+ panelClass?: string;
23
+ /** Wraps the groups of a panel, for products whose panels hold one toolbar row. */
24
+ wrap?: (doc: Document, tab: RibbonAddInTab, groups: HTMLElement[]) => HTMLElement[];
25
+ }
26
+ /**
27
+ * Shows `tabs` as the add-in panels of `ribbon` (an `office-ui-ribbon`), after the product's own
28
+ * panels and in the given order. A tab whose id is empty, repeated or already a product tab is
29
+ * skipped, so an add-in can never replace a built-in tab. The selected tab is kept when it still
30
+ * exists. Returns the ids that are shown.
31
+ *
32
+ * The panels are rebuilt only when something visible changed. A framework that passes a new
33
+ * array with new `run` callbacks on every render therefore keeps its panels (and an open
34
+ * drop-down), and a command always runs the callback of the latest descriptor.
35
+ */
36
+ export declare function syncRibbonAddIns(ribbon: HTMLElement, tabs: readonly RibbonAddInTab[], options?: RibbonAddInOptions): string[];
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Ribbon overflow for ribbons built from `office-ui-ribbon-group` elements: when the visible tab
3
+ * panel is narrower than its groups, the groups collapse from the right, each into the one button
4
+ * the group element already draws (`data-collapsed`), and that button opens the group's commands
5
+ * in a popup (`data-open`). This is what Office does when a window narrows; the panel scrolls only
6
+ * when even the collapsed groups do not fit.
7
+ *
8
+ * `createRibbonOverflow` (overflow.ts) does the same for ribbons made of plain `.ribbon-group`
9
+ * elements (Word, Excel) by moving their controls; here the controls never leave the group, so
10
+ * the product's own listeners and state hooks keep working.
11
+ */
12
+ export interface RibbonGroupOverflowOptions {
13
+ /** The registered icon of a collapsed group (by element); the group's `icon` attribute wins. */
14
+ icon?(group: HTMLElement): string | undefined;
15
+ /** Below this window width nothing collapses (a product's phone layout takes over). */
16
+ minWidth?: number;
17
+ }
18
+ export interface RibbonGroupOverflow {
19
+ /** Re-measures the visible panel now (after a tab switch or new tabs). */
20
+ refit(): void;
21
+ /** Closes the open group popup. */
22
+ close(): void;
23
+ destroy(): void;
24
+ }
25
+ /**
26
+ * Collapses groups of `panel` from the right until it no longer overflows. Returns the labels of
27
+ * the collapsed groups, rightmost first.
28
+ */
29
+ export declare function fitRibbonGroups(panel: HTMLElement, options?: RibbonGroupOverflowOptions): string[];
30
+ /**
31
+ * Keeps the visible panel of `ribbon` (an `office-ui-ribbon`) fitted as the ribbon resizes, the
32
+ * tab changes and panels are added, and owns which collapsed group is open: a press on a
33
+ * collapsed group's button toggles its popup; Escape, a click elsewhere or a command chosen in
34
+ * the popup closes it.
35
+ */
36
+ export declare function attachRibbonGroupOverflow(ribbon: HTMLElement, options?: RibbonGroupOverflowOptions): RibbonGroupOverflow;
37
+ //# sourceMappingURL=group-overflow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"group-overflow.d.ts","sourceRoot":"","sources":["../../src/ribbon/group-overflow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,WAAW,0BAA0B;IAC1C,gGAAgG;IAChG,IAAI,CAAC,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,GAAG,SAAS,CAAC;IAC9C,uFAAuF;IACvF,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,mBAAmB;IACnC,0EAA0E;IAC1E,KAAK,IAAI,IAAI,CAAC;IACd,mCAAmC;IACnC,KAAK,IAAI,IAAI,CAAC;IACd,OAAO,IAAI,IAAI,CAAC;CAChB;AAoBD;;;GAGG;AACH,wBAAgB,eAAe,CAC9B,KAAK,EAAE,WAAW,EAClB,OAAO,GAAE,0BAA+B,GACtC,MAAM,EAAE,CAkBV;AAiBD;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACxC,MAAM,EAAE,WAAW,EACnB,OAAO,GAAE,0BAA+B,GACtC,mBAAmB,CAyGrB"}
@@ -1 +1 @@
1
- {"version":3,"file":"ribbon-tabs.d.ts","sourceRoot":"","sources":["../../src/ribbon/ribbon-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,IAAI,iBAAiB,GAAG,IAAI,CAErC;IAED;;;OAGG;IACH,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI,CAS/D;IAED,OAAO,CAAC,MAAM;IAMd,sEAAsE;IACtE,OAAO,CAAC,KAAK;IAIb,2FAA2F;IAC3F,OAAO,CAAC,KAAK;IAmBb,OAAO,CAAC,YAAY;IAOpB,OAAO,CAAC,SAAS,CAEf;IAEF,OAAO,CAAC,gBAAgB;IAKxB,mFAAmF;IACnF,OAAO,CAAC,YAAY;IAOpB,UAAmB,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC,WAAW,EAAE,OAAO,CAAC,GAAG,IAAI,CAMtE;IAED,OAAO,CAAC,MAAM;IAMd,OAAO,CAAC,UAAU;IAKlB,4EAA4E;IAC5E,OAAO,CAAC,SAAS,CAKf;IAEF,OAAO,CAAC,KAAK;IAsBb,2EAA2E;IAC3E,OAAO,CAAC,OAAO,CAA+B;IAErC,iBAAiB,IAAI,IAAI,CAWjC;IAEQ,oBAAoB,IAAI,IAAI,CAMpC;IAED,+BAA+B;IAC/B,UAAmB,OAAO,IAAI,IAAI,CAKjC;IAED,UAAmB,MAAM,oCA0DxB;CACD;AAED,eAAO,MAAM,YAAY,+BAAoD,CAAC"}
@@ -3,7 +3,7 @@ export { TeamsSettings, defineTeamsSettings, parseIceLines } from './teams-setti
3
3
  export { TeamsController } from './controller.js';
4
4
  export { TeamsChannelTab, defineTeamsChannelTab } from './channel-tab.js';
5
5
  export { TeamsFilesPanel, defineTeamsFilesPanel } from './files-panel.js';
6
- export { TeamsPresentationPreview, defineTeamsPresentationPreview, } from './presentation-preview.js';
6
+ export { TeamsPresentationPreview, defineTeamsPresentationPreview } from './presentation-preview.js';
7
7
  export { TeamsContentPreview, defineTeamsContentPreview, type FileEmbeds, type SaveFileCopy, } from './content-preview.js';
8
8
  export { applyTeamsProps, listenTeamsEvents, type TeamsProps } from './bind.js';
9
9
  export * from './store.js';
package/dist/teams.js CHANGED
@@ -1,7 +1,7 @@
1
- export { EMOJI, OfficeUiAppRail, OfficeUiAvatar, OfficeUiCallControls, OfficeUiCallGrid, OfficeUiChannelList, OfficeUiChatComposer, OfficeUiChatList, OfficeUiPrejoin, QUICK_REACTIONS, TEAMS_TAGS, TeamsApp, TeamsChannelTab, TeamsContentPreview, TeamsController, TeamsElement, TeamsFilesPanel, TeamsSettings, applyTeamsProps, colorFor, createTeams, dayLabel, defineAppRail, defineAvatar, defineCallControls, defineCallGrid, defineChannelList, defineChatComposer, defineChatList, definePrejoin, defineTeamsApp, defineTeamsChannelTab, defineTeamsContentPreview, defineTeamsFilesPanel, defineTeamsSettings, formatElapsed, formatSize, formatTime, icon, listenTeamsEvents, loadConfig, loadIdentity, parseIceLines, registerTeams, safeStorage, saveConfig, saveIdentity, withStyles } from './chunk-6UPGM3X2.js';
1
+ export { EMOJI, OfficeUiAppRail, OfficeUiAvatar, OfficeUiCallControls, OfficeUiCallGrid, OfficeUiChannelList, OfficeUiChatComposer, OfficeUiChatList, OfficeUiPrejoin, QUICK_REACTIONS, TEAMS_TAGS, TeamsApp, TeamsChannelTab, TeamsContentPreview, TeamsController, TeamsElement, TeamsFilesPanel, TeamsSettings, applyTeamsProps, colorFor, createTeams, dayLabel, defineAppRail, defineAvatar, defineCallControls, defineCallGrid, defineChannelList, defineChatComposer, defineChatList, definePrejoin, defineTeamsApp, defineTeamsChannelTab, defineTeamsContentPreview, defineTeamsFilesPanel, defineTeamsSettings, formatElapsed, formatSize, formatTime, icon, listenTeamsEvents, loadConfig, loadIdentity, parseIceLines, registerTeams, safeStorage, saveConfig, saveIdentity, withStyles } from './chunk-7US5GCXF.js';
2
2
  export { TeamsPresentationPreview, defineTeamsPresentationPreview } from './chunk-SNV6YKPC.js';
3
3
  import './chunk-BCH2ZLWI.js';
4
- import './chunk-SCWCZSTE.js';
4
+ import './chunk-O7APCA5N.js';
5
5
  import './chunk-M6GF5ED2.js';
6
6
  import './chunk-L7JV5FVE.js';
7
7
  import './chunk-OGNNNTKI.js';
@@ -0,0 +1,42 @@
1
+ import { type VisioShape, type VisioShapeFormatEdit } from 'ooxml-core/visio';
2
+ import { visioShapeEffectValues, visioShapeFormattingState } from 'ooxml-core/visio/ui';
3
+ export type PanePatch = Omit<VisioShapeFormatEdit, 'type' | 'pageId' | 'shapeId'>;
4
+ /** Where a field sits: under the fill choices, under the line choices, or in Effects. */
5
+ export type PaneFieldGroup = 'fill' | 'line' | 'effects';
6
+ /** What a field reads its value from: the selection and its common formatting. */
7
+ export interface PaneFieldContext {
8
+ shapes: readonly VisioShape[];
9
+ common: ReturnType<typeof visioShapeFormattingState>;
10
+ effects: readonly ReturnType<typeof visioShapeEffectValues>[];
11
+ }
12
+ export interface PaneField {
13
+ key: string;
14
+ label: string;
15
+ group: PaneFieldGroup;
16
+ /** A list of choices; without it the field is a number. */
17
+ options?: readonly {
18
+ value: string;
19
+ label: string;
20
+ }[];
21
+ /** Largest number accepted, and what the reason calls the value. */
22
+ max?: number;
23
+ step?: string;
24
+ name?: string;
25
+ /** The selection's value as field text; empty when the shapes differ. */
26
+ read(context: PaneFieldContext): string;
27
+ patch(value: number, context: PaneFieldContext): PanePatch;
28
+ }
29
+ /**
30
+ * The Format Shape pane's fields beyond colour, transparency, width and dash: Visio's fill
31
+ * pattern, line cap, line ends and rounding, and the Effects section. Each is one existing
32
+ * `format-shape` property, read from the selection and applied at once.
33
+ */
34
+ export declare const PANE_FIELDS: readonly PaneField[];
35
+ export declare function paneFieldContext(shapes: readonly VisioShape[]): PaneFieldContext;
36
+ /** The glow colour is a colour control of its own; the patch keeps the glow's other values. */
37
+ export declare const glowColorPatch: (shapes: readonly VisioShape[], color: string) => PanePatch;
38
+ /** One labelled row with a select or number input carrying `data-pane-field`. */
39
+ export declare function paneFieldRow(doc: Document, field: PaneField): {
40
+ row: HTMLLabelElement;
41
+ input: HTMLInputElement | HTMLSelectElement;
42
+ };
@@ -0,0 +1,44 @@
1
+ import type { OfficeUiColorGrid } from '../controls.js';
2
+ import { type PaneFieldGroup } from './format-pane-fields.js';
3
+ export type PaneTarget = 'fill' | 'line';
4
+ export type PaneNumber = 'fillTransparency' | 'lineTransparency' | 'lineWeight';
5
+ /** Every colour the pane sets: the two paints, the pattern's background and the glow. */
6
+ export type PaneColor = PaneTarget | 'fillBackground' | 'glow';
7
+ export type PaneSection = PaneFieldGroup;
8
+ /** A button showing a colour that opens the shared colour grid under it. */
9
+ export interface FormatPaneColor {
10
+ row: HTMLElement;
11
+ button: HTMLButtonElement;
12
+ grid: OfficeUiColorGrid;
13
+ }
14
+ export interface FormatPaneSection {
15
+ set: HTMLFieldSetElement;
16
+ none: HTMLInputElement;
17
+ solid: HTMLInputElement;
18
+ /** Everything that only applies to a visible fill or line. */
19
+ details: HTMLElement;
20
+ }
21
+ export interface FormatPaneView {
22
+ section: HTMLElement;
23
+ hint: HTMLElement;
24
+ fill: FormatPaneSection;
25
+ line: FormatPaneSection;
26
+ effects: HTMLFieldSetElement;
27
+ colors: Record<PaneColor, FormatPaneColor>;
28
+ numbers: Record<PaneNumber, HTMLInputElement>;
29
+ dash: HTMLSelectElement;
30
+ /** The fields of `PANE_FIELDS`, by key. */
31
+ fields: Map<string, HTMLInputElement | HTMLSelectElement>;
32
+ }
33
+ export declare const GRADIENT_UNSUPPORTED = "A gradient fill is shown as saved, but its stops, angle and type cannot be changed yet.";
34
+ /** Visio's dash types 1-23; 0 (no line) is the No line choice. */
35
+ export declare const DASH_TYPES: {
36
+ value: string;
37
+ label: string;
38
+ }[];
39
+ /**
40
+ * The Format Shape task pane view: Fill, Line and Effects, as plain controls the pane class
41
+ * drives. Fill and Line start with their none/solid choice, colour and transparency; the rest of
42
+ * each section comes from `PANE_FIELDS`.
43
+ */
44
+ export declare function createFormatPaneView(doc: Document): FormatPaneView;
@@ -16,3 +16,4 @@ export type { ViewerEditState, VsdxExportResult } from 'ooxml-core/visio/ui';
16
16
  export type { VisioEdit, VisioGeometryEdit } from 'ooxml-core/visio';
17
17
  /** The built-in demo document, for the demo and tests. */
18
18
  export { demoDocument } from 'ooxml-core/visio/ui';
19
+ export { RIBBON_ADD_IN_EVENT, type OfficeRibbonAddInEvent, type RibbonAddInCommand, type RibbonAddInCommandDetail, type RibbonAddInGroup, type RibbonAddInTab, } from '../ribbon/add-in-tabs.js';
@@ -26,4 +26,8 @@ export type VisioPageSetupCommand = {
26
26
  style: VisioBorderStyle | null;
27
27
  } | {
28
28
  op: 'page-breaks';
29
+ }
30
+ /** Design > Connectors > Show Line Jumps: the page's LineJumpCode on (1) or off (0). */
31
+ | {
32
+ op: 'line-jumps';
29
33
  };
@@ -1,3 +1,4 @@
1
+ import type { VisioThemeColorRef } from 'ooxml-core/visio';
1
2
  import type { VisioBuiltInThemeId, VisioCalloutStyle, VisioChangeShapeTarget, VisioContainerStyle, VisioConnectorRoute, VisioShapeFormatEdit } from 'ooxml-core/visio';
2
3
  import type { TextCaseMode, VisioArrangement, VisioRuleSetId, VisioLayoutStyle } from 'ooxml-core/visio/ui';
3
4
  import type { VisioPageSetupCommand } from './page-setup-action.js';
@@ -8,8 +9,13 @@ export type VisioFormattingAction = {
8
9
  } | {
9
10
  type: 'font-color';
10
11
  value?: string;
12
+ theme?: VisioThemeColorRef;
11
13
  } | {
12
14
  type: 'text-bullets';
15
+ }
16
+ /** Home > Paragraph > Rotate Text: the text block turns 90 degrees counter-clockwise. */
17
+ | {
18
+ type: 'text-rotate';
13
19
  } | {
14
20
  type: 'text-indent';
15
21
  direction: 'increase' | 'decrease';
@@ -63,7 +69,7 @@ export type VisioDiagramPartAction = {
63
69
  style: VisioCalloutStyle;
64
70
  };
65
71
  /** Data-tab commands: import, refresh, data graphics, legend, windows and Shape Data. */
66
- export type VisioDataCommand = 'quick-import' | 'custom-import' | 'refresh' | 'graphic-text' | 'graphic-bar' | 'graphic-icon' | 'graphic-color' | 'graphic-remove' | 'legend' | 'external-data-window' | 'define-shape-data';
72
+ export type VisioDataCommand = 'quick-import' | 'custom-import' | 'refresh' | 'graphic-text' | 'graphic-bar' | 'graphic-icon' | 'graphic-color' | 'graphic-remove' | 'legend' | 'legend-horizontal' | 'external-data-window' | 'define-shape-data';
67
73
  /** Arrangement, layout, layer, selection, view and output commands (viewer-layout and friends). */
68
74
  export type VisioLayoutAction = {
69
75
  type: 'auto-align';
@@ -84,6 +90,8 @@ export type VisioLayoutAction = {
84
90
  type: 'guides';
85
91
  } | {
86
92
  type: 'dynamic-grid';
93
+ } | {
94
+ type: 'auto-connect';
87
95
  } | {
88
96
  type: 'drawing-explorer';
89
97
  } | {
@@ -116,10 +124,11 @@ export type VisioRibbonAction = VisioFormattingAction | VisioLayoutAction | {
116
124
  } | {
117
125
  type: 'text-feature';
118
126
  feature: VisioTextFeature;
119
- } | {
120
- type: 'paint-properties';
121
- } | {
127
+ }
128
+ /** Opens the Format Shape task pane, at one of its sections when given. */
129
+ | {
122
130
  type: 'format-shape-pane';
131
+ section?: 'fill' | 'line' | 'effects';
123
132
  } | {
124
133
  type: 'page-theme';
125
134
  theme?: VisioBuiltInThemeId | 'none';
@@ -144,9 +153,11 @@ export type VisioRibbonAction = VisioFormattingAction | VisioLayoutAction | {
144
153
  } | {
145
154
  type: 'flip';
146
155
  axis: 'horizontal' | 'vertical';
147
- } | {
156
+ }
157
+ /** A Basic Shapes outline, or `document:<id>` for a master of the drawing's own stencil. */
158
+ | {
148
159
  type: 'change-shape';
149
- shape: VisioChangeShapeTarget;
160
+ shape: VisioChangeShapeTarget | `document:${string}`;
150
161
  } | VisioDiagramPartAction | {
151
162
  type: 'pane';
152
163
  pane: 'shapes' | 'inspector';
@@ -1,11 +1,22 @@
1
1
  import type { OfficeGalleryState, OfficeUiGallery } from '../ribbon/gallery.js';
2
- /** Gallery state for the Basic Shapes; `reason` disables every tile and names why. */
3
- export declare function changeShapeState(reason: string | undefined): OfficeGalleryState;
2
+ /** A master of the drawing a stencil shape can change to; `preview` is its drawn SVG markup. */
3
+ export interface ChangeShapeMaster {
4
+ id: string;
5
+ name: string;
6
+ preview?: string;
7
+ }
4
8
  /**
5
- * Home > Editing > Change Shape: the shared `office-ui-gallery` of the Basic Shapes masters. A
6
- * pick raises `{ type: 'change-shape', shape }`; the viewer keeps `disabled` and the trigger's
7
- * tooltip in step with the selection (`syncChangeShape`).
9
+ * Gallery state: the Basic Shapes for a shape drawn here; for a stencil shape the other masters
10
+ * of the Document Stencil (`masters`) and, when `builtIn` allows, the Basic Shapes too (the shape
11
+ * then becomes an instance of that built-in master). `reason` disables every tile and names why.
12
+ */
13
+ export declare function changeShapeState(reason: string | undefined, masters?: readonly ChangeShapeMaster[], builtIn?: boolean): OfficeGalleryState;
14
+ /**
15
+ * Home > Editing > Change Shape: the shared `office-ui-gallery`. A pick raises
16
+ * `{ type: 'change-shape', shape }`, where `shape` is a Basic Shapes outline or `document:<id>`
17
+ * for a master of the drawing; the viewer keeps the tiles, `disabled` and the trigger's tooltip
18
+ * in step with the selection (`syncChangeShape`).
8
19
  */
9
20
  export declare function changeShapeGallery(doc: Document): OfficeUiGallery;
10
21
  /** Enable the gallery, or disable it with the reason as its tooltip (as unsupported commands do). */
11
- export declare function syncChangeShape(gallery: OfficeUiGallery, reason: string | undefined): void;
22
+ export declare function syncChangeShape(gallery: OfficeUiGallery, reason: string | undefined, masters?: readonly ChangeShapeMaster[], builtIn?: boolean): void;
@@ -0,0 +1,29 @@
1
+ import { type VisioPage, type VisioThemeColorRef } from 'ooxml-core/visio';
2
+ import type { OfficeColorPick, OfficeUiColorGrid } from '../controls.js';
3
+ import type { VisioFormattingAction } from './ribbon-action.js';
4
+ /** What a colour menu paints: a shape's fill, its line, or its text. */
5
+ export type ColorTarget = 'fill' | 'line' | 'font';
6
+ export declare const MORE_COLORS = "More Colors...";
7
+ /**
8
+ * Office's colour picker for a ribbon menu or the Format Shape pane: Theme Colors, Standard
9
+ * Colors, recent colours, No Fill or No Line, and More Colors. `data-color-grid` names the target.
10
+ */
11
+ export declare function colorGrid(doc: Document, target: ColorTarget): OfficeUiColorGrid;
12
+ /**
13
+ * The formatting action a picked colour (`#rrggbb` or `'none'`) stands for. `theme` is the Theme
14
+ * Colors swatch it came from: the colour is then saved as Visio's theme formula.
15
+ */
16
+ export declare function colorAction(target: ColorTarget, color: string, theme?: VisioThemeColorRef): VisioFormattingAction;
17
+ export declare const THEME_COLUMN_NAMES: readonly string[];
18
+ /** The page's Theme Colors as the picker shows them: ten columns and the variant colours row. */
19
+ export declare function pageThemeGrid(page: VisioPage | undefined): {
20
+ colors: string[];
21
+ variants: {
22
+ hex: string;
23
+ label: string;
24
+ }[];
25
+ };
26
+ /** The theme reference a pick from the grid stands for; undefined for a fixed colour. */
27
+ export declare function pickedThemeColor(pick: OfficeColorPick): VisioThemeColorRef | undefined;
28
+ /** The value all `values` share, or undefined when they differ or there are none. */
29
+ export declare function commonColor(values: readonly (string | undefined)[]): string | undefined;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Visio shows Quick Styles, Themes and Variants as a row of tiles in the ribbon, with a More
3
+ * button for the whole gallery. The shared `office-ui-gallery` draws that row (`mode="inline"`);
4
+ * this module decides how many tiles fit, because the ribbon does not fold its groups: a narrow
5
+ * viewer shows fewer tiles, and a phone-sized one shows the labelled drop-down button instead.
6
+ */
7
+ /**
8
+ * `[minimum viewer width, tiles shown]`, widest first. The widths are where the Home and Design
9
+ * rows still fit the viewer with that many tiles. Two tiles are no wider than the labelled
10
+ * drop-down button, so they stay down to the phone layout, where the button returns.
11
+ */
12
+ export declare const INLINE_GALLERY_STEPS: Readonly<Record<string, readonly (readonly [number, number])[]>>;
13
+ /** How many tiles of gallery `id` a viewer `width` pixels wide shows inline (0: a drop-down). */
14
+ export declare function inlineGalleryTiles(id: string, width: number): number;
15
+ /** Marks a gallery inline at its widest size; `wireInlineGalleries` narrows it to the viewer. */
16
+ export declare function inlineGallery(gallery: HTMLElement, id: string): void;
17
+ /** Fits every inline gallery under `root` to a viewer `width` pixels wide. */
18
+ export declare function fitInlineGalleries(root: ParentNode, width: number): void;
19
+ /** Keeps the inline galleries fitted to the viewer's width. Returns the disposer. */
20
+ export declare function wireInlineGalleries(host: HTMLElement, root: ParentNode): () => void;
@@ -0,0 +1,7 @@
1
+ import { type RibbonGroupOverflow } from '../ribbon/group-overflow.js';
2
+ /**
3
+ * Visio collapses ribbon groups into buttons, from the right, when the window is too narrow for
4
+ * them (on Home: Editing first, Clipboard last). The folding is ooxml-ui's shared
5
+ * `attachRibbonGroupOverflow`; this supplies Visio's group icons.
6
+ */
7
+ export declare function wireRibbonOverflow(ribbon: HTMLElement): RibbonGroupOverflow;
@@ -1,4 +1,7 @@
1
- /** Visio's Process tab: Subprocess and Diagram Validation (this viewer's generic rules). */
1
+ /**
2
+ * Visio's Process tab: Subprocess, Diagram Validation (this viewer's generic rules) and SharePoint
3
+ * Workflow, which is shown disabled because no server is connected.
4
+ */
2
5
  export declare function buildProcessPanel(doc: Document, panel: HTMLElement): void;
3
- /** Visio's Review tab: Proofing, Language, Comments and Reports. */
6
+ /** Visio's Review tab: Proofing, Accessibility, Language, Comments and Reports. */
4
7
  export declare function buildReviewPanel(doc: Document, panel: HTMLElement): void;
@@ -29,8 +29,8 @@ export interface RibbonTargets {
29
29
  insert(item: VisioInsertItem): void;
30
30
  data(command: VisioDataCommand): void;
31
31
  textFeature(feature: VisioTextFeature): void;
32
- showPaintProperties(): void;
33
- showFormatShape(): void;
32
+ /** Opens the Format Shape task pane, at a section when given. */
33
+ showFormatPane(section?: 'fill' | 'line' | 'effects'): void;
34
34
  pageTheme(action: Extract<VisioRibbonAction, {
35
35
  type: 'page-theme';
36
36
  }>): void;
@@ -45,7 +45,7 @@ export interface RibbonTargets {
45
45
  toggleFullscreen(): void;
46
46
  present(): void;
47
47
  togglePane(pane: 'shapes' | 'inspector'): void;
48
- reveal(panel: 'edit' | 'notes' | 'selection', focusText: boolean): void;
48
+ reveal(panel: 'edit' | 'notes' | 'selection' | 'format', focusText: boolean): void;
49
49
  fit(mode: 'page' | 'width'): void;
50
50
  focusSearch(): void;
51
51
  focusReplace(): void;
@@ -7,7 +7,10 @@ export declare const quickStyleItemId: (color: VisioQuickStyleColor, matrix: num
7
7
  /** The gallery's items: one row per style matrix, one column per theme colour, as in Visio. */
8
8
  export declare function quickStyleItems(): OfficeGalleryItem[];
9
9
  export declare function quickStyleGalleryState(disabled: boolean): OfficeGalleryState;
10
- /** Home > Shape Styles > Quick Styles: the shared Office gallery raising typed format actions. */
10
+ /**
11
+ * Home > Shape Styles > Quick Styles: the shared Office gallery, shown as Visio's row of tiles with
12
+ * a More button, raising typed format actions.
13
+ */
11
14
  export declare function quickStyleGallery(doc: Document): HTMLElement;
12
15
  /** Stable menu ids of the effect presets, shared with the selection state sync. */
13
16
  export declare const glowItemId: (size: number, accent: number) => string;
@@ -1,5 +1,6 @@
1
1
  import type { CommandSpec } from './ribbon-parts.js';
2
- /** The common Office solid font colors, with an explicit typed action per entry. */
3
- export declare function fontColorOptions(): CommandSpec[];
4
- /** Supported solid paints use the shared Office menu and source-backed format actions. */
2
+ /**
3
+ * The commands under the colour grid of Home > Fill and Line (`colorGrid` supplies the colours,
4
+ * No Fill or No Line and More Colors): line weight and pattern, and the paint options dialog.
5
+ */
5
6
  export declare function paintOptions(target: 'fill' | 'line'): CommandSpec[];
@@ -0,0 +1,29 @@
1
+ import { type VisioDocument, type VisioMaster } from 'ooxml-core/visio';
2
+ import type { Master } from './stencil-catalog.js';
3
+ /** The stencil of the drawing's own masters, as Visio's Document Stencil. */
4
+ export declare const DOCUMENT_STENCIL_ID = "document";
5
+ export declare const DOCUMENT_STENCIL_NAME = "Document Stencil";
6
+ /** `data-master` and drag payload prefix of a document master; the rest is the master ID. */
7
+ export declare const DOCUMENT_MASTER_PREFIX = "document:";
8
+ /** Masters drawn in the Shapes window; a drawing with more lists the first ones. */
9
+ export declare const DOCUMENT_MASTER_LIMIT = 200;
10
+ /** What the Shapes window shows for one drawing. */
11
+ export interface ShapesDocument {
12
+ /** Changes when the list has to be drawn again. */
13
+ key: string;
14
+ /** The document stencil's masters; empty when the drawing has none. */
15
+ masters: readonly Master[];
16
+ /** Built-in stencils the drawing docks (its Stencil windows), in window order. */
17
+ docked: readonly string[];
18
+ /** Docked stencil files with no built-in counterpart, by file name: listed, not openable. */
19
+ unavailable: readonly string[];
20
+ /** Masters beyond `DOCUMENT_MASTER_LIMIT` that are not listed. */
21
+ omitted: number;
22
+ }
23
+ export declare const EMPTY_SHAPES_DOCUMENT: ShapesDocument;
24
+ /** The drawing's master for a `document:<id>` master id. */
25
+ export declare function documentMaster(model: VisioDocument | null | undefined, id: string): VisioMaster | undefined;
26
+ /** The Shapes window content of a drawing: its document stencil and the stencils it docks. */
27
+ export declare function shapesDocument(model: VisioDocument | null | undefined): ShapesDocument;
28
+ /** The Shapes window section of a docked stencil file that has no built-in stand-in. */
29
+ export declare function unavailableStencil(doc: Document, file: string): HTMLElement;
@@ -1,12 +1,26 @@
1
1
  import { type Master } from './stencil-catalog.js';
2
- /** Per-viewer Shapes window preferences: opened stencils and each stencil's Quick Shapes. */
3
- export declare const SHAPES_STORAGE_KEY = "ooxml-ui.visio.shapes";
2
+ import { type ShapesDocument } from './shapes-document.js';
3
+ export { SHAPES_STORAGE_KEY, currentQuickShapes } from './shapes-storage.js';
4
+ /** The Stencils view of one Shapes window. */
5
+ export interface StencilsView {
6
+ /** The More Shapes and master menus; the caller puts them on the pane. */
7
+ menus: HTMLElement[];
8
+ /**
9
+ * Show a drawing's document stencil and the stencils it docks; a no-op for the same content.
10
+ * `opened` is false after an edit of the drawing that is showing: folded and unfolded stencils
11
+ * stay as the user has them, and a Document Stencil that appears then starts folded.
12
+ */
13
+ setDocument(next: ShapesDocument, opened?: boolean): void;
14
+ }
4
15
  /** One master button: drag it onto the page, or activate it to add it at the page centre. */
5
16
  export declare function masterButton(doc: Document, master: Master): HTMLLIElement;
6
17
  export declare function masterList(doc: Document, masters: readonly Master[]): HTMLUListElement;
7
18
  /**
8
19
  * The Stencils view below the view tabs: More Shapes (a menu of the built-in stencils), Quick
9
- * Shapes (favourites across the open stencils) and one collapsible section per open stencil,
10
- * Basic Shapes first. Opened stencils and Quick Shapes persist per viewer in localStorage.
20
+ * Shapes (favourites across the open stencils) and one collapsible section per open stencil.
21
+ * A drawing's own masters come first as its Document Stencil, then the stencils the drawing docks,
22
+ * then Basic Shapes and the stencils the user opened. The first of the drawing's stencils is the
23
+ * one showing, as in Visio; the others start folded. Opened stencils and Quick Shapes persist per
24
+ * viewer in localStorage; what a drawing docks is not persisted.
11
25
  */
12
- export declare function buildStencilsView(doc: Document, panel: HTMLElement, pane: HTMLElement): HTMLElement[];
26
+ export declare function buildStencilsView(doc: Document, panel: HTMLElement, pane: HTMLElement): StencilsView;
@@ -0,0 +1,15 @@
1
+ import { type Master } from './stencil-catalog.js';
2
+ /** Per-viewer Shapes window preferences: opened stencils and each stencil's Quick Shapes. */
3
+ export declare const SHAPES_STORAGE_KEY = "ooxml-ui.visio.shapes";
4
+ export interface SavedShapes {
5
+ open: string[];
6
+ quick: Record<string, string[]>;
7
+ }
8
+ export declare function loadShapes(doc: Document): SavedShapes;
9
+ export declare function saveShapes(doc: Document, saved: SavedShapes): void;
10
+ /**
11
+ * The Quick Shapes of the current stencil, for the AutoConnect mini toolbar: the stencil the user
12
+ * opened last, else the first one the drawing docks (`docked`), else Basic Shapes. Reads the
13
+ * saved preferences, so it follows the Shapes window.
14
+ */
15
+ export declare function currentQuickShapes(doc: Document, docked?: readonly string[], limit?: number): Master[];
@@ -1,3 +1,10 @@
1
+ import type { ShapesDocument } from './shapes-document.js';
2
+ /**
3
+ * Show a drawing in a Shapes window: its Document Stencil, the stencils it docks, and its masters
4
+ * in Search shapes. Cheap to call again for the same drawing. `opened` is false when the same
5
+ * drawing was only edited, so the stencils the user unfolded stay as they are.
6
+ */
7
+ export declare function setShapesDocument(pane: HTMLElement, next: ShapesDocument, opened?: boolean): void;
1
8
  export { BASIC_SHAPES, findMaster, masterCreation, type Master, type MasterCreation, } from './stencil-catalog.js';
2
9
  /** Drag payload type for a stencil master; the value is the master id. */
3
10
  export declare const MASTER_MIME = "application/x-visio-viewer-master";
@@ -9,6 +9,10 @@ export interface Master {
9
9
  width: number;
10
10
  height: number;
11
11
  };
12
+ /** A drawn preview that replaces `path` (a master of the drawing's own stencil). */
13
+ draw?: () => SVGElement | undefined;
14
+ /** Why the master cannot be dropped; it is listed disabled with this reason. */
15
+ unsupported?: string;
12
16
  }
13
17
  export interface Stencil {
14
18
  id: string;
@@ -0,0 +1,25 @@
1
+ import { type VisioTextMeasurer } from 'ooxml-core/visio';
2
+ /** The part of a 2D canvas context that measuring needs; a worker's OffscreenCanvas has it too. */
3
+ export interface MeasureContext {
4
+ font: string;
5
+ fontKerning?: string;
6
+ measureText(text: string): {
7
+ width: number;
8
+ };
9
+ }
10
+ /**
11
+ * Measures text with the browser's fonts for what the core's own tables do not cover (other
12
+ * families, italics, non-ASCII text). Visio's TEXTWIDTH adds up unkerned, unhinted advances, so
13
+ * kerning is turned off and the text is measured at 1000 px and scaled.
14
+ *
15
+ * A canvas silently draws a missing font with a fallback, which would measure a wrong size: a
16
+ * family counts as installed only when it measures differently from both generic fallbacks, and
17
+ * anything else is reported as not measurable. Superscript, subscript and small caps are not
18
+ * measured either.
19
+ */
20
+ export declare function createCanvasTextMeasurer(context: MeasureContext): VisioTextMeasurer;
21
+ /**
22
+ * Give the core a browser measurer where a canvas exists (the page, or a worker with
23
+ * OffscreenCanvas). Without one the core measures only what its own tables cover.
24
+ */
25
+ export declare function installBrowserTextMeasurer(): boolean;
@@ -0,0 +1,12 @@
1
+ import type { VisioAutoConnectDirection } from 'ooxml-core/visio/ui';
2
+ import type { Master } from './stencil-catalog.js';
3
+ /** An arrow or bar position in viewport pixels. */
4
+ export interface AutoConnectArrow {
5
+ direction: VisioAutoConnectDirection;
6
+ x: number;
7
+ y: number;
8
+ }
9
+ /** One AutoConnect arrow. Out of the tab order: the arrows are a pointer aid. */
10
+ export declare function autoConnectArrow(doc: Document, arrow: AutoConnectArrow, hasNeighbour: boolean): HTMLButtonElement;
11
+ /** The mini toolbar of Quick Shapes beside an arrow. */
12
+ export declare function autoConnectBar(doc: Document, arrow: AutoConnectArrow, masters: readonly Master[]): HTMLElement;
@@ -0,0 +1,33 @@
1
+ import { type VisioAutoConnectDirection } from 'ooxml-core/visio/ui';
2
+ import type { ViewerController, ViewerState } from './controller.js';
3
+ export interface AutoConnectHost {
4
+ /** The viewer's shadow root (a document in tests): the ribbon check box and event scope. */
5
+ root: ShadowRoot | Document;
6
+ viewport: HTMLElement;
7
+ controller: ViewerController;
8
+ announce(message: string): void;
9
+ edit(run: () => Promise<void>, message: string): void;
10
+ /** Arrows belong to the Pointer tool. */
11
+ pointerTool(): boolean;
12
+ }
13
+ /**
14
+ * View > Visual Aids > AutoConnect, on by default as in Visio. Resting the mouse on a top-level
15
+ * two-dimensional shape with the Pointer tool shows an arrow outside each side. An arrow shows a
16
+ * mini toolbar with the current stencil's first four Quick Shapes: choosing one adds it one gap
17
+ * away in that direction with a connector glued to both shapes, as one undoable step. Clicking
18
+ * the arrow itself connects to the neighbouring shape it points at, or adds the first Quick Shape
19
+ * when there is none. Arrows are a mouse and pen aid: touch and the keyboard never show them.
20
+ */
21
+ export declare class ViewerAutoConnect {
22
+ #private;
23
+ private readonly host;
24
+ constructor(host: AutoConnectHost);
25
+ get enabled(): boolean;
26
+ /** The shape whose arrows show, for tests and status text. */
27
+ get source(): string | undefined;
28
+ toggle(): void;
29
+ render(state: ViewerState): void;
30
+ /** Connects in `direction`: to `masterId` as a new shape, else to the neighbour or first Quick Shape. */
31
+ connect(direction: VisioAutoConnectDirection, masterId?: string): void;
32
+ wire(): () => void;
33
+ }