visio-angular-viewer 0.5.2 → 0.5.4
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/NOTICE +1 -1
- package/README.md +5 -5
- package/dist/index.js +3 -7487
- package/dist/types/packages/bindings/src/angular.d.ts +5 -5
- package/dist/types/packages/bindings/src/common.d.ts +8 -8
- package/dist/types/src/index.d.ts +1 -14
- package/package.json +10 -7
- package/dist/assets/edit-worker-CZbtTOr4.js +0 -56328
- package/dist/assets/parse-worker-BEaLqUCJ.js +0 -61176
- package/dist/types/src/arrowheads.d.ts +0 -3
- package/dist/types/src/backstage.d.ts +0 -15
- package/dist/types/src/binding.d.ts +0 -27
- package/dist/types/src/contract.d.ts +0 -32
- package/dist/types/src/controller.d.ts +0 -71
- package/dist/types/src/demo-document.d.ts +0 -3
- package/dist/types/src/diagnostics.d.ts +0 -9
- package/dist/types/src/document-history.d.ts +0 -42
- package/dist/types/src/document-text-search.d.ts +0 -44
- package/dist/types/src/edit-commands.d.ts +0 -3
- package/dist/types/src/edit-error.d.ts +0 -4
- package/dist/types/src/edit-worker.d.ts +0 -1
- package/dist/types/src/export-svg.d.ts +0 -25
- package/dist/types/src/foreign-vector-budget.d.ts +0 -24
- package/dist/types/src/office-ui.d.ts +0 -2
- package/dist/types/src/paragraph-layout.d.ts +0 -18
- package/dist/types/src/parse-worker.d.ts +0 -1
- package/dist/types/src/print-snapshot.d.ts +0 -87
- package/dist/types/src/render-fill.d.ts +0 -2
- package/dist/types/src/render-foreign-vector-shape.d.ts +0 -4
- package/dist/types/src/render-foreign-vector.d.ts +0 -3
- package/dist/types/src/render-image.d.ts +0 -4
- package/dist/types/src/render-resources.d.ts +0 -10
- package/dist/types/src/render-svg.d.ts +0 -17
- package/dist/types/src/render-text.d.ts +0 -4
- package/dist/types/src/ribbon-action.d.ts +0 -41
- package/dist/types/src/ribbon-home-format.d.ts +0 -2
- package/dist/types/src/ribbon-home.d.ts +0 -6
- package/dist/types/src/ribbon-keytips.d.ts +0 -2
- package/dist/types/src/ribbon-other-tabs.d.ts +0 -12
- package/dist/types/src/ribbon-parts.d.ts +0 -60
- package/dist/types/src/ribbon-router.d.ts +0 -19
- package/dist/types/src/ribbon-view.d.ts +0 -5
- package/dist/types/src/ribbon.d.ts +0 -13
- package/dist/types/src/scene-details.d.ts +0 -7
- package/dist/types/src/scene-validation.d.ts +0 -4
- package/dist/types/src/shape-inspector.d.ts +0 -5
- package/dist/types/src/shapes-window.d.ts +0 -28
- package/dist/types/src/snapshot-scene.d.ts +0 -8
- package/dist/types/src/status-bar.d.ts +0 -10
- package/dist/types/src/styles/index.d.ts +0 -5
- package/dist/types/src/styles.d.ts +0 -2
- package/dist/types/src/text-layout.d.ts +0 -45
- package/dist/types/src/viewer-backstage.d.ts +0 -33
- package/dist/types/src/viewer-canvas.d.ts +0 -21
- package/dist/types/src/viewer-chrome.d.ts +0 -22
- package/dist/types/src/viewer-commands.d.ts +0 -34
- package/dist/types/src/viewer-context-menu.d.ts +0 -8
- package/dist/types/src/viewer-draw-tool.d.ts +0 -33
- package/dist/types/src/viewer-edit-controls.d.ts +0 -12
- package/dist/types/src/viewer-element.d.ts +0 -51
- package/dist/types/src/viewer-fit.d.ts +0 -6
- package/dist/types/src/viewer-geometry-controls.d.ts +0 -14
- package/dist/types/src/viewer-input.d.ts +0 -10
- package/dist/types/src/viewer-layer-controls.d.ts +0 -5
- package/dist/types/src/viewer-layers.d.ts +0 -22
- package/dist/types/src/viewer-options.d.ts +0 -22
- package/dist/types/src/viewer-pan-zoom.d.ts +0 -19
- package/dist/types/src/viewer-ruler.d.ts +0 -13
- package/dist/types/src/viewer-search.d.ts +0 -18
- package/dist/types/src/viewer-share.d.ts +0 -20
- package/dist/types/src/viewer-stencil.d.ts +0 -6
- package/dist/types/src/viewer-tell-me.d.ts +0 -4
- package/dist/types/src/worker-editor.d.ts +0 -23
- package/dist/types/src/worker-parser.d.ts +0 -13
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { ViewerController } from './controller.js';
|
|
2
|
-
import type { VisioRibbonAction } from './ribbon-action.js';
|
|
3
|
-
/** The controllers a ribbon action can reach. The element supplies each one. */
|
|
4
|
-
export interface RibbonTargets {
|
|
5
|
-
controller: ViewerController;
|
|
6
|
-
history(key: 'undo' | 'redo'): void;
|
|
7
|
-
deleteSelection(): void;
|
|
8
|
-
setTool(tool: 'pointer' | 'rectangle'): void;
|
|
9
|
-
toggleGrid(): void;
|
|
10
|
-
toggleRuler(): void;
|
|
11
|
-
togglePanZoom(): void;
|
|
12
|
-
toggleFullscreen(): void;
|
|
13
|
-
togglePane(pane: 'shapes' | 'inspector'): void;
|
|
14
|
-
reveal(panel: 'edit' | 'notes' | 'selection' | 'layers', focusText: boolean): void;
|
|
15
|
-
fit(mode: 'page' | 'width'): void;
|
|
16
|
-
focusSearch(): void;
|
|
17
|
-
}
|
|
18
|
-
/** Routes a ribbon, status-bar or shortcut action to the controller that owns it. */
|
|
19
|
-
export declare function routeRibbonAction(targets: RibbonTargets, action: VisioRibbonAction): void;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Microsoft Visio's View tab: Views, Show, Zoom, Visual Aids, Window and Macros. Ruler, Grid,
|
|
3
|
-
* Task Panes, Full Screen and every Zoom command work; the rest is shown disabled with a reason.
|
|
4
|
-
*/
|
|
5
|
-
export declare function buildViewPanel(doc: Document, panel: HTMLElement): void;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { buildHomePanel } from './ribbon-home.js';
|
|
2
|
-
import { buildDataPanel, buildDesignPanel, buildHelpPanel, buildInsertPanel, buildProcessPanel, buildReviewPanel } from './ribbon-other-tabs.js';
|
|
3
|
-
import { buildViewPanel } from './ribbon-view.js';
|
|
4
|
-
export type { VisioRibbonAction } from './ribbon-action.js';
|
|
5
|
-
/** Visio's ribbon tab order. File (backstage) belongs to the host application. */
|
|
6
|
-
export declare const RIBBON_TABS: readonly [readonly ["home", "Home", typeof buildHomePanel], readonly ["insert", "Insert", typeof buildInsertPanel], readonly ["design", "Design", typeof buildDesignPanel], readonly ["data", "Data", typeof buildDataPanel], readonly ["process", "Process", typeof buildProcessPanel], readonly ["review", "Review", typeof buildReviewPanel], readonly ["view", "View", typeof buildViewPanel], readonly ["help", "Help", typeof buildHelpPanel]];
|
|
7
|
-
export type RibbonTab = (typeof RIBBON_TABS)[number][0];
|
|
8
|
-
/**
|
|
9
|
-
* The Visio ribbon on the shared `office-ui-ribbon`: Quick Access Toolbar, File, one panel per
|
|
10
|
-
* tab and Tell me. The shared element owns the tab row, selection and arrow-key movement;
|
|
11
|
-
* commands emit `ribbon-action` events for the router.
|
|
12
|
-
*/
|
|
13
|
-
export declare function createRibbon(doc: Document): HTMLElement;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { VisioShape } from 'ooxml-core/visio';
|
|
2
|
-
export interface DetailBudget {
|
|
3
|
-
rows: number;
|
|
4
|
-
characters: number;
|
|
5
|
-
}
|
|
6
|
-
/** Runtime model checks prevent implicit DOM stringification of host-provided objects. */
|
|
7
|
-
export declare function assertShapeDetails(shape: VisioShape, budget: DetailBudget): void;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { VisioDocument, VisioShape } from 'ooxml-core/visio';
|
|
2
|
-
import type { ViewerState } from './controller.js';
|
|
3
|
-
export declare function selectedShape(document: VisioDocument | null, selection: ViewerState['selectedShape'], pageIndex: number): VisioShape | undefined;
|
|
4
|
-
export declare function safeExternalHref(value: string): string | undefined;
|
|
5
|
-
export declare function shapeDetails(shape: VisioShape): DocumentFragment;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/** Drag payload type for a stencil master; the value is the master id. */
|
|
2
|
-
export declare const MASTER_MIME = "application/x-visio-viewer-master";
|
|
3
|
-
interface Master {
|
|
4
|
-
id: string;
|
|
5
|
-
name: string;
|
|
6
|
-
/** Preview outline in a 24x24 box (static application geometry). */
|
|
7
|
-
path: string;
|
|
8
|
-
/** Default size in inches when dropped. */
|
|
9
|
-
size?: {
|
|
10
|
-
width: number;
|
|
11
|
-
height: number;
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
/** Visio's Basic Shapes stencil, in Visio's order. */
|
|
15
|
-
export declare const BASIC_SHAPES: readonly Master[];
|
|
16
|
-
/**
|
|
17
|
-
* Visio's Shapes window: Stencils and Search views, More Shapes and Quick Shapes rows and the
|
|
18
|
-
* Basic Shapes stencil. Masters are dragged onto the page; Enter adds one at the page centre.
|
|
19
|
-
*/
|
|
20
|
-
export declare function createShapesWindow(doc: Document): HTMLElement;
|
|
21
|
-
/** Default size of a stencil master the viewer can create, or nothing when unsupported. */
|
|
22
|
-
export declare function masterSize(id: string): {
|
|
23
|
-
width: number;
|
|
24
|
-
height: number;
|
|
25
|
-
} | undefined;
|
|
26
|
-
/** Visio's minimised Shapes window: a narrow strip that reopens the window. */
|
|
27
|
-
export declare function createShapesStrip(doc: Document): HTMLButtonElement;
|
|
28
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { VisioDocument } from 'ooxml-core/visio';
|
|
2
|
-
/**
|
|
3
|
-
* @internal Copy a canonically validated scene without retaining any renderer-used mutable input.
|
|
4
|
-
* The caller validates the result before use. Independent allocation caps also bound a host that
|
|
5
|
-
* changes its arrays while fields are read. Shared raster buffers are copied once per invocation.
|
|
6
|
-
* Inspector metadata, connectors, layers and unknown host properties are not used by static SVG.
|
|
7
|
-
*/
|
|
8
|
-
export declare function copySnapshotScene(model: VisioDocument): VisioDocument;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Visio's status bar on the shared `office-ui-status-bar`: page and shape metrics, a live
|
|
3
|
-
* message region, compatibility notes, the host footer slot and the shared zoom slider.
|
|
4
|
-
*/
|
|
5
|
-
export declare function createStatusBar(doc: Document): HTMLElement;
|
|
6
|
-
/**
|
|
7
|
-
* Visio's page bar under the drawing: the All pages list, the shared document tab strip and
|
|
8
|
-
* Insert Page, which stays disabled until core can add pages.
|
|
9
|
-
*/
|
|
10
|
-
export declare function createPageTabs(doc: Document): HTMLElement;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/** Inherited public tokens use local fallback aliases so host themes are never shadowed. */
|
|
2
|
-
export declare const viewerStyles = "\n:host {\n --_vv-bg:var(--vv-background,#eceae8); --_vv-surface:var(--vv-surface,#fff);\n --_vv-secondary:var(--vv-secondary,#f3f2f1); --_vv-ink:var(--vv-ink,#1f1f1f);\n --_vv-muted:var(--vv-muted,#605e5c); --_vv-border:var(--vv-border,#e1dfdd);\n --_vv-accent:var(--vv-accent,#3955a3); --_vv-accent-soft:var(--vv-accent-soft,rgba(57,85,163,.10));\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,var(--_vv-accent)); 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,0 2px 8px rgb(0 0 0 / 14%)); 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.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,#fff); }\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,#b42318); }\n.edit-controls [data-edit-error] { color:var(--vv-danger,#b42318); }\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";
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import type { VisioTextRun } from 'ooxml-core/visio';
|
|
2
|
-
export interface TextLine {
|
|
3
|
-
runs: VisioTextRun[];
|
|
4
|
-
width: number;
|
|
5
|
-
height: number;
|
|
6
|
-
}
|
|
7
|
-
export type MeasureText = (text: string, run: VisioTextRun) => number;
|
|
8
|
-
export interface TextLayoutLimits {
|
|
9
|
-
maxCharacters: number;
|
|
10
|
-
maxMeasurements: number;
|
|
11
|
-
maxLines: number;
|
|
12
|
-
maxFragments: number;
|
|
13
|
-
maxShapeCharacters: number;
|
|
14
|
-
maxShapeMeasurements: number;
|
|
15
|
-
maxShapeLines: number;
|
|
16
|
-
maxShapeFragments: number;
|
|
17
|
-
maxCacheEntries: number;
|
|
18
|
-
}
|
|
19
|
-
export declare class TextLayoutBudgetError extends Error {
|
|
20
|
-
constructor(message: string);
|
|
21
|
-
}
|
|
22
|
-
/** One bounded measurement cache and work budget per render; shape scopes share both. */
|
|
23
|
-
export declare class TextLayoutBudget {
|
|
24
|
-
#private;
|
|
25
|
-
readonly limits: Readonly<TextLayoutLimits>;
|
|
26
|
-
private readonly cache;
|
|
27
|
-
private readonly parent?;
|
|
28
|
-
private constructor();
|
|
29
|
-
static create(options?: Partial<TextLayoutLimits>): TextLayoutBudget;
|
|
30
|
-
get characters(): number;
|
|
31
|
-
get measurements(): number;
|
|
32
|
-
get lines(): number;
|
|
33
|
-
get fragments(): number;
|
|
34
|
-
/** A shape may be omitted without consuming the rest of the page's budget. */
|
|
35
|
-
forShape(): TextLayoutBudget;
|
|
36
|
-
reserveCharacters(count: number): void;
|
|
37
|
-
reserveLine(): void;
|
|
38
|
-
reserveFragment(): void;
|
|
39
|
-
private reserveMeasurement;
|
|
40
|
-
measure(text: string, run: VisioTextRun, measure: MeasureText): number;
|
|
41
|
-
}
|
|
42
|
-
export declare const createTextLayoutBudget: (options?: Partial<TextLayoutLimits>) => TextLayoutBudget;
|
|
43
|
-
export declare const measureBrowserText: MeasureText;
|
|
44
|
-
/** Rendering-only greedy wrapping. Inject one budget across shapes to bound total UI-thread work. */
|
|
45
|
-
export declare function wrapText(runs: VisioTextRun[], width: number, measure?: MeasureText, firstLineIndent?: number, budget?: TextLayoutBudget): TextLine[];
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import type { ViewerState } from './controller.js';
|
|
2
|
-
import type { VsdxSource } from './contract.js';
|
|
3
|
-
import { type BackstagePage } from './backstage.js';
|
|
4
|
-
/** What the backstage needs from the element; every action delegates to existing APIs. */
|
|
5
|
-
export interface BackstageHost {
|
|
6
|
-
root: ShadowRoot;
|
|
7
|
-
viewport: HTMLElement;
|
|
8
|
-
fileName(): string;
|
|
9
|
-
load(source: VsdxSource): Promise<void>;
|
|
10
|
-
exportVsdx(): {
|
|
11
|
-
bytes: Uint8Array;
|
|
12
|
-
dirty: boolean;
|
|
13
|
-
};
|
|
14
|
-
exportSvg(): {
|
|
15
|
-
svg: string;
|
|
16
|
-
pageIndex: number;
|
|
17
|
-
};
|
|
18
|
-
closeDocument(): void;
|
|
19
|
-
revealNotes(): void;
|
|
20
|
-
showOptions(): void;
|
|
21
|
-
announce(message: string): void;
|
|
22
|
-
noteCount(): number;
|
|
23
|
-
}
|
|
24
|
-
export declare class ViewerBackstage {
|
|
25
|
-
#private;
|
|
26
|
-
private readonly host;
|
|
27
|
-
constructor(host: BackstageHost);
|
|
28
|
-
get open(): boolean;
|
|
29
|
-
show(page?: BackstagePage): void;
|
|
30
|
-
hide(): void;
|
|
31
|
-
wire(): () => void;
|
|
32
|
-
render(state: ViewerState): void;
|
|
33
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { ViewerState } from './controller.js';
|
|
2
|
-
/**
|
|
3
|
-
* The drawing window: renders the current page, owns its resources, lists compatibility notes
|
|
4
|
-
* and marks the selection (revealing search hits). Page re-renders happen only when the
|
|
5
|
-
* document, page or layer overrides change.
|
|
6
|
-
*/
|
|
7
|
-
export declare class ViewerCanvas {
|
|
8
|
-
#private;
|
|
9
|
-
private readonly viewport;
|
|
10
|
-
private readonly notes;
|
|
11
|
-
private readonly notesPanel;
|
|
12
|
-
private readonly inspector;
|
|
13
|
-
constructor(viewport: HTMLElement, notes: HTMLUListElement, notesPanel: HTMLElement, inspector: HTMLDetailsElement);
|
|
14
|
-
get warnings(): readonly string[];
|
|
15
|
-
/** Force the next render to redraw the page (fonts loaded, element reconnected). */
|
|
16
|
-
invalidate(): void;
|
|
17
|
-
/** Release page resources and forget selection and search memory. */
|
|
18
|
-
dispose(): void;
|
|
19
|
-
/** Returns true when the page itself was re-rendered. */
|
|
20
|
-
render(state: ViewerState): boolean;
|
|
21
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { ViewerController, ViewerState } from './controller.js';
|
|
2
|
-
/**
|
|
3
|
-
* Static workspace markup (legacy; migrate to builders when next changed). The ribbon, Shapes
|
|
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. Labels are inserted as text.
|
|
6
|
-
*/
|
|
7
|
-
export declare const viewerChromeTemplate = "<div class=\"workspace\">\n <div class=\"viewport\" tabindex=\"0\" role=\"region\" aria-label=\"Diagram canvas\"></div>\n <aside id=\"inspector-pane\" class=\"inspector-pane\" aria-label=\"Drawing inspector\">\n <div class=\"pane-heading\"><span>Inspector</span><span class=\"inspector-kind\">Drawing</span><button class=\"pane-close\" type=\"button\" data-chrome=\"inspector\" aria-label=\"Close inspector\">\u00D7</button></div>\n <div class=\"inspector-body\">\n <section class=\"inspector-card document-card\" aria-label=\"Current page\"><h2>Current page</h2><p class=\"current-page-name\" data-page-name>No diagram open</p><dl><dt>Size</dt><dd data-page-size>No page</dd><dt>Shapes</dt><dd data-page-shapes>No shapes</dd></dl></section>\n <p class=\"selection-hint\">Select a shape on the canvas to see its data and links.</p>\n <details class=\"shape-inspector inspector-card\" hidden><summary>Selected shape</summary><div></div></details>\n <details class=\"edit-controls\"><summary>Edit diagram (experimental)</summary><p id=\"edit-warning\">Experimental source-backed editing. Unsupported targets are rejected. Native Visio compatibility is not verified. Keep your original file.</p><p data-edit-target></p><label for=\"edit-text\">Selected shape text</label><textarea id=\"edit-text\" rows=\"3\" aria-describedby=\"edit-warning edit-target edit-status\"></textarea><div class=\"edit-actions\"><button type=\"button\" data-edit=\"apply\">Apply text</button><button type=\"button\" data-edit=\"cancel\">Cancel</button><button type=\"button\" data-edit=\"undo\">Undo</button><button type=\"button\" data-edit=\"redo\">Redo</button></div><p id=\"edit-status\" role=\"status\" aria-live=\"polite\"></p><p data-edit-error role=\"alert\" hidden></p><ul data-edit-diagnostics></ul><fieldset data-geometry><legend>Geometry (experimental)</legend><p>Pin X/Y use drawing inches, bottom-left origin, Y up. Resize holds the rotation pin fixed. Core rejects unsupported formulas, protected cells, unsafe group/master dependencies and referenced deletion. Native Visio reopen fidelity is unverified.</p><label>New rectangle ID <input data-geometry-field=\"id\" type=\"text\" maxlength=\"256\"></label><label>Rectangle text (optional) <input data-geometry-field=\"text\" type=\"text\" maxlength=\"1000000\"></label><label>Pin X (inches) <input data-geometry-field=\"x\" type=\"number\" step=\"any\"></label><label>Pin Y (inches) <input data-geometry-field=\"y\" type=\"number\" step=\"any\"></label><label>Width (inches) <input data-geometry-field=\"width\" type=\"number\" min=\"0\" step=\"any\"></label><label>Height (inches) <input data-geometry-field=\"height\" type=\"number\" min=\"0\" step=\"any\"></label><div class=\"edit-actions\"><button type=\"button\" data-geometry-action=\"create-rectangle\">Create rectangle</button><button type=\"button\" data-geometry-action=\"move-shape\">Move selected</button><button type=\"button\" data-geometry-action=\"resize-shape\">Resize selected</button><button type=\"button\" data-geometry-action=\"delete-shape\">Delete selected</button></div><p data-geometry-error role=\"alert\" hidden></p></fieldset></details><details class=\"layer-controls\" hidden><summary>Layers</summary><p>Display changes only. SVG and print snapshots use saved visibility. Guides, NoShow and unknown hidden reasons remain hidden.</p><div data-layer-list></div><p data-layer-status role=\"status\"></p><button type=\"button\" data-layer-reset=\"all\">Reset all layers</button></details>\n <details class=\"notes inspector-card\"><summary>Compatibility notes</summary><ul></ul></details>\n </div>\n </aside>\n</div>";
|
|
8
|
-
export type TaskPane = 'shapes' | 'inspector';
|
|
9
|
-
/** Presentation state stays local; page navigation uses the same controller as every binding. */
|
|
10
|
-
export declare class ViewerChrome {
|
|
11
|
-
#private;
|
|
12
|
-
constructor(root: ShadowRoot, controller: ViewerController);
|
|
13
|
-
wire(): () => void;
|
|
14
|
-
showTab(tab: string): void;
|
|
15
|
-
/** On phones, close the Tools sheet once a command runs. */
|
|
16
|
-
closeCompactTools(): void;
|
|
17
|
-
/** Show or hide a task pane; compact layouts close the Tools menu afterwards. */
|
|
18
|
-
togglePane(pane: TaskPane): void;
|
|
19
|
-
/** Open an inspector disclosure; text editing may focus the text field directly (F2). */
|
|
20
|
-
reveal(kind: 'notes' | 'selection' | 'edit' | 'layers', focusText?: boolean): void;
|
|
21
|
-
render(state: ViewerState, noteCount: number): void;
|
|
22
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { ViewerController, ViewerState } from './controller.js';
|
|
2
|
-
import { type VisioRibbonAction } from './ribbon-action.js';
|
|
3
|
-
import type { Rulers } from './viewer-ruler.js';
|
|
4
|
-
export type CanvasTool = 'pointer' | 'rectangle';
|
|
5
|
-
interface CommandHost {
|
|
6
|
-
root: ShadowRoot;
|
|
7
|
-
viewport: HTMLElement;
|
|
8
|
-
rulers: Rulers;
|
|
9
|
-
controller: ViewerController;
|
|
10
|
-
fit(mode: 'page' | 'width'): void;
|
|
11
|
-
togglePane(pane: 'shapes' | 'inspector'): void;
|
|
12
|
-
reveal(panel: 'edit' | 'notes' | 'selection' | 'layers', focusText: boolean): void;
|
|
13
|
-
focusSearch(): void;
|
|
14
|
-
togglePanZoom(): void;
|
|
15
|
-
/** Transient command feedback for the status bar; document text is never interpreted as markup. */
|
|
16
|
-
announce(message: string): void;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Visio command state (tool, grid, pending edits) and keyboard shortcuts. Ribbon controls emit
|
|
20
|
-
* typed `ribbon-action` events and shortcuts build the same actions; both go through
|
|
21
|
-
* `routeRibbonAction`. Document mutation stays in the controller and core.
|
|
22
|
-
*/
|
|
23
|
-
export declare class ViewerCommands {
|
|
24
|
-
#private;
|
|
25
|
-
private readonly host;
|
|
26
|
-
constructor(host: CommandHost);
|
|
27
|
-
get tool(): CanvasTool;
|
|
28
|
-
/** Run one typed action, exactly as a ribbon control or shortcut would. */
|
|
29
|
-
run(action: VisioRibbonAction): void;
|
|
30
|
-
wire(): () => void;
|
|
31
|
-
setTool(tool: CanvasTool): void;
|
|
32
|
-
render(state: ViewerState): void;
|
|
33
|
-
}
|
|
34
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { ViewerController } from './controller.js';
|
|
2
|
-
/** Visio's shape and page context menus; commands the core lacks are shown disabled. */
|
|
3
|
-
export declare function createContextMenus(doc: Document): HTMLElement[];
|
|
4
|
-
/**
|
|
5
|
-
* Right-click, Shift+F10 or the Menu key on the canvas: a shape menu for the shape under the
|
|
6
|
-
* pointer (selecting it first, as Visio does) or a page menu on empty paper.
|
|
7
|
-
*/
|
|
8
|
-
export declare function wireContextMenus(root: ShadowRoot, viewport: HTMLElement, controller: ViewerController): () => void;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import type { VisioPage } from 'ooxml-core/visio';
|
|
2
|
-
import type { ViewerController } from './controller.js';
|
|
3
|
-
/** Next free numeric shape ID on the page tree. Core still rejects any collision. */
|
|
4
|
-
export declare function nextShapeId(page: VisioPage): string;
|
|
5
|
-
/** Page inches with a top-left origin (SVG user space) from a client point. */
|
|
6
|
-
export declare function pagePoint(svg: SVGSVGElement, page: VisioPage, event: Pick<MouseEvent, 'clientX' | 'clientY'>): {
|
|
7
|
-
x: number;
|
|
8
|
-
y: number;
|
|
9
|
-
} | undefined;
|
|
10
|
-
/**
|
|
11
|
-
* Create one rectangle through core and select it. `centre` is in top-left page inches (SVG
|
|
12
|
-
* space); core pins are centre points in bottom-left, y-up drawing inches.
|
|
13
|
-
*/
|
|
14
|
-
export declare function insertRectangle(controller: ViewerController, page: VisioPage, centre: {
|
|
15
|
-
x: number;
|
|
16
|
-
y: number;
|
|
17
|
-
}, size: {
|
|
18
|
-
width: number;
|
|
19
|
-
height: number;
|
|
20
|
-
}): Promise<string>;
|
|
21
|
-
/** Drag-to-draw rectangle tool. The preview is viewer-only; the shape is created by core. */
|
|
22
|
-
export declare class RectangleDrawTool {
|
|
23
|
-
#private;
|
|
24
|
-
private readonly viewport;
|
|
25
|
-
private readonly controller;
|
|
26
|
-
private readonly options;
|
|
27
|
-
constructor(viewport: HTMLElement, controller: ViewerController, options: {
|
|
28
|
-
active(): boolean;
|
|
29
|
-
announce(message: string): void;
|
|
30
|
-
});
|
|
31
|
-
get drawing(): boolean;
|
|
32
|
-
wire(): () => void;
|
|
33
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { ViewerController, ViewerState } from './controller.js';
|
|
2
|
-
/** Static markup only. Document text is assigned exclusively through value/textContent. */
|
|
3
|
-
export declare const editControlsTemplate = "<details class=\"edit-controls\"><summary>Edit diagram (experimental)</summary><p id=\"edit-warning\">Experimental source-backed editing. Unsupported targets are rejected. Native Visio compatibility is not verified. Keep your original file.</p><p data-edit-target></p><label for=\"edit-text\">Selected shape text</label><textarea id=\"edit-text\" rows=\"3\" aria-describedby=\"edit-warning edit-target edit-status\"></textarea><div class=\"edit-actions\"><button type=\"button\" data-edit=\"apply\">Apply text</button><button type=\"button\" data-edit=\"cancel\">Cancel</button><button type=\"button\" data-edit=\"undo\">Undo</button><button type=\"button\" data-edit=\"redo\">Redo</button></div><p id=\"edit-status\" role=\"status\" aria-live=\"polite\"></p><p data-edit-error role=\"alert\" hidden></p><ul data-edit-diagnostics></ul><fieldset data-geometry><legend>Geometry (experimental)</legend><p>Pin X/Y use drawing inches, bottom-left origin, Y up. Resize holds the rotation pin fixed. Core rejects unsupported formulas, protected cells, unsafe group/master dependencies and referenced deletion. Native Visio reopen fidelity is unverified.</p><label>New rectangle ID <input data-geometry-field=\"id\" type=\"text\" maxlength=\"256\"></label><label>Rectangle text (optional) <input data-geometry-field=\"text\" type=\"text\" maxlength=\"1000000\"></label><label>Pin X (inches) <input data-geometry-field=\"x\" type=\"number\" step=\"any\"></label><label>Pin Y (inches) <input data-geometry-field=\"y\" type=\"number\" step=\"any\"></label><label>Width (inches) <input data-geometry-field=\"width\" type=\"number\" min=\"0\" step=\"any\"></label><label>Height (inches) <input data-geometry-field=\"height\" type=\"number\" min=\"0\" step=\"any\"></label><div class=\"edit-actions\"><button type=\"button\" data-geometry-action=\"create-rectangle\">Create rectangle</button><button type=\"button\" data-geometry-action=\"move-shape\">Move selected</button><button type=\"button\" data-geometry-action=\"resize-shape\">Resize selected</button><button type=\"button\" data-geometry-action=\"delete-shape\">Delete selected</button></div><p data-geometry-error role=\"alert\" hidden></p></fieldset></details>";
|
|
4
|
-
export declare class ViewerEditControls {
|
|
5
|
-
#private;
|
|
6
|
-
readonly panel: HTMLDetailsElement;
|
|
7
|
-
readonly input: HTMLTextAreaElement;
|
|
8
|
-
constructor(root: ShadowRoot, controller: ViewerController);
|
|
9
|
-
wire(): () => void;
|
|
10
|
-
reset(focus?: boolean): void;
|
|
11
|
-
render(state: ViewerState): void;
|
|
12
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import type { VisioDocument, VisioEdit } from 'ooxml-core/visio';
|
|
2
|
-
import type { VsdxSource } from './contract.js';
|
|
3
|
-
import { ViewerController } from './controller.js';
|
|
4
|
-
import { type BackstagePage } from './backstage.js';
|
|
5
|
-
import { type SvgExportOptions, type SvgExportResult } from './export-svg.js';
|
|
6
|
-
import { type CurrentPagePrintSnapshotOptions, type PrintSnapshot } from './print-snapshot.js';
|
|
7
|
-
declare const BaseElement: typeof HTMLElement;
|
|
8
|
-
export declare class VisioViewerElement extends BaseElement {
|
|
9
|
-
#private;
|
|
10
|
-
readonly controller: ViewerController;
|
|
11
|
-
constructor();
|
|
12
|
-
get document(): VisioDocument | null;
|
|
13
|
-
set document(value: VisioDocument | null);
|
|
14
|
-
get pageIndex(): number;
|
|
15
|
-
set pageIndex(value: number);
|
|
16
|
-
get zoom(): number;
|
|
17
|
-
set zoom(value: number);
|
|
18
|
-
get showToolbar(): boolean;
|
|
19
|
-
set showToolbar(value: boolean);
|
|
20
|
-
get renderWarnings(): readonly string[];
|
|
21
|
-
load(source: VsdxSource): Promise<void>;
|
|
22
|
-
/** Leave Visio's File backstage and return to the drawing. */
|
|
23
|
-
closeBackstage(): void;
|
|
24
|
-
/** Open Visio's File backstage at a page (Info by default). */
|
|
25
|
-
openBackstage(page?: BackstagePage): void;
|
|
26
|
-
/** Name of the last opened local file, or empty for bytes, models and closed drawings. */
|
|
27
|
-
get fileName(): string;
|
|
28
|
-
applyEdits(edits: readonly VisioEdit[]): Promise<void>;
|
|
29
|
-
replacePlainText(pageId: string, shapeId: string, text: string): Promise<void>;
|
|
30
|
-
undo(): Promise<void>;
|
|
31
|
-
redo(): Promise<void>;
|
|
32
|
-
cancelEdit(): void;
|
|
33
|
-
exportVsdx(): ReturnType<ViewerController['exportVsdx']>;
|
|
34
|
-
fit(): void;
|
|
35
|
-
setLayerVisibility(pageId: string, layerId: string, visible: boolean | null): void;
|
|
36
|
-
resetLayerVisibility(pageId?: string): void;
|
|
37
|
-
/** Return a portable saved-display current-page snapshot without changing selection or downloading a file. */
|
|
38
|
-
exportSvg(options?: SvgExportOptions): SvgExportResult;
|
|
39
|
-
/** Prepare only the captured current drawing with saved display visibility. No frame, download, print dialog or state change. */
|
|
40
|
-
createPrintSnapshot(options?: CurrentPagePrintSnapshotOptions): PrintSnapshot;
|
|
41
|
-
destroy(): void;
|
|
42
|
-
connectedCallback(): void;
|
|
43
|
-
disconnectedCallback(): void;
|
|
44
|
-
}
|
|
45
|
-
export declare function registerVisioViewer(): void;
|
|
46
|
-
declare global {
|
|
47
|
-
interface HTMLElementTagNameMap {
|
|
48
|
-
'visio-viewer': VisioViewerElement;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
export {};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { VisioPage } from 'ooxml-core/visio';
|
|
2
|
-
/**
|
|
3
|
-
* Zoom that fits a page into the drawing window, as Visio's Fit to Window (whole page, never
|
|
4
|
-
* enlarged past 100%) or Page Width (fills the width and scrolls vertically).
|
|
5
|
-
*/
|
|
6
|
-
export declare function fitZoom(viewport: HTMLElement, page: VisioPage, mode: 'page' | 'width'): number;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { ViewerController, ViewerState } from './controller.js';
|
|
2
|
-
export declare const geometryControlsTemplate = "<fieldset data-geometry><legend>Geometry (experimental)</legend><p>Pin X/Y use drawing inches, bottom-left origin, Y up. Resize holds the rotation pin fixed. Core rejects unsupported formulas, protected cells, unsafe group/master dependencies and referenced deletion. Native Visio reopen fidelity is unverified.</p><label>New rectangle ID <input data-geometry-field=\"id\" type=\"text\" maxlength=\"256\"></label><label>Rectangle text (optional) <input data-geometry-field=\"text\" type=\"text\" maxlength=\"1000000\"></label><label>Pin X (inches) <input data-geometry-field=\"x\" type=\"number\" step=\"any\"></label><label>Pin Y (inches) <input data-geometry-field=\"y\" type=\"number\" step=\"any\"></label><label>Width (inches) <input data-geometry-field=\"width\" type=\"number\" min=\"0\" step=\"any\"></label><label>Height (inches) <input data-geometry-field=\"height\" type=\"number\" min=\"0\" step=\"any\"></label><div class=\"edit-actions\"><button type=\"button\" data-geometry-action=\"create-rectangle\">Create rectangle</button><button type=\"button\" data-geometry-action=\"move-shape\">Move selected</button><button type=\"button\" data-geometry-action=\"resize-shape\">Resize selected</button><button type=\"button\" data-geometry-action=\"delete-shape\">Delete selected</button></div><p data-geometry-error role=\"alert\" hidden></p></fieldset>";
|
|
3
|
-
/** Collect explicit coordinates; never infer a Visio pin from rendered SVG transforms. */
|
|
4
|
-
export declare class ViewerGeometryControls {
|
|
5
|
-
#private;
|
|
6
|
-
private readonly panel;
|
|
7
|
-
private readonly controller;
|
|
8
|
-
private readonly draftChanged;
|
|
9
|
-
constructor(panel: HTMLElement, controller: ViewerController, draftChanged?: () => void);
|
|
10
|
-
wire(): () => void;
|
|
11
|
-
get hasDraft(): boolean;
|
|
12
|
-
reset(): void;
|
|
13
|
-
render(state: ViewerState): void;
|
|
14
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { ViewerController } from './controller.js';
|
|
2
|
-
interface Controls {
|
|
3
|
-
viewport: HTMLDivElement;
|
|
4
|
-
zoomSlider: HTMLElement & {
|
|
5
|
-
value: number;
|
|
6
|
-
};
|
|
7
|
-
}
|
|
8
|
-
/** 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): () => void;
|
|
10
|
-
export {};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { ViewerController, ViewerState } from './controller.js';
|
|
2
|
-
export declare const layerControlsTemplate = "<details class=\"layer-controls\" hidden><summary>Layers</summary><p>Display changes only. SVG and print snapshots use saved visibility. Guides, NoShow and unknown hidden reasons remain hidden.</p><div data-layer-list></div><p data-layer-status role=\"status\"></p><button type=\"button\" data-layer-reset=\"all\">Reset all layers</button></details>";
|
|
3
|
-
/** Static controls and text-only labels. Document strings never become selectors or markup. */
|
|
4
|
-
export declare function renderLayerControls(panel: HTMLDetailsElement, state: ViewerState): void;
|
|
5
|
-
export declare function wireLayerControls(panel: HTMLDetailsElement, controller: ViewerController): () => void;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { type VisioDocument, type VisioShape } from 'ooxml-core/visio';
|
|
2
|
-
/** UI limits. Visibility semantics and shape traversal remain in ooxml-core. */
|
|
3
|
-
export declare const VIEWER_LAYER_LIMITS: Readonly<{
|
|
4
|
-
overrides: 25000;
|
|
5
|
-
controls: 200;
|
|
6
|
-
}>;
|
|
7
|
-
export interface LayerVisibilityOverride {
|
|
8
|
-
/** The source page owning the layer, including background pages. */
|
|
9
|
-
readonly pageId: string;
|
|
10
|
-
readonly layerId: string;
|
|
11
|
-
readonly visible: boolean;
|
|
12
|
-
}
|
|
13
|
-
export declare const EMPTY_LAYER_OVERRIDES: readonly LayerVisibilityOverride[];
|
|
14
|
-
/** Validate before allocating indexes; never expose mutable maps as viewer state. */
|
|
15
|
-
export declare function layerOverrideMaps(model: VisioDocument | null, overrides: readonly LayerVisibilityOverride[]): Map<string, Map<string, boolean>>;
|
|
16
|
-
export declare function documentVisibility(model: VisioDocument | null, overrides?: readonly LayerVisibilityOverride[]): WeakMap<VisioShape, boolean>;
|
|
17
|
-
export declare function visibleSelection(model: VisioDocument | null, pageIndex: number, selection: {
|
|
18
|
-
readonly id: string;
|
|
19
|
-
readonly pageId?: string;
|
|
20
|
-
} | null, visible: WeakMap<VisioShape, boolean>): boolean;
|
|
21
|
-
/** Rendering eligibility shared by selection and SVG containers; no format interpretation. */
|
|
22
|
-
export declare function hasVisibleShapeContent(shape: VisioShape, visible: WeakMap<VisioShape, boolean> | undefined, cache?: WeakMap<VisioShape, boolean>): boolean;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { type OfficeOptionCategory, type OfficeProfile } from 'ooxml-ui/controls';
|
|
2
|
-
/**
|
|
3
|
-
* Visio's File > Options categories, in Visio's order. Only User name and Initials are honoured
|
|
4
|
-
* today (they are the local profile, also used as the identity in a shared session); every other
|
|
5
|
-
* setting is shown disabled with the capability it is waiting for.
|
|
6
|
-
*/
|
|
7
|
-
export declare const VISIO_OPTION_CATEGORIES: readonly OfficeOptionCategory[];
|
|
8
|
-
/** The Options dialog element. Built once and appended to the viewer's shadow root. */
|
|
9
|
-
export declare function createOptionsDialog(doc: Document): HTMLElement;
|
|
10
|
-
/**
|
|
11
|
-
* File > Account and File > Options share one local profile. Edits in either are written to the
|
|
12
|
-
* suite-wide profile store, mirrored into the other and reported through `onProfile`.
|
|
13
|
-
*/
|
|
14
|
-
export declare class ViewerProfile {
|
|
15
|
-
#private;
|
|
16
|
-
private readonly onProfile;
|
|
17
|
-
constructor(root: ShadowRoot, onProfile?: (profile: OfficeProfile) => void);
|
|
18
|
-
get profile(): OfficeProfile;
|
|
19
|
-
/** Open Visio Options, on General as Visio does. */
|
|
20
|
-
showOptions(category?: string): void;
|
|
21
|
-
wire(): () => void;
|
|
22
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { ViewerController } from './controller.js';
|
|
2
|
-
/** Visio's Pan & Zoom window: a floating page thumbnail with the visible area outlined. */
|
|
3
|
-
export declare function createPanZoom(doc: Document): HTMLElement;
|
|
4
|
-
/**
|
|
5
|
-
* Keeps the thumbnail and the visible-area rectangle in step with the drawing window, and pans
|
|
6
|
-
* the drawing window from the thumbnail. The thumbnail is a DOM clone of the rendered page.
|
|
7
|
-
*/
|
|
8
|
-
export declare class ViewerPanZoom {
|
|
9
|
-
#private;
|
|
10
|
-
private readonly viewport;
|
|
11
|
-
private readonly controller;
|
|
12
|
-
private readonly checked;
|
|
13
|
-
constructor(root: ShadowRoot, viewport: HTMLElement, controller: ViewerController, checked: (open: boolean) => void);
|
|
14
|
-
get open(): boolean;
|
|
15
|
-
toggle(open?: boolean): void;
|
|
16
|
-
wire(): () => void;
|
|
17
|
-
/** Refresh the thumbnail when the page changed, then the visible-area rectangle. */
|
|
18
|
-
render(): void;
|
|
19
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Visio's rulers: inch scales along the top and left of the drawing window with 0 at the page's
|
|
3
|
-
* left and bottom edges (vertical values grow upward, as in Visio). Drawn by the shared
|
|
4
|
-
* `office-ui-ruler`; this module only lays them out and says where zero is. Viewer-only
|
|
5
|
-
* presentation: nothing is read from or written to the document beyond the rendered page box.
|
|
6
|
-
*/
|
|
7
|
-
export interface Rulers {
|
|
8
|
-
element: HTMLElement;
|
|
9
|
-
render(visible: boolean, zoom: number): void;
|
|
10
|
-
wire(): () => void;
|
|
11
|
-
}
|
|
12
|
-
/** Wraps the viewport in a grid with a corner, a top ruler and a left ruler. */
|
|
13
|
-
export declare function createRulers(viewport: HTMLElement): Rulers;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { ViewerController, ViewerState } from './controller.js';
|
|
2
|
-
export type FindBar = HTMLElement & {
|
|
3
|
-
open: boolean;
|
|
4
|
-
value: string;
|
|
5
|
-
status: string;
|
|
6
|
-
statusTitle: string;
|
|
7
|
-
show(): void;
|
|
8
|
-
close(): void;
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* Visio opens Find from Home > Editing rather than keeping a box in the ribbon. The shared
|
|
12
|
-
* `office-ui-find-bar` sits under the ribbon, hidden until Find... or Ctrl+F; Enter and
|
|
13
|
-
* Shift+Enter step through matching shapes and Escape clears, then closes.
|
|
14
|
-
*/
|
|
15
|
-
export declare function createFindBar(doc: Document): FindBar;
|
|
16
|
-
/** Route the find bar's queries and steps to the controller; `closed` restores focus. */
|
|
17
|
-
export declare function wireFindBar(bar: FindBar, controller: ViewerController, closed: () => void): () => void;
|
|
18
|
-
export declare function renderFindBar(bar: FindBar, state: ViewerState): void;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { OfficeProfile } from 'ooxml-ui/controls';
|
|
2
|
-
import type { ViewerController } from './controller.js';
|
|
3
|
-
type Collab = typeof import('ooxml-core/collab');
|
|
4
|
-
/**
|
|
5
|
-
* File > Share: a live session over `ooxml-core/collab` (Yjs). Peers in other windows of this
|
|
6
|
-
* browser share the whole VSDX package through a BroadcastChannel; remote changes arrive as one
|
|
7
|
-
* undoable history step. The collab runtime loads only when sharing starts.
|
|
8
|
-
*/
|
|
9
|
-
export declare class ViewerShare {
|
|
10
|
-
#private;
|
|
11
|
-
private readonly controller;
|
|
12
|
-
private readonly profile;
|
|
13
|
-
private readonly loadCollab;
|
|
14
|
-
constructor(root: ShadowRoot, controller: ViewerController, profile: () => OfficeProfile, loadCollab?: () => Promise<Collab>);
|
|
15
|
-
get active(): boolean;
|
|
16
|
-
wire(): () => void;
|
|
17
|
-
start(roomId: string): Promise<void>;
|
|
18
|
-
stop(): void;
|
|
19
|
-
}
|
|
20
|
-
export {};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { ViewerController } from './controller.js';
|
|
2
|
-
/**
|
|
3
|
-
* Shapes window interaction: drag a master onto the page to drop it there, or activate it to add
|
|
4
|
-
* it at the page centre. Only masters the core can create are draggable; the rest stay inert.
|
|
5
|
-
*/
|
|
6
|
-
export declare function wireStencil(pane: HTMLElement, viewport: HTMLElement, controller: ViewerController, announce: (message: string) => void): () => void;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/** Visio's "Tell me what you want to do" box (the shared `office-ui-command-search`). */
|
|
2
|
-
export declare function createTellMe(doc: Document): HTMLElement;
|
|
3
|
-
/** The command list refreshes on focus, so enabled states always match the ribbon. */
|
|
4
|
-
export declare function wireTellMe(root: ShadowRoot): () => void;
|