ooxml-ui 1.53.0 → 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 +4 -0
- package/dist/base.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-keys.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-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-fields.d.ts +1 -0
- package/dist/chart/format-pane-fill-kinds.d.ts +5 -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.map +1 -1
- package/dist/chart/format-pane-locales/en.d.ts +1 -0
- package/dist/chart/format-pane-locales/en.d.ts.map +1 -1
- package/dist/chart/format-pane-locales/es.d.ts.map +1 -1
- package/dist/chart/format-pane-locales/fr.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/chart/format-pane-model.d.ts +1 -0
- package/dist/chart/format-pane-options.d.ts +1 -0
- package/dist/chart/format-pane-space.d.ts +10 -4
- package/dist/chart/format-pane-space.d.ts.map +1 -1
- package/dist/chart/format-pane.d.ts +9 -1
- 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/backstage.d.ts +2 -1
- package/dist/chrome/find-bar.d.ts +2 -1
- package/dist/chrome/find-replace-fields.d.ts +1 -0
- package/dist/chrome/format-section.d.ts +2 -1
- package/dist/chrome/ruler.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/tab-strip.d.ts +2 -1
- package/dist/chrome/task-pane.d.ts +2 -1
- package/dist/chrome/title-bar-types.d.ts +1 -0
- package/dist/chrome/title-bar.d.ts +2 -1
- package/dist/{chunk-J36LIYGS.js → chunk-3BNPWXCC.js} +1 -1
- package/dist/{chunk-HUR5JAG7.js → chunk-4JFADIZ6.js} +359 -17
- package/dist/{chunk-Y535PPSZ.js → chunk-54MF25DU.js} +1 -1
- package/dist/{chunk-XQIZWJEV.js → chunk-6SAT2GKV.js} +1 -1
- package/dist/{chunk-NSBQACCO.js → chunk-7F5IZHKM.js} +150 -109
- package/dist/{chunk-X464LPTR.js → chunk-HTB63MJO.js} +210 -14
- package/dist/{chunk-JI4ZNPEK.js → chunk-O3ER66QG.js} +7 -0
- package/dist/{chunk-2EBZ6IV6.js → chunk-UEUP3EMQ.js} +3 -3
- package/dist/comments/comments-pane.d.ts +2 -1
- 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-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/progress-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 +94 -22
- package/dist/export/pdf-image.d.ts +1 -0
- package/dist/export/pdf-path.d.ts +1 -0
- package/dist/export/pdf-svg-gradient.d.ts +1 -0
- package/dist/export/pdf-svg-notes.d.ts +1 -0
- package/dist/export/pdf-text-layer-font.d.ts +1 -0
- package/dist/files/cloud-files-labels.d.ts +1 -0
- package/dist/files/cloud-files-view.d.ts +1 -0
- package/dist/files/connected-services.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/form/checkable.d.ts +1 -0
- 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/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/switch.d.ts +2 -1
- package/dist/form/symbol-picker.d.ts +2 -1
- package/dist/form/zoom-slider.d.ts +2 -1
- package/dist/icon.d.ts +1 -0
- package/dist/image-native-size.d.ts +1 -0
- package/dist/index.js +6 -6
- package/dist/keytips.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-button.d.ts +2 -1
- package/dist/menu/menu-item.d.ts +2 -1
- package/dist/menu/menu-model.d.ts +1 -0
- package/dist/menu/menu-separator.d.ts +2 -1
- package/dist/notices/toasts.d.ts +2 -1
- package/dist/picture-artistic-filters.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-O33ER4AJ.cjs → chunk-3GS5BKST.cjs} +7 -0
- package/dist/pptx/{chunk-STQTJXYQ.cjs → chunk-5BQM5YYS.cjs} +21550 -19868
- 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-OS2SX33G.mjs → chunk-DNXARUCD.mjs} +18865 -17244
- package/dist/pptx/{chunk-75MKMQP5.mjs → chunk-FYNZ6QSV.mjs} +7 -0
- package/dist/pptx/{chunk-5PL3ZZV4.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-TJPRGVT4.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/index.cjs +3987 -3727
- 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 +10 -0
- package/dist/pptx/render/controller/index.d.ts.map +1 -1
- 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/fill-style.d.ts.map +1 -1
- package/dist/pptx/render/index.d.ts +3 -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 +25 -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-fields.d.ts.map +1 -1
- 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-native-entries.d.ts +3 -2
- package/dist/pptx/render/ribbon-galleries/smartart-native-entries.d.ts.map +1 -1
- 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.map +1 -1
- 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-FJFP4JJ5.mjs → smartart-insert-preview-D2WJBY2M.mjs} +7 -7
- package/dist/pptx/{smartart-insert-preview-XNHOSN3T.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/presence/presence.d.ts +2 -1
- package/dist/recovery-scheduler.d.ts +1 -0
- package/dist/render-cache.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-actions.d.ts +2 -1
- package/dist/ribbon/ribbon-section.d.ts +2 -1
- package/dist/ribbon/ribbon-stack.d.ts +2 -1
- package/dist/ribbon/ribbon-tabs.d.ts +2 -1
- package/dist/ribbon/ribbon-toolbar.d.ts +2 -1
- package/dist/ribbon/safe-svg.d.ts +1 -0
- 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.js +1 -1
- package/dist/teams.js +3 -3
- package/dist/theme.d.ts +1 -0
- package/dist/touch-targets.d.ts +1 -0
- package/dist/visio.js +12 -7
- package/dist/xlsx/chart-format-source.d.ts +2 -0
- package/dist/xlsx.js +72 -19
- package/package.json +9 -9
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createIconSvg, paintIcon, getIcon } from './chunk-M6GF5ED2.js';
|
|
2
|
-
import { CHART_FORMAT_STRINGS, CHART_FORMAT_LOCALES } from './chunk-
|
|
2
|
+
import { CHART_FORMAT_STRINGS, CHART_FORMAT_LOCALES } from './chunk-O3ER66QG.js';
|
|
3
3
|
import { initialsOf } from './chunk-FQN4XNEF.js';
|
|
4
4
|
import { parseSvgPreview } from './chunk-FN7IF6M6.js';
|
|
5
5
|
import { OfficeElement, controlStyles, definer, valueOn, flag, present, emit, triState, withTokens } from './chunk-4W4QZF4C.js';
|
|
@@ -2743,7 +2743,7 @@ function errorBarSection(analysis) {
|
|
|
2743
2743
|
const note = analysis.multipleErrorBars ? t(
|
|
2744
2744
|
"analysis.multipleErrorBars",
|
|
2745
2745
|
"Ambiguous error bars are preserved and cannot be edited here."
|
|
2746
|
-
) : error?.valueType === "cust" ? analysis.workbookRanges ? t(
|
|
2746
|
+
) : error?.valueType === "cust" ? !analysis.resolveRange ? t("errorBars.customValuesHint", "Enter values such as 1, 2, 3.") : analysis.workbookRanges ? t(
|
|
2747
2747
|
"errorBars.customHint",
|
|
2748
2748
|
"Enter values such as 1, 2, 3 or a range such as Sheet1!$C$2:$C$4."
|
|
2749
2749
|
) : t(
|
|
@@ -2776,7 +2776,8 @@ function chartAnalysisSections(series) {
|
|
|
2776
2776
|
});
|
|
2777
2777
|
const analysis = series.analysis;
|
|
2778
2778
|
if (!analysis) return sections;
|
|
2779
|
-
sections.push(...chartTrendlineSections(analysis.trendlines
|
|
2779
|
+
if (analysis.trendlines) sections.push(...chartTrendlineSections(analysis.trendlines));
|
|
2780
|
+
sections.push(errorBarSection(analysis));
|
|
2780
2781
|
return sections;
|
|
2781
2782
|
}
|
|
2782
2783
|
var ones = (count) => chartErrorBarSourceFromText("1", { pointCount: count });
|
|
@@ -3020,6 +3021,105 @@ function chartAdvancedFieldIntent(view, target, field, value) {
|
|
|
3020
3021
|
return null;
|
|
3021
3022
|
}
|
|
3022
3023
|
}
|
|
3024
|
+
|
|
3025
|
+
// src/chart/format-pane-fill-kinds.ts
|
|
3026
|
+
function gradientFields(prefix, gradient) {
|
|
3027
|
+
const stops = gradient.stops;
|
|
3028
|
+
const fields = [
|
|
3029
|
+
{
|
|
3030
|
+
id: `${prefix}.gradientType`,
|
|
3031
|
+
kind: "select",
|
|
3032
|
+
label: t("gradientType", "Type"),
|
|
3033
|
+
value: gradient.type,
|
|
3034
|
+
choices: [
|
|
3035
|
+
choice("linear", "gradientType.linear", "Linear"),
|
|
3036
|
+
choice("radial", "gradientType.radial", "Radial")
|
|
3037
|
+
]
|
|
3038
|
+
},
|
|
3039
|
+
{
|
|
3040
|
+
id: `${prefix}.gradientStart`,
|
|
3041
|
+
kind: "color",
|
|
3042
|
+
label: t("gradientStart", "Start color"),
|
|
3043
|
+
value: hexForInput(stops[0]?.color, "#FFFFFF")
|
|
3044
|
+
},
|
|
3045
|
+
{
|
|
3046
|
+
id: `${prefix}.gradientEnd`,
|
|
3047
|
+
kind: "color",
|
|
3048
|
+
label: t("gradientEnd", "End color"),
|
|
3049
|
+
value: hexForInput(stops[stops.length - 1]?.color)
|
|
3050
|
+
}
|
|
3051
|
+
];
|
|
3052
|
+
if (gradient.type === "linear") {
|
|
3053
|
+
fields.push({
|
|
3054
|
+
id: `${prefix}.gradientAngle`,
|
|
3055
|
+
kind: "number",
|
|
3056
|
+
label: t("angle", "Angle"),
|
|
3057
|
+
value: Math.round(gradient.angle ?? 0),
|
|
3058
|
+
min: 0,
|
|
3059
|
+
max: 359,
|
|
3060
|
+
step: 1,
|
|
3061
|
+
unit: "\xB0"
|
|
3062
|
+
});
|
|
3063
|
+
}
|
|
3064
|
+
return fields;
|
|
3065
|
+
}
|
|
3066
|
+
function patternFields(pattern, presets) {
|
|
3067
|
+
return [
|
|
3068
|
+
{
|
|
3069
|
+
id: "fill.patternPreset",
|
|
3070
|
+
kind: "select",
|
|
3071
|
+
label: t("pattern", "Pattern"),
|
|
3072
|
+
value: pattern.preset,
|
|
3073
|
+
choices: [...presets]
|
|
3074
|
+
},
|
|
3075
|
+
{
|
|
3076
|
+
id: "fill.patternForeground",
|
|
3077
|
+
kind: "color",
|
|
3078
|
+
label: t("foreground", "Foreground"),
|
|
3079
|
+
value: hexForInput(pattern.foreground)
|
|
3080
|
+
},
|
|
3081
|
+
{
|
|
3082
|
+
id: "fill.patternBackground",
|
|
3083
|
+
kind: "color",
|
|
3084
|
+
label: t("background", "Background"),
|
|
3085
|
+
value: hexForInput(pattern.background, "#FFFFFF")
|
|
3086
|
+
}
|
|
3087
|
+
];
|
|
3088
|
+
}
|
|
3089
|
+
var DEFAULT_CHART_TEXTURE = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAABoUlEQVR42j3S504CQRQF4Hn/19BojCUxMYiiomIBFKmCIh1sgL389sMxJpPZnXPvKXd2QyW70qlt37UOn0f5m/Jmq5L8HJcm/dN2dev25mA6yObSc+PeSa++E6vhvp2xvPUbu3atjmpozdIGGpyWhQwPHhYHBzU7zvB6l+3wOo3sJRpqgwQHYi+3Z93LFJSqAj0ZRIJoeL07Z/7n8DTMqT12j9vVzZjn/eFi1Nx/6BzpsKMRZt5vpIgG7F59Ow4QTY2I/z2toL3dF3DKp8t0NTAMylRRo7DEuuPccub35+GcaX08FqkEA+izWHGnhKAsAO14y/bB1R5cTyDjTI+7s0itSgIBrhUHAneN5IGBarOUiMMVMoscBCVGwmXIgyAnOXPW8msB9WtSbhTW+ZgEEyK0DCS18jGSLxPB0Kklncmz06Gbkr7I91I8XlICCsJ5NrTEatjcoZpI0KvmViVUjbdnEllm1wr1ackIKrpUo+aemgHscBeKz9wK8REHRTNWHFckO3L8ZZjQnf0av//P7B7PDxf+/2o1IA4HNEeiGij+AIB5gfnxhkAIAAAAAElFTkSuQmCC";
|
|
3090
|
+
function pictureFields(picture) {
|
|
3091
|
+
const fields = [
|
|
3092
|
+
{
|
|
3093
|
+
id: "fill.picture",
|
|
3094
|
+
kind: "file",
|
|
3095
|
+
label: t("pictureSource", "Picture source"),
|
|
3096
|
+
accept: "image/png,image/jpeg,image/gif,image/bmp",
|
|
3097
|
+
button: t("insertPicture", "Insert..."),
|
|
3098
|
+
value: Boolean(picture?.src || picture?.relId)
|
|
3099
|
+
}
|
|
3100
|
+
];
|
|
3101
|
+
if (picture?.src || picture?.relId) {
|
|
3102
|
+
fields.push(
|
|
3103
|
+
{
|
|
3104
|
+
id: "fill.pictureTransparency",
|
|
3105
|
+
kind: "number",
|
|
3106
|
+
label: t("transparency", "Transparency"),
|
|
3107
|
+
value: Math.round(picture.transparency ?? 0),
|
|
3108
|
+
min: 0,
|
|
3109
|
+
max: 100,
|
|
3110
|
+
step: 1,
|
|
3111
|
+
unit: "%"
|
|
3112
|
+
},
|
|
3113
|
+
{
|
|
3114
|
+
id: "fill.pictureTile",
|
|
3115
|
+
kind: "checkbox",
|
|
3116
|
+
label: t("pictureTile", "Tile picture as texture"),
|
|
3117
|
+
value: Boolean(picture.tile)
|
|
3118
|
+
}
|
|
3119
|
+
);
|
|
3120
|
+
}
|
|
3121
|
+
return fields;
|
|
3122
|
+
}
|
|
3023
3123
|
var number = (value) => {
|
|
3024
3124
|
if (value === "" || typeof value === "boolean") return null;
|
|
3025
3125
|
const n = typeof value === "number" ? value : Number(value);
|
|
@@ -3089,8 +3189,20 @@ function paintIntent(view, target, field, value) {
|
|
|
3089
3189
|
);
|
|
3090
3190
|
return fill3 && { op: "fill", target, fill: fill3 };
|
|
3091
3191
|
}
|
|
3192
|
+
if (text2 === "picture")
|
|
3193
|
+
return !view.support.picture || view.fill.kind === "picture" ? null : { op: "picture", target, edit: { src: DEFAULT_CHART_TEXTURE, tile: true } };
|
|
3092
3194
|
return null;
|
|
3093
3195
|
}
|
|
3196
|
+
case "fill.picture":
|
|
3197
|
+
return view.support.picture && text2.startsWith("data:image/") ? {
|
|
3198
|
+
op: "picture",
|
|
3199
|
+
target,
|
|
3200
|
+
edit: { src: text2, tile: Boolean(view.fill.picture?.tile) }
|
|
3201
|
+
} : null;
|
|
3202
|
+
case "fill.pictureTile":
|
|
3203
|
+
return view.support.picture && view.fill.kind === "picture" ? { op: "picture", target, edit: { tile: Boolean(value) } } : null;
|
|
3204
|
+
case "fill.pictureTransparency":
|
|
3205
|
+
return !view.support.picture || view.fill.kind !== "picture" || n === null || n < 0 || n > 100 ? null : { op: "picture", target, edit: { transparency: n } };
|
|
3094
3206
|
case "fill.color": {
|
|
3095
3207
|
const color = drawingColorFromHex(text2, view.fill.transparency);
|
|
3096
3208
|
return color && { op: "fill", target, fill: { kind: "solid", color } };
|
|
@@ -3246,104 +3358,6 @@ function chartFormatFieldIntent(view, target, field, value) {
|
|
|
3246
3358
|
return null;
|
|
3247
3359
|
}
|
|
3248
3360
|
|
|
3249
|
-
// src/chart/format-pane-fill-kinds.ts
|
|
3250
|
-
function gradientFields(prefix, gradient) {
|
|
3251
|
-
const stops = gradient.stops;
|
|
3252
|
-
const fields = [
|
|
3253
|
-
{
|
|
3254
|
-
id: `${prefix}.gradientType`,
|
|
3255
|
-
kind: "select",
|
|
3256
|
-
label: t("gradientType", "Type"),
|
|
3257
|
-
value: gradient.type,
|
|
3258
|
-
choices: [
|
|
3259
|
-
choice("linear", "gradientType.linear", "Linear"),
|
|
3260
|
-
choice("radial", "gradientType.radial", "Radial")
|
|
3261
|
-
]
|
|
3262
|
-
},
|
|
3263
|
-
{
|
|
3264
|
-
id: `${prefix}.gradientStart`,
|
|
3265
|
-
kind: "color",
|
|
3266
|
-
label: t("gradientStart", "Start color"),
|
|
3267
|
-
value: hexForInput(stops[0]?.color, "#FFFFFF")
|
|
3268
|
-
},
|
|
3269
|
-
{
|
|
3270
|
-
id: `${prefix}.gradientEnd`,
|
|
3271
|
-
kind: "color",
|
|
3272
|
-
label: t("gradientEnd", "End color"),
|
|
3273
|
-
value: hexForInput(stops[stops.length - 1]?.color)
|
|
3274
|
-
}
|
|
3275
|
-
];
|
|
3276
|
-
if (gradient.type === "linear") {
|
|
3277
|
-
fields.push({
|
|
3278
|
-
id: `${prefix}.gradientAngle`,
|
|
3279
|
-
kind: "number",
|
|
3280
|
-
label: t("angle", "Angle"),
|
|
3281
|
-
value: Math.round(gradient.angle ?? 0),
|
|
3282
|
-
min: 0,
|
|
3283
|
-
max: 359,
|
|
3284
|
-
step: 1,
|
|
3285
|
-
unit: "\xB0"
|
|
3286
|
-
});
|
|
3287
|
-
}
|
|
3288
|
-
return fields;
|
|
3289
|
-
}
|
|
3290
|
-
function patternFields(pattern, presets) {
|
|
3291
|
-
return [
|
|
3292
|
-
{
|
|
3293
|
-
id: "fill.patternPreset",
|
|
3294
|
-
kind: "select",
|
|
3295
|
-
label: t("pattern", "Pattern"),
|
|
3296
|
-
value: pattern.preset,
|
|
3297
|
-
choices: [...presets]
|
|
3298
|
-
},
|
|
3299
|
-
{
|
|
3300
|
-
id: "fill.patternForeground",
|
|
3301
|
-
kind: "color",
|
|
3302
|
-
label: t("foreground", "Foreground"),
|
|
3303
|
-
value: hexForInput(pattern.foreground)
|
|
3304
|
-
},
|
|
3305
|
-
{
|
|
3306
|
-
id: "fill.patternBackground",
|
|
3307
|
-
kind: "color",
|
|
3308
|
-
label: t("background", "Background"),
|
|
3309
|
-
value: hexForInput(pattern.background, "#FFFFFF")
|
|
3310
|
-
}
|
|
3311
|
-
];
|
|
3312
|
-
}
|
|
3313
|
-
function pictureFields(picture) {
|
|
3314
|
-
const fields = [
|
|
3315
|
-
{
|
|
3316
|
-
id: "fill.picture",
|
|
3317
|
-
kind: "file",
|
|
3318
|
-
label: t("pictureSource", "Picture source"),
|
|
3319
|
-
accept: "image/png,image/jpeg,image/gif,image/bmp",
|
|
3320
|
-
button: t("insertPicture", "Insert..."),
|
|
3321
|
-
value: Boolean(picture?.src || picture?.relId)
|
|
3322
|
-
}
|
|
3323
|
-
];
|
|
3324
|
-
if (picture?.src || picture?.relId) {
|
|
3325
|
-
fields.push(
|
|
3326
|
-
{
|
|
3327
|
-
id: "fill.pictureTransparency",
|
|
3328
|
-
kind: "number",
|
|
3329
|
-
label: t("transparency", "Transparency"),
|
|
3330
|
-
value: Math.round(picture.transparency ?? 0),
|
|
3331
|
-
min: 0,
|
|
3332
|
-
max: 100,
|
|
3333
|
-
step: 1,
|
|
3334
|
-
unit: "%"
|
|
3335
|
-
},
|
|
3336
|
-
{
|
|
3337
|
-
id: "fill.pictureTile",
|
|
3338
|
-
kind: "checkbox",
|
|
3339
|
-
label: t("pictureTile", "Tile picture as texture"),
|
|
3340
|
-
value: Boolean(picture.tile)
|
|
3341
|
-
}
|
|
3342
|
-
);
|
|
3343
|
-
}
|
|
3344
|
-
return fields;
|
|
3345
|
-
}
|
|
3346
|
-
|
|
3347
3361
|
// src/chart/format-pane-fill-line.ts
|
|
3348
3362
|
var DASHES = [
|
|
3349
3363
|
["solid", "Solid"],
|
|
@@ -4332,7 +4346,7 @@ function chartAdvancedElementView(space, target, resolve, fillView2, lineView2,
|
|
|
4332
4346
|
return result;
|
|
4333
4347
|
}
|
|
4334
4348
|
var transparency3 = (alpha) => Math.round((1 - alpha) * 100);
|
|
4335
|
-
function fillView(fill3, resolve) {
|
|
4349
|
+
function fillView(fill3, resolve, sources) {
|
|
4336
4350
|
switch (fill3?.kind) {
|
|
4337
4351
|
case "none":
|
|
4338
4352
|
return { kind: "none" };
|
|
@@ -4351,8 +4365,19 @@ function fillView(fill3, resolve) {
|
|
|
4351
4365
|
background: fill3.background ? resolve(fill3.background)?.hex ?? "#FFFFFF" : "#FFFFFF"
|
|
4352
4366
|
}
|
|
4353
4367
|
};
|
|
4354
|
-
case "picture":
|
|
4355
|
-
|
|
4368
|
+
case "picture": {
|
|
4369
|
+
const alpha = fill3.effects?.find((effect) => effect.kind === "alphaModFix");
|
|
4370
|
+
const src = fill3.relId ? sources?.[fill3.relId] : void 0;
|
|
4371
|
+
return {
|
|
4372
|
+
kind: "picture",
|
|
4373
|
+
picture: {
|
|
4374
|
+
...fill3.relId ? { relId: fill3.relId } : {},
|
|
4375
|
+
...src ? { src } : {},
|
|
4376
|
+
tile: Boolean(fill3.layout?.tile),
|
|
4377
|
+
transparency: alpha?.kind === "alphaModFix" ? Math.round((1 - alpha.amount) * 100) : 0
|
|
4378
|
+
}
|
|
4379
|
+
};
|
|
4380
|
+
}
|
|
4356
4381
|
default:
|
|
4357
4382
|
return { kind: "automatic" };
|
|
4358
4383
|
}
|
|
@@ -4468,7 +4493,7 @@ function chartSpaceFormatSource(space, options = {}) {
|
|
|
4468
4493
|
space,
|
|
4469
4494
|
target,
|
|
4470
4495
|
resolve,
|
|
4471
|
-
(fill3) => fillView(fill3, resolve),
|
|
4496
|
+
(fill3) => fillView(fill3, resolve, space.pictureSources),
|
|
4472
4497
|
(line) => lineView(line, resolve),
|
|
4473
4498
|
!lineTarget
|
|
4474
4499
|
) : {},
|
|
@@ -4476,14 +4501,14 @@ function chartSpaceFormatSource(space, options = {}) {
|
|
|
4476
4501
|
fill: !lineTarget,
|
|
4477
4502
|
gradient: true,
|
|
4478
4503
|
pattern: advanced && !lineTarget,
|
|
4479
|
-
picture:
|
|
4504
|
+
picture: advanced && !lineTarget && options.pictures === true,
|
|
4480
4505
|
threeD: advanced && !lineTarget,
|
|
4481
4506
|
text: advanced && chartTargetHasText(target),
|
|
4482
4507
|
lineDetails: advanced,
|
|
4483
4508
|
effects: advanced,
|
|
4484
4509
|
secondaryAxis: target.kind === "series" && advanced && chartSeriesSecondaryAxisSupported(space, target.seriesIndex)
|
|
4485
4510
|
},
|
|
4486
|
-
fill: fillView(shape?.fill, resolve),
|
|
4511
|
+
fill: fillView(shape?.fill, resolve, space.pictureSources),
|
|
4487
4512
|
line: lineView(shape?.line, resolve)
|
|
4488
4513
|
};
|
|
4489
4514
|
};
|
|
@@ -4566,6 +4591,7 @@ var OfficeUiChartFormatPane = class extends OfficeElement {
|
|
|
4566
4591
|
/** Properties a host may set before the element is defined; replayed through their setters. */
|
|
4567
4592
|
static replayed = [
|
|
4568
4593
|
"source",
|
|
4594
|
+
"pictures",
|
|
4569
4595
|
"chartSpace",
|
|
4570
4596
|
"theme",
|
|
4571
4597
|
"target",
|
|
@@ -4575,6 +4601,7 @@ var OfficeUiChartFormatPane = class extends OfficeElement {
|
|
|
4575
4601
|
sourceValue;
|
|
4576
4602
|
spaceValue;
|
|
4577
4603
|
themeValue;
|
|
4604
|
+
picturesValue = false;
|
|
4578
4605
|
targetValue = "chartArea";
|
|
4579
4606
|
translator = echo;
|
|
4580
4607
|
localeValue = "en";
|
|
@@ -4621,6 +4648,17 @@ var OfficeUiChartFormatPane = class extends OfficeElement {
|
|
|
4621
4648
|
this.sourceValue = value && chartSpaceFormatSource(value, this.themeOptions());
|
|
4622
4649
|
this.requestUpdate("chartSpace");
|
|
4623
4650
|
}
|
|
4651
|
+
/**
|
|
4652
|
+
* Offer Picture or texture fill for a `chartSpace`: set by a host that keeps the chart's
|
|
4653
|
+
* `pictureSources` and stores pending pictures when it saves (`embedChartSpacePictures`).
|
|
4654
|
+
*/
|
|
4655
|
+
get pictures() {
|
|
4656
|
+
return this.picturesValue;
|
|
4657
|
+
}
|
|
4658
|
+
set pictures(value) {
|
|
4659
|
+
this.picturesValue = Boolean(value);
|
|
4660
|
+
if (this.spaceValue) this.chartSpace = this.spaceValue;
|
|
4661
|
+
}
|
|
4624
4662
|
/** Resolves scheme colours of a `chartSpace`. */
|
|
4625
4663
|
get theme() {
|
|
4626
4664
|
return this.themeValue;
|
|
@@ -4659,7 +4697,10 @@ var OfficeUiChartFormatPane = class extends OfficeElement {
|
|
|
4659
4697
|
this.requestUpdate("locale");
|
|
4660
4698
|
}
|
|
4661
4699
|
themeOptions() {
|
|
4662
|
-
return
|
|
4700
|
+
return {
|
|
4701
|
+
...this.themeValue ? { theme: this.themeValue } : {},
|
|
4702
|
+
...this.picturesValue ? { pictures: true } : {}
|
|
4703
|
+
};
|
|
4663
4704
|
}
|
|
4664
4705
|
statics() {
|
|
4665
4706
|
return this.constructor;
|
|
@@ -12220,4 +12261,4 @@ function registerControls(registry) {
|
|
|
12220
12261
|
for (const define of CONTROL_DEFINERS) define(registry);
|
|
12221
12262
|
}
|
|
12222
12263
|
|
|
12223
|
-
export { CHART_DATA_SHEET_ENGLISH, CONTROL_DEFINERS, CUSTOM_FONT_ACCEPT, CUSTOM_FONT_EXTENSIONS, DEFAULT_CLOUD_FILES_LABELS, DEFAULT_COMMENTS_LABELS, DEFAULT_CONNECTED_SERVICES_LABELS, DEFAULT_OFFICE_PROFILE, DEFAULT_OPEN_PLACES_LABELS, DEVICE_PLACE, EMPTY_MENU_STATE, OFFICE_AVATAR_SWATCHES, OFFICE_COLOR_SWATCHES, OFFICE_COLOR_SWATCH_HEXES, OFFICE_PROFILE_STORAGE_KEY, OFFICE_SYMBOLS, OFFICE_TITLE_BAR_SEARCH_LIMIT, OFFICE_TOAST_VISIBLE_LIMIT, OfficeUiChartFormatPane, OfficeUiCloudFiles, OfficeUiConnectedServices, OfficeUiFormatSection, OfficeUiMessageDialog, OfficeUiOpenPlaces, OfficeUiShareDialog, SAVE_PROGRESS_TEXT, SHARE_DIALOG_LABELS, SHARE_DIALOG_LOCALES, alertDialog, assignKeyTips, attachKeyTips, attachRibbonGroupOverflow, buildChartFormatModel, buildFontCatalog, chartFormatFieldIntent, chartFormatLocale, chartFormatPaneTitle, chartFormatSourceTabs, chartFormatTargetLabel, chartFormatTargetOptions, chartFormatTranslator, chartSpaceFormatSource, clampFlyoutPosition, clampOptionNumber, clearOfficeProfile, commentInitials, confirmDialog, createDialogSession, createFontFaceScope, createLiveColorInput, createRibbonOverflow, defaultPaneGradient, defineAccount, defineBackstage, defineButton, defineChartDataSheet, defineChartFormatPane, defineChartPicker, defineCheckbox, defineCloudFiles, defineColorCustom, defineColorGrid, defineCommandSearch, defineCommentsPane, defineConnectedServices, defineContextMenu, defineDialog, defineDialogFooter, defineFindBar, defineFormatSection, defineGallery, defineIcon, defineMenuButton, defineMenuItem, defineMenuSeparator, defineMessageDialog, defineOpenPlaces, defineOptionsDialog, definePasteOptions, definePrintPreview, defineProgressDialog, defineRadio, defineReadOnlyBanner, defineRibbon, defineRibbonActions, defineRibbonGroup, defineRibbonSection, defineRibbonStack, defineRibbonToggle, defineRuler, defineSearchField, defineSelect, defineShareDialog, defineStatusBar, defineStatusItem, defineSwitch, defineSymbolPicker, defineTabStrip, defineTaskPane, defineTitleBar, defineToasts, defineToolbar, defineZoomSlider, deriveCustomFontDescriptor, drawingColorFromHex, drawingGradientFrom, fitRibbonGroups, formatCommentTime, glyph, handleLiveColorEvent, hexForInput, isFontFamilyAvailable, liveColorRevertPatch, nextEnabledIndex, optionText, optionsLabels, parseOfficeSymbolCode, personalizeSection, profileInitials, promptDialog, rangeControl, range_control_default, readOfficeProfile, recordLiveColorLeaves, registerControls, registerCustomFont, resolveChartFormatSourceTarget, rulerDivisions, runKeyTips, sanitizeOfficeProfile, saveProgressLabel, saveProgressStepChanged, scanAvailableFontFamilies, shareDialogLabels, translateChartFormatText, typeAheadIndex, unavailableCategory, unavailableControl, userInterfaceSection, wireTabDrag, writeOfficeProfile };
|
|
12264
|
+
export { CHART_DATA_SHEET_ENGLISH, CONTROL_DEFINERS, CUSTOM_FONT_ACCEPT, CUSTOM_FONT_EXTENSIONS, DEFAULT_CHART_TEXTURE, DEFAULT_CLOUD_FILES_LABELS, DEFAULT_COMMENTS_LABELS, DEFAULT_CONNECTED_SERVICES_LABELS, DEFAULT_OFFICE_PROFILE, DEFAULT_OPEN_PLACES_LABELS, DEVICE_PLACE, EMPTY_MENU_STATE, OFFICE_AVATAR_SWATCHES, OFFICE_COLOR_SWATCHES, OFFICE_COLOR_SWATCH_HEXES, OFFICE_PROFILE_STORAGE_KEY, OFFICE_SYMBOLS, OFFICE_TITLE_BAR_SEARCH_LIMIT, OFFICE_TOAST_VISIBLE_LIMIT, OfficeUiChartFormatPane, OfficeUiCloudFiles, OfficeUiConnectedServices, OfficeUiFormatSection, OfficeUiMessageDialog, OfficeUiOpenPlaces, OfficeUiShareDialog, SAVE_PROGRESS_TEXT, SHARE_DIALOG_LABELS, SHARE_DIALOG_LOCALES, alertDialog, assignKeyTips, attachKeyTips, attachRibbonGroupOverflow, buildChartFormatModel, buildFontCatalog, chartFormatFieldIntent, chartFormatLocale, chartFormatPaneTitle, chartFormatSourceTabs, chartFormatTargetLabel, chartFormatTargetOptions, chartFormatTranslator, chartSpaceFormatSource, clampFlyoutPosition, clampOptionNumber, clearOfficeProfile, commentInitials, confirmDialog, createDialogSession, createFontFaceScope, createLiveColorInput, createRibbonOverflow, defaultPaneGradient, defineAccount, defineBackstage, defineButton, defineChartDataSheet, defineChartFormatPane, defineChartPicker, defineCheckbox, defineCloudFiles, defineColorCustom, defineColorGrid, defineCommandSearch, defineCommentsPane, defineConnectedServices, defineContextMenu, defineDialog, defineDialogFooter, defineFindBar, defineFormatSection, defineGallery, defineIcon, defineMenuButton, defineMenuItem, defineMenuSeparator, defineMessageDialog, defineOpenPlaces, defineOptionsDialog, definePasteOptions, definePrintPreview, defineProgressDialog, defineRadio, defineReadOnlyBanner, defineRibbon, defineRibbonActions, defineRibbonGroup, defineRibbonSection, defineRibbonStack, defineRibbonToggle, defineRuler, defineSearchField, defineSelect, defineShareDialog, defineStatusBar, defineStatusItem, defineSwitch, defineSymbolPicker, defineTabStrip, defineTaskPane, defineTitleBar, defineToasts, defineToolbar, defineZoomSlider, deriveCustomFontDescriptor, drawingColorFromHex, drawingGradientFrom, fitRibbonGroups, formatCommentTime, glyph, handleLiveColorEvent, hexForInput, isFontFamilyAvailable, liveColorRevertPatch, nextEnabledIndex, optionText, optionsLabels, parseOfficeSymbolCode, personalizeSection, profileInitials, promptDialog, rangeControl, range_control_default, readOfficeProfile, recordLiveColorLeaves, registerControls, registerCustomFont, resolveChartFormatSourceTarget, rulerDivisions, runKeyTips, sanitizeOfficeProfile, saveProgressLabel, saveProgressStepChanged, scanAvailableFontFamilies, shareDialogLabels, translateChartFormatText, typeAheadIndex, unavailableCategory, unavailableControl, userInterfaceSection, wireTabDrag, writeOfficeProfile };
|
|
@@ -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, appliedDiagramNativeId, DIAGRAM_NATIVE_COLOR_SECTIONS, DIAGRAM_NATIVE_COLOR_ENTRIES, DIAGRAM_NATIVE_STYLE_SECTIONS, DIAGRAM_NATIVE_STYLE_ENTRIES, diagramDesignEdit, diagramNodeOutline } from 'ooxml-core/diagram';
|
|
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';
|
|
@@ -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] });
|
|
@@ -1148,6 +1314,15 @@ function colorToCss(color, scheme, report) {
|
|
|
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 };
|