ooxml-ui 1.6.2 → 1.8.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 +90 -37
- package/custom-elements.json +303 -4
- package/dist/chrome/ruler.d.ts +7 -1
- package/dist/chrome/ruler.d.ts.map +1 -1
- package/dist/chrome/status-bar.d.ts.map +1 -1
- package/dist/chrome/tab-strip.d.ts +3 -1
- package/dist/chrome/tab-strip.d.ts.map +1 -1
- package/dist/chrome/task-pane.d.ts +29 -0
- package/dist/chrome/task-pane.d.ts.map +1 -0
- package/dist/chrome/title-bar.d.ts +2 -1
- package/dist/chrome/title-bar.d.ts.map +1 -1
- package/dist/{chunk-QAIVGTQZ.js → chunk-7US5GCXF.js} +158 -153
- package/dist/{chunk-Z7CS3UUK.js → chunk-KF72ZA6V.js} +5 -2
- package/dist/{chunk-QHAE6Y5B.js → chunk-O7APCA5N.js} +680 -98
- package/dist/chunk-W6AV3GHC.js +112 -0
- package/dist/controls.d.ts +9 -2
- package/dist/controls.d.ts.map +1 -1
- package/dist/controls.js +1 -1
- package/dist/dialog/dialog-footer.d.ts.map +1 -1
- package/dist/dialog/options-dialog.d.ts.map +1 -1
- package/dist/docx/editor-core.d.ts +3 -0
- package/dist/docx/editor-shell.d.ts +2 -0
- package/dist/docx/element-api.d.ts +7 -0
- package/dist/docx/events.d.ts +4 -1
- package/dist/docx/index.d.ts +1 -0
- package/dist/docx/ribbon-color-grid.d.ts +3 -4
- package/dist/docx.js +46 -78
- package/dist/edit-worker.js +52 -3
- package/dist/form/color-custom.d.ts +79 -0
- package/dist/form/color-custom.d.ts.map +1 -0
- package/dist/form/color-grid.d.ts +125 -0
- package/dist/form/color-grid.d.ts.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +4 -3
- package/dist/menu/context-menu.d.ts.map +1 -1
- package/dist/menu/menu-button.d.ts +2 -1
- package/dist/menu/menu-button.d.ts.map +1 -1
- package/dist/notices/paste-options.d.ts.map +1 -1
- package/dist/notices/toasts.d.ts.map +1 -1
- package/dist/pptx/{chart-3d-view-scene-ERX2GRCD.mjs → chart-3d-view-scene-P6MAFEGL.mjs} +2 -2
- package/dist/pptx/{chart-3d-view-scene-55WDENSO.cjs → chart-3d-view-scene-V74F7ZOC.cjs} +38 -38
- package/dist/pptx/{chunk-G2YUKLRX.cjs → chunk-526IHNIH.cjs} +1 -1
- package/dist/pptx/{chunk-SVN6OBG4.mjs → chunk-DPOES4WM.mjs} +26 -11
- package/dist/pptx/{chunk-BLAJIEXA.cjs → chunk-GCS5KBMR.cjs} +511 -653
- package/dist/pptx/{chunk-RPRC2EG5.cjs → chunk-K3S2A64B.cjs} +13 -13
- package/dist/pptx/{chunk-E55NU4BF.mjs → chunk-MCHPNO42.mjs} +289 -493
- package/dist/pptx/{chunk-AWQRQUPL.mjs → chunk-NAFUYAQP.mjs} +1 -1
- package/dist/pptx/{chunk-LCIXR7WE.cjs → chunk-VFPVEVF4.cjs} +26 -11
- package/dist/pptx/{chunk-TKATCPOK.mjs → chunk-ZAOYPCAM.mjs} +1 -1
- package/dist/pptx/dom/activex-controls-overlay.d.ts.map +1 -1
- package/dist/pptx/dom/elements/image.d.ts.map +1 -1
- package/dist/pptx/dom/elements/media.d.ts.map +1 -1
- package/dist/pptx/dom/elements/text-block.d.ts.map +1 -1
- package/dist/pptx/dom/elements/zoom.d.ts.map +1 -1
- package/dist/pptx/dom/index.cjs +252 -247
- package/dist/pptx/dom/index.mjs +11 -6
- package/dist/pptx/export/html2canvas-clone.cjs +2 -2
- package/dist/pptx/export/html2canvas-clone.mjs +1 -1
- package/dist/pptx/index.cjs +3059 -3023
- package/dist/pptx/index.mjs +4 -4
- package/dist/pptx/render/chart-combo-series.d.ts.map +1 -1
- package/dist/pptx/render/chart-combo-stock.cjs +3 -3
- package/dist/pptx/render/chart-combo-stock.mjs +1 -1
- package/dist/pptx/render/chart-marker-shape.d.ts.map +1 -1
- package/dist/pptx/render/chart-overlays.cjs +7 -7
- package/dist/pptx/render/chart-overlays.mjs +1 -1
- package/dist/pptx/render/chart-surface-treemap.cjs +4 -4
- package/dist/pptx/render/chart-surface-treemap.mjs +1 -1
- package/dist/pptx/render/chart-view-model.cjs +44 -44
- package/dist/pptx/render/chart-view-model.mjs +1 -1
- package/dist/pptx/render/chart-waterfall-map.cjs +6 -6
- package/dist/pptx/render/chart-waterfall-map.mjs +1 -1
- package/dist/pptx/render/connector-router-types.d.ts +4 -52
- package/dist/pptx/render/connector-router-types.d.ts.map +1 -1
- package/dist/pptx/render/connector-router.d.ts +4 -32
- package/dist/pptx/render/connector-router.d.ts.map +1 -1
- package/dist/pptx/render/editor-keymap-arrows.d.ts +0 -7
- package/dist/pptx/render/editor-keymap-arrows.d.ts.map +1 -1
- package/dist/pptx/render/element-interaction.d.ts +2 -6
- package/dist/pptx/render/element-interaction.d.ts.map +1 -1
- package/dist/pptx/render/index.d.ts +1 -0
- package/dist/pptx/render/index.d.ts.map +1 -1
- package/dist/pptx/render/ribbon-add-ins.d.ts +53 -0
- package/dist/pptx/render/ribbon-add-ins.d.ts.map +1 -0
- package/dist/pptx/web-components/index.d.ts +1 -0
- package/dist/pptx/web-components/index.d.ts.map +1 -1
- package/dist/pptx/web-components/ribbon-add-in.d.ts +20 -0
- package/dist/pptx/web-components/ribbon-add-in.d.ts.map +1 -0
- package/dist/ribbon/add-in-tabs.d.ts +36 -0
- package/dist/ribbon/group-overflow.d.ts +37 -0
- package/dist/ribbon/group-overflow.d.ts.map +1 -0
- package/dist/ribbon/ribbon-tabs.d.ts.map +1 -1
- package/dist/teams/app/index.d.ts +1 -1
- package/dist/teams.js +2 -2
- package/dist/visio/format-pane-fields.d.ts +42 -0
- package/dist/visio/format-pane-view.d.ts +44 -0
- package/dist/visio/index.d.ts +1 -0
- package/dist/visio/page-setup-action.d.ts +4 -0
- package/dist/visio/ribbon-action.d.ts +20 -7
- package/dist/visio/ribbon-change-shape.d.ts +17 -6
- package/dist/visio/ribbon-color-menu.d.ts +29 -0
- package/dist/visio/ribbon-inline-galleries.d.ts +20 -0
- package/dist/visio/ribbon-overflow.d.ts +7 -0
- package/dist/visio/ribbon-review.d.ts +5 -2
- package/dist/visio/ribbon-router.d.ts +3 -3
- package/dist/visio/ribbon-shape-styles.d.ts +4 -1
- package/dist/visio/ribbon-style-options.d.ts +4 -3
- package/dist/visio/ribbon.d.ts +2 -2
- package/dist/visio/shapes-document.d.ts +29 -0
- package/dist/visio/shapes-sections.d.ts +19 -5
- package/dist/visio/shapes-storage.d.ts +15 -0
- package/dist/visio/shapes-window.d.ts +9 -2
- package/dist/visio/status-bar.d.ts +7 -4
- package/dist/visio/stencil-catalog.d.ts +4 -0
- package/dist/visio/styles/theme.d.ts +1 -1
- package/dist/visio/styles.d.ts +1 -1
- package/dist/visio/text-measurer.d.ts +25 -0
- package/dist/visio/title-bar.d.ts +9 -0
- package/dist/visio/viewer-auto-connect-parts.d.ts +12 -0
- package/dist/visio/viewer-auto-connect.d.ts +33 -0
- package/dist/visio/viewer-backstage.d.ts +2 -1
- package/dist/visio/viewer-canvas.d.ts +1 -1
- package/dist/visio/viewer-change-shape.d.ts +8 -4
- package/dist/visio/viewer-chrome.d.ts +13 -5
- package/dist/visio/viewer-color-menus.d.ts +34 -0
- package/dist/visio/viewer-commands.d.ts +4 -1
- package/dist/visio/viewer-connector-tool.d.ts +5 -3
- package/dist/visio/viewer-data-window.d.ts +5 -1
- package/dist/visio/viewer-draw-tool.d.ts +1 -11
- package/dist/visio/viewer-element.d.ts +16 -0
- package/dist/visio/viewer-format-pane.d.ts +26 -0
- package/dist/visio/viewer-guides.d.ts +7 -4
- package/dist/visio/viewer-inline-text.d.ts +31 -0
- package/dist/visio/viewer-input.d.ts +5 -1
- package/dist/visio/viewer-layer-properties.d.ts +18 -0
- package/dist/visio/viewer-layout-commands.d.ts +8 -2
- package/dist/visio/viewer-more-colors.d.ts +16 -0
- package/dist/visio/viewer-options.d.ts +18 -4
- package/dist/visio/viewer-page-setup.d.ts +6 -0
- package/dist/visio/viewer-ruler-grid.d.ts +25 -0
- package/dist/visio/viewer-ruler.d.ts +11 -3
- package/dist/visio/viewer-snap-glue.d.ts +23 -0
- package/dist/visio/viewer-stencil.d.ts +4 -1
- package/dist/visio.js +7595 -5944
- package/dist/xlsx/component.d.ts +8 -0
- package/dist/xlsx/dialogs/format-cells/color-swatches.d.ts +4 -2
- package/dist/xlsx/dialogs/styles.d.ts +1 -1
- package/dist/xlsx/events.d.ts +4 -1
- package/dist/xlsx/index.d.ts +1 -0
- package/dist/xlsx/ribbon/color-grid.d.ts +25 -7
- package/dist/xlsx/ribbon/ribbon.d.ts +3 -0
- package/dist/xlsx.js +121 -163
- package/package.json +3 -2
- package/dist/pptx/render/connector-router-astar.d.ts +0 -24
- package/dist/pptx/render/connector-router-astar.d.ts.map +0 -1
- package/dist/pptx/render/connector-router-graph.d.ts +0 -38
- package/dist/pptx/render/connector-router-graph.d.ts.map +0 -1
- package/dist/visio/format-shape-dialog.d.ts +0 -21
- package/dist/visio/viewer-edit-controls.d.ts +0 -12
- package/dist/visio/viewer-format-shape.d.ts +0 -16
- package/dist/visio/viewer-geometry-controls.d.ts +0 -14
- package/dist/visio/viewer-layer-controls.d.ts +0 -5
- package/dist/visio/viewer-paint-dialog.d.ts +0 -28
- package/dist/visio/viewer-paint-properties.d.ts +0 -13
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* The `--vv-*` custom properties stay as optional host overrides and appear only in this block.
|
|
4
4
|
* `inch` is not a colour: it is the canvas scale set by `viewer-canvas.ts`.
|
|
5
5
|
*/
|
|
6
|
-
export declare const visioThemeAliases = ":host {\n --_vv-bg:var(--vv-background,var(--office-surface,#eceae8));\n --_vv-surface:var(--vv-surface,var(--office-background,#fff));\n --_vv-secondary:var(--vv-secondary,var(--office-surface,#f3f2f1));\n --_vv-ink:var(--vv-ink,var(--office-foreground,#1f1f1f));\n --_vv-muted:var(--vv-muted,var(--office-muted-foreground,#605e5c));\n --_vv-border:var(--vv-border,var(--office-border,#e1dfdd));\n --_vv-accent:var(--vv-accent,var(--office-accent,#3955a3));\n --_vv-accent-soft:var(--vv-accent-soft,color-mix(in srgb,var(--_vv-accent) 10%,transparent));\n --_vv-accent-ink:var(--vv-accent-ink,var(--office-accent-foreground,#fff));\n --_vv-focus:var(--vv-focus,var(--office-ring,var(--_vv-accent)));\n --_vv-danger:var(--vv-danger,var(--office-danger,#b42318));\n --_vv-shadow:var(--vv-shadow,var(--office-shadow,0 2px 8px rgb(0 0 0 / 14%)));\n}\n";
|
|
6
|
+
export declare const visioThemeAliases = ":host {\n --_vv-bg:var(--vv-background,var(--office-surface,#eceae8));\n --_vv-surface:var(--vv-surface,var(--office-background,#fff));\n --_vv-secondary:var(--vv-secondary,var(--office-surface,#f3f2f1));\n --_vv-ink:var(--vv-ink,var(--office-foreground,#1f1f1f));\n --_vv-muted:var(--vv-muted,var(--office-muted-foreground,#605e5c));\n --_vv-border:var(--vv-border,var(--office-border,#e1dfdd));\n --_vv-accent:var(--vv-accent,var(--office-accent,#3955a3));\n --_vv-accent-soft:var(--vv-accent-soft,color-mix(in srgb,var(--_vv-accent) 10%,transparent));\n --_vv-accent-ink:var(--vv-accent-ink,var(--office-accent-foreground,#fff));\n --_vv-focus:var(--vv-focus,var(--office-ring,var(--_vv-accent)));\n --_vv-danger:var(--vv-danger,var(--office-danger,#b42318));\n --_vv-shadow:var(--vv-shadow,var(--office-shadow,0 2px 8px rgb(0 0 0 / 14%)));\n --_vv-status-bg:var(--vv-status-background,var(--_vv-surface));\n --_vv-status-ink:var(--vv-status-ink,var(--_vv-ink));\n}\n:host([status-bar='colorful']) {\n --_vv-status-bg:var(--vv-status-background,var(--_vv-accent));\n --_vv-status-ink:var(--vv-status-ink,var(--_vv-accent-ink));\n}\n";
|
|
7
7
|
/**
|
|
8
8
|
* Feeds the shared controls (ribbon, dialogs) from the aliases above. It sits on the shadow
|
|
9
9
|
* root's children, not on `:host`, because a custom property cannot read the value it replaces.
|
package/dist/visio/styles.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** Colours come from the alias block in `styles/theme.ts`, which follows the shared theme. */
|
|
2
|
-
export declare const viewerStyles = "\n:host {\n display:flex; flex-direction:column; min-width:0; min-height:320px; height:100%; overflow:hidden;\n color:var(--_vv-ink); background:var(--_vv-bg); font:12px/1.5 \"Segoe UI\",Arial,sans-serif; contain:layout;\n}\n* { box-sizing:border-box; }\n[hidden] { display:none !important; }\nbutton,select,input,textarea { font:inherit; color:inherit; border:1px solid var(--_vv-border); background:var(--_vv-surface); border-radius:4px; min-height:28px; padding:3px 8px; }\nbutton { cursor:pointer; }\nbutton:hover:enabled { background:var(--_vv-accent-soft); border-color:var(--_vv-accent); }\nbutton:disabled { opacity:.4; cursor:default; }\nbutton:focus-visible,select:focus-visible,input:focus-visible,textarea:focus-visible,summary:focus-visible,[tabindex]:focus-visible { outline:2px solid var(--_vv-focus); outline-offset:2px; }\nbutton[aria-pressed=\"true\"] { color:var(--_vv-accent); background:var(--_vv-accent-soft); }\n.toolbar { flex:none; min-width:0; border-bottom:1px solid var(--_vv-border); background:var(--_vv-surface); }\n.spacer { flex:1; }\n.ribbon-content { min-height:82px; display:flex; align-items:stretch; gap:0; padding:2px 4px; overflow-x:auto; }\n.ribbon-group { display:flex; flex-direction:column; justify-content:space-between; flex:none; gap:2px; padding:3px 10px 4px; border-right:1px solid var(--_vv-border); }\n.group-label { font-size:10px; line-height:12px; color:var(--_vv-muted); text-align:center; }\n.ribbon-actions { display:flex; align-items:stretch; gap:2px; flex:1; }\n.ribbon-command { display:flex; flex-direction:column; justify-content:center; align-items:center; gap:2px; min-width:70px; padding:2px 6px; border-color:transparent; background:transparent; font-size:11px; white-space:nowrap; }\n.ribbon-hint { align-self:center; flex:none; margin:0; padding:0 16px; font-size:11px; line-height:18px; color:var(--_vv-muted); }\n.workspace { position:relative; display:flex; flex:1; min-width:0; min-height:0; overflow:hidden; }\n.pane-heading { height:37px; display:flex; align-items:center; justify-content:space-between; gap:8px; padding:8px 10px; border-bottom:1px solid var(--_vv-border); font-size:11px; font-weight:600; }\n.inspector-kind { color:var(--_vv-muted); font-size:10px; font-weight:400; }\n.viewport { position:relative; display:flex; flex-direction:column; flex:1; overflow:auto; min-width:0; min-height:0; padding:16px 4px; background:var(--_vv-bg); }\n.paper { display:block; flex:none; background:white; box-shadow:var(--_vv-shadow); margin:auto; }\n.paper [data-shape-id] { cursor:pointer; }\n.paper [data-selected=\"true\"] > [data-geometry] { stroke:var(--_vv-accent) !important; stroke-width:.025 !important; }\n.paper [role=\"group\"][data-selected=\"true\"] [data-geometry] { stroke:var(--_vv-accent) !important; stroke-dasharray:.06 .04; }\n.inspector-pane { flex:0 0 288px; width:288px; min-width:0; overflow:auto; border-left:1px solid var(--_vv-border); background:var(--_vv-secondary); }\n.inspector-body { display:flex; flex-direction:column; gap:12px; padding:12px 10px; }\n.inspector-card,.edit-controls,.layer-controls { min-width:0; padding:8px; margin:0; border:1px solid var(--_vv-border); border-radius:4px; background:var(--_vv-surface); font-size:11px; line-height:17px; }\n.document-card h2 { margin:0 0 8px; font-size:10px; font-weight:500; letter-spacing:.5px; text-transform:uppercase; color:var(--_vv-muted); }\n.current-page-name { margin:0 0 8px; font-size:12px; font-weight:500; overflow-wrap:anywhere; }\n.document-card dl { display:grid; grid-template-columns:1fr auto; gap:4px 10px; margin:0; font-size:11px; }\n.document-card dt { color:var(--_vv-muted); }\n.document-card dd { margin:0; text-align:right; overflow-wrap:anywhere; }\n.selection-hint { margin:0; padding:0 2px; color:var(--_vv-muted); font-size:11px; }\nsummary { cursor:pointer; min-height:22px; line-height:22px; font-weight:500; }\nsummary::marker { color:var(--_vv-muted); font-size:10px; }\n.shape-inspector div { max-height:260px; overflow:auto; }\n.shape-inspector p { margin:6px 0; overflow-wrap:anywhere; }\n.shape-inspector dl { display:grid; grid-template-columns:minmax(60px,1fr) 1.5fr; gap:6px 10px; }\n.shape-inspector dt { font-weight:500; }\n.shape-inspector dd { margin:0; overflow-wrap:anywhere; white-space:pre-wrap; }\n.shape-inspector h3 { margin:12px 0 5px; font-size:11px; }\n.shape-inspector a { color:var(--_vv-accent); overflow-wrap:anywhere; }\n.edit-controls p,.layer-controls p { margin:6px 0; color:var(--_vv-muted); overflow-wrap:anywhere; }\n.edit-controls textarea { display:block; width:100%; resize:vertical; max-height:180px; margin-top:4px; background:var(--_vv-secondary); }\n.edit-controls label { display:block; margin-top:8px; }\n.edit-actions { display:flex; flex-wrap:wrap; gap:4px; margin-top:8px; }\n.edit-actions button { font-size:11px; padding:3px 7px; }\n.edit-actions [data-edit=\"apply\"]:enabled { background:var(--_vv-accent); border-color:var(--_vv-accent); color:var(--_vv-accent-ink); }\n.edit-controls [data-geometry] { min-width:0; margin:8px 0 0; padding:6px; border:1px solid var(--_vv-border); }\n.edit-controls [data-geometry-field] { display:block; width:100%; min-width:0; margin-top:4px; }\n.edit-controls [data-geometry-error] { color:var(--_vv-danger); }\n.edit-controls [data-edit-error] { color:var(--_vv-danger); }\n.edit-controls [data-edit-diagnostics] { max-height:100px; overflow:auto; padding-left:16px; }\n.layer-controls [data-layer-list] { max-height:240px; overflow:auto; }\n.layer-controls fieldset { border:1px solid var(--_vv-border); margin:6px 0; padding:6px; min-width:0; }\n.layer-controls legend { max-width:100%; overflow-wrap:anywhere; }\n.layer-controls fieldset div { display:flex; align-items:center; gap:6px; margin:3px 0; }\n.layer-controls label { display:flex; align-items:center; gap:6px; overflow-wrap:anywhere; }\n.layer-controls input { flex-shrink:0; width:16px; height:16px; min-height:16px; padding:0; accent-color:var(--_vv-accent); }\n.notes ul { max-height:220px; overflow:auto; padding-left:17px; margin:6px 0 0; color:var(--_vv-muted); }\n.notes li { margin:5px 0; overflow-wrap:anywhere; }\n.notes-strip { flex:none; display:flex; align-items:center; justify-content:space-between; min-height:25.5px; padding:0 12px; border-top:1px solid var(--_vv-border); background:var(--_vv-bg); color:var(--_vv-muted); font-size:10px; }\n.notes-strip button { min-height:24.5px; padding:2px 0; border:0; background:transparent; color:var(--_vv-muted); font-size:11px; }\n.notes-strip button::before { content:\"\u25B8\"; margin-right:6px; }\n.notes-strip button[aria-expanded=\"true\"]::before { content:\"\u25BE\"; }\n.status { flex:none; display:flex; align-items:center; justify-content:space-between; gap:12px; min-width:0; min-height:29px; padding:0 8px 0 12px; border-top:1px solid var(--_vv-border); color:var(--_vv-muted); background:var(--_vv-surface); font-size:10px; }\n.status-message { display:flex; gap:16px; min-width:0; }\n.status-message span { overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }\n.empty { max-width:360px; margin:60px auto; padding:16px; text-align:center; color:var(--_vv-muted); font-size:12px; }\n.empty strong { display:block; color:var(--_vv-ink); font-size:18px; font-weight:500; margin-bottom:8px; }\n@media(max-width:1100px) { .ribbon-hint { display:none; } [data-diagnostics] { display:none; } }\n@media(max-width:760px) {\n button,select,input,textarea { min-height:44px; }\n button { min-width:44px; }\n summary { min-height:44px; line-height:44px; }\n .ribbon-content { min-height:86px; }\n .ribbon-group { padding:4px 8px; }\n #home-panel>.ribbon-group:not(.search-group):not(.undo-group) { display:none; }\n .ribbon-command { min-width:90px; }\n .workspace { display:block; overflow:auto; }\n .viewport { height:340px; min-height:260px; padding:16px 4px; }\n .inspector-pane { width:100%; overflow:visible; border-left:0; border-top:1px solid var(--_vv-border); }\n .inspector-body { gap:8px; padding:10px; }\n .inspector-card,.edit-controls,.layer-controls { font-size:12px; }\n .layer-controls label { min-height:44px; }\n .layer-controls input { min-width:20px; width:20px; height:20px; min-height:20px; }\n .notes-strip { min-height:44px; padding:0 10px; }\n .notes-strip button { min-height:44px; }\n .status { flex-wrap:wrap; gap:0; padding:4px 8px; }\n .status-message { width:100%; min-height:18px; }\n}\n@media(pointer:coarse) {\n button,select,input,textarea { min-height:44px; }\n button { min-width:44px; }\n summary,.layer-controls label { min-height:44px; line-height:44px; }\n .ribbon-content { min-height:96px; }\n .notes-strip button { min-height:44px; height:44px; }\n .layer-controls input { min-height:20px; }\n}\n/* Suite ribbon: tabs lead directly into Visio command groups. */\n.ribbon-content { min-height:104px; padding:4px 4px; }\n.ribbon-hint { order:3; padding:10px 18px; }\n.ribbon-command { min-width:82px; }\n.pane-close { display:none; }\n@media(max-width:760px) {\n .ribbon-content { min-height:54px; padding:4px 0; }\n .search-feedback,.group-label { display:none; }\n .ribbon-content { overflow-x:auto; scroll-snap-type:x mandatory; }\n .workspace { display:flex; position:relative; overflow:hidden; }\n .viewport { flex:1; width:100%; height:100%; min-height:0; padding:16px 4px; }\n .inspector-pane { position:absolute; inset:0 0 0 auto; width:min(320px,100%); z-index:4; overflow:auto; border-left:1px solid var(--_vv-border); box-shadow:-8px 0 24px #0002; }\n .pane-close { display:block; width:44px; height:44px; padding:0; font-size:22px; background:transparent; border:0; }\n .inspector-kind { margin-left:auto; }\n .notes-strip { display:none; }\n .status { min-height:48px; padding:2px 8px; }\n .status-message { display:none; }\n}\n.toolbar { position:relative; }\n.ribbon-tools { display:flex; flex:none; order:0; }\n.tools-content { display:flex; align-items:stretch; }\n.ribbon-tools>summary { display:none; }\n.ribbon-command { font-size:12px; min-width:88px; }\n.ribbon-hint { font-size:12px; line-height:20px; flex:1; }\n.group-label { font-size:11px; line-height:14px; }\n.inspector-card,.edit-controls,.layer-controls { font-size:12px; line-height:18px; }\n.selection-hint,.document-card dl { font-size:12px; }\n.pane-heading { font-size:12px; }\n.inspector-pane .pane-heading { position:sticky; top:0; z-index:1; background:var(--_vv-secondary); flex:none; }\n.status .notes-strip { border:0; padding:0 8px; background:transparent; min-height:28px; }\n.status .notes-strip>span { display:none; }\n.status-message { flex:1; }\n@media(max-width:760px) {\n #home-panel { overflow:visible; min-height:54px; padding:4px; }\n .ribbon-tools { display:block; flex:0 0 84px; width:84px; order:1; }\n .ribbon-tools>summary { display:flex; min-height:44px; align-items:center; justify-content:center; gap:6px; padding:0 10px; border:1px solid var(--_vv-border); background:var(--_vv-surface); border-radius:4px; font-size:12px; cursor:pointer; list-style:none; }\n .ribbon-tools>summary::-webkit-details-marker { display:none; }\n .ribbon-tools .tools-content { display:flex; position:absolute; top:100%; left:4px; right:4px; z-index:6; flex-direction:column; padding:12px; gap:12px; border:1px solid var(--_vv-border); border-radius:4px; background:var(--_vv-surface); box-shadow:0 12px 28px #0003; max-height:60vh; overflow:auto; }\n .ribbon-tools:not([open])>.tools-content { display:none; }\n .ribbon-tools .ribbon-group { display:flex; width:100%; min-height:64px; border:0; padding:0; }\n .ribbon-tools .ribbon-actions { justify-content:space-between; }\n .ribbon-tools .ribbon-command { min-width:88px; font-size:12px; }\n .ribbon-tools .search-feedback { display:block; }\n .status { flex-wrap:nowrap; gap:4px; min-height:48px; }\n .status .notes-strip { display:none; }\n}\n@media(prefers-reduced-motion:reduce) { * { scroll-behavior:auto !important; } }\n";
|
|
2
|
+
export declare const viewerStyles = "\n:host {\n display:flex; flex-direction:column; min-width:0; min-height:320px; height:100%; overflow:hidden;\n color:var(--_vv-ink); background:var(--_vv-bg); font:12px/1.5 \"Segoe UI\",Arial,sans-serif; contain:layout;\n}\n* { box-sizing:border-box; }\n[hidden] { display:none !important; }\nbutton,select,input,textarea { font:inherit; color:inherit; border:1px solid var(--_vv-border); background:var(--_vv-surface); border-radius:4px; min-height:28px; padding:3px 8px; }\nbutton { cursor:pointer; }\nbutton:hover:enabled { background:var(--_vv-accent-soft); border-color:var(--_vv-accent); }\nbutton:disabled { opacity:.4; cursor:default; }\nbutton:focus-visible,select:focus-visible,input:focus-visible,textarea:focus-visible,summary:focus-visible,[tabindex]:focus-visible { outline:2px solid var(--_vv-focus); outline-offset:2px; }\nbutton[aria-pressed=\"true\"] { color:var(--_vv-accent); background:var(--_vv-accent-soft); }\n.toolbar { flex:none; min-width:0; border-bottom:1px solid var(--_vv-border); background:var(--_vv-surface); }\n.spacer { flex:1; }\n.ribbon-content { min-height:82px; display:flex; align-items:stretch; gap:0; padding:2px 4px; overflow-x:auto; }\n.ribbon-group { display:flex; flex-direction:column; justify-content:space-between; flex:none; gap:2px; padding:3px 10px 4px; border-right:1px solid var(--_vv-border); }\n.group-label { font-size:10px; line-height:12px; color:var(--_vv-muted); text-align:center; }\n.ribbon-actions { display:flex; align-items:stretch; gap:2px; flex:1; }\n.ribbon-command { display:flex; flex-direction:column; justify-content:center; align-items:center; gap:2px; min-width:70px; padding:2px 6px; border-color:transparent; background:transparent; font-size:11px; white-space:nowrap; }\n.ribbon-hint { align-self:center; flex:none; margin:0; padding:0 16px; font-size:11px; line-height:18px; color:var(--_vv-muted); }\n.workspace { position:relative; display:flex; flex:1; min-width:0; min-height:0; overflow:hidden; }\n.pane-heading { height:37px; display:flex; align-items:center; justify-content:space-between; gap:8px; padding:8px 10px; border-bottom:1px solid var(--_vv-border); font-size:11px; font-weight:600; }\n.viewport { position:relative; display:flex; flex-direction:column; flex:1; overflow:auto; min-width:0; min-height:0; padding:16px 4px; background:var(--_vv-bg); }\n.paper { display:block; flex:none; background:white; box-shadow:var(--_vv-shadow); margin:auto; }\n.paper [data-shape-id] { cursor:pointer; }\n.inspector-pane { flex:0 0 288px; width:288px; min-width:0; overflow:auto; border-left:1px solid var(--_vv-border); background:var(--_vv-secondary); }\nsummary { cursor:pointer; min-height:22px; line-height:22px; font-weight:500; }\nsummary::marker { color:var(--_vv-muted); font-size:10px; }\n.shape-inspector div { max-height:260px; overflow:auto; }\n.shape-inspector p { margin:6px 0; overflow-wrap:anywhere; }\n.shape-inspector dl { display:grid; grid-template-columns:minmax(60px,1fr) 1.5fr; gap:6px 10px; }\n.shape-inspector dt { font-weight:500; }\n.shape-inspector dd { margin:0; overflow-wrap:anywhere; white-space:pre-wrap; }\n.shape-inspector h3 { margin:12px 0 5px; font-size:11px; }\n.shape-inspector a { color:var(--_vv-accent); overflow-wrap:anywhere; }\n.status { flex:none; display:flex; align-items:center; justify-content:space-between; gap:12px; min-width:0; min-height:29px; padding:0 8px 0 12px; border-top:1px solid var(--_vv-border); color:var(--_vv-muted); background:var(--_vv-surface); font-size:10px; }\n.status-message { display:flex; gap:16px; min-width:0; }\n.status-message span { overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }\n.empty { max-width:360px; margin:60px auto; padding:16px; text-align:center; color:var(--_vv-muted); font-size:12px; }\n.empty strong { display:block; color:var(--_vv-ink); font-size:18px; font-weight:500; margin-bottom:8px; }\n@media(max-width:1100px) { .ribbon-hint { display:none; } }\n@media(max-width:760px) {\n button,select,input,textarea { min-height:44px; }\n button { min-width:44px; }\n summary { min-height:44px; line-height:44px; }\n .ribbon-content { min-height:86px; }\n .ribbon-group { padding:4px 8px; }\n #home-panel>.ribbon-group:not(.search-group):not(.undo-group) { display:none; }\n .ribbon-command { min-width:90px; }\n .workspace { display:block; overflow:auto; }\n .viewport { height:340px; min-height:260px; padding:16px 4px; }\n .inspector-pane { width:100%; overflow:visible; border-left:0; border-top:1px solid var(--_vv-border); }\n .status { flex-wrap:wrap; gap:0; padding:4px 8px; }\n .status-message { width:100%; min-height:18px; }\n}\n@media(pointer:coarse) {\n button,select,input,textarea { min-height:44px; }\n button { min-width:44px; }\n summary { min-height:44px; line-height:44px; }\n .ribbon-content { min-height:96px; }\n}\n/* Suite ribbon: tabs lead directly into Visio command groups. */\n.ribbon-content { min-height:104px; padding:4px 4px; }\n.ribbon-hint { order:3; padding:10px 18px; }\n.ribbon-command { min-width:82px; }\n.pane-close { display:none; }\n@media(max-width:760px) {\n .ribbon-content { min-height:54px; padding:4px 0; }\n .search-feedback,.group-label { display:none; }\n .ribbon-content { overflow-x:auto; scroll-snap-type:x mandatory; }\n .workspace { display:flex; position:relative; overflow:hidden; }\n .viewport { flex:1; width:100%; height:100%; min-height:0; padding:16px 4px; }\n .inspector-pane { position:absolute; inset:0 0 0 auto; width:min(320px,100%); z-index:4; overflow:auto; border-left:1px solid var(--_vv-border); box-shadow:-8px 0 24px #0002; }\n .pane-close { display:block; width:44px; height:44px; padding:0; font-size:22px; background:transparent; border:0; }\n .status { min-height:48px; padding:2px 8px; }\n .status-message { display:none; }\n}\n.toolbar { position:relative; }\n.ribbon-tools { display:flex; flex:none; order:0; }\n.tools-content { display:flex; align-items:stretch; }\n.ribbon-tools>summary { display:none; }\n.ribbon-command { font-size:12px; min-width:88px; }\n.ribbon-hint { font-size:12px; line-height:20px; flex:1; }\n.group-label { font-size:11px; line-height:14px; }\n.pane-heading { font-size:12px; }\n.status-message { flex:1; }\n@media(max-width:760px) {\n #home-panel { overflow:visible; min-height:54px; padding:4px; }\n .ribbon-tools { display:block; flex:0 0 84px; width:84px; order:1; }\n .ribbon-tools>summary { display:flex; min-height:44px; align-items:center; justify-content:center; gap:6px; padding:0 10px; border:1px solid var(--_vv-border); background:var(--_vv-surface); border-radius:4px; font-size:12px; cursor:pointer; list-style:none; }\n .ribbon-tools>summary::-webkit-details-marker { display:none; }\n .ribbon-tools .tools-content { display:flex; position:absolute; top:100%; left:4px; right:4px; z-index:6; flex-direction:column; padding:12px; gap:12px; border:1px solid var(--_vv-border); border-radius:4px; background:var(--_vv-surface); box-shadow:0 12px 28px #0003; max-height:60vh; overflow:auto; }\n .ribbon-tools:not([open])>.tools-content { display:none; }\n .ribbon-tools .ribbon-group { display:flex; width:100%; min-height:64px; border:0; padding:0; }\n .ribbon-tools .ribbon-actions { justify-content:space-between; }\n .ribbon-tools .ribbon-command { min-width:88px; font-size:12px; }\n .ribbon-tools .search-feedback { display:block; }\n .status { flex-wrap:nowrap; gap:4px; min-height:48px; }\n}\n@media(prefers-reduced-motion:reduce) { * { scroll-behavior:auto !important; } }\n";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type VisioTextMeasurer } from 'ooxml-core/visio';
|
|
2
|
+
/** The part of a 2D canvas context that measuring needs; a worker's OffscreenCanvas has it too. */
|
|
3
|
+
export interface MeasureContext {
|
|
4
|
+
font: string;
|
|
5
|
+
fontKerning?: string;
|
|
6
|
+
measureText(text: string): {
|
|
7
|
+
width: number;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Measures text with the browser's fonts for what the core's own tables do not cover (other
|
|
12
|
+
* families, italics, non-ASCII text). Visio's TEXTWIDTH adds up unkerned, unhinted advances, so
|
|
13
|
+
* kerning is turned off and the text is measured at 1000 px and scaled.
|
|
14
|
+
*
|
|
15
|
+
* A canvas silently draws a missing font with a fallback, which would measure a wrong size: a
|
|
16
|
+
* family counts as installed only when it measures differently from both generic fallbacks, and
|
|
17
|
+
* anything else is reported as not measurable. Superscript, subscript and small caps are not
|
|
18
|
+
* measured either.
|
|
19
|
+
*/
|
|
20
|
+
export declare function createCanvasTextMeasurer(context: MeasureContext): VisioTextMeasurer;
|
|
21
|
+
/**
|
|
22
|
+
* Give the core a browser measurer where a canvas exists (the page, or a worker with
|
|
23
|
+
* OffscreenCanvas). Without one the core measures only what its own tables cover.
|
|
24
|
+
*/
|
|
25
|
+
export declare function installBrowserTextMeasurer(): boolean;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { OfficeProfile } from '../controls.js';
|
|
2
|
+
import type { ViewerState } from './controller.js';
|
|
3
|
+
/**
|
|
4
|
+
* Visio's title bar on the shared `office-ui-title-bar`, as Word, Excel and PowerPoint use it: the
|
|
5
|
+
* V mark, the Quick Access Toolbar (Save, Undo, Redo), the drawing's name and state, and the
|
|
6
|
+
* signed-in name at the right. Tell me stays on the ribbon's tab row, where Visio has it.
|
|
7
|
+
*/
|
|
8
|
+
export declare function createTitleBar(doc: Document): HTMLElement;
|
|
9
|
+
export declare function renderTitleBar(bar: HTMLElement, state: ViewerState, fileName: string, profile: OfficeProfile): void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { VisioAutoConnectDirection } from 'ooxml-core/visio/ui';
|
|
2
|
+
import type { Master } from './stencil-catalog.js';
|
|
3
|
+
/** An arrow or bar position in viewport pixels. */
|
|
4
|
+
export interface AutoConnectArrow {
|
|
5
|
+
direction: VisioAutoConnectDirection;
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
}
|
|
9
|
+
/** One AutoConnect arrow. Out of the tab order: the arrows are a pointer aid. */
|
|
10
|
+
export declare function autoConnectArrow(doc: Document, arrow: AutoConnectArrow, hasNeighbour: boolean): HTMLButtonElement;
|
|
11
|
+
/** The mini toolbar of Quick Shapes beside an arrow. */
|
|
12
|
+
export declare function autoConnectBar(doc: Document, arrow: AutoConnectArrow, masters: readonly Master[]): HTMLElement;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type VisioAutoConnectDirection } from 'ooxml-core/visio/ui';
|
|
2
|
+
import type { ViewerController, ViewerState } from './controller.js';
|
|
3
|
+
export interface AutoConnectHost {
|
|
4
|
+
/** The viewer's shadow root (a document in tests): the ribbon check box and event scope. */
|
|
5
|
+
root: ShadowRoot | Document;
|
|
6
|
+
viewport: HTMLElement;
|
|
7
|
+
controller: ViewerController;
|
|
8
|
+
announce(message: string): void;
|
|
9
|
+
edit(run: () => Promise<void>, message: string): void;
|
|
10
|
+
/** Arrows belong to the Pointer tool. */
|
|
11
|
+
pointerTool(): boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* View > Visual Aids > AutoConnect, on by default as in Visio. Resting the mouse on a top-level
|
|
15
|
+
* two-dimensional shape with the Pointer tool shows an arrow outside each side. An arrow shows a
|
|
16
|
+
* mini toolbar with the current stencil's first four Quick Shapes: choosing one adds it one gap
|
|
17
|
+
* away in that direction with a connector glued to both shapes, as one undoable step. Clicking
|
|
18
|
+
* the arrow itself connects to the neighbouring shape it points at, or adds the first Quick Shape
|
|
19
|
+
* when there is none. Arrows are a mouse and pen aid: touch and the keyboard never show them.
|
|
20
|
+
*/
|
|
21
|
+
export declare class ViewerAutoConnect {
|
|
22
|
+
#private;
|
|
23
|
+
private readonly host;
|
|
24
|
+
constructor(host: AutoConnectHost);
|
|
25
|
+
get enabled(): boolean;
|
|
26
|
+
/** The shape whose arrows show, for tests and status text. */
|
|
27
|
+
get source(): string | undefined;
|
|
28
|
+
toggle(): void;
|
|
29
|
+
render(state: ViewerState): void;
|
|
30
|
+
/** Connects in `direction`: to `masterId` as a new shape, else to the neighbour or first Quick Shape. */
|
|
31
|
+
connect(direction: VisioAutoConnectDirection, masterId?: string): void;
|
|
32
|
+
wire(): () => void;
|
|
33
|
+
}
|
|
@@ -22,7 +22,6 @@ export interface BackstageHost {
|
|
|
22
22
|
pageIndex: number;
|
|
23
23
|
}>;
|
|
24
24
|
closeDocument(): void;
|
|
25
|
-
revealNotes(): void;
|
|
26
25
|
showOptions(): void;
|
|
27
26
|
announce(message: string): void;
|
|
28
27
|
noteCount(): number;
|
|
@@ -37,5 +36,7 @@ export declare class ViewerBackstage {
|
|
|
37
36
|
show(page?: BackstagePage): void;
|
|
38
37
|
hide(): void;
|
|
39
38
|
wire(): () => void;
|
|
39
|
+
/** Save: download the edited drawing as a copy (File > Save and the Quick Access Toolbar). */
|
|
40
|
+
download(): void;
|
|
40
41
|
render(state: ViewerState): void;
|
|
41
42
|
}
|
|
@@ -10,7 +10,7 @@ export declare class ViewerCanvas {
|
|
|
10
10
|
private readonly notes;
|
|
11
11
|
private readonly notesPanel;
|
|
12
12
|
private readonly inspector;
|
|
13
|
-
constructor(viewport: HTMLElement, notes: HTMLUListElement, notesPanel: HTMLElement, inspector:
|
|
13
|
+
constructor(viewport: HTMLElement, notes: HTMLUListElement, notesPanel: HTMLElement, inspector: HTMLElement);
|
|
14
14
|
get warnings(): readonly string[];
|
|
15
15
|
/** Force the next render to redraw the page (fonts loaded, element reconnected). */
|
|
16
16
|
invalidate(): void;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import type { VisioChangeShapeTarget } from 'ooxml-core/visio';
|
|
2
2
|
import type { ViewerController, ViewerState } from './controller.js';
|
|
3
|
+
import { DOCUMENT_MASTER_PREFIX } from './shapes-document.js';
|
|
4
|
+
/** What the gallery asks for: a Basic Shapes outline, or `document:<id>` for a master. */
|
|
5
|
+
export type ChangeShapeChoice = VisioChangeShapeTarget | `${typeof DOCUMENT_MASTER_PREFIX}${string}`;
|
|
3
6
|
/**
|
|
4
|
-
* Home > Change Shape
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
+
* Home > Change Shape through the core's `change-shape` edit, so undo and redo come from the
|
|
8
|
+
* source-backed history. A shape drawn here takes another Basic Shapes outline; a stencil shape
|
|
9
|
+
* becomes an instance of another master of the Document Stencil, as Visio's Change Shape does.
|
|
10
|
+
* The gallery shows the choices for the selection; locks and formulas are proven by the core.
|
|
7
11
|
*/
|
|
8
12
|
export declare class ViewerChangeShape {
|
|
9
13
|
#private;
|
|
@@ -11,6 +15,6 @@ export declare class ViewerChangeShape {
|
|
|
11
15
|
private readonly controller;
|
|
12
16
|
private readonly edit;
|
|
13
17
|
constructor(root: ShadowRoot, controller: ViewerController, edit: (run: () => Promise<void>, message: string) => void);
|
|
14
|
-
run(shape:
|
|
18
|
+
run(shape: ChangeShapeChoice): void;
|
|
15
19
|
render(state: ViewerState): void;
|
|
16
20
|
}
|
|
@@ -2,9 +2,16 @@ import type { ViewerController, ViewerState } from './controller.js';
|
|
|
2
2
|
/**
|
|
3
3
|
* Static workspace markup (legacy; migrate to builders when next changed). The ribbon, Shapes
|
|
4
4
|
* window, page tabs and status bar are built by their own modules. Visio keeps pages in the
|
|
5
|
-
* bottom tabs and the All pages list, so there is no page pane.
|
|
5
|
+
* bottom tabs and the All pages list, so there is no page pane. The right task pane shows one
|
|
6
|
+
* view at a time (Shape Data, or Format Shape, which builds its own view), and starts closed.
|
|
6
7
|
*/
|
|
7
|
-
export declare const viewerChromeTemplate = "<div class=\"workspace\">\n <div class=\"viewport\" tabindex=\"0\" role=\"region\" aria-label=\"Diagram canvas\"></div>\n <
|
|
8
|
+
export declare const viewerChromeTemplate = "<div class=\"workspace\">\n <div class=\"viewport\" tabindex=\"0\" role=\"region\" aria-label=\"Diagram canvas\"></div>\n <office-ui-task-pane id=\"inspector-pane\" class=\"inspector-pane\" label=\"Shape Data\" hidden>\n <section class=\"shape-inspector\" data-pane-view=\"selection\"><p class=\"selection-hint\">No Shape Data</p><div></div></section>\n </office-ui-task-pane>\n</div>";
|
|
9
|
+
/** The titles Visio gives the task pane views. */
|
|
10
|
+
declare const PANE_TITLES: {
|
|
11
|
+
readonly selection: 'Shape Data';
|
|
12
|
+
readonly format: 'Format Shape';
|
|
13
|
+
};
|
|
14
|
+
export type PaneView = keyof typeof PANE_TITLES;
|
|
8
15
|
export type TaskPane = 'shapes' | 'inspector';
|
|
9
16
|
/** Presentation state stays local; page navigation uses the same controller as every binding. */
|
|
10
17
|
export declare class ViewerChrome {
|
|
@@ -16,7 +23,8 @@ export declare class ViewerChrome {
|
|
|
16
23
|
closeCompactTools(): void;
|
|
17
24
|
/** Show or hide a task pane; compact layouts close the Tools menu afterwards. */
|
|
18
25
|
togglePane(pane: TaskPane): void;
|
|
19
|
-
/**
|
|
20
|
-
reveal(kind:
|
|
21
|
-
render(state: ViewerState
|
|
26
|
+
/** Show a task pane view (Shape Data, Format Shape) and move focus into it. */
|
|
27
|
+
reveal(kind: PaneView): void;
|
|
28
|
+
render(state: ViewerState): void;
|
|
22
29
|
}
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { VisioPage, VisioShape } from 'ooxml-core/visio';
|
|
2
|
+
import type { ViewerController, ViewerState } from './controller.js';
|
|
3
|
+
import type { VisioFormattingAction } from './ribbon-action.js';
|
|
4
|
+
import { ViewerMoreColors } from './viewer-more-colors.js';
|
|
5
|
+
/** The colours the selection has now, per target; undefined when mixed or nothing is selected. */
|
|
6
|
+
export interface SelectionColors {
|
|
7
|
+
fill: string | undefined;
|
|
8
|
+
line: string | undefined;
|
|
9
|
+
font: string | undefined;
|
|
10
|
+
}
|
|
11
|
+
/** The selected shapes Fill and Line can format, or none when any of them cannot be. */
|
|
12
|
+
export declare function styleSelection(state: ViewerState): {
|
|
13
|
+
page: VisioPage;
|
|
14
|
+
shapes: VisioShape[];
|
|
15
|
+
} | undefined;
|
|
16
|
+
export declare function selectionColors(state: ViewerState): SelectionColors;
|
|
17
|
+
/**
|
|
18
|
+
* The ribbon's Fill, Line and Font Color pickers: each menu holds the shared colour grid with the
|
|
19
|
+
* page's theme colours. A pick runs the same formatting action the old fixed colours did; More
|
|
20
|
+
* Colors opens the custom colour dialog, and a custom colour joins Recent Colors for every menu.
|
|
21
|
+
*/
|
|
22
|
+
export declare class ViewerColorMenus {
|
|
23
|
+
#private;
|
|
24
|
+
private readonly root;
|
|
25
|
+
private readonly controller;
|
|
26
|
+
private readonly run;
|
|
27
|
+
readonly moreColors: ViewerMoreColors;
|
|
28
|
+
constructor(root: ShadowRoot, controller: ViewerController, run: (action: VisioFormattingAction) => void);
|
|
29
|
+
get recent(): readonly string[];
|
|
30
|
+
/** A custom colour was applied somewhere: show it under Recent Colors everywhere. */
|
|
31
|
+
remember(color: string): void;
|
|
32
|
+
wire(): () => void;
|
|
33
|
+
render(state: ViewerState): void;
|
|
34
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { VisioGridSteps } from 'ooxml-core/visio/ui';
|
|
1
2
|
import type { ViewerController, ViewerState } from './controller.js';
|
|
2
3
|
import { type VisioRibbonAction, type CanvasTool } from './ribbon-action.js';
|
|
3
4
|
import type { Rulers } from './viewer-ruler.js';
|
|
@@ -11,7 +12,7 @@ interface CommandHost {
|
|
|
11
12
|
controller: ViewerController;
|
|
12
13
|
fit(mode: 'page' | 'width'): void;
|
|
13
14
|
togglePane(pane: 'shapes' | 'inspector'): void;
|
|
14
|
-
reveal(panel: 'edit' | 'notes' | 'selection' | '
|
|
15
|
+
reveal(panel: 'edit' | 'notes' | 'selection' | 'format', focusText: boolean): void;
|
|
15
16
|
focusSearch(): void;
|
|
16
17
|
focusReplace?(): void;
|
|
17
18
|
togglePanZoom(): void;
|
|
@@ -34,6 +35,8 @@ export declare class ViewerCommands {
|
|
|
34
35
|
private readonly host;
|
|
35
36
|
readonly layoutCommands: ViewerLayoutCommands;
|
|
36
37
|
constructor(host: CommandHost);
|
|
38
|
+
/** The page's grid lines while View > Grid is on (Snap to Grid), else 0. */
|
|
39
|
+
get gridStep(): VisioGridSteps | 0;
|
|
37
40
|
get tool(): CanvasTool;
|
|
38
41
|
/** Browser clipboard transport used by the element's public clipboard methods. */
|
|
39
42
|
clipboard(operation: ClipboardOperation): Promise<void>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type VisioConnectorRoute, type VisioPage } from 'ooxml-core/visio';
|
|
2
2
|
import type { ViewerController, ViewerState } from './controller.js';
|
|
3
3
|
/** What an end released at the pointer would glue to. */
|
|
4
4
|
export interface ConnectorGlueHit {
|
|
@@ -8,13 +8,15 @@ export interface ConnectorGlueHit {
|
|
|
8
8
|
x?: number;
|
|
9
9
|
y?: number;
|
|
10
10
|
}
|
|
11
|
-
/** A page shape the core can glue to: a visible
|
|
11
|
+
/** A page shape the core can glue to: a visible top-level 2D shape, drawn or from a stencil. */
|
|
12
12
|
export declare function connectorGlueTarget(page: VisioPage, element: Element | null): string | undefined;
|
|
13
13
|
/**
|
|
14
14
|
* The glue target under a client point: the nearest connection point within a few pixels of it,
|
|
15
15
|
* else the shape under it. Pointer capture retargets events, so the point itself is hit-tested.
|
|
16
16
|
*/
|
|
17
|
-
export declare function connectorGlueAt(viewport: HTMLElement, page: VisioPage, event: Pick<PointerEvent, 'clientX' | 'clientY' | 'target'>, zoom: number
|
|
17
|
+
export declare function connectorGlueAt(viewport: HTMLElement, page: VisioPage, event: Pick<PointerEvent, 'clientX' | 'clientY' | 'target'>, zoom: number,
|
|
18
|
+
/** The drawing's GlueSettings (Snap & Glue): Glue off glues nothing, and connection points can be left out. */
|
|
19
|
+
glue?: number): ConnectorGlueHit | undefined;
|
|
18
20
|
/**
|
|
19
21
|
* Home > Tools > Connector (Ctrl+3). A drag draws a dynamic connector in the current route
|
|
20
22
|
* (right-angle by default); ends released on shapes glue to them, ends released on a connection
|
|
@@ -2,7 +2,11 @@ import type { VisioDataRecordset } from 'ooxml-core/visio';
|
|
|
2
2
|
/** Drag payload of External Data rows: `{ recordsetId, rowIds }` as JSON. */
|
|
3
3
|
export declare const DATA_ROW_MIME = "application/x-visio-viewer-data-row";
|
|
4
4
|
export type DataWindowAction = 'link' | 'auto-link' | 'unlink' | 'refresh' | 'remove' | 'close';
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* Visio's External Data window: a grid of the drawing's saved recordsets, docked under the
|
|
7
|
+
* drawing in the shared `office-ui-task-pane` (title and close button), with the recordset
|
|
8
|
+
* picker and the link commands in a bar above the grid.
|
|
9
|
+
*/
|
|
6
10
|
export declare function createExternalDataWindow(doc: Document): HTMLElement;
|
|
7
11
|
export interface DataWindowView {
|
|
8
12
|
recordsets: readonly VisioDataRecordset[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { VisioPage
|
|
1
|
+
import type { VisioPage } from 'ooxml-core/visio';
|
|
2
2
|
import { type VisioPathTool, type VisioDrawingPoint } from 'ooxml-core/visio/ui';
|
|
3
3
|
import type { ViewerController, ViewerState } from './controller.js';
|
|
4
4
|
export { pagePoint } from './viewer-page-point.js';
|
|
@@ -7,16 +7,6 @@ export declare function insertRectangle(controller: ViewerController, page: Visi
|
|
|
7
7
|
width: number;
|
|
8
8
|
height: number;
|
|
9
9
|
}): Promise<string>;
|
|
10
|
-
/** Add a Basic Shapes master: Ellipse and Circle are native ellipses, the rest core outlines. */
|
|
11
|
-
export declare function insertMaster(controller: ViewerController, page: VisioPage, master: {
|
|
12
|
-
kind: 'ellipse';
|
|
13
|
-
} | {
|
|
14
|
-
kind: 'rectangle';
|
|
15
|
-
shape: VisioOutlineShape;
|
|
16
|
-
}, centre: VisioDrawingPoint, size: {
|
|
17
|
-
width: number;
|
|
18
|
-
height: number;
|
|
19
|
-
}): Promise<string>;
|
|
20
10
|
/**
|
|
21
11
|
* Quick Style a dropped master gets: variant colour 1 (Accent 1 in every built-in theme's first
|
|
22
12
|
* variant, and in the theme-less Office colours), theme style 4, so drops follow Design > Variants.
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { VisioDocument, VisioEdit } from 'ooxml-core/visio';
|
|
2
2
|
import type { VsdxSource, VisioShapeSelection } from 'ooxml-core/visio/ui';
|
|
3
3
|
import { ViewerController } from './controller.js';
|
|
4
|
+
import { type RibbonAddInTab } from '../ribbon/add-in-tabs.js';
|
|
4
5
|
import { type BackstagePage } from './backstage.js';
|
|
5
6
|
import type { CreateVsdxOptions } from 'ooxml-core/visio';
|
|
7
|
+
import { type StatusBarTheme } from './viewer-options.js';
|
|
6
8
|
import { type SvgExportOptions, type SvgExportResult } from './export-svg.js';
|
|
7
9
|
import { type CurrentPagePrintSnapshotOptions, type PrintSnapshot } from './print-snapshot.js';
|
|
8
10
|
declare const BaseElement: typeof HTMLElement;
|
|
@@ -16,6 +18,20 @@ export declare class VisioViewerElement extends BaseElement {
|
|
|
16
18
|
set pageIndex(value: number);
|
|
17
19
|
get zoom(): number;
|
|
18
20
|
set zoom(value: number);
|
|
21
|
+
/**
|
|
22
|
+
* The status bar's look: `'neutral'` (the suite's bar, the default) or `'colorful'` (Visio's
|
|
23
|
+
* product colour). Reflects the `status-bar` attribute; `--vv-status-background` and
|
|
24
|
+
* `--vv-status-ink` recolour either.
|
|
25
|
+
*/
|
|
26
|
+
get statusBar(): StatusBarTheme;
|
|
27
|
+
set statusBar(value: StatusBarTheme);
|
|
28
|
+
/**
|
|
29
|
+
* Tabs a host adds after Help, as an Office add-in does (Visio's ACROBAT tab). Each command
|
|
30
|
+
* runs its `run` callback and dispatches `office-ribbon-add-in` (`{ tab, command }`) from the
|
|
31
|
+
* viewer. Assign a new array to change them; a tab cannot take a built-in tab's id.
|
|
32
|
+
*/
|
|
33
|
+
get ribbonAddIns(): readonly RibbonAddInTab[];
|
|
34
|
+
set ribbonAddIns(value: readonly RibbonAddInTab[]);
|
|
19
35
|
get showToolbar(): boolean;
|
|
20
36
|
set showToolbar(value: boolean);
|
|
21
37
|
get renderWarnings(): readonly string[];
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ViewerController, ViewerState } from './controller.js';
|
|
2
|
+
import { type PaneSection } from './format-pane-view.js';
|
|
3
|
+
import type { VisioFormattingAction } from './ribbon-action.js';
|
|
4
|
+
import { type ViewerColorMenus } from './viewer-color-menus.js';
|
|
5
|
+
/**
|
|
6
|
+
* Visio's Format Shape task pane (the Shape Styles launcher, the Fill, Line and Effects menus'
|
|
7
|
+
* options commands and the shape menu's Format Shape): Fill (none or solid, colour, transparency,
|
|
8
|
+
* pattern and its background), Line (colour, transparency, width, dash, cap, rounding and line
|
|
9
|
+
* ends) and Effects (shadow, glow, soft edges, reflection). It follows the selection, and every
|
|
10
|
+
* change is applied at once as one undoable `format-shape` edit per shape, through the same
|
|
11
|
+
* action the ribbon uses.
|
|
12
|
+
*/
|
|
13
|
+
export declare class ViewerFormatPane {
|
|
14
|
+
#private;
|
|
15
|
+
private readonly root;
|
|
16
|
+
private readonly controller;
|
|
17
|
+
private readonly colors;
|
|
18
|
+
private readonly run;
|
|
19
|
+
private readonly reveal;
|
|
20
|
+
private readonly announce;
|
|
21
|
+
constructor(root: ShadowRoot, controller: ViewerController, colors: ViewerColorMenus, run: (action: VisioFormattingAction) => void, reveal: () => void, announce: (message: string) => void);
|
|
22
|
+
/** Show the pane, at `section` when given; it explains itself when nothing can be formatted. */
|
|
23
|
+
show(section?: PaneSection): void;
|
|
24
|
+
wire(): () => void;
|
|
25
|
+
render(state: ViewerState): void;
|
|
26
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { type VisioPagePoint } from 'ooxml-core/visio/ui';
|
|
1
|
+
import { type VisioPage } from 'ooxml-core/visio';
|
|
2
|
+
import { type VisioSnapGrid, type VisioPagePoint } from 'ooxml-core/visio/ui';
|
|
3
3
|
import type { ViewerController, ViewerState } from './controller.js';
|
|
4
4
|
/**
|
|
5
5
|
* View > Guides and View > Dynamic Grid. Guides are the page's `Type="Guide"` shapes, drawn as
|
|
@@ -19,8 +19,11 @@ export declare class ViewerGuides {
|
|
|
19
19
|
get shown(): boolean;
|
|
20
20
|
toggleGuides(): void;
|
|
21
21
|
toggleDynamicGrid(): void;
|
|
22
|
-
/**
|
|
23
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Snap a shape drag; draws alignment hints. `grid` is the Snap to Grid step in page inches (0
|
|
24
|
+
* while the grid is hidden). Unchanged when no snapping is active.
|
|
25
|
+
*/
|
|
26
|
+
snap(page: VisioPage, ids: readonly string[], delta: VisioPagePoint, grid?: number | VisioSnapGrid): VisioPagePoint;
|
|
24
27
|
clearHints(): void;
|
|
25
28
|
wire(): () => void;
|
|
26
29
|
render(state: ViewerState): void;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { ViewerController, ViewerState } from './controller.js';
|
|
2
|
+
/**
|
|
3
|
+
* Visio's in-place text editing: double-click a shape, press F2 or start typing with one shape
|
|
4
|
+
* selected, and its text becomes editable where it is drawn. Esc, clicking elsewhere on the canvas
|
|
5
|
+
* or selecting something else saves the change as one undoable edit (as in Visio, Esc keeps what
|
|
6
|
+
* you typed); Enter starts a new line. Ribbon commands leave the editor open, and the draft
|
|
7
|
+
* survives other edits to the same drawing. The editor is a plain textarea (`#edit-text`), so
|
|
8
|
+
* Insert Symbol, Field and Spelling work on it.
|
|
9
|
+
*/
|
|
10
|
+
export declare class ViewerInlineText {
|
|
11
|
+
#private;
|
|
12
|
+
private readonly viewport;
|
|
13
|
+
private readonly controller;
|
|
14
|
+
private readonly announce;
|
|
15
|
+
readonly input: HTMLTextAreaElement;
|
|
16
|
+
constructor(viewport: HTMLElement, controller: ViewerController, announce: (message: string) => void);
|
|
17
|
+
get editing(): boolean;
|
|
18
|
+
wire(): () => void;
|
|
19
|
+
/**
|
|
20
|
+
* Start editing the one selected shape's text. `typed` replaces the text with a typed character,
|
|
21
|
+
* as typing on a selected shape does in Visio. False when the selection has no editable text.
|
|
22
|
+
*/
|
|
23
|
+
start(typed?: string): boolean;
|
|
24
|
+
/** Save the draft as one edit; `focusCanvas` returns keyboard focus to the drawing. */
|
|
25
|
+
commit(focusCanvas: boolean): Promise<void>;
|
|
26
|
+
/**
|
|
27
|
+
* Selecting something else or changing page saves; another edit to the same drawing (formatting,
|
|
28
|
+
* a move, undo) keeps the draft on the redrawn shape; a different file discards it.
|
|
29
|
+
*/
|
|
30
|
+
render(state: ViewerState): void;
|
|
31
|
+
}
|
|
@@ -5,6 +5,10 @@ interface Controls {
|
|
|
5
5
|
value: number;
|
|
6
6
|
};
|
|
7
7
|
}
|
|
8
|
+
/** Page inches an arrow key nudges the selection: the editor's 1/16-inch drawing snap. */
|
|
9
|
+
export declare const NUDGE_STEP: number;
|
|
8
10
|
/** Own every DOM listener and abort them together when the surface is disposed. */
|
|
9
|
-
export declare function wireViewerInputs(controls: Controls, controller: ViewerController, fit: (mode: 'page' | 'width') => void
|
|
11
|
+
export declare function wireViewerInputs(controls: Controls, controller: ViewerController, fit: (mode: 'page' | 'width') => void, announce?: (message: string) => void,
|
|
12
|
+
/** Typing a character with one shape selected starts editing its text; true when it did. */
|
|
13
|
+
typeText?: (character: string) => boolean): () => void;
|
|
10
14
|
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ViewerController, ViewerState } from './controller.js';
|
|
2
|
+
import { ViewerDialog } from './viewer-dialog.js';
|
|
3
|
+
/**
|
|
4
|
+
* Home > Editing > Layers > Layer Properties, as Visio's dialog: one row per layer of the page
|
|
5
|
+
* (and of its background pages) with its shape count, Visible, Print and Lock boxes and colour.
|
|
6
|
+
* OK saves the changed flags as one `set-layer-properties` edit. A read-only drawing can still
|
|
7
|
+
* show or hide layers here, for this view only.
|
|
8
|
+
*/
|
|
9
|
+
export declare class ViewerLayerProperties {
|
|
10
|
+
#private;
|
|
11
|
+
private readonly root;
|
|
12
|
+
private readonly controller;
|
|
13
|
+
private readonly announce;
|
|
14
|
+
readonly dialog: ViewerDialog;
|
|
15
|
+
constructor(root: ShadowRoot, controller: ViewerController, announce: (message: string) => void);
|
|
16
|
+
open(): void;
|
|
17
|
+
render(state: ViewerState): void;
|
|
18
|
+
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { ViewerController, ViewerState } from './controller.js';
|
|
2
2
|
import type { VisioLayoutAction } from './ribbon-action.js';
|
|
3
|
+
import { ViewerAutoConnect } from './viewer-auto-connect.js';
|
|
3
4
|
import { ViewerExplorer } from './viewer-explorer.js';
|
|
4
5
|
import { ViewerGuides } from './viewer-guides.js';
|
|
5
6
|
import { ViewerLayerAssign } from './viewer-layer-assign.js';
|
|
7
|
+
import { ViewerLayerProperties } from './viewer-layer-properties.js';
|
|
6
8
|
import { ViewerLayout } from './viewer-layout.js';
|
|
7
9
|
import { ViewerPasteSpecial } from './viewer-paste-special.js';
|
|
8
10
|
import { ViewerSelectType } from './viewer-select-type.js';
|
|
@@ -19,20 +21,24 @@ export interface LayoutCommandHost {
|
|
|
19
21
|
edit(run: () => Promise<void>, message: string): void;
|
|
20
22
|
/** Paste the viewer's own shape clipboard, as Ctrl+V does. */
|
|
21
23
|
pasteShapes(): Promise<void>;
|
|
24
|
+
/** Whether the Pointer tool is the current tool (AutoConnect arrows belong to it). */
|
|
25
|
+
pointerTool(): boolean;
|
|
22
26
|
}
|
|
23
27
|
/**
|
|
24
28
|
* Arrangement, layout, layers, selection, view aids and help commands: Auto Align & Space,
|
|
25
|
-
* Re-Layout Page and its Layout dialog, Assign to Layer, Select by Type, Paste Special, Guides,
|
|
26
|
-
* Dynamic Grid, Drawing Explorer, Help and Show Training.
|
|
29
|
+
* Re-Layout Page and its Layout dialog, Assign to Layer, Layer Properties, Select by Type, Paste Special, Guides,
|
|
30
|
+
* Dynamic Grid, AutoConnect, Drawing Explorer, Help and Show Training.
|
|
27
31
|
*/
|
|
28
32
|
export declare class ViewerLayoutCommands {
|
|
29
33
|
private readonly host;
|
|
30
34
|
readonly layout: ViewerLayout;
|
|
31
35
|
readonly layers: ViewerLayerAssign;
|
|
36
|
+
readonly layerProperties: ViewerLayerProperties;
|
|
32
37
|
readonly select: ViewerSelectType;
|
|
33
38
|
readonly paste: ViewerPasteSpecial;
|
|
34
39
|
readonly guides: ViewerGuides;
|
|
35
40
|
readonly explorer: ViewerExplorer;
|
|
41
|
+
readonly autoConnect: ViewerAutoConnect;
|
|
36
42
|
constructor(host: LayoutCommandHost);
|
|
37
43
|
run(action: VisioLayoutAction): void;
|
|
38
44
|
wire(): () => void;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { OfficeUiColorCustom } from '../controls.js';
|
|
2
|
+
import { ViewerDialog } from './viewer-dialog.js';
|
|
3
|
+
/**
|
|
4
|
+
* Office's More Colors dialog, Custom tab, on the shared `office-ui-color-custom`: the hue and
|
|
5
|
+
* saturation square, the luminance slider, Hex, RGB and HSL fields and the New and Current
|
|
6
|
+
* swatches. OK hands the colour (`#rrggbb`) to the caller.
|
|
7
|
+
*/
|
|
8
|
+
export declare class ViewerMoreColors {
|
|
9
|
+
#private;
|
|
10
|
+
readonly dialog: ViewerDialog;
|
|
11
|
+
readonly picker: OfficeUiColorCustom;
|
|
12
|
+
constructor(root: ShadowRoot);
|
|
13
|
+
/** Opens on `current` (`#rrggbb`; black when it is not a colour) and reports the choice. */
|
|
14
|
+
open(current: string | undefined, pick: (color: string) => void): void;
|
|
15
|
+
close(): void;
|
|
16
|
+
}
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import { type OfficeOptionCategory, type OfficeProfile } from '../controls.js';
|
|
2
2
|
/**
|
|
3
|
-
* Visio's File > Options categories, in Visio's order.
|
|
4
|
-
*
|
|
5
|
-
* setting is shown disabled with the capability it is waiting for.
|
|
3
|
+
* Visio's File > Options categories, in Visio's order. User name and Initials (the local profile,
|
|
4
|
+
* also the identity in a shared session) and Office Theme (the status bar's look) are honoured;
|
|
5
|
+
* every other setting is shown disabled with the capability it is waiting for.
|
|
6
6
|
*/
|
|
7
7
|
export declare const VISIO_OPTION_CATEGORIES: readonly OfficeOptionCategory[];
|
|
8
|
+
/** The status bar's look: Visio's product colour ("Colorful") or the neutral suite bar. */
|
|
9
|
+
export type StatusBarTheme = 'colorful' | 'neutral';
|
|
10
|
+
export declare const isStatusBarTheme: (value: unknown) => value is StatusBarTheme;
|
|
11
|
+
/** The Office Theme remembered on this device, if any (storage may be unavailable). */
|
|
12
|
+
export declare function readStatusBarTheme(): StatusBarTheme | undefined;
|
|
13
|
+
/** Office Theme as Options offers it: the two light looks, or the dark theme. */
|
|
14
|
+
export type OfficeThemeChoice = StatusBarTheme | 'dark';
|
|
8
15
|
/** The Options dialog element. Built once and appended to the viewer's shadow root. */
|
|
9
16
|
export declare function createOptionsDialog(doc: Document): HTMLElement;
|
|
10
17
|
/**
|
|
@@ -14,7 +21,14 @@ export declare function createOptionsDialog(doc: Document): HTMLElement;
|
|
|
14
21
|
export declare class ViewerProfile {
|
|
15
22
|
#private;
|
|
16
23
|
private readonly onProfile;
|
|
17
|
-
|
|
24
|
+
/** Reads and applies the Office Theme on the viewer element. */
|
|
25
|
+
private readonly theme;
|
|
26
|
+
constructor(root: ShadowRoot, onProfile?: (profile: OfficeProfile) => void,
|
|
27
|
+
/** Reads and applies the Office Theme on the viewer element. */
|
|
28
|
+
theme?: {
|
|
29
|
+
get(): OfficeThemeChoice;
|
|
30
|
+
set(theme: OfficeThemeChoice): void;
|
|
31
|
+
});
|
|
18
32
|
get profile(): OfficeProfile;
|
|
19
33
|
/** Open Visio Options, on General as Visio does. */
|
|
20
34
|
showOptions(category?: string): void;
|