ooxml-ui 1.40.0 → 1.41.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/README.md +1 -1
- package/custom-elements.json +480 -0
- package/dist/base.d.ts +0 -1
- package/dist/building-block-styles.d.ts +0 -1
- package/dist/chart/data-sheet-keys.d.ts +0 -1
- package/dist/chart/data-sheet.d.ts +1 -2
- package/dist/chart/format-pane-advanced-space.d.ts +0 -1
- package/dist/chart/format-pane-analysis.d.ts +0 -1
- package/dist/chart/format-pane-fields.d.ts +0 -1
- package/dist/chart/format-pane-fill-line.d.ts +0 -1
- package/dist/chart/format-pane-intent.d.ts +0 -1
- package/dist/chart/format-pane-locales/de.d.ts +0 -1
- package/dist/chart/format-pane-locales/en.d.ts +0 -1
- package/dist/chart/format-pane-text.d.ts +0 -1
- package/dist/chart/format-pane-translate.d.ts +0 -1
- package/dist/chrome/account.d.ts +1 -2
- package/dist/chrome/print-preview.d.ts +1 -2
- package/dist/chrome/ruler.d.ts +1 -2
- package/dist/chrome/status-bar.d.ts +1 -2
- package/dist/chrome/tab-drag.d.ts +0 -1
- package/dist/chrome/task-pane.d.ts +1 -2
- package/dist/chunk-4RFFOPBU.js +90 -0
- package/dist/{chunk-BOTLS2PR.js → chunk-4ZSZPUE5.js} +20 -0
- package/dist/{chunk-XL77FR4B.js → chunk-6EOS74O4.js} +6 -0
- package/dist/{chunk-GZNBWWJ5.js → chunk-6FFZFH73.js} +43 -27
- package/dist/{chunk-FYBLAPAJ.js → chunk-7L4NP4HN.js} +149 -76
- package/dist/{chunk-QLHCGV4C.js → chunk-FE5KE5TR.js} +1 -1
- package/dist/{chunk-C4KI635Q.js → chunk-II43ALTT.js} +1 -1
- package/dist/{chunk-6VF4FEMY.js → chunk-LBIABP4I.js} +1 -1
- package/dist/{chunk-T5ARELU2.js → chunk-N6AKS4ED.js} +1 -1
- package/dist/{chunk-YZH2QS7J.js → chunk-Q6WZEGAM.js} +1 -1
- package/dist/{chunk-IZ7XMMMJ.js → chunk-TTT5IQBU.js} +10 -5
- package/dist/{chunk-QAX4FAB7.js → chunk-Y6KY34VD.js} +1632 -202
- package/dist/comments/mentions.d.ts +0 -1
- package/dist/comments/types.d.ts +0 -1
- package/dist/controls.d.ts +16 -3
- package/dist/controls.d.ts.map +1 -1
- package/dist/controls.js +4 -4
- 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-dialog.d.ts +84 -0
- package/dist/dialog/message-dialog.d.ts.map +1 -0
- package/dist/dialog/message-dialogs.d.ts +38 -0
- package/dist/dialog/message-dialogs.d.ts.map +1 -0
- package/dist/dialog/options-categories.d.ts +0 -1
- package/dist/dialog/options-controls.d.ts +0 -1
- package/dist/dialog/progress-dialog.d.ts +1 -2
- package/dist/dialog/share-controller.d.ts +38 -0
- package/dist/dialog/share-dialog-locales.d.ts +47 -0
- package/dist/dialog/share-dialog-locales.d.ts.map +1 -0
- package/dist/dialog/share-dialog.d.ts +121 -0
- package/dist/dialog/share-dialog.d.ts.map +1 -0
- package/dist/docx/backstage-account.d.ts +3 -0
- package/dist/docx/backstage-open.d.ts +4 -0
- package/dist/docx/backstage-pages.d.ts +8 -1
- package/dist/docx/backstage.d.ts +1 -1
- package/dist/docx/cloud-labels.d.ts +4 -0
- package/dist/docx/editor-chrome.d.ts +16 -1
- package/dist/docx/editor-core.d.ts +13 -1
- package/dist/docx/element-api.d.ts +17 -1
- package/dist/docx/file-commands.d.ts +2 -2
- package/dist/docx/locales/en-app.d.ts +36 -0
- package/dist/docx/locales/en.d.ts +36 -0
- package/dist/docx/localization-strings.d.ts +36 -0
- package/dist/docx.js +402 -54
- package/dist/files/cloud-files-labels.d.ts +44 -0
- package/dist/files/cloud-files-labels.d.ts.map +1 -0
- package/dist/files/cloud-files-view.d.ts +42 -0
- package/dist/files/cloud-files-view.d.ts.map +1 -0
- package/dist/files/cloud-files.d.ts +130 -0
- package/dist/files/cloud-files.d.ts.map +1 -0
- package/dist/files/connected-services-labels.d.ts +6 -0
- package/dist/files/connected-services.d.ts +70 -0
- package/dist/files/connected-services.d.ts.map +1 -0
- package/dist/files/open-places.d.ts +58 -0
- package/dist/files/open-places.d.ts.map +1 -0
- 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/checkbox.d.ts +1 -2
- 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-leaves.d.ts +0 -1
- package/dist/form/radio.d.ts +1 -2
- package/dist/form/search-field.d.ts +1 -2
- package/dist/form/symbol-picker.d.ts +1 -2
- package/dist/form/zoom-slider.d.ts +1 -2
- package/dist/image-native-size.d.ts +0 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +10 -10
- package/dist/menu/command-search.d.ts +1 -2
- package/dist/menu/context-menu.d.ts +1 -2
- package/dist/menu/menu-item.d.ts +1 -2
- package/dist/notices/paste-options.d.ts +1 -2
- package/dist/notices/read-only-banner.d.ts.map +1 -1
- package/dist/notices/toasts.d.ts +1 -2
- package/dist/picture-effects.d.ts +0 -1
- package/dist/picture-pixels.d.ts.map +1 -1
- package/dist/picture-standard-filter.d.ts +0 -1
- package/dist/picture-view.d.ts +0 -1
- package/dist/pptx/{chart-3d-view-scene-V55XPBBF.cjs → chart-3d-view-scene-C7QUQTXD.cjs} +37 -37
- package/dist/pptx/{chart-3d-view-scene-BKNMGRGO.mjs → chart-3d-view-scene-CGLU6ISD.mjs} +2 -2
- package/dist/pptx/{chunk-ZLK243QC.cjs → chunk-4SZSTDER.cjs} +49 -49
- package/dist/pptx/{chunk-S5VKG3XJ.cjs → chunk-7XXOLM7H.cjs} +1 -1
- package/dist/pptx/{chunk-WZHYA2B3.mjs → chunk-DH6EKOVI.mjs} +1 -1
- package/dist/pptx/{chunk-MK2ASJSY.mjs → chunk-G4VNRJUX.mjs} +6 -0
- package/dist/pptx/{chunk-BLONL4S7.mjs → chunk-IN46QNJE.mjs} +1 -1
- package/dist/pptx/{chunk-NUB6VP7R.mjs → chunk-J6PRXB72.mjs} +6986 -2851
- package/dist/pptx/{chunk-HIRBPTML.cjs → chunk-JP26TA3Q.cjs} +12 -12
- package/dist/pptx/{chunk-XTC6MQYM.mjs → chunk-JU3ZV73R.mjs} +3 -3
- package/dist/pptx/{chunk-XWAX3PZO.cjs → chunk-RN3JVXVN.cjs} +7198 -3021
- package/dist/pptx/{chunk-WQI3NLMY.mjs → chunk-SF3MYUTD.mjs} +41 -0
- package/dist/pptx/{chunk-QK6LJT3K.mjs → chunk-TW5UQCZS.mjs} +7 -17
- package/dist/pptx/{chunk-CRV7G4GC.cjs → chunk-WNDGU3GQ.cjs} +41 -0
- package/dist/pptx/{chunk-3ESFHUZI.cjs → chunk-XZSGVMRN.cjs} +6 -0
- package/dist/pptx/{chunk-KJICUZXM.cjs → chunk-YZWKNFPU.cjs} +6 -16
- package/dist/pptx/dom/elements/shape-filter-defs.d.ts.map +1 -1
- package/dist/pptx/dom/elements/text-shape.d.ts.map +1 -1
- package/dist/pptx/dom/index.cjs +434 -428
- package/dist/pptx/dom/index.mjs +17 -11
- package/dist/pptx/dom/slide-stage.d.ts.map +1 -1
- package/dist/pptx/dom/types.d.ts +8 -1
- package/dist/pptx/dom/types.d.ts.map +1 -1
- package/dist/pptx/export/html2canvas-clone.cjs +6 -6
- package/dist/pptx/export/html2canvas-clone.mjs +1 -1
- package/dist/pptx/export/presentation-save.d.ts +15 -0
- package/dist/pptx/export/presentation-save.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.d.ts.map +1 -1
- package/dist/pptx/index.cjs +3541 -3373
- package/dist/pptx/index.mjs +6 -6
- package/dist/pptx/render/abutting-edge-bleed-style.d.ts +24 -0
- package/dist/pptx/render/abutting-edge-bleed-style.d.ts.map +1 -0
- package/dist/pptx/render/abutting-edge-bleed.d.ts +56 -0
- package/dist/pptx/render/abutting-edge-bleed.d.ts.map +1 -0
- 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-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/cloud-open.d.ts +56 -0
- package/dist/pptx/render/cloud-open.d.ts.map +1 -0
- package/dist/pptx/render/connector-style.d.ts +2 -2
- package/dist/pptx/render/connector-style.d.ts.map +1 -1
- package/dist/pptx/render/element-style-transform.d.ts +11 -3
- package/dist/pptx/render/element-style-transform.d.ts.map +1 -1
- package/dist/pptx/render/fill-style.d.ts.map +1 -1
- package/dist/pptx/render/index.d.ts +11 -0
- package/dist/pptx/render/index.d.ts.map +1 -1
- package/dist/pptx/render/inline-list-presentation.d.ts.map +1 -1
- package/dist/pptx/render/morph-animation.d.ts +23 -11
- package/dist/pptx/render/morph-animation.d.ts.map +1 -1
- package/dist/pptx/render/morph-body-carry.d.ts +8 -0
- package/dist/pptx/render/morph-body-carry.d.ts.map +1 -0
- package/dist/pptx/render/morph-carry.d.ts +60 -0
- package/dist/pptx/render/morph-carry.d.ts.map +1 -0
- package/dist/pptx/render/morph-easing.d.ts +37 -0
- package/dist/pptx/render/morph-easing.d.ts.map +1 -0
- package/dist/pptx/render/morph-effect-carry.d.ts +75 -0
- package/dist/pptx/render/morph-effect-carry.d.ts.map +1 -0
- package/dist/pptx/render/morph-effect-glow.d.ts +42 -0
- package/dist/pptx/render/morph-effect-glow.d.ts.map +1 -0
- package/dist/pptx/render/morph-effect-parse.d.ts +10 -0
- package/dist/pptx/render/morph-effect-parse.d.ts.map +1 -0
- package/dist/pptx/render/morph-effect-shadow.d.ts +71 -0
- package/dist/pptx/render/morph-effect-shadow.d.ts.map +1 -0
- package/dist/pptx/render/morph-flatten.d.ts +2 -2
- package/dist/pptx/render/morph-flip-turn.d.ts +55 -0
- package/dist/pptx/render/morph-flip-turn.d.ts.map +1 -0
- package/dist/pptx/render/morph-geometry-key.d.ts +30 -0
- package/dist/pptx/render/morph-geometry-key.d.ts.map +1 -0
- package/dist/pptx/render/morph-image-crop.d.ts.map +1 -1
- package/dist/pptx/render/morph-matching.d.ts.map +1 -1
- package/dist/pptx/render/morph-outline-blend.d.ts +7 -0
- package/dist/pptx/render/morph-outline-blend.d.ts.map +1 -0
- package/dist/pptx/render/morph-overlay-order.d.ts +1 -1
- package/dist/pptx/render/morph-overlay-stack.d.ts +85 -0
- package/dist/pptx/render/morph-overlay-stack.d.ts.map +1 -0
- package/dist/pptx/render/morph-plan.d.ts +73 -1
- package/dist/pptx/render/morph-plan.d.ts.map +1 -1
- package/dist/pptx/render/morph-predicates.d.ts.map +1 -1
- package/dist/pptx/render/morph-shape-carry-path.d.ts +40 -0
- package/dist/pptx/render/morph-shape-carry-path.d.ts.map +1 -0
- package/dist/pptx/render/morph-shape-carry.d.ts +73 -0
- package/dist/pptx/render/morph-shape-carry.d.ts.map +1 -0
- package/dist/pptx/render/morph-text-bands.d.ts +44 -0
- package/dist/pptx/render/morph-text-bands.d.ts.map +1 -0
- package/dist/pptx/render/morph-text-baseline.d.ts +47 -0
- package/dist/pptx/render/morph-text-baseline.d.ts.map +1 -0
- package/dist/pptx/render/morph-text-blend.d.ts +71 -0
- package/dist/pptx/render/morph-text-blend.d.ts.map +1 -0
- package/dist/pptx/render/morph-text-body-copies.d.ts +51 -0
- package/dist/pptx/render/morph-text-body-copies.d.ts.map +1 -0
- package/dist/pptx/render/morph-text-body.d.ts +31 -0
- package/dist/pptx/render/morph-text-body.d.ts.map +1 -0
- package/dist/pptx/render/morph-text-flip.d.ts +49 -0
- package/dist/pptx/render/morph-text-flip.d.ts.map +1 -0
- package/dist/pptx/render/morph-text-frame-read.d.ts +97 -0
- package/dist/pptx/render/morph-text-frame-read.d.ts.map +1 -0
- package/dist/pptx/render/morph-text-frame.d.ts +66 -0
- package/dist/pptx/render/morph-text-frame.d.ts.map +1 -0
- package/dist/pptx/render/morph-text-ink.d.ts +43 -0
- package/dist/pptx/render/morph-text-ink.d.ts.map +1 -0
- package/dist/pptx/render/morph-text-lines.d.ts +73 -0
- package/dist/pptx/render/morph-text-lines.d.ts.map +1 -0
- package/dist/pptx/render/morph-text-piece-plan.d.ts +37 -0
- package/dist/pptx/render/morph-text-piece-plan.d.ts.map +1 -0
- package/dist/pptx/render/morph-text-pieces.d.ts +87 -0
- package/dist/pptx/render/morph-text-pieces.d.ts.map +1 -0
- package/dist/pptx/render/morph-text-slot.d.ts +19 -4
- package/dist/pptx/render/morph-text-slot.d.ts.map +1 -1
- package/dist/pptx/render/morph-text-spans.d.ts +27 -0
- package/dist/pptx/render/morph-text-spans.d.ts.map +1 -0
- package/dist/pptx/render/morph-text-transform.d.ts +108 -0
- package/dist/pptx/render/morph-text-transform.d.ts.map +1 -0
- package/dist/pptx/render/morph-types.d.ts +79 -38
- package/dist/pptx/render/morph-types.d.ts.map +1 -1
- package/dist/pptx/render/paragraph-baseline.d.ts +87 -0
- package/dist/pptx/render/paragraph-baseline.d.ts.map +1 -0
- package/dist/pptx/render/paragraph-spacing.d.ts +29 -66
- package/dist/pptx/render/paragraph-spacing.d.ts.map +1 -1
- package/dist/pptx/render/paragraph-types.d.ts +7 -0
- package/dist/pptx/render/paragraph-types.d.ts.map +1 -1
- package/dist/pptx/render/presentation-action.d.ts +3 -2
- package/dist/pptx/render/presentation-action.d.ts.map +1 -1
- package/dist/pptx/render/read-only-badge.d.ts +23 -0
- package/dist/pptx/render/read-only-badge.d.ts.map +1 -0
- package/dist/pptx/render/share-session.d.ts +4 -7
- package/dist/pptx/render/share-session.d.ts.map +1 -1
- package/dist/pptx/render/stroke-clip-edge.d.ts +6 -1
- package/dist/pptx/render/stroke-clip-edge.d.ts.map +1 -1
- package/dist/pptx/render/stroke-compound-strands.d.ts +30 -0
- package/dist/pptx/render/stroke-compound-strands.d.ts.map +1 -0
- package/dist/pptx/render/stroke-outline.d.ts.map +1 -1
- package/dist/pptx/render/table-cell-paragraphs.d.ts.map +1 -1
- package/dist/pptx/render/text-block-style.d.ts.map +1 -1
- package/dist/pptx/render/text-flip-compensation.d.ts +51 -0
- package/dist/pptx/render/text-flip-compensation.d.ts.map +1 -0
- package/dist/pptx/render/text-paragraphs.d.ts.map +1 -1
- package/dist/pptx/render/transition-template-elements.d.ts +33 -0
- package/dist/pptx/render/transition-template-elements.d.ts.map +1 -0
- package/dist/pptx/render/viewer-api-guard.d.ts +36 -0
- package/dist/pptx/render/viewer-api-guard.d.ts.map +1 -0
- package/dist/pptx/render/viewer-dialogs.d.ts +31 -0
- package/dist/pptx/render/viewer-dialogs.d.ts.map +1 -0
- package/dist/pptx/render/viewer-hyperlinks.d.ts +2 -1
- package/dist/pptx/render/viewer-hyperlinks.d.ts.map +1 -1
- package/dist/pptx/render/viewer-props-manifest.d.ts.map +1 -1
- package/dist/pptx/{smartart-insert-preview-BP4WAD5U.mjs → smartart-insert-preview-GA6ELFRB.mjs} +7 -7
- package/dist/pptx/{smartart-insert-preview-USGRDZHJ.cjs → smartart-insert-preview-PQTEVG7C.cjs} +8 -8
- package/dist/pptx/theme/index.cjs +18 -18
- package/dist/pptx/theme/index.mjs +1 -1
- package/dist/pptx/web-components/index.d.ts.map +1 -1
- package/dist/pptx/web-components/office-aliases.d.ts +4 -0
- package/dist/pptx/web-components/office-aliases.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/presence.js +3 -3
- package/dist/{presentation-preview-ZVJNGOJO.js → presentation-preview-KGBTDTNM.js} +1 -1
- package/dist/render-cache.d.ts +0 -1
- package/dist/ribbon/auto-collapse.d.ts +0 -1
- package/dist/ribbon/button.d.ts +1 -2
- package/dist/ribbon/gallery-styles.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-section.d.ts +1 -2
- package/dist/ribbon/ribbon-stack.d.ts +1 -2
- package/dist/ribbon/safe-svg.d.ts +0 -1
- package/dist/ribbon/scroll-more.d.ts +0 -1
- package/dist/smartart/smartart-picker.d.ts +1 -2
- package/dist/smartart/smartart-text-pane-tools.d.ts +0 -1
- package/dist/smartart.js +3 -3
- package/dist/suite/document-store.d.ts +10 -0
- package/dist/suite.js +45 -6
- package/dist/teams/app/content-preview.d.ts +1 -1
- package/dist/teams/app/dialogs.d.ts +18 -0
- package/dist/teams/app/teams-app.d.ts +8 -0
- package/dist/teams/i18n/locales/de.d.ts +4 -0
- package/dist/teams/i18n/locales/en/shell.d.ts +4 -0
- package/dist/teams/i18n/locales/en.d.ts +4 -0
- package/dist/teams/i18n/locales/es.d.ts +4 -0
- package/dist/teams/i18n/locales/fr.d.ts +4 -0
- package/dist/teams/i18n/locales/zh-CN.d.ts +4 -0
- package/dist/teams.js +7 -7
- package/dist/theme-bridge.d.ts +0 -1
- package/dist/theme.js +2 -2
- package/dist/tokens.d.ts +5 -0
- package/dist/tokens.d.ts.map +1 -1
- package/dist/visio/binding.d.ts +3 -0
- package/dist/visio/controller.d.ts +2 -0
- package/dist/visio/locales/cloud-files.d.ts +4 -0
- package/dist/visio/viewer-backstage.d.ts +5 -1
- package/dist/visio/viewer-cloud-places.d.ts +16 -0
- package/dist/visio/viewer-connected-services.d.ts +13 -0
- package/dist/visio/viewer-element.d.ts +16 -1
- package/dist/visio/viewer-share-ui.d.ts +27 -0
- package/dist/visio/viewer-share.d.ts +7 -2
- package/dist/visio.js +476 -69
- package/dist/xlsx/backstage/cloud-labels.d.ts +4 -0
- package/dist/xlsx/backstage/index.d.ts +1 -1
- package/dist/xlsx/backstage/pages-account.d.ts +2 -0
- package/dist/xlsx/backstage/pages-file.d.ts +0 -1
- package/dist/xlsx/backstage/pages-open.d.ts +2 -0
- package/dist/xlsx/backstage/pages-share.d.ts +5 -6
- package/dist/xlsx/backstage/parts.d.ts +5 -0
- package/dist/xlsx/component.d.ts +8 -0
- package/dist/xlsx/editor-core.d.ts +10 -1
- package/dist/xlsx/editor-files.d.ts +14 -1
- package/dist/xlsx/editor-shell.d.ts +3 -0
- package/dist/xlsx/element-api.d.ts +14 -5
- package/dist/xlsx.js +247 -89
- package/package.json +3 -3
- package/dist/chunk-7RRN2GPO.js +0 -19
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createIconSvg, paintIcon, getIcon } from './chunk-M6GF5ED2.js';
|
|
2
2
|
import { CHART_FORMAT_STRINGS, CHART_FORMAT_LOCALES } from './chunk-4OBMFPGF.js';
|
|
3
|
-
import { initialsOf } from './chunk-
|
|
3
|
+
import { initialsOf } from './chunk-Q6WZEGAM.js';
|
|
4
4
|
import { parseSvgPreview } from './chunk-FN7IF6M6.js';
|
|
5
|
-
import { OfficeElement, controlStyles, definer, valueOn, flag, present, emit, triState, withTokens } from './chunk-
|
|
6
|
-
import { tok, OFFICE_TOKENS } from './chunk-
|
|
5
|
+
import { OfficeElement, controlStyles, definer, valueOn, flag, present, emit, triState, withTokens } from './chunk-FE5KE5TR.js';
|
|
6
|
+
import { tok, OFFICE_TOKENS } from './chunk-6EOS74O4.js';
|
|
7
7
|
import { html, LitElement, nothing, render, svg } from 'lit';
|
|
8
8
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
9
9
|
import { repeat } from 'lit/directives/repeat.js';
|
|
@@ -15,6 +15,7 @@ import { resolveDrawingColor } from 'ooxml-core/drawingml';
|
|
|
15
15
|
import { keyed } from 'lit/directives/keyed.js';
|
|
16
16
|
import { OFFICE_STANDARD_COLORS, normalizePaletteHex, buildThemePalette, hslToRgb, toHex, hexToRgbChannels, rgbToHsl } from 'ooxml-core/color';
|
|
17
17
|
import { parseLocaleNumber, formatLocaleNumber, parseTsv } from 'ooxml-core/text';
|
|
18
|
+
import { COLLABORATION_OFF_STATE, suggestRoomId, joinShareOptions, startShareOptions, shareInvitation, isValidRoomId } from 'ooxml-core/collab';
|
|
18
19
|
|
|
19
20
|
function glyph(name, className = "glyph", hidden = false) {
|
|
20
21
|
const found = getIcon(name);
|
|
@@ -177,8 +178,8 @@ var OfficeUiPasteOptions = class extends OfficeElement {
|
|
|
177
178
|
const view = this.ownerDocument.defaultView;
|
|
178
179
|
if (!view) return;
|
|
179
180
|
const dismiss = (event) => {
|
|
180
|
-
const
|
|
181
|
-
if (
|
|
181
|
+
const toolbar2 = this.renderRoot.querySelector(".toolbar");
|
|
182
|
+
if (toolbar2 && event.composedPath().includes(toolbar2) && (!(event instanceof KeyboardEvent) || event.key !== "Escape"))
|
|
182
183
|
return;
|
|
183
184
|
this.dismiss();
|
|
184
185
|
};
|
|
@@ -315,6 +316,7 @@ var OfficeUiReadOnlyBanner = class extends OfficeElement {
|
|
|
315
316
|
<input
|
|
316
317
|
id="password"
|
|
317
318
|
type="password"
|
|
319
|
+
autocomplete="off"
|
|
318
320
|
data-testid="${p}-password-input"
|
|
319
321
|
placeholder=${l.passwordPlaceholder ?? "Password"}
|
|
320
322
|
aria-invalid=${String(failed !== null)}
|
|
@@ -463,14 +465,14 @@ var OfficeUiRadio = class extends OfficeElement {
|
|
|
463
465
|
this.select(true);
|
|
464
466
|
return;
|
|
465
467
|
}
|
|
466
|
-
const
|
|
467
|
-
const index =
|
|
468
|
-
const last =
|
|
469
|
-
const
|
|
470
|
-
if (
|
|
468
|
+
const list2 = this.peers().filter((item) => !present(item.disabled));
|
|
469
|
+
const index = list2.indexOf(this);
|
|
470
|
+
const last = list2.length - 1;
|
|
471
|
+
const next2 = event.key === "ArrowRight" || event.key === "ArrowDown" ? (index + 1) % list2.length : event.key === "ArrowLeft" || event.key === "ArrowUp" ? (index + last) % list2.length : event.key === "Home" ? 0 : event.key === "End" ? last : -1;
|
|
472
|
+
if (next2 < 0 || index < 0) return;
|
|
471
473
|
event.preventDefault();
|
|
472
474
|
event.stopPropagation();
|
|
473
|
-
const target =
|
|
475
|
+
const target = list2[next2];
|
|
474
476
|
target.select(true);
|
|
475
477
|
target.focus();
|
|
476
478
|
}
|
|
@@ -877,6 +879,710 @@ var OfficeUiBackstage = class extends OfficeElement {
|
|
|
877
879
|
};
|
|
878
880
|
var defineBackstage = definer("office-ui-backstage", () => OfficeUiBackstage);
|
|
879
881
|
|
|
882
|
+
// raw-css:/home/runner/work/ooxml/ooxml/src/ui/src/files/cloud-files.css?raw
|
|
883
|
+
var cloud_files_default = "/* Tokens: --office-* (backstage look). */\n:host {\n display: block;\n min-width: 0;\n color: var(--office-foreground);\n font-family: var(--office-font);\n font-size: var(--office-font-size-md);\n}\nh2 {\n margin: 0 0 var(--office-space-3);\n font-size: var(--office-font-size-xl);\n font-weight: var(--office-font-weight-medium);\n}\np {\n margin: 0 0 var(--office-space-3);\n color: var(--office-muted-foreground);\n}\nbutton {\n min-height: var(--office-control-height-lg);\n padding: 0 var(--office-space-3);\n border: var(--office-border-width) solid var(--office-border);\n border-radius: var(--office-radius);\n background: var(--office-background);\n color: inherit;\n font: inherit;\n cursor: pointer;\n}\nbutton:hover:enabled {\n background: var(--office-surface);\n}\nbutton.primary {\n border-color: var(--office-accent);\n background: var(--office-accent);\n color: var(--office-accent-foreground);\n}\nbutton.primary:hover:enabled {\n background: var(--office-accent-hover);\n}\nbutton:disabled {\n opacity: 0.55;\n cursor: default;\n}\nbutton:focus-visible,\n[role='option']:focus-visible,\ninput:focus-visible {\n outline: var(--office-focus-width) solid var(--office-ring);\n outline-offset: var(--office-focus-offset);\n}\n.signin {\n max-width: 36em;\n padding: var(--office-space-6) 0;\n}\n.bar {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: var(--office-space-2);\n margin-bottom: var(--office-space-3);\n}\n.bar .grow {\n flex: 1;\n min-width: 0;\n}\n.account {\n color: var(--office-muted-foreground);\n}\n.tabs {\n display: flex;\n flex-wrap: wrap;\n gap: var(--office-space-1);\n}\n.tabs button {\n border-color: transparent;\n background: transparent;\n}\n.tabs button[aria-pressed='true'] {\n border-bottom: var(--office-border-width-thick) solid var(--office-accent);\n border-radius: 0;\n font-weight: var(--office-font-weight-bold);\n}\noffice-ui-search {\n flex: 1 1 12em;\n max-width: 24em;\n}\n.link {\n display: flex;\n gap: var(--office-space-2);\n flex: 1 1 16em;\n max-width: 32em;\n}\n.link input {\n flex: 1;\n min-width: 0;\n min-height: var(--office-control-height-lg);\n padding: 0 var(--office-space-2);\n border: var(--office-border-width) solid var(--office-field-border);\n border-radius: var(--office-radius);\n background: var(--office-field-background);\n color: inherit;\n font: inherit;\n}\nnav ol {\n display: flex;\n flex-wrap: wrap;\n gap: var(--office-space-1);\n margin: 0 0 var(--office-space-2);\n padding: 0;\n list-style: none;\n}\nnav li + li::before {\n content: '/';\n margin-inline-end: var(--office-space-1);\n color: var(--office-muted-foreground);\n}\nnav button {\n min-height: var(--office-control-height);\n padding: 0 var(--office-space-1);\n border: 0;\n background: transparent;\n}\nnav button[aria-current='page'] {\n font-weight: var(--office-font-weight-bold);\n}\n.head,\n.row {\n display: grid;\n grid-template-columns: minmax(0, 1fr) 9em 6em;\n gap: var(--office-space-3);\n align-items: center;\n padding: 0 var(--office-space-3);\n}\n.head {\n color: var(--office-muted-foreground);\n font-size: var(--office-font-size-sm);\n border-bottom: var(--office-border-width) solid var(--office-border);\n}\nul {\n margin: 0;\n padding: 0;\n list-style: none;\n}\n.row {\n min-height: var(--office-target-size);\n border-bottom: var(--office-border-width) solid var(--office-border);\n cursor: pointer;\n}\n.row:hover,\n.row[aria-selected='true'] {\n background: var(--office-surface);\n}\n.row[aria-disabled='true'] {\n opacity: 0.5;\n cursor: default;\n}\n.row[aria-busy='true'] {\n background: var(--office-selected);\n}\n.name {\n display: flex;\n align-items: center;\n gap: var(--office-space-2);\n min-width: 0;\n}\n.title {\n min-width: 0;\n}\n.title b {\n display: block;\n overflow: hidden;\n font-weight: var(--office-font-weight-medium);\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.title small {\n display: block;\n overflow: hidden;\n color: var(--office-muted-foreground);\n font-size: var(--office-font-size-sm);\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.icon {\n display: inline-flex;\n flex: none;\n align-items: center;\n justify-content: center;\n width: var(--office-icon-size-lg);\n height: var(--office-icon-size-lg);\n border-radius: var(--office-radius-sm);\n background: var(--office-accent);\n color: var(--office-accent-foreground);\n font-size: var(--office-font-size-xs);\n font-weight: var(--office-font-weight-bold);\n}\n.icon.docx {\n background: var(--office-word-brand);\n color: var(--office-app-brand-foreground);\n}\n.icon.xlsx {\n background: var(--office-excel-brand);\n color: var(--office-app-brand-foreground);\n}\n.icon.pptx {\n background: var(--office-powerpoint-brand);\n color: var(--office-app-brand-foreground);\n}\n.icon.vsdx {\n background: var(--office-visio-brand);\n color: var(--office-app-brand-foreground);\n}\n.icon.folder {\n background: var(--office-warning);\n color: var(--office-warning-foreground);\n}\n.icon.other {\n background: var(--office-muted-foreground);\n color: var(--office-background);\n}\n.cell {\n overflow: hidden;\n color: var(--office-muted-foreground);\n font-size: var(--office-font-size-sm);\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.status {\n display: flex;\n align-items: center;\n gap: var(--office-space-3);\n margin-top: var(--office-space-3);\n}\n.error {\n margin-top: var(--office-space-3);\n padding: var(--office-space-2) var(--office-space-3);\n border: var(--office-border-width) solid var(--office-danger);\n border-radius: var(--office-radius);\n color: var(--office-danger);\n}\n.error:empty {\n display: none;\n}\n.empty {\n padding: var(--office-space-6) var(--office-space-3);\n color: var(--office-muted-foreground);\n}\n.skeleton {\n height: var(--office-target-size);\n margin-top: var(--office-space-1);\n border-radius: var(--office-radius);\n background: var(--office-surface);\n animation: pulse 1.2s ease-in-out infinite;\n}\n@keyframes pulse {\n 50% {\n opacity: 0.5;\n }\n}\n.more {\n margin-top: var(--office-space-3);\n}\n@media (max-width: 600px) {\n .head {\n display: none;\n }\n .row {\n grid-template-columns: minmax(0, 1fr) auto;\n min-height: var(--office-target-size-touch);\n }\n .row .size {\n display: none;\n }\n .link input {\n font-size: var(--office-font-size-touch);\n }\n}\n@media (prefers-reduced-motion: reduce) {\n .skeleton {\n animation: none;\n }\n}\n@media (forced-colors: active) {\n .row[aria-selected='true'] {\n outline: var(--office-focus-width) solid Highlight;\n }\n}\n";
|
|
884
|
+
|
|
885
|
+
// src/files/cloud-files-labels.ts
|
|
886
|
+
var DEFAULT_CLOUD_FILES_LABELS = {
|
|
887
|
+
signInHeading: "Sign in to {provider}",
|
|
888
|
+
signInText: "Sign in to open and save your files in {provider}.",
|
|
889
|
+
signIn: "Sign in",
|
|
890
|
+
signOut: "Sign out",
|
|
891
|
+
providers: "Places",
|
|
892
|
+
recent: "Recent",
|
|
893
|
+
myFiles: "My files",
|
|
894
|
+
location: "Location",
|
|
895
|
+
searchPlaceholder: "Search files",
|
|
896
|
+
openLink: "Open from a link",
|
|
897
|
+
openLinkPlaceholder: "Paste a sharing link",
|
|
898
|
+
openLinkButton: "Open",
|
|
899
|
+
files: "Files",
|
|
900
|
+
name: "Name",
|
|
901
|
+
modified: "Modified",
|
|
902
|
+
size: "Size",
|
|
903
|
+
loadMore: "Load more",
|
|
904
|
+
loading: "Loading",
|
|
905
|
+
empty: "There are no files here.",
|
|
906
|
+
emptySearch: "No files match your search.",
|
|
907
|
+
unsupported: "This file cannot be opened here",
|
|
908
|
+
opening: "Opening {name}",
|
|
909
|
+
openingPercent: "Opening {name} ({percent}%)",
|
|
910
|
+
cancel: "Cancel",
|
|
911
|
+
folder: "Folder",
|
|
912
|
+
failed: "Something went wrong."
|
|
913
|
+
};
|
|
914
|
+
function fillLabel(template, values) {
|
|
915
|
+
return template.replace(/\{(\w+)\}/g, (whole, key) => values[key] ?? whole);
|
|
916
|
+
}
|
|
917
|
+
var KIND_BADGE = { docx: "W", xlsx: "X", pptx: "P", vsdx: "V" };
|
|
918
|
+
function entryBadge(entry) {
|
|
919
|
+
return entry.type === "folder" ? "" : entry.kind ? KIND_BADGE[entry.kind] : "\u2022";
|
|
920
|
+
}
|
|
921
|
+
function formatSize(bytes) {
|
|
922
|
+
if (bytes === void 0) return "";
|
|
923
|
+
if (bytes < 1024) return `${bytes} B`;
|
|
924
|
+
const units = ["KB", "MB", "GB", "TB"];
|
|
925
|
+
let value = bytes / 1024;
|
|
926
|
+
let unit = 0;
|
|
927
|
+
while (value >= 1024 && unit < units.length - 1) {
|
|
928
|
+
value /= 1024;
|
|
929
|
+
unit++;
|
|
930
|
+
}
|
|
931
|
+
return `${value >= 10 ? Math.round(value) : Math.round(value * 10) / 10} ${units[unit]}`;
|
|
932
|
+
}
|
|
933
|
+
function formatModified(modified, locale) {
|
|
934
|
+
if (modified === void 0) return "";
|
|
935
|
+
try {
|
|
936
|
+
return new Intl.DateTimeFormat(locale, { dateStyle: "medium" }).format(modified);
|
|
937
|
+
} catch {
|
|
938
|
+
return new Date(modified).toISOString().slice(0, 10);
|
|
939
|
+
}
|
|
940
|
+
}
|
|
941
|
+
function messageOf(error, fallback) {
|
|
942
|
+
return error instanceof Error && error.message ? error.message : fallback;
|
|
943
|
+
}
|
|
944
|
+
function row(vm, entry, index) {
|
|
945
|
+
const { text: text2 } = vm;
|
|
946
|
+
const ok = vm.accepted(entry);
|
|
947
|
+
const busy = vm.opening === entry.id;
|
|
948
|
+
const blocked = entry.type === "file" && (!ok || vm.opening !== void 0 && !busy);
|
|
949
|
+
const place2 = vm.view === "files" ? void 0 : entry.location;
|
|
950
|
+
return html`<li
|
|
951
|
+
class="row"
|
|
952
|
+
role="option"
|
|
953
|
+
data-index=${index}
|
|
954
|
+
data-entry=${entry.id}
|
|
955
|
+
tabindex=${index === vm.focusIndex ? 0 : -1}
|
|
956
|
+
aria-selected=${index === vm.focusIndex ? "true" : "false"}
|
|
957
|
+
aria-disabled=${blocked ? "true" : "false"}
|
|
958
|
+
aria-busy=${busy ? "true" : "false"}
|
|
959
|
+
title=${ifDefined(entry.type === "file" && !ok ? text2.unsupported : void 0)}
|
|
960
|
+
@click=${() => vm.select(index, entry)}
|
|
961
|
+
><span class="name"
|
|
962
|
+
><span
|
|
963
|
+
class="icon ${entry.type === "folder" ? "folder" : entry.kind ?? "other"}"
|
|
964
|
+
aria-hidden="true"
|
|
965
|
+
>${entryBadge(entry)}</span
|
|
966
|
+
><span class="title"
|
|
967
|
+
><b>${entry.name}</b>${place2 ? html`<small>${place2}</small>` : nothing}</span
|
|
968
|
+
></span
|
|
969
|
+
><span class="cell">${formatModified(entry.modified, vm.locale)}</span
|
|
970
|
+
><span class="cell size">${entry.type === "folder" ? "" : formatSize(entry.size)}</span></li
|
|
971
|
+
>`;
|
|
972
|
+
}
|
|
973
|
+
function list(vm) {
|
|
974
|
+
const { text: text2 } = vm;
|
|
975
|
+
if (vm.loading && vm.entries.length === 0)
|
|
976
|
+
return html`<div aria-hidden="true"
|
|
977
|
+
><div class="skeleton"></div><div class="skeleton"></div><div class="skeleton"></div
|
|
978
|
+
></div>`;
|
|
979
|
+
if (vm.entries.length === 0 && !vm.error)
|
|
980
|
+
return html`<div class="empty">${vm.view === "search" ? text2.emptySearch : text2.empty}</div>`;
|
|
981
|
+
return html`
|
|
982
|
+
<div class="head" aria-hidden="true"
|
|
983
|
+
><span>${text2.name}</span><span>${text2.modified}</span
|
|
984
|
+
><span class="size">${text2.size}</span></div
|
|
985
|
+
>
|
|
986
|
+
<ul role="listbox" aria-label=${text2.files} @keydown=${vm.keydown}
|
|
987
|
+
>${vm.entries.map((entry, index) => row(vm, entry, index))}</ul
|
|
988
|
+
>
|
|
989
|
+
${vm.next ? html`<button class="more" type="button" ?disabled=${vm.loading} @click=${vm.loadMore}
|
|
990
|
+
>${text2.loadMore}</button
|
|
991
|
+
>` : nothing}
|
|
992
|
+
`;
|
|
993
|
+
}
|
|
994
|
+
function renderSignedOut(vm, provider) {
|
|
995
|
+
const { text: text2 } = vm;
|
|
996
|
+
const values = { provider: provider.label };
|
|
997
|
+
return html`<div class="signin"
|
|
998
|
+
><h2>${fillLabel(text2.signInHeading, values)}</h2><p>${fillLabel(text2.signInText, values)}</p
|
|
999
|
+
><button type="button" class="primary" @click=${vm.signIn}>${text2.signIn}</button
|
|
1000
|
+
><div class="error" role="alert">${vm.error}</div></div
|
|
1001
|
+
>`;
|
|
1002
|
+
}
|
|
1003
|
+
function toolbar(vm, provider, account) {
|
|
1004
|
+
const { text: text2 } = vm;
|
|
1005
|
+
const tab = (view, label) => html`<button
|
|
1006
|
+
type="button"
|
|
1007
|
+
data-view=${view}
|
|
1008
|
+
aria-pressed=${vm.view === view ? "true" : "false"}
|
|
1009
|
+
@click=${() => vm.show(view)}
|
|
1010
|
+
>${label}</button
|
|
1011
|
+
>`;
|
|
1012
|
+
const switcher = vm.providers.length > 1 ? html`<div class="tabs" role="group" aria-label=${text2.providers}
|
|
1013
|
+
>${vm.providers.map(
|
|
1014
|
+
(other) => html`<button
|
|
1015
|
+
type="button"
|
|
1016
|
+
data-provider=${other.id}
|
|
1017
|
+
aria-pressed=${other === provider ? "true" : "false"}
|
|
1018
|
+
@click=${() => vm.choose(other.id)}
|
|
1019
|
+
>${other.label}</button
|
|
1020
|
+
>`
|
|
1021
|
+
)}</div
|
|
1022
|
+
>` : nothing;
|
|
1023
|
+
const search = provider.search ? html`<office-ui-search
|
|
1024
|
+
placeholder=${text2.searchPlaceholder}
|
|
1025
|
+
.value=${vm.query}
|
|
1026
|
+
@input=${vm.search}
|
|
1027
|
+
></office-ui-search>` : nothing;
|
|
1028
|
+
const signOut = provider.signOut ? html`<button type="button" data-action="sign-out" @click=${vm.signOut}
|
|
1029
|
+
>${text2.signOut}</button
|
|
1030
|
+
>` : nothing;
|
|
1031
|
+
return html`<div class="bar"
|
|
1032
|
+
>${switcher}<div class="tabs"
|
|
1033
|
+
>${provider.recent ? tab("recent", text2.recent) : nothing}${tab("files", text2.myFiles)}</div
|
|
1034
|
+
>${search}<span class="grow"></span><span class="account">${account.name}</span> ${signOut}</div
|
|
1035
|
+
>`;
|
|
1036
|
+
}
|
|
1037
|
+
function linkField(vm) {
|
|
1038
|
+
const { text: text2 } = vm;
|
|
1039
|
+
return html`<form class="bar link" @submit=${vm.openLink}
|
|
1040
|
+
><input
|
|
1041
|
+
type="text"
|
|
1042
|
+
aria-label=${text2.openLink}
|
|
1043
|
+
placeholder=${text2.openLinkPlaceholder}
|
|
1044
|
+
/><button type="submit" ?disabled=${vm.opening !== void 0}
|
|
1045
|
+
>${text2.openLinkButton}</button
|
|
1046
|
+
></form
|
|
1047
|
+
>`;
|
|
1048
|
+
}
|
|
1049
|
+
function statusLine(vm) {
|
|
1050
|
+
const { text: text2, progress } = vm;
|
|
1051
|
+
if (!vm.opening) return nothing;
|
|
1052
|
+
const entry = vm.entries.find((candidate) => candidate.id === vm.opening);
|
|
1053
|
+
const name = entry?.name ?? text2.openLink;
|
|
1054
|
+
const percent2 = progress?.total && progress.total > 0 ? Math.min(100, Math.round(progress.loaded / progress.total * 100)) : void 0;
|
|
1055
|
+
const message = percent2 === void 0 ? fillLabel(text2.opening, { name }) : fillLabel(text2.openingPercent, { name, percent: String(percent2) });
|
|
1056
|
+
return html`<div class="status"
|
|
1057
|
+
><span role="status" data-progress=${ifDefined(percent2)}>${message}</span
|
|
1058
|
+
><button type="button" data-action="cancel" @click=${vm.cancel}>${text2.cancel}</button></div
|
|
1059
|
+
>`;
|
|
1060
|
+
}
|
|
1061
|
+
function crumbs(vm) {
|
|
1062
|
+
return html`<nav aria-label=${vm.text.location}
|
|
1063
|
+
><ol
|
|
1064
|
+
>${vm.path.map(
|
|
1065
|
+
(crumb, index) => html`<li
|
|
1066
|
+
><button
|
|
1067
|
+
type="button"
|
|
1068
|
+
data-crumb=${index}
|
|
1069
|
+
aria-current=${ifDefined(
|
|
1070
|
+
vm.view === "files" && index === vm.path.length - 1 ? "page" : void 0
|
|
1071
|
+
)}
|
|
1072
|
+
@click=${() => vm.enter(index)}
|
|
1073
|
+
>${index === 0 ? vm.text.myFiles : crumb.name}</button
|
|
1074
|
+
></li
|
|
1075
|
+
>`
|
|
1076
|
+
)}</ol
|
|
1077
|
+
></nav
|
|
1078
|
+
>`;
|
|
1079
|
+
}
|
|
1080
|
+
function renderBrowser(vm, provider, account) {
|
|
1081
|
+
return html`<div aria-busy=${vm.loading ? "true" : "false"}
|
|
1082
|
+
>${toolbar(vm, provider, account)}${provider.openLink ? linkField(vm) : nothing}${vm.view === "files" ? crumbs(vm) : nothing}${list(vm)}${statusLine(vm)} <div class="error" role="alert">${vm.error}</div></div
|
|
1083
|
+
>`;
|
|
1084
|
+
}
|
|
1085
|
+
|
|
1086
|
+
// src/files/cloud-files.ts
|
|
1087
|
+
var ALL_KINDS = ["docx", "xlsx", "pptx", "vsdx"];
|
|
1088
|
+
var LINK_ID = "\0link";
|
|
1089
|
+
var OfficeUiCloudFiles = class extends OfficeElement {
|
|
1090
|
+
static styles = controlStyles(cloud_files_default);
|
|
1091
|
+
static properties = {
|
|
1092
|
+
providers: { attribute: false },
|
|
1093
|
+
accept: { attribute: false },
|
|
1094
|
+
labels: { attribute: false },
|
|
1095
|
+
searchDelay: { type: Number, attribute: "search-delay" },
|
|
1096
|
+
locale: { type: String },
|
|
1097
|
+
active: { state: true },
|
|
1098
|
+
view: { state: true },
|
|
1099
|
+
path: { state: true },
|
|
1100
|
+
entries: { state: true },
|
|
1101
|
+
next: { state: true },
|
|
1102
|
+
loading: { state: true },
|
|
1103
|
+
error: { state: true },
|
|
1104
|
+
query: { state: true },
|
|
1105
|
+
opening: { state: true },
|
|
1106
|
+
progress: { state: true },
|
|
1107
|
+
focusIndex: { state: true }
|
|
1108
|
+
};
|
|
1109
|
+
listAbort;
|
|
1110
|
+
openAbort;
|
|
1111
|
+
searchTimer;
|
|
1112
|
+
accountKey = "";
|
|
1113
|
+
subscriptions = [];
|
|
1114
|
+
constructor() {
|
|
1115
|
+
super();
|
|
1116
|
+
this.providers = [];
|
|
1117
|
+
this.accept = ALL_KINDS;
|
|
1118
|
+
this.labels = {};
|
|
1119
|
+
this.searchDelay = 300;
|
|
1120
|
+
this.locale = void 0;
|
|
1121
|
+
this.active = void 0;
|
|
1122
|
+
this.view = "files";
|
|
1123
|
+
this.path = [];
|
|
1124
|
+
this.entries = [];
|
|
1125
|
+
this.next = void 0;
|
|
1126
|
+
this.loading = false;
|
|
1127
|
+
this.error = "";
|
|
1128
|
+
this.query = "";
|
|
1129
|
+
this.opening = void 0;
|
|
1130
|
+
this.progress = void 0;
|
|
1131
|
+
this.focusIndex = 0;
|
|
1132
|
+
}
|
|
1133
|
+
get text() {
|
|
1134
|
+
return { ...DEFAULT_CLOUD_FILES_LABELS, ...this.labels };
|
|
1135
|
+
}
|
|
1136
|
+
/** The provider being browsed: the chosen one, else the first. */
|
|
1137
|
+
get provider() {
|
|
1138
|
+
return this.providers.find((p) => p.id === this.active) ?? this.providers[0];
|
|
1139
|
+
}
|
|
1140
|
+
connectedCallback() {
|
|
1141
|
+
super.connectedCallback();
|
|
1142
|
+
this.subscribe();
|
|
1143
|
+
}
|
|
1144
|
+
disconnectedCallback() {
|
|
1145
|
+
super.disconnectedCallback();
|
|
1146
|
+
this.unsubscribe();
|
|
1147
|
+
this.listAbort?.abort();
|
|
1148
|
+
this.openAbort?.abort();
|
|
1149
|
+
clearTimeout(this.searchTimer);
|
|
1150
|
+
this.accountKey = "";
|
|
1151
|
+
}
|
|
1152
|
+
willUpdate(changed) {
|
|
1153
|
+
if (changed.has("providers") && this.isConnected) this.subscribe();
|
|
1154
|
+
if (changed.has("providers") || changed.has("active")) this.syncAccount();
|
|
1155
|
+
}
|
|
1156
|
+
subscribe() {
|
|
1157
|
+
this.unsubscribe();
|
|
1158
|
+
for (const p of this.providers)
|
|
1159
|
+
this.subscriptions.push(p.subscribe?.(() => this.onAccountChange(p)) ?? (() => {
|
|
1160
|
+
}));
|
|
1161
|
+
}
|
|
1162
|
+
unsubscribe() {
|
|
1163
|
+
for (const off of this.subscriptions) off();
|
|
1164
|
+
this.subscriptions = [];
|
|
1165
|
+
}
|
|
1166
|
+
onAccountChange(p) {
|
|
1167
|
+
if (p === this.provider) this.syncAccount();
|
|
1168
|
+
this.requestUpdate();
|
|
1169
|
+
}
|
|
1170
|
+
/** Reload from scratch when the browsed provider or its account changed. */
|
|
1171
|
+
syncAccount() {
|
|
1172
|
+
const p = this.provider;
|
|
1173
|
+
const key = p ? `${p.id}\0${p.account()?.name ?? ""}` : "";
|
|
1174
|
+
if (key === this.accountKey) return;
|
|
1175
|
+
this.accountKey = key;
|
|
1176
|
+
this.listAbort?.abort();
|
|
1177
|
+
this.openAbort?.abort();
|
|
1178
|
+
this.entries = [];
|
|
1179
|
+
this.next = void 0;
|
|
1180
|
+
this.error = "";
|
|
1181
|
+
this.query = "";
|
|
1182
|
+
this.opening = void 0;
|
|
1183
|
+
this.loading = false;
|
|
1184
|
+
this.path = [{ id: void 0, name: this.text.myFiles }];
|
|
1185
|
+
this.view = p?.recent ? "recent" : "files";
|
|
1186
|
+
if (p?.account()) void this.load();
|
|
1187
|
+
}
|
|
1188
|
+
async fetch(p, signal, page) {
|
|
1189
|
+
const options = { signal, ...page === void 0 ? {} : { page } };
|
|
1190
|
+
if (this.view === "recent") return p.recent(options);
|
|
1191
|
+
if (this.view === "search") return p.search(this.query.trim(), options);
|
|
1192
|
+
return p.list(this.path[this.path.length - 1]?.id, options);
|
|
1193
|
+
}
|
|
1194
|
+
async load(append = false) {
|
|
1195
|
+
const p = this.provider;
|
|
1196
|
+
if (!p) return;
|
|
1197
|
+
this.listAbort?.abort();
|
|
1198
|
+
const controller = new AbortController();
|
|
1199
|
+
this.listAbort = controller;
|
|
1200
|
+
this.loading = true;
|
|
1201
|
+
this.error = "";
|
|
1202
|
+
if (!append) {
|
|
1203
|
+
this.entries = [];
|
|
1204
|
+
this.next = void 0;
|
|
1205
|
+
this.focusIndex = 0;
|
|
1206
|
+
}
|
|
1207
|
+
try {
|
|
1208
|
+
const listing = await this.fetch(
|
|
1209
|
+
p,
|
|
1210
|
+
controller.signal,
|
|
1211
|
+
append ? this.next : void 0
|
|
1212
|
+
);
|
|
1213
|
+
if (controller.signal.aborted) return;
|
|
1214
|
+
this.entries = append ? [...this.entries, ...listing.entries] : listing.entries;
|
|
1215
|
+
this.next = listing.next;
|
|
1216
|
+
} catch (error) {
|
|
1217
|
+
if (!controller.signal.aborted) this.error = messageOf(error, this.text.failed);
|
|
1218
|
+
} finally {
|
|
1219
|
+
if (this.listAbort === controller) this.loading = false;
|
|
1220
|
+
}
|
|
1221
|
+
}
|
|
1222
|
+
show(view) {
|
|
1223
|
+
this.view = view;
|
|
1224
|
+
void this.load();
|
|
1225
|
+
}
|
|
1226
|
+
enter(index) {
|
|
1227
|
+
const root = this.path.slice(0, index + 1);
|
|
1228
|
+
this.path = root;
|
|
1229
|
+
this.show("files");
|
|
1230
|
+
}
|
|
1231
|
+
async signIn() {
|
|
1232
|
+
this.error = "";
|
|
1233
|
+
try {
|
|
1234
|
+
await this.provider?.signIn();
|
|
1235
|
+
this.syncAccount();
|
|
1236
|
+
} catch (error) {
|
|
1237
|
+
this.error = messageOf(error, this.text.failed);
|
|
1238
|
+
}
|
|
1239
|
+
this.requestUpdate();
|
|
1240
|
+
}
|
|
1241
|
+
async signOut() {
|
|
1242
|
+
try {
|
|
1243
|
+
await this.provider?.signOut?.();
|
|
1244
|
+
this.syncAccount();
|
|
1245
|
+
} catch (error) {
|
|
1246
|
+
this.error = messageOf(error, this.text.failed);
|
|
1247
|
+
}
|
|
1248
|
+
this.requestUpdate();
|
|
1249
|
+
}
|
|
1250
|
+
onSearchInput(event) {
|
|
1251
|
+
this.query = event.target.value;
|
|
1252
|
+
clearTimeout(this.searchTimer);
|
|
1253
|
+
this.searchTimer = setTimeout(() => {
|
|
1254
|
+
if (this.query.trim()) this.show("search");
|
|
1255
|
+
else if (this.view === "search") this.show(this.provider?.recent ? "recent" : "files");
|
|
1256
|
+
}, this.searchDelay);
|
|
1257
|
+
}
|
|
1258
|
+
accepted(entry) {
|
|
1259
|
+
return entry.type === "folder" || entry.kind !== void 0 && this.accept.includes(entry.kind);
|
|
1260
|
+
}
|
|
1261
|
+
/** Folders navigate; accepted files download and then emit `office-cloud-file-open`. */
|
|
1262
|
+
activate(entry) {
|
|
1263
|
+
if (entry.type === "folder") {
|
|
1264
|
+
this.path = this.view === "files" ? [...this.path, entry] : [this.path[0], entry];
|
|
1265
|
+
return this.show("files");
|
|
1266
|
+
}
|
|
1267
|
+
if (this.opening || !this.accepted(entry)) return;
|
|
1268
|
+
void this.run(entry.id, (options) => this.provider.open(entry, options));
|
|
1269
|
+
}
|
|
1270
|
+
async openLink(link) {
|
|
1271
|
+
if (this.opening || !link.trim()) return;
|
|
1272
|
+
await this.run(LINK_ID, (options) => this.provider.openLink(link.trim(), options));
|
|
1273
|
+
}
|
|
1274
|
+
async run(id, start) {
|
|
1275
|
+
const controller = new AbortController();
|
|
1276
|
+
this.openAbort = controller;
|
|
1277
|
+
this.opening = id;
|
|
1278
|
+
this.progress = void 0;
|
|
1279
|
+
this.error = "";
|
|
1280
|
+
try {
|
|
1281
|
+
const file = await start({
|
|
1282
|
+
signal: controller.signal,
|
|
1283
|
+
onProgress: (loaded, total) => {
|
|
1284
|
+
if (!controller.signal.aborted)
|
|
1285
|
+
this.progress = total === void 0 ? { loaded } : { loaded, total };
|
|
1286
|
+
}
|
|
1287
|
+
});
|
|
1288
|
+
if (controller.signal.aborted) return;
|
|
1289
|
+
this.fire("office-cloud-file-open", {
|
|
1290
|
+
providerId: this.provider.id,
|
|
1291
|
+
file
|
|
1292
|
+
});
|
|
1293
|
+
} catch (error) {
|
|
1294
|
+
if (!controller.signal.aborted) this.error = messageOf(error, this.text.failed);
|
|
1295
|
+
} finally {
|
|
1296
|
+
if (this.openAbort === controller) {
|
|
1297
|
+
this.opening = void 0;
|
|
1298
|
+
this.progress = void 0;
|
|
1299
|
+
}
|
|
1300
|
+
}
|
|
1301
|
+
}
|
|
1302
|
+
onKeydown(event) {
|
|
1303
|
+
const last = this.entries.length - 1;
|
|
1304
|
+
const move = {
|
|
1305
|
+
ArrowDown: this.focusIndex + 1,
|
|
1306
|
+
ArrowUp: this.focusIndex - 1,
|
|
1307
|
+
Home: 0,
|
|
1308
|
+
End: last
|
|
1309
|
+
};
|
|
1310
|
+
if (event.key in move) {
|
|
1311
|
+
event.preventDefault();
|
|
1312
|
+
this.focusIndex = Math.max(0, Math.min(last, move[event.key]));
|
|
1313
|
+
this.renderRoot.querySelector(`[data-index="${this.focusIndex}"]`)?.focus();
|
|
1314
|
+
} else if (event.key === "Enter" || event.key === " ") {
|
|
1315
|
+
const entry = this.entries[this.focusIndex];
|
|
1316
|
+
if (!entry) return;
|
|
1317
|
+
event.preventDefault();
|
|
1318
|
+
this.activate(entry);
|
|
1319
|
+
}
|
|
1320
|
+
}
|
|
1321
|
+
/** The template's view of this element: its state and bound actions. */
|
|
1322
|
+
viewModel() {
|
|
1323
|
+
return {
|
|
1324
|
+
text: this.text,
|
|
1325
|
+
providers: this.providers,
|
|
1326
|
+
locale: this.locale,
|
|
1327
|
+
view: this.view,
|
|
1328
|
+
path: this.path,
|
|
1329
|
+
entries: this.entries,
|
|
1330
|
+
next: this.next,
|
|
1331
|
+
loading: this.loading,
|
|
1332
|
+
error: this.error,
|
|
1333
|
+
query: this.query,
|
|
1334
|
+
opening: this.opening,
|
|
1335
|
+
progress: this.progress,
|
|
1336
|
+
focusIndex: this.focusIndex,
|
|
1337
|
+
accepted: (entry) => this.accepted(entry),
|
|
1338
|
+
select: (index, entry) => {
|
|
1339
|
+
this.focusIndex = index;
|
|
1340
|
+
this.activate(entry);
|
|
1341
|
+
},
|
|
1342
|
+
show: (view) => this.show(view),
|
|
1343
|
+
enter: (index) => this.enter(index),
|
|
1344
|
+
loadMore: () => void this.load(true),
|
|
1345
|
+
choose: (id) => {
|
|
1346
|
+
this.active = id;
|
|
1347
|
+
},
|
|
1348
|
+
signIn: () => void this.signIn(),
|
|
1349
|
+
signOut: () => void this.signOut(),
|
|
1350
|
+
search: (event) => this.onSearchInput(event),
|
|
1351
|
+
openLink: (event) => {
|
|
1352
|
+
event.preventDefault();
|
|
1353
|
+
const input = event.currentTarget.querySelector("input");
|
|
1354
|
+
if (input) void this.openLink(input.value);
|
|
1355
|
+
},
|
|
1356
|
+
cancel: () => this.openAbort?.abort(),
|
|
1357
|
+
keydown: (event) => this.onKeydown(event)
|
|
1358
|
+
};
|
|
1359
|
+
}
|
|
1360
|
+
render() {
|
|
1361
|
+
const p = this.provider;
|
|
1362
|
+
if (!p) return nothing;
|
|
1363
|
+
const account = p.account();
|
|
1364
|
+
const vm = this.viewModel();
|
|
1365
|
+
return account ? renderBrowser(vm, p, account) : renderSignedOut(vm, p);
|
|
1366
|
+
}
|
|
1367
|
+
};
|
|
1368
|
+
var defineCloudFiles = definer("office-ui-cloud-files", () => OfficeUiCloudFiles, [
|
|
1369
|
+
defineSearchField
|
|
1370
|
+
]);
|
|
1371
|
+
|
|
1372
|
+
// raw-css:/home/runner/work/ooxml/ooxml/src/ui/src/files/open-places.css?raw
|
|
1373
|
+
var open_places_default = ":host {\n display: block;\n min-width: 0;\n}\n.places {\n display: flex;\n flex-wrap: wrap;\n gap: var(--office-space-1);\n margin-bottom: var(--office-space-4);\n border-bottom: var(--office-border-width) solid var(--office-border);\n}\n.places button {\n position: relative;\n padding: var(--office-space-2) var(--office-space-3);\n border: 0;\n border-radius: var(--office-radius-sm) var(--office-radius-sm) 0 0;\n background: transparent;\n color: var(--office-muted-foreground);\n font: inherit;\n font-size: var(--office-font-size-md);\n font-weight: var(--office-font-weight-medium);\n cursor: pointer;\n}\n.places button:hover {\n color: var(--office-foreground);\n box-shadow: inset 0 calc(-1 * var(--office-border-width-thick)) 0 var(--office-border);\n}\n.places button[aria-selected='true'] {\n color: var(--office-foreground);\n}\n.places button[aria-selected='true']::after {\n position: absolute;\n right: var(--office-space-2);\n bottom: calc(-1 * var(--office-border-width));\n left: var(--office-space-2);\n height: var(--office-border-width-thick);\n border-radius: var(--office-border-width);\n background: var(--office-accent);\n content: '';\n}\n.places button:focus-visible {\n outline: var(--office-focus-width) solid var(--office-ring);\n outline-offset: calc(-1 * var(--office-focus-width));\n}\n.panel {\n min-width: 0;\n}\nslot[hidden] {\n display: none;\n}\n@media (forced-colors: active) {\n .places button[aria-selected='true']::after {\n background: Highlight;\n }\n}\n";
|
|
1374
|
+
|
|
1375
|
+
// src/files/open-places.ts
|
|
1376
|
+
var DEFAULT_OPEN_PLACES_LABELS = {
|
|
1377
|
+
thisDevice: "This device",
|
|
1378
|
+
places: "Places"
|
|
1379
|
+
};
|
|
1380
|
+
var DEVICE_PLACE = "device";
|
|
1381
|
+
var KEY_STEPS = {
|
|
1382
|
+
ArrowLeft: -1,
|
|
1383
|
+
ArrowRight: 1,
|
|
1384
|
+
ArrowUp: -1,
|
|
1385
|
+
ArrowDown: 1
|
|
1386
|
+
};
|
|
1387
|
+
var OfficeUiOpenPlaces = class extends OfficeElement {
|
|
1388
|
+
static styles = controlStyles(open_places_default);
|
|
1389
|
+
static properties = {
|
|
1390
|
+
providers: { attribute: false },
|
|
1391
|
+
accept: { attribute: false },
|
|
1392
|
+
labels: { attribute: false },
|
|
1393
|
+
locale: { type: String },
|
|
1394
|
+
selected: { type: String }
|
|
1395
|
+
};
|
|
1396
|
+
constructor() {
|
|
1397
|
+
super();
|
|
1398
|
+
this.providers = [];
|
|
1399
|
+
this.accept = void 0;
|
|
1400
|
+
this.labels = {};
|
|
1401
|
+
this.locale = void 0;
|
|
1402
|
+
this.selected = DEVICE_PLACE;
|
|
1403
|
+
}
|
|
1404
|
+
get places() {
|
|
1405
|
+
const thisDevice = this.labels.thisDevice ?? DEFAULT_OPEN_PLACES_LABELS.thisDevice;
|
|
1406
|
+
return [
|
|
1407
|
+
{ id: DEVICE_PLACE, label: thisDevice },
|
|
1408
|
+
...this.providers.map((provider) => ({ id: provider.id, label: provider.label }))
|
|
1409
|
+
];
|
|
1410
|
+
}
|
|
1411
|
+
/** The place shown: the chosen one while it still exists, else This device. */
|
|
1412
|
+
get place() {
|
|
1413
|
+
return this.places.some((place2) => place2.id === this.selected) ? this.selected : DEVICE_PLACE;
|
|
1414
|
+
}
|
|
1415
|
+
choose(id, focus = false) {
|
|
1416
|
+
if (id !== this.place) {
|
|
1417
|
+
this.selected = id;
|
|
1418
|
+
this.fire("office-open-place-change", { place: id });
|
|
1419
|
+
}
|
|
1420
|
+
if (focus)
|
|
1421
|
+
void this.updateComplete.then(
|
|
1422
|
+
() => this.renderRoot.querySelector(`[data-place="${CSS.escape(id)}"]`)?.focus()
|
|
1423
|
+
);
|
|
1424
|
+
}
|
|
1425
|
+
onKeydown(event) {
|
|
1426
|
+
const { places } = this;
|
|
1427
|
+
const index = places.findIndex((place2) => place2.id === this.place);
|
|
1428
|
+
const next2 = event.key === "Home" ? 0 : event.key === "End" ? places.length - 1 : event.key in KEY_STEPS ? (index + KEY_STEPS[event.key] + places.length) % places.length : -1;
|
|
1429
|
+
if (next2 < 0) return;
|
|
1430
|
+
event.preventDefault();
|
|
1431
|
+
this.choose(places[next2].id, true);
|
|
1432
|
+
}
|
|
1433
|
+
render() {
|
|
1434
|
+
if (!this.providers.length) return html`<slot></slot>`;
|
|
1435
|
+
const current = this.place;
|
|
1436
|
+
const provider = this.providers.find((candidate) => candidate.id === current);
|
|
1437
|
+
return html`<div
|
|
1438
|
+
class="places"
|
|
1439
|
+
role="tablist"
|
|
1440
|
+
aria-label=${this.labels.places ?? DEFAULT_OPEN_PLACES_LABELS.places}
|
|
1441
|
+
@keydown=${this.onKeydown}
|
|
1442
|
+
>${this.places.map(
|
|
1443
|
+
(place2) => html`<button
|
|
1444
|
+
type="button"
|
|
1445
|
+
role="tab"
|
|
1446
|
+
id=${`place-${place2.id}`}
|
|
1447
|
+
data-place=${place2.id}
|
|
1448
|
+
aria-selected=${place2.id === current ? "true" : "false"}
|
|
1449
|
+
aria-controls="panel"
|
|
1450
|
+
tabindex=${place2.id === current ? 0 : -1}
|
|
1451
|
+
@click=${() => this.choose(place2.id)}
|
|
1452
|
+
>${place2.label}</button
|
|
1453
|
+
>`
|
|
1454
|
+
)}</div
|
|
1455
|
+
><div id="panel" class="panel" role="tabpanel" aria-labelledby=${`place-${current}`}
|
|
1456
|
+
>${provider ? html`<office-ui-cloud-files
|
|
1457
|
+
.providers=${[provider]}
|
|
1458
|
+
.accept=${this.accept ?? ["docx", "xlsx", "pptx", "vsdx"]}
|
|
1459
|
+
.labels=${this.labels}
|
|
1460
|
+
.locale=${this.locale}
|
|
1461
|
+
></office-ui-cloud-files>` : nothing}<slot ?hidden=${provider !== void 0}></slot
|
|
1462
|
+
></div>`;
|
|
1463
|
+
}
|
|
1464
|
+
};
|
|
1465
|
+
var defineOpenPlaces = definer("office-ui-open-places", () => OfficeUiOpenPlaces, [
|
|
1466
|
+
defineCloudFiles
|
|
1467
|
+
]);
|
|
1468
|
+
|
|
1469
|
+
// raw-css:/home/runner/work/ooxml/ooxml/src/ui/src/files/connected-services.css?raw
|
|
1470
|
+
var connected_services_default = ":host {\n display: block;\n min-width: 0;\n color: var(--office-foreground);\n}\n.heading {\n margin: 0;\n font-size: var(--office-font-size-lg);\n font-weight: var(--office-font-weight-bold);\n}\n.description {\n margin: var(--office-space-1) 0 var(--office-space-3);\n color: var(--office-muted-foreground);\n font-size: var(--office-font-size-md);\n}\n.services {\n display: grid;\n gap: var(--office-space-2);\n margin: 0;\n padding: 0;\n list-style: none;\n}\n.service {\n display: flex;\n align-items: center;\n gap: var(--office-space-3);\n padding: var(--office-space-3);\n border: var(--office-border-width) solid var(--office-border);\n border-radius: var(--office-radius-md);\n background: var(--office-surface);\n}\n.badge {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex: none;\n width: var(--office-control-height);\n height: var(--office-control-height);\n border-radius: var(--office-radius-sm);\n background: var(--office-accent);\n color: var(--office-accent-foreground);\n font-weight: var(--office-font-weight-bold);\n}\n.details {\n display: grid;\n flex: 1;\n min-width: 0;\n}\n.name {\n font-weight: var(--office-font-weight-bold);\n}\n.account,\n.managed {\n overflow: hidden;\n color: var(--office-muted-foreground);\n font-size: var(--office-font-size-sm);\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.error {\n color: var(--office-danger);\n font-size: var(--office-font-size-sm);\n}\nbutton {\n flex: none;\n min-height: var(--office-control-height);\n padding: 0 var(--office-space-3);\n border: var(--office-border-width) solid var(--office-border);\n border-radius: var(--office-radius-sm);\n background: var(--office-surface);\n color: var(--office-foreground);\n font: inherit;\n cursor: pointer;\n}\nbutton.primary {\n border-color: var(--office-accent);\n background: var(--office-accent);\n color: var(--office-accent-foreground);\n}\nbutton:hover:not(:disabled) {\n background: var(--office-backstage-item-hover);\n}\nbutton.primary:hover:not(:disabled) {\n background: var(--office-accent-hover);\n}\nbutton:disabled {\n cursor: default;\n opacity: 0.6;\n}\nbutton:focus-visible {\n outline: var(--office-focus-width) solid var(--office-ring);\n outline-offset: var(--office-focus-offset);\n}\n@media (max-width: 30rem) {\n .service {\n flex-wrap: wrap;\n }\n}\n";
|
|
1471
|
+
|
|
1472
|
+
// src/files/connected-services.ts
|
|
1473
|
+
var DEFAULT_CONNECTED_SERVICES_LABELS = {
|
|
1474
|
+
heading: "Connected services",
|
|
1475
|
+
description: "Link your storage to open and save files from every app.",
|
|
1476
|
+
notConnected: "Not connected",
|
|
1477
|
+
connect: "Connect",
|
|
1478
|
+
disconnect: "Disconnect",
|
|
1479
|
+
managed: "Managed by your organization",
|
|
1480
|
+
failed: "Could not update {provider}. Try again."
|
|
1481
|
+
};
|
|
1482
|
+
var OfficeUiConnectedServices = class extends OfficeElement {
|
|
1483
|
+
static styles = controlStyles(connected_services_default);
|
|
1484
|
+
static properties = {
|
|
1485
|
+
providers: { attribute: false },
|
|
1486
|
+
labels: { attribute: false },
|
|
1487
|
+
headingLevel: { type: Number, attribute: "heading-level" },
|
|
1488
|
+
busy: { state: true },
|
|
1489
|
+
failed: { state: true }
|
|
1490
|
+
};
|
|
1491
|
+
subscriptions = [];
|
|
1492
|
+
constructor() {
|
|
1493
|
+
super();
|
|
1494
|
+
this.providers = [];
|
|
1495
|
+
this.labels = {};
|
|
1496
|
+
this.headingLevel = 2;
|
|
1497
|
+
this.busy = null;
|
|
1498
|
+
this.failed = null;
|
|
1499
|
+
}
|
|
1500
|
+
connectedCallback() {
|
|
1501
|
+
super.connectedCallback();
|
|
1502
|
+
this.subscribe();
|
|
1503
|
+
}
|
|
1504
|
+
disconnectedCallback() {
|
|
1505
|
+
super.disconnectedCallback();
|
|
1506
|
+
this.unsubscribe();
|
|
1507
|
+
}
|
|
1508
|
+
willUpdate(changed) {
|
|
1509
|
+
if (changed.has("providers") && this.isConnected) this.subscribe();
|
|
1510
|
+
}
|
|
1511
|
+
label(key, provider) {
|
|
1512
|
+
const text2 = this.labels[key] ?? DEFAULT_CONNECTED_SERVICES_LABELS[key];
|
|
1513
|
+
return provider ? text2.replaceAll("{provider}", provider.label) : text2;
|
|
1514
|
+
}
|
|
1515
|
+
subscribe() {
|
|
1516
|
+
this.unsubscribe();
|
|
1517
|
+
for (const provider of this.providers)
|
|
1518
|
+
this.subscriptions.push(provider.subscribe?.(() => this.requestUpdate()) ?? (() => {
|
|
1519
|
+
}));
|
|
1520
|
+
}
|
|
1521
|
+
unsubscribe() {
|
|
1522
|
+
for (const stop of this.subscriptions.splice(0)) stop();
|
|
1523
|
+
}
|
|
1524
|
+
async toggle(provider) {
|
|
1525
|
+
const connect = !provider.account();
|
|
1526
|
+
this.busy = provider.id;
|
|
1527
|
+
this.failed = null;
|
|
1528
|
+
try {
|
|
1529
|
+
if (connect) await provider.signIn();
|
|
1530
|
+
else await provider.signOut?.();
|
|
1531
|
+
this.fire("office-connected-service-change", {
|
|
1532
|
+
providerId: provider.id,
|
|
1533
|
+
connected: Boolean(provider.account())
|
|
1534
|
+
});
|
|
1535
|
+
} catch {
|
|
1536
|
+
this.failed = provider.id;
|
|
1537
|
+
} finally {
|
|
1538
|
+
this.busy = null;
|
|
1539
|
+
this.requestUpdate();
|
|
1540
|
+
}
|
|
1541
|
+
}
|
|
1542
|
+
row(provider) {
|
|
1543
|
+
const account = provider.account();
|
|
1544
|
+
const busy = this.busy === provider.id;
|
|
1545
|
+
const action = account ? provider.signOut ? this.label("disconnect") : null : this.label("connect");
|
|
1546
|
+
return html`<li class="service" data-provider=${provider.id}>
|
|
1547
|
+
<span class="badge" aria-hidden="true">${provider.label.slice(0, 1)}</span>
|
|
1548
|
+
<span class="details">
|
|
1549
|
+
<span class="name">${provider.label}</span>
|
|
1550
|
+
<span class="account"
|
|
1551
|
+
>${account ? `${account.name}${account.email && account.email !== account.name ? ` (${account.email})` : ""}` : this.label("notConnected")}</span
|
|
1552
|
+
>
|
|
1553
|
+
${this.failed === provider.id ? html`<span class="error" role="alert">${this.label("failed", provider)}</span>` : nothing}
|
|
1554
|
+
</span>
|
|
1555
|
+
${action ? html`<button
|
|
1556
|
+
type="button"
|
|
1557
|
+
class=${account ? "secondary" : "primary"}
|
|
1558
|
+
?disabled=${busy}
|
|
1559
|
+
aria-busy=${busy ? "true" : "false"}
|
|
1560
|
+
aria-label=${`${action} ${provider.label}`}
|
|
1561
|
+
@click=${() => void this.toggle(provider)}
|
|
1562
|
+
>
|
|
1563
|
+
${action}
|
|
1564
|
+
</button>` : html`<span class="managed">${this.label("managed")}</span>`}
|
|
1565
|
+
</li>`;
|
|
1566
|
+
}
|
|
1567
|
+
render() {
|
|
1568
|
+
if (!this.providers.length) return nothing;
|
|
1569
|
+
const level = Math.min(6, Math.max(1, Math.round(this.headingLevel) || 2));
|
|
1570
|
+
return html`<section aria-labelledby="heading">
|
|
1571
|
+
<div id="heading" class="heading" role="heading" aria-level=${level}
|
|
1572
|
+
>${this.label("heading")}</div
|
|
1573
|
+
>
|
|
1574
|
+
<p class="description">${this.label("description")}</p>
|
|
1575
|
+
<ul class="services">
|
|
1576
|
+
${this.providers.map((provider) => this.row(provider))}
|
|
1577
|
+
</ul>
|
|
1578
|
+
</section>`;
|
|
1579
|
+
}
|
|
1580
|
+
};
|
|
1581
|
+
var defineConnectedServices = definer(
|
|
1582
|
+
"office-ui-connected-services",
|
|
1583
|
+
() => OfficeUiConnectedServices
|
|
1584
|
+
);
|
|
1585
|
+
|
|
880
1586
|
// raw-css:/home/runner/work/ooxml/ooxml/src/ui/src/chrome/find-bar.css?raw
|
|
881
1587
|
var find_bar_default = ":host {\n display: flex;\n align-items: center;\n gap: var(--office-space-2);\n min-height: var(--office-find-bar-height);\n padding: var(--office-space-1) var(--office-space-2) var(--office-space-1) var(--office-space-3);\n border-bottom: var(--office-border-width) solid var(--office-border);\n background: var(--office-surface);\n color: var(--office-foreground);\n font: var(--office-font-size-sm) var(--office-font);\n}\n:host(:not([open])) {\n display: none;\n}\n.find-content {\n flex: 1;\n min-width: 0;\n}\n.replace-fields {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n gap: var(--office-space-2);\n margin-top: var(--office-space-2);\n}\n.replace-fields label {\n flex: 0 1 auto;\n}\n.replace-fields label:first-child {\n flex: 1;\n}\n.replace-fields textarea {\n min-width: var(--office-find-replace-field-min-width);\n width: 100%;\n box-sizing: border-box;\n min-height: var(--office-input-height);\n padding: var(--office-space-1);\n font: inherit;\n color: inherit;\n border: var(--office-border-width) solid var(--office-border);\n border-radius: var(--office-radius-sm);\n background: var(--office-background);\n}\n.replace-fields office-ui-select {\n min-width: var(--office-find-replace-select-min-width);\n}\n.find-error {\n color: var(--office-danger);\n margin-bottom: 0;\n}\n[role='search'] {\n display: flex;\n flex: 1;\n align-items: center;\n gap: var(--office-space-1);\n min-width: 0;\n max-width: var(--office-find-max-width);\n}\nlabel {\n display: flex;\n flex: 1;\n align-items: center;\n gap: var(--office-space-1-5);\n min-width: 0;\n}\ninput {\n flex: 1;\n min-width: 0;\n min-height: var(--office-input-height);\n padding: var(--office-space-0) var(--office-space-1-5);\n font: inherit;\n color: inherit;\n border: var(--office-border-width) solid var(--office-border);\n border-radius: var(--office-radius-sm);\n background: var(--office-background);\n}\nbutton {\n min-height: var(--office-input-height);\n padding: var(--office-space-0) var(--office-space-2);\n font: inherit;\n color: inherit;\n cursor: pointer;\n border: var(--office-border-width) solid var(--office-border);\n border-radius: var(--office-radius-sm);\n background: var(--office-background);\n}\nbutton:disabled {\n opacity: 0.5;\n cursor: default;\n}\n.status {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n color: var(--office-muted-foreground);\n}\n.close {\n margin-inline-start: auto;\n width: var(--office-target-size);\n padding: 0;\n border-color: transparent;\n background: transparent;\n font-size: var(--office-font-size-xl);\n line-height: 1;\n}\ninput:focus-visible,\nbutton:focus-visible {\n outline: var(--office-focus-width) solid var(--office-ring);\n outline-offset: calc(var(--office-focus-offset) / 2);\n}\n@media (max-width: 760px) {\n :host {\n flex-wrap: wrap;\n }\n [role='search'] {\n flex-wrap: wrap;\n }\n}\n";
|
|
882
1588
|
function findReplaceFields(state) {
|
|
@@ -1024,12 +1730,12 @@ var OfficeUiFindBar = class extends OfficeElement {
|
|
|
1024
1730
|
} else this.close();
|
|
1025
1731
|
}
|
|
1026
1732
|
}
|
|
1027
|
-
replaceOptions(
|
|
1733
|
+
replaceOptions(next2) {
|
|
1028
1734
|
if (present(this.disabled)) return;
|
|
1029
|
-
if (
|
|
1030
|
-
if (
|
|
1031
|
-
if (
|
|
1032
|
-
this.matchCase =
|
|
1735
|
+
if (next2.replacement !== void 0) this.replacement = next2.replacement;
|
|
1736
|
+
if (next2.scope !== void 0) this.scope = next2.scope;
|
|
1737
|
+
if (next2.matchCase !== void 0 && !present(this.matchCaseDisabled))
|
|
1738
|
+
this.matchCase = next2.matchCase;
|
|
1033
1739
|
this.fire("office-find-options", {
|
|
1034
1740
|
replacement: this.replacement,
|
|
1035
1741
|
scope: this.scope,
|
|
@@ -1096,7 +1802,7 @@ var OfficeUiFindBar = class extends OfficeElement {
|
|
|
1096
1802
|
disabled,
|
|
1097
1803
|
replaceDisabled: present(this.replaceDisabled),
|
|
1098
1804
|
replaceAllDisabled: present(this.replaceAllDisabled),
|
|
1099
|
-
options: (
|
|
1805
|
+
options: (next2) => this.replaceOptions(next2),
|
|
1100
1806
|
replace: (mode) => {
|
|
1101
1807
|
if (!disabled && !present(mode === "current" ? this.replaceDisabled : this.replaceAllDisabled))
|
|
1102
1808
|
this.fire("office-find-replace", { mode });
|
|
@@ -1399,14 +2105,14 @@ var OfficeUiCommentsPane = class extends OfficeElement {
|
|
|
1399
2105
|
></div
|
|
1400
2106
|
>`;
|
|
1401
2107
|
const roving = this.rovingId;
|
|
1402
|
-
const
|
|
2108
|
+
const list2 = this.threads.length ? html`<div class="threads" role="list" aria-label=${l.list} @keydown=${this.onListKey}
|
|
1403
2109
|
>${repeat(
|
|
1404
2110
|
this.threads,
|
|
1405
2111
|
(thread) => thread.id,
|
|
1406
2112
|
(thread) => this.renderThread(thread, roving)
|
|
1407
2113
|
)}</div
|
|
1408
2114
|
>` : html`<p class="empty">${l.empty}</p>`;
|
|
1409
|
-
return html`${header}${composer}${
|
|
2115
|
+
return html`${header}${composer}${list2}`;
|
|
1410
2116
|
}
|
|
1411
2117
|
};
|
|
1412
2118
|
var defineCommentsPane = definer("office-ui-comments-pane", () => OfficeUiCommentsPane);
|
|
@@ -1564,9 +2270,9 @@ function slider(field, ctx, label) {
|
|
|
1564
2270
|
max: field.max ?? 100,
|
|
1565
2271
|
...field.step === void 0 ? {} : { step: field.step },
|
|
1566
2272
|
disabled: ctx.locked || Boolean(field.disabled),
|
|
1567
|
-
onInput: (
|
|
1568
|
-
last =
|
|
1569
|
-
ctx.preview(field.id,
|
|
2273
|
+
onInput: (next2) => {
|
|
2274
|
+
last = next2;
|
|
2275
|
+
ctx.preview(field.id, next2, `${next2}${field.unit ?? ""}`);
|
|
1570
2276
|
},
|
|
1571
2277
|
onChange: () => ctx.change(field.id, last)
|
|
1572
2278
|
})}</div
|
|
@@ -2157,8 +2863,8 @@ function textIntent(view, target, field, value) {
|
|
|
2157
2863
|
key.slice(8),
|
|
2158
2864
|
value
|
|
2159
2865
|
);
|
|
2160
|
-
const
|
|
2161
|
-
return
|
|
2866
|
+
const next2 = gradient && chartDrawingGradientFrom(gradient);
|
|
2867
|
+
return next2 ? wrap({ fill: next2 }) : null;
|
|
2162
2868
|
}
|
|
2163
2869
|
if (!fill3 && key === "width")
|
|
2164
2870
|
return n === null || n < 0 || n > 1584 ? null : wrap({ line: { widthEmu: chartPointsToEmu(n) } });
|
|
@@ -2257,12 +2963,12 @@ function paintIntent(view, target, field, value) {
|
|
|
2257
2963
|
const gradient = GRADIENT.exec(field);
|
|
2258
2964
|
if (gradient) {
|
|
2259
2965
|
const paint = gradient[1] === "fill" ? view.fill : view.line;
|
|
2260
|
-
const
|
|
2966
|
+
const next2 = gradientEdit(
|
|
2261
2967
|
paint.gradient ?? defaultPaneGradient(paint.color),
|
|
2262
2968
|
gradient[2],
|
|
2263
2969
|
value
|
|
2264
2970
|
);
|
|
2265
|
-
const fill3 =
|
|
2971
|
+
const fill3 = next2 && drawingGradientFrom(next2);
|
|
2266
2972
|
if (!fill3) return null;
|
|
2267
2973
|
return gradient[1] === "fill" ? { op: "fill", target, fill: fill3 } : { op: "line", target, line: { fill: fill3 }, merge: true };
|
|
2268
2974
|
}
|
|
@@ -2571,7 +3277,7 @@ var ARROWS = [
|
|
|
2571
3277
|
["diamond", "Diamond Arrow"],
|
|
2572
3278
|
["oval", "Oval Arrow"]
|
|
2573
3279
|
];
|
|
2574
|
-
var choices = (prefix,
|
|
3280
|
+
var choices = (prefix, list2) => list2.map(([value, label]) => choice(value, `${prefix}.${value}`, label));
|
|
2575
3281
|
function fillSection(view, source) {
|
|
2576
3282
|
if (!view.support.fill) {
|
|
2577
3283
|
return void 0;
|
|
@@ -3439,9 +4145,9 @@ function chartSeriesOptionsView(space, entry, seriesIndex, advanced) {
|
|
|
3439
4145
|
}
|
|
3440
4146
|
return view;
|
|
3441
4147
|
}
|
|
3442
|
-
function chartEffectsView(
|
|
4148
|
+
function chartEffectsView(list2, resolve) {
|
|
3443
4149
|
const view = { shadow: null, glow: null, softEdge: 0 };
|
|
3444
|
-
for (const effect of
|
|
4150
|
+
for (const effect of list2?.effects ?? []) {
|
|
3445
4151
|
if (effect.kind === "outerShadow") {
|
|
3446
4152
|
const color = effect.color && resolve(effect.color);
|
|
3447
4153
|
view.shadow = {
|
|
@@ -4064,9 +4770,9 @@ var OfficeUiPrintPreview = class extends OfficeElement {
|
|
|
4064
4770
|
return this.current;
|
|
4065
4771
|
}
|
|
4066
4772
|
set index(value) {
|
|
4067
|
-
const
|
|
4068
|
-
if (
|
|
4069
|
-
this.current =
|
|
4773
|
+
const next2 = Math.max(0, Math.min(this.list.length - 1, Math.trunc(value) || 0));
|
|
4774
|
+
if (next2 === this.current) return;
|
|
4775
|
+
this.current = next2;
|
|
4070
4776
|
this.requestUpdate("index");
|
|
4071
4777
|
}
|
|
4072
4778
|
go(index) {
|
|
@@ -4235,9 +4941,9 @@ var OfficeUiRibbon = class extends OfficeElement {
|
|
|
4235
4941
|
/** Collapses to the tab row on a short viewport (phone landscape) unless the user chose. */
|
|
4236
4942
|
applyAuto = () => {
|
|
4237
4943
|
if (!this.collapsible) return;
|
|
4238
|
-
const
|
|
4239
|
-
if (
|
|
4240
|
-
this.collapsed =
|
|
4944
|
+
const next2 = resolveCollapsed(this.shortQuery?.matches ?? false, this.userCollapsed);
|
|
4945
|
+
if (next2 === this.collapsed) return;
|
|
4946
|
+
this.collapsed = next2;
|
|
4241
4947
|
this.peek = false;
|
|
4242
4948
|
};
|
|
4243
4949
|
setCollapsed(value) {
|
|
@@ -4290,10 +4996,10 @@ var OfficeUiRibbon = class extends OfficeElement {
|
|
|
4290
4996
|
const focused = event.target.closest?.('[role="tab"]');
|
|
4291
4997
|
const at = focused ? tabs.indexOf(focused) : tabs.findIndex((tab) => tab.dataset.tab === this.selected);
|
|
4292
4998
|
const step2 = { ArrowRight: 1, ArrowLeft: -1 }[event.key];
|
|
4293
|
-
const
|
|
4294
|
-
if (!
|
|
4999
|
+
const next2 = event.key === "Home" ? tabs[0] : event.key === "End" ? tabs.at(-1) : step2 ? tabs[(at + step2 + tabs.length) % tabs.length] : void 0;
|
|
5000
|
+
if (!next2) return;
|
|
4295
5001
|
event.preventDefault();
|
|
4296
|
-
this.choose(
|
|
5002
|
+
this.choose(next2.dataset.tab);
|
|
4297
5003
|
this.focusTab();
|
|
4298
5004
|
}
|
|
4299
5005
|
/** Rebuild the tab row when a panel's label or visibility flag changes. */
|
|
@@ -4327,13 +5033,13 @@ var OfficeUiRibbon = class extends OfficeElement {
|
|
|
4327
5033
|
const hideAll = this.collapsed && !this.peek;
|
|
4328
5034
|
for (const panel of this.panels())
|
|
4329
5035
|
panel.hidden = hideAll || panel.dataset.ribbonTab !== selected;
|
|
4330
|
-
const
|
|
4331
|
-
const
|
|
4332
|
-
if (
|
|
4333
|
-
const tab =
|
|
4334
|
-
const view =
|
|
4335
|
-
if (tab.left < view.left)
|
|
4336
|
-
else if (tab.right > view.right)
|
|
5036
|
+
const active2 = this.tabButton(selected);
|
|
5037
|
+
const list2 = active2?.parentElement;
|
|
5038
|
+
if (active2 && list2 && list2.scrollWidth > list2.clientWidth) {
|
|
5039
|
+
const tab = active2.getBoundingClientRect();
|
|
5040
|
+
const view = list2.getBoundingClientRect();
|
|
5041
|
+
if (tab.left < view.left) list2.scrollLeft -= view.left - tab.left;
|
|
5042
|
+
else if (tab.right > view.right) list2.scrollLeft += tab.right - view.right;
|
|
4337
5043
|
}
|
|
4338
5044
|
}
|
|
4339
5045
|
render() {
|
|
@@ -4835,12 +5541,12 @@ var OfficeUiGallery = class extends OfficeElement {
|
|
|
4835
5541
|
return this.model;
|
|
4836
5542
|
}
|
|
4837
5543
|
set state(value) {
|
|
4838
|
-
const
|
|
4839
|
-
const json =
|
|
5544
|
+
const next2 = value ?? void 0;
|
|
5545
|
+
const json = next2 ? JSON.stringify(next2) : "";
|
|
4840
5546
|
if (this.stateJson === json && this.hasUpdated) return;
|
|
4841
5547
|
this.stateJson = json;
|
|
4842
|
-
this.model =
|
|
4843
|
-
this.pruneParsed(
|
|
5548
|
+
this.model = next2;
|
|
5549
|
+
this.pruneParsed(next2);
|
|
4844
5550
|
this.requestUpdate("state");
|
|
4845
5551
|
}
|
|
4846
5552
|
stateJson = "";
|
|
@@ -4874,12 +5580,12 @@ var OfficeUiGallery = class extends OfficeElement {
|
|
|
4874
5580
|
return this.opened;
|
|
4875
5581
|
}
|
|
4876
5582
|
set open(value) {
|
|
4877
|
-
const
|
|
4878
|
-
if (
|
|
4879
|
-
this.opened =
|
|
5583
|
+
const next2 = present(value) && !this.unavailable() && this.getAttribute("mode") !== "panel";
|
|
5584
|
+
if (next2 === this.opened) return;
|
|
5585
|
+
this.opened = next2;
|
|
4880
5586
|
this.cleanup();
|
|
4881
5587
|
this.requestUpdate("open");
|
|
4882
|
-
if (
|
|
5588
|
+
if (next2 && this.isConnected) {
|
|
4883
5589
|
const doc = this.ownerDocument;
|
|
4884
5590
|
doc.addEventListener("pointerdown", this.onOutside, true);
|
|
4885
5591
|
doc.addEventListener("keydown", this.onEscape);
|
|
@@ -5099,12 +5805,12 @@ var OfficeUiGallery = class extends OfficeElement {
|
|
|
5099
5805
|
const index = tile ? items.indexOf(tile) : -1;
|
|
5100
5806
|
const columns = this.model?.sections[Array.from(this.querySelectorAll(".section")).indexOf(section)]?.columns ?? 1;
|
|
5101
5807
|
const delta = { ArrowRight: 1, ArrowLeft: -1, ArrowDown: columns, ArrowUp: -columns }[event.key];
|
|
5102
|
-
const
|
|
5103
|
-
if (index >= 0 &&
|
|
5808
|
+
const next2 = event.key === "Home" ? 0 : event.key === "End" ? items.length - 1 : delta === void 0 ? -1 : (index + delta + items.length) % items.length;
|
|
5809
|
+
if (index >= 0 && next2 >= 0) {
|
|
5104
5810
|
event.preventDefault();
|
|
5105
5811
|
event.stopPropagation();
|
|
5106
|
-
items[
|
|
5107
|
-
if (panel && !this.hasAttribute("compact")) items[
|
|
5812
|
+
items[next2]?.focus();
|
|
5813
|
+
if (panel && !this.hasAttribute("compact")) items[next2]?.click();
|
|
5108
5814
|
return;
|
|
5109
5815
|
}
|
|
5110
5816
|
if (panel) return;
|
|
@@ -5558,8 +6264,8 @@ var OfficeUiAccount = class extends OfficeElement {
|
|
|
5558
6264
|
this.current = sanitizeOfficeProfile(value);
|
|
5559
6265
|
this.requestUpdate("profile");
|
|
5560
6266
|
}
|
|
5561
|
-
change(
|
|
5562
|
-
this.profile =
|
|
6267
|
+
change(next2) {
|
|
6268
|
+
this.profile = next2;
|
|
5563
6269
|
this.fire("office-profile-change", { profile: this.profile });
|
|
5564
6270
|
}
|
|
5565
6271
|
onSwatchKey(event) {
|
|
@@ -5698,13 +6404,13 @@ var OfficeUiDialog = class extends OfficeElement {
|
|
|
5698
6404
|
}
|
|
5699
6405
|
/** The focused element, followed into open shadow roots. */
|
|
5700
6406
|
deepActive() {
|
|
5701
|
-
let
|
|
5702
|
-
while (
|
|
5703
|
-
return
|
|
6407
|
+
let active2 = this.ownerDocument.activeElement;
|
|
6408
|
+
while (active2?.shadowRoot?.activeElement) active2 = active2.shadowRoot.activeElement;
|
|
6409
|
+
return active2;
|
|
5704
6410
|
}
|
|
5705
6411
|
onOpen() {
|
|
5706
|
-
const
|
|
5707
|
-
this.returnFocus =
|
|
6412
|
+
const active2 = this.ownerDocument.activeElement;
|
|
6413
|
+
this.returnFocus = active2 && active2 !== this.ownerDocument.body ? active2 : null;
|
|
5708
6414
|
(this.focusables()[0] ?? this.box)?.focus();
|
|
5709
6415
|
}
|
|
5710
6416
|
onClose() {
|
|
@@ -5883,18 +6589,18 @@ var OfficeUiCommandSearch = class extends OfficeElement {
|
|
|
5883
6589
|
}
|
|
5884
6590
|
/** The listbox is a top-layer popover below the field: show or hide it as `isOpen` changes. */
|
|
5885
6591
|
updated(changed) {
|
|
5886
|
-
const
|
|
5887
|
-
if (!
|
|
6592
|
+
const list2 = this.list;
|
|
6593
|
+
if (!list2 || !changed.has("isOpen")) return;
|
|
5888
6594
|
if (this.isOpen) {
|
|
5889
6595
|
const box = this.input?.getBoundingClientRect();
|
|
5890
6596
|
if (box) {
|
|
5891
|
-
|
|
5892
|
-
|
|
6597
|
+
list2.style.left = `${Math.round(box.left)}px`;
|
|
6598
|
+
list2.style.top = `${Math.round(box.bottom + 4)}px`;
|
|
5893
6599
|
}
|
|
5894
|
-
if (
|
|
5895
|
-
} else if (
|
|
6600
|
+
if (list2.hasAttribute("popover") && !list2.matches(":popover-open")) list2.showPopover?.();
|
|
6601
|
+
} else if (list2.hasAttribute("popover")) {
|
|
5896
6602
|
try {
|
|
5897
|
-
|
|
6603
|
+
list2.hidePopover?.();
|
|
5898
6604
|
} catch {
|
|
5899
6605
|
}
|
|
5900
6606
|
}
|
|
@@ -5994,7 +6700,7 @@ var context_menu_default = ":host {\n display: contents;\n}\n:host([data-control
|
|
|
5994
6700
|
var ITEMS = "office-ui-menu-item:not([disabled]):not([hidden])";
|
|
5995
6701
|
var TYPE_AHEAD_MS = 700;
|
|
5996
6702
|
var openMenus = /* @__PURE__ */ new WeakMap();
|
|
5997
|
-
var stateChanged = (
|
|
6703
|
+
var stateChanged = (next2, old) => JSON.stringify(next2) !== JSON.stringify(old);
|
|
5998
6704
|
var OfficeUiContextMenu = class extends OfficeElement {
|
|
5999
6705
|
static requestEvent = "office-menu-request";
|
|
6000
6706
|
static closeEvent = "office-menu-close";
|
|
@@ -6046,8 +6752,8 @@ var OfficeUiContextMenu = class extends OfficeElement {
|
|
|
6046
6752
|
this.focused = false;
|
|
6047
6753
|
const opener = this.opener;
|
|
6048
6754
|
this.opener = null;
|
|
6049
|
-
const
|
|
6050
|
-
if (opener?.isConnected && (!
|
|
6755
|
+
const active2 = this.ownerDocument.activeElement;
|
|
6756
|
+
if (opener?.isConnected && (!active2 || active2 === this.ownerDocument.body))
|
|
6051
6757
|
opener.focus({ preventScroll: true });
|
|
6052
6758
|
}
|
|
6053
6759
|
typeAhead(items, from, key) {
|
|
@@ -6068,8 +6774,8 @@ var OfficeUiContextMenu = class extends OfficeElement {
|
|
|
6068
6774
|
const doc = this.ownerDocument;
|
|
6069
6775
|
const panel = this.panel;
|
|
6070
6776
|
if (!panel) return;
|
|
6071
|
-
const
|
|
6072
|
-
this.returnFocus =
|
|
6777
|
+
const active2 = doc.activeElement;
|
|
6778
|
+
this.returnFocus = active2 instanceof HTMLElement ? active2 : null;
|
|
6073
6779
|
if (panel.hasAttribute("popover")) {
|
|
6074
6780
|
if (!this.open) panel.showPopover?.();
|
|
6075
6781
|
} else {
|
|
@@ -6188,10 +6894,10 @@ var OfficeUiContextMenu = class extends OfficeElement {
|
|
|
6188
6894
|
} else if (this.focused && this.active >= 0)
|
|
6189
6895
|
this.rows[this.active]?.focus({ preventScroll: true });
|
|
6190
6896
|
}
|
|
6191
|
-
applyMarkers(
|
|
6897
|
+
applyMarkers(next2) {
|
|
6192
6898
|
for (const name of this.markers) this.removeAttribute(name);
|
|
6193
6899
|
const pattern = this.config().markerPattern;
|
|
6194
|
-
this.markers =
|
|
6900
|
+
this.markers = next2.filter((name) => pattern.test(name));
|
|
6195
6901
|
for (const name of this.markers) this.setAttribute(name, "true");
|
|
6196
6902
|
}
|
|
6197
6903
|
place() {
|
|
@@ -6214,7 +6920,7 @@ var OfficeUiContextMenu = class extends OfficeElement {
|
|
|
6214
6920
|
if (index < 0) return;
|
|
6215
6921
|
this.active = index;
|
|
6216
6922
|
const rows = this.rows;
|
|
6217
|
-
rows.forEach((
|
|
6923
|
+
rows.forEach((row2, at) => row2.tabIndex = at === index ? 0 : -1);
|
|
6218
6924
|
rows[index]?.focus({ preventScroll: true });
|
|
6219
6925
|
}
|
|
6220
6926
|
onRowKey(event) {
|
|
@@ -6230,9 +6936,9 @@ var OfficeUiContextMenu = class extends OfficeElement {
|
|
|
6230
6936
|
this.focusRow(target);
|
|
6231
6937
|
}
|
|
6232
6938
|
onRowOver(event) {
|
|
6233
|
-
const
|
|
6234
|
-
const index =
|
|
6235
|
-
if (index >= 0 && !
|
|
6939
|
+
const row2 = event.target?.closest("button");
|
|
6940
|
+
const index = row2 ? this.rows.indexOf(row2) : -1;
|
|
6941
|
+
if (index >= 0 && !row2?.disabled && index !== this.active) this.focusRow(index);
|
|
6236
6942
|
}
|
|
6237
6943
|
dismiss(reason) {
|
|
6238
6944
|
this.fire(this.config().closeEvent, { reason });
|
|
@@ -6685,11 +7391,11 @@ function optionRow(host, control2) {
|
|
|
6685
7391
|
?disabled=${disabled}
|
|
6686
7392
|
@change=${(event) => {
|
|
6687
7393
|
const field = event.target;
|
|
6688
|
-
const
|
|
6689
|
-
if (
|
|
7394
|
+
const next2 = clampOptionNumber(field.value, control2.min, control2.max);
|
|
7395
|
+
if (next2 === void 0) field.value = String(draft[control2.key] ?? "");
|
|
6690
7396
|
else {
|
|
6691
|
-
field.value = String(
|
|
6692
|
-
host.set(control2.key,
|
|
7397
|
+
field.value = String(next2);
|
|
7398
|
+
host.set(control2.key, next2);
|
|
6693
7399
|
}
|
|
6694
7400
|
}}
|
|
6695
7401
|
/>${control2.unit ? html`<span class="unit">${control2.unit}</span>` : ""}</span
|
|
@@ -6834,10 +7540,10 @@ var OfficeUiOptionsDialog = class extends OfficeElement {
|
|
|
6834
7540
|
this.active = this.categories[0]?.id ?? "";
|
|
6835
7541
|
if (changed.has("open") && present(this.open)) this.draftValues = { ...this.committed };
|
|
6836
7542
|
}
|
|
6837
|
-
set(key,
|
|
6838
|
-
this.draftValues[key] =
|
|
6839
|
-
if (present(this.live)) this.committed[key] =
|
|
6840
|
-
this.fire("office-option-input", { key, value:
|
|
7543
|
+
set(key, next2) {
|
|
7544
|
+
this.draftValues[key] = next2;
|
|
7545
|
+
if (present(this.live)) this.committed[key] = next2;
|
|
7546
|
+
this.fire("office-option-input", { key, value: next2 });
|
|
6841
7547
|
this.requestUpdate();
|
|
6842
7548
|
}
|
|
6843
7549
|
pane(category) {
|
|
@@ -6953,14 +7659,14 @@ var OfficeUiToolbar = class extends OfficeElement {
|
|
|
6953
7659
|
}
|
|
6954
7660
|
onKey(event) {
|
|
6955
7661
|
const vertical2 = this.getAttribute("aria-orientation") === "vertical";
|
|
6956
|
-
const
|
|
7662
|
+
const next2 = vertical2 ? "ArrowDown" : "ArrowRight";
|
|
6957
7663
|
const prev = vertical2 ? "ArrowUp" : "ArrowLeft";
|
|
6958
|
-
if (![
|
|
7664
|
+
if (![next2, prev, "Home", "End"].includes(event.key)) return;
|
|
6959
7665
|
const items = this.items();
|
|
6960
7666
|
const from = items.findIndex((el) => el === event.target || el.contains(event.target));
|
|
6961
7667
|
if (from < 0 || items.length === 0) return;
|
|
6962
7668
|
event.preventDefault();
|
|
6963
|
-
const index = event.key === "Home" ? 0 : event.key === "End" ? items.length - 1 : (from + (event.key ===
|
|
7669
|
+
const index = event.key === "Home" ? 0 : event.key === "End" ? items.length - 1 : (from + (event.key === next2 ? 1 : -1) + items.length) % items.length;
|
|
6964
7670
|
items[index]?.focus();
|
|
6965
7671
|
}
|
|
6966
7672
|
willUpdate() {
|
|
@@ -7023,21 +7729,21 @@ function positionSelectMenu(menu, trigger, host) {
|
|
|
7023
7729
|
menu.style.top = `${Math.max(margin, flip ? rect.top - gap - height : rect.bottom + gap)}px`;
|
|
7024
7730
|
menu.style.left = `${Math.max(margin, Math.min(rect.left, view.innerWidth - menuWidth - margin))}px`;
|
|
7025
7731
|
}
|
|
7026
|
-
function nextSelectActive(choices2,
|
|
7732
|
+
function nextSelectActive(choices2, active2, step2) {
|
|
7027
7733
|
for (let i = 0; i < choices2.length; i++) {
|
|
7028
|
-
|
|
7029
|
-
if (!choices2[
|
|
7734
|
+
active2 = (active2 + step2 + choices2.length) % choices2.length;
|
|
7735
|
+
if (!choices2[active2].disabled && !choices2[active2].hidden) return active2;
|
|
7030
7736
|
}
|
|
7031
|
-
return
|
|
7737
|
+
return active2;
|
|
7032
7738
|
}
|
|
7033
7739
|
var SELECT_PAGE_SIZE = 8;
|
|
7034
|
-
function pageSelectActive(choices2,
|
|
7740
|
+
function pageSelectActive(choices2, active2, direction) {
|
|
7035
7741
|
const usable = (index) => !choices2[index]?.disabled && !choices2[index]?.hidden;
|
|
7036
7742
|
const last = choices2.length - 1;
|
|
7037
|
-
const target = Math.max(0, Math.min(last, Math.max(
|
|
7743
|
+
const target = Math.max(0, Math.min(last, Math.max(active2, 0) + direction * SELECT_PAGE_SIZE));
|
|
7038
7744
|
for (let index = target; index >= 0 && index <= last; index -= direction)
|
|
7039
7745
|
if (usable(index)) return index;
|
|
7040
|
-
return
|
|
7746
|
+
return active2;
|
|
7041
7747
|
}
|
|
7042
7748
|
|
|
7043
7749
|
// raw-css:/home/runner/work/ooxml/ooxml/src/ui/src/form/select.css?raw
|
|
@@ -7096,8 +7802,8 @@ var OfficeUiSelect = class extends OfficeElement {
|
|
|
7096
7802
|
const children = [...this.querySelectorAll("option")];
|
|
7097
7803
|
return children.length ? children : this.data;
|
|
7098
7804
|
}
|
|
7099
|
-
set options(
|
|
7100
|
-
this.data = [...
|
|
7805
|
+
set options(next2) {
|
|
7806
|
+
this.data = [...next2];
|
|
7101
7807
|
this.refresh();
|
|
7102
7808
|
}
|
|
7103
7809
|
get value() {
|
|
@@ -7108,8 +7814,8 @@ var OfficeUiSelect = class extends OfficeElement {
|
|
|
7108
7814
|
return requested;
|
|
7109
7815
|
return [...this.querySelectorAll("option")].find((option) => option.selected)?.value ?? choices2.find((choice2) => !choice2.disabled && !choice2.hidden)?.value ?? choices2[0]?.value ?? requested ?? "";
|
|
7110
7816
|
}
|
|
7111
|
-
set value(
|
|
7112
|
-
this.requested = String(
|
|
7817
|
+
set value(next2) {
|
|
7818
|
+
this.requested = String(next2 ?? "");
|
|
7113
7819
|
this.requestUpdate("value", void 0);
|
|
7114
7820
|
}
|
|
7115
7821
|
get selectedIndex() {
|
|
@@ -7601,16 +8307,16 @@ function wireTabDrag(host) {
|
|
|
7601
8307
|
} catch {
|
|
7602
8308
|
}
|
|
7603
8309
|
}
|
|
7604
|
-
const
|
|
7605
|
-
const [lo, hi] = host.limit?.(state.tab) ?? [0,
|
|
7606
|
-
state.slot = Math.max(lo, Math.min(hi, slotAt(
|
|
8310
|
+
const list2 = host.tabs();
|
|
8311
|
+
const [lo, hi] = host.limit?.(state.tab) ?? [0, list2.length];
|
|
8312
|
+
state.slot = Math.max(lo, Math.min(hi, slotAt(list2, event.clientX)));
|
|
7607
8313
|
marker ??= doc.createElement("div");
|
|
7608
8314
|
marker.className = host.markerClass;
|
|
7609
8315
|
marker.setAttribute("aria-hidden", "true");
|
|
7610
8316
|
const box = host.markerBox.getBoundingClientRect();
|
|
7611
|
-
const ref =
|
|
8317
|
+
const ref = list2[state.slot] ?? list2[list2.length - 1];
|
|
7612
8318
|
const rect = ref?.getBoundingClientRect();
|
|
7613
|
-
const x = !rect ? 0 : state.slot <
|
|
8319
|
+
const x = !rect ? 0 : state.slot < list2.length ? rect.left : rect.right;
|
|
7614
8320
|
marker.style.left = `${x - box.left + host.markerBox.scrollLeft}px`;
|
|
7615
8321
|
host.markerParent.append(marker);
|
|
7616
8322
|
};
|
|
@@ -7639,7 +8345,7 @@ function wireTabDrag(host) {
|
|
|
7639
8345
|
}
|
|
7640
8346
|
|
|
7641
8347
|
// src/chrome/tab-strip.ts
|
|
7642
|
-
var
|
|
8348
|
+
var KEY_STEPS2 = {
|
|
7643
8349
|
ArrowLeft: -1,
|
|
7644
8350
|
ArrowRight: 1,
|
|
7645
8351
|
ArrowUp: -1,
|
|
@@ -7715,9 +8421,9 @@ var OfficeUiTabStrip = class extends OfficeElement {
|
|
|
7715
8421
|
event.preventDefault();
|
|
7716
8422
|
const target = event.key === "Home" ? this.items[0] : this.items[this.items.length - 1];
|
|
7717
8423
|
if (target) this.choose(target.id, true);
|
|
7718
|
-
} else if (
|
|
8424
|
+
} else if (KEY_STEPS2[event.key] !== void 0) {
|
|
7719
8425
|
event.preventDefault();
|
|
7720
|
-
this.move(
|
|
8426
|
+
this.move(KEY_STEPS2[event.key], true);
|
|
7721
8427
|
}
|
|
7722
8428
|
}
|
|
7723
8429
|
connectedCallback() {
|
|
@@ -7730,12 +8436,12 @@ var OfficeUiTabStrip = class extends OfficeElement {
|
|
|
7730
8436
|
super.disconnectedCallback();
|
|
7731
8437
|
}
|
|
7732
8438
|
wireDrag() {
|
|
7733
|
-
const
|
|
7734
|
-
if (!
|
|
7735
|
-
const tabs = () => [...
|
|
8439
|
+
const list2 = this.renderRoot.querySelector(".list");
|
|
8440
|
+
if (!list2 || this.disposeDrag) return;
|
|
8441
|
+
const tabs = () => [...list2.querySelectorAll(".tab")];
|
|
7736
8442
|
const groupOf2 = (tab) => this.items.find((item) => item.id === tab.dataset.id)?.group;
|
|
7737
8443
|
this.disposeDrag = wireTabDrag({
|
|
7738
|
-
area:
|
|
8444
|
+
area: list2,
|
|
7739
8445
|
tabs,
|
|
7740
8446
|
tabSelector: ".tab",
|
|
7741
8447
|
canDrag: (tab) => present(this.reorderable) && !present(this.disabled) && !!tab.dataset.id,
|
|
@@ -7767,7 +8473,7 @@ var OfficeUiTabStrip = class extends OfficeElement {
|
|
|
7767
8473
|
const disabled = present(this.disabled);
|
|
7768
8474
|
const index = this.index();
|
|
7769
8475
|
const previous = this.previousLabel || "Previous";
|
|
7770
|
-
const
|
|
8476
|
+
const next2 = this.nextLabel || "Next";
|
|
7771
8477
|
return html`
|
|
7772
8478
|
<button
|
|
7773
8479
|
type="button"
|
|
@@ -7781,8 +8487,8 @@ var OfficeUiTabStrip = class extends OfficeElement {
|
|
|
7781
8487
|
<button
|
|
7782
8488
|
type="button"
|
|
7783
8489
|
class="step"
|
|
7784
|
-
aria-label=${
|
|
7785
|
-
title=${
|
|
8490
|
+
aria-label=${next2}
|
|
8491
|
+
title=${next2}
|
|
7786
8492
|
?disabled=${disabled || index < 0 || index >= this.items.length - 1}
|
|
7787
8493
|
@click=${() => this.move(1, false)}
|
|
7788
8494
|
>${glyph("chevronRight", "icon")}</button
|
|
@@ -7937,21 +8643,21 @@ var OfficeUiTitleBar = class extends OfficeElement {
|
|
|
7937
8643
|
}
|
|
7938
8644
|
onQatKey(event) {
|
|
7939
8645
|
if (event.ctrlKey || event.metaKey || event.altKey) return;
|
|
7940
|
-
const
|
|
7941
|
-
const index =
|
|
7942
|
-
const last =
|
|
8646
|
+
const list2 = this.enabledButtons();
|
|
8647
|
+
const index = list2.findIndex((b) => b === event.target.closest("button"));
|
|
8648
|
+
const last = list2.length - 1;
|
|
7943
8649
|
const moves = {
|
|
7944
|
-
ArrowRight: (index + 1) %
|
|
7945
|
-
ArrowLeft: (index + last) %
|
|
8650
|
+
ArrowRight: (index + 1) % list2.length,
|
|
8651
|
+
ArrowLeft: (index + last) % list2.length,
|
|
7946
8652
|
Home: 0,
|
|
7947
8653
|
End: last
|
|
7948
8654
|
};
|
|
7949
|
-
const
|
|
7950
|
-
if (
|
|
8655
|
+
const next2 = moves[event.key] ?? -1;
|
|
8656
|
+
if (next2 >= 0 && index >= 0) {
|
|
7951
8657
|
event.preventDefault();
|
|
7952
|
-
|
|
8658
|
+
list2[next2]?.focus();
|
|
7953
8659
|
}
|
|
7954
|
-
if (
|
|
8660
|
+
if (next2 >= 0 || event.key === " " || event.key === "Enter") event.stopPropagation();
|
|
7955
8661
|
}
|
|
7956
8662
|
quickAccess() {
|
|
7957
8663
|
const qa = this.model.quickAccess;
|
|
@@ -8024,18 +8730,18 @@ var OfficeUiTitleBar = class extends OfficeElement {
|
|
|
8024
8730
|
if (!ctrlKey && !metaKey) event.stopPropagation();
|
|
8025
8731
|
}
|
|
8026
8732
|
onSearchBlur(event) {
|
|
8027
|
-
const
|
|
8733
|
+
const next2 = event.relatedTarget;
|
|
8028
8734
|
const box = this.renderRoot.querySelector(".box");
|
|
8029
|
-
if (!
|
|
8735
|
+
if (!next2 || !box?.contains(next2)) this.closeResults();
|
|
8030
8736
|
}
|
|
8031
8737
|
results(search) {
|
|
8032
8738
|
if (!search || !this.resultsOpen)
|
|
8033
8739
|
return html`<div class="results" role="listbox" hidden></div>
|
|
8034
8740
|
<div class="sr" role="status"></div>`;
|
|
8035
8741
|
const query = this.query;
|
|
8036
|
-
const pick = (event,
|
|
8742
|
+
const pick = (event, run2) => {
|
|
8037
8743
|
event.preventDefault();
|
|
8038
|
-
|
|
8744
|
+
run2();
|
|
8039
8745
|
};
|
|
8040
8746
|
return html`
|
|
8041
8747
|
<div class="results" role="listbox" ?hidden=${!this.resultsOpen}>
|
|
@@ -8188,9 +8894,9 @@ var OfficeUiZoomSlider = class extends OfficeElement {
|
|
|
8188
8894
|
get value() {
|
|
8189
8895
|
return clampTo(this.requested, this.low, this.high);
|
|
8190
8896
|
}
|
|
8191
|
-
set value(
|
|
8897
|
+
set value(next2) {
|
|
8192
8898
|
const old = this.value;
|
|
8193
|
-
this.requested = finite(Number(
|
|
8899
|
+
this.requested = finite(Number(next2), 100);
|
|
8194
8900
|
this.requestUpdate("value", old);
|
|
8195
8901
|
}
|
|
8196
8902
|
get low() {
|
|
@@ -8203,12 +8909,12 @@ var OfficeUiZoomSlider = class extends OfficeElement {
|
|
|
8203
8909
|
stepBy(direction) {
|
|
8204
8910
|
const step2 = Math.max(1, finite(this.step, 10));
|
|
8205
8911
|
const current = this.value;
|
|
8206
|
-
const
|
|
8207
|
-
this.commit(
|
|
8912
|
+
const next2 = direction > 0 ? Math.floor(current / step2) * step2 + step2 : Math.ceil(current / step2) * step2 - step2;
|
|
8913
|
+
this.commit(next2, "change");
|
|
8208
8914
|
}
|
|
8209
|
-
commit(
|
|
8915
|
+
commit(next2, type) {
|
|
8210
8916
|
if (present(this.disabled)) return;
|
|
8211
|
-
const value = clampTo(
|
|
8917
|
+
const value = clampTo(next2, this.low, this.high);
|
|
8212
8918
|
if (value === this.value && type === "change") return;
|
|
8213
8919
|
this.value = value;
|
|
8214
8920
|
this.dispatchEvent(new Event("input", { bubbles: true, composed: true }));
|
|
@@ -8241,7 +8947,7 @@ var OfficeUiZoomSlider = class extends OfficeElement {
|
|
|
8241
8947
|
min: this.low,
|
|
8242
8948
|
max: this.high,
|
|
8243
8949
|
disabled,
|
|
8244
|
-
onInput: (
|
|
8950
|
+
onInput: (next2) => this.commit(next2, "input"),
|
|
8245
8951
|
onChange: () => this.dispatchEvent(new Event("change", { bubbles: true, composed: true }))
|
|
8246
8952
|
})}
|
|
8247
8953
|
<button
|
|
@@ -8478,7 +9184,7 @@ var OfficeUiColorGrid = class extends OfficeElement {
|
|
|
8478
9184
|
column: Number(item.dataset.column)
|
|
8479
9185
|
});
|
|
8480
9186
|
const from = at(items[current]);
|
|
8481
|
-
const inRow = (
|
|
9187
|
+
const inRow = (row2) => items.filter((item) => at(item).row === row2);
|
|
8482
9188
|
const rows = [...new Set(items.map((item) => at(item).row))];
|
|
8483
9189
|
const vertical2 = (step2) => {
|
|
8484
9190
|
const target = rows[rows.indexOf(from.row) + step2];
|
|
@@ -8487,13 +9193,13 @@ var OfficeUiColorGrid = class extends OfficeElement {
|
|
|
8487
9193
|
(best, item) => Math.abs(at(item).column - from.column) < Math.abs(at(best).column - from.column) ? item : best
|
|
8488
9194
|
);
|
|
8489
9195
|
};
|
|
8490
|
-
const
|
|
9196
|
+
const next2 = event.key === "ArrowRight" ? items[current + 1] : event.key === "ArrowLeft" ? items[current - 1] : event.key === "ArrowDown" ? vertical2(1) : event.key === "ArrowUp" ? vertical2(-1) : event.key === "Home" ? items[0] : event.key === "End" ? items.at(-1) : void 0;
|
|
8491
9197
|
if (!["ArrowRight", "ArrowLeft", "ArrowDown", "ArrowUp", "Home", "End"].includes(event.key))
|
|
8492
9198
|
return;
|
|
8493
|
-
if (!
|
|
9199
|
+
if (!next2 && (event.key === "ArrowDown" || event.key === "ArrowUp")) return;
|
|
8494
9200
|
event.preventDefault();
|
|
8495
9201
|
event.stopPropagation();
|
|
8496
|
-
|
|
9202
|
+
next2?.focus();
|
|
8497
9203
|
}
|
|
8498
9204
|
willUpdate() {
|
|
8499
9205
|
this.setAttribute("role", "group");
|
|
@@ -8504,17 +9210,17 @@ var OfficeUiColorGrid = class extends OfficeElement {
|
|
|
8504
9210
|
const value = this.value ? normalizePaletteHex(this.value) ?? this.value : null;
|
|
8505
9211
|
const position = this.selectedTheme;
|
|
8506
9212
|
const checked = (item, source, column) => position ? source === "theme" && column === position.column && item.variant?.kind === position.variant?.kind && item.variant?.percent === position.variant?.percent : value === item.hex;
|
|
8507
|
-
let
|
|
8508
|
-
const command = (text2, name2, checked2,
|
|
9213
|
+
let row2 = 0;
|
|
9214
|
+
const command = (text2, name2, checked2, run2) => html`<button
|
|
8509
9215
|
type="button"
|
|
8510
9216
|
class="command"
|
|
8511
9217
|
data-command=${name2}
|
|
8512
|
-
data-row=${
|
|
9218
|
+
data-row=${row2++}
|
|
8513
9219
|
data-column="0"
|
|
8514
9220
|
role=${checked2 === void 0 ? "button" : "menuitemradio"}
|
|
8515
9221
|
aria-checked=${checked2 === void 0 ? nothing : String(checked2)}
|
|
8516
9222
|
?disabled=${disabled}
|
|
8517
|
-
@click=${
|
|
9223
|
+
@click=${run2}
|
|
8518
9224
|
>${text2}</button
|
|
8519
9225
|
>`;
|
|
8520
9226
|
const swatch = (item, source, column) => html`<button
|
|
@@ -8523,7 +9229,7 @@ var OfficeUiColorGrid = class extends OfficeElement {
|
|
|
8523
9229
|
role="menuitemradio"
|
|
8524
9230
|
data-color=${item.hex}
|
|
8525
9231
|
data-source=${source}
|
|
8526
|
-
data-row=${
|
|
9232
|
+
data-row=${row2}
|
|
8527
9233
|
data-column=${column}
|
|
8528
9234
|
title=${item.label}
|
|
8529
9235
|
aria-label=${item.label}
|
|
@@ -8543,7 +9249,7 @@ var OfficeUiColorGrid = class extends OfficeElement {
|
|
|
8543
9249
|
(item, index) => item ? swatch(item, source, index) : html`<span></span>`
|
|
8544
9250
|
)}</div
|
|
8545
9251
|
>`;
|
|
8546
|
-
|
|
9252
|
+
row2++;
|
|
8547
9253
|
return result;
|
|
8548
9254
|
};
|
|
8549
9255
|
const palette = this.palette ?? buildThemePalette(this.themeColors ?? void 0, this.themeNames ?? void 0);
|
|
@@ -8626,17 +9332,17 @@ var OfficeUiColorCustom = class extends OfficeElement {
|
|
|
8626
9332
|
const { r, g, b } = hslToRgb(this.hsl.h, this.hsl.s, this.hsl.l);
|
|
8627
9333
|
return `#${toHex(r)}${toHex(g)}${toHex(b)}`.toLowerCase();
|
|
8628
9334
|
}
|
|
8629
|
-
set value(
|
|
8630
|
-
const color = normalizePaletteHex(
|
|
9335
|
+
set value(next2) {
|
|
9336
|
+
const color = normalizePaletteHex(next2 ?? "");
|
|
8631
9337
|
if (!color || color === this.value) return;
|
|
8632
9338
|
const rgb = hexToRgbChannels(color);
|
|
8633
9339
|
this.hsl = rgbToHsl(rgb.r, rgb.g, rgb.b);
|
|
8634
9340
|
this.typed = null;
|
|
8635
9341
|
this.bad = null;
|
|
8636
9342
|
}
|
|
8637
|
-
set(
|
|
9343
|
+
set(next2) {
|
|
8638
9344
|
if (present(this.disabled)) return;
|
|
8639
|
-
this.hsl = { ...this.hsl, ...
|
|
9345
|
+
this.hsl = { ...this.hsl, ...next2 };
|
|
8640
9346
|
this.typed = null;
|
|
8641
9347
|
this.bad = null;
|
|
8642
9348
|
emit(this, "office-color-change", { color: this.value });
|
|
@@ -8660,7 +9366,7 @@ var OfficeUiColorCustom = class extends OfficeElement {
|
|
|
8660
9366
|
target.setPointerCapture?.(event.pointerId);
|
|
8661
9367
|
target.focus();
|
|
8662
9368
|
move.call(this, event);
|
|
8663
|
-
const onMove = (
|
|
9369
|
+
const onMove = (next2) => move.call(this, next2);
|
|
8664
9370
|
const stop = () => {
|
|
8665
9371
|
target.removeEventListener("pointermove", onMove);
|
|
8666
9372
|
target.removeEventListener("pointerup", stop);
|
|
@@ -8674,20 +9380,20 @@ var OfficeUiColorCustom = class extends OfficeElement {
|
|
|
8674
9380
|
squareKey(event) {
|
|
8675
9381
|
const step2 = event.shiftKey ? 10 : 1;
|
|
8676
9382
|
const { h, s } = this.hsl;
|
|
8677
|
-
const
|
|
8678
|
-
if (!
|
|
9383
|
+
const next2 = event.key === "ArrowRight" ? { h: clamp(h + step2 * (360 / SCALE), 359.999) } : event.key === "ArrowLeft" ? { h: clamp(h - step2 * (360 / SCALE), 359.999) } : event.key === "ArrowUp" ? { s: clamp(s + step2 / SCALE) } : event.key === "ArrowDown" ? { s: clamp(s - step2 / SCALE) } : event.key === "Home" ? { h: 0 } : event.key === "End" ? { h: 359.999 } : void 0;
|
|
9384
|
+
if (!next2) return;
|
|
8679
9385
|
event.preventDefault();
|
|
8680
9386
|
event.stopPropagation();
|
|
8681
|
-
this.set(
|
|
9387
|
+
this.set(next2);
|
|
8682
9388
|
}
|
|
8683
9389
|
sliderKey(event) {
|
|
8684
9390
|
const step2 = (event.shiftKey ? 10 : 1) / SCALE;
|
|
8685
9391
|
const { l } = this.hsl;
|
|
8686
|
-
const
|
|
8687
|
-
if (
|
|
9392
|
+
const next2 = event.key === "ArrowUp" || event.key === "ArrowRight" ? clamp(l + step2) : event.key === "ArrowDown" || event.key === "ArrowLeft" ? clamp(l - step2) : event.key === "Home" ? 0 : event.key === "End" ? 1 : void 0;
|
|
9393
|
+
if (next2 === void 0) return;
|
|
8688
9394
|
event.preventDefault();
|
|
8689
9395
|
event.stopPropagation();
|
|
8690
|
-
this.set({ l:
|
|
9396
|
+
this.set({ l: next2 });
|
|
8691
9397
|
}
|
|
8692
9398
|
channels() {
|
|
8693
9399
|
const { r, g, b } = hslToRgb(this.hsl.h, this.hsl.s, this.hsl.l);
|
|
@@ -8713,8 +9419,8 @@ var OfficeUiColorCustom = class extends OfficeElement {
|
|
|
8713
9419
|
if (name === "lum") return this.set({ l: value / SCALE });
|
|
8714
9420
|
const now = this.channels();
|
|
8715
9421
|
const rgb = { ...now, [name]: value };
|
|
8716
|
-
const
|
|
8717
|
-
this.set(
|
|
9422
|
+
const next2 = rgbToHsl(rgb.red, rgb.green, rgb.blue);
|
|
9423
|
+
this.set(next2.s === 0 ? { ...next2, h: this.hsl.h } : next2);
|
|
8718
9424
|
}
|
|
8719
9425
|
onHex(event) {
|
|
8720
9426
|
if (present(this.disabled)) return;
|
|
@@ -8991,17 +9697,17 @@ var STEPS = {
|
|
|
8991
9697
|
ArrowLeft: [0, -1],
|
|
8992
9698
|
ArrowRight: [0, 1]
|
|
8993
9699
|
};
|
|
8994
|
-
function exists(
|
|
8995
|
-
return
|
|
9700
|
+
function exists(row2, col, rows, cols) {
|
|
9701
|
+
return row2 >= 0 && col >= 0 && row2 < rows && col < cols && !(row2 === 0 && col === 0);
|
|
8996
9702
|
}
|
|
8997
|
-
function step(
|
|
8998
|
-
return exists(
|
|
9703
|
+
function step(row2, col, [dr, dc], rows, cols) {
|
|
9704
|
+
return exists(row2 + dr, col + dc, rows, cols) ? { row: row2 + dr, col: col + dc } : { row: row2, col };
|
|
8999
9705
|
}
|
|
9000
|
-
function chartDataSheetKeyAction(key, mode,
|
|
9706
|
+
function chartDataSheetKeyAction(key, mode, row2, col, rows, cols) {
|
|
9001
9707
|
if (key.ctrlKey || key.metaKey || key.altKey) return { type: "native" };
|
|
9002
9708
|
const arrow = STEPS[key.key];
|
|
9003
9709
|
if (arrow) {
|
|
9004
|
-
return mode === "edit" ? { type: "native" } : { type: "move", ...step(
|
|
9710
|
+
return mode === "edit" ? { type: "native" } : { type: "move", ...step(row2, col, arrow, rows, cols) };
|
|
9005
9711
|
}
|
|
9006
9712
|
switch (key.key) {
|
|
9007
9713
|
case "F2":
|
|
@@ -9009,9 +9715,9 @@ function chartDataSheetKeyAction(key, mode, row, col, rows, cols) {
|
|
|
9009
9715
|
case "Escape":
|
|
9010
9716
|
return { type: "revert" };
|
|
9011
9717
|
case "Enter":
|
|
9012
|
-
return { type: "move", ...step(
|
|
9718
|
+
return { type: "move", ...step(row2, col, key.shiftKey ? [-1, 0] : [1, 0], rows, cols) };
|
|
9013
9719
|
case "Tab": {
|
|
9014
|
-
const target = step(
|
|
9720
|
+
const target = step(row2, col, key.shiftKey ? [0, -1] : [0, 1], rows, cols);
|
|
9015
9721
|
return target.col === col ? { type: "native" } : { type: "move", ...target };
|
|
9016
9722
|
}
|
|
9017
9723
|
case "Backspace":
|
|
@@ -9082,10 +9788,10 @@ var OfficeUiChartDataSheet = class extends OfficeElement {
|
|
|
9082
9788
|
}
|
|
9083
9789
|
parse = (raw) => parseLocaleNumber(raw, this.language);
|
|
9084
9790
|
/** The text a cell shows for the current data. */
|
|
9085
|
-
cellText(
|
|
9086
|
-
if (
|
|
9087
|
-
if (col === 0) return this.data.categories[
|
|
9088
|
-
const value = this.data.series[col - 1]?.values[
|
|
9791
|
+
cellText(row2, col) {
|
|
9792
|
+
if (row2 === 0) return this.data.series[col - 1]?.name ?? "";
|
|
9793
|
+
if (col === 0) return this.data.categories[row2 - 1] ?? "";
|
|
9794
|
+
const value = this.data.series[col - 1]?.values[row2 - 1];
|
|
9089
9795
|
return typeof value === "number" ? formatLocaleNumber(value, this.language) : "";
|
|
9090
9796
|
}
|
|
9091
9797
|
/**
|
|
@@ -9109,9 +9815,9 @@ var OfficeUiChartDataSheet = class extends OfficeElement {
|
|
|
9109
9815
|
if (edit) this.emitEdits([edit]);
|
|
9110
9816
|
this.requestUpdate();
|
|
9111
9817
|
}
|
|
9112
|
-
focusCell(
|
|
9818
|
+
focusCell(row2, col) {
|
|
9113
9819
|
const cell = this.renderRoot.querySelector(
|
|
9114
|
-
`input[data-row="${
|
|
9820
|
+
`input[data-row="${row2}"][data-col="${col}"]`
|
|
9115
9821
|
);
|
|
9116
9822
|
cell?.focus();
|
|
9117
9823
|
cell?.select();
|
|
@@ -9119,10 +9825,10 @@ var OfficeUiChartDataSheet = class extends OfficeElement {
|
|
|
9119
9825
|
onKeyDown(event) {
|
|
9120
9826
|
event.stopPropagation();
|
|
9121
9827
|
const input = event.target;
|
|
9122
|
-
const { row, col } = this.position(input);
|
|
9828
|
+
const { row: row2, col } = this.position(input);
|
|
9123
9829
|
const rows = this.data.categories.length + 1;
|
|
9124
9830
|
const cols = this.data.series.length + 1;
|
|
9125
|
-
const action = chartDataSheetKeyAction(event, this.mode,
|
|
9831
|
+
const action = chartDataSheetKeyAction(event, this.mode, row2, col, rows, cols);
|
|
9126
9832
|
if (action.type === "native") return;
|
|
9127
9833
|
if (action.type === "typing") {
|
|
9128
9834
|
this.mode = "enter";
|
|
@@ -9133,7 +9839,7 @@ var OfficeUiChartDataSheet = class extends OfficeElement {
|
|
|
9133
9839
|
this.mode = "edit";
|
|
9134
9840
|
input.setSelectionRange(input.value.length, input.value.length);
|
|
9135
9841
|
} else if (action.type === "revert") {
|
|
9136
|
-
input.value = this.cellText(
|
|
9842
|
+
input.value = this.cellText(row2, col);
|
|
9137
9843
|
this.mode = "ready";
|
|
9138
9844
|
this.invalid = false;
|
|
9139
9845
|
this.requestUpdate();
|
|
@@ -9166,16 +9872,16 @@ var OfficeUiChartDataSheet = class extends OfficeElement {
|
|
|
9166
9872
|
}
|
|
9167
9873
|
this.highlightKey = key;
|
|
9168
9874
|
}
|
|
9169
|
-
cell(
|
|
9875
|
+
cell(row2, col, label, marked) {
|
|
9170
9876
|
return html`<input
|
|
9171
9877
|
type="text"
|
|
9172
9878
|
class=${marked ? "cell highlight" : "cell"}
|
|
9173
|
-
inputmode=${
|
|
9174
|
-
data-row=${
|
|
9879
|
+
inputmode=${row2 > 0 && col > 0 ? "decimal" : "text"}
|
|
9880
|
+
data-row=${row2}
|
|
9175
9881
|
data-col=${col}
|
|
9176
9882
|
aria-label=${label}
|
|
9177
9883
|
?disabled=${this.disabled}
|
|
9178
|
-
.value=${live(this.cellText(
|
|
9884
|
+
.value=${live(this.cellText(row2, col))}
|
|
9179
9885
|
@focus=${this.onFocus}
|
|
9180
9886
|
@keydown=${this.onKeyDown}
|
|
9181
9887
|
@change=${(event) => this.commit(event.target)}
|
|
@@ -9241,21 +9947,21 @@ var OfficeUiChartDataSheet = class extends OfficeElement {
|
|
|
9241
9947
|
></thead
|
|
9242
9948
|
><tbody
|
|
9243
9949
|
>${categories.map(
|
|
9244
|
-
(_,
|
|
9950
|
+
(_, row2) => html`<tr
|
|
9245
9951
|
><th class="category"
|
|
9246
9952
|
><span class="header"
|
|
9247
|
-
>${this.cell(
|
|
9953
|
+
>${this.cell(row2 + 1, 0, fill2(t2.categoryLabel, { number: row2 + 1 }), false)}${edit && categories.length > 1 ? this.removeButton(t2.removeCategory, {
|
|
9248
9954
|
kind: "remove-category",
|
|
9249
|
-
category:
|
|
9955
|
+
category: row2
|
|
9250
9956
|
}) : nothing}</span
|
|
9251
9957
|
></th
|
|
9252
9958
|
>${series.map(
|
|
9253
9959
|
(entry, col) => html`<td
|
|
9254
9960
|
>${this.cell(
|
|
9255
|
-
|
|
9961
|
+
row2 + 1,
|
|
9256
9962
|
col + 1,
|
|
9257
|
-
fill2(t2.valueCell, { name: entry.name, number:
|
|
9258
|
-
mark?.series === col && mark.point ===
|
|
9963
|
+
fill2(t2.valueCell, { name: entry.name, number: row2 + 1 }),
|
|
9964
|
+
mark?.series === col && mark.point === row2
|
|
9259
9965
|
)}</td
|
|
9260
9966
|
>`
|
|
9261
9967
|
)}</tr
|
|
@@ -9270,12 +9976,48 @@ var defineChartDataSheet = definer(
|
|
|
9270
9976
|
"office-ui-chart-data-sheet",
|
|
9271
9977
|
() => OfficeUiChartDataSheet
|
|
9272
9978
|
);
|
|
9979
|
+
|
|
9980
|
+
// src/dialog/focus.ts
|
|
9981
|
+
var MODAL_FOCUSABLE_SELECTOR = [
|
|
9982
|
+
"a[href]",
|
|
9983
|
+
"button:not([disabled])",
|
|
9984
|
+
'input:not([disabled]):not([type="hidden"])',
|
|
9985
|
+
"select:not([disabled])",
|
|
9986
|
+
"textarea:not([disabled])",
|
|
9987
|
+
'[contenteditable="true"]',
|
|
9988
|
+
'[tabindex]:not([tabindex="-1"])'
|
|
9989
|
+
].join(",");
|
|
9990
|
+
function isAvailable(element) {
|
|
9991
|
+
if (element.hidden || element.getAttribute("aria-hidden") === "true") {
|
|
9992
|
+
return false;
|
|
9993
|
+
}
|
|
9994
|
+
const style = element.ownerDocument.defaultView?.getComputedStyle(element);
|
|
9995
|
+
return style?.display !== "none" && style?.visibility !== "hidden";
|
|
9996
|
+
}
|
|
9997
|
+
function focusableElements(root, found = []) {
|
|
9998
|
+
for (const child of Array.from(root.children)) {
|
|
9999
|
+
if (child instanceof HTMLElement) {
|
|
10000
|
+
if (!isAvailable(child)) continue;
|
|
10001
|
+
if (child.matches(MODAL_FOCUSABLE_SELECTOR) && isAvailable(child)) {
|
|
10002
|
+
found.push(child);
|
|
10003
|
+
}
|
|
10004
|
+
if (child.shadowRoot && isAvailable(child)) {
|
|
10005
|
+
focusableElements(child.shadowRoot, found);
|
|
10006
|
+
}
|
|
10007
|
+
}
|
|
10008
|
+
focusableElements(child, found);
|
|
10009
|
+
}
|
|
10010
|
+
return found;
|
|
10011
|
+
}
|
|
9273
10012
|
function deepActiveElement(doc) {
|
|
9274
|
-
let
|
|
9275
|
-
while (
|
|
9276
|
-
|
|
10013
|
+
let active2 = doc.activeElement;
|
|
10014
|
+
while (active2?.shadowRoot?.activeElement) {
|
|
10015
|
+
active2 = active2.shadowRoot.activeElement;
|
|
9277
10016
|
}
|
|
9278
|
-
return
|
|
10017
|
+
return active2;
|
|
10018
|
+
}
|
|
10019
|
+
function modalFocusableElements(panel) {
|
|
10020
|
+
return focusableElements(panel);
|
|
9279
10021
|
}
|
|
9280
10022
|
function modalActiveElement(doc) {
|
|
9281
10023
|
return deepActiveElement(doc);
|
|
@@ -9335,8 +10077,8 @@ var OfficeUiProgressDialog = class extends OfficeElement {
|
|
|
9335
10077
|
updated(_changed) {
|
|
9336
10078
|
const open = this.model.open;
|
|
9337
10079
|
if (open && !this.wasOpen) {
|
|
9338
|
-
const
|
|
9339
|
-
this.returnFocus =
|
|
10080
|
+
const active2 = modalActiveElement(this.ownerDocument);
|
|
10081
|
+
this.returnFocus = active2 && active2 !== this.ownerDocument.body ? active2 : null;
|
|
9340
10082
|
this.cancelButton?.focus();
|
|
9341
10083
|
} else if (!open && this.wasOpen) {
|
|
9342
10084
|
const target = this.returnFocus;
|
|
@@ -9390,6 +10132,689 @@ var defineProgressDialog = definer(
|
|
|
9390
10132
|
() => OfficeUiProgressDialog
|
|
9391
10133
|
);
|
|
9392
10134
|
|
|
10135
|
+
// raw-css:/home/runner/work/ooxml/ooxml/src/ui/src/dialog/message-dialog.css?raw
|
|
10136
|
+
var message_dialog_default = "/* The box is a native modal <dialog>, so it enters the top layer and sits above any other modal\n dialog on the page. The host's own overlay only stands in where showModal is unavailable. */\n:host {\n position: fixed;\n inset: 0;\n z-index: calc(var(--office-z-popover) + 200);\n display: flex;\n align-items: center;\n justify-content: center;\n background: var(--office-overlay);\n}\n:host([data-modal]) {\n position: static;\n display: contents;\n background: none;\n}\n:host([hidden]) {\n display: none !important;\n}\ndialog.box {\n box-sizing: border-box;\n width: min(calc(100vw - 2 * var(--office-space-4)), 26rem);\n max-width: none;\n max-height: var(--office-dialog-max-height);\n margin: auto;\n padding: 0;\n overflow: auto;\n border: var(--office-border-width) solid var(--office-border);\n border-radius: var(--office-radius-lg);\n background: var(--office-popover);\n color: var(--office-popover-foreground);\n box-shadow: var(--office-shadow-lg);\n font-family: var(--office-font);\n font-size: var(--office-font-size);\n}\ndialog.box:not([open]) {\n display: none;\n}\n:host(:not([data-modal])) dialog.box {\n position: relative;\n inset: auto;\n}\ndialog.box::backdrop {\n background: var(--office-overlay);\n}\ndialog.box:focus {\n outline: none;\n}\n.content {\n display: flex;\n flex-direction: column;\n gap: var(--office-space-3);\n padding: var(--office-space-5);\n}\nh2 {\n margin: 0;\n font-size: var(--office-font-size-lg);\n font-weight: 600;\n}\n.message {\n margin: 0;\n overflow: auto;\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n}\nlabel {\n display: flex;\n flex-direction: column;\n gap: var(--office-space-1);\n}\ninput {\n box-sizing: border-box;\n width: 100%;\n min-height: var(--office-control-height-lg);\n padding: var(--office-space-1) var(--office-space-2);\n border: var(--office-border-width) solid var(--office-border);\n border-radius: var(--office-radius-md);\n background: var(--office-background);\n color: var(--office-foreground);\n font: inherit;\n}\ninput:focus-visible {\n outline: var(--office-focus-width) solid var(--office-ring);\n outline-offset: var(--office-focus-offset);\n}\n.actions {\n display: flex;\n flex-wrap: wrap;\n justify-content: flex-end;\n gap: var(--office-space-2);\n}\nbutton {\n box-sizing: border-box;\n min-width: var(--office-dialog-button-min-width);\n min-height: var(--office-control-height-lg);\n padding: var(--office-space-1-5) var(--office-space-3-5);\n border: var(--office-border-width) solid var(--office-border);\n border-radius: var(--office-radius-md);\n background: var(--office-surface);\n color: var(--office-foreground);\n font: 500 var(--office-font-size) / 1.2 var(--office-font);\n cursor: pointer;\n touch-action: manipulation;\n}\nbutton:hover {\n background: var(--office-selected);\n}\nbutton.primary {\n border-color: var(--office-accent);\n background: var(--office-accent);\n color: var(--office-accent-foreground);\n}\nbutton.danger {\n border-color: var(--office-danger);\n background: var(--office-danger);\n color: var(--office-danger-foreground);\n}\nbutton.primary:hover,\nbutton.danger:hover {\n opacity: 0.9;\n}\nbutton:focus-visible {\n outline: var(--office-focus-width) solid var(--office-ring);\n outline-offset: var(--office-focus-offset);\n}\n@media (pointer: coarse), (max-width: 767px) {\n button {\n min-height: var(--office-target-size-touch);\n }\n}\n@media (forced-colors: active) {\n dialog.box {\n border-color: CanvasText;\n background: Canvas;\n color: CanvasText;\n }\n dialog.box::backdrop {\n background: transparent;\n }\n button,\n button.primary,\n button.danger {\n border-color: ButtonText;\n background: ButtonFace;\n color: ButtonText;\n }\n button:hover {\n background: Highlight;\n color: HighlightText;\n }\n}\n";
|
|
10137
|
+
|
|
10138
|
+
// src/dialog/message-dialog.ts
|
|
10139
|
+
var nextId = 0;
|
|
10140
|
+
var OfficeUiMessageDialog = class extends OfficeElement {
|
|
10141
|
+
static resultEvent = "office-message-dialog-result";
|
|
10142
|
+
static styles = controlStyles(message_dialog_default);
|
|
10143
|
+
static properties = {
|
|
10144
|
+
kind: { type: String },
|
|
10145
|
+
tone: { type: String },
|
|
10146
|
+
heading: { type: String },
|
|
10147
|
+
message: { type: String },
|
|
10148
|
+
confirmLabel: { type: String, attribute: "confirm-label" },
|
|
10149
|
+
cancelLabel: { type: String, attribute: "cancel-label" },
|
|
10150
|
+
inputLabel: { type: String, attribute: "input-label" },
|
|
10151
|
+
value: { type: String },
|
|
10152
|
+
placeholder: { type: String }
|
|
10153
|
+
};
|
|
10154
|
+
settled = false;
|
|
10155
|
+
returnFocus = null;
|
|
10156
|
+
uid = `office-message-${++nextId}`;
|
|
10157
|
+
constructor() {
|
|
10158
|
+
super();
|
|
10159
|
+
this.kind = "confirm";
|
|
10160
|
+
this.tone = "default";
|
|
10161
|
+
this.heading = "";
|
|
10162
|
+
this.message = "";
|
|
10163
|
+
this.confirmLabel = "OK";
|
|
10164
|
+
this.cancelLabel = "Cancel";
|
|
10165
|
+
this.inputLabel = "";
|
|
10166
|
+
this.value = "";
|
|
10167
|
+
this.placeholder = "";
|
|
10168
|
+
this.addEventListener("keydown", (event) => this.onKey(event));
|
|
10169
|
+
}
|
|
10170
|
+
connectedCallback() {
|
|
10171
|
+
const active2 = modalActiveElement(this.ownerDocument);
|
|
10172
|
+
this.returnFocus = active2 instanceof HTMLElement && active2 !== this.ownerDocument.body ? active2 : null;
|
|
10173
|
+
super.connectedCallback();
|
|
10174
|
+
this.settled = false;
|
|
10175
|
+
queueMicrotask(() => {
|
|
10176
|
+
if (this.isConnected) this.focusInitial();
|
|
10177
|
+
});
|
|
10178
|
+
}
|
|
10179
|
+
disconnectedCallback() {
|
|
10180
|
+
super.disconnectedCallback();
|
|
10181
|
+
this.finish(false);
|
|
10182
|
+
const target = this.returnFocus;
|
|
10183
|
+
this.returnFocus = null;
|
|
10184
|
+
if (target?.isConnected) target.focus?.();
|
|
10185
|
+
}
|
|
10186
|
+
get input() {
|
|
10187
|
+
return this.renderRoot.querySelector("input");
|
|
10188
|
+
}
|
|
10189
|
+
/**
|
|
10190
|
+
* Show the box as a native modal `<dialog>`: it enters the top layer, so it sits above (and
|
|
10191
|
+
* takes over from) any other modal dialog the page has open, and the rest of the page goes
|
|
10192
|
+
* inert. Where `showModal` is missing the host's fixed overlay styling stands in.
|
|
10193
|
+
*/
|
|
10194
|
+
openModal() {
|
|
10195
|
+
const box = this.renderRoot.querySelector("dialog.box");
|
|
10196
|
+
if (!box || box.open) return;
|
|
10197
|
+
try {
|
|
10198
|
+
box.showModal();
|
|
10199
|
+
this.setAttribute("data-modal", "");
|
|
10200
|
+
} catch {
|
|
10201
|
+
box.setAttribute("open", "");
|
|
10202
|
+
this.removeAttribute("data-modal");
|
|
10203
|
+
}
|
|
10204
|
+
}
|
|
10205
|
+
focusInitial() {
|
|
10206
|
+
this.ensureRendered();
|
|
10207
|
+
this.openModal();
|
|
10208
|
+
const root = this.renderRoot;
|
|
10209
|
+
const target = this.kind === "prompt" ? this.input : root.querySelector(
|
|
10210
|
+
this.tone === "danger" && this.kind === "confirm" ? ".cancel" : ".confirm"
|
|
10211
|
+
);
|
|
10212
|
+
const box = root.querySelector(".box");
|
|
10213
|
+
(target ?? box)?.focus();
|
|
10214
|
+
if (this.kind === "prompt") this.input?.select();
|
|
10215
|
+
}
|
|
10216
|
+
/** Emit the result once; later calls (a second click, removal after a click) do nothing. */
|
|
10217
|
+
finish(confirmed) {
|
|
10218
|
+
if (this.settled) return;
|
|
10219
|
+
this.settled = true;
|
|
10220
|
+
const value = confirmed && this.kind === "prompt" ? this.input?.value ?? this.value : "";
|
|
10221
|
+
const { resultEvent } = this.constructor;
|
|
10222
|
+
this.fire(resultEvent, { confirmed, value });
|
|
10223
|
+
}
|
|
10224
|
+
onKey(event) {
|
|
10225
|
+
if (event.key === "Escape") {
|
|
10226
|
+
event.preventDefault();
|
|
10227
|
+
event.stopPropagation();
|
|
10228
|
+
this.finish(false);
|
|
10229
|
+
} else if (event.key === "Enter" && !event.isComposing) {
|
|
10230
|
+
const target = event.composedPath()[0];
|
|
10231
|
+
if (target instanceof HTMLButtonElement) return;
|
|
10232
|
+
event.preventDefault();
|
|
10233
|
+
event.stopPropagation();
|
|
10234
|
+
this.finish(true);
|
|
10235
|
+
} else if (event.key === "Tab") {
|
|
10236
|
+
const box = this.renderRoot.querySelector(".box");
|
|
10237
|
+
if (!box) return;
|
|
10238
|
+
const items = modalFocusableElements(box);
|
|
10239
|
+
const current = modalActiveElement(this.ownerDocument);
|
|
10240
|
+
const at = items.findIndex((item) => item === current);
|
|
10241
|
+
const last = items.length - 1;
|
|
10242
|
+
if (at < 0 || !event.shiftKey && at === last || event.shiftKey && at === 0) {
|
|
10243
|
+
event.preventDefault();
|
|
10244
|
+
items[at < 0 || !event.shiftKey ? 0 : last]?.focus();
|
|
10245
|
+
}
|
|
10246
|
+
}
|
|
10247
|
+
}
|
|
10248
|
+
render() {
|
|
10249
|
+
const title = `${this.uid}-title`;
|
|
10250
|
+
const body = `${this.uid}-body`;
|
|
10251
|
+
const confirmClass = this.tone === "danger" ? "confirm danger" : "confirm primary";
|
|
10252
|
+
return html`
|
|
10253
|
+
<dialog
|
|
10254
|
+
class="box"
|
|
10255
|
+
role="alertdialog"
|
|
10256
|
+
aria-modal="true"
|
|
10257
|
+
aria-labelledby=${title}
|
|
10258
|
+
aria-describedby=${body}
|
|
10259
|
+
tabindex="-1"
|
|
10260
|
+
@click=${(event) => {
|
|
10261
|
+
if (event.target === event.currentTarget) this.finish(false);
|
|
10262
|
+
}}
|
|
10263
|
+
@cancel=${(event) => {
|
|
10264
|
+
event.preventDefault();
|
|
10265
|
+
this.finish(false);
|
|
10266
|
+
}}
|
|
10267
|
+
>
|
|
10268
|
+
<div class="content">
|
|
10269
|
+
<h2 id=${title}>${this.heading}</h2>
|
|
10270
|
+
<p class="message" id=${body}>${this.message}</p>
|
|
10271
|
+
${this.kind === "prompt" ? html`<label
|
|
10272
|
+
>${this.inputLabel ? html`<span>${this.inputLabel}</span>` : nothing}<input
|
|
10273
|
+
type="text"
|
|
10274
|
+
.value=${this.value}
|
|
10275
|
+
placeholder=${this.placeholder}
|
|
10276
|
+
aria-label=${this.inputLabel || this.heading}
|
|
10277
|
+
aria-describedby=${body}
|
|
10278
|
+
autocomplete="off"
|
|
10279
|
+
/></label>` : nothing}
|
|
10280
|
+
<div class="actions">
|
|
10281
|
+
${this.kind === "alert" ? nothing : html`<button class="cancel" type="button" @click=${() => this.finish(false)}
|
|
10282
|
+
>${this.cancelLabel}</button
|
|
10283
|
+
>`}<button class=${confirmClass} type="button" @click=${() => this.finish(true)}
|
|
10284
|
+
>${this.confirmLabel}</button
|
|
10285
|
+
>
|
|
10286
|
+
</div>
|
|
10287
|
+
</div>
|
|
10288
|
+
</dialog>
|
|
10289
|
+
`;
|
|
10290
|
+
}
|
|
10291
|
+
};
|
|
10292
|
+
var defineMessageDialog = definer("office-ui-message-dialog", () => OfficeUiMessageDialog);
|
|
10293
|
+
|
|
10294
|
+
// raw-css:/home/runner/work/ooxml/ooxml/src/ui/src/dialog/share-dialog.css?raw
|
|
10295
|
+
var share_dialog_default = ":host {\n display: contents;\n}\n:host([hidden]) {\n display: none !important;\n}\n.body {\n display: flex;\n flex-direction: column;\n gap: var(--office-space-3);\n width: min(calc(100vw - 4 * var(--office-space-4)), 28rem);\n font-family: var(--office-font);\n font-size: var(--office-font-size);\n color: var(--office-popover-foreground);\n}\np {\n margin: 0;\n}\n.description {\n color: var(--office-foreground);\n}\n.hint {\n color: var(--office-muted-foreground);\n font-size: var(--office-font-size-sm);\n}\n.error {\n color: var(--office-danger);\n font-size: var(--office-font-size-sm);\n}\n.tabs {\n display: flex;\n gap: var(--office-space-1);\n border-bottom: var(--office-border-width) solid var(--office-border);\n}\n.tab {\n min-width: 0;\n min-height: var(--office-control-height);\n margin-bottom: calc(-1 * var(--office-border-width));\n padding: var(--office-space-1) var(--office-space-3);\n border: 0;\n border-bottom: var(--office-border-width-thick) solid transparent;\n border-radius: 0;\n background: none;\n color: var(--office-muted-foreground);\n}\n.tab[aria-selected='true'] {\n border-bottom-color: var(--office-accent);\n color: var(--office-foreground);\n font-weight: 600;\n}\n.field {\n display: flex;\n flex-direction: column;\n gap: var(--office-space-1);\n}\ninput {\n box-sizing: border-box;\n width: 100%;\n min-height: var(--office-control-height-lg);\n padding: var(--office-space-1) var(--office-space-2);\n border: var(--office-border-width) solid var(--office-border);\n border-radius: var(--office-radius-md);\n background: var(--office-background);\n color: var(--office-foreground);\n font: inherit;\n}\ninput:focus-visible,\nbutton:focus-visible {\n outline: var(--office-focus-width) solid var(--office-ring);\n outline-offset: var(--office-focus-offset);\n}\n.copy-row {\n display: flex;\n gap: var(--office-space-2);\n}\n.copy-row input {\n flex: 1;\n min-width: 0;\n}\n.status {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n gap: var(--office-space-2);\n}\n.dot {\n width: 0.625rem;\n height: 0.625rem;\n border-radius: 50%;\n background: var(--office-muted-foreground);\n}\n.status[data-status='connected'] .dot {\n background: var(--office-accent);\n}\n.status[data-status='connecting'] .dot,\n.status[data-status='disconnected'] .dot {\n background: var(--office-warning);\n}\n.status[data-status='error'] .dot {\n background: var(--office-danger);\n}\n.count {\n margin-inline-start: auto;\n color: var(--office-muted-foreground);\n font-size: var(--office-font-size-sm);\n}\n.details {\n display: grid;\n grid-template-columns: auto 1fr;\n gap: var(--office-space-1) var(--office-space-3);\n margin: 0;\n font-size: var(--office-font-size-sm);\n}\n.details dt {\n color: var(--office-muted-foreground);\n}\n.details dd {\n margin: 0;\n overflow-wrap: anywhere;\n}\n.people {\n display: flex;\n flex-direction: column;\n gap: var(--office-space-1);\n}\n.people ul {\n display: flex;\n flex-direction: column;\n gap: var(--office-space-1);\n max-height: 12rem;\n margin: 0;\n padding: 0;\n overflow: auto;\n list-style: none;\n}\n.people li {\n display: flex;\n align-items: center;\n gap: var(--office-space-2);\n}\n.avatar {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex: none;\n width: 1.75rem;\n height: 1.75rem;\n border-radius: 50%;\n background: var(--share-person);\n color: var(--office-app-brand-foreground);\n font-size: var(--office-font-size-xs);\n font-weight: 600;\n}\n.you {\n color: var(--office-muted-foreground);\n}\n.actions {\n display: flex;\n flex-wrap: wrap;\n justify-content: flex-end;\n gap: var(--office-space-2);\n}\nbutton {\n box-sizing: border-box;\n min-width: var(--office-dialog-button-min-width);\n min-height: var(--office-control-height-lg);\n padding: var(--office-space-1-5) var(--office-space-3-5);\n border: var(--office-border-width) solid var(--office-border);\n border-radius: var(--office-radius-md);\n background: var(--office-surface);\n color: var(--office-foreground);\n font: 500 var(--office-font-size) / 1.2 var(--office-font);\n cursor: pointer;\n touch-action: manipulation;\n}\nbutton:hover {\n background: var(--office-selected);\n}\nbutton:disabled {\n opacity: 0.5;\n cursor: default;\n}\nbutton.primary {\n border-color: var(--office-accent);\n background: var(--office-accent);\n color: var(--office-accent-foreground);\n}\nbutton.danger {\n border-color: var(--office-danger);\n background: var(--office-danger);\n color: var(--office-danger-foreground);\n}\nbutton.primary:hover:not(:disabled),\nbutton.danger:hover {\n opacity: 0.9;\n}\n.copy {\n min-width: 0;\n}\n@media (pointer: coarse), (max-width: 767px) {\n button {\n min-height: var(--office-target-size-touch);\n }\n}\n@media (forced-colors: active) {\n .avatar,\n .dot {\n forced-color-adjust: none;\n }\n button,\n button.primary,\n button.danger {\n border-color: ButtonText;\n background: ButtonFace;\n color: ButtonText;\n }\n .tab[aria-selected='true'] {\n border-bottom-color: Highlight;\n }\n}\n";
|
|
10296
|
+
|
|
10297
|
+
// src/dialog/share-dialog-locales.ts
|
|
10298
|
+
var SHARE_DIALOG_LOCALES = ["en", "fr", "de", "es", "zh-CN"];
|
|
10299
|
+
var en = {
|
|
10300
|
+
title: "Share",
|
|
10301
|
+
activeTitle: "Sharing",
|
|
10302
|
+
description: "Edit together with other people. Everyone in the same session sees changes as they are made.",
|
|
10303
|
+
createTab: "Start a session",
|
|
10304
|
+
joinTab: "Join a session",
|
|
10305
|
+
roomName: "Session name",
|
|
10306
|
+
yourName: "Your name",
|
|
10307
|
+
serverUrl: "Server (optional)",
|
|
10308
|
+
serverPlaceholder: "wss://collab.example.com",
|
|
10309
|
+
serverHint: "Without a server, only other windows and tabs of this browser can join.",
|
|
10310
|
+
invitation: "Invitation link or session name",
|
|
10311
|
+
invitationPlaceholder: "Paste a link or type a session name",
|
|
10312
|
+
start: "Start sharing",
|
|
10313
|
+
join: "Join",
|
|
10314
|
+
cancel: "Cancel",
|
|
10315
|
+
close: "Close",
|
|
10316
|
+
stop: "Stop sharing",
|
|
10317
|
+
link: "Invitation link",
|
|
10318
|
+
copy: "Copy",
|
|
10319
|
+
copied: "Copied",
|
|
10320
|
+
linkHint: "Send this link to the people you want to edit with.",
|
|
10321
|
+
session: "Session",
|
|
10322
|
+
server: "Server",
|
|
10323
|
+
noServer: "This browser only",
|
|
10324
|
+
people: "People in this session",
|
|
10325
|
+
you: "(you)",
|
|
10326
|
+
peopleCount: "{count} in this session",
|
|
10327
|
+
invalidRoom: "Use 1 to 128 letters, digits, hyphens or underscores for the session name.",
|
|
10328
|
+
statusOff: "Not sharing.",
|
|
10329
|
+
statusConnecting: "Connecting...",
|
|
10330
|
+
statusConnected: "Connected.",
|
|
10331
|
+
statusJoining: "Joining the session...",
|
|
10332
|
+
statusDisconnected: "Disconnected. Changes are kept and sent when the connection returns.",
|
|
10333
|
+
statusError: "The connection failed. Changes are kept and sent when the connection returns."
|
|
10334
|
+
};
|
|
10335
|
+
var fr = {
|
|
10336
|
+
title: "Partager",
|
|
10337
|
+
activeTitle: "Partage en cours",
|
|
10338
|
+
description: "Modifiez \xE0 plusieurs. Toutes les personnes de la m\xEAme session voient les modifications au fur et \xE0 mesure.",
|
|
10339
|
+
createTab: "D\xE9marrer une session",
|
|
10340
|
+
joinTab: "Rejoindre une session",
|
|
10341
|
+
roomName: "Nom de la session",
|
|
10342
|
+
yourName: "Votre nom",
|
|
10343
|
+
serverUrl: "Serveur (facultatif)",
|
|
10344
|
+
serverPlaceholder: "wss://collab.example.com",
|
|
10345
|
+
serverHint: "Sans serveur, seuls les autres onglets et fen\xEAtres de ce navigateur peuvent rejoindre la session.",
|
|
10346
|
+
invitation: "Lien d'invitation ou nom de session",
|
|
10347
|
+
invitationPlaceholder: "Collez un lien ou saisissez un nom de session",
|
|
10348
|
+
start: "Commencer le partage",
|
|
10349
|
+
join: "Rejoindre",
|
|
10350
|
+
cancel: "Annuler",
|
|
10351
|
+
close: "Fermer",
|
|
10352
|
+
stop: "Arr\xEAter le partage",
|
|
10353
|
+
link: "Lien d'invitation",
|
|
10354
|
+
copy: "Copier",
|
|
10355
|
+
copied: "Copi\xE9",
|
|
10356
|
+
linkHint: "Envoyez ce lien aux personnes avec qui vous voulez modifier.",
|
|
10357
|
+
session: "Session",
|
|
10358
|
+
server: "Serveur",
|
|
10359
|
+
noServer: "Ce navigateur uniquement",
|
|
10360
|
+
people: "Personnes dans cette session",
|
|
10361
|
+
you: "(vous)",
|
|
10362
|
+
peopleCount: "{count} dans cette session",
|
|
10363
|
+
invalidRoom: "Utilisez de 1 \xE0 128 lettres, chiffres, traits d\u2019union ou traits de soulignement pour le nom de la session.",
|
|
10364
|
+
statusOff: "Aucun partage.",
|
|
10365
|
+
statusConnecting: "Connexion...",
|
|
10366
|
+
statusConnected: "Connect\xE9.",
|
|
10367
|
+
statusJoining: "Connexion \xE0 la session...",
|
|
10368
|
+
statusDisconnected: "D\xE9connect\xE9. Les modifications sont conserv\xE9es et envoy\xE9es au retour de la connexion.",
|
|
10369
|
+
statusError: "La connexion a \xE9chou\xE9. Les modifications sont conserv\xE9es et envoy\xE9es au retour de la connexion."
|
|
10370
|
+
};
|
|
10371
|
+
var de = {
|
|
10372
|
+
title: "Freigeben",
|
|
10373
|
+
activeTitle: "Freigegeben",
|
|
10374
|
+
description: "Gemeinsam mit anderen bearbeiten. Alle in derselben Sitzung sehen \xC4nderungen, sobald sie entstehen.",
|
|
10375
|
+
createTab: "Sitzung starten",
|
|
10376
|
+
joinTab: "Sitzung beitreten",
|
|
10377
|
+
roomName: "Sitzungsname",
|
|
10378
|
+
yourName: "Ihr Name",
|
|
10379
|
+
serverUrl: "Server (optional)",
|
|
10380
|
+
serverPlaceholder: "wss://collab.example.com",
|
|
10381
|
+
serverHint: "Ohne Server k\xF6nnen nur andere Fenster und Tabs dieses Browsers beitreten.",
|
|
10382
|
+
invitation: "Einladungslink oder Sitzungsname",
|
|
10383
|
+
invitationPlaceholder: "Link einf\xFCgen oder Sitzungsnamen eingeben",
|
|
10384
|
+
start: "Freigabe starten",
|
|
10385
|
+
join: "Beitreten",
|
|
10386
|
+
cancel: "Abbrechen",
|
|
10387
|
+
close: "Schlie\xDFen",
|
|
10388
|
+
stop: "Freigabe beenden",
|
|
10389
|
+
link: "Einladungslink",
|
|
10390
|
+
copy: "Kopieren",
|
|
10391
|
+
copied: "Kopiert",
|
|
10392
|
+
linkHint: "Senden Sie diesen Link an die Personen, mit denen Sie bearbeiten m\xF6chten.",
|
|
10393
|
+
session: "Sitzung",
|
|
10394
|
+
server: "Server",
|
|
10395
|
+
noServer: "Nur dieser Browser",
|
|
10396
|
+
people: "Personen in dieser Sitzung",
|
|
10397
|
+
you: "(Sie)",
|
|
10398
|
+
peopleCount: "{count} in dieser Sitzung",
|
|
10399
|
+
invalidRoom: "Verwenden Sie f\xFCr den Sitzungsnamen 1 bis 128 Buchstaben, Ziffern, Binde- oder Unterstriche.",
|
|
10400
|
+
statusOff: "Keine Freigabe.",
|
|
10401
|
+
statusConnecting: "Verbindung wird hergestellt...",
|
|
10402
|
+
statusConnected: "Verbunden.",
|
|
10403
|
+
statusJoining: "Sitzung wird beigetreten...",
|
|
10404
|
+
statusDisconnected: "Getrennt. \xC4nderungen bleiben erhalten und werden gesendet, sobald die Verbindung zur\xFCck ist.",
|
|
10405
|
+
statusError: "Die Verbindung ist fehlgeschlagen. \xC4nderungen bleiben erhalten und werden gesendet, sobald die Verbindung zur\xFCck ist."
|
|
10406
|
+
};
|
|
10407
|
+
var es = {
|
|
10408
|
+
title: "Compartir",
|
|
10409
|
+
activeTitle: "Compartiendo",
|
|
10410
|
+
description: "Edite junto con otras personas. Todos los participantes de la misma sesi\xF3n ven los cambios a medida que se hacen.",
|
|
10411
|
+
createTab: "Iniciar una sesi\xF3n",
|
|
10412
|
+
joinTab: "Unirse a una sesi\xF3n",
|
|
10413
|
+
roomName: "Nombre de la sesi\xF3n",
|
|
10414
|
+
yourName: "Su nombre",
|
|
10415
|
+
serverUrl: "Servidor (opcional)",
|
|
10416
|
+
serverPlaceholder: "wss://collab.example.com",
|
|
10417
|
+
serverHint: "Sin servidor, solo pueden unirse otras ventanas y pesta\xF1as de este explorador.",
|
|
10418
|
+
invitation: "V\xEDnculo de invitaci\xF3n o nombre de sesi\xF3n",
|
|
10419
|
+
invitationPlaceholder: "Pegue un v\xEDnculo o escriba un nombre de sesi\xF3n",
|
|
10420
|
+
start: "Empezar a compartir",
|
|
10421
|
+
join: "Unirse",
|
|
10422
|
+
cancel: "Cancelar",
|
|
10423
|
+
close: "Cerrar",
|
|
10424
|
+
stop: "Dejar de compartir",
|
|
10425
|
+
link: "V\xEDnculo de invitaci\xF3n",
|
|
10426
|
+
copy: "Copiar",
|
|
10427
|
+
copied: "Copiado",
|
|
10428
|
+
linkHint: "Env\xEDe este v\xEDnculo a las personas con las que quiere editar.",
|
|
10429
|
+
session: "Sesi\xF3n",
|
|
10430
|
+
server: "Servidor",
|
|
10431
|
+
noServer: "Solo este explorador",
|
|
10432
|
+
people: "Personas en esta sesi\xF3n",
|
|
10433
|
+
you: "(usted)",
|
|
10434
|
+
peopleCount: "{count} en esta sesi\xF3n",
|
|
10435
|
+
invalidRoom: "Use de 1 a 128 letras, d\xEDgitos, guiones o guiones bajos para el nombre de la sesi\xF3n.",
|
|
10436
|
+
statusOff: "Sin compartir.",
|
|
10437
|
+
statusConnecting: "Conectando...",
|
|
10438
|
+
statusConnected: "Conectado.",
|
|
10439
|
+
statusJoining: "Uni\xE9ndose a la sesi\xF3n...",
|
|
10440
|
+
statusDisconnected: "Desconectado. Los cambios se conservan y se env\xEDan cuando vuelva la conexi\xF3n.",
|
|
10441
|
+
statusError: "Error de conexi\xF3n. Los cambios se conservan y se env\xEDan cuando vuelva la conexi\xF3n."
|
|
10442
|
+
};
|
|
10443
|
+
var zhCN = {
|
|
10444
|
+
title: "\u5171\u4EAB",
|
|
10445
|
+
activeTitle: "\u6B63\u5728\u5171\u4EAB",
|
|
10446
|
+
description: "\u4E0E\u4ED6\u4EBA\u4E00\u8D77\u7F16\u8F91\u3002\u540C\u4E00\u4F1A\u8BDD\u4E2D\u7684\u6BCF\u4E2A\u4EBA\u90FD\u4F1A\u5B9E\u65F6\u770B\u5230\u66F4\u6539\u3002",
|
|
10447
|
+
createTab: "\u5F00\u59CB\u4F1A\u8BDD",
|
|
10448
|
+
joinTab: "\u52A0\u5165\u4F1A\u8BDD",
|
|
10449
|
+
roomName: "\u4F1A\u8BDD\u540D\u79F0",
|
|
10450
|
+
yourName: "\u4F60\u7684\u59D3\u540D",
|
|
10451
|
+
serverUrl: "\u670D\u52A1\u5668\uFF08\u53EF\u9009\uFF09",
|
|
10452
|
+
serverPlaceholder: "wss://collab.example.com",
|
|
10453
|
+
serverHint: "\u6CA1\u6709\u670D\u52A1\u5668\u65F6\uFF0C\u53EA\u6709\u6B64\u6D4F\u89C8\u5668\u7684\u5176\u4ED6\u7A97\u53E3\u548C\u6807\u7B7E\u9875\u53EF\u4EE5\u52A0\u5165\u3002",
|
|
10454
|
+
invitation: "\u9080\u8BF7\u94FE\u63A5\u6216\u4F1A\u8BDD\u540D\u79F0",
|
|
10455
|
+
invitationPlaceholder: "\u7C98\u8D34\u94FE\u63A5\u6216\u952E\u5165\u4F1A\u8BDD\u540D\u79F0",
|
|
10456
|
+
start: "\u5F00\u59CB\u5171\u4EAB",
|
|
10457
|
+
join: "\u52A0\u5165",
|
|
10458
|
+
cancel: "\u53D6\u6D88",
|
|
10459
|
+
close: "\u5173\u95ED",
|
|
10460
|
+
stop: "\u505C\u6B62\u5171\u4EAB",
|
|
10461
|
+
link: "\u9080\u8BF7\u94FE\u63A5",
|
|
10462
|
+
copy: "\u590D\u5236",
|
|
10463
|
+
copied: "\u5DF2\u590D\u5236",
|
|
10464
|
+
linkHint: "\u5C06\u6B64\u94FE\u63A5\u53D1\u9001\u7ED9\u8981\u4E00\u8D77\u7F16\u8F91\u7684\u4EBA\u3002",
|
|
10465
|
+
session: "\u4F1A\u8BDD",
|
|
10466
|
+
server: "\u670D\u52A1\u5668",
|
|
10467
|
+
noServer: "\u4EC5\u6B64\u6D4F\u89C8\u5668",
|
|
10468
|
+
people: "\u6B64\u4F1A\u8BDD\u4E2D\u7684\u4EBA\u5458",
|
|
10469
|
+
you: "\uFF08\u4F60\uFF09",
|
|
10470
|
+
peopleCount: "\u6B64\u4F1A\u8BDD\u4E2D\u6709 {count} \u4EBA",
|
|
10471
|
+
invalidRoom: "\u4F1A\u8BDD\u540D\u79F0\u8BF7\u4F7F\u7528 1 \u5230 128 \u4E2A\u5B57\u6BCD\u3001\u6570\u5B57\u3001\u8FDE\u5B57\u7B26\u6216\u4E0B\u5212\u7EBF\u3002",
|
|
10472
|
+
statusOff: "\u672A\u5171\u4EAB\u3002",
|
|
10473
|
+
statusConnecting: "\u6B63\u5728\u8FDE\u63A5...",
|
|
10474
|
+
statusConnected: "\u5DF2\u8FDE\u63A5\u3002",
|
|
10475
|
+
statusJoining: "\u6B63\u5728\u52A0\u5165\u4F1A\u8BDD...",
|
|
10476
|
+
statusDisconnected: "\u5DF2\u65AD\u5F00\u8FDE\u63A5\u3002\u66F4\u6539\u4F1A\u4FDD\u7559\uFF0C\u5E76\u5728\u8FDE\u63A5\u6062\u590D\u540E\u53D1\u9001\u3002",
|
|
10477
|
+
statusError: "\u8FDE\u63A5\u5931\u8D25\u3002\u66F4\u6539\u4F1A\u4FDD\u7559\uFF0C\u5E76\u5728\u8FDE\u63A5\u6062\u590D\u540E\u53D1\u9001\u3002"
|
|
10478
|
+
};
|
|
10479
|
+
var SHARE_DIALOG_LABELS = { en, fr, de, es, "zh-CN": zhCN };
|
|
10480
|
+
function shareDialogLabels(locale) {
|
|
10481
|
+
const tag = (locale ?? "").trim();
|
|
10482
|
+
if (tag in SHARE_DIALOG_LABELS) return SHARE_DIALOG_LABELS[tag];
|
|
10483
|
+
if (/^zh(-|$)/iu.test(tag)) return zhCN;
|
|
10484
|
+
const base = tag.split("-")[0]?.toLowerCase() ?? "";
|
|
10485
|
+
return SHARE_DIALOG_LABELS[base] ?? en;
|
|
10486
|
+
}
|
|
10487
|
+
|
|
10488
|
+
// src/dialog/share-dialog.ts
|
|
10489
|
+
var OfficeUiShareDialog = class extends OfficeElement {
|
|
10490
|
+
static startEvent = "office-share-start";
|
|
10491
|
+
static stopEvent = "office-share-stop";
|
|
10492
|
+
static closeEvent = "office-share-close";
|
|
10493
|
+
static styles = controlStyles(share_dialog_default);
|
|
10494
|
+
static properties = {
|
|
10495
|
+
open: flag,
|
|
10496
|
+
state: { attribute: false },
|
|
10497
|
+
defaults: { attribute: false },
|
|
10498
|
+
invitation: { type: String },
|
|
10499
|
+
location: { attribute: false },
|
|
10500
|
+
labels: { attribute: false },
|
|
10501
|
+
error: { type: String },
|
|
10502
|
+
note: { type: String },
|
|
10503
|
+
noServer: { attribute: "no-server", ...flag },
|
|
10504
|
+
roomPrefix: { attribute: "room-prefix", type: String },
|
|
10505
|
+
view: { state: true },
|
|
10506
|
+
fields: { state: true },
|
|
10507
|
+
joinText: { state: true },
|
|
10508
|
+
copied: { state: true }
|
|
10509
|
+
};
|
|
10510
|
+
/** The server of the session this dialog started, for its invitation link. */
|
|
10511
|
+
sessionServer = null;
|
|
10512
|
+
wasOpen = false;
|
|
10513
|
+
constructor() {
|
|
10514
|
+
super();
|
|
10515
|
+
this.open = false;
|
|
10516
|
+
this.state = COLLABORATION_OFF_STATE;
|
|
10517
|
+
this.defaults = {};
|
|
10518
|
+
this.invitation = "";
|
|
10519
|
+
this.location = null;
|
|
10520
|
+
this.labels = {};
|
|
10521
|
+
this.error = "";
|
|
10522
|
+
this.note = "";
|
|
10523
|
+
this.noServer = false;
|
|
10524
|
+
this.roomPrefix = "room";
|
|
10525
|
+
this.view = "create";
|
|
10526
|
+
this.fields = { roomId: "", userName: "", serverUrl: "" };
|
|
10527
|
+
this.joinText = "";
|
|
10528
|
+
this.copied = false;
|
|
10529
|
+
}
|
|
10530
|
+
get text() {
|
|
10531
|
+
return { ...SHARE_DIALOG_LABELS.en, ...this.labels };
|
|
10532
|
+
}
|
|
10533
|
+
/** Seed the form each time the dialog opens, so it never shows a stale session name. */
|
|
10534
|
+
willUpdate() {
|
|
10535
|
+
if (this.open && !this.wasOpen) {
|
|
10536
|
+
const defaults = this.defaults ?? {};
|
|
10537
|
+
this.fields = {
|
|
10538
|
+
roomId: defaults.roomId || suggestRoomId(this.roomPrefix || "room"),
|
|
10539
|
+
userName: defaults.userName ?? "",
|
|
10540
|
+
serverUrl: defaults.serverUrl ?? ""
|
|
10541
|
+
};
|
|
10542
|
+
this.joinText = this.invitation;
|
|
10543
|
+
this.view = this.invitation ? "join" : "create";
|
|
10544
|
+
this.copied = false;
|
|
10545
|
+
}
|
|
10546
|
+
this.wasOpen = this.open;
|
|
10547
|
+
if (!this.state?.active) this.sessionServer = null;
|
|
10548
|
+
}
|
|
10549
|
+
/** The options the current form describes, or null while it is incomplete. */
|
|
10550
|
+
formOptions() {
|
|
10551
|
+
if (this.view === "join") {
|
|
10552
|
+
return joinShareOptions({
|
|
10553
|
+
invitation: this.joinText,
|
|
10554
|
+
userName: this.fields.userName,
|
|
10555
|
+
serverUrl: this.fields.serverUrl
|
|
10556
|
+
});
|
|
10557
|
+
}
|
|
10558
|
+
return startShareOptions(this.fields);
|
|
10559
|
+
}
|
|
10560
|
+
/** The invitation link of the live session, or '' when not sharing. */
|
|
10561
|
+
invitationLink() {
|
|
10562
|
+
const roomId = this.state?.roomId;
|
|
10563
|
+
if (!this.state?.active || !roomId) return "";
|
|
10564
|
+
const serverUrl = this.sessionServer ?? this.defaults?.serverUrl ?? "";
|
|
10565
|
+
const page = this.location ?? this.ownerDocument.defaultView?.location;
|
|
10566
|
+
return shareInvitation(
|
|
10567
|
+
{ roomId, serverUrl },
|
|
10568
|
+
page ? { origin: page.origin, pathname: page.pathname } : void 0
|
|
10569
|
+
);
|
|
10570
|
+
}
|
|
10571
|
+
submit(event) {
|
|
10572
|
+
event.preventDefault();
|
|
10573
|
+
const options = this.formOptions();
|
|
10574
|
+
if (!options) return;
|
|
10575
|
+
this.sessionServer = options.serverUrl ?? "";
|
|
10576
|
+
this.fire(this.constructor.startEvent, { options });
|
|
10577
|
+
}
|
|
10578
|
+
close() {
|
|
10579
|
+
this.open = false;
|
|
10580
|
+
this.fire(this.constructor.closeEvent, {});
|
|
10581
|
+
}
|
|
10582
|
+
async copy() {
|
|
10583
|
+
const link = this.invitationLink();
|
|
10584
|
+
try {
|
|
10585
|
+
await this.ownerDocument.defaultView?.navigator.clipboard.writeText(link);
|
|
10586
|
+
this.copied = true;
|
|
10587
|
+
} catch {
|
|
10588
|
+
this.renderRoot.querySelector(".link input")?.select();
|
|
10589
|
+
}
|
|
10590
|
+
}
|
|
10591
|
+
edit(key, event) {
|
|
10592
|
+
this.fields = { ...this.fields, [key]: event.target.value };
|
|
10593
|
+
}
|
|
10594
|
+
status() {
|
|
10595
|
+
const t2 = this.text;
|
|
10596
|
+
const state = this.state ?? COLLABORATION_OFF_STATE;
|
|
10597
|
+
if (state.status === "connected") return state.synced ? t2.statusConnected : t2.statusJoining;
|
|
10598
|
+
if (state.status === "connecting") return t2.statusConnecting;
|
|
10599
|
+
if (state.status === "disconnected") return t2.statusDisconnected;
|
|
10600
|
+
if (state.status === "error") return t2.statusError;
|
|
10601
|
+
return t2.statusOff;
|
|
10602
|
+
}
|
|
10603
|
+
field(label, key, placeholder = "") {
|
|
10604
|
+
return html`<label class="field"
|
|
10605
|
+
><span>${label}</span
|
|
10606
|
+
><input
|
|
10607
|
+
type="text"
|
|
10608
|
+
data-key=${key}
|
|
10609
|
+
autocomplete="off"
|
|
10610
|
+
spellcheck="false"
|
|
10611
|
+
maxlength=${key === "roomId" ? 128 : 256}
|
|
10612
|
+
placeholder=${placeholder}
|
|
10613
|
+
.value=${this.fields[key]}
|
|
10614
|
+
@input=${(event) => this.edit(key, event)}
|
|
10615
|
+
/></label>`;
|
|
10616
|
+
}
|
|
10617
|
+
renderForm() {
|
|
10618
|
+
const t2 = this.text;
|
|
10619
|
+
const room = this.fields.roomId.trim();
|
|
10620
|
+
const badRoom = this.view === "create" && room.length > 0 && !isValidRoomId(room);
|
|
10621
|
+
const ready = this.formOptions() !== null;
|
|
10622
|
+
const tab = (view, label) => html`<button
|
|
10623
|
+
type="button"
|
|
10624
|
+
role="tab"
|
|
10625
|
+
class="tab"
|
|
10626
|
+
data-view=${view}
|
|
10627
|
+
aria-selected=${String(this.view === view)}
|
|
10628
|
+
@click=${() => this.view = view}
|
|
10629
|
+
>${label}</button
|
|
10630
|
+
>`;
|
|
10631
|
+
return html`<form class="body" @submit=${(event) => this.submit(event)}>
|
|
10632
|
+
<p class="description">${t2.description}</p>
|
|
10633
|
+
<div class="tabs" role="tablist">${tab("create", t2.createTab)}${tab("join", t2.joinTab)}</div>
|
|
10634
|
+
${this.view === "join" ? html`<label class="field"
|
|
10635
|
+
><span>${t2.invitation}</span
|
|
10636
|
+
><input
|
|
10637
|
+
type="text"
|
|
10638
|
+
data-key="invitation"
|
|
10639
|
+
autocomplete="off"
|
|
10640
|
+
spellcheck="false"
|
|
10641
|
+
placeholder=${t2.invitationPlaceholder}
|
|
10642
|
+
.value=${this.joinText}
|
|
10643
|
+
@input=${(event) => this.joinText = event.target.value}
|
|
10644
|
+
/></label>` : this.field(t2.roomName, "roomId")}${badRoom ? html`<p class="error" role="alert">${t2.invalidRoom}</p>` : nothing}
|
|
10645
|
+
${this.field(t2.yourName, "userName")}
|
|
10646
|
+
${this.noServer ? nothing : html`${this.field(t2.serverUrl, "serverUrl", t2.serverPlaceholder)}<p class="hint"
|
|
10647
|
+
>${t2.serverHint}</p
|
|
10648
|
+
>`}
|
|
10649
|
+
${this.error ? html`<p class="error" role="alert">${this.error}</p>` : nothing}
|
|
10650
|
+
${this.note ? html`<p class="hint">${this.note}</p>` : nothing}
|
|
10651
|
+
<div class="actions">
|
|
10652
|
+
<button type="button" class="cancel" @click=${() => this.close()}>${t2.cancel}</button
|
|
10653
|
+
><button type="submit" class="primary" data-share="start" ?disabled=${!ready}
|
|
10654
|
+
>${this.view === "join" ? t2.join : t2.start}</button
|
|
10655
|
+
>
|
|
10656
|
+
</div>
|
|
10657
|
+
</form>`;
|
|
10658
|
+
}
|
|
10659
|
+
renderActive() {
|
|
10660
|
+
const t2 = this.text;
|
|
10661
|
+
const state = this.state;
|
|
10662
|
+
const people = state.people ?? [];
|
|
10663
|
+
const server = this.sessionServer ?? this.defaults?.serverUrl ?? "";
|
|
10664
|
+
return html`<div class="body">
|
|
10665
|
+
<p class="status" role="status" data-status=${state.status}
|
|
10666
|
+
><span class="dot" aria-hidden="true"></span>${this.status()}<span class="count"
|
|
10667
|
+
>${t2.peopleCount.replace("{count}", String(people.length))}</span
|
|
10668
|
+
></p
|
|
10669
|
+
>
|
|
10670
|
+
<div class="link field">
|
|
10671
|
+
<span>${t2.link}</span>
|
|
10672
|
+
<div class="copy-row">
|
|
10673
|
+
<input type="text" readonly aria-label=${t2.link} .value=${this.invitationLink()} /><button
|
|
10674
|
+
type="button"
|
|
10675
|
+
class="copy"
|
|
10676
|
+
@click=${() => void this.copy()}
|
|
10677
|
+
>${this.copied ? t2.copied : t2.copy}</button
|
|
10678
|
+
>
|
|
10679
|
+
</div>
|
|
10680
|
+
<p class="hint">${t2.linkHint}</p>
|
|
10681
|
+
</div>
|
|
10682
|
+
<dl class="details">
|
|
10683
|
+
<dt>${t2.session}</dt>
|
|
10684
|
+
<dd><code>${state.roomId ?? ""}</code></dd>
|
|
10685
|
+
<dt>${t2.server}</dt>
|
|
10686
|
+
<dd>${server ? html`<code>${server}</code>` : t2.noServer}</dd>
|
|
10687
|
+
</dl>
|
|
10688
|
+
<div class="people">
|
|
10689
|
+
<span class="people-label">${t2.people}</span>
|
|
10690
|
+
<ul aria-label=${t2.people}>
|
|
10691
|
+
${people.map(
|
|
10692
|
+
(person) => html`<li
|
|
10693
|
+
><span
|
|
10694
|
+
class="avatar"
|
|
10695
|
+
aria-hidden="true"
|
|
10696
|
+
style=${`--share-person:${person.color || "var(--office-accent)"}`}
|
|
10697
|
+
>${initialsOf(person.name)}</span
|
|
10698
|
+
><span class="name">${person.name}</span
|
|
10699
|
+
>${person.self ? html`<span class="you">${t2.you}</span>` : nothing}</li
|
|
10700
|
+
>`
|
|
10701
|
+
)}
|
|
10702
|
+
</ul>
|
|
10703
|
+
</div>
|
|
10704
|
+
${this.error ? html`<p class="error" role="alert">${this.error}</p>` : nothing}
|
|
10705
|
+
${this.note ? html`<p class="hint">${this.note}</p>` : nothing}
|
|
10706
|
+
<div class="actions">
|
|
10707
|
+
<button
|
|
10708
|
+
type="button"
|
|
10709
|
+
class="danger"
|
|
10710
|
+
data-share="stop"
|
|
10711
|
+
@click=${() => this.fire(this.constructor.stopEvent, {})}
|
|
10712
|
+
>${t2.stop}</button
|
|
10713
|
+
><button type="button" class="primary" @click=${() => this.close()}>${t2.close}</button>
|
|
10714
|
+
</div>
|
|
10715
|
+
</div>`;
|
|
10716
|
+
}
|
|
10717
|
+
render() {
|
|
10718
|
+
defineDialog(this.ownerDocument.defaultView?.customElements);
|
|
10719
|
+
const t2 = this.text;
|
|
10720
|
+
const active2 = !!this.state?.active;
|
|
10721
|
+
return html`<office-ui-dialog
|
|
10722
|
+
?open=${this.open}
|
|
10723
|
+
heading=${active2 ? t2.activeTitle : t2.title}
|
|
10724
|
+
close-label=${t2.close}
|
|
10725
|
+
@office-dialog-close=${(event) => {
|
|
10726
|
+
event.stopPropagation();
|
|
10727
|
+
this.close();
|
|
10728
|
+
}}
|
|
10729
|
+
>${active2 ? this.renderActive() : this.renderForm()}</office-ui-dialog
|
|
10730
|
+
>`;
|
|
10731
|
+
}
|
|
10732
|
+
};
|
|
10733
|
+
var defineShareDialog = definer("office-ui-share-dialog", () => OfficeUiShareDialog);
|
|
10734
|
+
|
|
10735
|
+
// src/dialog/message-dialogs.ts
|
|
10736
|
+
var queue = [];
|
|
10737
|
+
var active = false;
|
|
10738
|
+
function mountPoint(host) {
|
|
10739
|
+
const doc = typeof document === "undefined" ? void 0 : document;
|
|
10740
|
+
if (!host) return doc?.body ?? null;
|
|
10741
|
+
if (host instanceof ShadowRoot) return host;
|
|
10742
|
+
if (host instanceof Document) return host.body;
|
|
10743
|
+
if (host instanceof Element) {
|
|
10744
|
+
if (host.shadowRoot) return host.shadowRoot;
|
|
10745
|
+
const themed = host.closest("[data-office-theme]");
|
|
10746
|
+
if (themed) return themed.shadowRoot ?? themed;
|
|
10747
|
+
const root = host.getRootNode();
|
|
10748
|
+
return root instanceof ShadowRoot ? root : host.ownerDocument.body ?? null;
|
|
10749
|
+
}
|
|
10750
|
+
return doc?.body ?? null;
|
|
10751
|
+
}
|
|
10752
|
+
function run(pending) {
|
|
10753
|
+
const { options, kind } = pending;
|
|
10754
|
+
const parent = mountPoint(options.host);
|
|
10755
|
+
if (!parent) {
|
|
10756
|
+
pending.settle({ confirmed: false, value: "" });
|
|
10757
|
+
return;
|
|
10758
|
+
}
|
|
10759
|
+
defineMessageDialog();
|
|
10760
|
+
const dialog = parent.ownerDocument?.createElement("office-ui-message-dialog") ?? null;
|
|
10761
|
+
if (!(dialog instanceof OfficeUiMessageDialog)) {
|
|
10762
|
+
pending.settle({ confirmed: false, value: "" });
|
|
10763
|
+
return;
|
|
10764
|
+
}
|
|
10765
|
+
dialog.kind = kind;
|
|
10766
|
+
dialog.tone = options.tone ?? "default";
|
|
10767
|
+
dialog.heading = options.title;
|
|
10768
|
+
dialog.message = options.message;
|
|
10769
|
+
if (options.confirmLabel) dialog.confirmLabel = options.confirmLabel;
|
|
10770
|
+
if (options.cancelLabel) dialog.cancelLabel = options.cancelLabel;
|
|
10771
|
+
if (options.label) dialog.inputLabel = options.label;
|
|
10772
|
+
dialog.value = options.defaultValue ?? "";
|
|
10773
|
+
dialog.placeholder = options.placeholder ?? "";
|
|
10774
|
+
const { resultEvent } = OfficeUiMessageDialog;
|
|
10775
|
+
const onResult = (event) => {
|
|
10776
|
+
event.stopPropagation();
|
|
10777
|
+
dialog.removeEventListener(resultEvent, onResult);
|
|
10778
|
+
const detail = event.detail;
|
|
10779
|
+
dialog.remove();
|
|
10780
|
+
pending.settle(detail);
|
|
10781
|
+
};
|
|
10782
|
+
dialog.addEventListener(resultEvent, onResult);
|
|
10783
|
+
parent.appendChild(dialog);
|
|
10784
|
+
}
|
|
10785
|
+
function next() {
|
|
10786
|
+
if (active) return;
|
|
10787
|
+
const pending = queue.shift();
|
|
10788
|
+
if (!pending) return;
|
|
10789
|
+
active = true;
|
|
10790
|
+
let settled = false;
|
|
10791
|
+
const original = pending.settle;
|
|
10792
|
+
pending.settle = (result) => {
|
|
10793
|
+
if (settled) return;
|
|
10794
|
+
settled = true;
|
|
10795
|
+
active = false;
|
|
10796
|
+
original(result);
|
|
10797
|
+
next();
|
|
10798
|
+
};
|
|
10799
|
+
run(pending);
|
|
10800
|
+
}
|
|
10801
|
+
function ask(kind, options) {
|
|
10802
|
+
return new Promise((resolve) => {
|
|
10803
|
+
queue.push({ kind, options, settle: resolve });
|
|
10804
|
+
next();
|
|
10805
|
+
});
|
|
10806
|
+
}
|
|
10807
|
+
async function confirmDialog(options) {
|
|
10808
|
+
return (await ask("confirm", options)).confirmed;
|
|
10809
|
+
}
|
|
10810
|
+
async function promptDialog(options) {
|
|
10811
|
+
const result = await ask("prompt", options);
|
|
10812
|
+
return result.confirmed ? result.value : null;
|
|
10813
|
+
}
|
|
10814
|
+
async function alertDialog(options) {
|
|
10815
|
+
await ask("alert", options);
|
|
10816
|
+
}
|
|
10817
|
+
|
|
9393
10818
|
// src/keytips.ts
|
|
9394
10819
|
var BADGE_CSS = "position:fixed;inset:auto;margin:0;padding:0;border:0;background:transparent;overflow:visible;pointer-events:none";
|
|
9395
10820
|
var TIP_CSS = `position:fixed;transform:translate(-50%,-30%);min-width:${tok("--office-icon-size")};padding:${tok("--office-space-px")} ${tok("--office-space-1")};border:${tok("--office-border-width")} solid ${tok("--office-keytip-border")};border-radius:${tok("--office-radius-xs")};background:${tok("--office-keytip-background")};color:${tok("--office-keytip-foreground")};font:${tok("--office-font-weight-bold")} ${tok("--office-font-size-xs")}/${tok("--office-icon-size")} ${tok("--office-font")};text-align:center;box-shadow:${tok("--office-shadow-sm")}`;
|
|
@@ -9473,9 +10898,9 @@ function attachKeyTips(scope) {
|
|
|
9473
10898
|
if (isDisabled(el)) return render2();
|
|
9474
10899
|
const panel = el.dataset.keytipPanel;
|
|
9475
10900
|
activate(el);
|
|
9476
|
-
const
|
|
9477
|
-
if (
|
|
9478
|
-
levels.push(
|
|
10901
|
+
const next2 = panel ? [...scope.querySelectorAll("[data-keytip-level]")].find((el2) => el2.id === panel) ?? null : null;
|
|
10902
|
+
if (next2) {
|
|
10903
|
+
levels.push(next2);
|
|
9479
10904
|
if (view?.requestAnimationFrame) view.requestAnimationFrame(render2);
|
|
9480
10905
|
else render2();
|
|
9481
10906
|
} else stop();
|
|
@@ -10109,8 +11534,8 @@ function diffLeaves(before, beforeHas, after, afterHas, path, out) {
|
|
|
10109
11534
|
var isAncestor = (ancestor, path) => ancestor.every((segment, index) => path[index] === segment);
|
|
10110
11535
|
function recordLiveColorLeaves(leaves, value, patch) {
|
|
10111
11536
|
const diff = { changed: [], created: [] };
|
|
10112
|
-
for (const [key,
|
|
10113
|
-
diffLeaves(childOf(value, key), hasChild(value, key),
|
|
11537
|
+
for (const [key, next2] of Object.entries(patch)) {
|
|
11538
|
+
diffLeaves(childOf(value, key), hasChild(value, key), next2, true, [key], diff);
|
|
10114
11539
|
}
|
|
10115
11540
|
for (const path of diff.created) {
|
|
10116
11541
|
const id = `created:${JSON.stringify(path)}`;
|
|
@@ -10591,10 +12016,15 @@ var CONTROL_DEFINERS = [
|
|
|
10591
12016
|
defineColorCustom,
|
|
10592
12017
|
defineChartPicker,
|
|
10593
12018
|
defineChartDataSheet,
|
|
10594
|
-
defineProgressDialog
|
|
12019
|
+
defineProgressDialog,
|
|
12020
|
+
defineMessageDialog,
|
|
12021
|
+
defineShareDialog,
|
|
12022
|
+
defineCloudFiles,
|
|
12023
|
+
defineOpenPlaces,
|
|
12024
|
+
defineConnectedServices
|
|
10595
12025
|
];
|
|
10596
12026
|
function registerControls(registry) {
|
|
10597
12027
|
for (const define of CONTROL_DEFINERS) define(registry);
|
|
10598
12028
|
}
|
|
10599
12029
|
|
|
10600
|
-
export { CHART_DATA_SHEET_ENGLISH, CONTROL_DEFINERS, CUSTOM_FONT_ACCEPT, CUSTOM_FONT_EXTENSIONS, DEFAULT_COMMENTS_LABELS, DEFAULT_OFFICE_PROFILE, 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, assignKeyTips, attachKeyTips, attachRibbonGroupOverflow, buildChartFormatModel, buildFontCatalog, chartFormatFieldIntent, chartFormatLocale, chartFormatPaneTitle, chartFormatSourceTabs, chartFormatTargetLabel, chartFormatTargetOptions, chartFormatTranslator, chartSpaceFormatSource, clampFlyoutPosition, clampOptionNumber, clearOfficeProfile, commentInitials, createDialogSession, createFontFaceScope, createLiveColorInput, createRibbonOverflow, defaultPaneGradient, defineAccount, defineBackstage, defineButton, defineChartDataSheet, defineChartFormatPane, defineChartPicker, defineCheckbox, defineColorCustom, defineColorGrid, defineCommandSearch, defineCommentsPane, defineContextMenu, defineDialog, defineDialogFooter, defineFindBar, defineGallery, defineIcon, defineMenuButton, defineMenuItem, defineMenuSeparator, defineOptionsDialog, definePasteOptions, definePrintPreview, defineProgressDialog, defineRadio, defineReadOnlyBanner, defineRibbon, defineRibbonActions, defineRibbonGroup, defineRibbonSection, defineRibbonStack, defineRibbonToggle, defineRuler, defineSearchField, defineSelect, 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, rangeControl, range_control_default, readOfficeProfile, recordLiveColorLeaves, registerControls, registerCustomFont, resolveChartFormatSourceTarget, rulerDivisions, runKeyTips, sanitizeOfficeProfile, scanAvailableFontFamilies, translateChartFormatText, typeAheadIndex, unavailableCategory, unavailableControl, userInterfaceSection, wireTabDrag, writeOfficeProfile };
|
|
12030
|
+
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, OfficeUiMessageDialog, OfficeUiOpenPlaces, OfficeUiShareDialog, 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, 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, scanAvailableFontFamilies, shareDialogLabels, translateChartFormatText, typeAheadIndex, unavailableCategory, unavailableControl, userInterfaceSection, wireTabDrag, writeOfficeProfile };
|