ooxml-ui 1.34.0 → 1.36.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 (223) hide show
  1. package/custom-elements.json +14 -1
  2. package/dist/chart/format-pane-analysis.d.ts +0 -1
  3. package/dist/chart/format-pane-effects.d.ts +0 -1
  4. package/dist/chart/format-pane-fill-kinds.d.ts +0 -1
  5. package/dist/chart/format-pane-fill-line.d.ts +0 -1
  6. package/dist/chart/format-pane-targets.d.ts +0 -1
  7. package/dist/chart/format-pane-text.d.ts +0 -1
  8. package/dist/chrome/tab-drag.d.ts +27 -0
  9. package/dist/chrome/tab-drag.d.ts.map +1 -0
  10. package/dist/chrome/tab-strip.d.ts +25 -1
  11. package/dist/chrome/tab-strip.d.ts.map +1 -1
  12. package/dist/{chunk-CDC5MAZS.js → chunk-6VF4FEMY.js} +1 -1
  13. package/dist/chunk-7RRN2GPO.js +19 -0
  14. package/dist/{chunk-3AOIYE3R.js → chunk-7ST5QRD5.js} +1 -1
  15. package/dist/{chunk-6TS7ASDJ.js → chunk-C4KI635Q.js} +2 -17
  16. package/dist/{chunk-CALEXPBD.js → chunk-GZNBWWJ5.js} +840 -51
  17. package/dist/{chunk-KYXSQFDB.js → chunk-QAX4FAB7.js} +139 -4
  18. package/dist/{chunk-SWDVBUBW.js → chunk-Z4DML5NW.js} +3 -3
  19. package/dist/controls.d.ts +1 -1
  20. package/dist/controls.d.ts.map +1 -1
  21. package/dist/controls.js +1 -1
  22. package/dist/docx/building-blocks-actions.d.ts +2 -2
  23. package/dist/docx/editable-region-view.d.ts +4 -0
  24. package/dist/docx/editor-chrome.d.ts +1 -1
  25. package/dist/docx/editor-core.d.ts +4 -0
  26. package/dist/docx/editor-plugins.d.ts +3 -0
  27. package/dist/docx/file-commands.d.ts +5 -0
  28. package/dist/docx/format-dialogs.d.ts +6 -1
  29. package/dist/docx/insert-controller.d.ts +5 -0
  30. package/dist/docx/list-commands.d.ts +3 -1
  31. package/dist/docx/list-marker-display.d.ts +1 -1
  32. package/dist/docx/locales/en-app.d.ts +0 -1
  33. package/dist/docx/locales/en-ribbon.d.ts +51 -0
  34. package/dist/docx/locales/en.d.ts +51 -1
  35. package/dist/docx/localization-strings.d.ts +51 -1
  36. package/dist/docx/paragraph-styles.d.ts +1 -1
  37. package/dist/docx/print-picture.d.ts +4 -0
  38. package/dist/docx/protection-controls.d.ts +4 -0
  39. package/dist/docx/restrict-editing-pane.d.ts +14 -0
  40. package/dist/docx/ribbon-action.d.ts +4 -0
  41. package/dist/docx/ribbon-icons.d.ts +1 -0
  42. package/dist/docx/search-controller.d.ts +12 -5
  43. package/dist/docx/search-document.d.ts +32 -0
  44. package/dist/docx.js +1227 -390
  45. package/dist/export/pdf-embedded-font.d.ts +65 -0
  46. package/dist/export/pdf-fonts.d.ts +14 -0
  47. package/dist/export/pdf-vector.d.ts +84 -0
  48. package/dist/image-native-size.d.ts +43 -0
  49. package/dist/image-native-size.d.ts.map +1 -0
  50. package/dist/index.js +5 -5
  51. package/dist/picture-artistic-filters.d.ts +9 -0
  52. package/dist/picture-artistic-filters.d.ts.map +1 -0
  53. package/dist/picture-artistic-preview.d.ts +3 -0
  54. package/dist/picture-artistic-preview.d.ts.map +1 -0
  55. package/dist/picture-effects.d.ts +3 -1
  56. package/dist/picture-effects.d.ts.map +1 -0
  57. package/dist/picture-paint.d.ts +23 -0
  58. package/dist/picture-paint.d.ts.map +1 -0
  59. package/dist/picture-pixels.d.ts +11 -0
  60. package/dist/picture-pixels.d.ts.map +1 -0
  61. package/dist/picture-standard-filter.d.ts +6 -0
  62. package/dist/picture-standard-filter.d.ts.map +1 -0
  63. package/dist/picture-view.d.ts +10 -0
  64. package/dist/picture-view.d.ts.map +1 -0
  65. package/dist/pptx/ai/bridge-factory.d.ts +4 -1
  66. package/dist/pptx/ai/bridge-factory.d.ts.map +1 -1
  67. package/dist/pptx/ai/config.d.ts +1 -1
  68. package/dist/pptx/ai/config.d.ts.map +1 -1
  69. package/dist/pptx/ai/host.cjs +36 -36
  70. package/dist/pptx/ai/host.mjs +1 -1
  71. package/dist/pptx/ai/index.cjs +50 -43
  72. package/dist/pptx/ai/index.mjs +10 -3
  73. package/dist/pptx/ai/system-prompt.d.ts +1 -1
  74. package/dist/pptx/ai/system-prompt.d.ts.map +1 -1
  75. package/dist/pptx/ai/tool-summary.d.ts.map +1 -1
  76. package/dist/pptx/ai/tools/mcp-registry.d.ts.map +1 -1
  77. package/dist/pptx/{chart-3d-view-scene-HNL4NWJT.mjs → chart-3d-view-scene-BKNMGRGO.mjs} +3 -25
  78. package/dist/pptx/{chart-3d-view-scene-OPVBTZL5.cjs → chart-3d-view-scene-V55XPBBF.cjs} +39 -61
  79. package/dist/pptx/{chunk-KGDMMWIY.mjs → chunk-2AK5MS6H.mjs} +11 -0
  80. package/dist/pptx/{chunk-M55PNMFQ.cjs → chunk-4OKSYRYA.cjs} +11 -0
  81. package/dist/pptx/{chunk-CH4Z6H6C.mjs → chunk-4RSRCNRM.mjs} +1192 -382
  82. package/dist/pptx/{chunk-TDIJHLS5.cjs → chunk-6JJD3LFT.cjs} +1532 -715
  83. package/dist/pptx/{chunk-46HIE4IE.cjs → chunk-CRV7G4GC.cjs} +8 -0
  84. package/dist/pptx/{chunk-S3L5NNCK.cjs → chunk-FROIGMTI.cjs} +1 -1
  85. package/dist/pptx/{chunk-S5I64Y55.cjs → chunk-HIRBPTML.cjs} +12 -12
  86. package/dist/pptx/{chunk-D4LJJ7Z7.cjs → chunk-KJICUZXM.cjs} +171 -540
  87. package/dist/pptx/{chunk-7DT3UJQB.mjs → chunk-KNCCSPAV.mjs} +7 -3
  88. package/dist/pptx/{chunk-RZVEPTLN.mjs → chunk-QK6LJT3K.mjs} +140 -529
  89. package/dist/pptx/{chunk-ZS5EVODY.cjs → chunk-SI7GQYSL.cjs} +52 -48
  90. package/dist/pptx/{chunk-LCCRLB7Q.mjs → chunk-UHDWWRTX.mjs} +1 -1
  91. package/dist/pptx/{chunk-6MEBLCNK.mjs → chunk-WQI3NLMY.mjs} +8 -0
  92. package/dist/pptx/{chunk-SPOECCPV.mjs → chunk-WZHYA2B3.mjs} +1 -1
  93. package/dist/pptx/dom/elements/smartart.d.ts.map +1 -1
  94. package/dist/pptx/dom/index.cjs +427 -427
  95. package/dist/pptx/dom/index.mjs +10 -10
  96. package/dist/pptx/export/html2canvas-clone.cjs +6 -6
  97. package/dist/pptx/export/html2canvas-clone.mjs +1 -1
  98. package/dist/pptx/i18n/index.cjs +6 -6
  99. package/dist/pptx/i18n/index.mjs +1 -1
  100. package/dist/pptx/i18n/translations-en.d.ts.map +1 -1
  101. package/dist/pptx/index.cjs +3361 -3353
  102. package/dist/pptx/index.mjs +5 -5
  103. package/dist/pptx/render/chart-3d-projection.d.ts +5 -54
  104. package/dist/pptx/render/chart-3d-projection.d.ts.map +1 -1
  105. package/dist/pptx/render/chart-3d-shading.d.ts +7 -10
  106. package/dist/pptx/render/chart-3d-shading.d.ts.map +1 -1
  107. package/dist/pptx/render/chart-combo-stock.cjs +3 -3
  108. package/dist/pptx/render/chart-combo-stock.mjs +1 -1
  109. package/dist/pptx/render/chart-funnel-sunburst.d.ts +1 -1
  110. package/dist/pptx/render/chart-funnel-sunburst.d.ts.map +1 -1
  111. package/dist/pptx/render/chart-map-projection.d.ts +2 -37
  112. package/dist/pptx/render/chart-map-projection.d.ts.map +1 -1
  113. package/dist/pptx/render/chart-overlays.cjs +7 -7
  114. package/dist/pptx/render/chart-overlays.mjs +1 -1
  115. package/dist/pptx/render/chart-region-map-alias.d.ts +1 -11
  116. package/dist/pptx/render/chart-region-map-alias.d.ts.map +1 -1
  117. package/dist/pptx/render/chart-region-map-colors.d.ts +1 -3
  118. package/dist/pptx/render/chart-region-map-colors.d.ts.map +1 -1
  119. package/dist/pptx/render/chart-region-map-data.d.ts +2 -44
  120. package/dist/pptx/render/chart-region-map-data.d.ts.map +1 -1
  121. package/dist/pptx/render/chart-region-map-view.d.ts.map +1 -1
  122. package/dist/pptx/render/chart-surface-treemap.cjs +4 -4
  123. package/dist/pptx/render/chart-surface-treemap.mjs +1 -1
  124. package/dist/pptx/render/chart-view-model-types.d.ts +2 -0
  125. package/dist/pptx/render/chart-view-model-types.d.ts.map +1 -1
  126. package/dist/pptx/render/chart-view-model.cjs +44 -44
  127. package/dist/pptx/render/chart-view-model.mjs +1 -1
  128. package/dist/pptx/render/chart-waterfall-map.cjs +6 -6
  129. package/dist/pptx/render/chart-waterfall-map.mjs +1 -1
  130. package/dist/pptx/render/controller/custom-shows-controller.d.ts +93 -0
  131. package/dist/pptx/render/controller/custom-shows-controller.d.ts.map +1 -0
  132. package/dist/pptx/render/controller/index.d.ts +2 -0
  133. package/dist/pptx/render/controller/index.d.ts.map +1 -1
  134. package/dist/pptx/render/custom-shows.d.ts +10 -2
  135. package/dist/pptx/render/custom-shows.d.ts.map +1 -1
  136. package/dist/pptx/render/editor-key-target.d.ts.map +1 -1
  137. package/dist/pptx/render/image-effect-filter-values.d.ts +1 -10
  138. package/dist/pptx/render/image-effect-filter-values.d.ts.map +1 -1
  139. package/dist/pptx/render/image-effects.d.ts +1 -0
  140. package/dist/pptx/render/image-effects.d.ts.map +1 -1
  141. package/dist/pptx/render/image-native-size.d.ts +1 -42
  142. package/dist/pptx/render/image-native-size.d.ts.map +1 -1
  143. package/dist/pptx/render/image-tiling.d.ts.map +1 -1
  144. package/dist/pptx/render/index.d.ts +1 -1
  145. package/dist/pptx/render/index.d.ts.map +1 -1
  146. package/dist/pptx/render/render-cache.d.ts +1 -3
  147. package/dist/pptx/render/render-cache.d.ts.map +1 -1
  148. package/dist/pptx/render/smartart-drawing.d.ts +3 -0
  149. package/dist/pptx/render/smartart-drawing.d.ts.map +1 -1
  150. package/dist/pptx/render/smartart-picture-image.d.ts +9 -0
  151. package/dist/pptx/render/smartart-picture-image.d.ts.map +1 -0
  152. package/dist/pptx/render/smartart-reflow-to-shapes.d.ts.map +1 -1
  153. package/dist/pptx/{smartart-insert-preview-RQUFRLSV.mjs → smartart-insert-preview-JH5TXECK.mjs} +6 -6
  154. package/dist/pptx/{smartart-insert-preview-YKNB37GE.cjs → smartart-insert-preview-QWROEVZL.cjs} +7 -7
  155. package/dist/render-cache.d.ts +4 -0
  156. package/dist/render-cache.d.ts.map +1 -0
  157. package/dist/smartart/smartart-paint.d.ts +2 -1
  158. package/dist/smartart/smartart-picture.d.ts +4 -3
  159. package/dist/smartart/smartart-text-pane-tools.d.ts +0 -1
  160. package/dist/smartart.d.ts +3 -0
  161. package/dist/smartart.js +1 -1
  162. package/dist/teams.js +2 -2
  163. package/dist/theme-bridge.d.ts +0 -1
  164. package/dist/theme.d.ts +0 -1
  165. package/dist/touch-targets.d.ts +0 -1
  166. package/dist/visio/binding.d.ts +2 -1
  167. package/dist/visio/canvas-editing.d.ts +2 -0
  168. package/dist/visio/controller.d.ts +3 -0
  169. package/dist/visio/pdf-path.d.ts +37 -0
  170. package/dist/visio/pdf-svg-gradient.d.ts +23 -0
  171. package/dist/visio/pdf-svg-style.d.ts +20 -0
  172. package/dist/visio/pdf-svg-text.d.ts +8 -0
  173. package/dist/visio/pdf-svg.d.ts +22 -0
  174. package/dist/visio/ribbon-action.d.ts +47 -5
  175. package/dist/visio/ribbon-arrange.d.ts +9 -0
  176. package/dist/visio/ribbon-contextual-formats.d.ts +18 -0
  177. package/dist/visio/ribbon-org-chart.d.ts +7 -0
  178. package/dist/visio/ribbon-router.d.ts +18 -0
  179. package/dist/visio/ribbon-shape-format.d.ts +7 -0
  180. package/dist/visio/ribbon-size-fields.d.ts +5 -0
  181. package/dist/visio/ribbon-swimlane.d.ts +9 -0
  182. package/dist/visio/ribbon-themes.d.ts +13 -3
  183. package/dist/visio/ribbon.d.ts +5 -1
  184. package/dist/visio/shapes-files-ui.d.ts +1 -1
  185. package/dist/visio/template-thumbnails.d.ts +10 -0
  186. package/dist/visio/viewer-backstage.d.ts +9 -3
  187. package/dist/visio/viewer-chart-editor.d.ts +2 -1
  188. package/dist/visio/viewer-contextual-tabs.d.ts +21 -0
  189. package/dist/visio/viewer-diagram-parts.d.ts +9 -1
  190. package/dist/visio/viewer-element.d.ts +10 -0
  191. package/dist/visio/viewer-export.d.ts +1 -6
  192. package/dist/visio/viewer-file-commands.d.ts +6 -1
  193. package/dist/visio/viewer-guides.d.ts +8 -1
  194. package/dist/visio/viewer-inline-size.d.ts +15 -0
  195. package/dist/visio/viewer-insert-dialog.d.ts +1 -0
  196. package/dist/visio/viewer-new-drawing.d.ts +3 -2
  197. package/dist/visio/viewer-org-chart.d.ts +19 -0
  198. package/dist/visio/viewer-pdf-options.d.ts +26 -0
  199. package/dist/visio/viewer-pdf.d.ts +47 -0
  200. package/dist/visio/viewer-picture-format.d.ts +20 -0
  201. package/dist/visio/viewer-resize-handles.d.ts +13 -1
  202. package/dist/visio/viewer-swimlanes.d.ts +34 -0
  203. package/dist/visio.js +4079 -742
  204. package/dist/xlsx/dialogs/audit-dialogs.d.ts +9 -0
  205. package/dist/xlsx/dialogs/custom-autofilter.d.ts +12 -0
  206. package/dist/xlsx/dialogs/custom-lists.d.ts +6 -0
  207. package/dist/xlsx/dialogs/filter-dates.d.ts +4 -0
  208. package/dist/xlsx/dialogs/help-dialogs.d.ts +2 -2
  209. package/dist/xlsx/dialogs/sort-dialog.d.ts +3 -3
  210. package/dist/xlsx/dialogs/text-to-columns.d.ts +0 -7
  211. package/dist/xlsx/dialogs/top10-filter.d.ts +5 -0
  212. package/dist/xlsx/dialogs/watch-window.d.ts +4 -0
  213. package/dist/xlsx/grid/audit-layer.d.ts +3 -0
  214. package/dist/xlsx/grid/filter-buttons.d.ts +11 -0
  215. package/dist/xlsx/grid/filter-menu.d.ts +10 -0
  216. package/dist/xlsx/grid/filter-presets.d.ts +19 -0
  217. package/dist/xlsx/grid/grid-view.d.ts +23 -1
  218. package/dist/xlsx/grid/pane-chrome.d.ts +2 -0
  219. package/dist/xlsx/grid/split-bars.d.ts +2 -0
  220. package/dist/xlsx/grid/styles.d.ts +1 -1
  221. package/dist/xlsx/sheet-tabs/drag.d.ts +1 -2
  222. package/dist/xlsx.js +1991 -450
  223. package/package.json +2 -2
@@ -1,5 +1,6 @@
1
1
  import type { VisioThemeColorRef } from 'ooxml-core/visio';
2
- import type { VisioBuiltInThemeId, VisioCalloutStyle, VisioChangeShapeTarget, VisioContainerStyle, VisioConnectorRoute, VisioShapeFormatEdit } from 'ooxml-core/visio';
2
+ import type { VisioDataGraphicPosition } from 'ooxml-core/visio/ui';
3
+ import type { VisioBuiltInThemeId, VisioEmbellishment, VisioCalloutStyle, VisioChangeShapeTarget, VisioContainerStyle, VisioConnectorRoute, VisioShapeFormatEdit } from 'ooxml-core/visio';
3
4
  import type { TextCaseMode, VisioArrangement, VisioRuleSetId, VisioLayoutStyle } from 'ooxml-core/visio/ui';
4
5
  import type { VisioPageSetupCommand } from './page-setup-action.js';
5
6
  export type CanvasTool = 'pointer' | 'connector' | 'connection-point' | 'rectangle' | 'ellipse' | 'line' | 'text' | 'freeform' | 'arc' | 'pencil';
@@ -58,7 +59,7 @@ export type VisioTextFeature = 'text-dialog' | 'paragraph-dialog' | 'text-block'
58
59
  * Insert-tab items that act on the page or the selected shape; `chart-data` and `chart-format`
59
60
  * open Edit Data and Format Chart for a selected chart object.
60
61
  */
61
- export type VisioInsertItem = 'picture' | 'chart' | 'chart-data' | 'chart-format' | 'link' | 'screen-tip';
62
+ export type VisioInsertItem = 'picture' | 'chart' | 'chart-data' | 'chart-format' | 'chart-edit' | 'link' | 'screen-tip';
62
63
  /** Review and Process tab commands: comments, shape reports, diagram checks and subprocesses. */
63
64
  export type VisioReviewCommand = 'check-accessibility' | 'alt-text' | 'page-alt-text' | 'new-comment' | 'page-comment' | 'comments-pane' | 'shape-reports' | 'check-diagram' | 'issues-window' | 'ignore-issue' | 'rule-set' | 'subprocess-new' | 'subprocess-existing' | 'subprocess-selection';
64
65
  /** Insert > Diagram Parts: a container or callout in one of its styles. */
@@ -71,8 +72,44 @@ export type VisioDiagramPartAction = {
71
72
  part: 'callout';
72
73
  style: VisioCalloutStyle;
73
74
  };
75
+ /** Container Format > Size and Membership: act on the one selected container. */
76
+ export type VisioContainerAction = {
77
+ type: 'container';
78
+ command: 'fit' | 'select-contents' | 'disband';
79
+ };
80
+ /**
81
+ * Container Format > Margins, Automatic Resize and Lock Container: one core option edit each. The
82
+ * lock is `toggle` on its command; the viewer resolves it from the container's current state.
83
+ */
84
+ export type VisioContainerOptionAction = {
85
+ type: 'container-options';
86
+ margin?: number;
87
+ resize?: 0 | 1 | 2;
88
+ locked?: boolean | 'toggle';
89
+ };
90
+ /** Picture Format > Brightness and Contrast presets (0 to 1, 0.5 neutral) and Crop to Square or Reset Crop. */
91
+ export type VisioPictureAction = {
92
+ type: 'picture-adjust';
93
+ brightness?: number;
94
+ contrast?: number;
95
+ } | {
96
+ type: 'picture-crop';
97
+ crop: 'square' | 'reset';
98
+ };
99
+ /** The Cross-Functional Flowchart tab: lanes, separators and the Design and Arrange options. */
100
+ export type VisioSwimlaneAction = {
101
+ type: 'swimlane';
102
+ command: 'insert-before' | 'insert-after' | 'delete' | 'separator' | 'title' | 'separators' | 'rotate-labels' | 'direction-horizontal' | 'direction-vertical' | 'style';
103
+ /** The Style number (1-4) for the style command. */
104
+ style?: number;
105
+ };
106
+ /** The Org Chart tab: add a position under, beside or for the selected one, delete it, lay out. */
107
+ export type VisioOrgChartAction = {
108
+ type: 'org-chart';
109
+ command: 'subordinate' | 'coworker' | 'assistant' | 'delete' | 'layout';
110
+ };
74
111
  /** Data-tab commands: import, refresh, data graphics, legend, windows and Shape Data. */
75
- 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';
112
+ export type VisioDataCommand = 'quick-import' | 'custom-import' | 'refresh' | 'graphic-text' | 'graphic-bar' | 'graphic-icon' | 'graphic-color' | 'graphic-remove' | 'legend' | 'legend-horizontal' | 'external-data-window' | 'link-data' | 'graphic-configure' | 'graphic-auto-space' | `graphic-position-${VisioDataGraphicPosition}` | 'define-shape-data';
76
113
  /** Arrangement, layout, layer, selection, view and output commands (viewer-layout and friends). */
77
114
  export type VisioLayoutAction = {
78
115
  type: 'auto-align';
@@ -102,7 +139,7 @@ export type VisioLayoutAction = {
102
139
  topic: 'help' | 'training';
103
140
  };
104
141
  /** Every command the Visio ribbon, status bar or a shortcut can raise, as a `ribbon-action` event. */
105
- export type VisioRibbonAction = VisioFormattingAction | VisioLayoutAction | {
142
+ export type VisioRibbonAction = VisioFormattingAction | VisioSwimlaneAction | VisioOrgChartAction | VisioLayoutAction | {
106
143
  type: 'arrange';
107
144
  operation: VisioArrangement;
108
145
  } | {
@@ -136,6 +173,11 @@ export type VisioRibbonAction = VisioFormattingAction | VisioLayoutAction | {
136
173
  type: 'page-theme';
137
174
  theme?: VisioBuiltInThemeId | 'none';
138
175
  variant?: number;
176
+ colors?: VisioBuiltInThemeId;
177
+ fonts?: VisioBuiltInThemeId;
178
+ effects?: VisioBuiltInThemeId;
179
+ connectors?: VisioBuiltInThemeId;
180
+ embellishment?: VisioEmbellishment;
139
181
  } | {
140
182
  type: 'delete';
141
183
  } | {
@@ -161,7 +203,7 @@ export type VisioRibbonAction = VisioFormattingAction | VisioLayoutAction | {
161
203
  | {
162
204
  type: 'change-shape';
163
205
  shape: VisioChangeShapeTarget | `document:${string}`;
164
- } | VisioDiagramPartAction | {
206
+ } | VisioDiagramPartAction | VisioContainerAction | VisioContainerOptionAction | VisioPictureAction | {
165
207
  type: 'pane';
166
208
  pane: 'shapes' | 'inspector';
167
209
  } | {
@@ -0,0 +1,9 @@
1
+ /** Which Shape Styles controls a contextual tab keeps (Quick Styles apply to whole shapes). */
2
+ export interface ShapeStylesOptions {
3
+ label?: string;
4
+ parts?: readonly ('quick' | 'fill' | 'line' | 'effects')[];
5
+ }
6
+ /** Shape Styles: Quick Styles, Fill, Line and Effects (Home and the Format tabs). */
7
+ export declare function shapeStylesGroup(doc: Document, options?: ShapeStylesOptions): HTMLElement;
8
+ /** Arrange: Align, Position, order and Group (Home and Shape Format). */
9
+ export declare function arrangeGroup(doc: Document): HTMLElement;
@@ -0,0 +1,18 @@
1
+ /** Container Format margins: none, the editor's narrow and normal margins and the wide one. */
2
+ export declare const CONTAINER_MARGINS: readonly [string, number][];
3
+ /**
4
+ * Picture Format: Adjust (Brightness and Contrast presets, Crop), Picture Styles (Line and
5
+ * Effects, the Home controls built again), Arrange and Size. Compression and Auto Balance stay
6
+ * listed disabled with the reason.
7
+ */
8
+ export declare function buildPictureFormatPanel(doc: Document, panel: HTMLElement): void;
9
+ /**
10
+ * Container Format: Size (Margins, Fit to Contents and Automatic Resize, then the Width and
11
+ * Height boxes), Container Styles (Fill, Line, Effects), Membership (Lock Container) and Arrange.
12
+ */
13
+ export declare function buildContainerFormatPanel(doc: Document, panel: HTMLElement): void;
14
+ /**
15
+ * Chart Design: the chart editor's entry points (the same one a double-click opens), Arrange and
16
+ * Size. Chart commands are enabled while the chart is selected on an editable drawing.
17
+ */
18
+ export declare function buildChartDesignPanel(doc: Document, panel: HTMLElement): void;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Visio's contextual Org Chart tab, as far as positions go: Insert (Subordinate, Coworker,
3
+ * Assistant), Position (Delete Position) and Arrange (Layout). It shows while an org chart
4
+ * position is selected (`viewer-contextual-tabs.ts`); `viewer-org-chart.ts` keeps its state.
5
+ * Importing people from a file or directory is not offered.
6
+ */
7
+ export declare function buildOrgChartPanel(doc: Document, panel: HTMLElement): void;
@@ -18,6 +18,12 @@ export interface RibbonTargets {
18
18
  insertDiagramPart(action: Extract<VisioRibbonAction, {
19
19
  type: 'diagram-part';
20
20
  }>): void;
21
+ swimlane(action: Extract<VisioRibbonAction, {
22
+ type: 'swimlane';
23
+ }>): void;
24
+ orgChart(action: Extract<VisioRibbonAction, {
25
+ type: 'org-chart';
26
+ }>): void;
21
27
  formatSelection(action: VisioFormattingAction): void;
22
28
  formatPainter(mode: 'once' | 'sticky' | 'cancel'): void;
23
29
  arrangeSelection(action: Extract<VisioRibbonAction, {
@@ -57,6 +63,18 @@ export interface RibbonTargets {
57
63
  }>): void;
58
64
  /** Layout, layers, selection, guides, explorer, export and help (ViewerLayoutCommands). */
59
65
  layout(action: VisioLayoutAction): void;
66
+ /** Container Format: fit, select the contents or disband the selected container. */
67
+ container(command: Extract<VisioRibbonAction, {
68
+ type: 'container';
69
+ }>['command']): void;
70
+ /** Container Format > Margins, Automatic Resize and Lock Container. */
71
+ containerOptions(action: Extract<VisioRibbonAction, {
72
+ type: 'container-options';
73
+ }>): void;
74
+ /** Picture Format > Brightness, Contrast and Crop of the selected picture. */
75
+ picture(action: Extract<VisioRibbonAction, {
76
+ type: 'picture-adjust' | 'picture-crop';
77
+ }>): void;
60
78
  }
61
79
  /** Routes a ribbon, status-bar or shortcut action to the controller that owns it. */
62
80
  export declare function routeRibbonAction(targets: RibbonTargets, action: VisioRibbonAction): void;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Visio's contextual Shape Format tab: Shape Styles and Arrange are the Home groups built again
3
+ * (the viewer mirrors their state from Home, so one implementation serves both), Size opens the
4
+ * Size & Position window, and WordArt Styles lists what Visio offers with the reason it is
5
+ * unavailable here. The tab shows only while shapes are selected (`viewer-contextual-tabs.ts`).
6
+ */
7
+ export declare function buildShapeFormatPanel(doc: Document, panel: HTMLElement): void;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * The Width and Height boxes of the Size group: inches of the selected shape, committed by
3
+ * `ViewerInlineSize` (the same core resize the Size & Position pane makes).
4
+ */
5
+ export declare function sizeFields(doc: Document): HTMLElement;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Visio's contextual Cross-Functional Flowchart tab (Microsoft's "Create a cross-functional
3
+ * flowchart"): Insert (Swimlane, Separator), Arrange (Direction turns the flowchart on its side,
4
+ * Rotate Lane Labels) and Design
5
+ * (Style, Show Title Bar, Show Separator Bar). It shows while a flowchart's frame, a lane or a
6
+ * shape in a lane is selected (`viewer-contextual-tabs.ts`); `viewer-swimlanes.ts` keeps its
7
+ * state and availability.
8
+ */
9
+ export declare function buildSwimlanePanel(doc: Document, panel: HTMLElement): void;
@@ -3,8 +3,15 @@ import type { OfficeGalleryState, OfficeUiGallery } from '../ribbon/gallery.js';
3
3
  export declare const THEMES_HINT = "Apply a theme to the current page. Quick-styled shapes take its colours; text keeps its own font.";
4
4
  export declare const VARIANTS_HINT = "Pick one of the current theme's four colour variants.";
5
5
  export declare const NO_THEME_VARIANTS = "Apply a theme to the page first.";
6
- /** Design > Variants > More: which theme parts can be changed separately. */
7
- export declare const VARIANT_OPTION_REASONS: readonly [id: string, label: string, reason: string][];
6
+ /**
7
+ * Design > Variants > More > Embellishment: the levels, each writing the page's EmbellishmentIndex.
8
+ * The decorative geometry is not drawn yet; see `ViewerThemes`.
9
+ */
10
+ export declare const VARIANT_EMBELLISHMENTS: readonly [readonly ['low', 'Low'], readonly ['medium', 'Medium'], readonly ['high', 'High']];
11
+ /** The scheme submenus of Variants > More, in Visio's order. */
12
+ export declare const VARIANT_SCHEME_MENUS: readonly [readonly ['colors', 'theme-colors', 'Colors'], readonly ['fonts', 'theme-fonts', 'Fonts'], readonly ['effects', 'theme-effects', 'Effects'], readonly ['connectors', 'theme-connectors', 'Connectors']];
13
+ export type VariantScheme = (typeof VARIANT_SCHEME_MENUS)[number][0];
14
+ export declare const schemeItemId: (scheme: VariantScheme, id: string) => string;
8
15
  export declare const themeItemId: (id: string) => string;
9
16
  export declare const variantItemId: (index: number) => string;
10
17
  /** Themes gallery: No Theme, then the built-in themes; the page's theme is marked applied. */
@@ -13,5 +20,8 @@ export declare function themesGalleryState(disabled: boolean, current: VisioPage
13
20
  export declare function variantsGalleryState(disabled: boolean, current: VisioPageTheme | undefined): OfficeGalleryState;
14
21
  export declare const themesGallery: (doc: Document) => OfficeUiGallery;
15
22
  export declare const variantsGallery: (doc: Document) => OfficeUiGallery;
16
- /** Variants > More: Colors, Fonts, Effects, Connectors and Embellishment, disabled with reasons. */
23
+ /**
24
+ * Variants > More: Colors, Fonts, Effects and Connectors list the built-in themes (the page's
25
+ * current one is checked, see `ViewerThemes`); Embellishment lists its three levels.
26
+ */
17
27
  export declare function variantOptions(doc: Document): import("./ribbon-parts.js").RibbonCommand;
@@ -1,9 +1,13 @@
1
1
  import { buildHomePanel } from './ribbon-home.js';
2
2
  import { buildDataPanel, buildDesignPanel, buildHelpPanel, buildInsertPanel, buildProcessPanel, buildReviewPanel } from './ribbon-other-tabs.js';
3
+ import { buildShapeFormatPanel } from './ribbon-shape-format.js';
4
+ import { buildChartDesignPanel, buildContainerFormatPanel, buildPictureFormatPanel } from './ribbon-contextual-formats.js';
5
+ import { buildOrgChartPanel } from './ribbon-org-chart.js';
6
+ import { buildSwimlanePanel } from './ribbon-swimlane.js';
3
7
  import { buildViewPanel } from './ribbon-view.js';
4
8
  export type { VisioRibbonAction } from './ribbon-action.js';
5
9
  /** Visio's ribbon tab order. File (backstage) belongs to the host application. */
6
- export declare const RIBBON_TABS: readonly [readonly ['home', 'Home', typeof buildHomePanel], readonly ['insert', 'Insert', typeof buildInsertPanel], readonly ['design', 'Design', typeof buildDesignPanel], readonly ['data', 'Data', typeof buildDataPanel], readonly ['process', 'Process', typeof buildProcessPanel], readonly ['review', 'Review', typeof buildReviewPanel], readonly ['view', 'View', typeof buildViewPanel], readonly ['help', 'Help', typeof buildHelpPanel]];
10
+ export declare const RIBBON_TABS: readonly [readonly ['home', 'Home', typeof buildHomePanel], readonly ['insert', 'Insert', typeof buildInsertPanel], readonly ['design', 'Design', typeof buildDesignPanel], readonly ['data', 'Data', typeof buildDataPanel], readonly ['process', 'Process', typeof buildProcessPanel], readonly ['review', 'Review', typeof buildReviewPanel], readonly ['view', 'View', typeof buildViewPanel], readonly ['help', 'Help', typeof buildHelpPanel], readonly ['shape-format', 'Shape Format', typeof buildShapeFormatPanel], readonly ['picture-format', 'Picture Format', typeof buildPictureFormatPanel], readonly ['container-format', 'Container Format', typeof buildContainerFormatPanel], readonly ['chart-design', 'Chart Design', typeof buildChartDesignPanel], readonly ['cross-functional', 'Cross-Functional Flowchart', typeof buildSwimlanePanel], readonly ['org-chart', 'Org Chart', typeof buildOrgChartPanel]];
7
11
  export type RibbonTab = (typeof RIBBON_TABS)[number][0];
8
12
  /**
9
13
  * The Visio ribbon on the shared `office-ui-ribbon`: File, one panel per tab and Tell me (the
@@ -1,7 +1,7 @@
1
1
  import type { Stencil } from './stencil-catalog.js';
2
2
  import type { StencilFiles } from './stencil-files.js';
3
3
  /** What a stencil file picker offers; Visio's own stencils are .vssx, and the rest is refused by name. */
4
- export declare const STENCIL_FILE_ACCEPT = ".vssx,.vstx,.vsdx,.vss,.vst";
4
+ export declare const STENCIL_FILE_ACCEPT = ".vssx,.vssm,.vstx,.vstm,.vsdx,.vsdm,.vss,.vst";
5
5
  /**
6
6
  * The hidden file input behind More Shapes > Open Stencil and the line that says why a file could
7
7
  * not be opened. `opened` runs for each stencil that was read.
@@ -0,0 +1,10 @@
1
+ import { type VisioTemplateId } from 'ooxml-core/visio/ui';
2
+ /**
3
+ * The first page of a New template drawn by the viewer's own page renderer: the template is built
4
+ * as a real drawing, parsed and exported as a static SVG, returned as an image data URL. Nothing
5
+ * is hand drawn, so a tile always matches what the template creates. Undefined when it cannot be
6
+ * rendered (no DOM, or a failure), in which case the tile keeps its text only.
7
+ */
8
+ export declare function templateThumbnail(id: VisioTemplateId): Promise<string | undefined>;
9
+ /** Fill the thumbnail of every New tile under `root`, once; later calls reuse the cached images. */
10
+ export declare function fillTemplateThumbnails(root: ParentNode): Promise<void>;
@@ -1,9 +1,10 @@
1
1
  import type { ViewerState } from './controller.js';
2
2
  import type { DocumentStorage, VisioFileCommand } from 'ooxml-core/embedding';
3
- import type { VsdxSource } from 'ooxml-core/visio/ui';
3
+ import { type VisioTemplateId, type VsdxSource } from 'ooxml-core/visio/ui';
4
4
  import { type BackstagePage } from './backstage.js';
5
5
  import type { VisioRegionContext } from 'ooxml-core/visio/ui';
6
6
  import { type ResolvedVisioCustomization } from './viewer-customization.js';
7
+ import { type PdfRangeChoice, type PdfReportSummary } from './viewer-pdf-options.js';
7
8
  /** What the backstage needs from the element; every action delegates to existing APIs. */
8
9
  export interface BackstageHost {
9
10
  root: ShadowRoot;
@@ -11,6 +12,7 @@ export interface BackstageHost {
11
12
  fileName(): string;
12
13
  load(source: VsdxSource): Promise<void>;
13
14
  createBlankDrawing(): Promise<void>;
15
+ createFromTemplate(template: VisioTemplateId): Promise<void>;
14
16
  exportVsdx(): {
15
17
  bytes: Uint8Array;
16
18
  dirty: boolean;
@@ -19,10 +21,14 @@ export interface BackstageHost {
19
21
  svg: string;
20
22
  pageIndex: number;
21
23
  };
22
- /** Raster PDF of the foreground pages, or a PNG of the current page (viewer-export). */
23
- exportPicture(format: 'pdf' | 'png'): Promise<{
24
+ /**
25
+ * A vector PDF of the chosen foreground pages with its per-page report, or a PNG of the
26
+ * current page (viewer-export).
27
+ */
28
+ exportPicture(format: 'pdf' | 'png', pdf?: PdfRangeChoice): Promise<{
24
29
  blob: Blob;
25
30
  pageIndex: number;
31
+ report?: PdfReportSummary;
26
32
  }>;
27
33
  closeDocument(): void;
28
34
  showOptions(): void;
@@ -1,4 +1,4 @@
1
- import { type ChartSpace } from 'ooxml-core/chart';
1
+ import { type ChartSpace, type ChartExSpace } from 'ooxml-core/chart';
2
2
  import { type OfficeUiChartDataSheet } from '../chart/data-sheet.js';
3
3
  import { type OfficeUiChartFormatPane } from '../chart/format-pane.js';
4
4
  import { type ChartObjectData, type ChartTarget, type RasterizeSvg } from './viewer-insert-chart.js';
@@ -30,6 +30,7 @@ export declare class ChartObjectEditor {
30
30
  constructor(root: ShadowRoot, submit: (data: ChartObjectData, target: ChartTarget) => Promise<void>, rasterize?: RasterizeSvg, locale?: () => string | undefined);
31
31
  /** The edited chart part, while the editor is open. */
32
32
  get space(): ChartSpace | undefined;
33
+ get chartExSpace(): ChartExSpace | undefined;
33
34
  /** The chart being edited while the editor is open, so a host can close it if the shape goes. */
34
35
  get target(): ChartTarget | undefined;
35
36
  /** Open `mode` for the chart object's workbook; false when the workbook holds no chart. */
@@ -0,0 +1,21 @@
1
+ import type { VisioShape } from 'ooxml-core/visio';
2
+ import type { ViewerState } from './controller.js';
3
+ /** The format tabs, in the order the ribbon lists them; one at most shows at a time. */
4
+ export declare const CONTEXTUAL_TABS: readonly ['shape-format', 'picture-format', 'container-format', 'chart-design'];
5
+ export type ContextualTab = (typeof CONTEXTUAL_TABS)[number];
6
+ export type SelectionKind = 'picture' | 'container' | 'chart' | 'shape';
7
+ /** The kind of object that decides which specialised tab a single selection gets. */
8
+ export declare function selectionKind(shape: VisioShape | undefined): SelectionKind;
9
+ /**
10
+ * The one contextual tab for the selection. A lone picture, container or chart gets its own tab
11
+ * (which carries the Arrange and Size controls too) instead of Shape Format; every other
12
+ * selection, including several shapes, gets Shape Format; no selection gets none.
13
+ */
14
+ export declare function contextualTabFor(state: ViewerState): ContextualTab | undefined;
15
+ /**
16
+ * The state of the contextual tabs. Their Shape Styles, Arrange and Size controls are the Home
17
+ * controls built again: every module that syncs a control by its id updates the first match
18
+ * (Home), so this copies that state onto the contextual twins instead of teaching each module
19
+ * about several copies. Controls that exist only on a contextual tab are synced by their owner.
20
+ */
21
+ export declare function renderContextualTabs(toolbar: HTMLElement, state: ViewerState): void;
@@ -1,11 +1,12 @@
1
1
  import type { ViewerController, ViewerState } from './controller.js';
2
- import type { VisioDiagramPartAction } from './ribbon-action.js';
2
+ import type { VisioContainerAction, VisioContainerOptionAction, VisioDiagramPartAction } from './ribbon-action.js';
3
3
  import { type DiagramPart } from './ribbon-diagram-parts.js';
4
4
  /**
5
5
  * Insert > Container and Callout (and the shape menu's Container): one core edit each, so undo
6
6
  * restores the page in one step. Availability follows the selection; core admission decides.
7
7
  */
8
8
  export declare class ViewerDiagramParts {
9
+ #private;
9
10
  private readonly root;
10
11
  private readonly controller;
11
12
  private readonly edit;
@@ -13,5 +14,12 @@ export declare class ViewerDiagramParts {
13
14
  constructor(root: ShadowRoot, controller: ViewerController, edit: (run: () => Promise<void>, message: string) => void, revealText: () => void);
14
15
  reason(state: ViewerState, part: DiagramPart): string | undefined;
15
16
  run(action: VisioDiagramPartAction): void;
17
+ /**
18
+ * Container Format > Margins, Automatic Resize and Lock Container: one core option edit. The
19
+ * lock toggle reads the container's stored lock, so it flips whatever the page shows.
20
+ */
21
+ containerOptions(action: VisioContainerOptionAction): void;
22
+ /** Container Format > Fit to Contents, Select Contents and Disband Container. */
23
+ container(command: VisioContainerAction['command']): void;
16
24
  render(state: ViewerState): void;
17
25
  }
@@ -4,11 +4,13 @@ import { ViewerController } from './controller.js';
4
4
  import { type RibbonAddInTab } from '../ribbon/add-in-tabs.js';
5
5
  import { type BackstagePage } from './backstage.js';
6
6
  import type { CreateVsdxOptions } from 'ooxml-core/visio';
7
+ import type { VisioTemplateId } from 'ooxml-core/visio/ui';
7
8
  import type { VisioCustomization } from 'ooxml-core/visio/ui';
8
9
  import type { DocumentStorage } from 'ooxml-core/embedding';
9
10
  import { type StatusBarTheme } from './viewer-options.js';
10
11
  import type { VisioCollaborationOptions, VisioCollaborationState } from './collaboration-types.js';
11
12
  import { type SvgExportOptions, type SvgExportResult } from './export-svg.js';
13
+ import type { PdfFontFile } from '../export/pdf-embedded-font.js';
12
14
  import { type CurrentPagePrintSnapshotOptions, type PrintSnapshot } from './print-snapshot.js';
13
15
  declare const BaseElement: typeof HTMLElement;
14
16
  export declare class VisioViewerElement extends BaseElement {
@@ -44,6 +46,12 @@ export declare class VisioViewerElement extends BaseElement {
44
46
  */
45
47
  get storage(): DocumentStorage | null;
46
48
  set storage(value: DocumentStorage | null | undefined);
49
+ /**
50
+ * TrueType fonts File > Export > PDF embeds (as subsets) so text outside the standard fonts'
51
+ * character set, or in a particular typeface, stays real text. The host supplies the bytes
52
+ * (nothing is bundled); a font whose licence forbids embedding is reported and skipped.
53
+ */
54
+ pdfFonts: readonly PdfFontFile[];
47
55
  /** What `collaboration-change` last reported. */
48
56
  get collaborationState(): VisioCollaborationState;
49
57
  /** Leaves the room and clears `collaboration`. A host-owned session stays alive. */
@@ -79,6 +87,8 @@ export declare class VisioViewerElement extends BaseElement {
79
87
  load(source: VsdxSource): Promise<void>;
80
88
  /** Create a source-backed drawing and name only the accepted request. */
81
89
  createBlankDrawing(options?: CreateVsdxOptions): Promise<void>;
90
+ /** Create a drawing from a File > New template (Blank Drawing, flowcharts, org chart). */
91
+ createFromTemplate(template: VisioTemplateId): Promise<void>;
82
92
  /** Leave Visio's File backstage and return to the drawing. */
83
93
  closeBackstage(): void;
84
94
  /** Open Visio's File backstage at a page (Info by default). */
@@ -1,5 +1,5 @@
1
1
  import type { VisioDocument } from 'ooxml-core/visio';
2
- /** Raster resolution of PDF and PNG output; large pages are scaled down to the canvas cap. */
2
+ /** Raster resolution of PNG output and of PDF picture-page fallbacks; large pages are scaled down to the canvas cap. */
3
3
  export declare const EXPORT_DPI = 150;
4
4
  /** Pixel size of a page at `dpi`, scaled down so neither side exceeds the canvas cap. */
5
5
  export declare function rasterSize(widthIn: number, heightIn: number, dpi?: number): {
@@ -10,8 +10,3 @@ export declare function rasterSize(widthIn: number, heightIn: number, dpi?: numb
10
10
  export declare function rasterizePage(doc: Document, model: VisioDocument, pageIndex: number, dpi?: number): Promise<HTMLCanvasElement>;
11
11
  /** The current page as a PNG picture. */
12
12
  export declare function exportPagePng(doc: Document, model: VisioDocument, pageIndex: number): Promise<Blob>;
13
- /**
14
- * Every foreground page (with its background pages) as one raster PDF page of the drawing's
15
- * page size. Text is not selectable: the pages are pictures, not vector PDF.
16
- */
17
- export declare function exportDocumentPdf(doc: Document, model: VisioDocument): Promise<Blob>;
@@ -4,7 +4,12 @@ import { type DocumentStorage, type VisioFileCommand } from 'ooxml-core/embeddin
4
4
  * Excel. Returns false when a host canceled it to handle the command itself.
5
5
  */
6
6
  export declare function announceFileCommand(host: HTMLElement, command: VisioFileCommand): boolean;
7
- /** The name a drawing is saved under in host storage: its own name as a .vsdx. */
7
+ /**
8
+ * The extension a drawing is saved with: .vsdm for a macro-enabled drawing or template (its VBA
9
+ * project is kept, never run), .vsdx for everything else (a template saves as a drawing).
10
+ */
11
+ export declare function drawingExtension(fileName: string): 'vsdx' | 'vsdm';
12
+ /** The name a drawing is saved under in host storage: its own name as a .vsdx (or .vsdm). */
8
13
  export declare function storageFileName(fileName: string): string;
9
14
  /** Saves the drawing's bytes to the host's storage; resolves with the name it now has. */
10
15
  export declare function saveDrawingToStorage(storage: DocumentStorage, bytes: Uint8Array, fileName: string): Promise<string>;
@@ -1,5 +1,5 @@
1
1
  import { type VisioPage } from 'ooxml-core/visio';
2
- import { type VisioSnapGrid, type VisioPagePoint } from 'ooxml-core/visio/ui';
2
+ import { type VisioResizeSizeMatch, type VisioResizeSnapOptions, type VisioSnapGrid, type VisioSnapResult, type VisioPagePoint } from 'ooxml-core/visio/ui';
3
3
  import type { ViewerController, ViewerState } from './controller.js';
4
4
  /**
5
5
  * View > Guides and View > Dynamic Grid. Guides are the page's `Type="Guide"` shapes, drawn as
@@ -24,6 +24,13 @@ export declare class ViewerGuides {
24
24
  * to omit grid snapping). Grid visibility is independent. Unchanged when no snapping is active.
25
25
  */
26
26
  snap(page: VisioPage, ids: readonly string[], delta: VisioPagePoint, grid?: number | VisioSnapGrid, axis?: 'x' | 'y'): VisioPagePoint;
27
+ /**
28
+ * The snapping a resize drag uses (Dynamic Grid and shown guides, with the same threshold as a
29
+ * move), or undefined when none of it is on. Snap & Glue switched off leaves it undefined too.
30
+ */
31
+ resizeSnapSettings(): VisioResizeSnapOptions | undefined;
32
+ /** Draws a resize's alignment lines and size-match outlines, replacing the earlier hints. */
33
+ resizeHints(page: VisioPage, lines: VisioSnapResult['lines'], matches: readonly VisioResizeSizeMatch[]): void;
27
34
  clearHints(): void;
28
35
  wire(): () => void;
29
36
  render(state: ViewerState): void;
@@ -0,0 +1,15 @@
1
+ import type { ViewerController, ViewerState } from './controller.js';
2
+ /**
3
+ * The Width and Height boxes in the Size group of the Shape, Picture and Container Format tabs.
4
+ * Each commits one resize of the selected shape through the same core command the Size & Position
5
+ * pane uses, so the two always agree.
6
+ */
7
+ export declare class ViewerInlineSize {
8
+ #private;
9
+ private readonly root;
10
+ private readonly controller;
11
+ constructor(root: ShadowRoot, controller: ViewerController);
12
+ wire(): () => void;
13
+ inputs(): HTMLInputElement[];
14
+ render(state: ViewerState): void;
15
+ }
@@ -36,6 +36,7 @@ export declare class InsertDialog {
36
36
  choices(name: string, values: readonly string[], current: string, options?: {
37
37
  labels?: readonly string[];
38
38
  none?: boolean;
39
+ noneLabel?: string;
39
40
  }): void;
40
41
  busy(value: boolean): void;
41
42
  }
@@ -1,5 +1,6 @@
1
+ import { type VisioTemplateId } from 'ooxml-core/visio/ui';
1
2
  /** File New and its shortcut share the element's source lifecycle. */
2
- export declare function wireNewDrawing(root: ShadowRoot, create: () => Promise<void>, busy: () => boolean, announce: (message: string) => void): {
3
- run(): void;
3
+ export declare function wireNewDrawing(root: ShadowRoot, create: (template?: VisioTemplateId) => Promise<void>, busy: () => boolean, announce: (message: string) => void): {
4
+ run(template?: VisioTemplateId): void;
4
5
  dispose(): void;
5
6
  };
@@ -0,0 +1,19 @@
1
+ import { type ViewerController, type ViewerState } from './controller.js';
2
+ import type { VisioOrgChartAction } from './ribbon-action.js';
3
+ type Command = VisioOrgChartAction['command'];
4
+ /** The org chart position the first selected shape is, on the displayed page. */
5
+ export declare function orgChartSelection(state: ViewerState): {
6
+ pageId: string;
7
+ id: string;
8
+ } | undefined;
9
+ /** The Org Chart tab's controller: one edit batch per command, so undo steps back one command. */
10
+ export declare class ViewerOrgChart {
11
+ private readonly root;
12
+ private readonly controller;
13
+ private readonly edit;
14
+ constructor(root: ShadowRoot, controller: ViewerController, edit: (run: () => Promise<void>, message: string) => void);
15
+ reason(state: ViewerState, command: Command): string | undefined;
16
+ run(action: VisioOrgChartAction): void;
17
+ render(state: ViewerState): void;
18
+ }
19
+ export {};
@@ -0,0 +1,26 @@
1
+ import type { VisioDocument } from 'ooxml-core/visio';
2
+ import type { PdfExportOptions, PdfExportResult } from './viewer-pdf.js';
3
+ /** What the Export page asks of the PDF: Visio's Publish options "Page range". */
4
+ export type PdfRangeChoice = {
5
+ scope: 'all';
6
+ } | {
7
+ scope: 'current';
8
+ } | {
9
+ scope: 'range';
10
+ from: number;
11
+ to: number;
12
+ };
13
+ /** The result summary the Export page shows after a PDF is made. */
14
+ export type PdfReportSummary = Pick<PdfExportResult, 'pages' | 'embeddedFonts' | 'refusedFonts'>;
15
+ /** The "Publish options" panel: a page range, and the report of the last export. */
16
+ export declare function pdfOptionsPanel(doc: Document): HTMLElement;
17
+ /** The choice on the panel, clamped to `pageCount` foreground pages. */
18
+ export declare function readPdfChoice(root: ParentNode, pageCount: number): PdfRangeChoice;
19
+ /** Keep the range inputs inside the drawing's foreground pages. */
20
+ export declare function syncPdfPanel(root: ParentNode, model: VisioDocument | null | undefined): void;
21
+ /** The PDF export options for a choice (the current page is `pageIndex`). */
22
+ export declare function pdfOptionsFor(choice: PdfRangeChoice, pageIndex: number): PdfExportOptions;
23
+ /** Lines of the per-page report: how each page was drawn and what it lost. */
24
+ export declare function pdfReportLines(summary: PdfReportSummary): string[];
25
+ /** Show the report of the last PDF export on the panel (or hide it with `undefined`). */
26
+ export declare function showPdfReport(root: ParentNode, summary: PdfReportSummary | undefined): void;
@@ -0,0 +1,47 @@
1
+ import type { VisioDocument } from 'ooxml-core/visio';
2
+ import { type PdfFontFile } from '../export/pdf-embedded-font.js';
3
+ /** Which pages the PDF holds. Background pages are always drawn behind the pages that use them. */
4
+ export interface PdfExportOptions {
5
+ /** `current` exports only `pageIndex` (a foreground page); default `all`. */
6
+ scope?: 'all' | 'current';
7
+ pageIndex?: number;
8
+ /** 1-based inclusive range over the foreground pages. */
9
+ from?: number;
10
+ to?: number;
11
+ /**
12
+ * TrueType fonts to embed (subset) so text outside WinAnsi, or in a typeface the standard
13
+ * fonts do not match, stays real text. The host supplies the bytes; none are bundled.
14
+ */
15
+ fonts?: readonly PdfFontFile[];
16
+ }
17
+ export interface PdfPageReport {
18
+ /** Index in the document's page list. */
19
+ index: number;
20
+ name: string;
21
+ /** `vector` is real paths and text; `picture` is a raster of the page, with `fallback` saying why. */
22
+ mode: 'vector' | 'picture';
23
+ fallback: string[];
24
+ /** Effects the vector page leaves out or simplifies. */
25
+ degraded: string[];
26
+ }
27
+ export interface PdfExportResult {
28
+ blob: Blob;
29
+ pages: PdfPageReport[];
30
+ /** Families of the supplied fonts that were embedded as subsets. */
31
+ embeddedFonts: string[];
32
+ /** Supplied fonts that were not embedded (not TrueType, or the licence forbids embedding). */
33
+ refusedFonts: string[];
34
+ }
35
+ /** The foreground page indexes a PDF export covers. */
36
+ export declare function pdfPageIndexes(model: VisioDocument, options?: PdfExportOptions): number[];
37
+ /**
38
+ * Pages as a PDF: vector paths, real (selectable) text and embedded pictures. Text uses the
39
+ * 14 standard fonts (not embedded) unless the host passes `fonts`, which are subset and embedded.
40
+ * Gradients are PDF shadings and shadows are offset copies; glow is a hard-edged halo; blur,
41
+ * soft edges and reflections are not drawn. A page the vector path cannot represent (text no
42
+ * supplied font covers, charts, patterns) becomes a picture page. The report says which and why
43
+ * (`PdfPageReport.degraded` and `fallback`).
44
+ */
45
+ export declare function exportDocumentPdfDetailed(doc: Document, model: VisioDocument, options?: PdfExportOptions): Promise<PdfExportResult>;
46
+ /** The PDF only; see `exportDocumentPdfDetailed` for the per-page report. */
47
+ export declare function exportDocumentPdf(doc: Document, model: VisioDocument, options?: PdfExportOptions): Promise<Blob>;
@@ -0,0 +1,20 @@
1
+ import type { ViewerController, ViewerState } from './controller.js';
2
+ import type { VisioPictureAction } from './ribbon-action.js';
3
+ /** The picture a single selection names, when it is a picture on the current page. */
4
+ export declare function selectedPicture(state: ViewerState): {
5
+ pageId: string;
6
+ shapeId: string;
7
+ } | undefined;
8
+ /**
9
+ * Picture Format > Adjust (Brightness, Contrast) and Crop: one core edit per command, on the
10
+ * selected picture. Core admission decides whether the picture can take it.
11
+ */
12
+ export declare class ViewerPictureFormat {
13
+ private readonly root;
14
+ private readonly controller;
15
+ private readonly edit;
16
+ constructor(root: ShadowRoot, controller: ViewerController, edit: (run: () => Promise<void>, message: string) => void);
17
+ reason(state: ViewerState): string | undefined;
18
+ run(action: VisioPictureAction): void;
19
+ render(state: ViewerState): void;
20
+ }