visio-react-viewer 0.3.0 → 0.4.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/dist/index.js +4673 -2225
- package/dist/types/src/backstage.d.ts +9 -0
- package/dist/types/src/ribbon-action.d.ts +8 -1
- package/dist/types/src/ribbon-home-format.d.ts +2 -0
- package/dist/types/src/ribbon-home.d.ts +3 -3
- package/dist/types/src/ribbon-keytips.d.ts +2 -0
- package/dist/types/src/ribbon-other-tabs.d.ts +12 -0
- package/dist/types/src/ribbon-parts.d.ts +49 -9
- package/dist/types/src/ribbon-router.d.ts +3 -1
- package/dist/types/src/ribbon-view.d.ts +4 -1
- package/dist/types/src/ribbon.d.ts +8 -2
- package/dist/types/src/shapes-window.d.ts +28 -0
- package/dist/types/src/status-bar.d.ts +4 -1
- package/dist/types/src/styles.d.ts +1 -1
- package/dist/types/src/viewer-backstage.d.ts +36 -0
- package/dist/types/src/viewer-canvas.d.ts +21 -0
- package/dist/types/src/viewer-chrome.d.ts +9 -6
- package/dist/types/src/viewer-commands.d.ts +4 -1
- package/dist/types/src/viewer-context-menu.d.ts +8 -0
- package/dist/types/src/viewer-draw-tool.d.ts +16 -0
- package/dist/types/src/viewer-element.d.ts +7 -0
- package/dist/types/src/viewer-fit.d.ts +6 -0
- package/dist/types/src/viewer-pan-zoom.d.ts +19 -0
- package/dist/types/src/viewer-ruler.d.ts +7 -0
- package/dist/types/src/viewer-search.d.ts +7 -0
- package/dist/types/src/viewer-stencil.d.ts +6 -0
- package/dist/types/src/viewer-tell-me.d.ts +4 -0
- package/package.json +2 -2
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Visio's File (backstage) pages, in Visio's order. Save and Close act without a page. */
|
|
2
|
+
export declare const BACKSTAGE_ITEMS: readonly [readonly ["info", "Info"], readonly ["new", "New"], readonly ["open", "Open"], readonly ["save", "Save"], readonly ["save-as", "Save As"], readonly ["print", "Print"], readonly ["share", "Share"], readonly ["export", "Export"], readonly ["close", "Close"]];
|
|
3
|
+
export declare const BACKSTAGE_FOOTER: readonly [readonly ["account", "Account"], readonly ["feedback", "Feedback"], readonly ["options", "Options"]];
|
|
4
|
+
export type BackstagePage = Exclude<(typeof BACKSTAGE_ITEMS)[number][0] | (typeof BACKSTAGE_FOOTER)[number][0], 'save' | 'close'>;
|
|
5
|
+
/**
|
|
6
|
+
* Visio's backstage: a full-window File view with a navigation column and one page per item.
|
|
7
|
+
* Static application structure only; document values are filled in later as text.
|
|
8
|
+
*/
|
|
9
|
+
export declare function createBackstage(doc: Document): HTMLElement;
|
|
@@ -9,18 +9,25 @@ export type VisioRibbonAction = {
|
|
|
9
9
|
type: 'delete';
|
|
10
10
|
} | {
|
|
11
11
|
type: 'pane';
|
|
12
|
-
pane: '
|
|
12
|
+
pane: 'shapes' | 'inspector';
|
|
13
13
|
} | {
|
|
14
14
|
type: 'reveal';
|
|
15
15
|
panel: 'edit' | 'notes' | 'selection' | 'layers';
|
|
16
16
|
focusText?: boolean;
|
|
17
17
|
} | {
|
|
18
18
|
type: 'grid';
|
|
19
|
+
} | {
|
|
20
|
+
type: 'panZoom';
|
|
21
|
+
} | {
|
|
22
|
+
type: 'ruler';
|
|
19
23
|
} | {
|
|
20
24
|
type: 'fullscreen';
|
|
21
25
|
} | {
|
|
22
26
|
type: 'zoom';
|
|
23
27
|
mode: 'fit' | 'width' | 'actual';
|
|
28
|
+
} | {
|
|
29
|
+
type: 'zoomTo';
|
|
30
|
+
percent: number;
|
|
24
31
|
} | {
|
|
25
32
|
type: 'search';
|
|
26
33
|
} | {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Visio's Home tab,
|
|
3
|
-
* Editing.
|
|
4
|
-
*
|
|
2
|
+
* Microsoft Visio's Home tab, group for group: Clipboard, Font, Paragraph, Tools, Shape
|
|
3
|
+
* Styles, Arrange and Editing. Commands the core cannot perform yet are shown disabled with the
|
|
4
|
+
* missing capability in their tooltip. On phones every group folds into the Tools disclosure.
|
|
5
5
|
*/
|
|
6
6
|
export declare function buildHomePanel(doc: Document, panel: HTMLElement): void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Visio's Insert tab: Pages, Illustrations, Diagram Parts, Links and Text. */
|
|
2
|
+
export declare function buildInsertPanel(doc: Document, panel: HTMLElement): void;
|
|
3
|
+
/** Visio's Design tab: Page Setup, Themes, Variants, Backgrounds and Layout. */
|
|
4
|
+
export declare function buildDesignPanel(doc: Document, panel: HTMLElement): void;
|
|
5
|
+
/** Visio's Data tab. Shape Data Window maps to the viewer's shape inspector. */
|
|
6
|
+
export declare function buildDataPanel(doc: Document, panel: HTMLElement): void;
|
|
7
|
+
/** Visio's Process tab. */
|
|
8
|
+
export declare function buildProcessPanel(doc: Document, panel: HTMLElement): void;
|
|
9
|
+
/** Visio's Review tab: Proofing, Language, Comments and Reports. */
|
|
10
|
+
export declare function buildReviewPanel(doc: Document, panel: HTMLElement): void;
|
|
11
|
+
/** Visio's Help tab. Help content, support and training are not bundled in this viewer. */
|
|
12
|
+
export declare function buildHelpPanel(doc: Document, panel: HTMLElement): void;
|
|
@@ -1,20 +1,60 @@
|
|
|
1
1
|
import { type VisioRibbonAction } from './ribbon-action.js';
|
|
2
|
-
/** A shared `office-ui
|
|
2
|
+
/** A shared `office-ui-*` command element with Visio state hooks. */
|
|
3
3
|
export type RibbonCommand = HTMLElement & {
|
|
4
4
|
disabled: boolean;
|
|
5
5
|
};
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
7
|
+
* One ribbon command. `id` is a stable name for state sync and tests; the typed `action` is
|
|
8
|
+
* what runs. Without an action the command is shown, disabled, with `unsupported` explaining
|
|
9
|
+
* what is missing, so the ribbon matches Visio without claiming features it lacks.
|
|
9
10
|
*/
|
|
10
|
-
export
|
|
11
|
+
export interface CommandSpec {
|
|
12
|
+
id: string;
|
|
13
|
+
label: string;
|
|
14
|
+
icon?: string;
|
|
15
|
+
action?: VisioRibbonAction;
|
|
16
|
+
unsupported?: string;
|
|
17
|
+
/** `large` stacks icon over label; `small` is icon and label in a row; `icon` is icon-only. */
|
|
18
|
+
size?: 'large' | 'small' | 'icon';
|
|
11
19
|
keys?: [aria: string, hint: string];
|
|
12
20
|
pressed?: boolean;
|
|
13
21
|
controls?: string;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export
|
|
22
|
+
checked?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface MenuSpec extends CommandSpec {
|
|
25
|
+
items: readonly CommandSpec[];
|
|
26
|
+
/** Split button: the main part runs `action`, the caret opens the menu. */
|
|
27
|
+
split?: boolean;
|
|
28
|
+
}
|
|
29
|
+
/** A shared `office-ui-button` in Visio's large, small or icon-only size. */
|
|
30
|
+
export declare function command(doc: Document, spec: CommandSpec): RibbonCommand;
|
|
31
|
+
/** A shared `office-ui-menu-button` (dropdown or split) with typed actions per item. */
|
|
32
|
+
export declare function menu(doc: Document, spec: MenuSpec): RibbonCommand;
|
|
33
|
+
/** Office's three-row column of small commands, or a row with `horizontal`. */
|
|
34
|
+
export declare function stack(doc: Document, children: readonly HTMLElement[], horizontal?: boolean): HTMLElement;
|
|
35
|
+
/** A labelled ribbon group; `launcher` shows Visio's dialog launcher, disabled with a reason. */
|
|
36
|
+
export declare function group(doc: Document, label: string, children: readonly HTMLElement[], options?: {
|
|
37
|
+
className?: string;
|
|
38
|
+
launcher?: string;
|
|
39
|
+
}): HTMLElement;
|
|
40
|
+
/** A labelled shared checkbox (Visio's View > Show options). */
|
|
41
|
+
export declare function check(doc: Document, spec: CommandSpec): HTMLElement;
|
|
42
|
+
/** A shared select shown as Visio's font or size combo; disabled until core supports it. */
|
|
43
|
+
export declare function combo(doc: Document, spec: {
|
|
44
|
+
id: string;
|
|
45
|
+
label: string;
|
|
46
|
+
placeholder: string;
|
|
47
|
+
width: number;
|
|
48
|
+
unsupported: string;
|
|
49
|
+
}): HTMLElement;
|
|
17
50
|
/** A keyboard-navigable row of groups (the shared `office-ui-toolbar`). */
|
|
18
51
|
export declare function commandRow(doc: Document, label: string, children: readonly HTMLElement[]): HTMLElement;
|
|
19
|
-
/**
|
|
20
|
-
|
|
52
|
+
/**
|
|
53
|
+
* A shared `office-ui-context-menu` of typed commands and separators (`'-'`). Items without an
|
|
54
|
+
* action are shown disabled with their reason, as in the ribbon.
|
|
55
|
+
*/
|
|
56
|
+
export declare function contextMenu(doc: Document, id: string, label: string, items: readonly (CommandSpec | '-')[]): HTMLElement & {
|
|
57
|
+
openAt(x: number, y: number): void;
|
|
58
|
+
close(): void;
|
|
59
|
+
open: boolean;
|
|
60
|
+
};
|
|
@@ -7,8 +7,10 @@ export interface RibbonTargets {
|
|
|
7
7
|
deleteSelection(): void;
|
|
8
8
|
setTool(tool: 'pointer' | 'rectangle'): void;
|
|
9
9
|
toggleGrid(): void;
|
|
10
|
+
toggleRuler(): void;
|
|
11
|
+
togglePanZoom(): void;
|
|
10
12
|
toggleFullscreen(): void;
|
|
11
|
-
togglePane(pane: '
|
|
13
|
+
togglePane(pane: 'shapes' | 'inspector'): void;
|
|
12
14
|
reveal(panel: 'edit' | 'notes' | 'selection' | 'layers', focusText: boolean): void;
|
|
13
15
|
fit(mode: 'page' | 'width'): void;
|
|
14
16
|
focusSearch(): void;
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
/**
|
|
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
|
+
*/
|
|
2
5
|
export declare function buildViewPanel(doc: Document, panel: HTMLElement): void;
|
|
@@ -1,6 +1,12 @@
|
|
|
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';
|
|
1
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];
|
|
2
8
|
/**
|
|
3
|
-
* The Visio ribbon:
|
|
4
|
-
* belong to the chrome; commands emit `ribbon-action` events for the router.
|
|
9
|
+
* The Visio ribbon: Quick Access Toolbar, tab list and one panel per tab. Tab switching and
|
|
10
|
+
* keyboard movement belong to the chrome; commands emit `ribbon-action` events for the router.
|
|
5
11
|
*/
|
|
6
12
|
export declare function createRibbon(doc: Document): HTMLElement;
|
|
@@ -0,0 +1,28 @@
|
|
|
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 {};
|
|
@@ -3,5 +3,8 @@
|
|
|
3
3
|
* message region, compatibility notes, the host footer slot and the shared zoom slider.
|
|
4
4
|
*/
|
|
5
5
|
export declare function createStatusBar(doc: Document): HTMLElement;
|
|
6
|
-
/**
|
|
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
|
+
*/
|
|
7
10
|
export declare function createPageTabs(doc: Document): HTMLElement;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
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-tabs { height:35px; display:flex; align-items:stretch; padding:0 4px; border-bottom:1px solid var(--_vv-border); }\n.ribbon-tabs button { position:relative; min-height:34px; padding:7px 14px; border:0; border-radius:0; background:transparent; color:var(--_vv-muted); font-size:12px; font-weight:500; }\n.ribbon-tabs button[aria-selected=\"true\"] { color:var(--_vv-accent); }\n.ribbon-tabs button[aria-selected=\"true\"]::after { content:\"\"; position:absolute; inset:auto 0 -1px; height:2.5px; background:var(--_vv-accent); }\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.search-group { width:330px; }\n.search-controls { display:flex; align-items:center; gap:4px; flex-wrap:wrap; }\n.search-controls label { display:flex; align-items:center; min-width:0; gap:6px; flex:1; font-size:11px; }\n.search-controls input { width:100%; min-width:0; padding:3px 6px; font-size:11px; }\n.search-controls button { padding:3px 6px; font-size:10px; background:var(--_vv-secondary); }\n.search-controls [role=\"status\"] { display:block; width:100%; min-height:15px; font-size:10px; line-height:15px; color:var(--_vv-muted); overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }\n.workspace { position:relative; display:flex; flex:1; min-width:0; min-height:0; overflow:hidden; }\n.page-rail { flex:0 0 180px; width:180px; min-width:0; overflow:auto; border-right:1px solid var(--_vv-border); background:var(--_vv-secondary); }\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.pane-heading [data-page-count],.inspector-kind { color:var(--_vv-muted); font-size:10px; font-weight:400; }\n.page-list { list-style:none; padding:8px 5px; margin:0; display:flex; flex-direction:column; gap:4px; }\n.page-link { display:flex; align-items:center; position:relative; width:100%; min-width:0; gap:4px; padding:4px 5px 4px 2px; border:0; border-radius:0; background:transparent; color:var(--_vv-muted); text-align:left; }\n.page-link[aria-current=\"page\"] { background:var(--_vv-accent-soft); }\n.page-link[aria-current=\"page\"]::before { content:\"\"; position:absolute; left:0; top:4px; bottom:4px; width:3px; border-radius:0 2px 2px 0; background:var(--_vv-accent); }\n.page-number { flex:0 0 20px; width:20px; padding-right:3px; font-size:10px; text-align:right; }\n.page-card { display:flex; flex-direction:column; align-items:flex-start; min-width:0; width:100%; min-height:98px; gap:3px; padding:10px; border:1px solid var(--_vv-border); border-radius:2px; background:var(--_vv-surface); }\n.page-link[aria-current=\"page\"] .page-card { border-color:var(--_vv-accent); }\n.page-link[aria-current=\"page\"] .page-number { color:var(--_vv-accent); font-weight:600; }\n.page-mark { color:var(--_vv-muted); font-size:20px; line-height:23px; }\n.page-name { color:var(--_vv-ink); font-size:11px; font-weight:500; line-height:16px; overflow-wrap:anywhere; }\n.page-meta { color:var(--_vv-muted); font-size:9px; line-height:14px; }\n.page-empty { margin:12px; color:var(--_vv-muted); font-size:11px; }\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-tabs { height:44px; }\n .ribbon-tabs button { min-height:44px; padding:8px 16px; }\n .ribbon-content { min-height:86px; }\n .ribbon-group { padding:4px 8px; }\n .search-group { width:100%; border-right:0; }\n .search-controls { gap:4px; }\n .search-controls label { font-size:12px; }\n .search-controls input { font-size:12px; }\n .search-controls button { min-width:44px; font-size:0; padding:3px; }\n .search-controls [data-action=\"search-previous\"]::before { content:\"\u2039\"; font-size:22px; }\n .search-controls [data-action=\"search-next\"]::before { content:\"\u203A\"; font-size:22px; }\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 .page-rail { width:100%; max-height:190px; border-right:0; border-bottom:1px solid var(--_vv-border); }\n .page-list { flex-direction:row; overflow-x:auto; }\n .page-list li { flex:0 0 155px; }\n .page-card { min-height:86px; }\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-tabs { min-height:44px; height:44px; }\n .ribbon-tabs button { min-height:44px; }\n .ribbon-content { min-height:96px; }\n .search-group { width:380px; max-width:100%; }\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-tabs { height:40px; }\n.ribbon-tabs button { min-height:39px; padding:8px 16px; }\n.ribbon-content { min-height:104px; padding:4px 4px; }\n.search-group { order:2; width:320px; }\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-tabs { height:44px; }\n .ribbon-tabs button { min-height:44px; }\n .ribbon-content { min-height:54px; padding:4px 0; }\n .search-group { flex:0 0 100%; width:100%; min-height:54px; }\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 .page-rail { position:absolute; inset:0 auto 0 0; width:180px; max-height:none; z-index:3; border-right:1px solid var(--_vv-border); background:var(--_vv-secondary); }\n .page-list { flex-direction:column; }\n .page-list li { flex:none; }\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-group { order:1; flex:auto; }\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(pointer:coarse) { .ribbon-tabs {height:45px;min-height:45px;} .ribbon-tabs button {min-height:44px;height:44px;} }\n@media(prefers-reduced-motion:reduce) { * { scroll-behavior:auto !important; } }\n";
|
|
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-tabs { height:35px; display:flex; align-items:stretch; padding:0 4px; border-bottom:1px solid var(--_vv-border); }\n.ribbon-tabs button { position:relative; min-height:34px; padding:7px 14px; border:0; border-radius:0; background:transparent; color:var(--_vv-muted); font-size:12px; font-weight:500; }\n.ribbon-tabs button[aria-selected=\"true\"] { color:var(--_vv-accent); }\n.ribbon-tabs button[aria-selected=\"true\"]::after { content:\"\"; position:absolute; inset:auto 0 -1px; height:2.5px; background:var(--_vv-accent); }\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.search-group { width:330px; }\n.search-controls { display:flex; align-items:center; gap:4px; flex-wrap:wrap; }\n.search-controls label { display:flex; align-items:center; min-width:0; gap:6px; flex:1; font-size:11px; }\n.search-controls input { width:100%; min-width:0; padding:3px 6px; font-size:11px; }\n.search-controls button { padding:3px 6px; font-size:10px; background:var(--_vv-secondary); }\n.search-controls [role=\"status\"] { display:block; width:100%; min-height:15px; font-size:10px; line-height:15px; color:var(--_vv-muted); overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }\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-tabs { height:44px; }\n .ribbon-tabs button { min-height:44px; padding:8px 16px; }\n .ribbon-content { min-height:86px; }\n .ribbon-group { padding:4px 8px; }\n .search-group { width:100%; border-right:0; }\n .search-controls { gap:4px; }\n .search-controls label { font-size:12px; }\n .search-controls input { font-size:12px; }\n .search-controls button { min-width:44px; font-size:0; padding:3px; }\n .search-controls [data-action=\"search-previous\"]::before { content:\"\u2039\"; font-size:22px; }\n .search-controls [data-action=\"search-next\"]::before { content:\"\u203A\"; font-size:22px; }\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-tabs { min-height:44px; height:44px; }\n .ribbon-tabs button { min-height:44px; }\n .ribbon-content { min-height:96px; }\n .search-group { width:380px; max-width:100%; }\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-tabs { height:40px; }\n.ribbon-tabs button { min-height:39px; padding:8px 16px; }\n.ribbon-content { min-height:104px; padding:4px 4px; }\n.search-group { order:2; width:320px; }\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-tabs { height:44px; }\n .ribbon-tabs button { min-height:44px; }\n .ribbon-content { min-height:54px; padding:4px 0; }\n .search-group { flex:0 0 100%; width:100%; min-height:54px; }\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-group { order:1; flex:auto; }\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(pointer:coarse) { .ribbon-tabs {height:45px;min-height:45px;} .ribbon-tabs button {min-height:44px;height:44px;} }\n@media(prefers-reduced-motion:reduce) { * { scroll-behavior:auto !important; } }\n";
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
announce(message: string): void;
|
|
21
|
+
noteCount(): number;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Visio's File backstage: opened from the File tab, closed with Back or Escape (focus returns to
|
|
25
|
+
* File). Open, Save, Save As, Export, Print and Close are real; the rest is shown disabled.
|
|
26
|
+
*/
|
|
27
|
+
export declare class ViewerBackstage {
|
|
28
|
+
#private;
|
|
29
|
+
private readonly host;
|
|
30
|
+
constructor(host: BackstageHost);
|
|
31
|
+
get open(): boolean;
|
|
32
|
+
show(page?: BackstagePage): void;
|
|
33
|
+
hide(): void;
|
|
34
|
+
wire(): () => void;
|
|
35
|
+
render(state: ViewerState): void;
|
|
36
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
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,18 +1,21 @@
|
|
|
1
1
|
import type { ViewerController, ViewerState } from './controller.js';
|
|
2
2
|
/**
|
|
3
|
-
* Static workspace markup (legacy; migrate to builders when next changed). The ribbon,
|
|
4
|
-
* tabs and status bar are built by
|
|
5
|
-
* All
|
|
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
6
|
*/
|
|
7
|
-
export declare const viewerChromeTemplate = "<div class=\"workspace\">\n <
|
|
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';
|
|
8
9
|
/** Presentation state stays local; page navigation uses the same controller as every binding. */
|
|
9
10
|
export declare class ViewerChrome {
|
|
10
11
|
#private;
|
|
11
12
|
constructor(root: ShadowRoot, controller: ViewerController);
|
|
12
13
|
wire(): () => void;
|
|
13
|
-
showTab(tab:
|
|
14
|
+
showTab(tab: string): void;
|
|
15
|
+
/** On phones, close the Tools sheet once a command runs. */
|
|
16
|
+
closeCompactTools(): void;
|
|
14
17
|
/** Show or hide a task pane; compact layouts close the Tools menu afterwards. */
|
|
15
|
-
togglePane(pane:
|
|
18
|
+
togglePane(pane: TaskPane): void;
|
|
16
19
|
/** Open an inspector disclosure; text editing may focus the text field directly (F2). */
|
|
17
20
|
reveal(kind: 'notes' | 'selection' | 'edit' | 'layers', focusText?: boolean): void;
|
|
18
21
|
render(state: ViewerState, noteCount: number): void;
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import type { ViewerController, ViewerState } from './controller.js';
|
|
2
2
|
import { type VisioRibbonAction } from './ribbon-action.js';
|
|
3
|
+
import type { Rulers } from './viewer-ruler.js';
|
|
3
4
|
export type CanvasTool = 'pointer' | 'rectangle';
|
|
4
5
|
interface CommandHost {
|
|
5
6
|
root: ShadowRoot;
|
|
6
7
|
viewport: HTMLElement;
|
|
8
|
+
rulers: Rulers;
|
|
7
9
|
controller: ViewerController;
|
|
8
10
|
fit(mode: 'page' | 'width'): void;
|
|
9
|
-
togglePane(pane: '
|
|
11
|
+
togglePane(pane: 'shapes' | 'inspector'): void;
|
|
10
12
|
reveal(panel: 'edit' | 'notes' | 'selection' | 'layers', focusText: boolean): void;
|
|
11
13
|
focusSearch(): void;
|
|
14
|
+
togglePanZoom(): void;
|
|
12
15
|
/** Transient command feedback for the status bar; document text is never interpreted as markup. */
|
|
13
16
|
announce(message: string): void;
|
|
14
17
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
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;
|
|
@@ -2,6 +2,22 @@ import type { VisioPage } from 'ooxml-core/visio';
|
|
|
2
2
|
import type { ViewerController } from './controller.js';
|
|
3
3
|
/** Next free numeric shape ID on the page tree. Core still rejects any collision. */
|
|
4
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>;
|
|
5
21
|
/** Drag-to-draw rectangle tool. The preview is viewer-only; the shape is created by core. */
|
|
6
22
|
export declare class RectangleDrawTool {
|
|
7
23
|
#private;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { VisioDocument, VisioEdit } from 'ooxml-core/visio';
|
|
2
2
|
import type { VsdxSource } from './contract.js';
|
|
3
3
|
import { ViewerController } from './controller.js';
|
|
4
|
+
import { type BackstagePage } from './backstage.js';
|
|
4
5
|
import { type SvgExportOptions, type SvgExportResult } from './export-svg.js';
|
|
5
6
|
import { type CurrentPagePrintSnapshotOptions, type PrintSnapshot } from './print-snapshot.js';
|
|
6
7
|
declare const BaseElement: typeof HTMLElement;
|
|
@@ -18,6 +19,12 @@ export declare class VisioViewerElement extends BaseElement {
|
|
|
18
19
|
set showToolbar(value: boolean);
|
|
19
20
|
get renderWarnings(): readonly string[];
|
|
20
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;
|
|
21
28
|
applyEdits(edits: readonly VisioEdit[]): Promise<void>;
|
|
22
29
|
replacePlainText(pageId: string, shapeId: string, text: string): Promise<void>;
|
|
23
30
|
undo(): Promise<void>;
|
|
@@ -0,0 +1,6 @@
|
|
|
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;
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface Rulers {
|
|
2
|
+
element: HTMLElement;
|
|
3
|
+
render(visible: boolean, zoom: number): void;
|
|
4
|
+
wire(): () => void;
|
|
5
|
+
}
|
|
6
|
+
/** Wraps the viewport in a grid with a corner, a top ruler and a left ruler. */
|
|
7
|
+
export declare function createRulers(viewport: HTMLElement): Rulers;
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import type { ViewerState } from './controller.js';
|
|
2
2
|
/** Builds the Find group: a search field, previous/next result buttons and a live status. */
|
|
3
3
|
export declare function createSearchGroup(doc: Document): HTMLElement;
|
|
4
|
+
/**
|
|
5
|
+
* Visio opens Find from Home > Editing rather than keeping a box in the ribbon. The find bar
|
|
6
|
+
* sits under the ribbon, hidden until Find... or Ctrl+F, and closes with its button or Escape.
|
|
7
|
+
*/
|
|
8
|
+
export declare function createFindBar(doc: Document): HTMLElement;
|
|
9
|
+
/** The find bar closes from its button, or Escape once the query is already empty. */
|
|
10
|
+
export declare function wireFindBar(bar: HTMLElement, input: HTMLInputElement, closed: () => void): () => void;
|
|
4
11
|
export interface SearchControls {
|
|
5
12
|
input: HTMLInputElement;
|
|
6
13
|
status: HTMLSpanElement;
|
|
@@ -0,0 +1,6 @@
|
|
|
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;
|
|
@@ -0,0 +1,4 @@
|
|
|
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;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "visio-react-viewer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Local-first Visio viewer for react",
|
|
5
5
|
"homepage": "https://christophervr.github.io/visio-viewer/",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"emf-converter": "4.8.9",
|
|
31
31
|
"ooxml-core": "^0.13.0",
|
|
32
|
-
"ooxml-ui": "^0.
|
|
32
|
+
"ooxml-ui": "^0.8.0",
|
|
33
33
|
"visio-core": "^0.2.1"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|