ooxml-ui 1.35.0 → 1.37.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 +14 -1
- package/dist/chrome/tab-drag.d.ts +27 -0
- package/dist/chrome/tab-drag.d.ts.map +1 -0
- package/dist/chrome/tab-strip.d.ts +25 -1
- package/dist/chrome/tab-strip.d.ts.map +1 -1
- package/dist/{chunk-CDC5MAZS.js → chunk-6VF4FEMY.js} +1 -1
- package/dist/{chunk-D5IRYZLP.js → chunk-7RRN2GPO.js} +1 -1
- package/dist/{chunk-TGG36HHF.js → chunk-FQYCSYWH.js} +2 -2
- package/dist/{chunk-FFM3WVLU.js → chunk-O3P6UH4P.js} +1 -1
- package/dist/{chunk-KYXSQFDB.js → chunk-QAX4FAB7.js} +139 -4
- package/dist/controls.d.ts +1 -1
- package/dist/controls.d.ts.map +1 -1
- package/dist/controls.js +1 -1
- package/dist/docx/building-blocks-actions.d.ts +2 -2
- package/dist/docx/editable-region-view.d.ts +4 -0
- package/dist/docx/editor-chrome.d.ts +1 -1
- package/dist/docx/editor-core.d.ts +4 -0
- package/dist/docx/editor-plugins.d.ts +3 -0
- package/dist/docx/file-commands.d.ts +5 -0
- package/dist/docx/format-dialogs.d.ts +6 -1
- package/dist/docx/insert-controller.d.ts +5 -0
- package/dist/docx/list-commands.d.ts +3 -1
- package/dist/docx/list-marker-display.d.ts +1 -1
- package/dist/docx/locales/en-app.d.ts +0 -1
- package/dist/docx/locales/en-ribbon.d.ts +51 -0
- package/dist/docx/locales/en.d.ts +51 -1
- package/dist/docx/localization-strings.d.ts +51 -1
- package/dist/docx/paragraph-styles.d.ts +1 -1
- package/dist/docx/protection-controls.d.ts +4 -0
- package/dist/docx/restrict-editing-pane.d.ts +14 -0
- package/dist/docx/ribbon-action.d.ts +4 -0
- package/dist/docx/ribbon-icons.d.ts +1 -0
- package/dist/docx/search-controller.d.ts +12 -5
- package/dist/docx/search-document.d.ts +32 -0
- package/dist/docx.js +1182 -384
- package/dist/export/pdf-embedded-font.d.ts +65 -0
- package/dist/export/pdf-fonts.d.ts +14 -0
- package/dist/export/pdf-vector.d.ts +84 -0
- package/dist/fonts/catalog.d.ts +1 -0
- package/dist/index.js +4 -4
- package/dist/pptx/ai/bridge-factory.d.ts +4 -1
- package/dist/pptx/ai/bridge-factory.d.ts.map +1 -1
- package/dist/pptx/ai/config.d.ts +1 -1
- package/dist/pptx/ai/config.d.ts.map +1 -1
- package/dist/pptx/ai/host.cjs +36 -36
- package/dist/pptx/ai/host.mjs +1 -1
- package/dist/pptx/ai/index.cjs +50 -43
- package/dist/pptx/ai/index.mjs +10 -3
- package/dist/pptx/ai/system-prompt.d.ts +1 -1
- package/dist/pptx/ai/system-prompt.d.ts.map +1 -1
- package/dist/pptx/ai/tool-summary.d.ts.map +1 -1
- package/dist/pptx/ai/tools/mcp-registry.d.ts.map +1 -1
- package/dist/pptx/{chunk-KGDMMWIY.mjs → chunk-2AK5MS6H.mjs} +11 -0
- package/dist/pptx/{chunk-M55PNMFQ.cjs → chunk-4OKSYRYA.cjs} +11 -0
- package/dist/pptx/{chunk-GPQP2R5Y.mjs → chunk-4RSRCNRM.mjs} +177 -13
- package/dist/pptx/{chunk-NPYNJOK2.cjs → chunk-6JJD3LFT.cjs} +182 -17
- package/dist/pptx/{chunk-46HIE4IE.cjs → chunk-CRV7G4GC.cjs} +8 -0
- package/dist/pptx/{chunk-5EERUTDC.mjs → chunk-KNCCSPAV.mjs} +1 -1
- package/dist/pptx/{chunk-GKQULDFF.cjs → chunk-SI7GQYSL.cjs} +42 -42
- package/dist/pptx/{chunk-6MEBLCNK.mjs → chunk-WQI3NLMY.mjs} +8 -0
- package/dist/pptx/dom/index.cjs +384 -384
- package/dist/pptx/dom/index.mjs +6 -6
- package/dist/pptx/i18n/index.cjs +6 -6
- package/dist/pptx/i18n/index.mjs +1 -1
- package/dist/pptx/i18n/translations-en.d.ts.map +1 -1
- package/dist/pptx/index.cjs +3037 -3033
- package/dist/pptx/index.mjs +2 -2
- package/dist/pptx/render/controller/custom-shows-controller.d.ts +93 -0
- package/dist/pptx/render/controller/custom-shows-controller.d.ts.map +1 -0
- package/dist/pptx/render/controller/index.d.ts +2 -0
- package/dist/pptx/render/controller/index.d.ts.map +1 -1
- package/dist/pptx/render/custom-shows.d.ts +10 -2
- package/dist/pptx/render/custom-shows.d.ts.map +1 -1
- package/dist/pptx/{smartart-insert-preview-6BITTUI4.mjs → smartart-insert-preview-JH5TXECK.mjs} +3 -3
- package/dist/pptx/{smartart-insert-preview-BUOS5XQR.cjs → smartart-insert-preview-QWROEVZL.cjs} +4 -4
- package/dist/teams.js +2 -2
- package/dist/theme-bridge.d.ts +1 -0
- package/dist/visio/binding.d.ts +2 -1
- package/dist/visio/canvas-editing.d.ts +4 -0
- package/dist/visio/controller.d.ts +3 -0
- package/dist/visio/locales/de-backstage.d.ts +2 -0
- package/dist/visio/locales/en-backstage.d.ts +2 -0
- package/dist/visio/locales/es-backstage.d.ts +2 -0
- package/dist/visio/locales/fr-backstage.d.ts +2 -0
- package/dist/visio/locales/zh-CN-backstage.d.ts +2 -0
- package/dist/visio/paragraph-layout.d.ts +6 -1
- package/dist/visio/pdf-path.d.ts +37 -0
- package/dist/visio/pdf-svg-gradient.d.ts +23 -0
- package/dist/visio/pdf-svg-style.d.ts +20 -0
- package/dist/visio/pdf-svg-text.d.ts +8 -0
- package/dist/visio/pdf-svg.d.ts +22 -0
- package/dist/visio/render-bevel.d.ts +15 -0
- package/dist/visio/ribbon-action.d.ts +47 -5
- package/dist/visio/ribbon-arrange.d.ts +9 -0
- package/dist/visio/ribbon-contextual-formats.d.ts +18 -0
- package/dist/visio/ribbon-localize.d.ts +6 -0
- package/dist/visio/ribbon-org-chart.d.ts +8 -0
- package/dist/visio/ribbon-router.d.ts +18 -0
- package/dist/visio/ribbon-shape-format.d.ts +7 -0
- package/dist/visio/ribbon-shape-styles.d.ts +2 -0
- package/dist/visio/ribbon-size-fields.d.ts +5 -0
- package/dist/visio/ribbon-swimlane.d.ts +9 -0
- package/dist/visio/ribbon-themes.d.ts +13 -3
- package/dist/visio/ribbon.d.ts +5 -1
- package/dist/visio/shapes-files-ui.d.ts +1 -1
- package/dist/visio/tab-layout.d.ts +15 -0
- package/dist/visio/template-thumbnails.d.ts +10 -0
- package/dist/visio/viewer-backstage.d.ts +13 -3
- package/dist/visio/viewer-contextual-tabs.d.ts +21 -0
- package/dist/visio/viewer-control-handles.d.ts +19 -0
- package/dist/visio/viewer-data-advanced.d.ts +25 -0
- package/dist/visio/viewer-data-fields.d.ts +16 -0
- package/dist/visio/viewer-data-labels.d.ts +8 -0
- package/dist/visio/viewer-data-visualizer.d.ts +25 -0
- package/dist/visio/viewer-data.d.ts +6 -0
- package/dist/visio/viewer-diagram-parts.d.ts +9 -1
- package/dist/visio/viewer-element.d.ts +10 -0
- package/dist/visio/viewer-export.d.ts +1 -6
- package/dist/visio/viewer-file-commands.d.ts +6 -1
- package/dist/visio/viewer-guides.d.ts +8 -1
- package/dist/visio/viewer-inline-size.d.ts +15 -0
- package/dist/visio/viewer-insert-dialog.d.ts +1 -0
- package/dist/visio/viewer-new-drawing.d.ts +3 -2
- package/dist/visio/viewer-org-chart.d.ts +30 -0
- package/dist/visio/viewer-pdf-options.d.ts +26 -0
- package/dist/visio/viewer-pdf.d.ts +47 -0
- package/dist/visio/viewer-picture-format.d.ts +20 -0
- package/dist/visio/viewer-resize-handles.d.ts +13 -1
- package/dist/visio/viewer-shape-actions.d.ts +12 -0
- package/dist/visio/viewer-shape-styles.d.ts +1 -1
- package/dist/visio/viewer-swimlanes.d.ts +34 -0
- package/dist/visio.js +6007 -1086
- package/dist/xlsx/dialogs/audit-dialogs.d.ts +9 -0
- package/dist/xlsx/dialogs/custom-lists.d.ts +6 -0
- package/dist/xlsx/dialogs/help-dialogs.d.ts +2 -2
- package/dist/xlsx/dialogs/sort-dialog.d.ts +3 -3
- package/dist/xlsx/dialogs/watch-window.d.ts +4 -0
- package/dist/xlsx/grid/audit-layer.d.ts +3 -0
- package/dist/xlsx/grid/grid-view.d.ts +23 -1
- package/dist/xlsx/grid/pane-chrome.d.ts +2 -0
- package/dist/xlsx/grid/split-bars.d.ts +2 -0
- package/dist/xlsx/grid/styles.d.ts +1 -1
- package/dist/xlsx/sheet-tabs/drag.d.ts +1 -2
- package/dist/xlsx.js +1074 -239
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { VisioParagraph, VisioText } from 'ooxml-core/visio';
|
|
1
|
+
import type { VisioParagraph, VisioTabStop, VisioText } from 'ooxml-core/visio';
|
|
2
2
|
import { type TextLayoutBudget, type MeasureText, type TextLine } from './text-layout.js';
|
|
3
3
|
export interface PositionedLine extends TextLine {
|
|
4
4
|
x: number;
|
|
@@ -10,6 +10,11 @@ export interface PositionedLine extends TextLine {
|
|
|
10
10
|
bullet?: NonNullable<VisioParagraph['bullet']> & {
|
|
11
11
|
x: number;
|
|
12
12
|
};
|
|
13
|
+
/** The paragraph's tab stops and the edge their positions are measured from. */
|
|
14
|
+
tabs?: {
|
|
15
|
+
stops: VisioTabStop[];
|
|
16
|
+
origin: number;
|
|
17
|
+
};
|
|
13
18
|
}
|
|
14
19
|
export interface ParagraphLayout {
|
|
15
20
|
lines: PositionedLine[];
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/** SVG path data to absolute move/line/cubic/close segments, for the PDF writer. DOM-free. */
|
|
2
|
+
export type PathSegment = {
|
|
3
|
+
t: 'M';
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
} | {
|
|
7
|
+
t: 'L';
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
} | {
|
|
11
|
+
t: 'C';
|
|
12
|
+
x1: number;
|
|
13
|
+
y1: number;
|
|
14
|
+
x2: number;
|
|
15
|
+
y2: number;
|
|
16
|
+
x: number;
|
|
17
|
+
y: number;
|
|
18
|
+
} | {
|
|
19
|
+
t: 'Z';
|
|
20
|
+
};
|
|
21
|
+
export declare const MAX_PATH_CHARS = 2000000;
|
|
22
|
+
export declare const MAX_PATH_SEGMENTS = 200000;
|
|
23
|
+
/** Parse path data. Returns `undefined` if it is malformed or exceeds the bounds. */
|
|
24
|
+
export declare function parsePath(d: string): PathSegment[] | undefined;
|
|
25
|
+
/** PDF path-construction operators for the segments. */
|
|
26
|
+
export declare function pathOperators(segments: readonly PathSegment[]): string[];
|
|
27
|
+
export interface PathEnd {
|
|
28
|
+
x: number;
|
|
29
|
+
y: number;
|
|
30
|
+
/** Direction of travel at the end, in radians; for the start it points along the path. */
|
|
31
|
+
angle: number;
|
|
32
|
+
}
|
|
33
|
+
/** Position and tangent where the first and last drawn segments meet the path ends. */
|
|
34
|
+
export declare function pathEnds(segments: readonly PathSegment[]): {
|
|
35
|
+
start?: PathEnd;
|
|
36
|
+
end?: PathEnd;
|
|
37
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SVG `linearGradient` and `radialGradient` elements as PDF shadings. A shading is painted with
|
|
3
|
+
* `sh` inside the filled path's clip, so it needs no pattern matrix: the matrices below are
|
|
4
|
+
* applied with `cm` first (bounding-box units, then `gradientTransform`).
|
|
5
|
+
*/
|
|
6
|
+
import type { PdfShading } from '../export/pdf-vector.js';
|
|
7
|
+
import type { PathSegment } from './pdf-path.js';
|
|
8
|
+
export interface GradientPaint {
|
|
9
|
+
shading: PdfShading;
|
|
10
|
+
/** Matrices to concatenate, in order, before painting the shading. */
|
|
11
|
+
matrices: number[][];
|
|
12
|
+
/** Mean stop opacity: a shading carries no per-stop alpha. */
|
|
13
|
+
opacity: number;
|
|
14
|
+
/** Whether the stop opacities differed (so the caller can say it averaged them). */
|
|
15
|
+
variableOpacity: boolean;
|
|
16
|
+
/** `repeat` and `reflect` spreads are painted as `pad`. */
|
|
17
|
+
spreadApproximated: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare const isGradient: (element: Element | undefined) => element is Element;
|
|
20
|
+
/** Bounds of a path's points (control points included). */
|
|
21
|
+
export declare function pathBounds(segments: readonly PathSegment[]): [number, number, number, number] | undefined;
|
|
22
|
+
/** The gradient as a shading for a path with `bounds`; `undefined` when it cannot be drawn. */
|
|
23
|
+
export declare function gradientPaint(gradient: Element, bounds: [number, number, number, number] | undefined): GradientPaint | undefined;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Colour, transform and inheritance helpers for the SVG to PDF converter. */
|
|
2
|
+
/** Thrown when a page holds something the vector path cannot represent. */
|
|
3
|
+
export declare class PdfFallback extends Error {
|
|
4
|
+
}
|
|
5
|
+
export interface Rgba {
|
|
6
|
+
r: number;
|
|
7
|
+
g: number;
|
|
8
|
+
b: number;
|
|
9
|
+
a: number;
|
|
10
|
+
}
|
|
11
|
+
/** A CSS colour as 0..1 channels; `null` for none or transparent; throws on anything unknown. */
|
|
12
|
+
export declare function parseColor(value: string | null | undefined): Rgba | null;
|
|
13
|
+
/** Transform list as 2x3 matrices applied left to right (SVG order). */
|
|
14
|
+
export declare function parseTransform(value: string | null): number[][];
|
|
15
|
+
/** The attribute on the element or the nearest ancestor that sets it (inherited properties). */
|
|
16
|
+
export declare function inherited(element: Element, name: string): string | null;
|
|
17
|
+
export declare const number: (value: string | null, fallback?: number) => number;
|
|
18
|
+
export declare const hrefOf: (element: Element) => string | null;
|
|
19
|
+
/** The `id` inside `url(#id)`. */
|
|
20
|
+
export declare const urlId: (value: string | null) => string | undefined;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PdfVectorPage } from '../export/pdf-vector.js';
|
|
2
|
+
import type { PdfFontSet } from '../export/pdf-embedded-font.js';
|
|
3
|
+
/**
|
|
4
|
+
* Draw one SVG `<text>` as real PDF text, row by row (the renderer's `tspan` rows carry x, y
|
|
5
|
+
* and anchor; their `tspan` children are the styled runs). The page space is y-down, so each
|
|
6
|
+
* run uses a flipped text matrix. Positions inside a row use approximate standard-font widths.
|
|
7
|
+
*/
|
|
8
|
+
export declare function drawSvgText(page: PdfVectorPage, text: Element, alpha: number, fonts?: PdfFontSet): void;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convert one static page SVG (from `exportPageSvg`) into a vector PDF page: paths with fill,
|
|
3
|
+
* stroke, dash, caps and joins, arrowhead markers, rect clips, real text and embedded images.
|
|
4
|
+
* What the PDF cannot draw degrades and is listed (`degraded`); what it cannot represent at all
|
|
5
|
+
* throws `PdfFallback` inside `convertSvgPage`, which then reports `fallback` so the caller can
|
|
6
|
+
* use a picture of the page instead.
|
|
7
|
+
*/
|
|
8
|
+
import type { PdfFontSet } from '../export/pdf-embedded-font.js';
|
|
9
|
+
import { PdfVectorPage, type PdfImageResource } from '../export/pdf-vector.js';
|
|
10
|
+
export interface SvgPageConversion {
|
|
11
|
+
/** The vector page, or `undefined` when `fallback` lists why it cannot be vector. */
|
|
12
|
+
page?: PdfVectorPage;
|
|
13
|
+
fallback: string[];
|
|
14
|
+
degraded: string[];
|
|
15
|
+
}
|
|
16
|
+
/** Every distinct image `href` (data URL) the page draws, for the caller to decode. */
|
|
17
|
+
export declare function collectSvgImages(svg: Element): string[];
|
|
18
|
+
/**
|
|
19
|
+
* Convert the static page SVG to a PDF page `widthIn` x `heightIn` inches. Never throws for
|
|
20
|
+
* unsupported content: it returns `fallback` reasons instead.
|
|
21
|
+
*/
|
|
22
|
+
export declare function convertSvgPage(svg: Element, widthIn: number, heightIn: number, images: ReadonlyMap<string, PdfImageResource>, fonts?: PdfFontSet): SvgPageConversion;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type VisioMatrix, type VisioShape } from 'ooxml-core/visio';
|
|
2
|
+
/**
|
|
3
|
+
* Bevel: an approximation. The shape's filled geometry is blurred by the bevel width, lit from the
|
|
4
|
+
* top left with a diffuse light, and only the departure from a flat surface is kept: white where
|
|
5
|
+
* the surface faces the light, black where it faces away. Inset bevels invert the light and hard
|
|
6
|
+
* profiles narrow the blur. Visio's own bevel profiles, materials and lighting are not reproduced,
|
|
7
|
+
* and the result changes slightly with the zoom because SVG lighting works on device pixels.
|
|
8
|
+
*/
|
|
9
|
+
export declare function renderBevel(shape: VisioShape, paths: readonly SVGPathElement[], defs: SVGDefsElement, world: VisioMatrix): SVGGElement | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* 3-D rotation: a parallel projection of the flat shape about its centre, as a matrix on a wrapper
|
|
12
|
+
* group. Perspective foreshortening and extrusion are not drawn; Visio's own SVG export ignores
|
|
13
|
+
* the rotation, its raster export draws it.
|
|
14
|
+
*/
|
|
15
|
+
export declare function rotation3dWrapper(shape: VisioShape): SVGGElement | undefined;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { VisioThemeColorRef } from 'ooxml-core/visio';
|
|
2
|
-
import type {
|
|
2
|
+
import type { VisioDataGraphicPosition } from 'ooxml-core/visio/ui';
|
|
3
|
+
import type { VisioBuiltInThemeId, VisioEmbellishment, VisioCalloutStyle, VisioChangeShapeTarget, VisioContainerStyle, VisioConnectorRoute, VisioShapeFormatEdit } from 'ooxml-core/visio';
|
|
3
4
|
import type { TextCaseMode, VisioArrangement, VisioRuleSetId, VisioLayoutStyle } from 'ooxml-core/visio/ui';
|
|
4
5
|
import type { VisioPageSetupCommand } from './page-setup-action.js';
|
|
5
6
|
export type CanvasTool = 'pointer' | 'connector' | 'connection-point' | 'rectangle' | 'ellipse' | 'line' | 'text' | 'freeform' | 'arc' | 'pencil';
|
|
@@ -58,7 +59,7 @@ export type VisioTextFeature = 'text-dialog' | 'paragraph-dialog' | 'text-block'
|
|
|
58
59
|
* Insert-tab items that act on the page or the selected shape; `chart-data` and `chart-format`
|
|
59
60
|
* open Edit Data and Format Chart for a selected chart object.
|
|
60
61
|
*/
|
|
61
|
-
export type VisioInsertItem = 'picture' | 'chart' | 'chart-data' | 'chart-format' | 'link' | 'screen-tip';
|
|
62
|
+
export type VisioInsertItem = 'picture' | 'chart' | 'chart-data' | 'chart-format' | 'chart-edit' | 'link' | 'screen-tip';
|
|
62
63
|
/** Review and Process tab commands: comments, shape reports, diagram checks and subprocesses. */
|
|
63
64
|
export type VisioReviewCommand = 'check-accessibility' | 'alt-text' | 'page-alt-text' | 'new-comment' | 'page-comment' | 'comments-pane' | 'shape-reports' | 'check-diagram' | 'issues-window' | 'ignore-issue' | 'rule-set' | 'subprocess-new' | 'subprocess-existing' | 'subprocess-selection';
|
|
64
65
|
/** Insert > Diagram Parts: a container or callout in one of its styles. */
|
|
@@ -71,8 +72,44 @@ export type VisioDiagramPartAction = {
|
|
|
71
72
|
part: 'callout';
|
|
72
73
|
style: VisioCalloutStyle;
|
|
73
74
|
};
|
|
75
|
+
/** Container Format > Size and Membership: act on the one selected container. */
|
|
76
|
+
export type VisioContainerAction = {
|
|
77
|
+
type: 'container';
|
|
78
|
+
command: 'fit' | 'select-contents' | 'disband';
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* Container Format > Margins, Automatic Resize and Lock Container: one core option edit each. The
|
|
82
|
+
* lock is `toggle` on its command; the viewer resolves it from the container's current state.
|
|
83
|
+
*/
|
|
84
|
+
export type VisioContainerOptionAction = {
|
|
85
|
+
type: 'container-options';
|
|
86
|
+
margin?: number;
|
|
87
|
+
resize?: 0 | 1 | 2;
|
|
88
|
+
locked?: boolean | 'toggle';
|
|
89
|
+
};
|
|
90
|
+
/** Picture Format > Brightness and Contrast presets (0 to 1, 0.5 neutral) and Crop to Square or Reset Crop. */
|
|
91
|
+
export type VisioPictureAction = {
|
|
92
|
+
type: 'picture-adjust';
|
|
93
|
+
brightness?: number;
|
|
94
|
+
contrast?: number;
|
|
95
|
+
} | {
|
|
96
|
+
type: 'picture-crop';
|
|
97
|
+
crop: 'square' | 'reset';
|
|
98
|
+
};
|
|
99
|
+
/** The Cross-Functional Flowchart tab: lanes, separators and the Design and Arrange options. */
|
|
100
|
+
export type VisioSwimlaneAction = {
|
|
101
|
+
type: 'swimlane';
|
|
102
|
+
command: 'insert-before' | 'insert-after' | 'delete' | 'separator' | 'title' | 'separators' | 'rotate-labels' | 'direction-horizontal' | 'direction-vertical' | 'style';
|
|
103
|
+
/** The Style number (1-4) for the style command. */
|
|
104
|
+
style?: number;
|
|
105
|
+
};
|
|
106
|
+
/** The Org Chart tab: add a position under, beside or for the selected one, delete it, lay out. */
|
|
107
|
+
export type VisioOrgChartAction = {
|
|
108
|
+
type: 'org-chart';
|
|
109
|
+
command: 'subordinate' | 'coworker' | 'assistant' | 'delete' | 'layout' | 'import';
|
|
110
|
+
};
|
|
74
111
|
/** Data-tab commands: import, refresh, data graphics, legend, windows and Shape Data. */
|
|
75
|
-
export type VisioDataCommand = 'quick-import' | 'custom-import' | 'refresh' | 'graphic-text' | 'graphic-bar' | 'graphic-icon' | 'graphic-color' | 'graphic-remove' | 'legend' | 'legend-horizontal' | 'external-data-window' | 'define-shape-data';
|
|
112
|
+
export type VisioDataCommand = 'quick-import' | 'custom-import' | 'refresh' | 'graphic-text' | 'graphic-bar' | 'graphic-icon' | 'graphic-color' | 'graphic-remove' | 'legend' | 'legend-horizontal' | 'external-data-window' | 'link-data' | 'graphic-configure' | 'graphic-auto-space' | `graphic-position-${VisioDataGraphicPosition}` | 'graphic-fields' | 'graphic-advanced' | 'visualizer-basic' | 'visualizer-cross-functional' | 'visualizer-refresh' | 'visualizer-template' | 'define-shape-data';
|
|
76
113
|
/** Arrangement, layout, layer, selection, view and output commands (viewer-layout and friends). */
|
|
77
114
|
export type VisioLayoutAction = {
|
|
78
115
|
type: 'auto-align';
|
|
@@ -102,7 +139,7 @@ export type VisioLayoutAction = {
|
|
|
102
139
|
topic: 'help' | 'training';
|
|
103
140
|
};
|
|
104
141
|
/** Every command the Visio ribbon, status bar or a shortcut can raise, as a `ribbon-action` event. */
|
|
105
|
-
export type VisioRibbonAction = VisioFormattingAction | VisioLayoutAction | {
|
|
142
|
+
export type VisioRibbonAction = VisioFormattingAction | VisioSwimlaneAction | VisioOrgChartAction | VisioLayoutAction | {
|
|
106
143
|
type: 'arrange';
|
|
107
144
|
operation: VisioArrangement;
|
|
108
145
|
} | {
|
|
@@ -136,6 +173,11 @@ export type VisioRibbonAction = VisioFormattingAction | VisioLayoutAction | {
|
|
|
136
173
|
type: 'page-theme';
|
|
137
174
|
theme?: VisioBuiltInThemeId | 'none';
|
|
138
175
|
variant?: number;
|
|
176
|
+
colors?: VisioBuiltInThemeId;
|
|
177
|
+
fonts?: VisioBuiltInThemeId;
|
|
178
|
+
effects?: VisioBuiltInThemeId;
|
|
179
|
+
connectors?: VisioBuiltInThemeId;
|
|
180
|
+
embellishment?: VisioEmbellishment;
|
|
139
181
|
} | {
|
|
140
182
|
type: 'delete';
|
|
141
183
|
} | {
|
|
@@ -161,7 +203,7 @@ export type VisioRibbonAction = VisioFormattingAction | VisioLayoutAction | {
|
|
|
161
203
|
| {
|
|
162
204
|
type: 'change-shape';
|
|
163
205
|
shape: VisioChangeShapeTarget | `document:${string}`;
|
|
164
|
-
} | VisioDiagramPartAction | {
|
|
206
|
+
} | VisioDiagramPartAction | VisioContainerAction | VisioContainerOptionAction | VisioPictureAction | {
|
|
165
207
|
type: 'pane';
|
|
166
208
|
pane: 'shapes' | 'inspector';
|
|
167
209
|
} | {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Which Shape Styles controls a contextual tab keeps (Quick Styles apply to whole shapes). */
|
|
2
|
+
export interface ShapeStylesOptions {
|
|
3
|
+
label?: string;
|
|
4
|
+
parts?: readonly ('quick' | 'fill' | 'line' | 'effects')[];
|
|
5
|
+
}
|
|
6
|
+
/** Shape Styles: Quick Styles, Fill, Line and Effects (Home and the Format tabs). */
|
|
7
|
+
export declare function shapeStylesGroup(doc: Document, options?: ShapeStylesOptions): HTMLElement;
|
|
8
|
+
/** Arrange: Align, Position, order and Group (Home and Shape Format). */
|
|
9
|
+
export declare function arrangeGroup(doc: Document): HTMLElement;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** Container Format margins: none, the editor's narrow and normal margins and the wide one. */
|
|
2
|
+
export declare const CONTAINER_MARGINS: readonly [string, number][];
|
|
3
|
+
/**
|
|
4
|
+
* Picture Format: Adjust (Brightness and Contrast presets, Crop), Picture Styles (Line and
|
|
5
|
+
* Effects, the Home controls built again), Arrange and Size. Compression and Auto Balance stay
|
|
6
|
+
* listed disabled with the reason.
|
|
7
|
+
*/
|
|
8
|
+
export declare function buildPictureFormatPanel(doc: Document, panel: HTMLElement): void;
|
|
9
|
+
/**
|
|
10
|
+
* Container Format: Size (Margins, Fit to Contents and Automatic Resize, then the Width and
|
|
11
|
+
* Height boxes), Container Styles (Fill, Line, Effects), Membership (Lock Container) and Arrange.
|
|
12
|
+
*/
|
|
13
|
+
export declare function buildContainerFormatPanel(doc: Document, panel: HTMLElement): void;
|
|
14
|
+
/**
|
|
15
|
+
* Chart Design: the chart editor's entry points (the same one a double-click opens), Arrange and
|
|
16
|
+
* Size. Chart commands are enabled while the chart is selected on an editable drawing.
|
|
17
|
+
*/
|
|
18
|
+
export declare function buildChartDesignPanel(doc: Document, panel: HTMLElement): void;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { type VisioLocale } from './ribbon-locale.js';
|
|
2
2
|
/** The locale of a ribbon last localized with `localizeRibbon`. */
|
|
3
3
|
export declare function ribbonLocale(ribbon: Element): VisioLocale;
|
|
4
|
+
/**
|
|
5
|
+
* Translates the wording of `elements` in place: their attributes in `ATTRIBUTES` and the text of
|
|
6
|
+
* their leaf elements. Add-in content and `data-user-text` (a document's own names) are kept.
|
|
7
|
+
* Calling it again with another locale translates from the English originals.
|
|
8
|
+
*/
|
|
9
|
+
export declare function localizeWording(elements: Iterable<Element>, locale: VisioLocale): void;
|
|
4
10
|
/**
|
|
5
11
|
* Translates the ribbon in place: tab names, group and command labels, tooltips, accessible names
|
|
6
12
|
* and the shared ribbon's own File and collapse labels. Add-in tabs keep the host's wording.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Visio's contextual Org Chart tab, as far as positions go: Insert (Subordinate, Coworker,
|
|
3
|
+
* Assistant), Position (Delete Position), Import and Arrange (Layout). It shows while an org chart
|
|
4
|
+
* position is selected (`viewer-contextual-tabs.ts`); `viewer-org-chart.ts` keeps its state.
|
|
5
|
+
* Import builds a chart from a CSV or Excel sheet (Name, Title and Reports To columns); a
|
|
6
|
+
* directory is not read. The Data tab offers the same command, because it needs no selection.
|
|
7
|
+
*/
|
|
8
|
+
export declare function buildOrgChartPanel(doc: Document, panel: HTMLElement): void;
|
|
@@ -18,6 +18,12 @@ export interface RibbonTargets {
|
|
|
18
18
|
insertDiagramPart(action: Extract<VisioRibbonAction, {
|
|
19
19
|
type: 'diagram-part';
|
|
20
20
|
}>): void;
|
|
21
|
+
swimlane(action: Extract<VisioRibbonAction, {
|
|
22
|
+
type: 'swimlane';
|
|
23
|
+
}>): void;
|
|
24
|
+
orgChart(action: Extract<VisioRibbonAction, {
|
|
25
|
+
type: 'org-chart';
|
|
26
|
+
}>): void;
|
|
21
27
|
formatSelection(action: VisioFormattingAction): void;
|
|
22
28
|
formatPainter(mode: 'once' | 'sticky' | 'cancel'): void;
|
|
23
29
|
arrangeSelection(action: Extract<VisioRibbonAction, {
|
|
@@ -57,6 +63,18 @@ export interface RibbonTargets {
|
|
|
57
63
|
}>): void;
|
|
58
64
|
/** Layout, layers, selection, guides, explorer, export and help (ViewerLayoutCommands). */
|
|
59
65
|
layout(action: VisioLayoutAction): void;
|
|
66
|
+
/** Container Format: fit, select the contents or disband the selected container. */
|
|
67
|
+
container(command: Extract<VisioRibbonAction, {
|
|
68
|
+
type: 'container';
|
|
69
|
+
}>['command']): void;
|
|
70
|
+
/** Container Format > Margins, Automatic Resize and Lock Container. */
|
|
71
|
+
containerOptions(action: Extract<VisioRibbonAction, {
|
|
72
|
+
type: 'container-options';
|
|
73
|
+
}>): void;
|
|
74
|
+
/** Picture Format > Brightness, Contrast and Crop of the selected picture. */
|
|
75
|
+
picture(action: Extract<VisioRibbonAction, {
|
|
76
|
+
type: 'picture-adjust' | 'picture-crop';
|
|
77
|
+
}>): void;
|
|
60
78
|
}
|
|
61
79
|
/** Routes a ribbon, status-bar or shortcut action to the controller that owns it. */
|
|
62
80
|
export declare function routeRibbonAction(targets: RibbonTargets, action: VisioRibbonAction): void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Visio's contextual Shape Format tab: Shape Styles and Arrange are the Home groups built again
|
|
3
|
+
* (the viewer mirrors their state from Home, so one implementation serves both), Size opens the
|
|
4
|
+
* Size & Position window, and WordArt Styles lists what Visio offers with the reason it is
|
|
5
|
+
* unavailable here. The tab shows only while shapes are selected (`viewer-contextual-tabs.ts`).
|
|
6
|
+
*/
|
|
7
|
+
export declare function buildShapeFormatPanel(doc: Document, panel: HTMLElement): void;
|
|
@@ -12,6 +12,8 @@ export declare function quickStyleGalleryState(disabled: boolean): OfficeGallery
|
|
|
12
12
|
* a More button, raising typed format actions.
|
|
13
13
|
*/
|
|
14
14
|
export declare function quickStyleGallery(doc: Document): HTMLElement;
|
|
15
|
+
export declare const bevelItemId: (id: string) => string;
|
|
16
|
+
export declare const rotationItemId: (id: string) => string;
|
|
15
17
|
/** Stable menu ids of the effect presets, shared with the selection state sync. */
|
|
16
18
|
export declare const glowItemId: (size: number, accent: number) => string;
|
|
17
19
|
export declare const softEdgesItemId: (size: number) => string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Visio's contextual Cross-Functional Flowchart tab (Microsoft's "Create a cross-functional
|
|
3
|
+
* flowchart"): Insert (Swimlane, Separator), Arrange (Direction turns the flowchart on its side,
|
|
4
|
+
* Rotate Lane Labels) and Design
|
|
5
|
+
* (Style, Show Title Bar, Show Separator Bar). It shows while a flowchart's frame, a lane or a
|
|
6
|
+
* shape in a lane is selected (`viewer-contextual-tabs.ts`); `viewer-swimlanes.ts` keeps its
|
|
7
|
+
* state and availability.
|
|
8
|
+
*/
|
|
9
|
+
export declare function buildSwimlanePanel(doc: Document, panel: HTMLElement): void;
|
|
@@ -3,8 +3,15 @@ import type { OfficeGalleryState, OfficeUiGallery } from '../ribbon/gallery.js';
|
|
|
3
3
|
export declare const THEMES_HINT = "Apply a theme to the current page. Quick-styled shapes take its colours; text keeps its own font.";
|
|
4
4
|
export declare const VARIANTS_HINT = "Pick one of the current theme's four colour variants.";
|
|
5
5
|
export declare const NO_THEME_VARIANTS = "Apply a theme to the page first.";
|
|
6
|
-
/**
|
|
7
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Design > Variants > More > Embellishment: the levels, each writing the page's EmbellishmentIndex.
|
|
8
|
+
* The decorative geometry is not drawn yet; see `ViewerThemes`.
|
|
9
|
+
*/
|
|
10
|
+
export declare const VARIANT_EMBELLISHMENTS: readonly [readonly ['low', 'Low'], readonly ['medium', 'Medium'], readonly ['high', 'High']];
|
|
11
|
+
/** The scheme submenus of Variants > More, in Visio's order. */
|
|
12
|
+
export declare const VARIANT_SCHEME_MENUS: readonly [readonly ['colors', 'theme-colors', 'Colors'], readonly ['fonts', 'theme-fonts', 'Fonts'], readonly ['effects', 'theme-effects', 'Effects'], readonly ['connectors', 'theme-connectors', 'Connectors']];
|
|
13
|
+
export type VariantScheme = (typeof VARIANT_SCHEME_MENUS)[number][0];
|
|
14
|
+
export declare const schemeItemId: (scheme: VariantScheme, id: string) => string;
|
|
8
15
|
export declare const themeItemId: (id: string) => string;
|
|
9
16
|
export declare const variantItemId: (index: number) => string;
|
|
10
17
|
/** Themes gallery: No Theme, then the built-in themes; the page's theme is marked applied. */
|
|
@@ -13,5 +20,8 @@ export declare function themesGalleryState(disabled: boolean, current: VisioPage
|
|
|
13
20
|
export declare function variantsGalleryState(disabled: boolean, current: VisioPageTheme | undefined): OfficeGalleryState;
|
|
14
21
|
export declare const themesGallery: (doc: Document) => OfficeUiGallery;
|
|
15
22
|
export declare const variantsGallery: (doc: Document) => OfficeUiGallery;
|
|
16
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* Variants > More: Colors, Fonts, Effects and Connectors list the built-in themes (the page's
|
|
25
|
+
* current one is checked, see `ViewerThemes`); Embellishment lists its three levels.
|
|
26
|
+
*/
|
|
17
27
|
export declare function variantOptions(doc: Document): import("./ribbon-parts.js").RibbonCommand;
|
package/dist/visio/ribbon.d.ts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { buildHomePanel } from './ribbon-home.js';
|
|
2
2
|
import { buildDataPanel, buildDesignPanel, buildHelpPanel, buildInsertPanel, buildProcessPanel, buildReviewPanel } from './ribbon-other-tabs.js';
|
|
3
|
+
import { buildShapeFormatPanel } from './ribbon-shape-format.js';
|
|
4
|
+
import { buildChartDesignPanel, buildContainerFormatPanel, buildPictureFormatPanel } from './ribbon-contextual-formats.js';
|
|
5
|
+
import { buildOrgChartPanel } from './ribbon-org-chart.js';
|
|
6
|
+
import { buildSwimlanePanel } from './ribbon-swimlane.js';
|
|
3
7
|
import { buildViewPanel } from './ribbon-view.js';
|
|
4
8
|
export type { VisioRibbonAction } from './ribbon-action.js';
|
|
5
9
|
/** 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]];
|
|
10
|
+
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], readonly ['shape-format', 'Shape Format', typeof buildShapeFormatPanel], readonly ['picture-format', 'Picture Format', typeof buildPictureFormatPanel], readonly ['container-format', 'Container Format', typeof buildContainerFormatPanel], readonly ['chart-design', 'Chart Design', typeof buildChartDesignPanel], readonly ['cross-functional', 'Cross-Functional Flowchart', typeof buildSwimlanePanel], readonly ['org-chart', 'Org Chart', typeof buildOrgChartPanel]];
|
|
7
11
|
export type RibbonTab = (typeof RIBBON_TABS)[number][0];
|
|
8
12
|
/**
|
|
9
13
|
* The Visio ribbon on the shared `office-ui-ribbon`: File, one panel per tab and Tell me (the
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Stencil } from './stencil-catalog.js';
|
|
2
2
|
import type { StencilFiles } from './stencil-files.js';
|
|
3
3
|
/** What a stencil file picker offers; Visio's own stencils are .vssx, and the rest is refused by name. */
|
|
4
|
-
export declare const STENCIL_FILE_ACCEPT = ".vssx,.vstx,.vsdx,.vss,.vst";
|
|
4
|
+
export declare const STENCIL_FILE_ACCEPT = ".vssx,.vssm,.vstx,.vstm,.vsdx,.vsdm,.vss,.vst";
|
|
5
5
|
/**
|
|
6
6
|
* The hidden file input behind More Shapes > Open Stencil and the line that says why a file could
|
|
7
7
|
* not be opened. `opened` runs for each stencil that was read.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type VisioTextRun } from 'ooxml-core/visio';
|
|
2
|
+
import type { PositionedLine } from './paragraph-layout.js';
|
|
3
|
+
import { type MeasureText } from './text-layout.js';
|
|
4
|
+
export interface TabbedSegment {
|
|
5
|
+
runs: VisioTextRun[];
|
|
6
|
+
x: number;
|
|
7
|
+
}
|
|
8
|
+
/** Whether a line has a tab character to lay out. */
|
|
9
|
+
export declare const lineHasTab: (line: PositionedLine) => boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Splits a left-aligned line at its tab characters and places each part at the tab stop it
|
|
12
|
+
* reaches (see `visioTabStarts`). The tab characters themselves are not drawn. Lines of other
|
|
13
|
+
* alignments keep their single run of text, as before.
|
|
14
|
+
*/
|
|
15
|
+
export declare function layoutTabbedLine(line: PositionedLine, measure?: MeasureText): TabbedSegment[] | undefined;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type VisioTemplateId } from 'ooxml-core/visio/ui';
|
|
2
|
+
/**
|
|
3
|
+
* The first page of a New template drawn by the viewer's own page renderer: the template is built
|
|
4
|
+
* as a real drawing, parsed and exported as a static SVG, returned as an image data URL. Nothing
|
|
5
|
+
* is hand drawn, so a tile always matches what the template creates. Undefined when it cannot be
|
|
6
|
+
* rendered (no DOM, or a failure), in which case the tile keeps its text only.
|
|
7
|
+
*/
|
|
8
|
+
export declare function templateThumbnail(id: VisioTemplateId): Promise<string | undefined>;
|
|
9
|
+
/** Fill the thumbnail of every New tile under `root`, once; later calls reuse the cached images. */
|
|
10
|
+
export declare function fillTemplateThumbnails(root: ParentNode): Promise<void>;
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import type { ViewerState } from './controller.js';
|
|
2
2
|
import type { DocumentStorage, VisioFileCommand } from 'ooxml-core/embedding';
|
|
3
|
-
import type
|
|
3
|
+
import { type VisioTemplateId, type VsdxSource } from 'ooxml-core/visio/ui';
|
|
4
4
|
import { type BackstagePage } from './backstage.js';
|
|
5
5
|
import type { VisioRegionContext } from 'ooxml-core/visio/ui';
|
|
6
6
|
import { type ResolvedVisioCustomization } from './viewer-customization.js';
|
|
7
|
+
import { type PdfRangeChoice, type PdfReportSummary } from './viewer-pdf-options.js';
|
|
7
8
|
/** What the backstage needs from the element; every action delegates to existing APIs. */
|
|
8
9
|
export interface BackstageHost {
|
|
9
10
|
root: ShadowRoot;
|
|
10
11
|
viewport: HTMLElement;
|
|
11
12
|
fileName(): string;
|
|
13
|
+
/** The display language (`locale`, else the Options language, else the page's): see the translator. */
|
|
14
|
+
locale(): string;
|
|
12
15
|
load(source: VsdxSource): Promise<void>;
|
|
13
16
|
createBlankDrawing(): Promise<void>;
|
|
17
|
+
createFromTemplate(template: VisioTemplateId): Promise<void>;
|
|
14
18
|
exportVsdx(): {
|
|
15
19
|
bytes: Uint8Array;
|
|
16
20
|
dirty: boolean;
|
|
@@ -19,10 +23,14 @@ export interface BackstageHost {
|
|
|
19
23
|
svg: string;
|
|
20
24
|
pageIndex: number;
|
|
21
25
|
};
|
|
22
|
-
/**
|
|
23
|
-
|
|
26
|
+
/**
|
|
27
|
+
* A vector PDF of the chosen foreground pages with its per-page report, or a PNG of the
|
|
28
|
+
* current page (viewer-export).
|
|
29
|
+
*/
|
|
30
|
+
exportPicture(format: 'pdf' | 'png', pdf?: PdfRangeChoice): Promise<{
|
|
24
31
|
blob: Blob;
|
|
25
32
|
pageIndex: number;
|
|
33
|
+
report?: PdfReportSummary;
|
|
26
34
|
}>;
|
|
27
35
|
closeDocument(): void;
|
|
28
36
|
showOptions(): void;
|
|
@@ -52,6 +60,8 @@ export declare class ViewerBackstage {
|
|
|
52
60
|
private readonly host;
|
|
53
61
|
constructor(host: BackstageHost);
|
|
54
62
|
get open(): boolean;
|
|
63
|
+
/** Shows the pages in the current display language again (after the locale changes). */
|
|
64
|
+
localize(): void;
|
|
55
65
|
/** Re-applies the host customisation: hidden pages, host pages and their contexts. */
|
|
56
66
|
refreshCustomization(): void;
|
|
57
67
|
show(page?: BackstagePage): void;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { VisioShape } from 'ooxml-core/visio';
|
|
2
|
+
import type { ViewerState } from './controller.js';
|
|
3
|
+
/** The format tabs, in the order the ribbon lists them; one at most shows at a time. */
|
|
4
|
+
export declare const CONTEXTUAL_TABS: readonly ['shape-format', 'picture-format', 'container-format', 'chart-design'];
|
|
5
|
+
export type ContextualTab = (typeof CONTEXTUAL_TABS)[number];
|
|
6
|
+
export type SelectionKind = 'picture' | 'container' | 'chart' | 'shape';
|
|
7
|
+
/** The kind of object that decides which specialised tab a single selection gets. */
|
|
8
|
+
export declare function selectionKind(shape: VisioShape | undefined): SelectionKind;
|
|
9
|
+
/**
|
|
10
|
+
* The one contextual tab for the selection. A lone picture, container or chart gets its own tab
|
|
11
|
+
* (which carries the Arrange and Size controls too) instead of Shape Format; every other
|
|
12
|
+
* selection, including several shapes, gets Shape Format; no selection gets none.
|
|
13
|
+
*/
|
|
14
|
+
export declare function contextualTabFor(state: ViewerState): ContextualTab | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* The state of the contextual tabs. Their Shape Styles, Arrange and Size controls are the Home
|
|
17
|
+
* controls built again: every module that syncs a control by its id updates the first match
|
|
18
|
+
* (Home), so this copies that state onto the contextual twins instead of teaching each module
|
|
19
|
+
* about several copies. Controls that exist only on a contextual tab are synced by their owner.
|
|
20
|
+
*/
|
|
21
|
+
export declare function renderContextualTabs(toolbar: HTMLElement, state: ViewerState): void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ViewerController, ViewerState } from './controller.js';
|
|
2
|
+
/**
|
|
3
|
+
* Visio's yellow control handles of the selected shape (its Controls rows). Dragging one along
|
|
4
|
+
* its free axis shows the handle at the pointer; release commits one `set-control` source edit,
|
|
5
|
+
* which rewrites the row's X or Y and recomputes the geometry that follows it. A handle the core
|
|
6
|
+
* cannot move (fixed on both axes, or driven by a formula) is drawn grey and says why.
|
|
7
|
+
*/
|
|
8
|
+
export declare class ViewerControlHandles {
|
|
9
|
+
#private;
|
|
10
|
+
private readonly viewport;
|
|
11
|
+
private readonly controller;
|
|
12
|
+
private readonly options;
|
|
13
|
+
constructor(viewport: HTMLElement, controller: ViewerController, options: {
|
|
14
|
+
active(): boolean;
|
|
15
|
+
announce(message: string): void;
|
|
16
|
+
});
|
|
17
|
+
render(state: ViewerState): void;
|
|
18
|
+
wire(): () => void;
|
|
19
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { VisioPage } from 'ooxml-core/visio';
|
|
2
|
+
import { type VisioDataGraphicItem } from 'ooxml-core/visio/ui';
|
|
3
|
+
import { type ViewerController } from './controller.js';
|
|
4
|
+
import { InsertDialog } from './viewer-insert-dialog.js';
|
|
5
|
+
type Run = (action: () => Promise<void>, success: string) => void;
|
|
6
|
+
/**
|
|
7
|
+
* Advanced Data Graphics: the Edit Data Graphic dialog. It lists the items of the first selected
|
|
8
|
+
* shape (a display type, a Shape Data field and a place each); New and Edit open the item form,
|
|
9
|
+
* Delete removes the item from every selected shape that has it.
|
|
10
|
+
*/
|
|
11
|
+
export declare class ViewerAdvancedGraphics {
|
|
12
|
+
#private;
|
|
13
|
+
private readonly controller;
|
|
14
|
+
private readonly announce;
|
|
15
|
+
private readonly run;
|
|
16
|
+
private readonly targets;
|
|
17
|
+
readonly dialog: InsertDialog;
|
|
18
|
+
/** Opens the item form, empty for a new item. */
|
|
19
|
+
onEdit: (item: VisioDataGraphicItem | undefined) => void;
|
|
20
|
+
constructor(root: ShadowRoot, controller: ViewerController, announce: (message: string) => void, run: Run, targets: (page: VisioPage) => string[]);
|
|
21
|
+
open(): void;
|
|
22
|
+
/** Rebuild the list from the drawing, keeping the selected item when it is still there. */
|
|
23
|
+
refresh(): void;
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type ViewerController, type ViewerState } from './controller.js';
|
|
2
|
+
type Run = (action: () => Promise<void>, success: string) => void;
|
|
3
|
+
/**
|
|
4
|
+
* Visio's Data Graphic Fields pane: the Shape Data fields of the selected shape, each with a
|
|
5
|
+
* check box that shows the value on the shape as a text callout and hides it again.
|
|
6
|
+
*/
|
|
7
|
+
export declare class ViewerGraphicFields {
|
|
8
|
+
#private;
|
|
9
|
+
private readonly controller;
|
|
10
|
+
private readonly run;
|
|
11
|
+
readonly pane: HTMLElement;
|
|
12
|
+
constructor(root: ShadowRoot, controller: ViewerController, run: Run);
|
|
13
|
+
toggle(open?: "until-found" | boolean): void;
|
|
14
|
+
render(state: ViewerState): void;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { VisioDataGraphicItem, VisioDataGraphicKind } from 'ooxml-core/visio/ui';
|
|
2
|
+
/** Display type of a data graphic by the command (or dialog value) that makes it. */
|
|
3
|
+
export declare const GRAPHIC_KINDS: Record<string, VisioDataGraphicKind>;
|
|
4
|
+
export declare const KIND_LABELS: string[];
|
|
5
|
+
export declare const POSITION_LABELS: string[];
|
|
6
|
+
export declare const kindLabel: (kind: VisioDataGraphicKind) => string;
|
|
7
|
+
/** One line of the Edit Data Graphic list: the display type, the field and where it sits. */
|
|
8
|
+
export declare const itemLabel: (item: VisioDataGraphicItem, fieldLabel: string) => string;
|