ooxml-ui 1.4.1 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +59 -0
- package/dist/{chunk-FN3MBKHE.js → chunk-L7JV5FVE.js} +1 -1
- package/dist/{chunk-CXOK5QWQ.js → chunk-OGNNNTKI.js} +1 -1
- package/dist/{chunk-6YEWVS7I.js → chunk-PXIYHFZ5.js} +1 -1
- package/dist/{chunk-F23XSUJD.js → chunk-QAIVGTQZ.js} +3 -3
- package/dist/{chunk-J2WUY2Q4.js → chunk-QHAE6Y5B.js} +156 -8
- package/dist/{chunk-CEBFGUMT.js → chunk-Z7CS3UUK.js} +5 -4
- package/dist/controls.d.ts +4 -2
- package/dist/controls.d.ts.map +1 -1
- package/dist/controls.js +3 -3
- package/dist/docx.js +4 -4
- package/dist/export/pdf-pages.d.ts +29 -0
- package/dist/form/symbol-picker.d.ts +45 -0
- package/dist/form/symbol-picker.d.ts.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +6 -6
- package/dist/pptx/{chunk-TLLEKXWQ.mjs → chunk-C5MXTIGE.mjs} +138 -10
- package/dist/pptx/{chunk-SOHTHDYV.cjs → chunk-QLGH3VCC.cjs} +140 -8
- package/dist/pptx/dom/elements/text-block.d.ts.map +1 -1
- package/dist/pptx/dom/index.cjs +204 -200
- package/dist/pptx/dom/index.mjs +8 -4
- package/dist/pptx/index.cjs +2720 -2704
- package/dist/pptx/index.mjs +1 -1
- package/dist/pptx/render/element-action-affordance.d.ts +1 -1
- package/dist/pptx/render/element-action-affordance.d.ts.map +1 -1
- package/dist/pptx/render/index.d.ts +1 -0
- package/dist/pptx/render/index.d.ts.map +1 -1
- package/dist/pptx/render/paragraph-spacing.d.ts +21 -0
- package/dist/pptx/render/paragraph-spacing.d.ts.map +1 -1
- package/dist/pptx/render/presentation-action.d.ts.map +1 -1
- package/dist/pptx/render/table-cell-paragraphs.d.ts.map +1 -1
- package/dist/pptx/render/table-style.d.ts +6 -0
- package/dist/pptx/render/table-style.d.ts.map +1 -1
- package/dist/pptx/render/text-paragraphs.d.ts.map +1 -1
- package/dist/pptx/render/text-run-meta.d.ts +2 -0
- package/dist/pptx/render/text-run-meta.d.ts.map +1 -1
- package/dist/pptx/render/viewer-hyperlinks.d.ts +34 -0
- package/dist/pptx/render/viewer-hyperlinks.d.ts.map +1 -0
- package/dist/presence.js +2 -2
- package/dist/ribbon/gallery.d.ts.map +1 -1
- package/dist/smartart.js +2 -2
- package/dist/teams.js +4 -4
- package/dist/visio/controller.d.ts +11 -0
- package/dist/visio/format-shape-dialog.d.ts +21 -0
- package/dist/visio/page-setup-action.d.ts +29 -0
- package/dist/visio/page-setup-dialog-form.d.ts +32 -0
- package/dist/visio/presentation-keys.d.ts +41 -0
- package/dist/visio/render-effects.d.ts +10 -0
- package/dist/visio/render-shadow.d.ts +7 -0
- package/dist/visio/ribbon-action.d.ts +97 -4
- package/dist/visio/ribbon-change-shape.d.ts +11 -0
- package/dist/visio/ribbon-diagram-parts.d.ts +14 -0
- package/dist/visio/ribbon-layout.d.ts +11 -0
- package/dist/visio/ribbon-other-tabs.d.ts +2 -5
- package/dist/visio/ribbon-page-setup.d.ts +12 -0
- package/dist/visio/ribbon-parts.d.ts +1 -0
- package/dist/visio/ribbon-review.d.ts +4 -0
- package/dist/visio/ribbon-router.d.ts +29 -1
- package/dist/visio/ribbon-shape-styles.d.ts +17 -0
- package/dist/visio/ribbon-themes.d.ts +17 -0
- package/dist/visio/ribbon-view.d.ts +1 -1
- package/dist/visio/shapes-sections.d.ts +12 -0
- package/dist/visio/shapes-window.d.ts +3 -20
- package/dist/visio/stencil-catalog.d.ts +47 -0
- package/dist/visio/styles.d.ts +1 -1
- package/dist/visio/text-run-style.d.ts +9 -0
- package/dist/visio/viewer-backstage.d.ts +7 -0
- package/dist/visio/viewer-change-shape.d.ts +16 -0
- package/dist/visio/viewer-chrome.d.ts +1 -1
- package/dist/visio/viewer-commands.d.ts +6 -0
- package/dist/visio/viewer-comment-threads.d.ts +17 -0
- package/dist/visio/viewer-comments.d.ts +25 -0
- package/dist/visio/viewer-connection-points.d.ts +31 -0
- package/dist/visio/viewer-connector-routes.d.ts +24 -0
- package/dist/visio/viewer-connector-tool.d.ts +42 -0
- package/dist/visio/viewer-data-import.d.ts +31 -0
- package/dist/visio/viewer-data-links.d.ts +25 -0
- package/dist/visio/viewer-data-sources.d.ts +23 -0
- package/dist/visio/viewer-data-window.d.ts +17 -0
- package/dist/visio/viewer-data.d.ts +28 -0
- package/dist/visio/viewer-diagram-parts.d.ts +17 -0
- package/dist/visio/viewer-dialog.d.ts +31 -0
- package/dist/visio/viewer-draw-tool.d.ts +21 -3
- package/dist/visio/viewer-drawing-gesture.d.ts +6 -4
- package/dist/visio/viewer-edit-controls.d.ts +1 -1
- package/dist/visio/viewer-element.d.ts +5 -0
- package/dist/visio/viewer-explorer.d.ts +17 -0
- package/dist/visio/viewer-export.d.ts +17 -0
- package/dist/visio/viewer-format-painter.d.ts +20 -0
- package/dist/visio/viewer-format-shape.d.ts +16 -0
- package/dist/visio/viewer-grouping.d.ts +13 -0
- package/dist/visio/viewer-guides.d.ts +27 -0
- package/dist/visio/viewer-insert-dialog.d.ts +41 -0
- package/dist/visio/viewer-insert.d.ts +25 -0
- package/dist/visio/viewer-issues.d.ts +29 -0
- package/dist/visio/viewer-layer-assign.d.ts +17 -0
- package/dist/visio/viewer-layout-commands.d.ts +41 -0
- package/dist/visio/viewer-layout.d.ts +24 -0
- package/dist/visio/viewer-page-breaks.d.ts +6 -0
- package/dist/visio/viewer-page-setup-dialog.d.ts +20 -0
- package/dist/visio/viewer-page-setup.d.ts +23 -0
- package/dist/visio/viewer-paste-special.d.ts +18 -0
- package/dist/visio/viewer-pointer-gestures.d.ts +5 -0
- package/dist/visio/viewer-presentation.d.ts +29 -0
- package/dist/visio/viewer-review.d.ts +23 -0
- package/dist/visio/viewer-select-type.d.ts +16 -0
- package/dist/visio/viewer-shape-data.d.ts +16 -0
- package/dist/visio/viewer-shape-report.d.ts +26 -0
- package/dist/visio/viewer-shape-styles.d.ts +9 -0
- package/dist/visio/viewer-shape-target.d.ts +7 -0
- package/dist/visio/viewer-stencil.d.ts +1 -1
- package/dist/visio/viewer-subprocess.d.ts +22 -0
- package/dist/visio/viewer-text-block.d.ts +23 -0
- package/dist/visio/viewer-text-dialog.d.ts +24 -0
- package/dist/visio/viewer-text-features.d.ts +24 -0
- package/dist/visio/viewer-text-insert.d.ts +28 -0
- package/dist/visio/viewer-themes.d.ts +16 -0
- package/dist/visio.js +14639 -6443
- package/dist/xlsx.js +7 -7
- package/package.json +2 -2
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { VisioDocument } from 'ooxml-core/visio';
|
|
2
|
+
/** Raster resolution of PDF and PNG output; large pages are scaled down to the canvas cap. */
|
|
3
|
+
export declare const EXPORT_DPI = 150;
|
|
4
|
+
/** Pixel size of a page at `dpi`, scaled down so neither side exceeds the canvas cap. */
|
|
5
|
+
export declare function rasterSize(widthIn: number, heightIn: number, dpi?: number): {
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
|
+
};
|
|
9
|
+
/** Draw one exported page SVG on a white canvas. Resolves once the image has loaded. */
|
|
10
|
+
export declare function rasterizePage(doc: Document, model: VisioDocument, pageIndex: number, dpi?: number): Promise<HTMLCanvasElement>;
|
|
11
|
+
/** The current page as a PNG picture. */
|
|
12
|
+
export declare function exportPagePng(doc: Document, model: VisioDocument, pageIndex: number): Promise<Blob>;
|
|
13
|
+
/**
|
|
14
|
+
* Every foreground page (with its background pages) as one raster PDF page of the drawing's
|
|
15
|
+
* page size. Text is not selectable: the pages are pictures, not vector PDF.
|
|
16
|
+
*/
|
|
17
|
+
export declare function exportDocumentPdf(doc: Document, model: VisioDocument): Promise<Blob>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ViewerController, ViewerState } from './controller.js';
|
|
2
|
+
export type FormatPainterMode = 'once' | 'sticky' | 'cancel';
|
|
3
|
+
/**
|
|
4
|
+
* Visio's Format Painter: a click copies the selected shape's formatting and applies it once to
|
|
5
|
+
* the next selection; a double click keeps it on until Escape or another click on the button.
|
|
6
|
+
* Each application is one atomic, undoable edit of existing core format commands.
|
|
7
|
+
*/
|
|
8
|
+
export declare class ViewerFormatPainter {
|
|
9
|
+
#private;
|
|
10
|
+
private readonly root;
|
|
11
|
+
private readonly controller;
|
|
12
|
+
private readonly announce;
|
|
13
|
+
private readonly edit;
|
|
14
|
+
constructor(root: ShadowRoot, controller: ViewerController, announce: (message: string) => void, edit: (run: () => Promise<void>, success: string) => void);
|
|
15
|
+
get armed(): boolean;
|
|
16
|
+
/** Double clicking the button keeps the painter on (the second click arrives first). */
|
|
17
|
+
wire(): () => void;
|
|
18
|
+
run(mode: FormatPainterMode): void;
|
|
19
|
+
render(state: ViewerState): void;
|
|
20
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ViewerController, ViewerState } from './controller.js';
|
|
2
|
+
/**
|
|
3
|
+
* Home > Shape Styles dialog launcher: Visio's Format Shape with Fill, Line and Effects sections.
|
|
4
|
+
* Every change becomes one undoable format-shape edit per selected shape.
|
|
5
|
+
*/
|
|
6
|
+
export declare class ViewerFormatShape {
|
|
7
|
+
#private;
|
|
8
|
+
private readonly root;
|
|
9
|
+
private readonly controller;
|
|
10
|
+
private readonly announce;
|
|
11
|
+
constructor(root: ShadowRoot, controller: ViewerController, announce: (message: string) => void);
|
|
12
|
+
wire(): () => void;
|
|
13
|
+
show(): void;
|
|
14
|
+
close(): void;
|
|
15
|
+
render(state: ViewerState): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ViewerController, ViewerState } from './controller.js';
|
|
2
|
+
type Operation = 'group' | 'ungroup';
|
|
3
|
+
/** Group and Ungroup availability; the controller owns the transaction and new selection. */
|
|
4
|
+
export declare class ViewerGrouping {
|
|
5
|
+
private readonly root;
|
|
6
|
+
private readonly controller;
|
|
7
|
+
private readonly edit;
|
|
8
|
+
constructor(root: ShadowRoot, controller: ViewerController, edit: (run: () => Promise<void>, message: string) => void);
|
|
9
|
+
private reason;
|
|
10
|
+
run(operation: Operation): void;
|
|
11
|
+
render(state: ViewerState): void;
|
|
12
|
+
}
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { VisioPage } from 'ooxml-core/visio';
|
|
2
|
+
import { type VisioPagePoint } from 'ooxml-core/visio/ui';
|
|
3
|
+
import type { ViewerController, ViewerState } from './controller.js';
|
|
4
|
+
/**
|
|
5
|
+
* View > Guides and View > Dynamic Grid. Guides are the page's `Type="Guide"` shapes, drawn as
|
|
6
|
+
* dashed lines when Guides is on: drag from the top ruler for a horizontal guide or the left
|
|
7
|
+
* ruler for a vertical one, drag a guide to move it, click it and press Delete to remove it.
|
|
8
|
+
* Each is one source edit. Moving shapes snaps to shown guides and, with Dynamic Grid, to other
|
|
9
|
+
* shapes' edges and centres, showing alignment hints while dragging.
|
|
10
|
+
*/
|
|
11
|
+
export declare class ViewerGuides {
|
|
12
|
+
#private;
|
|
13
|
+
private readonly root;
|
|
14
|
+
private readonly viewport;
|
|
15
|
+
private readonly rulers;
|
|
16
|
+
private readonly controller;
|
|
17
|
+
private readonly announce;
|
|
18
|
+
constructor(root: ShadowRoot, viewport: HTMLElement, rulers: HTMLElement, controller: ViewerController, announce: (message: string) => void);
|
|
19
|
+
get shown(): boolean;
|
|
20
|
+
toggleGuides(): void;
|
|
21
|
+
toggleDynamicGrid(): void;
|
|
22
|
+
/** Snap a shape drag; draws alignment hints. Unchanged when no snapping is active. */
|
|
23
|
+
snap(page: VisioPage, ids: readonly string[], delta: VisioPagePoint): VisioPagePoint;
|
|
24
|
+
clearHints(): void;
|
|
25
|
+
wire(): () => void;
|
|
26
|
+
render(state: ViewerState): void;
|
|
27
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
type Dialog = HTMLElement & {
|
|
2
|
+
open: boolean;
|
|
3
|
+
show(): void;
|
|
4
|
+
close(): void;
|
|
5
|
+
};
|
|
6
|
+
type Button = HTMLElement & {
|
|
7
|
+
disabled: boolean;
|
|
8
|
+
};
|
|
9
|
+
export interface FieldSpec {
|
|
10
|
+
name: string;
|
|
11
|
+
label: string;
|
|
12
|
+
/** A select lists choices; a text field accepts at most `maxLength` characters. */
|
|
13
|
+
choices?: boolean;
|
|
14
|
+
maxLength?: number;
|
|
15
|
+
placeholder?: string;
|
|
16
|
+
/** A checkbox (read with `checked`) or a number field instead of text. */
|
|
17
|
+
input?: 'checkbox' | 'number';
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* A small form on the shared `office-ui-dialog` shell: labelled fields, an alert line and footer
|
|
21
|
+
* buttons. Enter in a text field presses the first button. Document semantics stay with callers.
|
|
22
|
+
*/
|
|
23
|
+
export declare class InsertDialog {
|
|
24
|
+
readonly dialog: Dialog;
|
|
25
|
+
readonly error: HTMLElement;
|
|
26
|
+
readonly fields: Map<string, HTMLInputElement | HTMLSelectElement>;
|
|
27
|
+
readonly buttons: Map<string, Button>;
|
|
28
|
+
constructor(root: ShadowRoot, className: string, heading: string, specs: readonly FieldSpec[], buttons: readonly string[], press: (button: string) => void);
|
|
29
|
+
value(name: string): string;
|
|
30
|
+
checked(name: string): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Replace a select's choices; the current value is kept as an extra choice when unknown.
|
|
33
|
+
* `labels` names each value; `none: false` drops the leading empty choice.
|
|
34
|
+
*/
|
|
35
|
+
choices(name: string, values: readonly string[], current: string, options?: {
|
|
36
|
+
labels?: readonly string[];
|
|
37
|
+
none?: boolean;
|
|
38
|
+
}): void;
|
|
39
|
+
busy(value: boolean): void;
|
|
40
|
+
}
|
|
41
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ViewerController, ViewerState } from './controller.js';
|
|
2
|
+
import type { VisioInsertItem } from './ribbon-action.js';
|
|
3
|
+
import { InsertDialog } from './viewer-insert-dialog.js';
|
|
4
|
+
type Run = (action: () => Promise<void>, success: string) => void;
|
|
5
|
+
/**
|
|
6
|
+
* Insert-tab Pictures, Link and ScreenTip, plus Ctrl+click link following. Pictures are read
|
|
7
|
+
* from a local file only; links open in a new tab with noopener and never navigate the app.
|
|
8
|
+
*/
|
|
9
|
+
export declare class ViewerInsert {
|
|
10
|
+
#private;
|
|
11
|
+
private readonly root;
|
|
12
|
+
private readonly controller;
|
|
13
|
+
private readonly announce;
|
|
14
|
+
private readonly run;
|
|
15
|
+
readonly input: HTMLInputElement;
|
|
16
|
+
readonly link: InsertDialog;
|
|
17
|
+
readonly tip: InsertDialog;
|
|
18
|
+
constructor(root: ShadowRoot, controller: ViewerController, announce: (message: string) => void, run: Run);
|
|
19
|
+
open(item: VisioInsertItem): void;
|
|
20
|
+
close(): void;
|
|
21
|
+
/** Ctrl+click follows a shape's link like Visio; Shift keeps additive selection. */
|
|
22
|
+
wire(viewport: HTMLElement): () => void;
|
|
23
|
+
render(state: ViewerState): void;
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type VisioDiagramIssue, type VisioRuleSetId } from 'ooxml-core/visio/ui';
|
|
2
|
+
import type { ViewerController, ViewerState } from './controller.js';
|
|
3
|
+
/**
|
|
4
|
+
* Process > Check Diagram, the Issues window and Ignore This Issue. The rules are the core's
|
|
5
|
+
* generic ones. Ignored issues last for this session only: Visio keeps them in the document's
|
|
6
|
+
* Validation part with its own rule sets, which this viewer does not write.
|
|
7
|
+
*/
|
|
8
|
+
export declare class ViewerIssues {
|
|
9
|
+
#private;
|
|
10
|
+
private readonly root;
|
|
11
|
+
private readonly controller;
|
|
12
|
+
private readonly announce;
|
|
13
|
+
readonly host: HTMLElement;
|
|
14
|
+
readonly list: HTMLUListElement;
|
|
15
|
+
readonly summary: HTMLParagraphElement;
|
|
16
|
+
readonly showIgnored: HTMLInputElement;
|
|
17
|
+
constructor(root: ShadowRoot, controller: ViewerController, announce: (message: string) => void);
|
|
18
|
+
get open(): boolean;
|
|
19
|
+
get issues(): readonly VisioDiagramIssue[];
|
|
20
|
+
get ignored(): ReadonlySet<string>;
|
|
21
|
+
show(open?: boolean): void;
|
|
22
|
+
toggleRuleSet(id: VisioRuleSetId): void;
|
|
23
|
+
/** Check Diagram: run the enabled rule sets over every foreground page. */
|
|
24
|
+
check(): void;
|
|
25
|
+
/** Ignore This Issue: hide the selected issue (or the first visible one) for this session. */
|
|
26
|
+
ignore(): void;
|
|
27
|
+
wire(): () => void;
|
|
28
|
+
render(state: ViewerState): void;
|
|
29
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ViewerController, ViewerState } from './controller.js';
|
|
2
|
+
import { ViewerDialog } from './viewer-dialog.js';
|
|
3
|
+
/**
|
|
4
|
+
* Home > Editing > Layers > Assign to Layer: checkboxes for the page's layers (mixed membership
|
|
5
|
+
* starts indeterminate and is kept unless changed) and a New layer field. OK commits one
|
|
6
|
+
* `assign-layers` source edit, so assignment and new layers undo together.
|
|
7
|
+
*/
|
|
8
|
+
export declare class ViewerLayerAssign {
|
|
9
|
+
#private;
|
|
10
|
+
private readonly root;
|
|
11
|
+
private readonly controller;
|
|
12
|
+
private readonly announce;
|
|
13
|
+
readonly dialog: ViewerDialog;
|
|
14
|
+
constructor(root: ShadowRoot, controller: ViewerController, announce: (message: string) => void);
|
|
15
|
+
open(): void;
|
|
16
|
+
render(state: ViewerState): void;
|
|
17
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { ViewerController, ViewerState } from './controller.js';
|
|
2
|
+
import type { VisioLayoutAction } from './ribbon-action.js';
|
|
3
|
+
import { ViewerExplorer } from './viewer-explorer.js';
|
|
4
|
+
import { ViewerGuides } from './viewer-guides.js';
|
|
5
|
+
import { ViewerLayerAssign } from './viewer-layer-assign.js';
|
|
6
|
+
import { ViewerLayout } from './viewer-layout.js';
|
|
7
|
+
import { ViewerPasteSpecial } from './viewer-paste-special.js';
|
|
8
|
+
import { ViewerSelectType } from './viewer-select-type.js';
|
|
9
|
+
/** Where Help and Show Training lead: the viewer's own guide, not Microsoft's help. */
|
|
10
|
+
export declare const VISIO_GUIDE_URL = "https://christophervr.github.io/ooxml/visio/";
|
|
11
|
+
export interface LayoutCommandHost {
|
|
12
|
+
root: ShadowRoot;
|
|
13
|
+
viewport: HTMLElement;
|
|
14
|
+
/** The drawing window wrapper holding the rulers. */
|
|
15
|
+
rulers: HTMLElement;
|
|
16
|
+
controller: ViewerController;
|
|
17
|
+
announce(message: string): void;
|
|
18
|
+
/** The command runner shared with the other ribbon commands (status and focus handling). */
|
|
19
|
+
edit(run: () => Promise<void>, message: string): void;
|
|
20
|
+
/** Paste the viewer's own shape clipboard, as Ctrl+V does. */
|
|
21
|
+
pasteShapes(): Promise<void>;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Arrangement, layout, layers, selection, view aids and help commands: Auto Align & Space,
|
|
25
|
+
* Re-Layout Page and its Layout dialog, Assign to Layer, Select by Type, Paste Special, Guides,
|
|
26
|
+
* Dynamic Grid, Drawing Explorer, Help and Show Training.
|
|
27
|
+
*/
|
|
28
|
+
export declare class ViewerLayoutCommands {
|
|
29
|
+
private readonly host;
|
|
30
|
+
readonly layout: ViewerLayout;
|
|
31
|
+
readonly layers: ViewerLayerAssign;
|
|
32
|
+
readonly select: ViewerSelectType;
|
|
33
|
+
readonly paste: ViewerPasteSpecial;
|
|
34
|
+
readonly guides: ViewerGuides;
|
|
35
|
+
readonly explorer: ViewerExplorer;
|
|
36
|
+
constructor(host: LayoutCommandHost);
|
|
37
|
+
run(action: VisioLayoutAction): void;
|
|
38
|
+
wire(): () => void;
|
|
39
|
+
close(): void;
|
|
40
|
+
render(state: ViewerState): void;
|
|
41
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type VisioLayoutStyle } from 'ooxml-core/visio/ui';
|
|
2
|
+
import type { ViewerController, ViewerState } from './controller.js';
|
|
3
|
+
import { ViewerDialog } from './viewer-dialog.js';
|
|
4
|
+
type Run = (action: () => Promise<void>, message: string) => void;
|
|
5
|
+
/**
|
|
6
|
+
* Home > Arrange > Auto Align & Space and Design > Re-Layout Page with its Layout dialog. Both
|
|
7
|
+
* act on the selection (two or more shapes) or the whole page and commit one move batch, so a
|
|
8
|
+
* layout is a single undo step. Glued connectors follow through core glue recalculation.
|
|
9
|
+
*/
|
|
10
|
+
export declare class ViewerLayout {
|
|
11
|
+
#private;
|
|
12
|
+
private readonly root;
|
|
13
|
+
private readonly controller;
|
|
14
|
+
private readonly run;
|
|
15
|
+
readonly options: ViewerDialog;
|
|
16
|
+
constructor(root: ShadowRoot, controller: ViewerController, run: Run);
|
|
17
|
+
autoAlign(): void;
|
|
18
|
+
reLayout(style: VisioLayoutStyle, spacing?: number): void;
|
|
19
|
+
showOptions(): void;
|
|
20
|
+
render(state: ViewerState): void;
|
|
21
|
+
/** Whether Position can open for Auto Align & Space. */
|
|
22
|
+
available(state: ViewerState): boolean;
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { VisioPageBreaks } from 'ooxml-core/visio/ui';
|
|
2
|
+
/**
|
|
3
|
+
* View > Page Breaks: dashed lines where printed sheets split the page. The overlay is viewer
|
|
4
|
+
* chrome in page inches (the paper's viewBox), never document content, and is not exported.
|
|
5
|
+
*/
|
|
6
|
+
export declare function drawPageBreaks(svg: SVGSVGElement, breaks: VisioPageBreaks | undefined): void;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { VisioEdit, VisioPage } from 'ooxml-core/visio';
|
|
2
|
+
import type { ViewerController, ViewerState } from './controller.js';
|
|
3
|
+
import type { VisioPageSetupTab } from './page-setup-action.js';
|
|
4
|
+
/**
|
|
5
|
+
* Visio's Page Setup dialog (Design > Page Setup launcher, File > Print > Page Setup). OK commits
|
|
6
|
+
* one page transaction; Size to fit drawing contents follows as a second step because it also
|
|
7
|
+
* moves shapes. The core refuses formulas and locks it cannot prove.
|
|
8
|
+
*/
|
|
9
|
+
export declare class ViewerPageSetupDialog {
|
|
10
|
+
#private;
|
|
11
|
+
private readonly controller;
|
|
12
|
+
private readonly announce;
|
|
13
|
+
constructor(root: ShadowRoot, controller: ViewerController, announce?: (message: string) => void);
|
|
14
|
+
get element(): HTMLElement;
|
|
15
|
+
show(tab?: VisioPageSetupTab): void;
|
|
16
|
+
close(): void;
|
|
17
|
+
render(state: ViewerState): void;
|
|
18
|
+
/** The page transaction the form describes, or a message for the first invalid field. */
|
|
19
|
+
edits(page: VisioPage): VisioEdit[] | string;
|
|
20
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ViewerController, ViewerState } from './controller.js';
|
|
2
|
+
import type { VisioPageSetupCommand } from './page-setup-action.js';
|
|
3
|
+
import { ViewerPageSetupDialog } from './viewer-page-setup-dialog.js';
|
|
4
|
+
type Edit = (run: () => Promise<void>, message: string) => void;
|
|
5
|
+
/**
|
|
6
|
+
* Design > Page Setup and Backgrounds, File > Page Setup and View > Page Breaks. Every change is
|
|
7
|
+
* one source-backed core edit, so undo and redo come from the document history; locks, formulas
|
|
8
|
+
* and unmanaged background pages are refused by the core with its reason.
|
|
9
|
+
*/
|
|
10
|
+
export declare class ViewerPageSetup {
|
|
11
|
+
#private;
|
|
12
|
+
private readonly root;
|
|
13
|
+
private readonly controller;
|
|
14
|
+
private readonly edit;
|
|
15
|
+
private readonly announce;
|
|
16
|
+
readonly dialog: ViewerPageSetupDialog;
|
|
17
|
+
constructor(root: ShadowRoot, controller: ViewerController, edit: Edit, announce: (message: string) => void);
|
|
18
|
+
get pageBreaks(): boolean;
|
|
19
|
+
run(command: VisioPageSetupCommand): void;
|
|
20
|
+
wire(): () => void;
|
|
21
|
+
render(state: ViewerState): void;
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ViewerController, ViewerState } from './controller.js';
|
|
2
|
+
import { ViewerDialog } from './viewer-dialog.js';
|
|
3
|
+
/**
|
|
4
|
+
* Home > Clipboard > Paste Special: paste the clipboard as Visio shapes (the viewer's own shape
|
|
5
|
+
* clipboard), as unformatted text in a new text box, or as a picture (PNG, JPEG or GIF through
|
|
6
|
+
* the picture insertion edit). Reading the clipboard needs the browser's permission.
|
|
7
|
+
*/
|
|
8
|
+
export declare class ViewerPasteSpecial {
|
|
9
|
+
#private;
|
|
10
|
+
private readonly root;
|
|
11
|
+
private readonly controller;
|
|
12
|
+
private readonly announce;
|
|
13
|
+
private readonly pasteShapes;
|
|
14
|
+
readonly dialog: ViewerDialog;
|
|
15
|
+
constructor(root: ShadowRoot, controller: ViewerController, announce: (message: string) => void, pasteShapes: () => Promise<void>);
|
|
16
|
+
open(): void;
|
|
17
|
+
render(state: ViewerState): void;
|
|
18
|
+
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { VisioPage } from 'ooxml-core/visio';
|
|
2
|
+
import { type VisioPagePoint } from 'ooxml-core/visio/ui';
|
|
1
3
|
import type { ViewerController, ViewerState } from './controller.js';
|
|
2
4
|
/** Direct pointer movement and full-enclosure marquee; release is the only source edit. */
|
|
3
5
|
export declare class ViewerPointerGestures {
|
|
@@ -8,6 +10,9 @@ export declare class ViewerPointerGestures {
|
|
|
8
10
|
constructor(viewport: HTMLElement, controller: ViewerController, options: {
|
|
9
11
|
active(): boolean;
|
|
10
12
|
announce(message: string): void;
|
|
13
|
+
/** Guides and Dynamic Grid: adjust a drag delta and show alignment hints. */
|
|
14
|
+
snap?(page: VisioPage, ids: readonly string[], delta: VisioPagePoint): VisioPagePoint;
|
|
15
|
+
clearSnap?(): void;
|
|
11
16
|
});
|
|
12
17
|
render(state: ViewerState): void;
|
|
13
18
|
wire(): () => void;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { VisioDocument, VisioPage } from 'ooxml-core/visio';
|
|
2
|
+
import type { ViewerController, ViewerState } from './controller.js';
|
|
3
|
+
/** Visio presents foreground pages only; background pages appear under the pages using them. */
|
|
4
|
+
export declare function presentationPages(document: VisioDocument | null | undefined): VisioPage[];
|
|
5
|
+
/** The chrome-free presentation surface: a stage, a page indicator and previous/next/exit. */
|
|
6
|
+
export declare function createPresentation(doc: Document): HTMLElement;
|
|
7
|
+
/**
|
|
8
|
+
* Visio's Presentation Mode (F5): the current foreground page fitted to the screen on a dark
|
|
9
|
+
* backdrop, read only, one page at a time. It renders its own copy of each page, so the drawing
|
|
10
|
+
* window's page, zoom and selection are never touched and are exactly as before on exit. The
|
|
11
|
+
* Fullscreen API is used when the browser allows it; otherwise the overlay covers the window.
|
|
12
|
+
*/
|
|
13
|
+
export declare class ViewerPresentation {
|
|
14
|
+
#private;
|
|
15
|
+
private readonly root;
|
|
16
|
+
private readonly controller;
|
|
17
|
+
readonly overlay: HTMLElement;
|
|
18
|
+
constructor(root: ShadowRoot, controller: ViewerController);
|
|
19
|
+
get active(): boolean;
|
|
20
|
+
/** 0-based position among the foreground pages, while presenting. */
|
|
21
|
+
get index(): number;
|
|
22
|
+
start(): void;
|
|
23
|
+
exit(): void;
|
|
24
|
+
/** Move to a 0-based foreground page, clamped. */
|
|
25
|
+
go(index: number): void;
|
|
26
|
+
wire(): () => void;
|
|
27
|
+
/** Sync the entry points and, while presenting, the shown page with the controller state. */
|
|
28
|
+
render(state: ViewerState): void;
|
|
29
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ViewerController, ViewerState } from './controller.js';
|
|
2
|
+
import type { VisioRibbonAction } from './ribbon-action.js';
|
|
3
|
+
import { ViewerComments } from './viewer-comments.js';
|
|
4
|
+
import { ViewerIssues } from './viewer-issues.js';
|
|
5
|
+
import { ViewerShapeReport } from './viewer-shape-report.js';
|
|
6
|
+
import { ViewerSubprocess } from './viewer-subprocess.js';
|
|
7
|
+
type Run = (action: () => Promise<void>, success: string) => void;
|
|
8
|
+
type ReviewAction = Extract<VisioRibbonAction, {
|
|
9
|
+
type: 'review';
|
|
10
|
+
}>;
|
|
11
|
+
/** Review and Process tab commands: comments, shape reports, diagram checks and subprocesses. */
|
|
12
|
+
export declare class ViewerReview {
|
|
13
|
+
private readonly root;
|
|
14
|
+
readonly comments: ViewerComments;
|
|
15
|
+
readonly issues: ViewerIssues;
|
|
16
|
+
readonly report: ViewerShapeReport;
|
|
17
|
+
readonly subprocess: ViewerSubprocess;
|
|
18
|
+
constructor(root: ShadowRoot, viewport: HTMLElement, controller: ViewerController, announce: (message: string) => void, run: Run);
|
|
19
|
+
run(action: ReviewAction): void;
|
|
20
|
+
wire(): () => void;
|
|
21
|
+
render(state: ViewerState): void;
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ViewerController, ViewerState } from './controller.js';
|
|
2
|
+
import { ViewerDialog } from './viewer-dialog.js';
|
|
3
|
+
/**
|
|
4
|
+
* Home > Editing > Select > Select by Type: select the page's shapes by shape type, by layer or
|
|
5
|
+
* by master. Selection only: nothing is edited, so this works on read-only drawings too.
|
|
6
|
+
*/
|
|
7
|
+
export declare class ViewerSelectType {
|
|
8
|
+
#private;
|
|
9
|
+
private readonly root;
|
|
10
|
+
private readonly controller;
|
|
11
|
+
private readonly announce;
|
|
12
|
+
readonly dialog: ViewerDialog;
|
|
13
|
+
constructor(root: ShadowRoot, controller: ViewerController, announce: (message: string) => void);
|
|
14
|
+
open(): void;
|
|
15
|
+
render(state: ViewerState): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ViewerController, ViewerState } from './controller.js';
|
|
2
|
+
import { InsertDialog } from './viewer-insert-dialog.js';
|
|
3
|
+
/**
|
|
4
|
+
* Visio's Define Shape Data dialog: add, change and delete the selected shape's Shape Data rows
|
|
5
|
+
* (label, type, format, value, prompt, hidden). Each change is one undoable core edit.
|
|
6
|
+
*/
|
|
7
|
+
export declare class ViewerShapeData {
|
|
8
|
+
#private;
|
|
9
|
+
private readonly root;
|
|
10
|
+
private readonly controller;
|
|
11
|
+
private readonly announce;
|
|
12
|
+
readonly form: InsertDialog;
|
|
13
|
+
constructor(root: ShadowRoot, controller: ViewerController, announce: (message: string) => void);
|
|
14
|
+
open(): void;
|
|
15
|
+
render(state: ViewerState): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type VisioShapeReport } from 'ooxml-core/visio/ui';
|
|
2
|
+
import type { ViewerController } from './controller.js';
|
|
3
|
+
type Dialog = HTMLElement & {
|
|
4
|
+
open: boolean;
|
|
5
|
+
show(): void;
|
|
6
|
+
close(): void;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Review > Shape Reports: a table of every shape on the current page or in the drawing, with
|
|
10
|
+
* Export CSV (a local download) and Copy (tab-separated text). The report itself is built in core.
|
|
11
|
+
*/
|
|
12
|
+
export declare class ViewerShapeReport {
|
|
13
|
+
#private;
|
|
14
|
+
private readonly root;
|
|
15
|
+
private readonly controller;
|
|
16
|
+
private readonly announce;
|
|
17
|
+
readonly dialog: Dialog;
|
|
18
|
+
readonly scope: HTMLSelectElement;
|
|
19
|
+
readonly table: HTMLTableElement;
|
|
20
|
+
readonly status: HTMLElement;
|
|
21
|
+
constructor(root: ShadowRoot, controller: ViewerController, announce: (message: string) => void);
|
|
22
|
+
get report(): VisioShapeReport | undefined;
|
|
23
|
+
show(): void;
|
|
24
|
+
dispose(): void;
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type VisioPage, type VisioShape } from 'ooxml-core/visio';
|
|
2
|
+
import type { RibbonCommand } from './ribbon-parts.js';
|
|
3
|
+
/** Accent 1-6 of the page theme, or the Office colours a theme-less drawing uses. */
|
|
4
|
+
export declare function pageAccentColor(page: VisioPage | undefined, accent: number): string;
|
|
5
|
+
/**
|
|
6
|
+
* Selection state for Home > Shape Styles: the Quick Styles gallery and the Effects presets follow
|
|
7
|
+
* the same admission as Fill and Line. Bevel and 3-D Rotation keep their reasons.
|
|
8
|
+
*/
|
|
9
|
+
export declare function renderShapeStyleControls(root: ShadowRoot, shapes: readonly VisioShape[], reason: string, set: (element: RibbonCommand | null, reason: string) => void, page?: VisioPage): void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { VisioShapeSelection } from 'ooxml-core/visio/ui';
|
|
2
|
+
/**
|
|
3
|
+
* The shape a pointer selects, as in Visio: the first click on a group member selects the
|
|
4
|
+
* outermost group; clicking again inside a selected group subselects one level deeper.
|
|
5
|
+
* Additive clicks always use the outermost group.
|
|
6
|
+
*/
|
|
7
|
+
export declare function pointerShapeTarget(node: EventTarget | null, selected: readonly Pick<VisioShapeSelection, 'id'>[], additive?: boolean): SVGGElement | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ViewerController } from './controller.js';
|
|
2
2
|
/**
|
|
3
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.
|
|
4
|
+
* it at the page centre. Ellipses and circles are native ellipses; the rest are core outlines.
|
|
5
5
|
*/
|
|
6
6
|
export declare function wireStencil(pane: HTMLElement, viewport: HTMLElement, controller: ViewerController, announce: (message: string) => void): () => void;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ViewerController, ViewerState } from './controller.js';
|
|
2
|
+
import { InsertDialog } from './viewer-insert-dialog.js';
|
|
3
|
+
type Run = (action: () => Promise<void>, success: string) => void;
|
|
4
|
+
type Mode = 'new' | 'selection' | 'existing';
|
|
5
|
+
/**
|
|
6
|
+
* Process > Subprocess. Create New and Create from Selection are one core transaction (one undo
|
|
7
|
+
* step); Link to Existing adds a hyperlink to a chosen page. Links follow with Ctrl+click.
|
|
8
|
+
*/
|
|
9
|
+
export declare class ViewerSubprocess {
|
|
10
|
+
#private;
|
|
11
|
+
private readonly root;
|
|
12
|
+
private readonly controller;
|
|
13
|
+
private readonly announce;
|
|
14
|
+
private readonly run;
|
|
15
|
+
readonly link: InsertDialog;
|
|
16
|
+
constructor(root: ShadowRoot, controller: ViewerController, announce: (message: string) => void, run: Run);
|
|
17
|
+
reason(state: ViewerState, mode: Mode): string;
|
|
18
|
+
start(mode: Mode): void;
|
|
19
|
+
close(): void;
|
|
20
|
+
render(state: ViewerState): void;
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ViewerController, ViewerState } from './controller.js';
|
|
2
|
+
/**
|
|
3
|
+
* Home > Tools > Text Block (Ctrl+Shift+4): the selected shape's text block gets a frame that
|
|
4
|
+
* moves, eight resize handles and a rotation handle. Releasing writes one undoable format-text
|
|
5
|
+
* edit with the TxtPinX/TxtPinY/TxtWidth/TxtHeight/TxtAngle cells.
|
|
6
|
+
*/
|
|
7
|
+
export declare class ViewerTextBlockTool {
|
|
8
|
+
#private;
|
|
9
|
+
private readonly viewport;
|
|
10
|
+
private readonly controller;
|
|
11
|
+
private readonly options;
|
|
12
|
+
constructor(viewport: HTMLElement, controller: ViewerController, options: {
|
|
13
|
+
announce(message: string): void;
|
|
14
|
+
edit(run: () => Promise<void>, success: string): void;
|
|
15
|
+
/** The tool turned on or off. */
|
|
16
|
+
changed(active: boolean): void;
|
|
17
|
+
});
|
|
18
|
+
get active(): boolean;
|
|
19
|
+
toggle(): void;
|
|
20
|
+
exit(): void;
|
|
21
|
+
render(state: ViewerState): void;
|
|
22
|
+
wire(): () => void;
|
|
23
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type VisioTextDialogValues } from 'ooxml-core/visio/ui';
|
|
2
|
+
type Dialog = HTMLElement & {
|
|
3
|
+
open: boolean;
|
|
4
|
+
show(): void;
|
|
5
|
+
close(): void;
|
|
6
|
+
};
|
|
7
|
+
type Button = HTMLElement & {
|
|
8
|
+
disabled: boolean;
|
|
9
|
+
};
|
|
10
|
+
export type TextDialogTab = 'font' | 'character' | 'paragraph' | 'text-block' | 'tabs' | 'bullets';
|
|
11
|
+
/** Visio's Text dialog on the shared office-ui-dialog: tabs, typed fields and footer buttons. */
|
|
12
|
+
export declare function createTextDialog(root: ShadowRoot, press: (button: string) => void): {
|
|
13
|
+
dialog: Dialog;
|
|
14
|
+
error: HTMLParagraphElement;
|
|
15
|
+
buttons: Map<string, Button>;
|
|
16
|
+
select: (id: TextDialogTab, focus?: boolean) => void;
|
|
17
|
+
/** Show values; fonts fill the Font list and an unknown current font is kept. */
|
|
18
|
+
write(values: VisioTextDialogValues, fonts: readonly string[]): void;
|
|
19
|
+
/** Read the fields over `base`; invalid numbers keep the base value. */
|
|
20
|
+
read(base: VisioTextDialogValues): VisioTextDialogValues;
|
|
21
|
+
busy(value: boolean): void;
|
|
22
|
+
};
|
|
23
|
+
export type TextDialogView = ReturnType<typeof createTextDialog>;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ViewerController, ViewerState } from './controller.js';
|
|
2
|
+
import type { VisioTextFeature } from './ribbon-action.js';
|
|
3
|
+
import { ViewerTextBlockTool } from './viewer-text-block.js';
|
|
4
|
+
type Edit = (run: () => Promise<void>, success: string) => void;
|
|
5
|
+
/**
|
|
6
|
+
* Text features: the Text dialog (Font and Paragraph launchers), the Text Block tool, Insert
|
|
7
|
+
* Symbol and Field, and Review Spelling and Language. Spelling is the browser's own spell checker
|
|
8
|
+
* in the shape text editor; no dictionary is bundled.
|
|
9
|
+
*/
|
|
10
|
+
export declare class ViewerTextFeatures {
|
|
11
|
+
#private;
|
|
12
|
+
private readonly root;
|
|
13
|
+
private readonly viewport;
|
|
14
|
+
private readonly controller;
|
|
15
|
+
private readonly announce;
|
|
16
|
+
private readonly edit;
|
|
17
|
+
private readonly reveal;
|
|
18
|
+
readonly textBlock: ViewerTextBlockTool;
|
|
19
|
+
constructor(root: ShadowRoot, viewport: HTMLElement, controller: ViewerController, announce: (message: string) => void, edit: Edit, reveal: (panel: 'edit', focus: boolean) => void);
|
|
20
|
+
run(feature: VisioTextFeature): void;
|
|
21
|
+
wire(): () => void;
|
|
22
|
+
render(state: ViewerState, pointerTool: boolean): void;
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { VisioPage } from 'ooxml-core/visio';
|
|
2
|
+
import { type VisioFieldCategory } from 'ooxml-core/visio/ui';
|
|
3
|
+
import type { ViewerController } from './controller.js';
|
|
4
|
+
type Dialog = HTMLElement & {
|
|
5
|
+
open: boolean;
|
|
6
|
+
show(): void;
|
|
7
|
+
close(): void;
|
|
8
|
+
};
|
|
9
|
+
export interface TextInsertTarget {
|
|
10
|
+
page: VisioPage;
|
|
11
|
+
shapeId: string;
|
|
12
|
+
/** The shape text editor when it holds the caret for this shape. */
|
|
13
|
+
editor?: HTMLTextAreaElement;
|
|
14
|
+
}
|
|
15
|
+
/** Insert > Symbol and Insert > Field. Edits go through the controller; fields stay atomic. */
|
|
16
|
+
export declare class ViewerTextInsert {
|
|
17
|
+
#private;
|
|
18
|
+
private readonly controller;
|
|
19
|
+
private readonly announce;
|
|
20
|
+
readonly symbol: Dialog;
|
|
21
|
+
readonly field: Dialog;
|
|
22
|
+
constructor(root: ShadowRoot, controller: ViewerController, announce: (message: string) => void);
|
|
23
|
+
open(kind: 'symbol' | 'field', target: TextInsertTarget): void;
|
|
24
|
+
close(): void;
|
|
25
|
+
/** Close when the drawing the dialog was opened for is replaced. */
|
|
26
|
+
render(): void;
|
|
27
|
+
}
|
|
28
|
+
export type { VisioFieldCategory };
|