ooxml-ui 1.24.0 → 1.26.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 (365) hide show
  1. package/README.md +83 -19
  2. package/custom-elements.json +355 -1
  3. package/dist/bindings/bind-element.d.ts +29 -0
  4. package/dist/bindings/contract.d.ts +115 -0
  5. package/dist/bindings/equality.d.ts +9 -0
  6. package/dist/bindings/handle.d.ts +33 -0
  7. package/dist/bindings/index.d.ts +6 -0
  8. package/dist/bindings/react.d.ts +21 -0
  9. package/dist/bindings/react.js +39 -0
  10. package/dist/bindings/solid.d.ts +14 -0
  11. package/dist/bindings/solid.js +27 -0
  12. package/dist/bindings/src-loader.d.ts +14 -0
  13. package/dist/bindings/tracker.d.ts +14 -0
  14. package/dist/bindings/vue.d.ts +35 -0
  15. package/dist/bindings/vue.js +65 -0
  16. package/dist/bindings.js +3 -0
  17. package/dist/chart/data-sheet-keys.d.ts +38 -0
  18. package/dist/chart/data-sheet-keys.d.ts.map +1 -0
  19. package/dist/chart/data-sheet-labels.d.ts +36 -0
  20. package/dist/chart/data-sheet-labels.d.ts.map +1 -0
  21. package/dist/chart/data-sheet.d.ts +68 -0
  22. package/dist/chart/data-sheet.d.ts.map +1 -0
  23. package/dist/chart/design-galleries.d.ts +52 -0
  24. package/dist/chart/design-galleries.d.ts.map +1 -0
  25. package/dist/chart/format-pane-3d.d.ts +7 -0
  26. package/dist/chart/format-pane-3d.d.ts.map +1 -0
  27. package/dist/chart/format-pane-api.d.ts +17 -0
  28. package/dist/chart/format-pane-api.d.ts.map +1 -0
  29. package/dist/chart/format-pane-axis.d.ts +5 -0
  30. package/dist/chart/format-pane-axis.d.ts.map +1 -0
  31. package/dist/chart/format-pane-common.d.ts +23 -0
  32. package/dist/chart/format-pane-common.d.ts.map +1 -0
  33. package/dist/{pptx/render/chart-format/chart-format-pane-effects.d.ts → chart/format-pane-effects.d.ts} +5 -11
  34. package/dist/chart/format-pane-effects.d.ts.map +1 -0
  35. package/dist/chart/format-pane-fields.d.ts +29 -0
  36. package/dist/chart/format-pane-fields.d.ts.map +1 -0
  37. package/dist/chart/format-pane-fill-kinds.d.ts +16 -0
  38. package/dist/chart/format-pane-fill-kinds.d.ts.map +1 -0
  39. package/dist/chart/format-pane-fill-line.d.ts +13 -0
  40. package/dist/chart/format-pane-fill-line.d.ts.map +1 -0
  41. package/dist/chart/format-pane-fixture.test-util.d.ts +3 -0
  42. package/dist/chart/format-pane-intent.d.ts +24 -0
  43. package/dist/chart/format-pane-intent.d.ts.map +1 -0
  44. package/dist/chart/format-pane-locales/de.d.ts +3 -0
  45. package/dist/chart/format-pane-locales/de.d.ts.map +1 -0
  46. package/dist/chart/format-pane-locales/en.d.ts +3 -0
  47. package/dist/chart/format-pane-locales/en.d.ts.map +1 -0
  48. package/dist/chart/format-pane-locales/es.d.ts +3 -0
  49. package/dist/chart/format-pane-locales/es.d.ts.map +1 -0
  50. package/dist/chart/format-pane-locales/fr.d.ts +3 -0
  51. package/dist/chart/format-pane-locales/fr.d.ts.map +1 -0
  52. package/dist/chart/format-pane-locales/index.d.ts +7 -0
  53. package/dist/chart/format-pane-locales/index.d.ts.map +1 -0
  54. package/dist/chart/format-pane-locales/zh-CN.d.ts +3 -0
  55. package/dist/chart/format-pane-locales/zh-CN.d.ts.map +1 -0
  56. package/dist/chart/format-pane-model.d.ts +23 -0
  57. package/dist/chart/format-pane-model.d.ts.map +1 -0
  58. package/dist/chart/format-pane-options.d.ts +14 -0
  59. package/dist/chart/format-pane-options.d.ts.map +1 -0
  60. package/dist/chart/format-pane-space.d.ts +21 -0
  61. package/dist/chart/format-pane-space.d.ts.map +1 -0
  62. package/dist/chart/format-pane-targets.d.ts +25 -0
  63. package/dist/chart/format-pane-targets.d.ts.map +1 -0
  64. package/dist/chart/format-pane-text.d.ts +7 -0
  65. package/dist/chart/format-pane-text.d.ts.map +1 -0
  66. package/dist/chart/format-pane-translate.d.ts +10 -0
  67. package/dist/chart/format-pane-translate.d.ts.map +1 -0
  68. package/dist/chart/format-pane-types.d.ts +118 -0
  69. package/dist/chart/format-pane-types.d.ts.map +1 -0
  70. package/dist/chart/format-pane-view.d.ts +212 -0
  71. package/dist/chart/format-pane-view.d.ts.map +1 -0
  72. package/dist/chart/format-pane.d.ts +128 -0
  73. package/dist/chart/format-pane.d.ts.map +1 -0
  74. package/dist/chart/gallery-tiles.d.ts +23 -0
  75. package/dist/chart/gallery-tiles.d.ts.map +1 -0
  76. package/dist/chart-format-locales.js +1 -0
  77. package/dist/chunk-CDAXY5KC.js +118 -0
  78. package/dist/chunk-FN7IF6M6.js +25 -0
  79. package/dist/{chunk-4AARUBIF.js → chunk-HGLCXNCT.js} +50 -24
  80. package/dist/chunk-KJMAVPQB.js +53 -0
  81. package/dist/{chunk-A277D2OJ.js → chunk-KSOHDEUI.js} +1 -1
  82. package/dist/chunk-NDUD5JJB.js +79 -0
  83. package/dist/chunk-P4FRKIPE.js +953 -0
  84. package/dist/chunk-VM6ZTKB3.js +1134 -0
  85. package/dist/{chunk-DQEV4EMA.js → chunk-WDOWQKKC.js} +2722 -276
  86. package/dist/{chunk-Y67BTA5W.js → chunk-WH3EGA3S.js} +10 -3
  87. package/dist/controls.d.ts +9 -2
  88. package/dist/controls.d.ts.map +1 -1
  89. package/dist/controls.js +3 -1
  90. package/dist/dialog/dialog.d.ts +6 -0
  91. package/dist/dialog/dialog.d.ts.map +1 -1
  92. package/dist/dialog/progress-dialog.d.ts +42 -0
  93. package/dist/dialog/progress-dialog.d.ts.map +1 -0
  94. package/dist/docx/chart-commands.d.ts +22 -0
  95. package/dist/docx/chart-design-ribbon.d.ts +4 -0
  96. package/dist/docx/chart-dialogs.d.ts +11 -0
  97. package/dist/docx/chart-format-pane.d.ts +22 -0
  98. package/dist/docx/context-menu-items.d.ts +2 -0
  99. package/dist/docx/editor-core.d.ts +3 -0
  100. package/dist/docx/format-dialogs.d.ts +4 -2
  101. package/dist/docx/image-media.d.ts +9 -1
  102. package/dist/docx/insert-controller.d.ts +5 -0
  103. package/dist/docx/locales/charts.d.ts +51 -0
  104. package/dist/docx/locales/en.d.ts +113 -0
  105. package/dist/docx/locales/smartart.d.ts +77 -0
  106. package/dist/docx/localization-strings.d.ts +113 -0
  107. package/dist/docx/resize-handle.d.ts +23 -0
  108. package/dist/docx/ribbon-action.d.ts +15 -0
  109. package/dist/docx/ribbon-icons.d.ts +13 -0
  110. package/dist/docx/smartart-commands.d.ts +26 -0
  111. package/dist/docx/smartart-controller.d.ts +35 -0
  112. package/dist/docx/smartart-design-ribbon.d.ts +7 -0
  113. package/dist/docx/smartart-dialog.d.ts +12 -0
  114. package/dist/docx/smartart-node-view.d.ts +6 -3
  115. package/dist/docx.js +1674 -546
  116. package/dist/form/color-grid.d.ts +8 -1
  117. package/dist/form/color-grid.d.ts.map +1 -1
  118. package/dist/index.d.ts +1 -1
  119. package/dist/index.js +10 -5
  120. package/dist/pptx/ai/bridge-factory.d.ts +77 -0
  121. package/dist/pptx/ai/bridge-factory.d.ts.map +1 -0
  122. package/dist/pptx/ai/index.cjs +443 -164
  123. package/dist/pptx/ai/index.d.ts +4 -0
  124. package/dist/pptx/ai/index.d.ts.map +1 -1
  125. package/dist/pptx/ai/index.mjs +437 -165
  126. package/dist/pptx/ai/panel-controller.d.ts +104 -0
  127. package/dist/pptx/ai/panel-controller.d.ts.map +1 -0
  128. package/dist/pptx/{chart-3d-view-scene-RYL7F65H.cjs → chart-3d-view-scene-N7UQOYFI.cjs} +38 -38
  129. package/dist/pptx/{chart-3d-view-scene-CDIMM5T3.mjs → chart-3d-view-scene-ZUGA3DKM.mjs} +2 -2
  130. package/dist/pptx/{chunk-PIIYTRLE.mjs → chunk-34LEUH5R.mjs} +1 -1
  131. package/dist/pptx/{chunk-G3UVZ5FO.cjs → chunk-6KLPQQYP.cjs} +1 -0
  132. package/dist/pptx/{chunk-B5FR65LB.mjs → chunk-AMW2AR7J.mjs} +48 -2
  133. package/dist/pptx/chunk-CWHK7HF4.mjs +751 -0
  134. package/dist/pptx/{chunk-ZO43VVWQ.cjs → chunk-FM4C4MBJ.cjs} +49 -1
  135. package/dist/pptx/{chunk-LCB46TH2.cjs → chunk-H5IPNKX6.cjs} +12 -12
  136. package/dist/pptx/{chunk-SQQJLXTZ.cjs → chunk-HAO5PKWK.cjs} +8048 -4240
  137. package/dist/pptx/{chunk-3UOENEK7.mjs → chunk-IWUIGVWT.mjs} +7836 -4095
  138. package/dist/pptx/{chunk-ZNXKAINY.mjs → chunk-LB3A3GF6.mjs} +1150 -222
  139. package/dist/pptx/chunk-LUDEAPHZ.cjs +776 -0
  140. package/dist/pptx/{chunk-A2X5BP7J.cjs → chunk-OOQMIQT3.cjs} +1151 -221
  141. package/dist/pptx/chunk-WM5SW737.mjs +27 -0
  142. package/dist/pptx/{chunk-73OUATE4.mjs → chunk-WQA3KZRB.mjs} +1 -1
  143. package/dist/pptx/chunk-Y6DO6SVT.cjs +29 -0
  144. package/dist/pptx/dom/index.cjs +503 -1123
  145. package/dist/pptx/dom/index.d.ts +1 -0
  146. package/dist/pptx/dom/index.d.ts.map +1 -1
  147. package/dist/pptx/dom/index.mjs +12 -704
  148. package/dist/pptx/dom/smartart-insert-preview.d.ts +15 -0
  149. package/dist/pptx/dom/smartart-insert-preview.d.ts.map +1 -0
  150. package/dist/pptx/export/html2canvas-clone.cjs +10 -2
  151. package/dist/pptx/export/html2canvas-clone.d.ts +24 -0
  152. package/dist/pptx/export/html2canvas-clone.d.ts.map +1 -1
  153. package/dist/pptx/export/html2canvas-clone.mjs +1 -1
  154. package/dist/pptx/i18n/index.cjs +6 -6
  155. package/dist/pptx/i18n/index.mjs +1 -1
  156. package/dist/pptx/i18n/translations-en-chart-format.d.ts.map +1 -1
  157. package/dist/pptx/i18n/translations-en-galleries.d.ts.map +1 -1
  158. package/dist/pptx/i18n/translations-en.d.ts.map +1 -1
  159. package/dist/pptx/index.cjs +3523 -3238
  160. package/dist/pptx/index.mjs +6 -5
  161. package/dist/pptx/render/autosave-inline-draft.d.ts +27 -0
  162. package/dist/pptx/render/autosave-inline-draft.d.ts.map +1 -0
  163. package/dist/pptx/render/autosave-policy.d.ts +6 -7
  164. package/dist/pptx/render/autosave-policy.d.ts.map +1 -1
  165. package/dist/pptx/render/autosave-tick.d.ts +6 -0
  166. package/dist/pptx/render/autosave-tick.d.ts.map +1 -1
  167. package/dist/pptx/render/chart-combo-stock.cjs +3 -3
  168. package/dist/pptx/render/chart-combo-stock.mjs +1 -1
  169. package/dist/pptx/render/chart-format/chart-format-pane-edit.d.ts +10 -2
  170. package/dist/pptx/render/chart-format/chart-format-pane-edit.d.ts.map +1 -1
  171. package/dist/pptx/render/chart-format/chart-format-pane-model.d.ts +4 -2
  172. package/dist/pptx/render/chart-format/chart-format-pane-model.d.ts.map +1 -1
  173. package/dist/pptx/render/chart-format/chart-format-pane-types.d.ts +4 -91
  174. package/dist/pptx/render/chart-format/chart-format-pane-types.d.ts.map +1 -1
  175. package/dist/pptx/render/chart-format/chart-format-source.d.ts +14 -0
  176. package/dist/pptx/render/chart-format/chart-format-source.d.ts.map +1 -0
  177. package/dist/pptx/render/chart-format/chart-format-targets.d.ts +16 -19
  178. package/dist/pptx/render/chart-format/chart-format-targets.d.ts.map +1 -1
  179. package/dist/pptx/render/chart-format/index.d.ts +2 -1
  180. package/dist/pptx/render/chart-format/index.d.ts.map +1 -1
  181. package/dist/pptx/render/chart-overlays.cjs +7 -7
  182. package/dist/pptx/render/chart-overlays.mjs +1 -1
  183. package/dist/pptx/render/chart-quick-action-styles.d.ts +4 -1
  184. package/dist/pptx/render/chart-quick-action-styles.d.ts.map +1 -1
  185. package/dist/pptx/render/chart-surface-treemap.cjs +4 -4
  186. package/dist/pptx/render/chart-surface-treemap.mjs +1 -1
  187. package/dist/pptx/render/chart-view-model.cjs +44 -44
  188. package/dist/pptx/render/chart-view-model.mjs +1 -1
  189. package/dist/pptx/render/chart-waterfall-map.cjs +6 -6
  190. package/dist/pptx/render/chart-waterfall-map.mjs +1 -1
  191. package/dist/pptx/render/collaboration-provider.d.ts +80 -0
  192. package/dist/pptx/render/collaboration-provider.d.ts.map +1 -0
  193. package/dist/pptx/render/collaboration-yjs-session.d.ts +48 -0
  194. package/dist/pptx/render/collaboration-yjs-session.d.ts.map +1 -0
  195. package/dist/pptx/render/controller/autosave-controller.d.ts +133 -0
  196. package/dist/pptx/render/controller/autosave-controller.d.ts.map +1 -0
  197. package/dist/pptx/render/controller/autosave-recovery-controller.d.ts +68 -0
  198. package/dist/pptx/render/controller/autosave-recovery-controller.d.ts.map +1 -0
  199. package/dist/pptx/render/controller/collaboration-session-controller.d.ts +89 -0
  200. package/dist/pptx/render/controller/collaboration-session-controller.d.ts.map +1 -0
  201. package/dist/pptx/render/controller/controller.d.ts +44 -0
  202. package/dist/pptx/render/controller/controller.d.ts.map +1 -0
  203. package/dist/pptx/render/controller/history-controller.d.ts +54 -0
  204. package/dist/pptx/render/controller/history-controller.d.ts.map +1 -0
  205. package/dist/pptx/render/controller/index.d.ts +17 -0
  206. package/dist/pptx/render/controller/index.d.ts.map +1 -0
  207. package/dist/pptx/render/customization/ribbon-control-catalog-tail.d.ts +2 -0
  208. package/dist/pptx/render/customization/ribbon-control-catalog-tail.d.ts.map +1 -1
  209. package/dist/pptx/render/customization/ribbon-control-catalog.d.ts +2 -0
  210. package/dist/pptx/render/customization/ribbon-control-catalog.d.ts.map +1 -1
  211. package/dist/pptx/render/editor-gesture-frames.d.ts +59 -0
  212. package/dist/pptx/render/editor-gesture-frames.d.ts.map +1 -0
  213. package/dist/pptx/render/editor-gestures.d.ts +39 -38
  214. package/dist/pptx/render/editor-gestures.d.ts.map +1 -1
  215. package/dist/pptx/render/editor-history.d.ts +1 -1
  216. package/dist/pptx/render/editor-history.d.ts.map +1 -1
  217. package/dist/pptx/render/editor-key-dispatch.d.ts +68 -0
  218. package/dist/pptx/render/editor-key-dispatch.d.ts.map +1 -0
  219. package/dist/pptx/render/effects-helpers.d.ts +8 -1
  220. package/dist/pptx/render/effects-helpers.d.ts.map +1 -1
  221. package/dist/pptx/render/effects-shadow-helpers.d.ts +7 -0
  222. package/dist/pptx/render/effects-shadow-helpers.d.ts.map +1 -1
  223. package/dist/pptx/render/export-progress.d.ts +12 -0
  224. package/dist/pptx/render/export-progress.d.ts.map +1 -1
  225. package/dist/pptx/render/group-press-target.d.ts +37 -0
  226. package/dist/pptx/render/group-press-target.d.ts.map +1 -0
  227. package/dist/pptx/render/index.d.ts +13 -0
  228. package/dist/pptx/render/index.d.ts.map +1 -1
  229. package/dist/pptx/render/insert-chart-preview.d.ts +15 -0
  230. package/dist/pptx/render/insert-chart-preview.d.ts.map +1 -0
  231. package/dist/pptx/render/insert-chart.d.ts +21 -1
  232. package/dist/pptx/render/insert-chart.d.ts.map +1 -1
  233. package/dist/pptx/render/inspector/element-geometry-fields.d.ts +28 -0
  234. package/dist/pptx/render/inspector/element-geometry-fields.d.ts.map +1 -0
  235. package/dist/pptx/render/inspector/index.d.ts +18 -0
  236. package/dist/pptx/render/inspector/index.d.ts.map +1 -0
  237. package/dist/pptx/render/inspector/inspector-field-model.d.ts +125 -0
  238. package/dist/pptx/render/inspector/inspector-field-model.d.ts.map +1 -0
  239. package/dist/pptx/render/inspector/shape-effect-fields-more.d.ts +8 -0
  240. package/dist/pptx/render/inspector/shape-effect-fields-more.d.ts.map +1 -0
  241. package/dist/pptx/render/inspector/shape-effect-fields.d.ts +27 -0
  242. package/dist/pptx/render/inspector/shape-effect-fields.d.ts.map +1 -0
  243. package/dist/pptx/render/inspector/shape-effect-sections.d.ts +7 -0
  244. package/dist/pptx/render/inspector/shape-effect-sections.d.ts.map +1 -0
  245. package/dist/pptx/render/inspector/shape-line-fields.d.ts +20 -0
  246. package/dist/pptx/render/inspector/shape-line-fields.d.ts.map +1 -0
  247. package/dist/pptx/render/inspector/text-box-fields.d.ts +24 -0
  248. package/dist/pptx/render/inspector/text-box-fields.d.ts.map +1 -0
  249. package/dist/pptx/render/options/viewer-options-apply.d.ts.map +1 -1
  250. package/dist/pptx/render/options/viewer-options.d.ts.map +1 -1
  251. package/dist/pptx/render/presentation-show-step.d.ts +105 -0
  252. package/dist/pptx/render/presentation-show-step.d.ts.map +1 -0
  253. package/dist/pptx/render/read-only-session.d.ts +120 -0
  254. package/dist/pptx/render/read-only-session.d.ts.map +1 -0
  255. package/dist/pptx/render/ribbon-galleries/chart-colors-gallery.d.ts +3 -2
  256. package/dist/pptx/render/ribbon-galleries/chart-colors-gallery.d.ts.map +1 -1
  257. package/dist/pptx/render/ribbon-galleries/chart-quick-layout-gallery.d.ts +6 -3
  258. package/dist/pptx/render/ribbon-galleries/chart-quick-layout-gallery.d.ts.map +1 -1
  259. package/dist/pptx/render/ribbon-galleries/chart-styles-gallery.d.ts +2 -1
  260. package/dist/pptx/render/ribbon-galleries/chart-styles-gallery.d.ts.map +1 -1
  261. package/dist/pptx/render/ribbon-galleries/gallery-placements.d.ts.map +1 -1
  262. package/dist/pptx/render/ribbon-galleries/gallery-types.d.ts +1 -1
  263. package/dist/pptx/render/ribbon-galleries/gallery-types.d.ts.map +1 -1
  264. package/dist/pptx/render/ribbon-galleries/smartart-colors-gallery.d.ts +0 -8
  265. package/dist/pptx/render/ribbon-galleries/smartart-colors-gallery.d.ts.map +1 -1
  266. package/dist/pptx/render/ribbon-galleries/smartart-commands.d.ts +1 -1
  267. package/dist/pptx/render/ribbon-galleries/smartart-commands.d.ts.map +1 -1
  268. package/dist/pptx/render/ribbon-galleries/smartart-gallery-patch.d.ts +4 -2
  269. package/dist/pptx/render/ribbon-galleries/smartart-gallery-patch.d.ts.map +1 -1
  270. package/dist/pptx/render/ribbon-galleries/smartart-gallery-tiles.d.ts +3 -8
  271. package/dist/pptx/render/ribbon-galleries/smartart-gallery-tiles.d.ts.map +1 -1
  272. package/dist/pptx/render/ribbon-galleries/smartart-layout-tiles.d.ts +7 -5
  273. package/dist/pptx/render/ribbon-galleries/smartart-layout-tiles.d.ts.map +1 -1
  274. package/dist/pptx/render/ribbon-galleries/smartart-layouts-gallery.d.ts.map +1 -1
  275. package/dist/pptx/render/ribbon-insert-state.d.ts +6 -0
  276. package/dist/pptx/render/ribbon-insert-state.d.ts.map +1 -1
  277. package/dist/pptx/render/smart-art-presets.d.ts +12 -6
  278. package/dist/pptx/render/smart-art-presets.d.ts.map +1 -1
  279. package/dist/pptx/render/smartart-text-pane-model.d.ts +59 -0
  280. package/dist/pptx/render/smartart-text-pane-model.d.ts.map +1 -0
  281. package/dist/pptx/render/span-snap-move.d.ts +32 -0
  282. package/dist/pptx/render/span-snap-move.d.ts.map +1 -0
  283. package/dist/pptx/render/theme-color-grid.d.ts +17 -0
  284. package/dist/pptx/render/theme-color-grid.d.ts.map +1 -1
  285. package/dist/pptx/render/viewer-event-payloads.d.ts +4 -4
  286. package/dist/pptx/smartart-insert-preview-5ZTZYAZR.cjs +48 -0
  287. package/dist/pptx/smartart-insert-preview-HMSNUWDO.mjs +39 -0
  288. package/dist/pptx/web-components/chart-data-sheet.d.ts +47 -0
  289. package/dist/pptx/web-components/chart-data-sheet.d.ts.map +1 -0
  290. package/dist/pptx/web-components/chart-format-pane.d.ts +7 -5
  291. package/dist/pptx/web-components/chart-format-pane.d.ts.map +1 -1
  292. package/dist/pptx/web-components/host-styles.d.ts.map +1 -1
  293. package/dist/pptx/web-components/index.d.ts +7 -0
  294. package/dist/pptx/web-components/index.d.ts.map +1 -1
  295. package/dist/pptx/web-components/insert-chart-dialog.d.ts +25 -0
  296. package/dist/pptx/web-components/insert-chart-dialog.d.ts.map +1 -0
  297. package/dist/pptx/web-components/insert-dialog-frame.d.ts +25 -0
  298. package/dist/pptx/web-components/insert-dialog-frame.d.ts.map +1 -0
  299. package/dist/pptx/web-components/insert-smartart-dialog.d.ts +26 -0
  300. package/dist/pptx/web-components/insert-smartart-dialog.d.ts.map +1 -0
  301. package/dist/pptx/web-components/mobile-insert.d.ts.map +1 -1
  302. package/dist/pptx/web-components/office-alias-types.d.ts +6 -1
  303. package/dist/pptx/web-components/office-alias-types.d.ts.map +1 -1
  304. package/dist/pptx/web-components/office-aliases.d.ts +5 -0
  305. package/dist/pptx/web-components/office-aliases.d.ts.map +1 -1
  306. package/dist/pptx/web-components/office-token-bridge.d.ts +1 -1
  307. package/dist/pptx/web-components/office-token-bridge.d.ts.map +1 -1
  308. package/dist/pptx/web-components/ribbon-insert-view.d.ts.map +1 -1
  309. package/dist/pptx/web-components/smartart-text-pane.d.ts +38 -0
  310. package/dist/pptx/web-components/smartart-text-pane.d.ts.map +1 -0
  311. package/dist/smartart/galleries.d.ts +17 -0
  312. package/dist/smartart/smartart-picker.d.ts +97 -0
  313. package/dist/smartart/smartart-picker.d.ts.map +1 -0
  314. package/dist/smartart/smartart-text-pane-tools.d.ts +51 -0
  315. package/dist/smartart/smartart-text-pane-tools.d.ts.map +1 -0
  316. package/dist/smartart/smartart-text-pane.d.ts +121 -0
  317. package/dist/smartart/smartart-text-pane.d.ts.map +1 -0
  318. package/dist/smartart/text-pane-controller.d.ts +51 -0
  319. package/dist/smartart/tiles.d.ts +17 -0
  320. package/dist/smartart/tiles.d.ts.map +1 -0
  321. package/dist/smartart.d.ts +5 -0
  322. package/dist/smartart.js +2 -1
  323. package/dist/teams/app/bind.d.ts +30 -0
  324. package/dist/teams/app/index.d.ts +1 -1
  325. package/dist/teams.js +7 -2
  326. package/dist/visio/ribbon-action.d.ts +5 -2
  327. package/dist/visio/viewer-chart-editor.d.ts +38 -0
  328. package/dist/visio/viewer-insert.d.ts +7 -2
  329. package/dist/visio.js +197 -17
  330. package/dist/xlsx/chart-format-pane.d.ts +10 -0
  331. package/dist/xlsx/chart-format-source.d.ts +17 -0
  332. package/dist/xlsx/commands/chart-design.d.ts +55 -0
  333. package/dist/xlsx/dialogs/insert-smartart.d.ts +4 -0
  334. package/dist/xlsx/grid/smartart.d.ts +4 -1
  335. package/dist/xlsx/ribbon/tabs/contextual.d.ts +6 -0
  336. package/dist/xlsx/smartart-controller.d.ts +14 -0
  337. package/dist/xlsx.js +789 -468
  338. package/package.json +47 -4
  339. package/dist/chunk-QBXYGKPB.js +0 -224
  340. package/dist/pptx/render/chart-format/chart-format-pane-3d.d.ts +0 -13
  341. package/dist/pptx/render/chart-format/chart-format-pane-3d.d.ts.map +0 -1
  342. package/dist/pptx/render/chart-format/chart-format-pane-axis.d.ts +0 -12
  343. package/dist/pptx/render/chart-format/chart-format-pane-axis.d.ts.map +0 -1
  344. package/dist/pptx/render/chart-format/chart-format-pane-common.d.ts +0 -14
  345. package/dist/pptx/render/chart-format/chart-format-pane-common.d.ts.map +0 -1
  346. package/dist/pptx/render/chart-format/chart-format-pane-effects.d.ts.map +0 -1
  347. package/dist/pptx/render/chart-format/chart-format-pane-fill-kinds.d.ts +0 -15
  348. package/dist/pptx/render/chart-format/chart-format-pane-fill-kinds.d.ts.map +0 -1
  349. package/dist/pptx/render/chart-format/chart-format-pane-fill-line.d.ts +0 -12
  350. package/dist/pptx/render/chart-format/chart-format-pane-fill-line.d.ts.map +0 -1
  351. package/dist/pptx/render/chart-format/chart-format-pane-options.d.ts +0 -13
  352. package/dist/pptx/render/chart-format/chart-format-pane-options.d.ts.map +0 -1
  353. package/dist/pptx/render/chart-format/chart-format-pane-text.d.ts +0 -14
  354. package/dist/pptx/render/chart-format/chart-format-pane-text.d.ts.map +0 -1
  355. package/dist/pptx/render/ribbon-galleries/chart-color-palette-catalog.d.ts +0 -3
  356. package/dist/pptx/render/ribbon-galleries/chart-color-palette-catalog.d.ts.map +0 -1
  357. package/dist/pptx/render/ribbon-galleries/chart-gallery-tiles.d.ts +0 -24
  358. package/dist/pptx/render/ribbon-galleries/chart-gallery-tiles.d.ts.map +0 -1
  359. package/dist/pptx/render/ribbon-galleries/chart-quick-layout-catalog.d.ts +0 -22
  360. package/dist/pptx/render/ribbon-galleries/chart-quick-layout-catalog.d.ts.map +0 -1
  361. package/dist/pptx/web-components/chart-format-pane-fields.d.ts +0 -17
  362. package/dist/pptx/web-components/chart-format-pane-fields.d.ts.map +0 -1
  363. package/dist/xlsx/chart-area-pane.d.ts +0 -9
  364. package/dist/xlsx/chart-series-pane.d.ts +0 -8
  365. package/dist/xlsx/commands/chart-colors.d.ts +0 -19
package/dist/xlsx.js CHANGED
@@ -1,26 +1,31 @@
1
1
  import { statusLayout, watchStatusWidth } from './chunk-UBBC5FH7.js';
2
2
  import { trackPointerGesture } from './chunk-GSXOZCAN.js';
3
- import './chunk-Y67BTA5W.js';
4
- import { createHostBackstagePages, syncRibbonAddIns, withHostMenuItems } from './chunk-A277D2OJ.js';
5
- export { RIBBON_ADD_IN_EVENT } from './chunk-A277D2OJ.js';
6
- import { defineSmartArt } from './chunk-QBXYGKPB.js';
7
- import { withExtension, saveExtension, downloadBytes, emit, emitEvent, blobFor, announceFileCommand, pickFile } from './chunk-4AARUBIF.js';
8
- export { XLSX_EDITOR_EVENTS } from './chunk-4AARUBIF.js';
3
+ import './chunk-WH3EGA3S.js';
4
+ import { createHostBackstagePages, syncRibbonAddIns, withHostMenuItems } from './chunk-KSOHDEUI.js';
5
+ export { RIBBON_ADD_IN_EVENT } from './chunk-KSOHDEUI.js';
6
+ import { SmartArtTextPaneController, defineSmartArt, defineSmartArtPicker, safeColor, svgTile } from './chunk-P4FRKIPE.js';
7
+ import { withExtension, saveExtension, downloadBytes, emit, emitEvent, blobFor, announceFileCommand, pickFile } from './chunk-HGLCXNCT.js';
8
+ export { XLSX_EDITOR_EVENTS } from './chunk-HGLCXNCT.js';
9
9
  import './chunk-FHO7TEWA.js';
10
+ import './chunk-CDAXY5KC.js';
11
+ import './chunk-NDUD5JJB.js';
12
+ import './chunk-KJMAVPQB.js';
10
13
  import { legacyThemeAliases, legacyThemeBridge, installOfficeUiThemeFor } from './chunk-T5ARELU2.js';
11
- import { range_control_default, createRibbonOverflow, defineBackstage, defineRibbon, defineRibbonActions, defineTitleBar, defineStatusBar, defineZoomSlider, defineOptionsDialog, rangeControl, defineDialog, optionsLabels, runKeyTips, assignKeyTips, userInterfaceSection, personalizeSection, optionText, unavailableControl, unavailableCategory, defineGallery, defineContextMenu, defineColorGrid, defineCommentsPane, defineChartPicker } from './chunk-DQEV4EMA.js';
14
+ import { range_control_default, createRibbonOverflow, defineBackstage, defineRibbon, defineRibbonActions, defineTitleBar, defineStatusBar, defineZoomSlider, defineChartFormatPane, defineOptionsDialog, defineDialog, optionsLabels, runKeyTips, assignKeyTips, chartSpaceFormatSource, userInterfaceSection, personalizeSection, optionText, unavailableControl, unavailableCategory, defineGallery, defineContextMenu, rangeControl, defineColorGrid, defineCommentsPane, defineChartPicker } from './chunk-WDOWQKKC.js';
12
15
  import { getIcon, registerIcon } from './chunk-M6GF5ED2.js';
16
+ import './chunk-VM6ZTKB3.js';
13
17
  import { definePresence } from './chunk-YZH2QS7J.js';
18
+ import './chunk-FN7IF6M6.js';
14
19
  import { withTokens } from './chunk-QLHCGV4C.js';
15
20
  import './chunk-XL77FR4B.js';
16
- import { SPECIAL_CODES, FRACTION_CODES, translate, INSERT_CHART_TYPES, AUTOSUM_FUNCTIONS, ICON_ACCENTS, ICON_PATHS, normalizeEditorLocale, EXCEL_CAPABILITY_BACKSTAGE_PAGES, EXCEL_CAPABILITY_COMMANDS, normalizeThemeMode, applyThemeColors, parseSelectionRef, selectionRef, fontCommands, alignmentCommands, numberCommands, editBridge, FONT_SIZES, FONT_NAMES, style, activeRef, numberFormatOptions, selectionFormatting, DirtyState, createCommandRegistry, createDialogRegistry, createSelectionModel, SheetSelections, translator, initialSelection, sheetBaseName, historyOf, onRibbonTabsChange, activeChart, editChart, CellViewCache, QUADRANTS, columnHeaderHeight, rowHeaderWidth, GridGeometry, cellRange, scrollToReveal, buildItems, fitNumber, cssFont, clampAddress, selectCell, movingEnd, extendSelection, moveWithinSelection, rowsRange, colsRange, ALL_RANGE, ribbonTabs, isTabHidden, selectTab, setTabHidden, tabButton, searchCommands, formatNumber, isSingleCell, spanRange, selectionCellCount, addRange, TEMPLATES, createTemplateWorkbook, fillPaint, iconSvg, colSelected, rowSelected, rowHeaderMenu, columnHeaderMenu, cellMenu, isMenuSeparator, textDecoration, justify, alignItems, textAlign, hasBorders, edgeCss, diagonalSvg, registerRibbonTabs, installFormatPainter, SHEET_ICONS, clipboardCommands, cellCommands, editingCommands, pageLayoutCommands, pageBreakCommands, formulaCommands, dataCommands, whatIfCommands, contextualCommands, reviewTab, viewTab, helpTab, tabMenu, editing, icon, DATA_BAR_COLORS, dataBarRule, COLOR_SCALES, colorScaleRule, iconSetRule, target, tableAt, timelineSourceAt, slicerSourceAt, viewing, activeTable, BORDER_PRESETS, ORIENTATIONS, ACCOUNTING_FORMATS, themePaletteItems, MARGIN_PRESETS, PAPER_SIZES, FUNCTION_MENUS, MORE_FUNCTION_CATEGORIES, functionsIn, activeSlicer, activeTimeline, activeStyle, selectSpecial, insertFunctionCall, guessHeader, regionOf, evaluateRef, HIGHLIGHT_STYLES, ICON_SETS, TABLE_STYLES, tableStylePreview, resolveNameBox, absoluteReference, nameForRange, recentFunctions, buildChart, detectCategory, CATEGORIES, TIME_CODES, DATE_CODES, DEFAULT_OPTIONS, cellStyleItems, SYMBOLS, buildCode, UNSET, dxfCss, negativeCodes, iconCount, iconThresholds, rowsOf, colsOf } from 'ooxml-core/xlsx/ui';
21
+ import { SPECIAL_CODES, FRACTION_CODES, translate, INSERT_CHART_TYPES, AUTOSUM_FUNCTIONS, ICON_ACCENTS, ICON_PATHS, normalizeEditorLocale, EXCEL_CAPABILITY_BACKSTAGE_PAGES, EXCEL_CAPABILITY_COMMANDS, normalizeThemeMode, applyThemeColors, parseSelectionRef, selectionRef, fontCommands, alignmentCommands, numberCommands, editBridge, FONT_SIZES, FONT_NAMES, style, activeRef, numberFormatOptions, selectionFormatting, DirtyState, createCommandRegistry, createDialogRegistry, createSelectionModel, SheetSelections, translator, initialSelection, sheetBaseName, historyOf, onRibbonTabsChange, activeChart, CellViewCache, QUADRANTS, columnHeaderHeight, rowHeaderWidth, GridGeometry, cellRange, scrollToReveal, buildItems, fitNumber, cssFont, clampAddress, selectCell, movingEnd, extendSelection, moveWithinSelection, rowsRange, colsRange, ALL_RANGE, ribbonTabs, isTabHidden, selectTab, setTabHidden, tabButton, searchCommands, formatNumber, target, activeSmartArt, isSingleCell, spanRange, selectionCellCount, addRange, TEMPLATES, createTemplateWorkbook, fillPaint, iconSvg, colSelected, rowSelected, rowHeaderMenu, columnHeaderMenu, cellMenu, isMenuSeparator, textDecoration, justify, alignItems, textAlign, hasBorders, edgeCss, diagonalSvg, registerRibbonTabs, installFormatPainter, SHEET_ICONS, clipboardCommands, cellCommands, editingCommands, pageLayoutCommands, pageBreakCommands, formulaCommands, dataCommands, whatIfCommands, contextualCommands, reviewTab, viewTab, helpTab, tabMenu, editing, icon, DATA_BAR_COLORS, dataBarRule, COLOR_SCALES, colorScaleRule, iconSetRule, tableAt, timelineSourceAt, slicerSourceAt, viewing, activeTable, BORDER_PRESETS, ORIENTATIONS, ACCOUNTING_FORMATS, themePaletteItems, MARGIN_PRESETS, PAPER_SIZES, FUNCTION_MENUS, MORE_FUNCTION_CATEGORIES, functionsIn, activeSlicer, activeTimeline, activeStyle, selectSpecial, insertFunctionCall, guessHeader, regionOf, evaluateRef, editChart, HIGHLIGHT_STYLES, ICON_SETS, TABLE_STYLES, tableStylePreview, resolveNameBox, absoluteReference, nameForRange, recentFunctions, buildChart, detectCategory, CATEGORIES, TIME_CODES, DATE_CODES, DEFAULT_OPTIONS, cellStyleItems, SYMBOLS, buildCode, UNSET, dxfCss, negativeCodes, iconCount, iconThresholds, rowsOf, colsOf } from 'ooxml-core/xlsx/ui';
17
22
  export { EDITOR_LOCALES, EXCEL_CAPABILITY_IDS, THEME_KEYS, normalizeEditorLocale, registerRibbonTabs, themeToCssVars, darkTheme as xlsxDarkTheme, lightTheme as xlsxLightTheme } from 'ooxml-core/xlsx/ui';
18
- import { createWorksheet, cellInputText, createEditSession, approximateMeasure, createWorkbook, MAX_ROW, MAX_COL, chartView, createRefEvaluator, chartBarSpacing, CHART_FILL_PARTS, createGridMetrics, mergeAt, visibleCells, getCell, FUNCTION_CATALOG, closeParens, isFormulaText, parseCellInput, formatAddress, referenceTarget, navigate, anchorToPixelBox, renderChartSvg, selectionOfPeriods, pixelBoxToAnchor, listValidationOptions, validationAt, getValue, resolvePasteOptions, selectionStats, formatSelectionStat, nameAtCaret, functionMatches, callAtCaret, acceptsReference, formatRange, splice, translateFormula, slicerStyleColors, slicerGeometry, timelineGeometry, TIMELINE_PERIOD_WIDTH, TIMELINE_METRICS, timelineView, slicerItems, selectionAfterClick, isCellError, layoutRemoteSelections, parseHtmlTable, toggleAbsolute, rangeContains, printRange, chartSeriesTransparencyPatch, chartSeriesTransparency, chartSeriesGradientPatch, chartSeriesSolidFillPatch, chartSeriesFillPatch, chartWithElementFills, chartElementTransparencyPatch, chartElementTransparency, chartElementGradientPatch, chartElementSolidFillPatch, chartElementFillPatch, chartElementFill, columnLabel, coloredReferences, syntaxParams, activeParam, THEME_SLOTS, pageBreakPreview, normalizeRange, currentRegion, autoFitColumnWidth, chartGradientStopTransparency, paginateWorksheet, resolveColor, DEFAULT_THEME, pageHeaderFooter, createPrintMergeIndex, cellView, pixelsToColumnWidth, renderHeaderFooterRuns, planBreakDrag, resizePrintArea, nextSheetName, sheetByName, pivotGroupableFields, pivotGroupableDateFields, pivotSubtotalFields, DEFAULT_COL_WIDTH, pageViewLayout, formatValue, isDateFormat, pictureAnchorAt, selectedSparklineGroups, pivotTableAt, validateDefinedName, usedRange, pivotAxisChoices, parseAddress, PIVOT_DATE_UNITS, PIVOT_SUBTOTAL_ORDER, parseRange, parseInputCell, displayText, styleAt, rangesIntersect, chartColorScheme, SLICER_STYLE_NAMES, slicerStyleLabel, slicerStylePreview, pageViewCellRect, pageOfCell, validateSheetName, dateToSerial, IMAGE_EXTENSIONS, verifySheetPassword, verifyWorkbookPassword, quoteSheetName, pivotRowFields, pivotValuesIndex, pivotSourceData, defaultFieldGroup, defaultDateGroup, dateGroupDays, pivotIsoToSerial, fieldSubtotalFunctions, printTitles, formatPrintTitleSpan, parsePrintTitleSpan, scenariosOf, PAGE_VIEW_GAP, pivotPageItems, pivotPageItemLabel, pivotSerialToIso, previewScenario, serialToDate, BUILTIN_NUMBER_FORMATS, validateTableName, pixelsToEmu, pageViewHit, resizedFrameAnchor, headerFooterKey, splitHeaderFooter, composeHeaderFooter } from 'ooxml-core/xlsx';
23
+ import { createWorksheet, cellInputText, createEditSession, approximateMeasure, createWorkbook, MAX_ROW, MAX_COL, createGridMetrics, mergeAt, visibleCells, getCell, FUNCTION_CATALOG, closeParens, isFormulaText, parseCellInput, formatAddress, referenceTarget, navigate, anchorToPixelBox, createRefEvaluator, chartView, renderChartSvg, CHART_FILL_PARTS, selectionOfPeriods, pixelBoxToAnchor, listValidationOptions, validationAt, getValue, resolvePasteOptions, selectionStats, formatSelectionStat, chartSpaceOf, pictureAnchorAt, nameAtCaret, functionMatches, callAtCaret, acceptsReference, formatRange, splice, translateFormula, slicerStyleColors, slicerGeometry, timelineGeometry, TIMELINE_PERIOD_WIDTH, TIMELINE_METRICS, timelineView, slicerItems, selectionAfterClick, isCellError, layoutRemoteSelections, parseHtmlTable, toggleAbsolute, rangeContains, printRange, chartSeriesTransparencyPatch, chartSeriesTransparency, chartSeriesGradientPatch, chartSeriesSolidFillPatch, chartSeriesFillPatch, chartWithElementFills, chartElementTransparencyPatch, chartElementTransparency, chartElementGradientPatch, chartElementSolidFillPatch, chartElementFillPatch, chartElementFill, chartColorScheme, chartBarSpacing, columnLabel, coloredReferences, syntaxParams, activeParam, THEME_SLOTS, pageBreakPreview, normalizeRange, currentRegion, autoFitColumnWidth, chartGradientStopTransparency, paginateWorksheet, resolveColor, DEFAULT_THEME, pageHeaderFooter, createPrintMergeIndex, cellView, pixelsToColumnWidth, renderHeaderFooterRuns, planBreakDrag, resizePrintArea, nextSheetName, sheetByName, pivotGroupableFields, pivotGroupableDateFields, pivotSubtotalFields, DEFAULT_COL_WIDTH, pageViewLayout, formatValue, isDateFormat, selectedSparklineGroups, pivotTableAt, validateDefinedName, usedRange, pivotAxisChoices, parseAddress, PIVOT_DATE_UNITS, PIVOT_SUBTOTAL_ORDER, parseRange, parseInputCell, displayText, styleAt, rangesIntersect, chartStylePresetOf, chartTakesQuickLayout, SLICER_STYLE_NAMES, slicerStyleLabel, slicerStylePreview, pageViewCellRect, pageOfCell, validateSheetName, dateToSerial, IMAGE_EXTENSIONS, verifySheetPassword, verifyWorkbookPassword, quoteSheetName, pivotRowFields, pivotValuesIndex, pivotSourceData, defaultFieldGroup, defaultDateGroup, dateGroupDays, pivotIsoToSerial, fieldSubtotalFunctions, printTitles, formatPrintTitleSpan, parsePrintTitleSpan, scenariosOf, PAGE_VIEW_GAP, pivotPageItems, pivotPageItemLabel, pivotSerialToIso, previewScenario, serialToDate, BUILTIN_NUMBER_FORMATS, validateTableName, pixelsToEmu, pageViewHit, resizedFrameAnchor, headerFooterKey, splitHeaderFooter, composeHeaderFooter } from 'ooxml-core/xlsx';
19
24
  import { isCapabilityEnabled, capabilityHiddenActions, saveToStorage, documentSaveMeta, withoutHiddenEntries } from 'ooxml-core/embedding';
20
25
  import { hyperlinkPolicy } from 'ooxml-core/opc';
21
- import { resolveChartGradient, sortGradientStops, withChartGradientDirection, buildChartGradientDef, chartGradientMarkup, CHART_COLOR_PALETTES, chartPaletteColors } from 'ooxml-core/chart';
26
+ import { approximateDiagramDrawingFromNodes, DIAGRAM_INSERT_CATEGORIES, DIAGRAM_INSERT_PRESETS, RECT_GRADIENT_DIRECTIONS, OFFICE_GRADIENT_PRESETS, officeGradientPresetId, officeGradientPresetFill, resolveDrawingColor, drawingColorBrightness, drawingColorCss, rectGradientDirection, DIAGRAM_DESIGN_COMMANDS, DIAGRAM_ADD_SHAPE_LABEL, DIAGRAM_DESIGN_GROUPS, DIAGRAM_ADD_SHAPE_COMMANDS } from 'ooxml-core/diagram';
27
+ import { parseChartFormatTargetKey, resolveChartGradient, sortGradientStops, withChartGradientDirection, buildChartGradientDef, chartGradientMarkup, CHART_STYLE_PRESETS, CHART_COLOR_PALETTES, CHART_QUICK_LAYOUTS, chartPaletteColors } from 'ooxml-core/chart';
22
28
  import { render } from 'lit';
23
- import { RECT_GRADIENT_DIRECTIONS, OFFICE_GRADIENT_PRESETS, officeGradientPresetId, officeGradientPresetFill, resolveDrawingColor, drawingColorBrightness, drawingColorCss, rectGradientDirection } from 'ooxml-core/diagram';
24
29
  import { applyResize, applyDragDelta } from 'ooxml-core/geometry';
25
30
 
26
31
  // raw-css:/home/runner/work/ooxml/ooxml/src/ui/src/xlsx/theme/shell.css?raw
@@ -39,7 +44,7 @@ var popups_default = "/* Floating surfaces: ribbon popovers, menus, the colour g
39
44
  var backstage_default = "/* File backstage: the shared office-ui-backstage draws the navigation; these style the page content.\n The nav colours come from its tokens. */\n.xve-backstage {\n z-index: 40;\n --office-background: var(--surface);\n --office-backstage-nav-background: var(--xl);\n --office-backstage-nav-foreground: var(--xve-primary-foreground, var(--office-accent-foreground));\n}\n.xve-backstage-content {\n overflow: auto;\n padding: 28px 40px;\n color: var(--ink);\n}\n.xve-backstage-content h2 {\n margin: 0 0 20px;\n font-size: 30px;\n font-weight: 300;\n}\n.xve-backstage-content h3 {\n margin: 24px 0 10px;\n font-size: 15px;\n font-weight: 600;\n}\n.xve-backstage-title {\n margin: 0 0 4px;\n font-size: 26px;\n font-weight: 400;\n overflow-wrap: anywhere;\n}\n.xve-backstage-muted {\n color: var(--muted);\n}\n.xve-backstage-facts {\n display: grid;\n grid-template-columns: max-content minmax(0, 1fr);\n gap: 6px 24px;\n margin: 0;\n}\n.xve-backstage-facts dt {\n color: var(--muted);\n}\n.xve-backstage-facts dd {\n margin: 0;\n overflow-wrap: anywhere;\n}\n.xve-compatibility-notes {\n display: grid;\n gap: 8px;\n max-width: 760px;\n margin: 0;\n padding: 0;\n list-style: none;\n}\n.xve-compatibility-notes li {\n display: flex;\n gap: 8px;\n padding: 10px 12px;\n border: 1px solid var(--line);\n border-radius: 6px;\n line-height: 1.45;\n}\n.xve-compatibility-notes .xve-icon {\n margin-top: 2px;\n color: #b7791f;\n}\n.xve-backstage-columns {\n display: grid;\n grid-template-columns: minmax(0, 1fr) 300px;\n gap: 40px;\n align-items: start;\n}\n.xve-backstage-properties {\n padding: 4px 0 0 24px;\n border-left: 1px solid var(--line);\n}\n.xve-backstage-properties h3 {\n margin-top: 0;\n}\n.xve-backstage-tiles {\n display: flex;\n flex-wrap: wrap;\n gap: 12px;\n}\n.xve-backstage-tile {\n display: inline-flex;\n flex-direction: column;\n gap: 8px;\n padding: 8px;\n border: 1px solid transparent;\n border-radius: 6px;\n background: none;\n color: var(--ink);\n font: inherit;\n cursor: pointer;\n}\n.xve-backstage-tile:hover {\n border-color: var(--line);\n background: var(--xl-soft);\n}\n.xve-backstage-tile-preview {\n display: block;\n width: 150px;\n height: 112px;\n border: 1px solid var(--line);\n background-color: #fff;\n background-image:\n linear-gradient(#e1e1e1 1px, transparent 1px),\n linear-gradient(90deg, #e1e1e1 1px, transparent 1px);\n background-size: 30px 14px;\n box-shadow: 0 1px 3px #0002;\n}\n.xve-backstage-tile-preview[data-template]::before {\n display: block;\n height: 14px;\n background: var(--xl);\n content: '';\n opacity: 0.85;\n}\n.xve-backstage-card {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 24px;\n max-width: 760px;\n margin-bottom: 12px;\n padding: 14px 18px;\n border: 1px solid var(--line);\n border-radius: 6px;\n}\n.xve-backstage-card h3 {\n margin: 0 0 4px;\n}\n.xve-backstage-card p {\n margin: 0;\n}\n.xve-backstage-primary {\n padding: 8px 18px;\n border: 0;\n border-radius: 4px;\n background: var(--xl);\n color: var(--xve-primary-foreground, var(--office-accent-foreground));\n font: inherit;\n cursor: pointer;\n white-space: nowrap;\n}\n.xve-backstage-field {\n display: grid;\n gap: 4px;\n max-width: 420px;\n margin-bottom: 14px;\n color: var(--muted);\n font-size: 12px;\n}\n.xve-backstage-field input,\n.xve-backstage-field select {\n height: 32px;\n padding: 0 8px;\n border: 1px solid var(--line);\n border-radius: 4px;\n background: var(--surface);\n color: var(--ink);\n font: var(--office-font-size-md, 14px)/var(--office-line-height, 1.4)\n var(--xve-font, var(--office-font, system-ui, sans-serif));\n}\n/* File > Options > Customize Ribbon, shown in the shared Options dialog. */\n.xve-options-note {\n margin: 0 0 8px;\n color: var(--muted);\n font-size: 11px;\n}\n.xve-options-action {\n margin: 0 0 8px;\n padding: 6px 11px;\n border: 1px solid var(--line);\n border-radius: 4px;\n background: transparent;\n color: inherit;\n font: inherit;\n font-size: 12px;\n cursor: pointer;\n}\n.xve-options h3 {\n margin: 14px 0 4px;\n padding-bottom: 2px;\n border-bottom: 1px solid var(--line);\n color: var(--muted);\n font-size: 10px;\n font-weight: 700;\n letter-spacing: 0.04em;\n text-transform: uppercase;\n}\n.xve-customize-group {\n margin: 0 0 8px;\n padding: 6px 10px 8px;\n border: 1px solid var(--line);\n border-radius: 4px;\n}\n.xve-customize-group legend {\n padding: 0 4px;\n color: var(--muted);\n font-size: 11px;\n}\n.xve-customize-row {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n min-width: 180px;\n padding: 2px 8px 2px 0;\n font-size: 12px;\n}\n@media (max-width: 760px) {\n .xve-backstage-content {\n padding: 20px;\n }\n .xve-backstage-columns {\n grid-template-columns: minmax(0, 1fr);\n }\n .xve-backstage-properties {\n padding-left: 0;\n border-left: 0;\n }\n}\n";
40
45
 
41
46
  // raw-css:/home/runner/work/ooxml/ooxml/src/ui/src/xlsx/theme/chart-series.css?raw
42
- var chart_series_default = ".xve-canvas-row {\n display: flex;\n flex: 1;\n min-width: 0;\n min-height: 0;\n}\n.xve-chart-series-pane {\n box-sizing: border-box;\n width: 300px;\n max-width: 45%;\n flex: none;\n overflow: auto;\n border-left: 1px solid var(--line);\n background: var(--surface);\n}\n.xve-chart-series-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 12px 12px 12px 18px;\n border-bottom: 1px solid var(--line);\n}\n.xve-chart-series-header h2 {\n margin: 0;\n font-size: 18px;\n font-weight: 400;\n}\n.xve-chart-series-body,\n.xve-chart-series-pane > .xve-note {\n margin: 0;\n padding: 18px;\n}\n.xve-chart-series-body h3 {\n margin: 0 0 20px;\n font-size: 13px;\n font-weight: 600;\n}\n.xve-chart-series-body .xve-field {\n display: grid;\n grid-template-columns: 1fr 70px 12px;\n align-items: center;\n gap: 6px;\n margin: 14px 0;\n}\n.xve-chart-series-body .xve-input-number {\n box-sizing: border-box;\n width: 70px;\n min-width: 0;\n}\n.xve-chart-series-range .office-range-control {\n box-sizing: border-box;\n width: 100%;\n margin: 0 0 8px;\n}\n.xve-chart-series-fill {\n margin-top: 20px;\n padding-top: 18px;\n border-top: 1px solid var(--line);\n}\n.xve-chart-series-body .xve-field:has(select),\n.xve-chart-series-body .xve-field:has(.xve-chart-series-color),\n.xve-chart-series-body .xve-field:has(office-ui-gallery) {\n grid-template-columns: 1fr minmax(100px, 1fr);\n}\n.xve-chart-series-body office-ui-gallery .trigger {\n box-sizing: border-box;\n width: 100%;\n white-space: normal;\n}\n.xve-chart-series-color {\n height: 28px;\n background: var(--series-fill);\n border: 1px solid var(--line);\n cursor: pointer;\n}\n.xve-chart-series-color:disabled {\n opacity: 0.5;\n cursor: default;\n}\n.xve-chart-series-gradient {\n margin-top: 18px;\n}\n.xve-chart-gradient-buttons {\n display: flex;\n gap: 8px;\n justify-content: flex-end;\n}\n.xve-chart-gradient-selector {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n.xve-chart-gradient-selector .office-gradient-stop-track {\n flex: 1;\n min-width: 0;\n}\n.xve-chart-gradient-buttons .xve-button {\n width: 26px;\n height: 28px;\n padding: 0;\n font-size: 18px;\n}\n";
47
+ var chart_series_default = ".xve-canvas-row {\n display: flex;\n flex: 1;\n min-width: 0;\n min-height: 0;\n}\n.xve-chart-series-pane {\n box-sizing: border-box;\n width: 300px;\n max-width: 45%;\n flex: none;\n overflow: auto;\n border-left: 1px solid var(--line);\n background: var(--surface);\n}\n.xve-chart-series-pane .xve-field {\n display: grid;\n grid-template-columns: 1fr 70px 12px;\n align-items: center;\n gap: 6px;\n margin: 14px 0;\n}\n.xve-chart-series-pane .xve-input-number {\n box-sizing: border-box;\n width: 70px;\n min-width: 0;\n}\n.xve-chart-series-range .office-range-control {\n box-sizing: border-box;\n width: 100%;\n margin: 0 0 8px;\n}\n.xve-chart-series-fill .xve-field:first-of-type {\n margin-top: 0;\n}\n.xve-chart-series-pane .xve-field:has(select),\n.xve-chart-series-pane .xve-field:has(.xve-chart-series-color),\n.xve-chart-series-pane .xve-field:has(office-ui-gallery) {\n grid-template-columns: 1fr minmax(100px, 1fr);\n}\n.xve-chart-series-pane office-ui-gallery .trigger {\n box-sizing: border-box;\n width: 100%;\n white-space: normal;\n}\n.xve-chart-series-color {\n height: 28px;\n background: var(--series-fill);\n border: 1px solid var(--line);\n cursor: pointer;\n}\n.xve-chart-series-color:disabled {\n opacity: 0.5;\n cursor: default;\n}\n.xve-chart-series-gradient {\n margin-top: 18px;\n}\n.xve-chart-gradient-buttons {\n display: flex;\n gap: 8px;\n justify-content: flex-end;\n}\n.xve-chart-gradient-selector {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n.xve-chart-gradient-selector .office-gradient-stop-track {\n flex: 1;\n min-width: 0;\n}\n.xve-chart-gradient-buttons .xve-button {\n width: 26px;\n height: 28px;\n padding: 0;\n font-size: 18px;\n}\n/* The shared SmartArt text pane, beside the grid while a SmartArt graphic is selected. */\n.xve-smartart-text-pane {\n box-sizing: border-box;\n flex: none;\n align-self: flex-start;\n width: 260px;\n max-width: 40%;\n margin: 8px;\n}\n.xve-smartart-text-pane[hidden] {\n display: none;\n}\n.xve-cmd-dialog .xve-smartart-picker {\n display: grid;\n width: min(760px, 86vw);\n}\n";
43
48
 
44
49
  // src/xlsx/theme/styles.ts
45
50
  var themeTokenText = ":host{color-scheme:inherit;}" + legacyThemeAliases(":host", "--xve-", "--xlsx-theme-");
@@ -70,34 +75,34 @@ var DEFAULT_AUTHOR_NAME = "Author";
70
75
  function isXlsxEditorAttribute(name) {
71
76
  return XLSX_EDITOR_ATTRIBUTES.includes(name);
72
77
  }
73
- function applyAttribute(target36, name, value) {
78
+ function applyAttribute(target37, name, value) {
74
79
  switch (name) {
75
80
  case "locale":
76
- if (normalizeEditorLocale(value ?? "en") !== target36.locale) target36.locale = value ?? "en";
81
+ if (normalizeEditorLocale(value ?? "en") !== target37.locale) target37.locale = value ?? "en";
77
82
  return;
78
83
  case "read-only":
79
- target36.readOnly = value !== null && value !== "false";
84
+ target37.readOnly = value !== null && value !== "false";
80
85
  return;
81
86
  case "file-name": {
82
87
  const next = value || DEFAULT_FILE_NAME;
83
- if (next !== target36.fileName) target36.fileName = next;
88
+ if (next !== target37.fileName) target37.fileName = next;
84
89
  return;
85
90
  }
86
91
  case "author-name": {
87
92
  const next = value || DEFAULT_AUTHOR_NAME;
88
- if (next !== target36.authorName) target36.authorName = next;
93
+ if (next !== target37.authorName) target37.authorName = next;
89
94
  return;
90
95
  }
91
96
  case "theme": {
92
97
  const next = normalizeThemeMode(value);
93
- if (next !== target36.theme) target36.theme = next;
98
+ if (next !== target37.theme) target37.theme = next;
94
99
  return;
95
100
  }
96
101
  case "show-toolbar":
97
- if (value !== "false" !== target36.showToolbar) target36.showToolbar = value !== "false";
102
+ if (value !== "false" !== target37.showToolbar) target37.showToolbar = value !== "false";
98
103
  return;
99
104
  case "show-formula-bar":
100
- if (value !== "false" !== target36.showFormulaBar) target36.showFormulaBar = value !== "false";
105
+ if (value !== "false" !== target37.showFormulaBar) target37.showFormulaBar = value !== "false";
101
106
  }
102
107
  }
103
108
  function reflectAttribute(element, name, value) {
@@ -227,7 +232,7 @@ var runFile = (page, command, fileName) => () => {
227
232
  function customProperties(page, workbook) {
228
233
  const { doc, host, t } = page;
229
234
  const section = doc.createElement("section");
230
- const render3 = () => {
235
+ const render2 = () => {
231
236
  section.replaceChildren(heading(page, t("Custom properties"), "h3"));
232
237
  const properties = workbook.properties.custom ?? [];
233
238
  for (const [index, property] of properties.entries()) {
@@ -266,7 +271,7 @@ function customProperties(page, workbook) {
266
271
  "custom",
267
272
  (workbook.properties.custom ?? []).filter((_, i) => i !== index)
268
273
  );
269
- render3();
274
+ render2();
270
275
  });
271
276
  remove.disabled = host.ctx.readOnly();
272
277
  section.append(labelled(page, property.name, input), remove);
@@ -280,7 +285,7 @@ function customProperties(page, workbook) {
280
285
  const current = workbook.properties.custom ?? [];
281
286
  if (!key || current.some((p) => p.name.toLowerCase() === key.toLowerCase())) return;
282
287
  host.setProperty("custom", [...current, { name: key, type: "lpwstr", value: value.value }]);
283
- render3();
288
+ render2();
284
289
  });
285
290
  add.disabled = host.ctx.readOnly();
286
291
  section.append(
@@ -289,7 +294,7 @@ function customProperties(page, workbook) {
289
294
  add
290
295
  );
291
296
  };
292
- render3();
297
+ render2();
293
298
  return section;
294
299
  }
295
300
 
@@ -552,9 +557,9 @@ function printHtml(doc, html) {
552
557
  frame.setAttribute("sandbox", "allow-same-origin allow-modals");
553
558
  frame.style.cssText = "position:fixed;right:0;bottom:0;width:0;height:0;border:0;visibility:hidden";
554
559
  doc.body.append(frame);
555
- const target36 = frame.contentWindow;
560
+ const target37 = frame.contentWindow;
556
561
  const frameDoc = frame.contentDocument;
557
- if (!target36 || !frameDoc) {
562
+ if (!target37 || !frameDoc) {
558
563
  frame.remove();
559
564
  return;
560
565
  }
@@ -564,18 +569,18 @@ function printHtml(doc, html) {
564
569
  let safety;
565
570
  const cleanup = () => {
566
571
  if (safety !== void 0) clearTimeout(safety);
567
- target36.removeEventListener("afterprint", cleanup);
572
+ target37.removeEventListener("afterprint", cleanup);
568
573
  frame.remove();
569
574
  if (pendingFrames.get(doc) === cleanup) pendingFrames.delete(doc);
570
575
  };
571
576
  pendingFrames.set(doc, cleanup);
572
- target36.addEventListener("afterprint", cleanup);
577
+ target37.addEventListener("afterprint", cleanup);
573
578
  safety = setTimeout(cleanup, PRINT_FRAME_TIMEOUT_MS);
574
579
  setTimeout(() => {
575
580
  if (!frame.isConnected) return;
576
581
  try {
577
- target36.focus();
578
- target36.print();
582
+ target37.focus();
583
+ target37.print();
579
584
  } catch (error) {
580
585
  cleanup();
581
586
  console.error("xlsx-editor: printing failed", error);
@@ -1978,23 +1983,23 @@ var DISPLAY = {
1978
1983
  function formatKeys(spec, mac) {
1979
1984
  const parsed = parse(spec);
1980
1985
  const key = parsed.code ?? (spec.endsWith("+") ? "+" : spec.split("+").pop() ?? "");
1981
- const names2 = [
1986
+ const names = [
1982
1987
  parsed.mod ? mac ? "Cmd" : "Ctrl" : "",
1983
1988
  parsed.alt ? mac ? "Option" : "Alt" : "",
1984
1989
  parsed.shift ? "Shift" : "",
1985
1990
  DISPLAY[key.toLowerCase()] ?? (key.length === 1 ? key.toUpperCase() : key)
1986
1991
  ];
1987
- return names2.filter(Boolean).join("+");
1992
+ return names.filter(Boolean).join("+");
1988
1993
  }
1989
1994
  var displayKeys = (shortcut, mac) => shortcut.keys.filter((spec) => !spec.includes("code:")).map((spec) => formatKeys(spec, mac));
1990
1995
  function findShortcut(event, mac) {
1991
1996
  return SHORTCUTS.find((shortcut) => shortcut.keys.some((spec) => matchesKeys(event, spec, mac)));
1992
1997
  }
1993
1998
  function inTextField(event) {
1994
- const target36 = event.composedPath()[0];
1995
- if (!(target36 instanceof Element)) return false;
1996
- if (target36.closest(".xve-grid-host")) return false;
1997
- return target36.matches(
1999
+ const target37 = event.composedPath()[0];
2000
+ if (!(target37 instanceof Element)) return false;
2001
+ if (target37.closest(".xve-grid-host")) return false;
2002
+ return target37.matches(
1998
2003
  'input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), textarea, select, [contenteditable=""], [contenteditable="true"]'
1999
2004
  );
2000
2005
  }
@@ -2164,11 +2169,11 @@ function alignmentTab(init) {
2164
2169
  const alignment = patch();
2165
2170
  return Object.keys(alignment).length ? { alignment } : {};
2166
2171
  },
2167
- apply: (target36) => {
2172
+ apply: (target37) => {
2168
2173
  if (!changed.has("merge") || merge.input.checked === merged) return;
2169
- for (const range2 of target36.ranges)
2170
- if (merge.input.checked) target36.session.merge(target36.sheet, range2, "merge");
2171
- else target36.session.unmerge(target36.sheet, range2);
2174
+ for (const range2 of target37.ranges)
2175
+ if (merge.input.checked) target37.session.merge(target37.sheet, range2, "merge");
2176
+ else target37.session.unmerge(target37.sheet, range2);
2172
2177
  },
2173
2178
  focus: () => horizontal.focus()
2174
2179
  };
@@ -3258,10 +3263,10 @@ function openGoTo(ctx) {
3258
3263
  (name) => reference.value = name,
3259
3264
  () => confirm2?.()
3260
3265
  );
3261
- const names2 = (workbook?.definedNames ?? []).filter(
3266
+ const names = (workbook?.definedNames ?? []).filter(
3262
3267
  (n) => !n.hidden && !n.name.startsWith("_xlnm.")
3263
3268
  );
3264
- list.setItems(names2.map((n) => [n.name, n.name]));
3269
+ list.setItems(names.map((n) => [n.name, n.name]));
3265
3270
  const special = button(ctx, "Special...");
3266
3271
  return showDialog(
3267
3272
  ctx,
@@ -3276,9 +3281,9 @@ function openGoTo(ctx) {
3276
3281
  buttons: [special],
3277
3282
  opened: () => reference.focus(),
3278
3283
  submit: () => {
3279
- const target36 = resolveReference(ctx, reference.value);
3280
- if (!target36) return invalid(ctx, reference, "Reference is not valid.");
3281
- selectOn(ctx, target36.sheet, target36.range);
3284
+ const target37 = resolveReference(ctx, reference.value);
3285
+ if (!target37) return invalid(ctx, reference, "Reference is not valid.");
3286
+ selectOn(ctx, target37.sheet, target37.range);
3282
3287
  return reference.value.trim();
3283
3288
  }
3284
3289
  },
@@ -3464,15 +3469,15 @@ function openCreateNames(ctx) {
3464
3469
  opened: () => boxes[0]?.input.focus(),
3465
3470
  submit: () => {
3466
3471
  const chosen = boxes.filter((b) => b.input.checked).map((b) => b.edge);
3467
- const names2 = namesFromSelection(ctx, chosen);
3468
- if (!names2.length) {
3472
+ const names = namesFromSelection(ctx, chosen);
3473
+ if (!names.length) {
3469
3474
  ctx.toast(ctx.t("No names could be created from the selection."), "warning");
3470
3475
  return void 0;
3471
3476
  }
3472
3477
  t.session.batch("Create names", () => {
3473
- for (const name of names2) t.session.setDefinedName(name);
3478
+ for (const name of names) t.session.setDefinedName(name);
3474
3479
  });
3475
- return names2.length;
3480
+ return names.length;
3476
3481
  }
3477
3482
  });
3478
3483
  }
@@ -4641,7 +4646,7 @@ function nameValue(ctx, name) {
4641
4646
  return { text: "#NAME?", error: true };
4642
4647
  }
4643
4648
  }
4644
- var visibleNames = (names2) => names2.filter((n) => !n.hidden && !n.name.startsWith("_xlnm."));
4649
+ var visibleNames = (names) => names.filter((n) => !n.hidden && !n.name.startsWith("_xlnm."));
4645
4650
  function openNameManager(ctx) {
4646
4651
  const doc = ctx.host.ownerDocument;
4647
4652
  const filter = select(ctx, FILTERS, "all");
@@ -4658,7 +4663,7 @@ function openNameManager(ctx) {
4658
4663
  deleteButton.disabled = !editable;
4659
4664
  newButton.disabled = ctx.readOnly();
4660
4665
  };
4661
- const render3 = () => {
4666
+ const render2 = () => {
4662
4667
  const workbook = ctx.workbook();
4663
4668
  table.replaceChildren();
4664
4669
  const head = table.createTHead().insertRow();
@@ -4669,9 +4674,9 @@ function openNameManager(ctx) {
4669
4674
  head.append(th);
4670
4675
  }
4671
4676
  const body = table.createTBody();
4672
- const names2 = visibleNames(workbook?.definedNames ?? []);
4673
- if (selected2 && !names2.includes(selected2)) selected2 = void 0;
4674
- for (const name of names2) {
4677
+ const names = visibleNames(workbook?.definedNames ?? []);
4678
+ if (selected2 && !names.includes(selected2)) selected2 = void 0;
4679
+ for (const name of names) {
4675
4680
  const value = nameValue(ctx, name);
4676
4681
  const kind = filter.value;
4677
4682
  if (kind === "worksheet" && name.localSheet === void 0) continue;
@@ -4704,26 +4709,26 @@ function openNameManager(ctx) {
4704
4709
  }
4705
4710
  sync();
4706
4711
  };
4707
- filter.addEventListener("change", render3);
4712
+ filter.addEventListener("change", render2);
4708
4713
  newButton.addEventListener("click", async () => {
4709
4714
  await ctx.dialogs.open("define-name");
4710
- render3();
4715
+ render2();
4711
4716
  });
4712
4717
  editButton.addEventListener("click", async () => {
4713
4718
  if (!selected2) return;
4714
4719
  const props2 = { name: selected2.name };
4715
4720
  if (selected2.localSheet !== void 0) props2.localSheet = selected2.localSheet;
4716
4721
  await ctx.dialogs.open("define-name", props2);
4717
- render3();
4722
+ render2();
4718
4723
  });
4719
4724
  deleteButton.addEventListener("click", () => {
4720
4725
  const session = ctx.session();
4721
4726
  if (!selected2 || !session || ctx.readOnly()) return;
4722
4727
  session.deleteDefinedName(selected2.name, selected2.localSheet);
4723
4728
  selected2 = void 0;
4724
- render3();
4729
+ render2();
4725
4730
  });
4726
- render3();
4731
+ render2();
4727
4732
  return showDialog(ctx, {
4728
4733
  name: "name-manager",
4729
4734
  heading: "Name Manager",
@@ -5555,7 +5560,7 @@ function cfManagerDialog(ctx) {
5555
5560
  const visible = () => entries.flatMap(
5556
5561
  (e, i) => scope.value === "sheet" || e.ranges.some((r) => t.ranges.some((s) => rangesIntersect(r, s))) ? [i] : []
5557
5562
  );
5558
- const render3 = () => {
5563
+ const render2 = () => {
5559
5564
  appliesInputs.length = 0;
5560
5565
  const head = el(ctx, "tr");
5561
5566
  for (const key of ["Rule (applied in order shown)", "Format", "Applies to", "Stop If True"]) {
@@ -5576,7 +5581,7 @@ function cfManagerDialog(ctx) {
5576
5581
  return;
5577
5582
  }
5578
5583
  selected2 = i;
5579
- render3();
5584
+ render2();
5580
5585
  });
5581
5586
  const desc = el(ctx, "td");
5582
5587
  desc.textContent = describeRule(ctx, entry.rule);
@@ -5631,7 +5636,7 @@ function cfManagerDialog(ctx) {
5631
5636
  const [entry] = entries.splice(selected2, 1);
5632
5637
  if (entry) entries.splice(to, 0, entry);
5633
5638
  selected2 = to;
5634
- render3();
5639
+ render2();
5635
5640
  };
5636
5641
  const newRule = button(ctx, "New Rule...");
5637
5642
  const editRule = button(ctx, "Edit Rule...");
@@ -5645,7 +5650,7 @@ function cfManagerDialog(ctx) {
5645
5650
  if (!result) return;
5646
5651
  entries.unshift(result);
5647
5652
  selected2 = 0;
5648
- render3();
5653
+ render2();
5649
5654
  });
5650
5655
  editRule.addEventListener("click", async () => {
5651
5656
  if (!commitRanges()) return;
@@ -5653,20 +5658,20 @@ function cfManagerDialog(ctx) {
5653
5658
  if (!entry) return;
5654
5659
  const result = await editRuleDialog(ctx, entry);
5655
5660
  if (result) entries[selected2] = result;
5656
- render3();
5661
+ render2();
5657
5662
  });
5658
5663
  deleteRule.addEventListener("click", () => {
5659
5664
  if (selected2 < 0) return;
5660
5665
  entries.splice(selected2, 1);
5661
5666
  selected2 = Math.min(selected2, entries.length - 1);
5662
- render3();
5667
+ render2();
5663
5668
  });
5664
5669
  duplicate.addEventListener("click", () => {
5665
5670
  if (!commitRanges()) return;
5666
5671
  const entry = entries[selected2];
5667
5672
  if (!entry) return;
5668
5673
  entries.splice(selected2, 0, structuredClone(entry));
5669
- render3();
5674
+ render2();
5670
5675
  });
5671
5676
  up.addEventListener("click", () => move(-1));
5672
5677
  down.addEventListener("click", () => move(1));
@@ -5678,9 +5683,9 @@ function cfManagerDialog(ctx) {
5678
5683
  if (next === void 0) return;
5679
5684
  event.preventDefault();
5680
5685
  selected2 = next;
5681
- render3();
5686
+ render2();
5682
5687
  });
5683
- scope.addEventListener("change", render3);
5688
+ scope.addEventListener("change", render2);
5684
5689
  const apply = () => {
5685
5690
  if (!commitRanges()) return false;
5686
5691
  const formats = unstageRules(entries);
@@ -5692,12 +5697,12 @@ function cfManagerDialog(ctx) {
5692
5697
  formats.forEach((format2, i) => t.session.replaceConditionalFormat(t.sheet, i, format2));
5693
5698
  });
5694
5699
  entries = stageRules(formats);
5695
- render3();
5700
+ render2();
5696
5701
  return true;
5697
5702
  };
5698
5703
  const applyButton = button(ctx, "Apply");
5699
5704
  applyButton.addEventListener("click", () => void apply());
5700
- render3();
5705
+ render2();
5701
5706
  return showDialog(ctx, {
5702
5707
  name: "cf-manager",
5703
5708
  heading: "Conditional Formatting Rules Manager",
@@ -6127,12 +6132,12 @@ function hyperlinkDialog(ctx) {
6127
6132
  const tooltip2 = textInput(ctx, existing?.tooltip ?? "");
6128
6133
  const address = textInput(ctx, !mail ? existing?.target ?? "" : "");
6129
6134
  const sheets = t.workbook.sheets.map((s) => [s.name, s.name]);
6130
- const names2 = t.workbook.definedNames.filter((n) => !n.hidden && !n.name.startsWith("_xlnm.")).map((n) => [`name:${n.name}`, n.name]);
6135
+ const names = t.workbook.definedNames.filter((n) => !n.hidden && !n.name.startsWith("_xlnm.")).map((n) => [`name:${n.name}`, n.name]);
6131
6136
  const loc = existing?.location ? splitLocation(existing.location) : { sheet: t.ws.name, ref: "A1" };
6132
- const isName = !loc.sheet && names2.some(([, n]) => n === loc.ref);
6137
+ const isName = !loc.sheet && names.some(([, n]) => n === loc.ref);
6133
6138
  const place2 = select(
6134
6139
  ctx,
6135
- [...sheets, ...names2],
6140
+ [...sheets, ...names],
6136
6141
  isName ? `name:${loc.ref}` : loc.sheet ?? t.ws.name,
6137
6142
  true
6138
6143
  );
@@ -6238,7 +6243,7 @@ function sortDialog(ctx) {
6238
6243
  }
6239
6244
  return out;
6240
6245
  };
6241
- const render3 = () => {
6246
+ const render2 = () => {
6242
6247
  list.replaceChildren(
6243
6248
  ...levels.map((level, i) => {
6244
6249
  level.element.setAttribute("aria-selected", String(i === selected2));
@@ -6267,11 +6272,11 @@ function sortDialog(ctx) {
6267
6272
  const level = { element, column, order };
6268
6273
  element.addEventListener("focusin", () => {
6269
6274
  selected2 = levels.indexOf(level);
6270
- render3();
6275
+ render2();
6271
6276
  });
6272
6277
  levels.splice(at, 0, level);
6273
6278
  selected2 = at;
6274
- render3();
6279
+ render2();
6275
6280
  };
6276
6281
  addLevel(
6277
6282
  t.active.col >= region.start.col && t.active.col <= region.end.col ? t.active.col : region.start.col,
@@ -6300,7 +6305,7 @@ function sortDialog(ctx) {
6300
6305
  if (levels.length <= 1) return;
6301
6306
  levels.splice(selected2, 1);
6302
6307
  selected2 = Math.max(0, Math.min(selected2, levels.length - 1));
6303
- render3();
6308
+ render2();
6304
6309
  });
6305
6310
  copy.addEventListener("click", () => {
6306
6311
  const level = levels[selected2];
@@ -6312,7 +6317,7 @@ function sortDialog(ctx) {
6312
6317
  const [level] = levels.splice(selected2, 1);
6313
6318
  if (level) levels.splice(to, 0, level);
6314
6319
  selected2 = to;
6315
- render3();
6320
+ render2();
6316
6321
  };
6317
6322
  up.addEventListener("click", () => move(-1));
6318
6323
  down.addEventListener("click", () => move(1));
@@ -6582,14 +6587,14 @@ function registerSimpleDialogs(ctx) {
6582
6587
  d.register("use-in-formula", (c) => {
6583
6588
  const t = target(c);
6584
6589
  if (!t) return Promise.resolve(void 0);
6585
- const names2 = t.workbook.definedNames.filter(
6590
+ const names = t.workbook.definedNames.filter(
6586
6591
  (n) => !n.hidden && !n.name.startsWith("_xlnm.") && (n.localSheet === void 0 || n.localSheet === t.sheet)
6587
6592
  );
6588
6593
  return pickDialog(c, {
6589
6594
  name: "use-in-formula",
6590
6595
  heading: "Paste Name",
6591
6596
  label: "Paste name",
6592
- items: names2.map((n) => [n.name, n.name]),
6597
+ items: names.map((n) => [n.name, n.name]),
6593
6598
  apply: (name) => {
6594
6599
  const grid = c.grid();
6595
6600
  const cell = getCell(t.ws, t.active.row, t.active.col);
@@ -8695,12 +8700,12 @@ function openPivotFieldSettings(ctx) {
8695
8700
  const t = target(ctx);
8696
8701
  const pivot = t ? pivotTableAt(t.ws, t.active) : void 0;
8697
8702
  if (!t || !pivot) return Promise.resolve(void 0);
8698
- const names2 = pivotSubtotalFields(pivot);
8699
- if (!names2.length) return Promise.resolve(void 0);
8703
+ const names = pivotSubtotalFields(pivot);
8704
+ if (!names.length) return Promise.resolve(void 0);
8700
8705
  const chosen = select(
8701
8706
  ctx,
8702
- names2.map((name) => [name, name]),
8703
- names2[0],
8707
+ names.map((name) => [name, name]),
8708
+ names[0],
8704
8709
  true
8705
8710
  );
8706
8711
  const mode = radios(
@@ -9025,8 +9030,8 @@ function pivotFieldListControls(ctx, axis, initial, changed, initialFields = [])
9025
9030
  host,
9026
9031
  count: () => controls.length,
9027
9032
  /** Offers these source fields to every chooser, keeping the ones still available. */
9028
- load: (names2) => {
9029
- fields = names2;
9033
+ load: (names) => {
9034
+ fields = names;
9030
9035
  for (const entry of controls) load(entry.field);
9031
9036
  },
9032
9037
  /** Hides the whole group (and keeps its choices) while the second row field is empty. */
@@ -9119,8 +9124,8 @@ function pivotValueControls(ctx, initial, changed, initialFields = []) {
9119
9124
  return {
9120
9125
  host,
9121
9126
  count: () => controls.length,
9122
- load: (names2) => {
9123
- fields = names2;
9127
+ load: (names) => {
9128
+ fields = names;
9124
9129
  for (const row2 of controls) {
9125
9130
  const old = row2.field.value;
9126
9131
  const prefix = `${row2.aggregate.value[0].toUpperCase()}${row2.aggregate.value.slice(1)} of `;
@@ -9204,14 +9209,14 @@ function openPivotTable(ctx, settings = false) {
9204
9209
  const valuesPlacement = select(ctx, [["last", "After row fields"]], "last");
9205
9210
  let placementChoices = "";
9206
9211
  let placementWanted = pivot ? placementValue(pivot) : "last";
9207
- const placeValues = (names2) => {
9208
- const signature = names2.join("");
9212
+ const placeValues = (names) => {
9213
+ const signature = names.join("");
9209
9214
  if (signature === placementChoices) return;
9210
9215
  placementChoices = signature;
9211
9216
  const options = [
9212
9217
  ["first", ctx.t("Before row fields")],
9213
- ...names2.slice(0, -1).map(
9214
- (name, i) => names2.length === 2 ? ["between", ctx.t("Between row fields")] : [String(i + 1), ctx.t("After {field}", { field: name })]
9218
+ ...names.slice(0, -1).map(
9219
+ (name, i) => names.length === 2 ? ["between", ctx.t("Between row fields")] : [String(i + 1), ctx.t("After {field}", { field: name })]
9215
9220
  ),
9216
9221
  ["last", ctx.t("After row fields")]
9217
9222
  ];
@@ -9677,6 +9682,187 @@ function registerDialogs(ctx) {
9677
9682
  registerFormatCellsDialogs(ctx);
9678
9683
  registerRuleDialogs(ctx);
9679
9684
  }
9685
+ function chooseSmartArt(ctx) {
9686
+ const doc = ctx.host.ownerDocument;
9687
+ defineSmartArtPicker(doc.defaultView?.customElements);
9688
+ const picker = doc.createElement("office-ui-smartart-picker");
9689
+ picker.className = "xve-smartart-picker";
9690
+ const t = (key) => ctx.t(key);
9691
+ picker.labels = { categories: t("SmartArt categories"), layouts: t("SmartArt layouts") };
9692
+ picker.categories = DIAGRAM_INSERT_CATEGORIES.map((category) => ({
9693
+ id: category.id,
9694
+ label: t(`smartart.category.${category.id}`),
9695
+ description: t(`smartart.description.${category.id}`)
9696
+ }));
9697
+ picker.layouts = DIAGRAM_INSERT_PRESETS.map((preset) => ({
9698
+ id: preset.layout,
9699
+ category: preset.category,
9700
+ label: t(`smartart.layout.${preset.layout}`),
9701
+ family: preset.family
9702
+ }));
9703
+ picker.value = { layout: DIAGRAM_INSERT_PRESETS[0]?.layout ?? "", items: [] };
9704
+ const chosen = () => DIAGRAM_INSERT_PRESETS.find((entry) => entry.layout === picker.value.layout);
9705
+ return showDialog(
9706
+ ctx,
9707
+ {
9708
+ name: "insert-smartart",
9709
+ heading: "Choose a SmartArt Graphic",
9710
+ wide: true,
9711
+ body: picker,
9712
+ opened: () => picker.shadowRoot?.querySelector('[role="option"][tabindex="0"]')?.focus(),
9713
+ submit: chosen
9714
+ },
9715
+ (open) => picker.addEventListener("office-smartart-activate", () => {
9716
+ const preset = chosen();
9717
+ if (preset) open.element.querySelector(".xve-btn-primary")?.click();
9718
+ })
9719
+ );
9720
+ }
9721
+
9722
+ // src/xlsx/smartart-controller.ts
9723
+ var DEFAULT_SIZE = { width: 480, height: 280 };
9724
+ var ICONS = {
9725
+ addAfter: "smartArtAddShape",
9726
+ addBefore: "smartArtAddShape",
9727
+ addAbove: "smartArtAddShape",
9728
+ addBelow: "smartArtAddShape",
9729
+ textPane: "smartArtTextPane",
9730
+ promote: "smartArtPromote",
9731
+ demote: "smartArtDemote",
9732
+ moveUp: "smartArtMoveUp",
9733
+ moveDown: "smartArtMoveDown",
9734
+ changeLayout: "smartArtLayout"
9735
+ };
9736
+ var smartArtCommandId = (key) => `smartart.${key}`;
9737
+ var controllers = /* @__PURE__ */ new WeakMap();
9738
+ var XlsxSmartArtController = class {
9739
+ constructor(ctx) {
9740
+ this.ctx = ctx;
9741
+ this.text = new SmartArtTextPaneController(
9742
+ ctx.host.ownerDocument,
9743
+ {
9744
+ nodes: () => activeSmartArt(ctx)?.smartArt.nodes,
9745
+ edit: (edit) => {
9746
+ const t = target(ctx);
9747
+ const found = activeSmartArt(ctx);
9748
+ if (!t || !found || ctx.readOnly()) return void 0;
9749
+ const result = t.session.editSmartArt(t.sheet, found.index, edit);
9750
+ return result.changed ? result.nodeId ?? "" : void 0;
9751
+ },
9752
+ setText: (id, text3) => {
9753
+ const t = target(ctx);
9754
+ const found = activeSmartArt(ctx);
9755
+ if (t && found && !ctx.readOnly())
9756
+ t.session.editSmartArt(t.sheet, found.index, { kind: "text", nodeId: id, text: text3 });
9757
+ },
9758
+ toggled: (open) => {
9759
+ ctx.requestRender();
9760
+ if (!open) ctx.grid()?.focus();
9761
+ }
9762
+ },
9763
+ "xve-smartart-text-pane"
9764
+ );
9765
+ this.relocalize();
9766
+ }
9767
+ ctx;
9768
+ text;
9769
+ run(key) {
9770
+ if (key === "textPane") return this.text.setOpen(!this.text.open);
9771
+ if (key === "changeLayout") return void this.relayout();
9772
+ this.text.runCommand(key);
9773
+ this.ctx.grid()?.focus();
9774
+ }
9775
+ async definitions() {
9776
+ return import('ooxml-core/diagram/builtin');
9777
+ }
9778
+ async layoutOf(preset) {
9779
+ const builtin = await this.definitions();
9780
+ const layoutId = builtin.builtinLayoutIdForPreset(preset.layout);
9781
+ if (!layoutId) throw new Error("The SmartArt layouts could not be loaded.");
9782
+ return { builtin, layoutId, layoutXml: builtin.loadBuiltinSmartArtLayoutXml(layoutId) };
9783
+ }
9784
+ async insert() {
9785
+ const ctx = this.ctx;
9786
+ const preset = await chooseSmartArt(ctx);
9787
+ const t = target(ctx);
9788
+ if (!preset || !t || ctx.readOnly()) return;
9789
+ const { builtin, layoutId, layoutXml } = await this.layoutOf(preset);
9790
+ const index = t.session.insertSmartArt(t.sheet, {
9791
+ anchor: pictureAnchorAt(t.active, DEFAULT_SIZE.width, DEFAULT_SIZE.height),
9792
+ layoutId,
9793
+ family: preset.family,
9794
+ layoutXml,
9795
+ colorsId: builtin.BUILTIN_SMARTART_COLORS_ID,
9796
+ colorsXml: builtin.BUILTIN_SMARTART_COLORS_XML,
9797
+ quickStyleId: builtin.BUILTIN_SMARTART_QUICK_STYLE_ID,
9798
+ quickStyleXml: builtin.BUILTIN_SMARTART_QUICK_STYLE_XML,
9799
+ // Excel starts every shape empty, showing its "[Text]" placeholder.
9800
+ items: preset.defaultItems.map(() => "")
9801
+ });
9802
+ ctx.selection.set({ drawing: index });
9803
+ this.text.select(activeSmartArt(ctx)?.smartArt.nodes[0]?.id ?? null);
9804
+ this.text.setOpen(true);
9805
+ }
9806
+ async relayout() {
9807
+ const ctx = this.ctx;
9808
+ const preset = await chooseSmartArt(ctx);
9809
+ const t = target(ctx);
9810
+ const found = activeSmartArt(ctx);
9811
+ if (!preset || !t || !found || ctx.readOnly()) return;
9812
+ const { layoutId, layoutXml } = await this.layoutOf(preset);
9813
+ t.session.changeSmartArtLayout(t.sheet, found.index, {
9814
+ layoutId,
9815
+ family: preset.family,
9816
+ layoutXml
9817
+ });
9818
+ }
9819
+ refresh() {
9820
+ this.text.sync();
9821
+ }
9822
+ relocalize() {
9823
+ this.text.setLabels((key) => this.ctx.t(key));
9824
+ }
9825
+ };
9826
+ function createSmartArtController(ctx) {
9827
+ const controller = new XlsxSmartArtController(ctx);
9828
+ controllers.set(ctx, controller);
9829
+ return {
9830
+ element: controller.text.pane,
9831
+ refresh: () => controller.refresh(),
9832
+ relocalize: () => controller.relocalize(),
9833
+ /** A new workbook: the pane closes. */
9834
+ reset: () => controller.text.reset()
9835
+ };
9836
+ }
9837
+ function smartArtCommands() {
9838
+ const design = DIAGRAM_DESIGN_COMMANDS.map(
9839
+ (command) => editing({
9840
+ id: smartArtCommandId(command.key),
9841
+ label: command.label,
9842
+ icon: icon(ICONS[command.key]),
9843
+ lock: "objects",
9844
+ enabled: (ctx) => !!activeSmartArt(ctx),
9845
+ ...command.key === "textPane" ? { checked: (ctx) => controllers.get(ctx)?.text.open ?? false } : {},
9846
+ run: (ctx) => controllers.get(ctx)?.run(command.key)
9847
+ })
9848
+ );
9849
+ return [
9850
+ ...design,
9851
+ editing({
9852
+ id: "insert.smartart",
9853
+ label: "SmartArt",
9854
+ icon: icon("smartArt"),
9855
+ lock: "objects",
9856
+ run: async (ctx) => {
9857
+ try {
9858
+ await controllers.get(ctx)?.insert();
9859
+ } catch (error) {
9860
+ ctx.toast(ctx.t(error instanceof Error ? error.message : String(error)), "error");
9861
+ }
9862
+ }
9863
+ })
9864
+ ];
9865
+ }
9680
9866
  var PIXELS_PER_INCH = 96;
9681
9867
  var inches = (px) => (px / PIXELS_PER_INCH).toFixed(2);
9682
9868
  function update(ctx, patch) {
@@ -9971,24 +10157,6 @@ var tableStyleGalleryItems = (ctx) => TABLE_STYLES.map((info) => ({
9971
10157
  }));
9972
10158
  var cellStyleGalleryItems = (ctx) => cellStyleItems(ctx.workbook()).map((item) => ({ ...item, label: ctx.t(item.label) }));
9973
10159
 
9974
- // src/ribbon/svg-preview.ts
9975
- function safeColor(color, fallback = "none") {
9976
- if (!color) {
9977
- return fallback;
9978
- }
9979
- const c = color.trim();
9980
- if (/^#[0-9a-f]{3,8}$/iu.test(c) || /^rgba?\([\d\s.,%]+\)$/iu.test(c) || c === "none") {
9981
- return c;
9982
- }
9983
- if (c === "transparent") {
9984
- return "none";
9985
- }
9986
- return fallback;
9987
- }
9988
- function svgTile(width, height, defs, body) {
9989
- return `<svg xmlns="http://www.w3.org/2000/svg" width="${width}" height="${height}" viewBox="0 0 ${width} ${height}" aria-hidden="true" focusable="false">${""}${body}</svg>`;
9990
- }
9991
-
9992
10160
  // src/ribbon/color-preview.ts
9993
10161
  var num = (value) => String(Math.round(value * 100) / 100);
9994
10162
  function swatchStripSvg(colors, size) {
@@ -9999,29 +10167,207 @@ function swatchStripSvg(colors, size) {
9999
10167
  return svgTile(size.width, size.height, "", body);
10000
10168
  }
10001
10169
 
10002
- // src/xlsx/commands/chart-colors.ts
10003
- function chartColorGallerySections(ctx) {
10170
+ // src/chart/gallery-tiles.ts
10171
+ function num2(value) {
10172
+ return String(Math.round(value * 100) / 100);
10173
+ }
10174
+ var HEIGHTS = [0.55, 0.8, 0.4, 0.95, 0.7, 0.5];
10175
+ function columnChartTileSvg(colors, size) {
10176
+ const series = colors.slice(0, 4);
10177
+ const pad = 4;
10178
+ const plotW = size.width - pad * 2;
10179
+ const plotH = size.height - pad * 2;
10180
+ const groupW = plotW / 3;
10181
+ const barW = groupW * 0.8 / Math.max(series.length, 1);
10182
+ const bars = [];
10183
+ for (let g = 0; g < 3; g++) {
10184
+ series.forEach((color, s) => {
10185
+ const h2 = plotH * (HEIGHTS[(g + s * 2) % HEIGHTS.length] ?? 0.5);
10186
+ const x = pad + g * groupW + groupW * 0.1 + s * barW;
10187
+ bars.push(
10188
+ `<rect x="${num2(x)}" y="${num2(pad + plotH - h2)}" width="${num2(barW * 0.9)}" height="${num2(h2)}" fill="${safeColor(color, "#808080")}"/>`
10189
+ );
10190
+ });
10191
+ }
10192
+ const axis = `<line x1="${pad}" y1="${num2(pad + plotH)}" x2="${num2(pad + plotW)}" y2="${num2(pad + plotH)}" stroke="#A6A6A6" stroke-width="0.75"/>`;
10193
+ const bg = `<rect x="0" y="0" width="${size.width}" height="${size.height}" fill="#FFFFFF"/>`;
10194
+ return svgTile(size.width, size.height, "", bg + bars.join("") + axis);
10195
+ }
10196
+ var INK = "#7F7F7F";
10197
+ var ACCENT = "#4472C4";
10198
+ function chartLayoutTileSvg(sketch, size) {
10199
+ const parts = [
10200
+ `<rect x="0" y="0" width="${size.width}" height="${size.height}" fill="#FFFFFF"/>`
10201
+ ];
10202
+ let top = 3;
10203
+ let bottom = size.height - 3;
10204
+ let left = 3;
10205
+ let right = size.width - 3;
10206
+ const bar = (x, y, w2, h2, color = INK) => parts.push(
10207
+ `<rect x="${num2(x)}" y="${num2(y)}" width="${num2(w2)}" height="${num2(h2)}" fill="${color}"/>`
10208
+ );
10209
+ if (sketch.title) {
10210
+ bar(size.width * 0.3, top, size.width * 0.4, 3);
10211
+ top += 6;
10212
+ }
10213
+ if (sketch.legend === "t") {
10214
+ bar(size.width * 0.35, top, size.width * 0.3, 2, ACCENT);
10215
+ top += 5;
10216
+ } else if (sketch.legend === "b" && !sketch.dataTable) {
10217
+ bar(size.width * 0.35, bottom - 2, size.width * 0.3, 2, ACCENT);
10218
+ bottom -= 5;
10219
+ } else if (sketch.legend === "r") {
10220
+ bar(right - 6, (top + bottom) / 2 - 5, 6, 10, ACCENT);
10221
+ right -= 9;
10222
+ } else if (sketch.legend === "l") {
10223
+ bar(left, (top + bottom) / 2 - 5, 6, 10, ACCENT);
10224
+ left += 9;
10225
+ }
10226
+ if (sketch.dataTable) {
10227
+ const rows = 3;
10228
+ for (let r = 0; r < rows; r++) {
10229
+ parts.push(
10230
+ `<rect x="${num2(left + 4)}" y="${num2(bottom - (rows - r) * 3)}" width="${num2(right - left - 4)}" height="3" fill="none" stroke="${INK}" stroke-width="0.5"/>`
10231
+ );
10232
+ }
10233
+ bottom -= rows * 3 + 2;
10234
+ }
10235
+ if (sketch.catAxisTitle) {
10236
+ bar((left + right) / 2 - 6, bottom - 2, 12, 2);
10237
+ bottom -= 4;
10238
+ }
10239
+ if (sketch.valAxisTitle) {
10240
+ bar(left, (top + bottom) / 2 - 6, 2, 12);
10241
+ left += 4;
10242
+ }
10243
+ if (sketch.valueAxis) {
10244
+ left += 3;
10245
+ }
10246
+ const plotH = bottom - top;
10247
+ if (sketch.majorGridlines || sketch.minorGridlines) {
10248
+ const lines = sketch.minorGridlines ? 6 : 3;
10249
+ for (let i = 0; i < lines; i++) {
10250
+ const y = top + plotH * i / lines;
10251
+ parts.push(
10252
+ `<line x1="${num2(left)}" y1="${num2(y)}" x2="${num2(right)}" y2="${num2(y)}" stroke="#D9D9D9" stroke-width="${sketch.minorGridlines && i % 2 ? "0.4" : "0.7"}"/>`
10253
+ );
10254
+ }
10255
+ }
10256
+ const heights = [0.5, 0.8, 0.65];
10257
+ const w = (right - left) / 7;
10258
+ heights.forEach((h2, i) => {
10259
+ const x = left + w * (1 + i * 2);
10260
+ bar(x, bottom - plotH * h2, w, plotH * h2, ACCENT);
10261
+ if (sketch.dataLabels) {
10262
+ bar(x + w * 0.2, bottom - plotH * h2 - 2.5, w * 0.6, 1.5);
10263
+ }
10264
+ });
10265
+ parts.push(
10266
+ `<line x1="${num2(left)}" y1="${num2(bottom)}" x2="${num2(right)}" y2="${num2(bottom)}" stroke="${INK}" stroke-width="0.6"/>`
10267
+ );
10268
+ return svgTile(size.width, size.height, "", parts.join(""));
10269
+ }
10270
+
10271
+ // src/chart/design-galleries.ts
10272
+ var CHART_STYLE_TILE = { width: 60, height: 44 };
10273
+ var CHART_COLOR_TILE = { width: 96, height: 14 };
10274
+ var CHART_LAYOUT_TILE = { width: 56, height: 44 };
10275
+ function chartStyleGallerySection(appliedId) {
10276
+ return {
10277
+ id: "styles",
10278
+ columns: 6,
10279
+ tileWidth: CHART_STYLE_TILE.width,
10280
+ tileHeight: CHART_STYLE_TILE.height,
10281
+ items: CHART_STYLE_PRESETS.map((preset) => ({
10282
+ id: preset.id,
10283
+ label: preset.label,
10284
+ labelTemplate: preset.label,
10285
+ previewSvg: columnChartTileSvg(preset.colors(), CHART_STYLE_TILE),
10286
+ applied: preset.id === appliedId
10287
+ }))
10288
+ };
10289
+ }
10290
+ var COLOR_GROUPS = [
10291
+ ["colorful", "Colorful", "Colorful Palette {n}"],
10292
+ ["monochromatic", "Monochromatic", "Monochromatic Palette {n}"]
10293
+ ];
10294
+ function colorItem(palette, scheme, template, appliedId) {
10295
+ const count = palette.group === "colorful" ? Math.max(palette.base.length, 6) : 6;
10296
+ return {
10297
+ id: String(palette.id),
10298
+ label: template.replace("{n}", String(palette.index)),
10299
+ labelTemplate: template,
10300
+ labelParams: { n: palette.index },
10301
+ previewSvg: swatchStripSvg(chartPaletteColors(palette, count, scheme), CHART_COLOR_TILE),
10302
+ applied: palette.id === appliedId
10303
+ };
10304
+ }
10305
+ function chartColorGallerySections(scheme, appliedId) {
10306
+ return COLOR_GROUPS.map(([group, title, template]) => ({
10307
+ id: group,
10308
+ title,
10309
+ columns: 1,
10310
+ tileWidth: CHART_COLOR_TILE.width,
10311
+ tileHeight: CHART_COLOR_TILE.height,
10312
+ items: CHART_COLOR_PALETTES.filter((palette) => palette.group === group).map(
10313
+ (palette) => colorItem(palette, scheme, template, appliedId)
10314
+ )
10315
+ }));
10316
+ }
10317
+ function chartQuickLayoutGallerySection(appliedN) {
10318
+ return {
10319
+ id: "layouts",
10320
+ columns: 4,
10321
+ tileWidth: CHART_LAYOUT_TILE.width,
10322
+ tileHeight: CHART_LAYOUT_TILE.height,
10323
+ items: CHART_QUICK_LAYOUTS.map((layout) => ({
10324
+ id: `layout${layout.n}`,
10325
+ label: `Layout ${layout.n}`,
10326
+ labelTemplate: "Layout {n}",
10327
+ labelParams: { n: layout.n },
10328
+ previewSvg: chartLayoutTileSvg(layout, CHART_LAYOUT_TILE),
10329
+ applied: layout.n === appliedN
10330
+ }))
10331
+ };
10332
+ }
10333
+
10334
+ // src/xlsx/commands/chart-design.ts
10335
+ function translated(ctx, section) {
10336
+ return {
10337
+ ...section.title === void 0 ? {} : { title: ctx.t(section.title) },
10338
+ columns: section.columns,
10339
+ tileWidth: section.tileWidth,
10340
+ tileHeight: section.tileHeight,
10341
+ items: section.items.map((item) => ({
10342
+ id: item.id,
10343
+ label: ctx.t(item.labelTemplate, item.labelParams),
10344
+ preview: item.previewSvg,
10345
+ applied: item.applied
10346
+ }))
10347
+ };
10348
+ }
10349
+ function chartColorGallerySections2(ctx) {
10004
10350
  const workbook = ctx.workbook();
10005
10351
  const selectedChart = activeChart(ctx);
10006
10352
  if (!workbook || !selectedChart) return [];
10007
10353
  const scheme = chartColorScheme(workbook.theme);
10008
- const selected2 = selectedChart.chart.colorPalette ?? 10;
10009
- return ["colorful", "monochromatic"].map((group) => ({
10010
- title: ctx.t(group === "colorful" ? "Colorful" : "Monochromatic"),
10011
- columns: 1,
10012
- tileWidth: 96,
10013
- tileHeight: 14,
10014
- items: CHART_COLOR_PALETTES.filter((palette) => palette.group === group).map((palette) => ({
10015
- id: String(palette.id),
10016
- label: ctx.t(group === "colorful" ? "Colorful Palette {n}" : "Monochromatic Palette {n}", {
10017
- n: palette.index
10018
- }),
10019
- preview: swatchStripSvg(chartPaletteColors(palette, 6, scheme), { width: 96, height: 14 }),
10020
- applied: selected2 === palette.id
10021
- }))
10022
- }));
10354
+ return chartColorGallerySections(scheme, selectedChart.chart.colorPalette ?? 10).map(
10355
+ (section) => translated(ctx, section)
10356
+ );
10357
+ }
10358
+ var chartColorGalleryItems = (ctx) => chartColorGallerySections2(ctx).flatMap((section) => section.items);
10359
+ function chartStyleGallerySections(ctx) {
10360
+ const selectedChart = activeChart(ctx);
10361
+ if (!selectedChart) return [];
10362
+ return [translated(ctx, chartStyleGallerySection(chartStylePresetOf(selectedChart.chart)))];
10023
10363
  }
10024
- var chartColorGalleryItems = (ctx) => chartColorGallerySections(ctx).flatMap((section) => section.items);
10364
+ var chartStyleGalleryItems = (ctx) => chartStyleGallerySections(ctx).flatMap((section) => section.items);
10365
+ function chartQuickLayoutGallerySections(ctx) {
10366
+ const selectedChart = activeChart(ctx);
10367
+ if (!selectedChart || !chartTakesQuickLayout(selectedChart.chart)) return [];
10368
+ return [translated(ctx, chartQuickLayoutGallerySection(selectedChart.chart.quickLayout))];
10369
+ }
10370
+ var chartQuickLayoutGalleryItems = (ctx) => chartQuickLayoutGallerySections(ctx).flatMap((section) => section.items);
10025
10371
 
10026
10372
  // src/xlsx/ribbon/tabs/contextual.ts
10027
10373
  function tableDesignTab() {
@@ -10189,6 +10535,43 @@ function timelineTab() {
10189
10535
  ]
10190
10536
  };
10191
10537
  }
10538
+ function smartArtDesignTab() {
10539
+ const small = (key) => ({
10540
+ kind: "button",
10541
+ command: smartArtCommandId(key),
10542
+ showLabel: true
10543
+ });
10544
+ return {
10545
+ id: "smartart-design",
10546
+ label: "SmartArt Design",
10547
+ contextual: (ctx) => !!activeSmartArt(ctx),
10548
+ groups: [
10549
+ {
10550
+ id: "create-graphic",
10551
+ label: DIAGRAM_DESIGN_GROUPS.create,
10552
+ controls: [
10553
+ {
10554
+ kind: "menu",
10555
+ label: DIAGRAM_ADD_SHAPE_LABEL,
10556
+ icon: "xl-smartArtAddShape",
10557
+ size: "large",
10558
+ items: DIAGRAM_ADD_SHAPE_COMMANDS.map((command) => ({
10559
+ command: smartArtCommandId(command.key)
10560
+ }))
10561
+ },
10562
+ { kind: "toggle", command: smartArtCommandId("textPane"), size: "large" },
10563
+ { kind: "stack", controls: [small("promote"), small("demote")] },
10564
+ { kind: "stack", controls: [small("moveUp"), small("moveDown")] }
10565
+ ]
10566
+ },
10567
+ {
10568
+ id: "layouts",
10569
+ label: DIAGRAM_DESIGN_GROUPS.layouts,
10570
+ controls: [{ kind: "button", command: smartArtCommandId("changeLayout"), size: "large" }]
10571
+ }
10572
+ ]
10573
+ };
10574
+ }
10192
10575
  function chartDesignTab() {
10193
10576
  return {
10194
10577
  id: "chart-design",
@@ -10199,11 +10582,17 @@ function chartDesignTab() {
10199
10582
  id: "chart-styles",
10200
10583
  label: "Chart Styles",
10201
10584
  controls: [
10585
+ {
10586
+ kind: "gallery",
10587
+ command: "chart.styles",
10588
+ items: chartStyleGalleryItems,
10589
+ sections: chartStyleGallerySections
10590
+ },
10202
10591
  {
10203
10592
  kind: "gallery",
10204
10593
  command: "chart.colors",
10205
10594
  items: chartColorGalleryItems,
10206
- sections: chartColorGallerySections
10595
+ sections: chartColorGallerySections2
10207
10596
  }
10208
10597
  ]
10209
10598
  },
@@ -10211,6 +10600,12 @@ function chartDesignTab() {
10211
10600
  id: "chart-layouts",
10212
10601
  label: "Chart Layouts",
10213
10602
  controls: [
10603
+ {
10604
+ kind: "gallery",
10605
+ command: "chart.quick-layout",
10606
+ items: chartQuickLayoutGalleryItems,
10607
+ sections: chartQuickLayoutGallerySections
10608
+ },
10214
10609
  { kind: "button", command: "chart.title", size: "large" },
10215
10610
  { kind: "toggle", command: "chart.legend", size: "large" }
10216
10611
  ]
@@ -10766,7 +11161,10 @@ function insertTab() {
10766
11161
  {
10767
11162
  id: "illustrations",
10768
11163
  label: "Illustrations",
10769
- controls: [{ kind: "button", command: "insert.pictures", size: "large" }]
11164
+ controls: [
11165
+ { kind: "button", command: "insert.pictures", size: "large" },
11166
+ { kind: "button", command: "insert.smartart", size: "large" }
11167
+ ]
10770
11168
  },
10771
11169
  {
10772
11170
  id: "charts",
@@ -10948,6 +11346,7 @@ function commandTabs() {
10948
11346
  helpTab(),
10949
11347
  tableDesignTab(),
10950
11348
  chartDesignTab(),
11349
+ smartArtDesignTab(),
10951
11350
  slicerTab(),
10952
11351
  timelineTab()
10953
11352
  ];
@@ -11244,6 +11643,35 @@ function backgroundFillBinding(selected2) {
11244
11643
  preview: (chart, patch) => chartWithElementFills(chart, patch.elementFills ?? {})
11245
11644
  };
11246
11645
  }
11646
+ var XLSX_CHART_FILL_SLOT = "fill";
11647
+ var formatsSeries = (chart) => chart.series.length > 0;
11648
+ function workbookChartTheme(workbook) {
11649
+ const scheme = chartColorScheme(workbook.theme);
11650
+ return { scheme: (name) => scheme[name] };
11651
+ }
11652
+ var FILL_PARTS = ["chartArea", "plotArea", "title", "legend", "series"];
11653
+ var xlsxFillsTarget = (target37) => FILL_PARTS.includes(target37.kind);
11654
+ function xlsxChartFormatSource(chart, space, theme, target37) {
11655
+ const source = chartSpaceFormatSource(space, { theme });
11656
+ const spacing = chartBarSpacing(chart);
11657
+ return {
11658
+ ...source,
11659
+ targets: chart.title ? source.targets : source.targets.filter((option) => option.target.kind !== "title"),
11660
+ seriesOptions: (seriesIndex) => {
11661
+ const view = source.seriesOptions?.(seriesIndex);
11662
+ if (!view || view.chartType !== "bar") return view;
11663
+ return {
11664
+ ...view,
11665
+ gapWidth: view.gapWidth ?? spacing.barGapWidth,
11666
+ overlap: view.overlap ?? spacing.barOverlap,
11667
+ sliders: true
11668
+ };
11669
+ },
11670
+ ...target37 && xlsxFillsTarget(target37) ? { slots: { fill: XLSX_CHART_FILL_SLOT } } : {},
11671
+ flat: true,
11672
+ picker: { key: "chartFormat.chartElement", fallback: "Chart element" }
11673
+ };
11674
+ }
11247
11675
  function createNumberRange(input, options) {
11248
11676
  const element = input.ownerDocument.createElement("div");
11249
11677
  let original;
@@ -11644,10 +12072,10 @@ function createGradientTypeField(ctx, onPick) {
11644
12072
  };
11645
12073
  }
11646
12074
  function createChartGradientPreview(root, drawing, series, gradient) {
11647
- const target36 = typeof series === "number" ? `s${series}` : series;
12075
+ const target37 = typeof series === "number" ? `s${series}` : series;
11648
12076
  const nodes = Array.from(
11649
12077
  root.querySelectorAll(
11650
- `.xg-obj[data-index="${drawing}"] :is(linearGradient,radialGradient,pattern)[id$="-${target36}"]`
12078
+ `.xg-obj[data-index="${drawing}"] :is(linearGradient,radialGradient,pattern)[id$="-${target37}"]`
11651
12079
  )
11652
12080
  );
11653
12081
  const originals = nodes.map((node) => ({
@@ -12073,232 +12501,69 @@ function createSeriesFill(ctx, selected2, binding = seriesFillBinding(selected2)
12073
12501
  return { element, refresh };
12074
12502
  }
12075
12503
 
12076
- // src/xlsx/chart-series-pane.ts
12077
- function chartSeriesCommand() {
12504
+ // src/xlsx/chart-format-pane.ts
12505
+ function chartAreaCommand() {
12078
12506
  return editing({
12079
- id: "chart.format-series",
12080
- label: "Format Data Series",
12507
+ id: "chart.format-area",
12508
+ label: "Format Chart Area",
12081
12509
  icon: icon("chartColumn"),
12082
12510
  lock: "objects",
12083
12511
  enabled: (ctx) => {
12084
- const type = activeChart(ctx)?.chart.chartType;
12085
- return type === "column" || type === "bar";
12512
+ const chart = activeChart(ctx)?.chart;
12513
+ return !!chart && !chart.editBlocked;
12086
12514
  },
12087
- run: (ctx, arg) => void ctx.dialogs.open("format-chart-series", arg)
12088
- });
12089
- }
12090
- function createChartSeriesPane(ctx, onOpen) {
12091
- const element = el(ctx, "aside", "xve-chart-series-pane");
12092
- element.hidden = true;
12093
- element.setAttribute("role", "complementary");
12094
- const header = el(ctx, "div", "xve-chart-series-header");
12095
- const title = el(ctx, "h2");
12096
- const closeButton = el(ctx, "button", "xve-icon-button");
12097
- closeButton.type = "button";
12098
- closeButton.textContent = "\xD7";
12099
- const close = () => {
12100
- fills.refresh(void 0, void 0);
12101
- element.hidden = true;
12102
- ctx.grid()?.focus();
12103
- };
12104
- closeButton.addEventListener("click", close);
12105
- const body = el(ctx, "div", "xve-chart-series-body");
12106
- let selected2 = 0;
12107
- let shownWorkbook;
12108
- let shownSheet = -1;
12109
- let shownChart = -1;
12110
- const seriesSelect = select(ctx, []);
12111
- const seriesField = field(ctx, "Series", seriesSelect);
12112
- const fills = createSeriesFill(ctx, () => selected2);
12113
- seriesSelect.addEventListener("change", () => {
12114
- selected2 = Number(seriesSelect.value);
12115
- refresh();
12116
- });
12117
- const section = el(ctx, "h3");
12118
- const overlap = numberInput(ctx, 0, -100, 100);
12119
- const gap = numberInput(ctx, 150, 0, 500);
12120
- const overlapField = field(ctx, "Series Overlap", overlap);
12121
- const gapField = field(ctx, "Gap Width", gap);
12122
- const overlapRange = el(ctx, "div", "xve-chart-series-range");
12123
- const gapRange = el(ctx, "div", "xve-chart-series-range");
12124
- const ranges = [
12125
- [overlapRange, overlap, "Series Overlap"],
12126
- [gapRange, gap, "Gap Width"]
12127
- ];
12128
- const paintRange = (host, input, key) => {
12129
- const value = input.valueAsNumber;
12130
- render(
12131
- rangeControl({
12132
- label: ctx.t(key),
12133
- value,
12134
- valueText: `${value}%`,
12135
- min: Number(input.min),
12136
- max: Number(input.max),
12137
- disabled: input.disabled,
12138
- onInput: (next) => {
12139
- if (!ctx.commands.isEnabled("chart.format-series")) return refresh();
12140
- input.value = String(next);
12141
- paintRange(host, input, key);
12142
- },
12143
- onChange: () => input.dispatchEvent(new Event("change"))
12144
- }),
12145
- host
12146
- );
12147
- };
12148
- for (const row2 of [overlapField, gapField]) {
12149
- const unit = el(ctx, "span");
12150
- unit.textContent = "%";
12151
- row2.append(unit);
12152
- }
12153
- const empty = el(ctx, "p", "xve-note");
12154
- header.append(title, closeButton);
12155
- body.append(seriesField, section, overlapField, overlapRange, gapField, gapRange, fills.element);
12156
- element.append(header, body, empty);
12157
- element.addEventListener("keydown", (event) => {
12158
- if (event.key !== "Escape") return;
12159
- event.preventDefault();
12160
- event.stopPropagation();
12161
- close();
12162
- });
12163
- const relocalize = () => {
12164
- title.textContent = ctx.t("Format Data Series");
12165
- element.setAttribute("aria-label", title.textContent);
12166
- closeButton.setAttribute("aria-label", ctx.t("Close"));
12167
- section.textContent = ctx.t("Series Options");
12168
- seriesField.querySelector("span").textContent = ctx.t("Series");
12169
- seriesSelect.setAttribute("aria-label", ctx.t("Series"));
12170
- empty.textContent = ctx.t("Select a bar or column chart to format its series.");
12171
- for (const [row2, input, key] of [
12172
- [overlapField, overlap, "Series Overlap"],
12173
- [gapField, gap, "Gap Width"]
12174
- ]) {
12175
- row2.querySelector("span").textContent = ctx.t(key);
12176
- input.setAttribute("aria-label", ctx.t(key));
12177
- }
12178
- for (const [host, input, key] of ranges) paintRange(host, input, key);
12179
- refresh();
12180
- };
12181
- const refresh = () => {
12182
- if (element.hidden) return;
12183
- const found = activeChart(ctx);
12184
- const chart = found?.chart;
12185
- const workbook = ctx.workbook();
12186
- if (workbook !== shownWorkbook || shownSheet !== ctx.activeSheet() || shownChart !== found?.index)
12187
- selected2 = 0;
12188
- shownWorkbook = workbook;
12189
- shownSheet = ctx.activeSheet();
12190
- shownChart = found?.index ?? -1;
12191
- if (!chart?.series[selected2]) selected2 = 0;
12192
- const model = workbook && chart ? chartView(
12193
- workbook,
12194
- ctx.activeSheet(),
12195
- chart,
12196
- createRefEvaluator(workbook, ctx.session()?.calc, { sheet: ctx.activeSheet() })
12197
- ) : void 0;
12198
- seriesSelect.replaceChildren(
12199
- ...(model?.series ?? []).map((series, index) => {
12200
- const option = el(ctx, "option");
12201
- option.value = String(index);
12202
- option.textContent = series.name;
12203
- return option;
12204
- })
12205
- );
12206
- seriesSelect.value = String(selected2);
12207
- seriesSelect.disabled = !chart?.series.length || !ctx.commands.isEnabled("chart.format-series");
12208
- fills.refresh(chart, model);
12209
- const supported = chart?.chartType === "bar" || chart?.chartType === "column";
12210
- body.hidden = !supported;
12211
- empty.hidden = supported;
12212
- const spacing = chartBarSpacing(chart ?? {});
12213
- gap.value = String(spacing.barGapWidth);
12214
- overlap.value = String(spacing.barOverlap);
12215
- gap.disabled = overlap.disabled = !ctx.commands.isEnabled("chart.format-series");
12216
- for (const [host, input, key] of ranges) paintRange(host, input, key);
12217
- };
12218
- for (const [input, property] of [
12219
- [gap, "barGapWidth"],
12220
- [overlap, "barOverlap"]
12221
- ]) {
12222
- input.addEventListener("change", () => {
12223
- if (!ctx.commands.isEnabled("chart.format-series")) return refresh();
12224
- const value = input.valueAsNumber;
12225
- if (!Number.isInteger(value) || !input.checkValidity()) {
12226
- ctx.toast(
12227
- ctx.t("Enter a whole number from {min} to {max}.", { min: input.min, max: input.max }),
12228
- "warning"
12229
- );
12230
- refresh();
12231
- return;
12232
- }
12233
- if (activeChart(ctx)?.chart[property] !== value)
12234
- editChart(ctx, () => ({ [property]: value }));
12235
- refresh();
12236
- });
12237
- }
12238
- relocalize();
12239
- ctx.dialogs.register("format-chart-series", async (_ctx, props2) => {
12240
- if (!ctx.commands.isEnabled("chart.format-series")) return;
12241
- onOpen?.();
12242
- element.hidden = false;
12243
- refresh();
12244
- if (typeof props2 === "number" && Number.isInteger(props2) && activeChart(ctx)?.chart.series[props2]) {
12245
- selected2 = props2;
12246
- refresh();
12247
- }
12248
- overlap.focus();
12515
+ run: (ctx, arg) => void ctx.dialogs.open("format-chart-area", arg)
12249
12516
  });
12250
- return { element, refresh, relocalize, close };
12251
12517
  }
12252
- var names = {
12253
- chartArea: ["Chart Area", "Format Chart Area"],
12254
- plotArea: ["Plot Area", "Format Plot Area"],
12255
- title: ["Chart Title", "Format Chart Title"],
12256
- legend: ["Legend", "Format Legend"]
12257
- };
12258
- function chartAreaCommand() {
12518
+ function chartSeriesCommand() {
12259
12519
  return editing({
12260
- id: "chart.format-area",
12261
- label: "Format Chart Area",
12520
+ id: "chart.format-series",
12521
+ label: "Format Data Series",
12262
12522
  icon: icon("chartColumn"),
12263
12523
  lock: "objects",
12264
- enabled: (ctx) => !!activeChart(ctx),
12265
- run: (ctx, arg) => void ctx.dialogs.open("format-chart-area", arg)
12524
+ enabled: (ctx) => {
12525
+ const chart = activeChart(ctx)?.chart;
12526
+ return !!chart && !chart.editBlocked && formatsSeries(chart);
12527
+ },
12528
+ run: (ctx, arg) => void ctx.dialogs.open("format-chart-series", arg)
12266
12529
  });
12267
12530
  }
12268
- function createChartAreaPane(ctx, onOpen) {
12269
- const element = el(ctx, "aside", "xve-chart-series-pane");
12531
+ var BACKGROUNDS = ["chartArea", "plotArea", "title", "legend"];
12532
+ var englishKey = (fallback) => fallback.replace(/\{\{(\w+)\}\}/gu, "{$1}");
12533
+ var SPACING = {
12534
+ "series.gapWidth": [0, 500],
12535
+ "series.overlap": [-100, 100],
12536
+ "series.firstSliceAngle": [0, 360],
12537
+ "series.holeSize": [10, 90]
12538
+ };
12539
+ function createChartFormatPane(ctx) {
12540
+ const doc = ctx.host.ownerDocument;
12541
+ defineChartFormatPane(doc.defaultView?.customElements);
12542
+ const element = doc.createElement("office-ui-chart-format-pane");
12543
+ element.className = "xve-chart-series-pane";
12270
12544
  element.hidden = true;
12271
- element.setAttribute("role", "complementary");
12272
- const header = el(ctx, "div", "xve-chart-series-header");
12273
- const title = el(ctx, "h2");
12274
- const closeButton = el(ctx, "button", "xve-icon-button");
12275
- closeButton.type = "button";
12276
- closeButton.textContent = "\xD7";
12277
- const body = el(ctx, "div", "xve-chart-series-body");
12278
- let selected2 = "chartArea";
12279
- const target36 = select(ctx, []);
12280
- const targetField = field(ctx, "Chart element", target36);
12281
- const fills = createSeriesFill(
12545
+ let target37 = "chartArea";
12546
+ let seriesIndex = 0;
12547
+ let part = "chartArea";
12548
+ const seriesFill = createSeriesFill(ctx, () => seriesIndex);
12549
+ const backgroundFill = createSeriesFill(
12282
12550
  ctx,
12283
12551
  () => 0,
12284
- backgroundFillBinding(() => selected2)
12552
+ backgroundFillBinding(() => part)
12285
12553
  );
12554
+ for (const fill of [seriesFill, backgroundFill]) {
12555
+ fill.element.slot = XLSX_CHART_FILL_SLOT;
12556
+ fill.element.querySelector("h3")?.setAttribute("hidden", "");
12557
+ }
12558
+ const parsed = () => parseChartFormatTargetKey(target37);
12559
+ const isSeries = () => parsed()?.kind === "series";
12560
+ const commandId = () => isSeries() ? "chart.format-series" : "chart.format-area";
12286
12561
  const close = () => {
12287
- fills.refresh(void 0, void 0);
12562
+ seriesFill.refresh(void 0, void 0);
12563
+ backgroundFill.refresh(void 0, void 0);
12288
12564
  element.hidden = true;
12289
12565
  ctx.grid()?.focus();
12290
12566
  };
12291
- closeButton.addEventListener("click", close);
12292
- element.addEventListener("keydown", (event) => {
12293
- if (event.key === "Escape") {
12294
- event.preventDefault();
12295
- event.stopPropagation();
12296
- close();
12297
- }
12298
- });
12299
- header.append(title, closeButton);
12300
- body.append(targetField, fills.element);
12301
- element.append(header, body);
12302
12567
  const refresh = () => {
12303
12568
  if (element.hidden) return;
12304
12569
  const found = activeChart(ctx), book = ctx.workbook();
@@ -12306,50 +12571,84 @@ function createChartAreaPane(ctx, onOpen) {
12306
12571
  close();
12307
12572
  return;
12308
12573
  }
12309
- const available = (part) => part === "title" ? !!found.chart.title : part === "legend" ? found.chart.showLegend : true;
12310
- for (const option of target36.options)
12311
- option.disabled = !available(option.value);
12312
- if (!available(selected2)) selected2 = "chartArea";
12313
- title.textContent = ctx.t(names[selected2][1]);
12314
- element.setAttribute("aria-label", title.textContent);
12315
- target36.value = selected2;
12316
- target36.disabled = !ctx.commands.isEnabled("chart.format-area");
12317
- fills.refresh(
12574
+ const view = chartView(
12575
+ book,
12576
+ ctx.activeSheet(),
12318
12577
  found.chart,
12319
- chartView(
12320
- book,
12321
- ctx.activeSheet(),
12322
- found.chart,
12323
- createRefEvaluator(book, ctx.session()?.calc, { sheet: ctx.activeSheet() })
12324
- )
12578
+ createRefEvaluator(book, ctx.session()?.calc, { sheet: ctx.activeSheet() })
12325
12579
  );
12580
+ const space = chartSpaceOf(book, found.chart);
12581
+ const theme = workbookChartTheme(book);
12582
+ const listed = xlsxChartFormatSource(found.chart, space, theme, void 0);
12583
+ if (!listed.targets.some((option) => option.key === target37)) target37 = "chartArea";
12584
+ const selected2 = parsed();
12585
+ seriesIndex = selected2?.kind === "series" ? selected2.seriesIndex : 0;
12586
+ part = BACKGROUNDS.includes(target37) ? target37 : "chartArea";
12587
+ const slotted = selected2 !== void 0 && xlsxFillsTarget(selected2);
12588
+ const [active2, idle] = isSeries() ? [seriesFill, backgroundFill] : [backgroundFill, seriesFill];
12589
+ idle.refresh(void 0, void 0);
12590
+ idle.element.remove();
12591
+ if (slotted) {
12592
+ if (active2.element.parentNode !== element) element.append(active2.element);
12593
+ active2.refresh(found.chart, view);
12594
+ } else {
12595
+ active2.refresh(void 0, void 0);
12596
+ active2.element.remove();
12597
+ }
12598
+ element.source = xlsxChartFormatSource(found.chart, space, theme, selected2);
12599
+ element.target = target37;
12600
+ element.disabled = !ctx.commands.isEnabled(commandId());
12326
12601
  };
12327
- const relocalize = () => {
12328
- closeButton.setAttribute("aria-label", ctx.t("Close"));
12329
- targetField.querySelector("span").textContent = ctx.t("Chart element");
12330
- target36.setAttribute("aria-label", ctx.t("Chart element"));
12331
- target36.replaceChildren(
12332
- ...CHART_FILL_PARTS.map((part) => {
12333
- const option = el(ctx, "option");
12334
- option.value = part;
12335
- option.textContent = ctx.t(names[part][0]);
12336
- return option;
12337
- })
12338
- );
12602
+ element.addEventListener("office-chart-format-target", (event) => {
12603
+ target37 = event.detail.target;
12339
12604
  refresh();
12340
- };
12341
- target36.addEventListener("change", () => {
12342
- if (!target36.disabled && CHART_FILL_PARTS.includes(target36.value))
12343
- selected2 = target36.value;
12605
+ });
12606
+ element.addEventListener("office-chart-format-close", close);
12607
+ element.addEventListener("office-chart-format-edit", (event) => {
12608
+ const { field: field2, intent } = event.detail;
12609
+ if (!ctx.commands.isEnabled(commandId())) return refresh();
12610
+ const range2 = SPACING[field2];
12611
+ const found = activeChart(ctx);
12612
+ if (!intent || !found) {
12613
+ if (range2)
12614
+ ctx.toast(
12615
+ ctx.t("Enter a whole number from {min} to {max}.", { min: range2[0], max: range2[1] }),
12616
+ "warning"
12617
+ );
12618
+ return refresh();
12619
+ }
12620
+ try {
12621
+ ctx.session()?.editChart(ctx.activeSheet(), found.index, intent);
12622
+ } catch (error) {
12623
+ if (!(error instanceof RangeError)) throw error;
12624
+ ctx.toast(ctx.t("This chart element cannot take that setting."), "warning");
12625
+ }
12344
12626
  refresh();
12345
12627
  });
12346
- ctx.dialogs.register("format-chart-area", async (_ctx, part) => {
12347
- if (!ctx.commands.isEnabled("chart.format-area")) return;
12348
- onOpen();
12349
- selected2 = CHART_FILL_PARTS.includes(part) ? part : "chartArea";
12628
+ const relocalize = () => {
12629
+ element.locale = ctx.locale();
12630
+ element.translateLabel = (key, params, fallback) => {
12631
+ const english = englishKey(fallback ?? key);
12632
+ const own = ctx.t(english, params);
12633
+ return own === english ? key : own;
12634
+ };
12635
+ refresh();
12636
+ };
12637
+ const open = (focus) => {
12638
+ if (!ctx.commands.isEnabled(commandId())) return;
12350
12639
  element.hidden = false;
12351
12640
  refresh();
12352
- target36.focus();
12641
+ element.shadowRoot?.querySelector(focus)?.focus();
12642
+ };
12643
+ ctx.dialogs.register("format-chart-area", async (_ctx, arg) => {
12644
+ target37 = typeof arg === "string" && BACKGROUNDS.includes(arg) ? arg : "chartArea";
12645
+ open("[data-chart-format-target]");
12646
+ });
12647
+ ctx.dialogs.register("format-chart-series", async (_ctx, arg) => {
12648
+ const found = activeChart(ctx);
12649
+ const index = typeof arg === "number" && Number.isInteger(arg) && found?.chart.series[arg] ? arg : 0;
12650
+ target37 = `series:${index}`;
12651
+ open('[data-chart-format-field="series.overlap"] input');
12353
12652
  });
12354
12653
  relocalize();
12355
12654
  return { element, refresh, relocalize, close };
@@ -12379,7 +12678,8 @@ function allCommands() {
12379
12678
  ...viewCommands(),
12380
12679
  ...contextualCommands(),
12381
12680
  chartSeriesCommand(),
12382
- chartAreaCommand()
12681
+ chartAreaCommand(),
12682
+ ...smartArtCommands()
12383
12683
  ];
12384
12684
  }
12385
12685
  function installCommands(ctx) {
@@ -13125,11 +13425,11 @@ var CellEditor = class {
13125
13425
  }
13126
13426
  const refs = [];
13127
13427
  for (const ref of this.field.references()) {
13128
- const target36 = referenceTarget(ref.text);
13129
- if (!target36) continue;
13130
- if (target36.sheet !== void 0 && target36.sheet.toLowerCase() !== sheet.name.toLowerCase())
13428
+ const target37 = referenceTarget(ref.text);
13429
+ if (!target37) continue;
13430
+ if (target37.sheet !== void 0 && target37.sheet.toLowerCase() !== sheet.name.toLowerCase())
13131
13431
  continue;
13132
- refs.push({ range: target36.range, color: ref.color });
13432
+ refs.push({ range: target37.range, color: ref.color });
13133
13433
  }
13134
13434
  view.overlay.references = refs.length ? refs : void 0;
13135
13435
  view.schedule();
@@ -13450,7 +13750,10 @@ function smartArtSchemeColors(theme) {
13450
13750
  }
13451
13751
  return colors;
13452
13752
  }
13453
- function paintSmartArt(ctx, node, obj2, theme) {
13753
+ function paintSmartArt(ctx, node, obj2, theme, size = {
13754
+ w: (obj2.anchor.ext?.cx ?? 4572e3) / 9525,
13755
+ h: (obj2.anchor.ext?.cy ?? 2667e3) / 9525
13756
+ }) {
13454
13757
  const doc = node.ownerDocument;
13455
13758
  node.classList.add("xg-smartart");
13456
13759
  const label = obj2.name || ctx.t("SmartArt graphic");
@@ -13458,7 +13761,15 @@ function paintSmartArt(ctx, node, obj2, theme) {
13458
13761
  node.setAttribute("aria-label", label);
13459
13762
  const notice = ctx.t(obj2.notice);
13460
13763
  node.title = notice;
13461
- const diagram = obj2.diagram;
13764
+ const cached = obj2.diagram?.shapes.length ? obj2.diagram : void 0;
13765
+ const diagram = cached ?? approximateDiagramDrawingFromNodes({
13766
+ extentEmu: { width: Math.round(size.w * 9525), height: Math.round(size.h * 9525) },
13767
+ nodes: obj2.nodes,
13768
+ layoutId: obj2.layoutId,
13769
+ family: obj2.layoutFamily,
13770
+ colorsId: obj2.colorsId
13771
+ });
13772
+ node.dataset.rendering = cached ? "cached-drawing" : diagram ? "approximate" : "placeholder";
13462
13773
  if (diagram && diagram.shapes.length) {
13463
13774
  defineSmartArt(doc.defaultView?.customElements);
13464
13775
  const art = doc.createElement("office-ui-smartart");
@@ -13482,8 +13793,9 @@ function paintSmartArt(ctx, node, obj2, theme) {
13482
13793
  }
13483
13794
  node.append(list);
13484
13795
  }
13796
+ if (cached) return;
13485
13797
  const badge = h(doc, "div", "xg-smartart-notice");
13486
- badge.textContent = ctx.t("SmartArt (display only)");
13798
+ badge.textContent = ctx.t("Drawn with an approximate layout computed here; not Excel-identical.");
13487
13799
  badge.title = notice;
13488
13800
  node.append(badge);
13489
13801
  }
@@ -13551,6 +13863,15 @@ var DrawingLayer = class {
13551
13863
  this.#pressSlicer(event, index, frame, false);
13552
13864
  });
13553
13865
  node.addEventListener("dblclick", (event) => {
13866
+ const frame = view.sheet()?.drawings[index];
13867
+ if (frame?.kind === "smartArt") {
13868
+ event.stopPropagation();
13869
+ view.ctx.selection.set({ drawing: index });
13870
+ const textPane = view.ctx.commands.get("smartart.textPane");
13871
+ if (textPane && !textPane.checked?.(view.ctx))
13872
+ void view.ctx.commands.run("smartart.textPane");
13873
+ return;
13874
+ }
13554
13875
  const series = event.currentTarget.xgSeriesHit;
13555
13876
  const part = event.currentTarget.xgChartPart;
13556
13877
  if (series === void 0 && part === void 0) return;
@@ -13603,7 +13924,7 @@ var DrawingLayer = class {
13603
13924
  } else if (drawing.kind === "timeline") {
13604
13925
  paintTimeline(node, drawing, box.w, box.h, view.ctx, view.workbook());
13605
13926
  } else if (drawing.kind === "smartArt") {
13606
- paintSmartArt(view.ctx, node, drawing, view.workbook()?.theme);
13927
+ paintSmartArt(view.ctx, node, drawing, view.workbook()?.theme, box);
13607
13928
  } else if (drawing.chartEx) {
13608
13929
  this.#paintChart(node, drawing.chartEx, box);
13609
13930
  } else {
@@ -13721,11 +14042,11 @@ var DrawingLayer = class {
13721
14042
  }
13722
14043
  /** Handles a press on a timeline control; false lets the press move or resize the frame. */
13723
14044
  #pressTimeline(event, index, frame, node) {
13724
- const target36 = event.target;
14045
+ const target37 = event.target;
13725
14046
  const view = this.#view;
13726
- const list = target36.closest("[data-timeline-action=level]");
13727
- const clear = target36.closest("[data-timeline-action=clear]");
13728
- const cell = target36.closest("[data-period]");
14047
+ const list = target37.closest("[data-timeline-action=level]");
14048
+ const clear = target37.closest("[data-timeline-action=clear]");
14049
+ const cell = target37.closest("[data-period]");
13729
14050
  if (!list && !clear && !cell) return false;
13730
14051
  view.ctx.selection.set({ drawing: index });
13731
14052
  if (list) return true;
@@ -13780,10 +14101,10 @@ var DrawingLayer = class {
13780
14101
  }
13781
14102
  /** Handles a press on a slicer button; false lets the press move or resize the slicer. */
13782
14103
  #pressSlicer(event, index, frame, pointer = true) {
13783
- const target36 = event.target;
14104
+ const target37 = event.target;
13784
14105
  const view = this.#view;
13785
- const item = target36.closest("[data-slicer-item]");
13786
- const tool = target36.closest("[data-slicer-action]");
14106
+ const item = target37.closest("[data-slicer-item]");
14107
+ const tool = target37.closest("[data-slicer-action]");
13787
14108
  if (!item && !tool) return false;
13788
14109
  view.ctx.selection.set({ drawing: index });
13789
14110
  if (pointer) view.ctx.grid()?.focus();
@@ -14379,8 +14700,8 @@ function openMenuAtActive(view, refocus) {
14379
14700
  }
14380
14701
  function wireMenus(view, refocus) {
14381
14702
  const onMenu = (event) => {
14382
- const target36 = event.target;
14383
- if (target36.closest(".xg-editor-host.xg-editing, .xg-popup")) return;
14703
+ const target37 = event.target;
14704
+ if (target37.closest(".xg-editor-host.xg-editing, .xg-popup")) return;
14384
14705
  event.preventDefault();
14385
14706
  const hit = view.hitClient(event.clientX, event.clientY);
14386
14707
  const kind = hit.area === "row-header" ? "row" : hit.area === "col-header" ? "col" : "cell";
@@ -14441,8 +14762,8 @@ function startHeaderResize(view, axis, index, event) {
14441
14762
  }
14442
14763
  };
14443
14764
  draw();
14444
- const target36 = view.view;
14445
- target36.setPointerCapture?.(event.pointerId);
14765
+ const target37 = view.view;
14766
+ target37.setPointerCapture?.(event.pointerId);
14446
14767
  const move = (e) => {
14447
14768
  const { x, y } = view.clientToView(e.clientX, e.clientY);
14448
14769
  size = Math.max(0, Math.round((axis === "col" ? x : y) - start));
@@ -14450,9 +14771,9 @@ function startHeaderResize(view, axis, index, event) {
14450
14771
  guide.title = String(toFileSize(view, axis, size));
14451
14772
  };
14452
14773
  const up = (e) => {
14453
- target36.removeEventListener("pointermove", move, true);
14454
- target36.removeEventListener("pointerup", up, true);
14455
- target36.releasePointerCapture?.(e.pointerId);
14774
+ target37.removeEventListener("pointermove", move, true);
14775
+ target37.removeEventListener("pointerup", up, true);
14776
+ target37.releasePointerCapture?.(e.pointerId);
14456
14777
  guide.remove();
14457
14778
  const indices = resizeTargets(view, axis, index);
14458
14779
  const sheet = view.sheetIndex();
@@ -14460,8 +14781,8 @@ function startHeaderResize(view, axis, index, event) {
14460
14781
  else if (axis === "col") session.setColumnWidth(sheet, indices, toFileSize(view, "col", size));
14461
14782
  else session.setRowHeight(sheet, indices, toFileSize(view, "row", size));
14462
14783
  };
14463
- target36.addEventListener("pointermove", move, true);
14464
- target36.addEventListener("pointerup", up, true);
14784
+ target37.addEventListener("pointermove", move, true);
14785
+ target37.addEventListener("pointerup", up, true);
14465
14786
  }
14466
14787
  function autoFit(view, axis, index) {
14467
14788
  const session = view.ctx.session();
@@ -14551,8 +14872,8 @@ function wirePointer(host) {
14551
14872
  }, 40);
14552
14873
  };
14553
14874
  const onDown = (event) => {
14554
- const target36 = event.target;
14555
- if (target36.closest(".xg-editor-host, .xg-obj, .xg-dd, .xg-popup, .xg-assist")) return;
14875
+ const target37 = event.target;
14876
+ if (target37.closest(".xg-editor-host, .xg-obj, .xg-dd, .xg-popup, .xg-assist")) return;
14556
14877
  const { x, y } = view.clientToView(event.clientX, event.clientY);
14557
14878
  const g = view.geometry;
14558
14879
  const hit = g.hit(x, y);
@@ -14569,7 +14890,7 @@ function wirePointer(host) {
14569
14890
  event.preventDefault();
14570
14891
  const sheet = view.sheet();
14571
14892
  const editable = !view.ctx.readOnly();
14572
- if (target36.closest('[data-handle="fill"]') && editable) {
14893
+ if (target37.closest('[data-handle="fill"]') && editable) {
14573
14894
  drag = { kind: "fill", anchor: selection.get().active, pointer: event.pointerId, x, y };
14574
14895
  el4.setPointerCapture?.(event.pointerId);
14575
14896
  return;
@@ -14655,17 +14976,17 @@ function wirePointer(host) {
14655
14976
  drag = void 0;
14656
14977
  el4.releasePointerCapture?.(event.pointerId);
14657
14978
  if (finished.kind === "fill") {
14658
- const target36 = view.overlay.fillPreview;
14979
+ const target37 = view.overlay.fillPreview;
14659
14980
  view.overlay.fillPreview = void 0;
14660
14981
  const source = selection.get().ranges[selection.get().ranges.length - 1];
14661
- if (target36 && source) host.fill(source, target36);
14982
+ if (target37 && source) host.fill(source, target37);
14662
14983
  view.schedule();
14663
14984
  }
14664
14985
  if (finished.kind === "point") editor.focus();
14665
14986
  };
14666
14987
  const onDblClick = (event) => {
14667
- const target36 = event.target;
14668
- if (target36.closest(".xg-editor-host, .xg-obj, .xg-popup")) return;
14988
+ const target37 = event.target;
14989
+ if (target37.closest(".xg-editor-host, .xg-obj, .xg-popup")) return;
14669
14990
  const { x, y } = view.clientToView(event.clientX, event.clientY);
14670
14991
  const g = view.geometry;
14671
14992
  const hit = g.hit(x, y);
@@ -15649,8 +15970,8 @@ function wireTooltips(view) {
15649
15970
  tip.append(who, view.doc.createTextNode(reply.text));
15650
15971
  }
15651
15972
  } else if (link) {
15652
- const target36 = link.target ?? link.location ?? "";
15653
- tip.textContent = `${link.tooltip ?? target36}
15973
+ const target37 = link.target ?? link.location ?? "";
15974
+ tip.textContent = `${link.tooltip ?? target37}
15654
15975
  ${view.ctx.t("Ctrl+click to follow the link.")}`;
15655
15976
  }
15656
15977
  const g = view.geometry;
@@ -15685,8 +16006,8 @@ ${view.ctx.t("Ctrl+click to follow the link.")}`;
15685
16006
  tip.remove();
15686
16007
  };
15687
16008
  }
15688
- function workbookLocation(target36) {
15689
- const value = target36.trim();
16009
+ function workbookLocation(target37) {
16010
+ const value = target37.trim();
15690
16011
  if (value.startsWith("#")) return value.slice(1);
15691
16012
  return /^[a-z][a-z0-9+.-]+:/i.test(value) || /[\\/]/.test(value) ? void 0 : value;
15692
16013
  }
@@ -15716,13 +16037,13 @@ function goTo(view, selection, location) {
15716
16037
  if (!workbook) return false;
15717
16038
  const text3 = location.replace(/^#/, "");
15718
16039
  const name = workbook.definedNames.find((n) => n.name.toLowerCase() === text3.toLowerCase());
15719
- const target36 = referenceTarget(name ? name.formula : text3);
15720
- if (!target36) return false;
15721
- const sheetIndex = target36.sheet ? workbook.sheets.indexOf(sheetByName(workbook, target36.sheet)) : view.sheetIndex();
16040
+ const target37 = referenceTarget(name ? name.formula : text3);
16041
+ if (!target37) return false;
16042
+ const sheetIndex = target37.sheet ? workbook.sheets.indexOf(sheetByName(workbook, target37.sheet)) : view.sheetIndex();
15722
16043
  if (sheetIndex < 0) return false;
15723
16044
  if (sheetIndex !== view.sheetIndex()) view.ctx.setActiveSheet(sheetIndex);
15724
- const next = selectCell(sheetIndex, workbook.sheets[sheetIndex], target36.range.start);
15725
- selection.set({ ...next, ranges: [target36.range] }, target36.range.start);
16045
+ const next = selectCell(sheetIndex, workbook.sheets[sheetIndex], target37.range.start);
16046
+ selection.set({ ...next, ranges: [target37.range] }, target37.range.start);
15726
16047
  return true;
15727
16048
  }
15728
16049
 
@@ -16125,7 +16446,7 @@ function installPageBreakPreview(view) {
16125
16446
  return result;
16126
16447
  };
16127
16448
  const offModel = view.ctx.onModelChange(() => cache = void 0);
16128
- const target36 = (grab, clientX, clientY) => {
16449
+ const target37 = (grab, clientX, clientY) => {
16129
16450
  const g = view.geometry;
16130
16451
  const { x, y } = view.clientToView(clientX, clientY);
16131
16452
  const horizontal = grab.kind === "line" ? grab.line.axis === "col" : grab.edge === "left" || grab.edge === "right";
@@ -16174,7 +16495,7 @@ function installPageBreakPreview(view) {
16174
16495
  layer.append(ghost);
16175
16496
  let boundary = -1;
16176
16497
  const move = (e) => {
16177
- boundary = target36(grab, e.clientX, e.clientY);
16498
+ boundary = target37(grab, e.clientX, e.clientY);
16178
16499
  const g = view.geometry;
16179
16500
  if (axis === "row") place(ghost, g.headerW, g.rowY(boundary) - 1, g.cellsW, 3);
16180
16501
  else place(ghost, g.colX(boundary) - 1, g.headerH, 3, g.cellsH);
@@ -16334,9 +16655,9 @@ function mountGrid(ctx, container) {
16334
16655
  selection,
16335
16656
  editor,
16336
16657
  followLink: (row2, col) => followLink(view, selection, row2, col),
16337
- fill(source, target36) {
16338
- ctx.session()?.fill(view.sheetIndex(), source, target36);
16339
- selection.set({ ...selection.get(), ranges: [target36] });
16658
+ fill(source, target37) {
16659
+ ctx.session()?.fill(view.sheetIndex(), source, target37);
16660
+ selection.set({ ...selection.get(), ranges: [target37] });
16340
16661
  }
16341
16662
  }),
16342
16663
  wireTooltips(view),
@@ -16680,10 +17001,10 @@ function createNameBox(ctx, doc) {
16680
17001
  const wb = ctx.workbook();
16681
17002
  list.replaceChildren();
16682
17003
  const sheet = ctx.activeSheet();
16683
- const names2 = (wb?.definedNames ?? []).filter(
17004
+ const names = (wb?.definedNames ?? []).filter(
16684
17005
  (d) => !d.hidden && (d.localSheet === void 0 || d.localSheet === sheet)
16685
17006
  );
16686
- for (const named of names2) {
17007
+ for (const named of names) {
16687
17008
  const item = h(doc, "li", "xfb-name-item", { role: "option" });
16688
17009
  item.textContent = named.name;
16689
17010
  item.addEventListener("mousedown", (event) => {
@@ -16694,7 +17015,7 @@ function createNameBox(ctx, doc) {
16694
17015
  });
16695
17016
  list.append(item);
16696
17017
  }
16697
- if (!names2.length) {
17018
+ if (!names.length) {
16698
17019
  const empty = h(doc, "li", "xfb-name-empty", { "aria-disabled": "true" });
16699
17020
  empty.textContent = t("No defined names");
16700
17021
  list.append(empty);
@@ -17154,7 +17475,7 @@ function mountSheetTabs(ctx, container) {
17154
17475
  else if (right > strip.scrollLeft + strip.clientWidth)
17155
17476
  strip.scrollLeft = right - strip.clientWidth;
17156
17477
  };
17157
- const render3 = () => {
17478
+ const render2 = () => {
17158
17479
  if (renaming) return;
17159
17480
  const workbook = ctx.workbook();
17160
17481
  const active2 = ctx.activeSheet();
@@ -17172,7 +17493,7 @@ function mountSheetTabs(ctx, container) {
17172
17493
  const activate = (sheet) => {
17173
17494
  focusable = sheet;
17174
17495
  if (ctx.activeSheet() !== sheet) ctx.setActiveSheet(sheet);
17175
- render3();
17496
+ render2();
17176
17497
  };
17177
17498
  const rename = (sheet) => {
17178
17499
  if (!editable()) return;
@@ -17181,7 +17502,7 @@ function mountSheetTabs(ctx, container) {
17181
17502
  if (!tab) return;
17182
17503
  renaming = startRename(ctx, tab, sheet, () => {
17183
17504
  renaming = void 0;
17184
- render3();
17505
+ render2();
17185
17506
  tabFor(strip, sheet)?.focus();
17186
17507
  });
17187
17508
  };
@@ -17226,13 +17547,13 @@ function mountSheetTabs(ctx, container) {
17226
17547
  const visible = visibleSheetIndices(workbook);
17227
17548
  const at = visible.indexOf(sheet);
17228
17549
  const focusAt = (i) => {
17229
- const target37 = visible[Math.max(0, Math.min(visible.length - 1, i))];
17230
- if (target37 === void 0) return;
17231
- focusable = target37;
17550
+ const target38 = visible[Math.max(0, Math.min(visible.length - 1, i))];
17551
+ if (target38 === void 0) return;
17552
+ focusable = target38;
17232
17553
  for (const tab of strip.querySelectorAll(".xst-tab"))
17233
- tab.tabIndex = tab.dataset.sheet === String(target37) ? 0 : -1;
17234
- scrollIntoView(target37);
17235
- tabFor(strip, target37)?.focus();
17554
+ tab.tabIndex = tab.dataset.sheet === String(target38) ? 0 : -1;
17555
+ scrollIntoView(target38);
17556
+ tabFor(strip, target38)?.focus();
17236
17557
  };
17237
17558
  const moves = {
17238
17559
  ArrowLeft: at - 1,
@@ -17240,12 +17561,12 @@ function mountSheetTabs(ctx, container) {
17240
17561
  Home: 0,
17241
17562
  End: visible.length - 1
17242
17563
  };
17243
- const target36 = moves[event.key];
17564
+ const target37 = moves[event.key];
17244
17565
  const menuKey = event.key === "ContextMenu" || event.key === "F10" && event.shiftKey;
17245
- if (target36 === void 0 && !menuKey && !["Enter", " ", "F2"].includes(event.key)) return;
17566
+ if (target37 === void 0 && !menuKey && !["Enter", " ", "F2"].includes(event.key)) return;
17246
17567
  event.preventDefault();
17247
17568
  event.stopPropagation();
17248
- if (target36 !== void 0) focusAt(target36);
17569
+ if (target37 !== void 0) focusAt(target37);
17249
17570
  else if (event.key === "F2") rename(sheet);
17250
17571
  else if (menuKey) {
17251
17572
  const box = event.target.getBoundingClientRect();
@@ -17305,8 +17626,8 @@ function mountSheetTabs(ctx, container) {
17305
17626
  }
17306
17627
  }
17307
17628
  });
17308
- const disposeModel = ctx.onModelChange(() => render3());
17309
- render3();
17629
+ const disposeModel = ctx.onModelChange(() => render2());
17630
+ render2();
17310
17631
  return () => {
17311
17632
  renaming?.cancel();
17312
17633
  disposeModel();
@@ -17718,7 +18039,7 @@ function createPageLayoutView(ctx, host, fileName) {
17718
18039
  node.append(cell);
17719
18040
  });
17720
18041
  };
17721
- const render3 = () => {
18042
+ const render2 = () => {
17722
18043
  frame = 0;
17723
18044
  if (!active2) return;
17724
18045
  const workbook = ctx.workbook();
@@ -17764,7 +18085,7 @@ function createPageLayoutView(ctx, host, fileName) {
17764
18085
  paintSelection();
17765
18086
  };
17766
18087
  const schedule = () => {
17767
- if (!frame) frame = (doc.defaultView ?? window).requestAnimationFrame(render3);
18088
+ if (!frame) frame = (doc.defaultView ?? window).requestAnimationFrame(render2);
17768
18089
  };
17769
18090
  const toCanvas = (clientX, clientY) => {
17770
18091
  const rect = scaled.getBoundingClientRect();
@@ -17824,14 +18145,14 @@ function createPageLayoutView(ctx, host, fileName) {
17824
18145
  bandEditing = true;
17825
18146
  editBand(o, page, node, kind, section, () => {
17826
18147
  bandEditing = false;
17827
- render3();
18148
+ render2();
17828
18149
  root.focus({ preventScroll: true });
17829
18150
  });
17830
18151
  };
17831
18152
  root.addEventListener("pointerdown", (event) => {
17832
18153
  if (event.button !== 0 || !layout || !metrics || editor.editing) return;
17833
- const target36 = event.target;
17834
- if (target36.closest(".xpl-ruler-h,.xpl-ruler-v,.xpl-corner") || bandEditing) return;
18154
+ const target37 = event.target;
18155
+ if (target37.closest(".xpl-ruler-h,.xpl-ruler-v,.xpl-corner") || bandEditing) return;
17835
18156
  const { x, y } = toCanvas(event.clientX, event.clientY);
17836
18157
  const hit = pageViewHit(layout, metrics, x, y);
17837
18158
  if (!hit) return;
@@ -17921,7 +18242,7 @@ function createPageLayoutView(ctx, host, fileName) {
17921
18242
  if (active2 === on) return;
17922
18243
  active2 = on;
17923
18244
  root.hidden = !on;
17924
- if (on) render3();
18245
+ if (on) render2();
17925
18246
  else {
17926
18247
  editor.cancel();
17927
18248
  scaled.replaceChildren();
@@ -18042,7 +18363,7 @@ function collectKeyTips(panel3) {
18042
18363
  };
18043
18364
  targets.push({ key: COMMAND_KEYS[labelOf(control)] ?? "", element: control, activate });
18044
18365
  }
18045
- assignKeyTips(targets, (target36) => target36.element.getAttribute("aria-label") ?? "");
18366
+ assignKeyTips(targets, (target37) => target37.element.getAttribute("aria-label") ?? "");
18046
18367
  return targets;
18047
18368
  }
18048
18369
  var runTips = (root, targets, onDone) => (
@@ -18060,7 +18381,7 @@ function showTabKeyTips(root, select2) {
18060
18381
  const id = panel3.dataset.tab ?? "";
18061
18382
  const tab = tabButton(root, id);
18062
18383
  if (!tab || isTabHidden(panel3)) continue;
18063
- const used = targets.map((target36) => target36.key);
18384
+ const used = targets.map((target37) => target37.key);
18064
18385
  let key = TAB_KEYS[id] ?? "";
18065
18386
  if (!key || used.includes(key))
18066
18387
  key = [...(tab.textContent ?? id).toUpperCase().replace(/[^A-Z]/g, "")].find(
@@ -18113,7 +18434,7 @@ function applyRibbonVisibility(root, isHidden) {
18113
18434
  var isSmall = (control) => control.kind === "button" || control.kind === "toggle" || control.kind === "split" || control.kind === "menu" ? control.size !== "large" : control.kind === "color" || control.kind === "select";
18114
18435
  function layoutSmall(scope, run) {
18115
18436
  const { doc } = scope;
18116
- const render3 = (controls) => {
18437
+ const render2 = (controls) => {
18117
18438
  const box = el2(doc, "div", "ribbon-stack");
18118
18439
  for (const control of controls) {
18119
18440
  const node = renderControl(scope, control, true);
@@ -18134,14 +18455,14 @@ function layoutSmall(scope, run) {
18134
18455
  if (lines) {
18135
18456
  const column = el2(doc, "div", "ribbon-stack");
18136
18457
  for (const line of lines.filter((items2) => items2.length)) {
18137
- const row2 = render3(line);
18458
+ const row2 = render2(line);
18138
18459
  if (row2.childElementCount) column.append(row2);
18139
18460
  }
18140
18461
  return column.childElementCount ? [column] : [];
18141
18462
  }
18142
18463
  const columns = [];
18143
18464
  for (let at = 0; at < run.length; at += 3) {
18144
- const box = render3(run.slice(at, at + 3));
18465
+ const box = render2(run.slice(at, at + 3));
18145
18466
  if (box.childElementCount) columns.push(box);
18146
18467
  }
18147
18468
  return columns;
@@ -18552,7 +18873,7 @@ function createStatusBar(ctx, handlers) {
18552
18873
  const command = VIEW_COMMANDS[id];
18553
18874
  if (command) void ctx.commands.run(command);
18554
18875
  });
18555
- const render3 = () => {
18876
+ const render2 = () => {
18556
18877
  const sheet = ctx.workbook()?.sheets[ctx.activeSheet()];
18557
18878
  const mode = sheet?.view?.mode;
18558
18879
  const hasSheet = !!sheet;
@@ -18589,7 +18910,7 @@ function createStatusBar(ctx, handlers) {
18589
18910
  };
18590
18911
  };
18591
18912
  const refresh = () => {
18592
- render3();
18913
+ render2();
18593
18914
  stats.textContent = statisticsText(ctx, shown3, layout.stats);
18594
18915
  slider.value = zoom();
18595
18916
  };
@@ -18628,7 +18949,7 @@ function createTitleBar(ctx, handlers) {
18628
18949
  element.append(people);
18629
18950
  let fileName = "";
18630
18951
  let saveState = "saved";
18631
- const render3 = () => {
18952
+ const render2 = () => {
18632
18953
  const undoLabel = historyOf(ctx)?.undoLabel();
18633
18954
  const entries = [
18634
18955
  { id: "save", icon: "save", label: ctx.t("Save"), title: `${ctx.t("Save")} (Ctrl+S)` },
@@ -18682,25 +19003,25 @@ function createTitleBar(ctx, handlers) {
18682
19003
  });
18683
19004
  const relocalize = () => {
18684
19005
  people.setAttribute("label", ctx.t("People in this session"));
18685
- render3();
19006
+ render2();
18686
19007
  };
18687
19008
  const refresh = () => {
18688
19009
  const sharing = handlers.collaboration?.();
18689
19010
  people.hidden = !sharing?.active;
18690
19011
  const next = sharing?.active ? participants(sharing) : [];
18691
19012
  if (JSON.stringify(next) !== JSON.stringify(people.participants)) people.participants = next;
18692
- render3();
19013
+ render2();
18693
19014
  };
18694
19015
  relocalize();
18695
19016
  return {
18696
19017
  element,
18697
19018
  setFileName(value) {
18698
19019
  fileName = value;
18699
- render3();
19020
+ render2();
18700
19021
  },
18701
19022
  setSaveState(value) {
18702
19023
  saveState = value;
18703
- render3();
19024
+ render2();
18704
19025
  },
18705
19026
  refresh,
18706
19027
  relocalize,
@@ -18882,8 +19203,8 @@ function buildShell(core) {
18882
19203
  });
18883
19204
  const toaster = createToaster(doc, () => ctx.t("Close"));
18884
19205
  const workspace = el2(doc, "div", "xve-workspace");
18885
- const chartSeriesPane = createChartSeriesPane(ctx, () => chartAreaPane.close());
18886
- const chartAreaPane = createChartAreaPane(ctx, () => chartSeriesPane.close());
19206
+ const chartFormatPane = createChartFormatPane(ctx);
19207
+ const smartArt = createSmartArtController(ctx);
18887
19208
  const canvasRow = el2(doc, "div", "xve-canvas-row");
18888
19209
  const formulaRow = el2(doc, "div", "xve-formula-row");
18889
19210
  const gridHost = el2(doc, "div", "xve-grid-host");
@@ -18892,7 +19213,7 @@ function buildShell(core) {
18892
19213
  const emptyText = el2(doc, "p");
18893
19214
  empty.append(emptyText);
18894
19215
  workspace.append(formulaRow, gridHost, tabsRow, empty);
18895
- canvasRow.append(workspace, chartSeriesPane.element, chartAreaPane.element);
19216
+ canvasRow.append(workspace, chartFormatPane.element, smartArt.element);
18896
19217
  frame.append(
18897
19218
  titleBar.element,
18898
19219
  ribbon.element,
@@ -18921,22 +19242,22 @@ function buildShell(core) {
18921
19242
  formulaRow,
18922
19243
  gridHost,
18923
19244
  tabsRow,
18924
- chartSeriesPane.element,
18925
- chartAreaPane.element,
19245
+ chartFormatPane.element,
19246
+ smartArt.element,
18926
19247
  statusBar.element
18927
19248
  ].filter((region) => region.getClientRects().length);
18928
19249
  const focusRegion = (region) => {
18929
19250
  if (region === ribbon.element) return ribbon.focus();
18930
19251
  if (region === gridHost) return ctx.grid()?.focus();
18931
- region.querySelector('input, button:not(:disabled), [tabindex="0"]')?.focus();
19252
+ (region.shadowRoot ?? region).querySelector('input, button:not(:disabled), [tabindex="0"]')?.focus();
18932
19253
  };
18933
19254
  const actions = (action) => {
18934
19255
  if (action === "help") return help.open();
18935
19256
  if (action === "keytips") return ribbon.showKeyTips();
18936
19257
  if (action === "context-menu") {
18937
- const target36 = root.activeElement ?? gridHost;
18938
- const box = target36.getBoundingClientRect();
18939
- target36.dispatchEvent(
19258
+ const target37 = root.activeElement ?? gridHost;
19259
+ const box = target37.getBoundingClientRect();
19260
+ target37.dispatchEvent(
18940
19261
  new MouseEvent("contextmenu", {
18941
19262
  bubbles: true,
18942
19263
  composed: true,
@@ -18964,8 +19285,8 @@ function buildShell(core) {
18964
19285
  ribbonActions.refresh();
18965
19286
  statusBar.refresh();
18966
19287
  pageViews?.refresh();
18967
- chartSeriesPane.refresh();
18968
- chartAreaPane.refresh();
19288
+ chartFormatPane.refresh();
19289
+ smartArt.refresh();
18969
19290
  titleBar.setFileName(core.fileName);
18970
19291
  if (core.dirty.dirty && saveState !== "dirty" && saveState !== "saving")
18971
19292
  chrome.setSaveState("dirty");
@@ -18981,8 +19302,8 @@ function buildShell(core) {
18981
19302
  ribbonActions.relocalize();
18982
19303
  statusBar.relocalize();
18983
19304
  backstage.relocalize();
18984
- chartSeriesPane.relocalize();
18985
- chartAreaPane.relocalize();
19305
+ chartFormatPane.relocalize();
19306
+ smartArt.relocalize();
18986
19307
  core.requestRender();
18987
19308
  }
18988
19309
  };