ooxml-ui 1.52.0 → 1.53.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 +5 -1
- package/dist/base.d.ts +0 -1
- package/dist/chart/data-sheet-keys.d.ts +0 -1
- package/dist/chart/data-sheet-labels.d.ts +0 -1
- package/dist/chart/data-sheet.d.ts +1 -2
- package/dist/chart/format-pane-3d.d.ts +0 -1
- package/dist/chart/format-pane-advanced-intent.d.ts +0 -1
- package/dist/chart/format-pane-advanced-space.d.ts +4 -2
- package/dist/chart/format-pane-advanced-space.d.ts.map +1 -1
- package/dist/chart/format-pane-analysis.d.ts.map +1 -1
- package/dist/chart/format-pane-axis.d.ts +0 -1
- package/dist/chart/format-pane-common.d.ts +0 -1
- package/dist/chart/format-pane-effects.d.ts +0 -1
- package/dist/chart/format-pane-fields.d.ts +0 -1
- package/dist/chart/format-pane-intent.d.ts +0 -1
- package/dist/chart/format-pane-locales/de.d.ts.map +1 -1
- package/dist/chart/format-pane-locales/en.d.ts +0 -1
- 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/index.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 +0 -1
- 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 +0 -1
- package/dist/chart/format-pane-options.d.ts +0 -1
- package/dist/chart/format-pane-space.d.ts +10 -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-view.d.ts +10 -1
- package/dist/chart/format-pane-view.d.ts.map +1 -1
- package/dist/chart/format-pane.d.ts +1 -2
- package/dist/chart/gallery-tiles.d.ts +0 -1
- package/dist/chart-format-locales.js +1 -1
- package/dist/chrome/account-profile.d.ts +0 -1
- package/dist/chrome/account.d.ts +1 -2
- package/dist/chrome/backstage.d.ts +1 -2
- package/dist/chrome/find-bar.d.ts +1 -2
- package/dist/chrome/find-replace-fields.d.ts +0 -1
- package/dist/chrome/format-section.d.ts +1 -2
- package/dist/chrome/ruler.d.ts +1 -2
- package/dist/chrome/status-bar.d.ts +1 -2
- package/dist/chrome/status-item.d.ts +1 -2
- package/dist/chrome/tab-drag.d.ts +0 -1
- package/dist/chrome/tab-strip.d.ts +1 -2
- package/dist/chrome/task-pane.d.ts +1 -2
- package/dist/chrome/title-bar-types.d.ts +0 -1
- package/dist/chrome/title-bar.d.ts +1 -2
- package/dist/{chunk-ALWA7Q42.js → chunk-2EBZ6IV6.js} +3 -3
- package/dist/{chunk-JNCHVQQA.js → chunk-J36LIYGS.js} +1 -1
- package/dist/{chunk-GSO4HLIY.js → chunk-JI4ZNPEK.js} +42 -7
- package/dist/{chunk-3TF5IIIJ.js → chunk-NSBQACCO.js} +241 -149
- package/dist/{chunk-QDU4GLWK.js → chunk-X464LPTR.js} +152 -47
- package/dist/{chunk-FP45SLBV.js → chunk-XQIZWJEV.js} +1 -1
- package/dist/{chunk-QGRJJUH7.js → chunk-Y535PPSZ.js} +1 -1
- package/dist/comments/comments-pane.d.ts +1 -2
- package/dist/controls.d.ts +0 -1
- package/dist/controls.js +2 -2
- package/dist/dialog/chart-picker.d.ts +1 -2
- package/dist/dialog/dialog-footer.d.ts +1 -2
- package/dist/dialog/dialog-session.d.ts +0 -1
- package/dist/dialog/dialog.d.ts +1 -2
- package/dist/dialog/focus.d.ts +0 -1
- package/dist/dialog/message-dialogs.d.ts +0 -1
- package/dist/dialog/options-categories.d.ts +0 -1
- package/dist/dialog/options-controls.d.ts +0 -1
- package/dist/dialog/options-dialog.d.ts +1 -2
- package/dist/dialog/progress-dialog.d.ts +1 -2
- package/dist/dialog/share-dialog-locales.d.ts +0 -1
- package/dist/dialog/share-dialog.d.ts +1 -2
- package/dist/docx.js +36 -42
- package/dist/export/pdf-cid-font.d.ts +35 -0
- package/dist/export/pdf-cid-font.d.ts.map +1 -0
- package/dist/export/pdf-embedded-font.d.ts +10 -16
- package/dist/export/pdf-embedded-font.d.ts.map +1 -1
- package/dist/export/pdf-image.d.ts +0 -1
- package/dist/export/pdf-path.d.ts +0 -1
- package/dist/export/pdf-svg-gradient.d.ts +0 -1
- package/dist/export/pdf-svg-notes.d.ts +0 -1
- package/dist/export/pdf-text-layer-font.d.ts +13 -0
- package/dist/export/pdf-text-layer-font.d.ts.map +1 -0
- package/dist/export/pdf-vector.d.ts +3 -3
- package/dist/export/pdf-vector.d.ts.map +1 -1
- package/dist/files/cloud-files-labels.d.ts +0 -1
- package/dist/files/cloud-files-view.d.ts +0 -1
- package/dist/files/connected-services.d.ts +1 -2
- package/dist/files/open-places.d.ts +1 -2
- package/dist/files/save-progress-label.d.ts +0 -1
- package/dist/fonts/availability.d.ts +0 -1
- package/dist/fonts/catalog.d.ts +0 -1
- package/dist/fonts/custom-fonts.d.ts +0 -1
- package/dist/form/checkable.d.ts +0 -1
- package/dist/form/color-custom.d.ts +1 -2
- package/dist/form/color-grid.d.ts +1 -2
- package/dist/form/color-input/live-color-input.d.ts +0 -1
- package/dist/form/color-input/live-color-leaves.d.ts +0 -1
- package/dist/form/radio.d.ts +1 -2
- package/dist/form/range-control.d.ts +0 -1
- package/dist/form/search-field.d.ts +1 -2
- package/dist/form/select.d.ts +1 -2
- package/dist/form/switch.d.ts +1 -2
- package/dist/form/symbol-picker.d.ts +1 -2
- package/dist/form/zoom-slider.d.ts +1 -2
- package/dist/icon.d.ts +0 -1
- package/dist/image-native-size.d.ts +0 -1
- package/dist/index.js +6 -6
- package/dist/keytips.d.ts +0 -1
- package/dist/look.d.ts +1 -0
- package/dist/menu/command-search.d.ts +1 -2
- package/dist/menu/context-menu.d.ts +1 -2
- package/dist/menu/menu-button.d.ts +1 -2
- package/dist/menu/menu-item.d.ts +1 -2
- package/dist/menu/menu-model.d.ts +0 -1
- package/dist/menu/menu-separator.d.ts +1 -2
- package/dist/notices/toasts.d.ts +1 -2
- package/dist/picture-artistic-filters.d.ts +0 -1
- package/dist/pptx/{chunk-NGOH4ENE.mjs → chunk-5PL3ZZV4.mjs} +1 -1
- package/dist/pptx/{chunk-5454QDUH.mjs → chunk-75MKMQP5.mjs} +70 -7
- package/dist/pptx/{chunk-WKKLVLLP.cjs → chunk-O33ER4AJ.cjs} +70 -7
- package/dist/pptx/{chunk-KCIIXE4D.mjs → chunk-OS2SX33G.mjs} +3066 -1491
- package/dist/pptx/{chunk-SC4VATDY.cjs → chunk-STQTJXYQ.cjs} +3098 -1488
- package/dist/pptx/{chunk-7ZRVQFQN.cjs → chunk-TJPRGVT4.cjs} +42 -42
- package/dist/pptx/dom/index.cjs +377 -377
- package/dist/pptx/dom/index.mjs +6 -6
- package/dist/pptx/export/pdf-export-diagnostics.d.ts +1 -1
- package/dist/pptx/export/pdf-export-diagnostics.d.ts.map +1 -1
- package/dist/pptx/export/pdf-vector-collect.d.ts.map +1 -1
- package/dist/pptx/export/pdf-vector-export.d.ts.map +1 -1
- package/dist/pptx/export/pdf-vector-media.d.ts +11 -0
- package/dist/pptx/export/pdf-vector-media.d.ts.map +1 -0
- package/dist/pptx/export/pdf-vector-paint.d.ts +5 -1
- package/dist/pptx/export/pdf-vector-paint.d.ts.map +1 -1
- package/dist/pptx/export/pdf-vector-text.d.ts.map +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-pdf-export.d.ts.map +1 -1
- package/dist/pptx/i18n/translations-en.d.ts.map +1 -1
- package/dist/pptx/index.cjs +3410 -3270
- package/dist/pptx/index.mjs +2 -2
- package/dist/pptx/render/controller/index.d.ts +6 -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/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/index.d.ts +1 -0
- package/dist/pptx/render/index.d.ts.map +1 -1
- package/dist/pptx/render/inspector/index.d.ts +6 -0
- package/dist/pptx/render/inspector/index.d.ts.map +1 -1
- 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/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 +36 -0
- package/dist/pptx/render/ribbon-galleries/smartart-native-entries.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/{smartart-insert-preview-H2LZCTYG.mjs → smartart-insert-preview-FJFP4JJ5.mjs} +3 -3
- package/dist/pptx/{smartart-insert-preview-MMCWPA26.cjs → smartart-insert-preview-XNHOSN3T.cjs} +4 -4
- 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 +1 -2
- package/dist/recovery-scheduler.d.ts +0 -1
- package/dist/render-cache.d.ts +0 -1
- package/dist/ribbon/button.d.ts +1 -2
- package/dist/ribbon/color-preview.d.ts +0 -1
- package/dist/ribbon/gallery-styles.d.ts +0 -1
- package/dist/ribbon/gallery.d.ts +1 -2
- package/dist/ribbon/group-overflow.d.ts +0 -1
- package/dist/ribbon/keytip-run.d.ts +0 -1
- package/dist/ribbon/overflow.d.ts +0 -1
- package/dist/ribbon/ribbon-actions.d.ts +1 -2
- package/dist/ribbon/ribbon-section.d.ts +1 -2
- package/dist/ribbon/ribbon-stack.d.ts +1 -2
- package/dist/ribbon/ribbon-tabs.d.ts +24 -2
- package/dist/ribbon/ribbon-tabs.d.ts.map +1 -1
- package/dist/ribbon/ribbon-toolbar.d.ts +1 -2
- package/dist/ribbon/safe-svg.d.ts +0 -1
- 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-picker.d.ts +1 -2
- package/dist/smartart/smartart-text-pane-tools.d.ts +0 -1
- package/dist/smartart/smartart-text-pane.d.ts +1 -2
- package/dist/smartart.d.ts +1 -0
- package/dist/smartart.js +1 -1
- package/dist/teams.js +3 -3
- package/dist/theme.d.ts +0 -1
- package/dist/touch-targets.d.ts +0 -1
- package/dist/visio.js +97 -33
- package/dist/xlsx/chart-format-source.d.ts +4 -3
- package/dist/xlsx.js +46 -26
- package/package.json +2 -2
package/dist/visio.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { trackPointerPan, ownsCaptureLoss } from './chunk-GSXOZCAN.js';
|
|
2
|
-
import { FONT_DOWNLOADS_DEFAULT, fontDownloadLock, prepareWebfonts, effectiveFontDownloads, prefetchWebfonts, syncGoogleWebfontStylesheet, attachShareDialog, connectedServicesLabels, chartExSpaceFormatSource } from './chunk-
|
|
2
|
+
import { FONT_DOWNLOADS_DEFAULT, fontDownloadLock, prepareWebfonts, effectiveFontDownloads, prefetchWebfonts, syncGoogleWebfontStylesheet, attachShareDialog, connectedServicesLabels, chartExSpaceFormatSource } from './chunk-XQIZWJEV.js';
|
|
3
3
|
import { createRecoveryScheduler } from './chunk-DA57FPSN.js';
|
|
4
|
-
import { syncRibbonAddIns, createHostBackstagePages, syncHostMenuChildren, tidyMenuSeparators } from './chunk-
|
|
5
|
-
export { RIBBON_ADD_IN_EVENT } from './chunk-
|
|
4
|
+
import { syncRibbonAddIns, createHostBackstagePages, syncHostMenuChildren, tidyMenuSeparators } from './chunk-Y535PPSZ.js';
|
|
5
|
+
export { RIBBON_ADD_IN_EVENT } from './chunk-Y535PPSZ.js';
|
|
6
6
|
import { themeBridge, installOfficeUiThemeFor, prepareOfficeUiBlock } from './chunk-6C6S4AWF.js';
|
|
7
|
-
import { personalizeSection, unavailableCategory, userInterfaceSection, attachKeyTips, registerControls, readOfficeProfile, sanitizeOfficeProfile, writeOfficeProfile, defineRibbonActions, saveProgressStepChanged, saveProgressLabel, attachRibbonGroupOverflow, defineConnectedServices, defineOpenPlaces, defineChartPicker, defineChartDataSheet, defineChartFormatPane, commentInitials } from './chunk-
|
|
7
|
+
import { personalizeSection, unavailableCategory, userInterfaceSection, attachKeyTips, registerControls, readOfficeProfile, sanitizeOfficeProfile, writeOfficeProfile, defineRibbonActions, saveProgressStepChanged, saveProgressLabel, attachRibbonGroupOverflow, defineConnectedServices, defineOpenPlaces, defineChartPicker, defineChartDataSheet, defineChartFormatPane, commentInitials } from './chunk-NSBQACCO.js';
|
|
8
8
|
import { getIcon, registerIcon } from './chunk-M6GF5ED2.js';
|
|
9
|
-
import './chunk-
|
|
9
|
+
import './chunk-JI4ZNPEK.js';
|
|
10
10
|
import { definePresence } from './chunk-FQN4XNEF.js';
|
|
11
11
|
import { parseSvgPreview } from './chunk-FN7IF6M6.js';
|
|
12
12
|
import './chunk-4W4QZF4C.js';
|
|
@@ -15,7 +15,7 @@ import { VISIO_CAPABILITY_COMMANDS, VISIO_TEXT_LANGUAGES, VISIO_BULLET_STYLES, F
|
|
|
15
15
|
export { TEXT_SEARCH_LIMITS, VISIO_CAPABILITY_IDS, compatibilityNotes, compatibilityText, demoDocument, eventKeys, propertyKeys } from 'ooxml-core/visio/ui';
|
|
16
16
|
import { VISIO_VISIBILITY_LIMITS, VISIO_BASIC_STENCIL, VISIO_STENCILS, visioOutlineShape, VISIO_SNAP, VISIO_GLUE, VISIO_SHADOW_PRESETS, loadVisio, createVsdx, deserializeVisioClipboard, mergeVisioPages, getVisioPageLayers, resolveVisioPageVisibility, visioLineJumpPaths, collectVisioWebfontRuns, VISIO_CLIPBOARD_MAX_CHARS, projectPathData, createProjection, projectionMatrix, visioSnapGlue, VISIO_SWIMLANE_STYLES, VISIO_GLOW_TRANSPARENCY, VISIO_METADATA_TEXT_LIMIT, VISIO_PICTURE_MAX_BYTES, inspectVisioRasterImage, visioPageLayout, VISIO_BUILT_IN_THEMES, VISIO_CONNECTOR_ROUTES, visioRotation3dMatrix, visioFilledArrow, layoutVisioFilledArrowLine, visioOpenArrowPath, bevelMaterial, bevelLight, bevelHeightTable, extrudePaths, extrusionPathData, visioBuiltInStencil, visioBuiltInMaster, isVisioChangeShapeTarget, VISIO_CONTAINER_STYLES, VISIO_CALLOUT_STYLES, visioFallbackQuickStyle, VISIO_GLOW_SIZES, VISIO_BEVEL_PRESETS, VISIO_ROTATION_PRESETS, VISIO_SOFT_EDGE_SIZES, VISIO_REFLECTION_PRESETS, encodeBitmapEmf, VISIO_BACKGROUND_STYLES, visioBackgroundShapes, VISIO_BORDER_STYLES, visioBorderShapes, checkVisioAlternativeText, visioRefreshReport, VISIO_SHAPE_DATA_TYPES, visioShapeDataRowName, VISIO_CLIPBOARD_MAGIC, visioThemeVariantColors, visioPageThemeColors, parseVsdx, parsePath, visioTabStarts, readVisioStencil, isVisioBuiltInThemeId, VISIO_QUICK_STYLE_COLORS, VISIO_SCALE_UNITS, BEVEL_BLUR_WIDTHS } from 'ooxml-core/visio';
|
|
17
17
|
import { renderChartSvg, readEmbeddedChartSpace, readEmbeddedChartExSpace, writeEmbeddedChartSpace, writeEmbeddedChartExSpace } from 'ooxml-core/xlsx';
|
|
18
|
-
import { getSubstituteFontFamily, resolveGoogleFontsCss2Base, parseTrueType, mayEmbedFontSubset, embeddingPermission, subsetTrueType } from 'ooxml-core/text';
|
|
18
|
+
import { getSubstituteFontFamily, resolveGoogleFontsCss2Base, parseTrueType, mayEmbedFontSubset, embeddingPermission, subsetTrueType, MAX_GLYPHLESS_GLYPHS, glyphlessTrueType, isEastAsianChar } from 'ooxml-core/text';
|
|
19
19
|
import { resolveRotateHandlePlacement, createRotationDrag, snapAngle } from 'ooxml-core/geometry';
|
|
20
20
|
import { interpolate, normalizeLocale } from 'ooxml-core/i18n';
|
|
21
21
|
import { isCapabilityEnabled, capabilityHiddenActions, recoveryStoreOf, FILE_COMMAND_EVENT, fileCommandDetail, documentSaveMeta, saveToStorage } from 'ooxml-core/embedding';
|
|
@@ -29512,6 +29512,88 @@ var blob = (canvas2, type, quality) => new Promise(
|
|
|
29512
29512
|
async function exportPagePng(doc, model, pageIndex) {
|
|
29513
29513
|
return blob(await rasterizePage(doc, model, pageIndex), "image/png");
|
|
29514
29514
|
}
|
|
29515
|
+
|
|
29516
|
+
// src/export/pdf-cid-font.ts
|
|
29517
|
+
var hex4 = (value) => value.toString(16).padStart(4, "0");
|
|
29518
|
+
var utf16 = (code) => {
|
|
29519
|
+
if (code < 65536) return hex4(code);
|
|
29520
|
+
const v = code - 65536;
|
|
29521
|
+
return hex4(55296 + (v >> 10)) + hex4(56320 + (v & 1023));
|
|
29522
|
+
};
|
|
29523
|
+
function toUnicodeCMap(codes) {
|
|
29524
|
+
const lines = [
|
|
29525
|
+
"/CIDInit /ProcSet findresource begin",
|
|
29526
|
+
"12 dict begin",
|
|
29527
|
+
"begincmap",
|
|
29528
|
+
"/CIDSystemInfo << /Registry (Adobe) /Ordering (UCS) /Supplement 0 >> def",
|
|
29529
|
+
"/CMapName /Adobe-Identity-UCS def",
|
|
29530
|
+
"/CMapType 2 def",
|
|
29531
|
+
"1 begincodespacerange",
|
|
29532
|
+
"<0000> <FFFF>",
|
|
29533
|
+
"endcodespacerange"
|
|
29534
|
+
];
|
|
29535
|
+
for (let start = 0; start < codes.length; start += 100) {
|
|
29536
|
+
const chunk = codes.slice(start, start + 100);
|
|
29537
|
+
lines.push(`${chunk.length} beginbfchar`);
|
|
29538
|
+
chunk.forEach((code, index) => lines.push(`<${hex4(start + index + 1)}> <${utf16(code)}>`));
|
|
29539
|
+
lines.push("endbfchar");
|
|
29540
|
+
}
|
|
29541
|
+
lines.push("endcmap", "CMapName currentdict /CMap defineresource pop", "end", "end");
|
|
29542
|
+
return lines.join("\n");
|
|
29543
|
+
}
|
|
29544
|
+
var advanceOf = (char) => isEastAsianChar(char) ? 1e3 : 500;
|
|
29545
|
+
var PdfTextLayerFont = class {
|
|
29546
|
+
family = "TextLayer";
|
|
29547
|
+
bold = false;
|
|
29548
|
+
italic = false;
|
|
29549
|
+
#cids = /* @__PURE__ */ new Map();
|
|
29550
|
+
#codes = [];
|
|
29551
|
+
/** Advance width of `text` in em units. */
|
|
29552
|
+
width(text2) {
|
|
29553
|
+
let total = 0;
|
|
29554
|
+
for (const char of text2) total += advanceOf(char) / 1e3;
|
|
29555
|
+
return total;
|
|
29556
|
+
}
|
|
29557
|
+
/** `text` as the hex digits of 2-byte CIDs; each new character takes the next CID. */
|
|
29558
|
+
encode(text2) {
|
|
29559
|
+
let out = "";
|
|
29560
|
+
for (const char of text2) {
|
|
29561
|
+
const code = char.codePointAt(0);
|
|
29562
|
+
let cid = this.#cids.get(code);
|
|
29563
|
+
if (cid === void 0) {
|
|
29564
|
+
cid = this.#codes.length + 1 < MAX_GLYPHLESS_GLYPHS ? this.#codes.length + 1 : 0;
|
|
29565
|
+
if (cid) {
|
|
29566
|
+
this.#cids.set(code, cid);
|
|
29567
|
+
this.#codes.push(code);
|
|
29568
|
+
}
|
|
29569
|
+
}
|
|
29570
|
+
out += cid.toString(16).padStart(4, "0");
|
|
29571
|
+
}
|
|
29572
|
+
return out;
|
|
29573
|
+
}
|
|
29574
|
+
get used() {
|
|
29575
|
+
return this.#codes.length > 0;
|
|
29576
|
+
}
|
|
29577
|
+
build() {
|
|
29578
|
+
const widths = [0, ...this.#codes.map((code) => advanceOf(String.fromCodePoint(code)))];
|
|
29579
|
+
return {
|
|
29580
|
+
fontFile: glyphlessTrueType(widths),
|
|
29581
|
+
widths,
|
|
29582
|
+
toUnicode: toUnicodeCMap(this.#codes),
|
|
29583
|
+
descriptor: {
|
|
29584
|
+
flags: 4,
|
|
29585
|
+
bbox: [0, -200, 1e3, 800],
|
|
29586
|
+
italicAngle: 0,
|
|
29587
|
+
ascent: 800,
|
|
29588
|
+
descent: -200,
|
|
29589
|
+
capHeight: 700,
|
|
29590
|
+
stemV: 80
|
|
29591
|
+
}
|
|
29592
|
+
};
|
|
29593
|
+
}
|
|
29594
|
+
};
|
|
29595
|
+
|
|
29596
|
+
// src/export/pdf-embedded-font.ts
|
|
29515
29597
|
var PdfEmbeddedFont = class _PdfEmbeddedFont {
|
|
29516
29598
|
constructor(file, font) {
|
|
29517
29599
|
this.font = font;
|
|
@@ -29598,35 +29680,9 @@ var PdfEmbeddedFont = class _PdfEmbeddedFont {
|
|
|
29598
29680
|
};
|
|
29599
29681
|
}
|
|
29600
29682
|
};
|
|
29601
|
-
var hex4 = (value) => value.toString(16).padStart(4, "0");
|
|
29602
|
-
var utf16 = (code) => {
|
|
29603
|
-
if (code < 65536) return hex4(code);
|
|
29604
|
-
const v = code - 65536;
|
|
29605
|
-
return hex4(55296 + (v >> 10)) + hex4(56320 + (v & 1023));
|
|
29606
|
-
};
|
|
29607
|
-
function toUnicodeCMap(codes) {
|
|
29608
|
-
const lines = [
|
|
29609
|
-
"/CIDInit /ProcSet findresource begin",
|
|
29610
|
-
"12 dict begin",
|
|
29611
|
-
"begincmap",
|
|
29612
|
-
"/CIDSystemInfo << /Registry (Adobe) /Ordering (UCS) /Supplement 0 >> def",
|
|
29613
|
-
"/CMapName /Adobe-Identity-UCS def",
|
|
29614
|
-
"/CMapType 2 def",
|
|
29615
|
-
"1 begincodespacerange",
|
|
29616
|
-
"<0000> <FFFF>",
|
|
29617
|
-
"endcodespacerange"
|
|
29618
|
-
];
|
|
29619
|
-
for (let start = 0; start < codes.length; start += 100) {
|
|
29620
|
-
const chunk = codes.slice(start, start + 100);
|
|
29621
|
-
lines.push(`${chunk.length} beginbfchar`);
|
|
29622
|
-
chunk.forEach((code, index) => lines.push(`<${hex4(start + index + 1)}> <${utf16(code)}>`));
|
|
29623
|
-
lines.push("endbfchar");
|
|
29624
|
-
}
|
|
29625
|
-
lines.push("endcmap", "CMapName currentdict /CMap defineresource pop", "end", "end");
|
|
29626
|
-
return lines.join("\n");
|
|
29627
|
-
}
|
|
29628
29683
|
var PdfFontSet = class {
|
|
29629
29684
|
fonts;
|
|
29685
|
+
#textLayer;
|
|
29630
29686
|
constructor(files = []) {
|
|
29631
29687
|
this.fonts = files.flatMap((file) => {
|
|
29632
29688
|
const font = PdfEmbeddedFont.create(file);
|
|
@@ -29636,6 +29692,14 @@ var PdfFontSet = class {
|
|
|
29636
29692
|
get size() {
|
|
29637
29693
|
return this.fonts.length;
|
|
29638
29694
|
}
|
|
29695
|
+
/**
|
|
29696
|
+
* The glyphless font of this document's invisible text layer, for text over a picture of it
|
|
29697
|
+
* that no supplied font can write (one font for every page, created on first use).
|
|
29698
|
+
*/
|
|
29699
|
+
get textLayer() {
|
|
29700
|
+
this.#textLayer ??= new PdfTextLayerFont();
|
|
29701
|
+
return this.#textLayer;
|
|
29702
|
+
}
|
|
29639
29703
|
/** The best font that has every character of `text`, or `undefined`. */
|
|
29640
29704
|
pick(family, bold, italic, text2) {
|
|
29641
29705
|
const names = family.split(",").map(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ChartObject, type Workbook } from 'ooxml-core/xlsx';
|
|
2
|
-
import type { ChartFormatTarget, ChartSpace } from 'ooxml-core/chart';
|
|
2
|
+
import type { ChartFormatTarget, ChartRangeNumbers, ChartSpace } from 'ooxml-core/chart';
|
|
3
3
|
import type { DrawingColorTheme } from 'ooxml-core/drawingml';
|
|
4
4
|
import { type ChartFormatSource } from '../chart/format-pane-api.js';
|
|
5
5
|
/** The slot Excel's fill controls go into. */
|
|
@@ -12,6 +12,7 @@ export declare function workbookChartTheme(workbook: Workbook): DrawingColorThem
|
|
|
12
12
|
export declare const xlsxFillsTarget: (target: ChartFormatTarget) => boolean;
|
|
13
13
|
/**
|
|
14
14
|
* The Format pane source of `chart` (whose model is `space`) with `target` selected: Excel's fill
|
|
15
|
-
* controls take the Fill section of the elements they edit
|
|
15
|
+
* controls take the Fill section of the elements they edit, and `resolveRange` reads the cells a
|
|
16
|
+
* custom error-bar source names from the workbook.
|
|
16
17
|
*/
|
|
17
|
-
export declare function xlsxChartFormatSource(chart: ChartObject, space: ChartSpace, theme: DrawingColorTheme, target: ChartFormatTarget | undefined): ChartFormatSource;
|
|
18
|
+
export declare function xlsxChartFormatSource(chart: ChartObject, space: ChartSpace, theme: DrawingColorTheme, target: ChartFormatTarget | undefined, resolveRange?: ChartRangeNumbers): ChartFormatSource;
|
package/dist/xlsx.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import { statusLayout, watchStatusWidth, defineChartExOptions } from './chunk-HUR5JAG7.js';
|
|
2
2
|
import { trackPointerGesture } from './chunk-GSXOZCAN.js';
|
|
3
|
-
import { attachShareDialog, effectiveFontDownloads, fontDownloadLock, syncGoogleWebfontStylesheet, prefetchWebfonts, prepareWebfonts, chartExSpaceFormatSource, FONT_DOWNLOADS_DEFAULT, connectedServicesLabels } from './chunk-
|
|
4
|
-
import './chunk-
|
|
3
|
+
import { attachShareDialog, effectiveFontDownloads, fontDownloadLock, syncGoogleWebfontStylesheet, prefetchWebfonts, prepareWebfonts, chartExSpaceFormatSource, FONT_DOWNLOADS_DEFAULT, connectedServicesLabels } from './chunk-XQIZWJEV.js';
|
|
4
|
+
import './chunk-2EBZ6IV6.js';
|
|
5
5
|
import './chunk-DA57FPSN.js';
|
|
6
|
-
import { createHostBackstagePages, syncRibbonAddIns, withHostMenuItems } from './chunk-
|
|
7
|
-
export { RIBBON_ADD_IN_EVENT } from './chunk-
|
|
8
|
-
import { needsPicturePixels, pictureSvg, pictureEffectFilter, SmartArtTextPaneController, defineSmartArt, defineSmartArtPicker, smartArtStylesGalleryState, smartArtColorsGalleryState, safeColor, svgTile } from './chunk-
|
|
9
|
-
import { withExtension, saveExtension, downloadBytes, emit, emitEvent, blobFor, announceFileCommand, pickFile } from './chunk-
|
|
10
|
-
export { XLSX_EDITOR_EVENTS } from './chunk-
|
|
6
|
+
import { createHostBackstagePages, syncRibbonAddIns, withHostMenuItems } from './chunk-Y535PPSZ.js';
|
|
7
|
+
export { RIBBON_ADD_IN_EVENT } from './chunk-Y535PPSZ.js';
|
|
8
|
+
import { needsPicturePixels, pictureSvg, pictureEffectFilter, SmartArtTextPaneController, defineSmartArt, defineSmartArtPicker, smartArtStylesGalleryState, smartArtColorsGalleryState, safeColor, svgTile } from './chunk-X464LPTR.js';
|
|
9
|
+
import { withExtension, saveExtension, downloadBytes, emit, emitEvent, blobFor, announceFileCommand, pickFile } from './chunk-J36LIYGS.js';
|
|
10
|
+
export { XLSX_EDITOR_EVENTS } from './chunk-J36LIYGS.js';
|
|
11
11
|
import './chunk-4ZSZPUE5.js';
|
|
12
12
|
import './chunk-CDAXY5KC.js';
|
|
13
13
|
import './chunk-NDUD5JJB.js';
|
|
14
14
|
import './chunk-KJMAVPQB.js';
|
|
15
15
|
import { legacyThemeAliases, legacyThemeBridge, installOfficeUiThemeFor } from './chunk-6C6S4AWF.js';
|
|
16
|
-
import { range_control_default, createRibbonOverflow, defineBackstage, defineRibbon, defineRibbonActions, defineTitleBar, defineStatusBar, defineZoomSlider, defineChartFormatPane, defineChartDataSheet, confirmDialog, defineOptionsDialog, defineDialog, createDialogSession, optionsLabels, defineConnectedServices, defineOpenPlaces, runKeyTips, assignKeyTips, chartFormatTranslator, chartSpaceFormatSource, CHART_DATA_SHEET_ENGLISH, saveProgressLabel, userInterfaceSection, personalizeSection, optionText, unavailableControl, unavailableCategory, defineGallery, defineContextMenu, rangeControl, defineColorGrid, wireTabDrag, defineCommentsPane, defineChartPicker, createLiveColorInput, handleLiveColorEvent } from './chunk-
|
|
16
|
+
import { range_control_default, createRibbonOverflow, defineBackstage, defineRibbon, defineRibbonActions, defineTitleBar, defineStatusBar, defineZoomSlider, defineChartFormatPane, defineChartDataSheet, confirmDialog, defineOptionsDialog, defineDialog, createDialogSession, optionsLabels, defineConnectedServices, defineOpenPlaces, runKeyTips, assignKeyTips, chartFormatTranslator, chartSpaceFormatSource, CHART_DATA_SHEET_ENGLISH, saveProgressLabel, userInterfaceSection, personalizeSection, optionText, unavailableControl, unavailableCategory, defineGallery, defineContextMenu, rangeControl, defineColorGrid, wireTabDrag, defineCommentsPane, defineChartPicker, createLiveColorInput, handleLiveColorEvent } from './chunk-NSBQACCO.js';
|
|
17
17
|
import { getIcon, registerIcon } from './chunk-M6GF5ED2.js';
|
|
18
|
-
import './chunk-
|
|
18
|
+
import './chunk-JI4ZNPEK.js';
|
|
19
19
|
import { definePresence } from './chunk-FQN4XNEF.js';
|
|
20
20
|
import './chunk-FN7IF6M6.js';
|
|
21
21
|
import { withTokens } from './chunk-4W4QZF4C.js';
|
|
22
22
|
import './chunk-5FMWQWLP.js';
|
|
23
23
|
import { SPECIAL_CODES, FRACTION_CODES, translate, INSERT_CHART_TYPES, AUTOSUM_FUNCTIONS, ICON_ACCENTS, ICON_PATHS, normalizeEditorLocale, EXCEL_CAPABILITY_BACKSTAGE_PAGES, EXCEL_CAPABILITY_COMMANDS, normalizeThemeMode, applyThemeColors, parseSelectionRef, selectionRef, fontCommands, alignmentCommands, numberCommands, editBridge, FONT_SIZES, FONT_NAMES, style, activeRef, numberFormatOptions, selectionFormatting, DirtyState, createCommandRegistry, createDialogRegistry, createSelectionModel, SheetSelections, translator, initialSelection, sheetBaseName, historyOf, onRibbonTabsChange, activeChart, noteFunctionUse, recentFunctions, CellViewCache, QUADRANTS, columnHeaderHeight, rowHeaderWidth, GridGeometry, cellRange, scrollToReveal, buildItems, fitNumber, cssFont, clampAddress, selectCell, movingEnd, extendSelection, moveWithinSelection, rowsRange, colsRange, ALL_RANGE, onAuditChange, setErrorRules, ribbonTabs, isTabHidden, selectTab, setTabHidden, tabButton, searchCommands, formatNumber, target, activeSmartArt, stepMatch, validateReplacements, formatCellsState, isSingleCell, spanRange, selectionCellCount, auditState, setSelectionPane, addRange, TEMPLATES, createTemplateWorkbook, sheetLocked, fillPaint, iconSvg, colSelected, rowSelected, isMenuSeparator, textDecoration, justify, alignItems, textAlign, hasBorders, edgeCss, diagonalSvg, rowHeaderMenu, columnHeaderMenu, tabMenu, cellMenu, registerRibbonTabs, installFormatPainter, SHEET_ICONS, clipboardCommands, cellCommands, editingCommands, pageLayoutCommands, pageBreakCommands, formulaCommands, dataCommands, whatIfCommands, contextualCommands, reviewTab, viewTab, helpTab, editing, icon, DATA_BAR_COLORS, dataBarRule, COLOR_SCALES, colorScaleRule, iconSetRule, tableAt, timelineSourceAt, slicerSourceAt, viewing, activeTable, removeWatch, setWatchWindowOpen, BORDER_PRESETS, ORIENTATIONS, ACCOUNTING_FORMATS, themePaletteItems, MARGIN_PRESETS, PAPER_SIZES, FUNCTION_MENUS, MORE_FUNCTION_CATEGORIES, functionsIn, activeSlicer, activeTimeline, activeStyle, replaceAllValidated, selectSpecial, insertFunctionCall, guessHeader, regionOf, evaluateRef, editChart, suggestForecastEnd, FORECAST_AGGREGATIONS, createForecastSheet, ForecastError, forecastMessage, HIGHLIGHT_STYLES, addWatch, ICON_SETS, TABLE_STYLES, tableStylePreview, resolveNameBox, absoluteReference, nameForRange, orderFrom, buildChart, createScenarioSummary, detectCategory, CATEGORIES, TIME_CODES, DATE_CODES, DEFAULT_OPTIONS, cellStyleItems, SYMBOLS, buildCode, UNSET, dxfCss, negativeCodes, iconCount, iconThresholds, replaceOneValidated, rowsOf, colsOf } from 'ooxml-core/xlsx/ui';
|
|
24
24
|
export { EDITOR_LOCALES, EXCEL_CAPABILITY_IDS, THEME_KEYS, normalizeEditorLocale, registerRibbonTabs, themeToCssVars, darkTheme as xlsxDarkTheme, lightTheme as xlsxLightTheme } from 'ooxml-core/xlsx/ui';
|
|
25
|
-
import { createWorksheet, cellInputText, createEditSession, approximateMeasure, workbookFontFamily, createWorkbook, MAX_ROW, MAX_COL, FUNCTION_CATALOG, collectWorkbookWebfontRuns, createGridMetrics, splitToPx, splitAtCell, mergeAt, splitVisible, visibleCells, getCell, closeParens, isFormulaText, parseCellInput, formatAddress, referenceTarget, navigate, anchorToPixelBox, createRefEvaluator, chartView, renderChartSvg, CHART_FILL_PARTS, selectionOfPeriods, pixelBoxToAnchor, listValidationOptions, validationAt, getValue, hasFilterCriteria, resolvePasteOptions, ERROR_RULES, selectionStats, formatSelectionStat, chartSpaceOf, xlsxChartExDataSheet, pictureAnchorAt, styleAt, effectiveStyleId, nameAtCaret, functionMatches, callAtCaret, acceptsReference, formatRange, splice, translateFormula, slicerStyleColors, slicerGeometry, timelineGeometry, TIMELINE_PERIOD_WIDTH, TIMELINE_METRICS, controlStateIn, controlListItems, formControlSvg, shapeSvg, controlLinkCell, controlValueAtFraction, timelineView, slicerItems, selectionAfterClick, isCellError, filterMenuModel, displayText, layoutRemoteSelections, parseHtmlTable, CUT_MULTIPLE, toggleAbsolute, rangeContains, printRange, chartSeriesTransparencyPatch, chartSeriesTransparency, chartSeriesGradientPatch, chartSeriesSolidFillPatch, chartSeriesFillPatch, chartWithElementFills, chartElementTransparencyPatch, chartElementTransparency, chartElementGradientPatch, chartElementSolidFillPatch, chartElementFillPatch, chartElementFill, chartColorScheme, chartBarSpacing, columnLabel, coloredReferences, syntaxParams, activeParam, drawingSchemeColors, applyControlAction, checklistCriteria, pageBreakPreview, pxToSplit, pasteAreas, normalizeRange, currentRegion, autoFitColumnWidth, chartGradientStopTransparency, paginateWorksheet, colorFilterCriteria, clampSplitBar, resolveColor, DEFAULT_THEME, pageHeaderFooter, createPrintMergeIndex, cellView, pixelsToColumnWidth, renderHeaderFooterRuns, planBreakDrag, resizePrintArea, headerFooterPicture, nextSheetName, sheetByName, pivotGroupableFields, pivotGroupableDateFields, pivotSubtotalFields, DEFAULT_COL_WIDTH, pageViewLayout, formatValue, isDateFormat, selectedSparklineGroups, pivotTableAt, FormulaStepper, findErrors, adjacentIssue, withIgnoredError, parseNumberText, validateDefinedName, usedRange, pivotAxisChoices, parseAddress, PIVOT_DATE_UNITS, PIVOT_SUBTOTAL_ORDER, parseRange, decodeCondition, customFilter, topFilterCriteria, parseInputCell, serialToDate, rangesIntersect, watchExists, describeWatch, watchValueText, chartStylePresetOf, chartTakesQuickLayout, SLICER_STYLE_NAMES, slicerStyleLabel, slicerStylePreview, pageViewCellRect, pageOfCell, validateSheetName, dateToSerial, IMAGE_EXTENSIONS, verifySheetPassword, verifyWorkbookPassword, quoteSheetName, pivotRowFields, pivotValuesIndex, pivotSourceData, defaultFieldGroup, defaultDateGroup, dateGroupDays, pivotIsoToSerial, fieldSubtotalFunctions, printTitles, formatPrintTitleSpan, parsePrintTitleSpan, parseBreakPositions, splitFixedWidth, splitDelimited, scenariosOf, parseSortList, PAGE_VIEW_GAP, pivotPageItems, pivotPageItemLabel, pivotSerialToIso, previewScenario, customViewsOf, BUILTIN_NUMBER_FORMATS, BUILT_IN_SORT_LISTS, sortChoices, validateTableName, pixelsToEmu, pageViewHit, resizedFrameAnchor, headerFooterKey, splitHeaderFooter, composeHeaderFooter } from 'ooxml-core/xlsx';
|
|
25
|
+
import { createWorksheet, cellInputText, createEditSession, approximateMeasure, workbookFontFamily, createWorkbook, MAX_ROW, MAX_COL, FUNCTION_CATALOG, collectWorkbookWebfontRuns, createGridMetrics, splitToPx, splitAtCell, mergeAt, splitVisible, visibleCells, getCell, closeParens, isFormulaText, parseCellInput, formatAddress, referenceTarget, navigate, anchorToPixelBox, createRefEvaluator, chartView, renderChartSvg, CHART_FILL_PARTS, selectionOfPeriods, pixelBoxToAnchor, listValidationOptions, validationAt, getValue, hasFilterCriteria, resolvePasteOptions, ERROR_RULES, selectionStats, formatSelectionStat, chartSpaceOf, workbookChartRangeNumbers, xlsxChartExDataSheet, pictureAnchorAt, styleAt, effectiveStyleId, nameAtCaret, functionMatches, callAtCaret, acceptsReference, formatRange, splice, translateFormula, slicerStyleColors, slicerGeometry, timelineGeometry, TIMELINE_PERIOD_WIDTH, TIMELINE_METRICS, controlStateIn, controlListItems, formControlSvg, shapeSvg, controlLinkCell, controlValueAtFraction, timelineView, slicerItems, selectionAfterClick, isCellError, filterMenuModel, displayText, layoutRemoteSelections, parseHtmlTable, CUT_MULTIPLE, toggleAbsolute, rangeContains, printRange, chartSeriesTransparencyPatch, chartSeriesTransparency, chartSeriesGradientPatch, chartSeriesSolidFillPatch, chartSeriesFillPatch, chartWithElementFills, chartElementTransparencyPatch, chartElementTransparency, chartElementGradientPatch, chartElementSolidFillPatch, chartElementFillPatch, chartElementFill, chartColorScheme, chartBarSpacing, columnLabel, coloredReferences, syntaxParams, activeParam, drawingSchemeColors, applyControlAction, checklistCriteria, pageBreakPreview, pxToSplit, pasteAreas, normalizeRange, currentRegion, autoFitColumnWidth, chartGradientStopTransparency, paginateWorksheet, colorFilterCriteria, clampSplitBar, resolveColor, DEFAULT_THEME, pageHeaderFooter, createPrintMergeIndex, cellView, pixelsToColumnWidth, renderHeaderFooterRuns, planBreakDrag, resizePrintArea, headerFooterPicture, nextSheetName, sheetByName, pivotGroupableFields, pivotGroupableDateFields, pivotSubtotalFields, DEFAULT_COL_WIDTH, pageViewLayout, formatValue, isDateFormat, selectedSparklineGroups, pivotTableAt, FormulaStepper, findErrors, adjacentIssue, withIgnoredError, parseNumberText, validateDefinedName, usedRange, pivotAxisChoices, parseAddress, PIVOT_DATE_UNITS, PIVOT_SUBTOTAL_ORDER, parseRange, decodeCondition, customFilter, topFilterCriteria, parseInputCell, serialToDate, rangesIntersect, watchExists, describeWatch, watchValueText, chartStylePresetOf, chartTakesQuickLayout, SLICER_STYLE_NAMES, slicerStyleLabel, slicerStylePreview, pageViewCellRect, pageOfCell, validateSheetName, dateToSerial, IMAGE_EXTENSIONS, verifySheetPassword, verifyWorkbookPassword, quoteSheetName, pivotRowFields, pivotValuesIndex, pivotSourceData, defaultFieldGroup, defaultDateGroup, dateGroupDays, pivotIsoToSerial, fieldSubtotalFunctions, printTitles, formatPrintTitleSpan, parsePrintTitleSpan, parseBreakPositions, splitFixedWidth, splitDelimited, scenariosOf, parseSortList, PAGE_VIEW_GAP, pivotPageItems, pivotPageItemLabel, pivotSerialToIso, previewScenario, customViewsOf, BUILTIN_NUMBER_FORMATS, BUILT_IN_SORT_LISTS, sortChoices, validateTableName, pixelsToEmu, pageViewHit, resizedFrameAnchor, headerFooterKey, splitHeaderFooter, composeHeaderFooter } from 'ooxml-core/xlsx';
|
|
26
26
|
import { isCapabilityEnabled, capabilityHiddenActions, saveToStorage, documentSaveMeta, withoutHiddenEntries } from 'ooxml-core/embedding';
|
|
27
27
|
import { hyperlinkPolicy } from 'ooxml-core/opc';
|
|
28
|
-
import { previewDiagramLayout, resolveDiagramDrawingStyles, DIAGRAM_INSERT_CATEGORIES, DIAGRAM_INSERT_PRESETS, RECT_GRADIENT_DIRECTIONS, OFFICE_GRADIENT_PRESETS, officeGradientPresetId, officeGradientPresetFill, resolveDrawingColor, drawingColorBrightness, drawingColorCss, rectGradientDirection, DIAGRAM_DESIGN_COMMANDS,
|
|
28
|
+
import { previewDiagramLayout, resolveDiagramDrawingStyles, DIAGRAM_INSERT_CATEGORIES, DIAGRAM_INSERT_PRESETS, RECT_GRADIENT_DIRECTIONS, OFFICE_GRADIENT_PRESETS, officeGradientPresetId, officeGradientPresetFill, resolveDrawingColor, drawingColorBrightness, drawingColorCss, rectGradientDirection, DIAGRAM_DESIGN_COMMANDS, appliedDiagramNativeId, findDiagramNativeColor, findDiagramNativeStyle, DIAGRAM_ADD_SHAPE_LABEL, DIAGRAM_DESIGN_GROUPS, DIAGRAM_ADD_SHAPE_COMMANDS } from 'ooxml-core/diagram';
|
|
29
29
|
import { parseChartFormatTargetKey, resolveChartGradient, sortGradientStops, withChartGradientDirection, buildChartGradientDef, chartGradientMarkup, applyChartExEditAction, applyChartExSpaceDataSheetEdits, applyChartExEditIntent, CHART_STYLE_PRESETS, CHART_COLOR_PALETTES, CHART_QUICK_LAYOUTS, chartPaletteColors } from 'ooxml-core/chart';
|
|
30
30
|
import { render } from 'lit';
|
|
31
31
|
import { normalizeLocale } from 'ooxml-core/i18n';
|
|
@@ -11050,6 +11050,11 @@ function chooseSmartArt(ctx) {
|
|
|
11050
11050
|
|
|
11051
11051
|
// src/xlsx/smartart-controller.ts
|
|
11052
11052
|
var DEFAULT_SIZE = { width: 480, height: 280 };
|
|
11053
|
+
var styleLibrary;
|
|
11054
|
+
var styleLibraryLoad;
|
|
11055
|
+
var loadStyleLibrary = () => styleLibraryLoad ??= import('ooxml-core/diagram/builtin').then(
|
|
11056
|
+
(module) => styleLibrary = module
|
|
11057
|
+
);
|
|
11053
11058
|
var ICONS = {
|
|
11054
11059
|
addAfter: "smartArtAddShape",
|
|
11055
11060
|
addBefore: "smartArtAddShape",
|
|
@@ -11183,18 +11188,23 @@ function smartArtCommands() {
|
|
|
11183
11188
|
label: kind === "colors" ? "Change Colors" : "SmartArt Styles",
|
|
11184
11189
|
icon: icon("smartArt"),
|
|
11185
11190
|
lock: "objects",
|
|
11186
|
-
enabled: (ctx) =>
|
|
11187
|
-
|
|
11191
|
+
enabled: (ctx) => {
|
|
11192
|
+
const active2 = !!activeSmartArt(ctx);
|
|
11193
|
+
if (active2 && !styleLibrary) void loadStyleLibrary().catch(() => void 0);
|
|
11194
|
+
return active2;
|
|
11195
|
+
},
|
|
11196
|
+
run: async (ctx, arg) => {
|
|
11188
11197
|
const found = activeSmartArt(ctx);
|
|
11189
11198
|
const t = target(ctx);
|
|
11190
|
-
|
|
11191
|
-
|
|
11192
|
-
|
|
11193
|
-
|
|
11194
|
-
|
|
11195
|
-
|
|
11196
|
-
|
|
11197
|
-
|
|
11199
|
+
const id = typeof arg === "string" ? appliedDiagramNativeId(kind, `${kind}/${arg}`) : void 0;
|
|
11200
|
+
const choice = kind === "colors" ? findDiagramNativeColor(id) : findDiagramNativeStyle(id);
|
|
11201
|
+
if (!found || !t || !choice) return;
|
|
11202
|
+
const { builtinSmartArtFormatChange } = styleLibrary ?? await loadStyleLibrary();
|
|
11203
|
+
t.session.formatSmartArt(
|
|
11204
|
+
t.sheet,
|
|
11205
|
+
found.index,
|
|
11206
|
+
builtinSmartArtFormatChange(kind, choice.uniqueId)
|
|
11207
|
+
);
|
|
11198
11208
|
}
|
|
11199
11209
|
})
|
|
11200
11210
|
),
|
|
@@ -12000,7 +12010,7 @@ function smartArtDesignTab() {
|
|
|
12000
12010
|
sections: (ctx) => gallerySections(
|
|
12001
12011
|
smartArtStylesGalleryState(
|
|
12002
12012
|
smartArtSchemeColors(ctx.workbook()?.theme).accent1,
|
|
12003
|
-
activeSmartArt(ctx)?.smartArt.quickStyleId
|
|
12013
|
+
activeSmartArt(ctx)?.smartArt.quickStyleId,
|
|
12004
12014
|
(key) => ctx.t(key)
|
|
12005
12015
|
).sections
|
|
12006
12016
|
)
|
|
@@ -12012,7 +12022,7 @@ function smartArtDesignTab() {
|
|
|
12012
12022
|
sections: (ctx) => gallerySections(
|
|
12013
12023
|
smartArtColorsGalleryState(
|
|
12014
12024
|
smartArtSchemeColors(ctx.workbook()?.theme),
|
|
12015
|
-
activeSmartArt(ctx)?.smartArt.colorsId
|
|
12025
|
+
activeSmartArt(ctx)?.smartArt.colorsId,
|
|
12016
12026
|
(key) => ctx.t(key)
|
|
12017
12027
|
).sections
|
|
12018
12028
|
)
|
|
@@ -13146,8 +13156,11 @@ function workbookChartTheme(workbook) {
|
|
|
13146
13156
|
}
|
|
13147
13157
|
var FILL_PARTS = ["chartArea", "plotArea", "title", "legend", "series"];
|
|
13148
13158
|
var xlsxFillsTarget = (target44) => FILL_PARTS.includes(target44.kind);
|
|
13149
|
-
function xlsxChartFormatSource(chart, space, theme, target44) {
|
|
13150
|
-
const source = chartSpaceFormatSource(space, {
|
|
13159
|
+
function xlsxChartFormatSource(chart, space, theme, target44, resolveRange) {
|
|
13160
|
+
const source = chartSpaceFormatSource(space, {
|
|
13161
|
+
theme,
|
|
13162
|
+
...resolveRange ? { resolveRange } : {}
|
|
13163
|
+
});
|
|
13151
13164
|
const spacing = chartBarSpacing(chart);
|
|
13152
13165
|
return {
|
|
13153
13166
|
...source,
|
|
@@ -14260,7 +14273,14 @@ function createChartFormatPane(ctx) {
|
|
|
14260
14273
|
active2.refresh(void 0, void 0);
|
|
14261
14274
|
active2.element.remove();
|
|
14262
14275
|
}
|
|
14263
|
-
|
|
14276
|
+
const sheet = book.sheets[ctx.activeSheet()];
|
|
14277
|
+
element.source = xlsxChartFormatSource(
|
|
14278
|
+
found.chart,
|
|
14279
|
+
space,
|
|
14280
|
+
theme,
|
|
14281
|
+
selected2,
|
|
14282
|
+
sheet && workbookChartRangeNumbers(book, sheet)
|
|
14283
|
+
);
|
|
14264
14284
|
element.target = target44;
|
|
14265
14285
|
element.disabled = !ctx.commands.isEnabled(commandId());
|
|
14266
14286
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ooxml-ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.53.0",
|
|
4
4
|
"description": "Shared, format-neutral web components and styles for the Office viewers (Word, PowerPoint, Excel)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"custom-elements",
|
|
@@ -176,7 +176,7 @@
|
|
|
176
176
|
"dompurify": "^3.4.17",
|
|
177
177
|
"emf-converter": "4.25.4",
|
|
178
178
|
"lit": "^3.3.3",
|
|
179
|
-
"ooxml-core": "^1.
|
|
179
|
+
"ooxml-core": "^1.52.0",
|
|
180
180
|
"opentype.js": "^2.0.0",
|
|
181
181
|
"prosemirror-collab": "^1.3.1",
|
|
182
182
|
"prosemirror-commands": "^1.7.2",
|