ooxml-ui 1.52.1 → 1.54.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +9 -1
- package/dist/building-block-styles.d.ts +1 -0
- package/dist/chart/chartex-options-locales.d.ts +6 -6
- package/dist/chart/chartex-options-more.d.ts +17 -0
- package/dist/chart/chartex-options.d.ts +1 -0
- package/dist/chart/data-sheet-labels.d.ts +1 -0
- package/dist/chart/data-sheet.d.ts +2 -1
- package/dist/chart/format-pane-3d.d.ts +1 -0
- package/dist/chart/format-pane-advanced-intent.d.ts +1 -0
- package/dist/chart/format-pane-advanced-space.d.ts +5 -2
- package/dist/chart/format-pane-advanced-space.d.ts.map +1 -1
- package/dist/chart/format-pane-analysis.d.ts +1 -0
- package/dist/chart/format-pane-analysis.d.ts.map +1 -1
- package/dist/chart/format-pane-axis.d.ts +1 -0
- package/dist/chart/format-pane-common.d.ts +1 -0
- package/dist/chart/format-pane-effects.d.ts +1 -0
- package/dist/chart/format-pane-fill-kinds.d.ts +6 -0
- package/dist/chart/format-pane-fill-kinds.d.ts.map +1 -1
- package/dist/chart/format-pane-intent.d.ts +3 -2
- package/dist/chart/format-pane-intent.d.ts.map +1 -1
- package/dist/chart/format-pane-locales/de.d.ts +1 -0
- package/dist/chart/format-pane-locales/de.d.ts.map +1 -1
- package/dist/chart/format-pane-locales/en.d.ts.map +1 -1
- package/dist/chart/format-pane-locales/es.d.ts +1 -0
- package/dist/chart/format-pane-locales/es.d.ts.map +1 -1
- package/dist/chart/format-pane-locales/fr.d.ts +1 -0
- package/dist/chart/format-pane-locales/fr.d.ts.map +1 -1
- package/dist/chart/format-pane-locales/index.d.ts +1 -0
- package/dist/chart/format-pane-locales/ja.d.ts +1 -0
- package/dist/chart/format-pane-locales/ja.d.ts.map +1 -1
- package/dist/chart/format-pane-locales/ko.d.ts +1 -0
- package/dist/chart/format-pane-locales/ko.d.ts.map +1 -1
- package/dist/chart/format-pane-locales/zh-CN.d.ts +1 -0
- package/dist/chart/format-pane-locales/zh-CN.d.ts.map +1 -1
- package/dist/chart/format-pane-options.d.ts +1 -0
- package/dist/chart/format-pane-space.d.ts +16 -3
- package/dist/chart/format-pane-space.d.ts.map +1 -1
- package/dist/chart/format-pane-targets.d.ts +1 -0
- package/dist/chart/format-pane-trendlines.d.ts +17 -0
- package/dist/chart/format-pane-trendlines.d.ts.map +1 -0
- package/dist/chart/format-pane-types.d.ts +1 -0
- package/dist/chart/format-pane-view.d.ts +10 -1
- package/dist/chart/format-pane-view.d.ts.map +1 -1
- package/dist/chart/format-pane.d.ts +7 -0
- package/dist/chart/format-pane.d.ts.map +1 -1
- package/dist/chart/gallery-tiles.d.ts +1 -0
- package/dist/chart-format-locales.js +1 -1
- package/dist/chrome/account-profile.d.ts +1 -0
- package/dist/chrome/account.d.ts +2 -1
- package/dist/chrome/find-bar.d.ts +2 -1
- package/dist/chrome/format-section.d.ts +2 -1
- package/dist/chrome/print-preview.d.ts +2 -1
- package/dist/chrome/status-bar.d.ts +2 -1
- package/dist/chrome/status-item.d.ts +2 -1
- package/dist/chrome/tab-drag.d.ts +1 -0
- package/dist/chrome/task-pane.d.ts +2 -1
- package/dist/chrome/title-bar-types.d.ts +1 -0
- package/dist/{chunk-2N6QBIKM.js → chunk-3BNPWXCC.js} +1 -1
- package/dist/{chunk-HUR5JAG7.js → chunk-4JFADIZ6.js} +359 -17
- package/dist/{chunk-QGRJJUH7.js → chunk-54MF25DU.js} +1 -1
- package/dist/{chunk-FP45SLBV.js → chunk-6SAT2GKV.js} +1 -1
- package/dist/{chunk-3TF5IIIJ.js → chunk-7F5IZHKM.js} +388 -255
- package/dist/{chunk-QDU4GLWK.js → chunk-HTB63MJO.js} +361 -60
- package/dist/{chunk-GSO4HLIY.js → chunk-O3ER66QG.js} +49 -7
- package/dist/{chunk-ELVHRXWE.js → chunk-UEUP3EMQ.js} +3 -3
- package/dist/comments/types.d.ts +1 -0
- package/dist/controls.d.ts +1 -0
- package/dist/controls.js +2 -2
- package/dist/dialog/chart-picker.d.ts +2 -1
- package/dist/dialog/dialog-footer.d.ts +2 -1
- package/dist/dialog/dialog-session.d.ts +1 -0
- package/dist/dialog/dialog.d.ts +2 -1
- package/dist/dialog/focus.d.ts +1 -0
- package/dist/dialog/message-dialog.d.ts +2 -1
- package/dist/dialog/message-dialogs.d.ts +1 -0
- package/dist/dialog/options-categories.d.ts +1 -0
- package/dist/dialog/options-controls.d.ts +1 -0
- package/dist/dialog/options-dialog.d.ts +2 -1
- package/dist/dialog/share-dialog-locales.d.ts +1 -0
- package/dist/dialog/share-dialog.d.ts +2 -1
- package/dist/docx/chart-commands.d.ts +5 -1
- package/dist/docx/locales/charts.d.ts +9 -0
- package/dist/docx/locales/en.d.ts +77 -14
- package/dist/docx/locales/smartart.d.ts +68 -14
- package/dist/docx/localization-strings.d.ts +77 -14
- package/dist/docx/smartart-node-view.d.ts +2 -1
- package/dist/docx.js +124 -58
- package/dist/embedding/region-host.d.ts +1 -0
- package/dist/export/pdf-font-faces.d.ts +1 -0
- package/dist/export/pdf-svg-gradient.d.ts +1 -0
- package/dist/export/pdf-svg-text.d.ts +1 -0
- package/dist/export/pdf-text-layer-font.d.ts +1 -0
- package/dist/files/cloud-files-view.d.ts +1 -0
- package/dist/files/cloud-files.d.ts +2 -1
- package/dist/files/open-places.d.ts +2 -1
- package/dist/files/save-progress-label.d.ts +1 -0
- package/dist/fonts/availability.d.ts +1 -0
- package/dist/fonts/catalog.d.ts +1 -0
- package/dist/fonts/custom-fonts.d.ts +1 -0
- package/dist/fonts/webfonts.d.ts +1 -0
- package/dist/form/checkbox.d.ts +2 -1
- package/dist/form/color-custom.d.ts +2 -1
- package/dist/form/color-grid.d.ts +2 -1
- package/dist/form/color-input/live-color-input.d.ts +1 -0
- package/dist/form/color-input/live-color-leaves.d.ts +1 -0
- package/dist/form/color-swatches.d.ts +1 -0
- package/dist/form/radio.d.ts +2 -1
- package/dist/form/range-control.d.ts +1 -0
- package/dist/form/search-field.d.ts +2 -1
- package/dist/form/select.d.ts +2 -1
- package/dist/form/symbol-picker.d.ts +2 -1
- package/dist/form/zoom-slider.d.ts +2 -1
- package/dist/glyph.d.ts +1 -0
- package/dist/icon.d.ts +1 -0
- package/dist/icons.d.ts +1 -0
- package/dist/index.js +6 -6
- package/dist/keytips.d.ts +1 -0
- package/dist/look.d.ts +1 -0
- package/dist/menu/command-search.d.ts +2 -1
- package/dist/menu/context-menu.d.ts +2 -1
- package/dist/menu/menu-item.d.ts +2 -1
- package/dist/menu/menu-separator.d.ts +2 -1
- package/dist/notices/paste-options.d.ts +2 -1
- package/dist/notices/read-only-banner.d.ts +2 -1
- package/dist/picture-artistic-filters.d.ts +1 -0
- package/dist/picture-artistic-preview.d.ts +1 -0
- package/dist/picture-effects.d.ts +1 -0
- package/dist/picture-pixels.d.ts +1 -0
- package/dist/picture-standard-filter.d.ts +1 -0
- package/dist/pptx/{chart-3d-view-scene-RCWYLVC3.cjs → chart-3d-view-scene-B3SNZWRD.cjs} +37 -37
- package/dist/pptx/{chart-3d-view-scene-7LIMCTEM.mjs → chart-3d-view-scene-ENYOU7XV.mjs} +2 -2
- package/dist/pptx/{chunk-JVCSVLFU.cjs → chunk-3GS5BKST.cjs} +76 -7
- package/dist/pptx/{chunk-SWJV6FQN.cjs → chunk-5BQM5YYS.cjs} +9574 -6384
- package/dist/pptx/{chunk-3DJZBAQ2.mjs → chunk-6FDEQ46Q.mjs} +1 -1
- package/dist/pptx/{chunk-EEELXUAE.mjs → chunk-7EVC4DK7.mjs} +2 -2
- package/dist/pptx/{chunk-OFXOF5ZX.mjs → chunk-DNXARUCD.mjs} +18119 -15025
- package/dist/pptx/{chunk-4K4DO7RJ.mjs → chunk-FYNZ6QSV.mjs} +76 -7
- package/dist/pptx/{chunk-FQGG3DGL.mjs → chunk-J4PPKLNF.mjs} +3 -3
- package/dist/pptx/{chunk-HTFYAGHG.cjs → chunk-K2SGPTSG.cjs} +43 -0
- package/dist/pptx/{chunk-LOUVYGWX.cjs → chunk-KESYQS6D.cjs} +12 -12
- package/dist/pptx/{chunk-XOAXPD2W.cjs → chunk-MCRNV5DK.cjs} +5 -187
- package/dist/pptx/{chunk-OATLMHQL.cjs → chunk-QMGOPAN5.cjs} +49 -49
- package/dist/pptx/{chunk-RQJOOXRG.mjs → chunk-T3GW4SKO.mjs} +6 -186
- package/dist/pptx/{chunk-AN34Z3QP.cjs → chunk-WPM2ADMY.cjs} +2 -2
- package/dist/pptx/{chunk-XL5AF4U3.mjs → chunk-YFS2TFET.mjs} +40 -1
- package/dist/pptx/dom/index.cjs +441 -441
- package/dist/pptx/dom/index.mjs +11 -11
- package/dist/pptx/export/html2canvas-clone.cjs +6 -6
- package/dist/pptx/export/html2canvas-clone.mjs +1 -1
- package/dist/pptx/i18n/index.cjs +6 -6
- package/dist/pptx/i18n/index.mjs +1 -1
- package/dist/pptx/i18n/translations-en-galleries-data.d.ts.map +1 -1
- package/dist/pptx/i18n/translations-en.d.ts.map +1 -1
- package/dist/pptx/index.cjs +4092 -3692
- package/dist/pptx/index.mjs +6 -6
- package/dist/pptx/render/building-blocks/find-bar-controller.d.ts +5 -11
- package/dist/pptx/render/building-blocks/find-bar-controller.d.ts.map +1 -1
- package/dist/pptx/render/chart-combo-stock.cjs +3 -3
- package/dist/pptx/render/chart-combo-stock.mjs +1 -1
- package/dist/pptx/render/chart-format/chart-format-pane-edit-extra.d.ts +1 -5
- package/dist/pptx/render/chart-format/chart-format-pane-edit-extra.d.ts.map +1 -1
- package/dist/pptx/render/chart-format/chart-format-pane-edit.d.ts.map +1 -1
- package/dist/pptx/render/chart-format/chart-format-source.d.ts +3 -0
- package/dist/pptx/render/chart-format/chart-format-source.d.ts.map +1 -1
- package/dist/pptx/render/chart-overlays.cjs +7 -7
- package/dist/pptx/render/chart-overlays.mjs +1 -1
- package/dist/pptx/render/chart-surface-treemap.cjs +4 -4
- package/dist/pptx/render/chart-surface-treemap.mjs +1 -1
- package/dist/pptx/render/chart-view-model.cjs +44 -44
- package/dist/pptx/render/chart-view-model.mjs +1 -1
- package/dist/pptx/render/chart-waterfall-map.cjs +6 -6
- package/dist/pptx/render/chart-waterfall-map.mjs +1 -1
- package/dist/pptx/render/controller/comments-panel-controller.d.ts +78 -0
- package/dist/pptx/render/controller/comments-panel-controller.d.ts.map +1 -0
- package/dist/pptx/render/controller/find-replace-controller.d.ts +27 -0
- package/dist/pptx/render/controller/find-replace-controller.d.ts.map +1 -0
- package/dist/pptx/render/controller/index.d.ts +16 -0
- package/dist/pptx/render/controller/index.d.ts.map +1 -1
- package/dist/pptx/render/controller/presentation-ink-controller.d.ts +121 -0
- package/dist/pptx/render/controller/presentation-ink-controller.d.ts.map +1 -0
- package/dist/pptx/render/controller/presentation-rehearsal-controller.d.ts +71 -0
- package/dist/pptx/render/controller/presentation-rehearsal-controller.d.ts.map +1 -0
- package/dist/pptx/render/controller/presenter-session-controller.d.ts +85 -0
- package/dist/pptx/render/controller/presenter-session-controller.d.ts.map +1 -0
- package/dist/pptx/render/controller/selection-pane-controller.d.ts +82 -0
- package/dist/pptx/render/controller/selection-pane-controller.d.ts.map +1 -0
- package/dist/pptx/render/controller/slide-rail-controller.d.ts +67 -0
- package/dist/pptx/render/controller/slide-rail-controller.d.ts.map +1 -0
- package/dist/pptx/render/controller/slide-sorter-controller.d.ts +149 -0
- package/dist/pptx/render/controller/slide-sorter-controller.d.ts.map +1 -0
- package/dist/pptx/render/drawing-color.d.ts +10 -3
- package/dist/pptx/render/drawing-color.d.ts.map +1 -1
- package/dist/pptx/render/editor-chrome/ribbon-css.d.ts +1 -1
- package/dist/pptx/render/editor-chrome/ribbon-css.d.ts.map +1 -1
- package/dist/pptx/render/fill-style.d.ts.map +1 -1
- package/dist/pptx/render/index.d.ts +4 -0
- package/dist/pptx/render/index.d.ts.map +1 -1
- package/dist/pptx/render/inspector/action-settings-fields.d.ts +58 -0
- package/dist/pptx/render/inspector/action-settings-fields.d.ts.map +1 -0
- package/dist/pptx/render/inspector/element-alt-text-fields.d.ts +23 -0
- package/dist/pptx/render/inspector/element-alt-text-fields.d.ts.map +1 -0
- package/dist/pptx/render/inspector/index.d.ts +31 -0
- package/dist/pptx/render/inspector/index.d.ts.map +1 -1
- package/dist/pptx/render/inspector/inspector-field-model.d.ts +31 -3
- package/dist/pptx/render/inspector/inspector-field-model.d.ts.map +1 -1
- package/dist/pptx/render/inspector/inspector-option-label.d.ts +11 -0
- package/dist/pptx/render/inspector/inspector-option-label.d.ts.map +1 -0
- package/dist/pptx/render/inspector/media-playback-fields.d.ts +24 -0
- package/dist/pptx/render/inspector/media-playback-fields.d.ts.map +1 -0
- package/dist/pptx/render/inspector/media-trim-fields.d.ts +29 -0
- package/dist/pptx/render/inspector/media-trim-fields.d.ts.map +1 -0
- package/dist/pptx/render/inspector/ole-fields.d.ts +33 -0
- package/dist/pptx/render/inspector/ole-fields.d.ts.map +1 -0
- package/dist/pptx/render/inspector/paragraph-fields.d.ts +27 -0
- package/dist/pptx/render/inspector/paragraph-fields.d.ts.map +1 -0
- package/dist/pptx/render/inspector/picture-artistic-fields.d.ts +16 -0
- package/dist/pptx/render/inspector/picture-artistic-fields.d.ts.map +1 -0
- package/dist/pptx/render/inspector/picture-effect-fields.d.ts +45 -0
- package/dist/pptx/render/inspector/picture-effect-fields.d.ts.map +1 -0
- package/dist/pptx/render/inspector/picture-fields.d.ts +38 -0
- package/dist/pptx/render/inspector/picture-fields.d.ts.map +1 -0
- package/dist/pptx/render/inspector/shape-fill-actions.d.ts +109 -0
- package/dist/pptx/render/inspector/shape-fill-actions.d.ts.map +1 -0
- package/dist/pptx/render/inspector/shape-fill-fields.d.ts +54 -0
- package/dist/pptx/render/inspector/shape-fill-fields.d.ts.map +1 -0
- package/dist/pptx/render/inspector/shape-fill-stops.d.ts +21 -0
- package/dist/pptx/render/inspector/shape-fill-stops.d.ts.map +1 -0
- package/dist/pptx/render/inspector/slide-background-fields.d.ts +22 -0
- package/dist/pptx/render/inspector/slide-background-fields.d.ts.map +1 -0
- package/dist/pptx/render/inspector/table-cell-fields.d.ts +26 -0
- package/dist/pptx/render/inspector/table-cell-fields.d.ts.map +1 -0
- package/dist/pptx/render/inspector/table-option-fields.d.ts +23 -0
- package/dist/pptx/render/inspector/table-option-fields.d.ts.map +1 -0
- package/dist/pptx/render/outline-view-session.d.ts +67 -0
- package/dist/pptx/render/outline-view-session.d.ts.map +1 -0
- package/dist/pptx/render/present-controls-state.d.ts +6 -0
- package/dist/pptx/render/present-controls-state.d.ts.map +1 -1
- package/dist/pptx/render/ribbon-galleries/smartart-colors-gallery.d.ts.map +1 -1
- package/dist/pptx/render/ribbon-galleries/smartart-gallery-patch.d.ts.map +1 -1
- package/dist/pptx/render/ribbon-galleries/smartart-native-entries.d.ts +37 -0
- package/dist/pptx/render/ribbon-galleries/smartart-native-entries.d.ts.map +1 -0
- package/dist/pptx/render/ribbon-galleries/smartart-style-3d-preview.d.ts +4 -0
- package/dist/pptx/render/ribbon-galleries/smartart-style-3d-preview.d.ts.map +1 -0
- package/dist/pptx/render/ribbon-galleries/smartart-styles-gallery.d.ts +0 -11
- package/dist/pptx/render/ribbon-galleries/smartart-styles-gallery.d.ts.map +1 -1
- package/dist/pptx/render/ribbon-tab-row.d.ts +61 -0
- package/dist/pptx/render/ribbon-tab-row.d.ts.map +1 -0
- package/dist/pptx/render/slide-background-fill.d.ts +49 -0
- package/dist/pptx/render/slide-background-fill.d.ts.map +1 -0
- package/dist/pptx/render/slide-background.d.ts +3 -2
- package/dist/pptx/render/slide-background.d.ts.map +1 -1
- package/dist/pptx/render/smartart-3d-scene-camera.d.ts +13 -43
- package/dist/pptx/render/smartart-3d-scene-camera.d.ts.map +1 -1
- package/dist/pptx/render/visual-3d-camera-presets.d.ts +3 -33
- package/dist/pptx/render/visual-3d-camera-presets.d.ts.map +1 -1
- package/dist/pptx/render/zoom-to-selection.d.ts +41 -0
- package/dist/pptx/render/zoom-to-selection.d.ts.map +1 -0
- package/dist/pptx/{smartart-insert-preview-DF6KSG3D.mjs → smartart-insert-preview-D2WJBY2M.mjs} +7 -7
- package/dist/pptx/{smartart-insert-preview-BYPU325G.cjs → smartart-insert-preview-WI2O6X6C.cjs} +8 -8
- package/dist/pptx/{view-scene-GHBN7QMR.mjs → view-scene-DZCPZTE4.mjs} +1 -1
- package/dist/pptx/{view-scene-4ZFUCP6S.cjs → view-scene-HMOCSMJM.cjs} +8 -8
- package/dist/pptx/web-components/index.d.ts +2 -0
- package/dist/pptx/web-components/index.d.ts.map +1 -1
- package/dist/pptx/web-components/office-token-bridge.d.ts +1 -1
- package/dist/pptx/web-components/office-token-bridge.d.ts.map +1 -1
- package/dist/pptx/web-components/ribbon-tabs-styles.d.ts +8 -0
- package/dist/pptx/web-components/ribbon-tabs-styles.d.ts.map +1 -0
- package/dist/pptx/web-components/ribbon-tabs.d.ts +25 -0
- package/dist/pptx/web-components/ribbon-tabs.d.ts.map +1 -0
- package/dist/presence/presence.d.ts +2 -1
- package/dist/presence.d.ts +1 -0
- package/dist/recovery-scheduler.d.ts +1 -0
- package/dist/render-cache.d.ts +1 -0
- package/dist/ribbon/auto-collapse.d.ts +1 -0
- package/dist/ribbon/button.d.ts +2 -1
- package/dist/ribbon/color-preview.d.ts +1 -0
- package/dist/ribbon/gallery-styles.d.ts +1 -0
- package/dist/ribbon/gallery.d.ts +2 -1
- package/dist/ribbon/group-overflow.d.ts +1 -0
- package/dist/ribbon/keytip-run.d.ts +1 -0
- package/dist/ribbon/overflow.d.ts +1 -0
- package/dist/ribbon/ribbon-group.d.ts +2 -1
- package/dist/ribbon/ribbon-stack.d.ts +2 -1
- package/dist/ribbon/ribbon-tabs.d.ts +23 -0
- package/dist/ribbon/ribbon-tabs.d.ts.map +1 -1
- package/dist/ribbon/ribbon-toggle.d.ts +2 -1
- package/dist/ribbon/safe-svg.d.ts +1 -0
- package/dist/ribbon/scroll-more.d.ts +1 -0
- package/dist/ribbon/svg-preview.d.ts +1 -0
- package/dist/smartart/definition-tiles.d.ts +21 -0
- package/dist/smartart/definition-tiles.d.ts.map +1 -0
- package/dist/smartart/galleries.d.ts +12 -9
- package/dist/smartart/smartart-3d.d.ts +39 -0
- package/dist/smartart/smartart-picker.d.ts +2 -1
- package/dist/smartart/smartart-svg.d.ts +8 -1
- package/dist/smartart/smartart-text-pane-tools.d.ts +1 -0
- package/dist/smartart/smartart-text-pane.d.ts +2 -1
- package/dist/smartart.d.ts +1 -0
- package/dist/smartart.js +1 -1
- package/dist/styles.d.ts +1 -0
- package/dist/teams.js +3 -3
- package/dist/theme.d.ts +1 -0
- package/dist/visio.js +12 -7
- package/dist/xlsx/chart-format-source.d.ts +6 -3
- package/dist/xlsx.js +109 -36
- package/package.json +9 -9
|
@@ -2,7 +2,7 @@ import { parseSvgPreview } from './chunk-FN7IF6M6.js';
|
|
|
2
2
|
import { OfficeElement, controlStyles, definer } from './chunk-4W4QZF4C.js';
|
|
3
3
|
import { html, nothing } from 'lit';
|
|
4
4
|
import { hexToRgbChannels } from 'ooxml-core/color';
|
|
5
|
-
import { resolveDrawingColor, buildRectPathGradientSvg,
|
|
5
|
+
import { resolveDiagramSceneCamera, projectDiagramScenePoint, resolveDrawingColor, buildRectPathGradientSvg, diagramShape3dView, appliedDiagramNativeId, DIAGRAM_NATIVE_COLOR_SECTIONS, DIAGRAM_NATIVE_COLOR_ENTRIES, DIAGRAM_NATIVE_STYLE_SECTIONS, DIAGRAM_NATIVE_STYLE_ENTRIES, diagramDesignEdit, diagramNodeOutline } from 'ooxml-core/diagram';
|
|
6
6
|
import { evaluatePresetShape, pictureFillCounterTransform, imageRectFromCrop, pictureTileGeometry } from 'ooxml-core/geometry';
|
|
7
7
|
import { drawingPathData, resolveDrawingOuterShadow, pictureLuminanceTransfer, applyPictureHslPixels, resolveDrawingColor as resolveDrawingColor$1, buildImageLuminanceTransfer } from 'ooxml-core/drawingml';
|
|
8
8
|
import { wrapStyledRuns, getSubstituteFontFamily, designTextWidthEm } from 'ooxml-core/text';
|
|
@@ -324,8 +324,8 @@ function standardPictureFilter(doc, effect, scheme = {}, prefix = "picture") {
|
|
|
324
324
|
const value = effect.values ?? {};
|
|
325
325
|
const colors = effect.colors?.map((color) => {
|
|
326
326
|
const resolved = resolveDrawingColor$1(color, { scheme: (name) => scheme[name] });
|
|
327
|
-
const
|
|
328
|
-
return
|
|
327
|
+
const rgb2 = resolved ? hexToRgbChannels(resolved.hex) : void 0;
|
|
328
|
+
return rgb2 && resolved ? { r: rgb2.r / 255, g: rgb2.g / 255, b: rgb2.b / 255, a: resolved.alpha } : void 0;
|
|
329
329
|
});
|
|
330
330
|
switch (effect.name) {
|
|
331
331
|
case "alphaInv":
|
|
@@ -603,9 +603,9 @@ function probePicturePixels(doc, url, effects, scheme = {}) {
|
|
|
603
603
|
if (cached) return Promise.resolve(cached);
|
|
604
604
|
const running = pending.get(key);
|
|
605
605
|
if (running) return running;
|
|
606
|
-
const load = (source) => new Promise((
|
|
606
|
+
const load = (source) => new Promise((resolve2, reject) => {
|
|
607
607
|
const image = doc.createElement("img");
|
|
608
|
-
image.onload = () =>
|
|
608
|
+
image.onload = () => resolve2(image);
|
|
609
609
|
image.onerror = () => reject(new Error("Picture decode failed"));
|
|
610
610
|
image.src = source;
|
|
611
611
|
});
|
|
@@ -699,17 +699,17 @@ function probeNativeImageSize(src) {
|
|
|
699
699
|
}
|
|
700
700
|
const rememberPending = pendingProbes.size < CACHE_MAX;
|
|
701
701
|
const epoch = cacheEpoch;
|
|
702
|
-
const probe = new Promise((
|
|
702
|
+
const probe = new Promise((resolve2) => {
|
|
703
703
|
if (typeof Image === "undefined") {
|
|
704
|
-
|
|
704
|
+
resolve2(void 0);
|
|
705
705
|
return;
|
|
706
706
|
}
|
|
707
707
|
const img = new Image();
|
|
708
708
|
img.onload = () => {
|
|
709
709
|
const size = { width: img.naturalWidth, height: img.naturalHeight };
|
|
710
|
-
|
|
710
|
+
resolve2(size.width > 0 && size.height > 0 ? size : void 0);
|
|
711
711
|
};
|
|
712
|
-
img.onerror = () =>
|
|
712
|
+
img.onerror = () => resolve2(void 0);
|
|
713
713
|
img.src = src;
|
|
714
714
|
}).then((size) => {
|
|
715
715
|
if (pendingProbes.get(src) === probe) pendingProbes.delete(src);
|
|
@@ -788,13 +788,13 @@ function picturePaint(doc, defs, fill, media, context = { width: 1, height: 1 })
|
|
|
788
788
|
pattern.dataset.unapplied = "tile-image-size";
|
|
789
789
|
return;
|
|
790
790
|
}
|
|
791
|
-
const
|
|
791
|
+
const tile2 = fill.layout.tile;
|
|
792
792
|
const cell = pictureTileGeometry(
|
|
793
793
|
context,
|
|
794
794
|
// Office scales the uncropped bitmap to set the tile period; srcRect
|
|
795
795
|
// expands its image inside that fixed cell (native PowerPoint probe).
|
|
796
796
|
size2,
|
|
797
|
-
|
|
797
|
+
tile2,
|
|
798
798
|
fill.layout?.dpi
|
|
799
799
|
);
|
|
800
800
|
if (!cell) {
|
|
@@ -875,7 +875,7 @@ function picturePaint(doc, defs, fill, media, context = { width: 1, height: 1 })
|
|
|
875
875
|
}
|
|
876
876
|
|
|
877
877
|
// src/smartart/smartart-picture.ts
|
|
878
|
-
function diagramPictureFill(doc, defs, fill, part,
|
|
878
|
+
function diagramPictureFill(doc, defs, fill, part, resolve2, report, context) {
|
|
879
879
|
const fail = (reason) => {
|
|
880
880
|
const key = `picture:${reason}`;
|
|
881
881
|
if (!report.approximatedFills.includes(key)) report.approximatedFills.push(key);
|
|
@@ -883,8 +883,8 @@ function diagramPictureFill(doc, defs, fill, part, resolve, report, context) {
|
|
|
883
883
|
};
|
|
884
884
|
if (fill.unsupportedPicture?.length) return fail(fill.unsupportedPicture.join(","));
|
|
885
885
|
if (fill.linkRelId && !fill.relId) return fail("external");
|
|
886
|
-
if (!part || !
|
|
887
|
-
const url =
|
|
886
|
+
if (!part || !resolve2) return fail("unresolved");
|
|
887
|
+
const url = resolve2(part);
|
|
888
888
|
if (!url) return fail("missing-media");
|
|
889
889
|
const effects = picturePaint(doc, defs, fill, url, context);
|
|
890
890
|
if (effects.unapplied.length)
|
|
@@ -1126,10 +1126,176 @@ function diagramEffects(doc, defs, body, shape, scheme, report) {
|
|
|
1126
1126
|
body.setAttribute("filter", `url(#${filter.id})`);
|
|
1127
1127
|
}
|
|
1128
1128
|
}
|
|
1129
|
+
var NS8 = "http://www.w3.org/2000/svg";
|
|
1130
|
+
var EMU_PER_PX = 9525;
|
|
1131
|
+
var DEFAULT_BEVEL_EMU = 76200;
|
|
1132
|
+
var DEPTH_STEPS = 6;
|
|
1133
|
+
var serial5 = 0;
|
|
1134
|
+
var AZIMUTH = {
|
|
1135
|
+
t: 270,
|
|
1136
|
+
tr: 315,
|
|
1137
|
+
r: 0,
|
|
1138
|
+
br: 45,
|
|
1139
|
+
b: 90,
|
|
1140
|
+
bl: 135,
|
|
1141
|
+
l: 180,
|
|
1142
|
+
tl: 225
|
|
1143
|
+
};
|
|
1144
|
+
var SPECULAR = {
|
|
1145
|
+
metal: 1.4,
|
|
1146
|
+
softmetal: 1.1,
|
|
1147
|
+
clear: 1.2,
|
|
1148
|
+
plastic: 1,
|
|
1149
|
+
warmMatte: 0.55,
|
|
1150
|
+
matte: 0.45,
|
|
1151
|
+
powder: 0.35,
|
|
1152
|
+
translucentPowder: 0.35,
|
|
1153
|
+
softEdge: 0.7,
|
|
1154
|
+
dkEdge: 0.8,
|
|
1155
|
+
flat: 0
|
|
1156
|
+
};
|
|
1157
|
+
function projectedPlacement(camera, centre, frame, z = 0) {
|
|
1158
|
+
const w = frame.width > 0 ? frame.width : 1;
|
|
1159
|
+
const h = frame.height > 0 ? frame.height : 1;
|
|
1160
|
+
const origin = projectDiagramScenePoint(camera, centre, { x: frame.x, y: frame.y, z });
|
|
1161
|
+
const right = projectDiagramScenePoint(camera, centre, { x: frame.x + w, y: frame.y, z });
|
|
1162
|
+
const down = projectDiagramScenePoint(camera, centre, { x: frame.x, y: frame.y + h, z });
|
|
1163
|
+
const values = [
|
|
1164
|
+
(right.x - origin.x) / w,
|
|
1165
|
+
(right.y - origin.y) / w,
|
|
1166
|
+
(down.x - origin.x) / h,
|
|
1167
|
+
(down.y - origin.y) / h,
|
|
1168
|
+
origin.x,
|
|
1169
|
+
origin.y
|
|
1170
|
+
];
|
|
1171
|
+
return values.map((value) => Number(value.toFixed(4)));
|
|
1172
|
+
}
|
|
1173
|
+
function bevelFilter(doc, defs, widthPx, heightPx, direction, material) {
|
|
1174
|
+
const specular = SPECULAR[material ?? ""] ?? 0.8;
|
|
1175
|
+
if (specular <= 0) return void 0;
|
|
1176
|
+
const filter = doc.createElementNS(NS8, "filter");
|
|
1177
|
+
filter.id = `office-smartart-bevel-${++serial5}`;
|
|
1178
|
+
filter.setAttribute("color-interpolation-filters", "sRGB");
|
|
1179
|
+
const blur = doc.createElementNS(NS8, "feGaussianBlur");
|
|
1180
|
+
blur.setAttribute("in", "SourceAlpha");
|
|
1181
|
+
blur.setAttribute("stdDeviation", String(Math.max(0.5, widthPx / 2)));
|
|
1182
|
+
blur.setAttribute("result", "bump");
|
|
1183
|
+
const light = doc.createElementNS(NS8, "feSpecularLighting");
|
|
1184
|
+
light.setAttribute("in", "bump");
|
|
1185
|
+
light.setAttribute("surfaceScale", String(Math.min(10, Math.max(1, heightPx / widthPx * 4))));
|
|
1186
|
+
light.setAttribute("specularConstant", String(specular));
|
|
1187
|
+
light.setAttribute("specularExponent", "18");
|
|
1188
|
+
light.setAttribute("lighting-color", "#ffffff");
|
|
1189
|
+
light.setAttribute("result", "highlight");
|
|
1190
|
+
const source = doc.createElementNS(NS8, "feDistantLight");
|
|
1191
|
+
source.setAttribute("azimuth", String(AZIMUTH[direction] ?? 270));
|
|
1192
|
+
source.setAttribute("elevation", "40");
|
|
1193
|
+
light.append(source);
|
|
1194
|
+
const clip = doc.createElementNS(NS8, "feComposite");
|
|
1195
|
+
clip.setAttribute("in", "highlight");
|
|
1196
|
+
clip.setAttribute("in2", "SourceAlpha");
|
|
1197
|
+
clip.setAttribute("operator", "in");
|
|
1198
|
+
clip.setAttribute("result", "lit");
|
|
1199
|
+
const merge = doc.createElementNS(NS8, "feComposite");
|
|
1200
|
+
merge.setAttribute("in", "SourceGraphic");
|
|
1201
|
+
merge.setAttribute("in2", "lit");
|
|
1202
|
+
merge.setAttribute("operator", "arithmetic");
|
|
1203
|
+
merge.setAttribute("k1", "0");
|
|
1204
|
+
merge.setAttribute("k2", "1");
|
|
1205
|
+
merge.setAttribute("k3", "0.6");
|
|
1206
|
+
merge.setAttribute("k4", "0");
|
|
1207
|
+
filter.append(blur, light, clip, merge);
|
|
1208
|
+
defs.append(filter);
|
|
1209
|
+
return `url(#${filter.id})`;
|
|
1210
|
+
}
|
|
1211
|
+
function depthOffset(shape, scene, placement, depthPx) {
|
|
1212
|
+
const w = shape.frame.width / EMU_PER_PX;
|
|
1213
|
+
const h = shape.frame.height / EMU_PER_PX;
|
|
1214
|
+
let dx;
|
|
1215
|
+
let dy;
|
|
1216
|
+
if (placement) {
|
|
1217
|
+
const centre = { x: shape.frame.x / EMU_PER_PX + w / 2, y: shape.frame.y / EMU_PER_PX + h / 2 };
|
|
1218
|
+
const face = projectDiagramScenePoint(placement.camera, placement.centre, { ...centre, z: 0 });
|
|
1219
|
+
const back = projectDiagramScenePoint(placement.camera, placement.centre, {
|
|
1220
|
+
...centre,
|
|
1221
|
+
z: -depthPx
|
|
1222
|
+
});
|
|
1223
|
+
const [a = 1, b = 0, c = 0, d = 1] = placement.matrix;
|
|
1224
|
+
const det = a * d - b * c;
|
|
1225
|
+
if (Math.abs(det) < 1e-6) return void 0;
|
|
1226
|
+
const sx = back.x - face.x;
|
|
1227
|
+
const sy = back.y - face.y;
|
|
1228
|
+
dx = (d * sx - c * sy) / det;
|
|
1229
|
+
dy = (-b * sx + a * sy) / det;
|
|
1230
|
+
} else {
|
|
1231
|
+
const camera = resolveDiagramSceneCamera(scene);
|
|
1232
|
+
if (!camera) return void 0;
|
|
1233
|
+
const centre = { x: w / 2, y: h / 2 };
|
|
1234
|
+
const face = projectDiagramScenePoint(camera, centre, { ...centre, z: 0 });
|
|
1235
|
+
const back = projectDiagramScenePoint(camera, centre, { ...centre, z: -depthPx });
|
|
1236
|
+
dx = back.x - face.x;
|
|
1237
|
+
dy = back.y - face.y;
|
|
1238
|
+
}
|
|
1239
|
+
return Math.hypot(dx, dy) > 0.25 ? { dx, dy } : void 0;
|
|
1240
|
+
}
|
|
1241
|
+
function paintDiagramShape3d(doc, defs, group, body, shape, placement) {
|
|
1242
|
+
const view = diagramShape3dView(shape);
|
|
1243
|
+
if (!view) return Boolean(placement);
|
|
1244
|
+
const solid = view.shape;
|
|
1245
|
+
let painted = Boolean(placement);
|
|
1246
|
+
const depthPx = (solid?.extrusionHeight ?? 0) / EMU_PER_PX;
|
|
1247
|
+
const offset = depthPx > 0 ? depthOffset(shape, view.scene, placement, depthPx) : void 0;
|
|
1248
|
+
if (offset) {
|
|
1249
|
+
const { dx, dy } = offset;
|
|
1250
|
+
const side = doc.createElementNS(NS8, "g");
|
|
1251
|
+
side.dataset.extrusion = "";
|
|
1252
|
+
for (let step = DEPTH_STEPS; step >= 1; step--) {
|
|
1253
|
+
const copy = body.cloneNode(false);
|
|
1254
|
+
copy.removeAttribute("filter");
|
|
1255
|
+
copy.setAttribute(
|
|
1256
|
+
"transform",
|
|
1257
|
+
`translate(${(dx * step / DEPTH_STEPS).toFixed(2)} ${(dy * step / DEPTH_STEPS).toFixed(2)})`
|
|
1258
|
+
);
|
|
1259
|
+
side.append(copy);
|
|
1260
|
+
}
|
|
1261
|
+
const shade = body.cloneNode(false);
|
|
1262
|
+
shade.removeAttribute("filter");
|
|
1263
|
+
shade.setAttribute("transform", `translate(${(dx / 2).toFixed(2)} ${(dy / 2).toFixed(2)})`);
|
|
1264
|
+
shade.setAttribute("fill", "#000000");
|
|
1265
|
+
shade.setAttribute("fill-opacity", "0.35");
|
|
1266
|
+
shade.setAttribute("stroke", "none");
|
|
1267
|
+
side.append(shade);
|
|
1268
|
+
group.insertBefore(side, body);
|
|
1269
|
+
painted = true;
|
|
1270
|
+
}
|
|
1271
|
+
const bevel = solid && (solid.bevelTopType !== void 0 || solid.bevelTopWidth || solid.bevelTopHeight) && solid.bevelTopType !== "none";
|
|
1272
|
+
if (bevel) {
|
|
1273
|
+
const width = (solid.bevelTopWidth ?? DEFAULT_BEVEL_EMU) / EMU_PER_PX;
|
|
1274
|
+
const height = (solid.bevelTopHeight ?? DEFAULT_BEVEL_EMU) / EMU_PER_PX;
|
|
1275
|
+
const half = Math.min(shape.frame.width, shape.frame.height) / EMU_PER_PX / 2;
|
|
1276
|
+
const filter = bevelFilter(
|
|
1277
|
+
doc,
|
|
1278
|
+
defs,
|
|
1279
|
+
Math.max(0.5, Math.min(width, half * 0.9)),
|
|
1280
|
+
Math.max(0.5, height),
|
|
1281
|
+
view.scene?.lightRigDirection ?? "t",
|
|
1282
|
+
solid.presetMaterial
|
|
1283
|
+
);
|
|
1284
|
+
if (filter) {
|
|
1285
|
+
const wrap = doc.createElementNS(NS8, "g");
|
|
1286
|
+
wrap.setAttribute("filter", filter);
|
|
1287
|
+
wrap.dataset.bevel = solid.bevelTopType ?? "circle";
|
|
1288
|
+
group.replaceChild(wrap, body);
|
|
1289
|
+
wrap.append(body);
|
|
1290
|
+
}
|
|
1291
|
+
painted = true;
|
|
1292
|
+
}
|
|
1293
|
+
return painted || Boolean(solid?.presetMaterial);
|
|
1294
|
+
}
|
|
1129
1295
|
|
|
1130
1296
|
// src/smartart/smartart-svg.ts
|
|
1131
1297
|
var SVG_NS2 = "http://www.w3.org/2000/svg";
|
|
1132
|
-
var
|
|
1298
|
+
var EMU_PER_PX2 = 9525;
|
|
1133
1299
|
function colorToCss(color, scheme, report) {
|
|
1134
1300
|
if (!color) return void 0;
|
|
1135
1301
|
const resolved = resolveDrawingColor(color, { scheme: (name) => scheme[name] });
|
|
@@ -1140,14 +1306,23 @@ function colorToCss(color, scheme, report) {
|
|
|
1140
1306
|
];
|
|
1141
1307
|
if (resolved) {
|
|
1142
1308
|
if (resolved.alpha === 1) return resolved.hex;
|
|
1143
|
-
const
|
|
1144
|
-
return `rgba(${
|
|
1309
|
+
const rgb2 = hexToRgbChannels(resolved.hex);
|
|
1310
|
+
return `rgba(${rgb2.r}, ${rgb2.g}, ${rgb2.b}, ${resolved.alpha})`;
|
|
1145
1311
|
}
|
|
1146
1312
|
if (color.kind === "preset")
|
|
1147
1313
|
return /^[a-z]+$/i.test(color.value) ? color.value.toLowerCase() : "#808080";
|
|
1148
1314
|
if (color.kind === "system" && !color.fallback) return void 0;
|
|
1149
1315
|
return "#9ca3af";
|
|
1150
1316
|
}
|
|
1317
|
+
function diagramExtent(drawing) {
|
|
1318
|
+
let width = 0;
|
|
1319
|
+
let height = 0;
|
|
1320
|
+
for (const { frame } of drawing.shapes) {
|
|
1321
|
+
width = Math.max(width, frame.x + frame.width);
|
|
1322
|
+
height = Math.max(height, frame.y + frame.height);
|
|
1323
|
+
}
|
|
1324
|
+
return { width, height };
|
|
1325
|
+
}
|
|
1151
1326
|
function renderDiagramDrawing(doc, drawing, scheme = {}, fonts = {}, resolvePicture) {
|
|
1152
1327
|
const report = {
|
|
1153
1328
|
shapeCount: drawing.shapes.length,
|
|
@@ -1160,17 +1335,33 @@ function renderDiagramDrawing(doc, drawing, scheme = {}, fonts = {}, resolvePict
|
|
|
1160
1335
|
svg.append(defs);
|
|
1161
1336
|
let right = 0;
|
|
1162
1337
|
let bottom = 0;
|
|
1338
|
+
const camera = resolveDiagramSceneCamera(drawing.scene3d);
|
|
1339
|
+
const extent = drawing.extentEmu ?? diagramExtent(drawing);
|
|
1340
|
+
const centre = { x: extent.width / EMU_PER_PX2 / 2, y: extent.height / EMU_PER_PX2 / 2 };
|
|
1341
|
+
if (camera) report.camera = drawing.scene3d?.cameraPreset ?? "rotation";
|
|
1163
1342
|
for (const shape of drawing.shapes) {
|
|
1164
1343
|
const { frame } = shape;
|
|
1165
|
-
right = Math.max(right, (frame.x + frame.width) /
|
|
1166
|
-
bottom = Math.max(bottom, (frame.y + frame.height) /
|
|
1344
|
+
right = Math.max(right, (frame.x + frame.width) / EMU_PER_PX2);
|
|
1345
|
+
bottom = Math.max(bottom, (frame.y + frame.height) / EMU_PER_PX2);
|
|
1167
1346
|
const group = doc.createElementNS(SVG_NS2, "g");
|
|
1168
1347
|
group.dataset.modelId = shape.modelId;
|
|
1169
|
-
const cx = frame.width /
|
|
1170
|
-
const cy = frame.height /
|
|
1348
|
+
const cx = frame.width / EMU_PER_PX2 / 2;
|
|
1349
|
+
const cy = frame.height / EMU_PER_PX2 / 2;
|
|
1171
1350
|
const fx = shape.flipHorizontal ? -1 : 1;
|
|
1172
1351
|
const fy = shape.flipVertical ? -1 : 1;
|
|
1173
|
-
const
|
|
1352
|
+
const placement = camera ? {
|
|
1353
|
+
camera,
|
|
1354
|
+
centre,
|
|
1355
|
+
matrix: projectedPlacement(camera, centre, {
|
|
1356
|
+
x: frame.x / EMU_PER_PX2,
|
|
1357
|
+
y: frame.y / EMU_PER_PX2,
|
|
1358
|
+
width: frame.width / EMU_PER_PX2,
|
|
1359
|
+
height: frame.height / EMU_PER_PX2
|
|
1360
|
+
})
|
|
1361
|
+
} : void 0;
|
|
1362
|
+
const transform = [
|
|
1363
|
+
placement ? `matrix(${placement.matrix.join(" ")})` : `translate(${frame.x / EMU_PER_PX2} ${frame.y / EMU_PER_PX2})`
|
|
1364
|
+
];
|
|
1174
1365
|
if (shape.rotation) transform.push(`rotate(${shape.rotation} ${cx} ${cy})`);
|
|
1175
1366
|
if (fx !== 1 || fy !== 1) {
|
|
1176
1367
|
transform.push(`translate(${cx} ${cy}) scale(${fx} ${fy}) translate(${-cx} ${-cy})`);
|
|
@@ -1180,8 +1371,8 @@ function renderDiagramDrawing(doc, drawing, scheme = {}, fonts = {}, resolvePict
|
|
|
1180
1371
|
body.setAttribute(
|
|
1181
1372
|
"fill",
|
|
1182
1373
|
diagramFill(doc, defs, shape.fill, scheme, report, drawing.pictureParts, resolvePicture, {
|
|
1183
|
-
width: frame.width /
|
|
1184
|
-
height: frame.height /
|
|
1374
|
+
width: frame.width / EMU_PER_PX2,
|
|
1375
|
+
height: frame.height / EMU_PER_PX2,
|
|
1185
1376
|
...shape.rotation !== void 0 ? { rotation: shape.rotation } : {},
|
|
1186
1377
|
...shape.flipHorizontal ? { flipHorizontal: true } : {},
|
|
1187
1378
|
...shape.flipVertical ? { flipVertical: true } : {}
|
|
@@ -1201,19 +1392,24 @@ function renderDiagramDrawing(doc, drawing, scheme = {}, fonts = {}, resolvePict
|
|
|
1201
1392
|
if (stroke)
|
|
1202
1393
|
body.setAttribute(
|
|
1203
1394
|
"stroke-width",
|
|
1204
|
-
String(Math.max(0.5, (shape.line?.widthEmu ?? 9525) /
|
|
1395
|
+
String(Math.max(0.5, (shape.line?.widthEmu ?? 9525) / EMU_PER_PX2))
|
|
1205
1396
|
);
|
|
1206
1397
|
group.append(body);
|
|
1207
|
-
if (shape.has3d) {
|
|
1208
|
-
|
|
1209
|
-
|
|
1398
|
+
if (shape.has3d || placement) {
|
|
1399
|
+
if (paintDiagramShape3d(doc, defs, group, body, shape, placement)) {
|
|
1400
|
+
report.approximated3d = (report.approximated3d ?? 0) + 1;
|
|
1401
|
+
group.setAttribute("data-approximated-3d", "");
|
|
1402
|
+
} else {
|
|
1403
|
+
report.flattened3d += 1;
|
|
1404
|
+
group.setAttribute("data-flattened-3d", "");
|
|
1405
|
+
}
|
|
1210
1406
|
}
|
|
1211
1407
|
if (shape.text?.text) group.append(diagramTextElement(doc, shape, scheme, fonts, report));
|
|
1212
1408
|
svg.append(group);
|
|
1213
1409
|
}
|
|
1214
1410
|
svg.setAttribute(
|
|
1215
1411
|
"viewBox",
|
|
1216
|
-
`0 0 ${Math.max(drawing.extentEmu ? drawing.extentEmu.width /
|
|
1412
|
+
`0 0 ${Math.max(drawing.extentEmu ? drawing.extentEmu.width / EMU_PER_PX2 : right, 1)} ${Math.max(drawing.extentEmu ? drawing.extentEmu.height / EMU_PER_PX2 : bottom, 1)}`
|
|
1217
1413
|
);
|
|
1218
1414
|
svg.setAttribute("overflow", "visible");
|
|
1219
1415
|
return { svg, report };
|
|
@@ -1543,15 +1739,15 @@ var OfficeUiSmartArtPicker = class extends OfficeElement {
|
|
|
1543
1739
|
if (!layout) return;
|
|
1544
1740
|
event.preventDefault();
|
|
1545
1741
|
this.pick(layout);
|
|
1546
|
-
[...this.renderRoot.querySelectorAll("[data-layout]")].find((
|
|
1742
|
+
[...this.renderRoot.querySelectorAll("[data-layout]")].find((tile2) => tile2.dataset.layout === layout.id)?.focus();
|
|
1547
1743
|
}
|
|
1548
|
-
preview(layout,
|
|
1549
|
-
const key = `${
|
|
1744
|
+
preview(layout, tile2) {
|
|
1745
|
+
const key = `${tile2 ? "t" : "p"}:${layout.id}`;
|
|
1550
1746
|
if (this.previews.has(key)) return this.previews.get(key) ?? null;
|
|
1551
|
-
const size =
|
|
1747
|
+
const size = tile2 ? TILE : PREVIEW;
|
|
1552
1748
|
let drawn;
|
|
1553
1749
|
try {
|
|
1554
|
-
drawn = this.draw?.(layout, size,
|
|
1750
|
+
drawn = this.draw?.(layout, size, tile2);
|
|
1555
1751
|
} catch {
|
|
1556
1752
|
drawn = void 0;
|
|
1557
1753
|
}
|
|
@@ -1860,49 +2056,154 @@ var defineSmartArtTextPane = definer(
|
|
|
1860
2056
|
"office-ui-smartart-text-pane",
|
|
1861
2057
|
() => OfficeUiSmartArtTextPane
|
|
1862
2058
|
);
|
|
2059
|
+
|
|
2060
|
+
// src/smartart/definition-tiles.ts
|
|
2061
|
+
var DEFAULTS = {
|
|
2062
|
+
dk1: "#000000",
|
|
2063
|
+
lt1: "#FFFFFF",
|
|
2064
|
+
dk2: "#44546A",
|
|
2065
|
+
lt2: "#E7E6E6",
|
|
2066
|
+
accent1: "#4472C4",
|
|
2067
|
+
accent2: "#ED7D31",
|
|
2068
|
+
accent3: "#A5A5A5",
|
|
2069
|
+
accent4: "#FFC000",
|
|
2070
|
+
accent5: "#5B9BD5",
|
|
2071
|
+
accent6: "#70AD47"
|
|
2072
|
+
};
|
|
2073
|
+
var round2 = (value) => String(Math.round(value * 100) / 100);
|
|
2074
|
+
function rgb(color) {
|
|
2075
|
+
const hex2 = color.replace("#", "");
|
|
2076
|
+
const full = hex2.length === 3 ? [...hex2].map((c) => c + c).join("") : hex2.slice(0, 6);
|
|
2077
|
+
const value = Number.parseInt(full, 16);
|
|
2078
|
+
return Number.isNaN(value) ? [68, 114, 196] : [value >> 16, value >> 8 & 255, value & 255];
|
|
2079
|
+
}
|
|
2080
|
+
var hex = (channels) => `#${channels.map(
|
|
2081
|
+
(c) => Math.round(Math.min(255, Math.max(0, c))).toString(16).padStart(2, "0")
|
|
2082
|
+
).join("")}`;
|
|
2083
|
+
function toned(color, tone = 0) {
|
|
2084
|
+
const channels = rgb(color);
|
|
2085
|
+
return hex(channels.map((c) => tone < 0 ? c * (1 + tone) : c + (255 - c) * tone));
|
|
2086
|
+
}
|
|
2087
|
+
function mix(a, b, t) {
|
|
2088
|
+
const [x, y] = [rgb(a), rgb(b)];
|
|
2089
|
+
return hex(x.map((c, i) => c + ((y[i] ?? c) - c) * t));
|
|
2090
|
+
}
|
|
2091
|
+
var resolve = (theme, name) => safeColor(theme[name] ?? DEFAULTS[name], DEFAULTS.accent1);
|
|
2092
|
+
function smartArtDefinitionFills(entry, theme, count = 3) {
|
|
2093
|
+
const { fills, tones, mode } = entry.preview;
|
|
2094
|
+
const colors = fills.map((name, i) => toned(resolve(theme, name), tones?.[i]));
|
|
2095
|
+
if (!colors.length) return [resolve(theme, "accent1")];
|
|
2096
|
+
return Array.from({ length: Math.max(1, count) }, (_, i) => {
|
|
2097
|
+
if (mode === "span" && colors.length > 1) {
|
|
2098
|
+
const at = (count > 1 ? i / (count - 1) : 0) * (colors.length - 1);
|
|
2099
|
+
const low = Math.floor(at);
|
|
2100
|
+
return mix(colors[low], colors[Math.min(low + 1, colors.length - 1)], at - low);
|
|
2101
|
+
}
|
|
2102
|
+
return mode === "cycle" ? colors[i % colors.length] : colors[Math.min(i, colors.length - 1)];
|
|
2103
|
+
});
|
|
2104
|
+
}
|
|
2105
|
+
function tile(id, look, size) {
|
|
2106
|
+
const safeId = `sad-${id}`.replace(/[^\w-]/gu, "_");
|
|
2107
|
+
const pad = 4;
|
|
2108
|
+
const gap = 4;
|
|
2109
|
+
const w = (size.width - pad * 2 - gap * 2) / 3;
|
|
2110
|
+
const h = size.height * 0.46;
|
|
2111
|
+
const y = (size.height - h) / 2;
|
|
2112
|
+
let defs = "";
|
|
2113
|
+
let filter = "";
|
|
2114
|
+
if (look.effect > 0) {
|
|
2115
|
+
const k = Math.min(look.effect, 3);
|
|
2116
|
+
defs += `<filter id="${safeId}-s" x="-30%" y="-30%" width="160%" height="170%"><feDropShadow dx="0" dy="${round2(0.5 * k)}" stdDeviation="${round2(0.4 * k)}" flood-color="#000000" flood-opacity="${round2(0.15 + 0.1 * k)}"/></filter>`;
|
|
2117
|
+
filter = ` filter="url(#${safeId}-s)"`;
|
|
2118
|
+
}
|
|
2119
|
+
if (look.bevel)
|
|
2120
|
+
defs += `<linearGradient id="${safeId}-b" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#FFFFFF" stop-opacity="0.45"/><stop offset="0.5" stop-color="#FFFFFF" stop-opacity="0"/><stop offset="1" stop-color="#000000" stop-opacity="0.2"/></linearGradient>`;
|
|
2121
|
+
const boxes = [0, 1, 2].map((i) => {
|
|
2122
|
+
const x = pad + i * (w + gap);
|
|
2123
|
+
const fill = safeColor(look.fills[i % look.fills.length], DEFAULTS.accent1);
|
|
2124
|
+
const attrs = `x="${round2(x)}" y="${round2(y)}" width="${round2(w)}" height="${round2(h)}" rx="${round2(Math.min(w, h) * 0.12)}"`;
|
|
2125
|
+
const body = `<rect ${attrs} fill="${fill}" fill-opacity="${round2(look.opacity)}" stroke="${safeColor(look.line, "#FFFFFF")}" stroke-width="${round2(look.lineWidth)}"${filter}/>`;
|
|
2126
|
+
return look.bevel ? `${body}<rect ${attrs} fill="url(#${safeId}-b)"/>` : body;
|
|
2127
|
+
});
|
|
2128
|
+
const group = look.spatial ? `<g transform="translate(0 ${round2(size.height * 0.08)}) skewY(-6)">${boxes.join("")}</g>` : boxes.join("");
|
|
2129
|
+
const bg = `<rect x="0" y="0" width="${size.width}" height="${size.height}" fill="#FFFFFF"/>`;
|
|
2130
|
+
return svgTile(size.width, size.height, defs, bg + group);
|
|
2131
|
+
}
|
|
2132
|
+
function smartArtColorDefinitionTileSvg(entry, theme, size) {
|
|
2133
|
+
const line2 = resolve(theme, entry.preview.line);
|
|
2134
|
+
const outlined = entry.preview.line !== "lt1";
|
|
2135
|
+
return tile(
|
|
2136
|
+
entry.id,
|
|
2137
|
+
{
|
|
2138
|
+
fills: smartArtDefinitionFills(entry, theme),
|
|
2139
|
+
line: line2,
|
|
2140
|
+
lineWidth: outlined ? 1.5 : 0.75,
|
|
2141
|
+
opacity: entry.preview.transparent ? 0.6 : 1,
|
|
2142
|
+
effect: 0,
|
|
2143
|
+
bevel: false,
|
|
2144
|
+
spatial: false
|
|
2145
|
+
},
|
|
2146
|
+
size
|
|
2147
|
+
);
|
|
2148
|
+
}
|
|
2149
|
+
function smartArtStyleDefinitionTileSvg(entry, accent, size) {
|
|
2150
|
+
const { line: line2, effect, bevel, camera } = entry.preview;
|
|
2151
|
+
return tile(
|
|
2152
|
+
entry.id,
|
|
2153
|
+
{
|
|
2154
|
+
fills: [safeColor(accent, DEFAULTS.accent1)],
|
|
2155
|
+
line: "#FFFFFF",
|
|
2156
|
+
lineWidth: line2 >= 3 ? 1.75 : line2 > 0 ? 0.75 : 0,
|
|
2157
|
+
opacity: 1,
|
|
2158
|
+
effect,
|
|
2159
|
+
bevel: bevel === true,
|
|
2160
|
+
spatial: camera !== void 0
|
|
2161
|
+
},
|
|
2162
|
+
size
|
|
2163
|
+
);
|
|
2164
|
+
}
|
|
1863
2165
|
var TILE2 = { width: 56, height: 36 };
|
|
1864
2166
|
var same = (english) => english;
|
|
1865
|
-
function smartArtColorsGalleryState(
|
|
2167
|
+
function smartArtColorsGalleryState(theme, current, t = same) {
|
|
2168
|
+
const applied = appliedDiagramNativeId("colors", current);
|
|
1866
2169
|
return {
|
|
1867
2170
|
id: "smartArtColors",
|
|
1868
2171
|
label: t("Change Colors"),
|
|
1869
|
-
sections:
|
|
2172
|
+
sections: DIAGRAM_NATIVE_COLOR_SECTIONS.map((section) => ({
|
|
1870
2173
|
title: t(section.title),
|
|
1871
2174
|
columns: 5,
|
|
1872
2175
|
tileWidth: TILE2.width,
|
|
1873
2176
|
tileHeight: TILE2.height,
|
|
1874
|
-
items:
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
entry
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
TILE2
|
|
1883
|
-
)
|
|
1884
|
-
}))
|
|
2177
|
+
items: DIAGRAM_NATIVE_COLOR_ENTRIES.filter((entry) => entry.category === section.id).map(
|
|
2178
|
+
(entry) => ({
|
|
2179
|
+
id: entry.id,
|
|
2180
|
+
label: t(entry.name),
|
|
2181
|
+
applied: entry.id === applied,
|
|
2182
|
+
preview: smartArtColorDefinitionTileSvg(entry, theme, TILE2)
|
|
2183
|
+
})
|
|
2184
|
+
)
|
|
1885
2185
|
}))
|
|
1886
2186
|
};
|
|
1887
2187
|
}
|
|
1888
2188
|
function smartArtStylesGalleryState(accent1, current, t = same) {
|
|
2189
|
+
const applied = appliedDiagramNativeId("style", current);
|
|
1889
2190
|
return {
|
|
1890
2191
|
id: "smartArtStyles",
|
|
1891
2192
|
label: t("SmartArt Styles"),
|
|
1892
|
-
sections:
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
2193
|
+
sections: DIAGRAM_NATIVE_STYLE_SECTIONS.map((section) => ({
|
|
2194
|
+
title: t(section.title),
|
|
2195
|
+
columns: 5,
|
|
2196
|
+
tileWidth: TILE2.width,
|
|
2197
|
+
tileHeight: TILE2.height,
|
|
2198
|
+
items: DIAGRAM_NATIVE_STYLE_ENTRIES.filter((entry) => entry.category === section.id).map(
|
|
2199
|
+
(entry) => ({
|
|
1899
2200
|
id: entry.id,
|
|
1900
2201
|
label: t(entry.name),
|
|
1901
|
-
applied: entry.id ===
|
|
1902
|
-
preview:
|
|
1903
|
-
})
|
|
1904
|
-
|
|
1905
|
-
|
|
2202
|
+
applied: entry.id === applied,
|
|
2203
|
+
preview: smartArtStyleDefinitionTileSvg(entry, accent1, TILE2)
|
|
2204
|
+
})
|
|
2205
|
+
)
|
|
2206
|
+
}))
|
|
1906
2207
|
};
|
|
1907
2208
|
}
|
|
1908
2209
|
var SmartArtTextPaneController = class {
|
|
@@ -2036,4 +2337,4 @@ function pictureSvg(doc, fill, url, width, height, context = {}) {
|
|
|
2036
2337
|
return svg;
|
|
2037
2338
|
}
|
|
2038
2339
|
|
|
2039
|
-
export { OfficeUiSmartArt, OfficeUiSmartArtPicker, OfficeUiSmartArtTextPane, SmartArtTextPaneController, cachedPicturePixels, defineSmartArt, defineSmartArtPicker, defineSmartArtTextPane, needsPicturePixels, pictureEffectFilter, pictureNeedsSvg, picturePaint, pictureSvg, probePicturePixels, renderDiagramDrawing, safeColor, smartArtColorsGalleryState, smartArtLayoutTileSvg, smartArtStylesGalleryState, smartArtTileSvg, svgTile };
|
|
2340
|
+
export { OfficeUiSmartArt, OfficeUiSmartArtPicker, OfficeUiSmartArtTextPane, SmartArtTextPaneController, cachedPicturePixels, defineSmartArt, defineSmartArtPicker, defineSmartArtTextPane, needsPicturePixels, pictureEffectFilter, pictureNeedsSvg, picturePaint, pictureSvg, probePicturePixels, renderDiagramDrawing, safeColor, smartArtColorDefinitionTileSvg, smartArtColorsGalleryState, smartArtDefinitionFills, smartArtLayoutTileSvg, smartArtStyleDefinitionTileSvg, smartArtStylesGalleryState, smartArtTileSvg, svgTile };
|