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.
Files changed (145) hide show
  1. package/custom-elements.json +14 -1
  2. package/dist/chrome/tab-drag.d.ts +27 -0
  3. package/dist/chrome/tab-drag.d.ts.map +1 -0
  4. package/dist/chrome/tab-strip.d.ts +25 -1
  5. package/dist/chrome/tab-strip.d.ts.map +1 -1
  6. package/dist/{chunk-CDC5MAZS.js → chunk-6VF4FEMY.js} +1 -1
  7. package/dist/{chunk-D5IRYZLP.js → chunk-7RRN2GPO.js} +1 -1
  8. package/dist/{chunk-TGG36HHF.js → chunk-FQYCSYWH.js} +2 -2
  9. package/dist/{chunk-FFM3WVLU.js → chunk-O3P6UH4P.js} +1 -1
  10. package/dist/{chunk-KYXSQFDB.js → chunk-QAX4FAB7.js} +139 -4
  11. package/dist/controls.d.ts +1 -1
  12. package/dist/controls.d.ts.map +1 -1
  13. package/dist/controls.js +1 -1
  14. package/dist/docx/building-blocks-actions.d.ts +2 -2
  15. package/dist/docx/editable-region-view.d.ts +4 -0
  16. package/dist/docx/editor-chrome.d.ts +1 -1
  17. package/dist/docx/editor-core.d.ts +4 -0
  18. package/dist/docx/editor-plugins.d.ts +3 -0
  19. package/dist/docx/file-commands.d.ts +5 -0
  20. package/dist/docx/format-dialogs.d.ts +6 -1
  21. package/dist/docx/insert-controller.d.ts +5 -0
  22. package/dist/docx/list-commands.d.ts +3 -1
  23. package/dist/docx/list-marker-display.d.ts +1 -1
  24. package/dist/docx/locales/en-app.d.ts +0 -1
  25. package/dist/docx/locales/en-ribbon.d.ts +51 -0
  26. package/dist/docx/locales/en.d.ts +51 -1
  27. package/dist/docx/localization-strings.d.ts +51 -1
  28. package/dist/docx/paragraph-styles.d.ts +1 -1
  29. package/dist/docx/protection-controls.d.ts +4 -0
  30. package/dist/docx/restrict-editing-pane.d.ts +14 -0
  31. package/dist/docx/ribbon-action.d.ts +4 -0
  32. package/dist/docx/ribbon-icons.d.ts +1 -0
  33. package/dist/docx/search-controller.d.ts +12 -5
  34. package/dist/docx/search-document.d.ts +32 -0
  35. package/dist/docx.js +1182 -384
  36. package/dist/export/pdf-embedded-font.d.ts +65 -0
  37. package/dist/export/pdf-fonts.d.ts +14 -0
  38. package/dist/export/pdf-vector.d.ts +84 -0
  39. package/dist/fonts/catalog.d.ts +1 -0
  40. package/dist/index.js +4 -4
  41. package/dist/pptx/ai/bridge-factory.d.ts +4 -1
  42. package/dist/pptx/ai/bridge-factory.d.ts.map +1 -1
  43. package/dist/pptx/ai/config.d.ts +1 -1
  44. package/dist/pptx/ai/config.d.ts.map +1 -1
  45. package/dist/pptx/ai/host.cjs +36 -36
  46. package/dist/pptx/ai/host.mjs +1 -1
  47. package/dist/pptx/ai/index.cjs +50 -43
  48. package/dist/pptx/ai/index.mjs +10 -3
  49. package/dist/pptx/ai/system-prompt.d.ts +1 -1
  50. package/dist/pptx/ai/system-prompt.d.ts.map +1 -1
  51. package/dist/pptx/ai/tool-summary.d.ts.map +1 -1
  52. package/dist/pptx/ai/tools/mcp-registry.d.ts.map +1 -1
  53. package/dist/pptx/{chunk-KGDMMWIY.mjs → chunk-2AK5MS6H.mjs} +11 -0
  54. package/dist/pptx/{chunk-M55PNMFQ.cjs → chunk-4OKSYRYA.cjs} +11 -0
  55. package/dist/pptx/{chunk-GPQP2R5Y.mjs → chunk-4RSRCNRM.mjs} +177 -13
  56. package/dist/pptx/{chunk-NPYNJOK2.cjs → chunk-6JJD3LFT.cjs} +182 -17
  57. package/dist/pptx/{chunk-46HIE4IE.cjs → chunk-CRV7G4GC.cjs} +8 -0
  58. package/dist/pptx/{chunk-5EERUTDC.mjs → chunk-KNCCSPAV.mjs} +1 -1
  59. package/dist/pptx/{chunk-GKQULDFF.cjs → chunk-SI7GQYSL.cjs} +42 -42
  60. package/dist/pptx/{chunk-6MEBLCNK.mjs → chunk-WQI3NLMY.mjs} +8 -0
  61. package/dist/pptx/dom/index.cjs +384 -384
  62. package/dist/pptx/dom/index.mjs +6 -6
  63. package/dist/pptx/i18n/index.cjs +6 -6
  64. package/dist/pptx/i18n/index.mjs +1 -1
  65. package/dist/pptx/i18n/translations-en.d.ts.map +1 -1
  66. package/dist/pptx/index.cjs +3037 -3033
  67. package/dist/pptx/index.mjs +2 -2
  68. package/dist/pptx/render/controller/custom-shows-controller.d.ts +93 -0
  69. package/dist/pptx/render/controller/custom-shows-controller.d.ts.map +1 -0
  70. package/dist/pptx/render/controller/index.d.ts +2 -0
  71. package/dist/pptx/render/controller/index.d.ts.map +1 -1
  72. package/dist/pptx/render/custom-shows.d.ts +10 -2
  73. package/dist/pptx/render/custom-shows.d.ts.map +1 -1
  74. package/dist/pptx/{smartart-insert-preview-6BITTUI4.mjs → smartart-insert-preview-JH5TXECK.mjs} +3 -3
  75. package/dist/pptx/{smartart-insert-preview-BUOS5XQR.cjs → smartart-insert-preview-QWROEVZL.cjs} +4 -4
  76. package/dist/teams.js +2 -2
  77. package/dist/theme-bridge.d.ts +1 -0
  78. package/dist/visio/binding.d.ts +2 -1
  79. package/dist/visio/canvas-editing.d.ts +4 -0
  80. package/dist/visio/controller.d.ts +3 -0
  81. package/dist/visio/locales/de-backstage.d.ts +2 -0
  82. package/dist/visio/locales/en-backstage.d.ts +2 -0
  83. package/dist/visio/locales/es-backstage.d.ts +2 -0
  84. package/dist/visio/locales/fr-backstage.d.ts +2 -0
  85. package/dist/visio/locales/zh-CN-backstage.d.ts +2 -0
  86. package/dist/visio/paragraph-layout.d.ts +6 -1
  87. package/dist/visio/pdf-path.d.ts +37 -0
  88. package/dist/visio/pdf-svg-gradient.d.ts +23 -0
  89. package/dist/visio/pdf-svg-style.d.ts +20 -0
  90. package/dist/visio/pdf-svg-text.d.ts +8 -0
  91. package/dist/visio/pdf-svg.d.ts +22 -0
  92. package/dist/visio/render-bevel.d.ts +15 -0
  93. package/dist/visio/ribbon-action.d.ts +47 -5
  94. package/dist/visio/ribbon-arrange.d.ts +9 -0
  95. package/dist/visio/ribbon-contextual-formats.d.ts +18 -0
  96. package/dist/visio/ribbon-localize.d.ts +6 -0
  97. package/dist/visio/ribbon-org-chart.d.ts +8 -0
  98. package/dist/visio/ribbon-router.d.ts +18 -0
  99. package/dist/visio/ribbon-shape-format.d.ts +7 -0
  100. package/dist/visio/ribbon-shape-styles.d.ts +2 -0
  101. package/dist/visio/ribbon-size-fields.d.ts +5 -0
  102. package/dist/visio/ribbon-swimlane.d.ts +9 -0
  103. package/dist/visio/ribbon-themes.d.ts +13 -3
  104. package/dist/visio/ribbon.d.ts +5 -1
  105. package/dist/visio/shapes-files-ui.d.ts +1 -1
  106. package/dist/visio/tab-layout.d.ts +15 -0
  107. package/dist/visio/template-thumbnails.d.ts +10 -0
  108. package/dist/visio/viewer-backstage.d.ts +13 -3
  109. package/dist/visio/viewer-contextual-tabs.d.ts +21 -0
  110. package/dist/visio/viewer-control-handles.d.ts +19 -0
  111. package/dist/visio/viewer-data-advanced.d.ts +25 -0
  112. package/dist/visio/viewer-data-fields.d.ts +16 -0
  113. package/dist/visio/viewer-data-labels.d.ts +8 -0
  114. package/dist/visio/viewer-data-visualizer.d.ts +25 -0
  115. package/dist/visio/viewer-data.d.ts +6 -0
  116. package/dist/visio/viewer-diagram-parts.d.ts +9 -1
  117. package/dist/visio/viewer-element.d.ts +10 -0
  118. package/dist/visio/viewer-export.d.ts +1 -6
  119. package/dist/visio/viewer-file-commands.d.ts +6 -1
  120. package/dist/visio/viewer-guides.d.ts +8 -1
  121. package/dist/visio/viewer-inline-size.d.ts +15 -0
  122. package/dist/visio/viewer-insert-dialog.d.ts +1 -0
  123. package/dist/visio/viewer-new-drawing.d.ts +3 -2
  124. package/dist/visio/viewer-org-chart.d.ts +30 -0
  125. package/dist/visio/viewer-pdf-options.d.ts +26 -0
  126. package/dist/visio/viewer-pdf.d.ts +47 -0
  127. package/dist/visio/viewer-picture-format.d.ts +20 -0
  128. package/dist/visio/viewer-resize-handles.d.ts +13 -1
  129. package/dist/visio/viewer-shape-actions.d.ts +12 -0
  130. package/dist/visio/viewer-shape-styles.d.ts +1 -1
  131. package/dist/visio/viewer-swimlanes.d.ts +34 -0
  132. package/dist/visio.js +6007 -1086
  133. package/dist/xlsx/dialogs/audit-dialogs.d.ts +9 -0
  134. package/dist/xlsx/dialogs/custom-lists.d.ts +6 -0
  135. package/dist/xlsx/dialogs/help-dialogs.d.ts +2 -2
  136. package/dist/xlsx/dialogs/sort-dialog.d.ts +3 -3
  137. package/dist/xlsx/dialogs/watch-window.d.ts +4 -0
  138. package/dist/xlsx/grid/audit-layer.d.ts +3 -0
  139. package/dist/xlsx/grid/grid-view.d.ts +23 -1
  140. package/dist/xlsx/grid/pane-chrome.d.ts +2 -0
  141. package/dist/xlsx/grid/split-bars.d.ts +2 -0
  142. package/dist/xlsx/grid/styles.d.ts +1 -1
  143. package/dist/xlsx/sheet-tabs/drag.d.ts +1 -2
  144. package/dist/xlsx.js +1074 -239
  145. package/package.json +2 -2
@@ -0,0 +1,25 @@
1
+ import type { VisioPage } from 'ooxml-core/visio';
2
+ import { type VisioVisualizerVariant } from 'ooxml-core/visio/ui';
3
+ import { type ViewerController } from './controller.js';
4
+ import { type DataFilePicker } from './viewer-data-import.js';
5
+ type Run = (action: () => Promise<void>, success: string) => void;
6
+ /**
7
+ * Data Visualizer: draws a flowchart from a table of process steps (Process Step ID,
8
+ * Description, Next Step ID, Connector Label, Shape Type, Function) read from a local CSV or
9
+ * workbook, and redraws it from the edited table. Nothing leaves the device.
10
+ */
11
+ export declare class ViewerDataVisualizer {
12
+ #private;
13
+ private readonly controller;
14
+ private readonly announce;
15
+ private readonly run;
16
+ private readonly picker;
17
+ constructor(controller: ViewerController, announce: (message: string) => void, run: Run, picker: DataFilePicker);
18
+ /** Whether this page already holds a flowchart this command drew. */
19
+ drawn(page: VisioPage | undefined): boolean;
20
+ create(variant: VisioVisualizerVariant): Promise<void>;
21
+ refresh(): Promise<void>;
22
+ /** A CSV with the expected columns and a small example, for the person to edit. */
23
+ downloadTemplate(): void;
24
+ }
25
+ export {};
@@ -4,6 +4,9 @@ import { InsertDialog } from './viewer-insert-dialog.js';
4
4
  import { ViewerDataSources } from './viewer-data-sources.js';
5
5
  import { ViewerDataLinks } from './viewer-data-links.js';
6
6
  import { ViewerShapeData } from './viewer-shape-data.js';
7
+ import { ViewerGraphicFields } from './viewer-data-fields.js';
8
+ import { ViewerAdvancedGraphics } from './viewer-data-advanced.js';
9
+ import { ViewerDataVisualizer } from './viewer-data-visualizer.js';
7
10
  type Run = (action: () => Promise<void>, success: string) => void;
8
11
  /**
9
12
  * Visio's Data tab: Quick and Custom Import of a local workbook or CSV into a saved recordset,
@@ -20,6 +23,9 @@ export declare class ViewerData {
20
23
  readonly graphics: InsertDialog;
21
24
  readonly links: ViewerDataLinks;
22
25
  readonly shapeData: ViewerShapeData;
26
+ readonly fields: ViewerGraphicFields;
27
+ readonly advanced: ViewerAdvancedGraphics;
28
+ readonly visualizer: ViewerDataVisualizer;
23
29
  constructor(root: ShadowRoot, controller: ViewerController, announce: (message: string) => void, run: Run);
24
30
  handle(command: VisioDataCommand): void;
25
31
  wire(viewport: HTMLElement): () => void;
@@ -1,11 +1,12 @@
1
1
  import type { ViewerController, ViewerState } from './controller.js';
2
- import type { VisioDiagramPartAction } from './ribbon-action.js';
2
+ import type { VisioContainerAction, VisioContainerOptionAction, VisioDiagramPartAction } from './ribbon-action.js';
3
3
  import { type DiagramPart } from './ribbon-diagram-parts.js';
4
4
  /**
5
5
  * Insert > Container and Callout (and the shape menu's Container): one core edit each, so undo
6
6
  * restores the page in one step. Availability follows the selection; core admission decides.
7
7
  */
8
8
  export declare class ViewerDiagramParts {
9
+ #private;
9
10
  private readonly root;
10
11
  private readonly controller;
11
12
  private readonly edit;
@@ -13,5 +14,12 @@ export declare class ViewerDiagramParts {
13
14
  constructor(root: ShadowRoot, controller: ViewerController, edit: (run: () => Promise<void>, message: string) => void, revealText: () => void);
14
15
  reason(state: ViewerState, part: DiagramPart): string | undefined;
15
16
  run(action: VisioDiagramPartAction): void;
17
+ /**
18
+ * Container Format > Margins, Automatic Resize and Lock Container: one core option edit. The
19
+ * lock toggle reads the container's stored lock, so it flips whatever the page shows.
20
+ */
21
+ containerOptions(action: VisioContainerOptionAction): void;
22
+ /** Container Format > Fit to Contents, Select Contents and Disband Container. */
23
+ container(command: VisioContainerAction['command']): void;
16
24
  render(state: ViewerState): void;
17
25
  }
@@ -4,11 +4,13 @@ import { ViewerController } from './controller.js';
4
4
  import { type RibbonAddInTab } from '../ribbon/add-in-tabs.js';
5
5
  import { type BackstagePage } from './backstage.js';
6
6
  import type { CreateVsdxOptions } from 'ooxml-core/visio';
7
+ import type { VisioTemplateId } from 'ooxml-core/visio/ui';
7
8
  import type { VisioCustomization } from 'ooxml-core/visio/ui';
8
9
  import type { DocumentStorage } from 'ooxml-core/embedding';
9
10
  import { type StatusBarTheme } from './viewer-options.js';
10
11
  import type { VisioCollaborationOptions, VisioCollaborationState } from './collaboration-types.js';
11
12
  import { type SvgExportOptions, type SvgExportResult } from './export-svg.js';
13
+ import type { PdfFontFile } from '../export/pdf-embedded-font.js';
12
14
  import { type CurrentPagePrintSnapshotOptions, type PrintSnapshot } from './print-snapshot.js';
13
15
  declare const BaseElement: typeof HTMLElement;
14
16
  export declare class VisioViewerElement extends BaseElement {
@@ -44,6 +46,12 @@ export declare class VisioViewerElement extends BaseElement {
44
46
  */
45
47
  get storage(): DocumentStorage | null;
46
48
  set storage(value: DocumentStorage | null | undefined);
49
+ /**
50
+ * TrueType fonts File > Export > PDF embeds (as subsets) so text outside the standard fonts'
51
+ * character set, or in a particular typeface, stays real text. The host supplies the bytes
52
+ * (nothing is bundled); a font whose licence forbids embedding is reported and skipped.
53
+ */
54
+ pdfFonts: readonly PdfFontFile[];
47
55
  /** What `collaboration-change` last reported. */
48
56
  get collaborationState(): VisioCollaborationState;
49
57
  /** Leaves the room and clears `collaboration`. A host-owned session stays alive. */
@@ -79,6 +87,8 @@ export declare class VisioViewerElement extends BaseElement {
79
87
  load(source: VsdxSource): Promise<void>;
80
88
  /** Create a source-backed drawing and name only the accepted request. */
81
89
  createBlankDrawing(options?: CreateVsdxOptions): Promise<void>;
90
+ /** Create a drawing from a File > New template (Blank Drawing, flowcharts, org chart). */
91
+ createFromTemplate(template: VisioTemplateId): Promise<void>;
82
92
  /** Leave Visio's File backstage and return to the drawing. */
83
93
  closeBackstage(): void;
84
94
  /** Open Visio's File backstage at a page (Info by default). */
@@ -1,5 +1,5 @@
1
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. */
2
+ /** Raster resolution of PNG output and of PDF picture-page fallbacks; large pages are scaled down to the canvas cap. */
3
3
  export declare const EXPORT_DPI = 150;
4
4
  /** Pixel size of a page at `dpi`, scaled down so neither side exceeds the canvas cap. */
5
5
  export declare function rasterSize(widthIn: number, heightIn: number, dpi?: number): {
@@ -10,8 +10,3 @@ export declare function rasterSize(widthIn: number, heightIn: number, dpi?: numb
10
10
  export declare function rasterizePage(doc: Document, model: VisioDocument, pageIndex: number, dpi?: number): Promise<HTMLCanvasElement>;
11
11
  /** The current page as a PNG picture. */
12
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>;
@@ -4,7 +4,12 @@ import { type DocumentStorage, type VisioFileCommand } from 'ooxml-core/embeddin
4
4
  * Excel. Returns false when a host canceled it to handle the command itself.
5
5
  */
6
6
  export declare function announceFileCommand(host: HTMLElement, command: VisioFileCommand): boolean;
7
- /** The name a drawing is saved under in host storage: its own name as a .vsdx. */
7
+ /**
8
+ * The extension a drawing is saved with: .vsdm for a macro-enabled drawing or template (its VBA
9
+ * project is kept, never run), .vsdx for everything else (a template saves as a drawing).
10
+ */
11
+ export declare function drawingExtension(fileName: string): 'vsdx' | 'vsdm';
12
+ /** The name a drawing is saved under in host storage: its own name as a .vsdx (or .vsdm). */
8
13
  export declare function storageFileName(fileName: string): string;
9
14
  /** Saves the drawing's bytes to the host's storage; resolves with the name it now has. */
10
15
  export declare function saveDrawingToStorage(storage: DocumentStorage, bytes: Uint8Array, fileName: string): Promise<string>;
@@ -1,5 +1,5 @@
1
1
  import { type VisioPage } from 'ooxml-core/visio';
2
- import { type VisioSnapGrid, type VisioPagePoint } from 'ooxml-core/visio/ui';
2
+ import { type VisioResizeSizeMatch, type VisioResizeSnapOptions, type VisioSnapGrid, type VisioSnapResult, type VisioPagePoint } from 'ooxml-core/visio/ui';
3
3
  import type { ViewerController, ViewerState } from './controller.js';
4
4
  /**
5
5
  * View > Guides and View > Dynamic Grid. Guides are the page's `Type="Guide"` shapes, drawn as
@@ -24,6 +24,13 @@ export declare class ViewerGuides {
24
24
  * to omit grid snapping). Grid visibility is independent. Unchanged when no snapping is active.
25
25
  */
26
26
  snap(page: VisioPage, ids: readonly string[], delta: VisioPagePoint, grid?: number | VisioSnapGrid, axis?: 'x' | 'y'): VisioPagePoint;
27
+ /**
28
+ * The snapping a resize drag uses (Dynamic Grid and shown guides, with the same threshold as a
29
+ * move), or undefined when none of it is on. Snap & Glue switched off leaves it undefined too.
30
+ */
31
+ resizeSnapSettings(): VisioResizeSnapOptions | undefined;
32
+ /** Draws a resize's alignment lines and size-match outlines, replacing the earlier hints. */
33
+ resizeHints(page: VisioPage, lines: VisioSnapResult['lines'], matches: readonly VisioResizeSizeMatch[]): void;
27
34
  clearHints(): void;
28
35
  wire(): () => void;
29
36
  render(state: ViewerState): void;
@@ -0,0 +1,15 @@
1
+ import type { ViewerController, ViewerState } from './controller.js';
2
+ /**
3
+ * The Width and Height boxes in the Size group of the Shape, Picture and Container Format tabs.
4
+ * Each commits one resize of the selected shape through the same core command the Size & Position
5
+ * pane uses, so the two always agree.
6
+ */
7
+ export declare class ViewerInlineSize {
8
+ #private;
9
+ private readonly root;
10
+ private readonly controller;
11
+ constructor(root: ShadowRoot, controller: ViewerController);
12
+ wire(): () => void;
13
+ inputs(): HTMLInputElement[];
14
+ render(state: ViewerState): void;
15
+ }
@@ -36,6 +36,7 @@ export declare class InsertDialog {
36
36
  choices(name: string, values: readonly string[], current: string, options?: {
37
37
  labels?: readonly string[];
38
38
  none?: boolean;
39
+ noneLabel?: string;
39
40
  }): void;
40
41
  busy(value: boolean): void;
41
42
  }
@@ -1,5 +1,6 @@
1
+ import { type VisioTemplateId } from 'ooxml-core/visio/ui';
1
2
  /** File New and its shortcut share the element's source lifecycle. */
2
- export declare function wireNewDrawing(root: ShadowRoot, create: () => Promise<void>, busy: () => boolean, announce: (message: string) => void): {
3
- run(): void;
3
+ export declare function wireNewDrawing(root: ShadowRoot, create: (template?: VisioTemplateId) => Promise<void>, busy: () => boolean, announce: (message: string) => void): {
4
+ run(template?: VisioTemplateId): void;
4
5
  dispose(): void;
5
6
  };
@@ -0,0 +1,30 @@
1
+ import { visioOrgDeletePosition } from 'ooxml-core/visio/ui';
2
+ import { type ViewerController, type ViewerState } from './controller.js';
3
+ import type { VisioOrgChartAction } from './ribbon-action.js';
4
+ type Command = VisioOrgChartAction['command'];
5
+ /** The org chart position the first selected shape is, on the displayed page. */
6
+ export declare function orgChartSelection(state: ViewerState): {
7
+ pageId: string;
8
+ id: string;
9
+ } | undefined;
10
+ /**
11
+ * The edits that delete the selected shape when it is an org chart position: Delete Position,
12
+ * which removes its connectors and joins its subordinates to its manager. The Delete key uses
13
+ * it for a lone selected position, as Visio's org chart does.
14
+ */
15
+ export declare function orgChartDeleteSelection(state: ViewerState): {
16
+ edits: ReturnType<typeof visioOrgDeletePosition>;
17
+ message: string;
18
+ } | undefined;
19
+ /** The Org Chart tab's controller: one edit batch per command, so undo steps back one command. */
20
+ export declare class ViewerOrgChart {
21
+ #private;
22
+ private readonly root;
23
+ private readonly controller;
24
+ private readonly edit;
25
+ constructor(root: ShadowRoot, controller: ViewerController, edit: (run: () => Promise<void>, message: string) => void);
26
+ reason(state: ViewerState, command: Command): string | undefined;
27
+ run(action: VisioOrgChartAction): void;
28
+ render(state: ViewerState): void;
29
+ }
30
+ export {};
@@ -0,0 +1,26 @@
1
+ import type { VisioDocument } from 'ooxml-core/visio';
2
+ import type { PdfExportOptions, PdfExportResult } from './viewer-pdf.js';
3
+ /** What the Export page asks of the PDF: Visio's Publish options "Page range". */
4
+ export type PdfRangeChoice = {
5
+ scope: 'all';
6
+ } | {
7
+ scope: 'current';
8
+ } | {
9
+ scope: 'range';
10
+ from: number;
11
+ to: number;
12
+ };
13
+ /** The result summary the Export page shows after a PDF is made. */
14
+ export type PdfReportSummary = Pick<PdfExportResult, 'pages' | 'embeddedFonts' | 'refusedFonts'>;
15
+ /** The "Publish options" panel: a page range, and the report of the last export. */
16
+ export declare function pdfOptionsPanel(doc: Document): HTMLElement;
17
+ /** The choice on the panel, clamped to `pageCount` foreground pages. */
18
+ export declare function readPdfChoice(root: ParentNode, pageCount: number): PdfRangeChoice;
19
+ /** Keep the range inputs inside the drawing's foreground pages. */
20
+ export declare function syncPdfPanel(root: ParentNode, model: VisioDocument | null | undefined): void;
21
+ /** The PDF export options for a choice (the current page is `pageIndex`). */
22
+ export declare function pdfOptionsFor(choice: PdfRangeChoice, pageIndex: number): PdfExportOptions;
23
+ /** Lines of the per-page report: how each page was drawn and what it lost. */
24
+ export declare function pdfReportLines(summary: PdfReportSummary): string[];
25
+ /** Show the report of the last PDF export on the panel (or hide it with `undefined`). */
26
+ export declare function showPdfReport(root: ParentNode, summary: PdfReportSummary | undefined): void;
@@ -0,0 +1,47 @@
1
+ import type { VisioDocument } from 'ooxml-core/visio';
2
+ import { type PdfFontFile } from '../export/pdf-embedded-font.js';
3
+ /** Which pages the PDF holds. Background pages are always drawn behind the pages that use them. */
4
+ export interface PdfExportOptions {
5
+ /** `current` exports only `pageIndex` (a foreground page); default `all`. */
6
+ scope?: 'all' | 'current';
7
+ pageIndex?: number;
8
+ /** 1-based inclusive range over the foreground pages. */
9
+ from?: number;
10
+ to?: number;
11
+ /**
12
+ * TrueType fonts to embed (subset) so text outside WinAnsi, or in a typeface the standard
13
+ * fonts do not match, stays real text. The host supplies the bytes; none are bundled.
14
+ */
15
+ fonts?: readonly PdfFontFile[];
16
+ }
17
+ export interface PdfPageReport {
18
+ /** Index in the document's page list. */
19
+ index: number;
20
+ name: string;
21
+ /** `vector` is real paths and text; `picture` is a raster of the page, with `fallback` saying why. */
22
+ mode: 'vector' | 'picture';
23
+ fallback: string[];
24
+ /** Effects the vector page leaves out or simplifies. */
25
+ degraded: string[];
26
+ }
27
+ export interface PdfExportResult {
28
+ blob: Blob;
29
+ pages: PdfPageReport[];
30
+ /** Families of the supplied fonts that were embedded as subsets. */
31
+ embeddedFonts: string[];
32
+ /** Supplied fonts that were not embedded (not TrueType, or the licence forbids embedding). */
33
+ refusedFonts: string[];
34
+ }
35
+ /** The foreground page indexes a PDF export covers. */
36
+ export declare function pdfPageIndexes(model: VisioDocument, options?: PdfExportOptions): number[];
37
+ /**
38
+ * Pages as a PDF: vector paths, real (selectable) text and embedded pictures. Text uses the
39
+ * 14 standard fonts (not embedded) unless the host passes `fonts`, which are subset and embedded.
40
+ * Gradients are PDF shadings and shadows are offset copies; glow is a hard-edged halo; blur,
41
+ * soft edges and reflections are not drawn. A page the vector path cannot represent (text no
42
+ * supplied font covers, charts, patterns) becomes a picture page. The report says which and why
43
+ * (`PdfPageReport.degraded` and `fallback`).
44
+ */
45
+ export declare function exportDocumentPdfDetailed(doc: Document, model: VisioDocument, options?: PdfExportOptions): Promise<PdfExportResult>;
46
+ /** The PDF only; see `exportDocumentPdfDetailed` for the per-page report. */
47
+ export declare function exportDocumentPdf(doc: Document, model: VisioDocument, options?: PdfExportOptions): Promise<Blob>;
@@ -0,0 +1,20 @@
1
+ import type { ViewerController, ViewerState } from './controller.js';
2
+ import type { VisioPictureAction } from './ribbon-action.js';
3
+ /** The picture a single selection names, when it is a picture on the current page. */
4
+ export declare function selectedPicture(state: ViewerState): {
5
+ pageId: string;
6
+ shapeId: string;
7
+ } | undefined;
8
+ /**
9
+ * Picture Format > Adjust (Brightness, Contrast) and Crop: one core edit per command, on the
10
+ * selected picture. Core admission decides whether the picture can take it.
11
+ */
12
+ export declare class ViewerPictureFormat {
13
+ private readonly root;
14
+ private readonly controller;
15
+ private readonly edit;
16
+ constructor(root: ShadowRoot, controller: ViewerController, edit: (run: () => Promise<void>, message: string) => void);
17
+ reason(state: ViewerState): string | undefined;
18
+ run(action: VisioPictureAction): void;
19
+ render(state: ViewerState): void;
20
+ }
@@ -1,5 +1,8 @@
1
+ import type { VisioPage } from 'ooxml-core/visio';
2
+ import { type VisioResizeSizeMatch, type VisioResizeSnapOptions, type VisioSnapResult } from 'ooxml-core/visio/ui';
1
3
  import type { ViewerController, ViewerState } from './controller.js';
2
- /** Eight source-backed selection handles; saved content is never speculatively resized. */
4
+ /** Eight source-backed selection handles; saved content is never speculatively resized.
5
+ * Like Visio, corners keep the proportions and Shift keeps them on every handle. */
3
6
  export declare class ViewerResizeHandles {
4
7
  #private;
5
8
  private readonly viewport;
@@ -8,6 +11,15 @@ export declare class ViewerResizeHandles {
8
11
  constructor(viewport: HTMLElement, controller: ViewerController, options: {
9
12
  active(): boolean;
10
13
  announce(message: string): void;
14
+ /**
15
+ * Dynamic Grid and Guides for a resize: `settings` is undefined when snapping is off,
16
+ * `hint` draws the alignment lines and size matches, `clear` removes them.
17
+ */
18
+ snap?: {
19
+ settings(): VisioResizeSnapOptions | undefined;
20
+ hint(page: VisioPage, lines: VisioSnapResult['lines'], matches: VisioResizeSizeMatch[]): void;
21
+ clear(): void;
22
+ };
11
23
  });
12
24
  render(state: ViewerState): void;
13
25
  wire(): () => void;
@@ -0,0 +1,12 @@
1
+ import type { VisioAction } from 'ooxml-core/visio';
2
+ import { type ViewerController } from './controller.js';
3
+ /** Visio orders a shape's actions by SortKey when any row has one, otherwise by row. */
4
+ export declare function orderedActions(actions: readonly VisioAction[]): VisioAction[];
5
+ /** Why an action cannot run now, or undefined when it can. */
6
+ export declare function actionBlock(action: VisioAction, editable: boolean): string | undefined;
7
+ /**
8
+ * Adds the selected shape's Actions rows to its context menu, as Visio lists them below the
9
+ * built-in commands: checked and disabled states are kept, and an action this editor cannot run
10
+ * is shown disabled with the reason as its tip. Called each time the shape menu opens.
11
+ */
12
+ export declare function syncShapeActions(menu: HTMLElement, target: 'shape' | 'page', controller: Pick<ViewerController, 'state' | 'applyEdits'>, announce: (message: string) => void): void;
@@ -4,6 +4,6 @@ import type { RibbonCommand } from './ribbon-parts.js';
4
4
  export declare function pageAccentColor(page: VisioPage | undefined, accent: number): string;
5
5
  /**
6
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.
7
+ * the same admission as Fill and Line, as do Bevel and 3-D Rotation.
8
8
  */
9
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,34 @@
1
+ import type { VisioEdit } from 'ooxml-core/visio';
2
+ import { type VisioSwimlaneInfo } from 'ooxml-core/visio/ui';
3
+ import type { VisioPage } from 'ooxml-core/visio';
4
+ import { type ViewerController, type ViewerState } from './controller.js';
5
+ import type { VisioSwimlaneAction } from './ribbon-action.js';
6
+ type Command = VisioSwimlaneAction['command'];
7
+ /** The flowchart the first selected shape belongs to, and the lane it is (or sits in). */
8
+ export declare function swimlaneSelection(state: ViewerState): {
9
+ info: VisioSwimlaneInfo;
10
+ pageId: string;
11
+ lane?: string;
12
+ isLane: boolean;
13
+ } | undefined;
14
+ /**
15
+ * A resize drag on a flowchart's lane or frame. null: the selection is not part of a flowchart,
16
+ * so the ordinary resize applies. undefined: refused (the frame follows its lanes). Otherwise
17
+ * the lane edit that stacks the other lanes and carries their shapes.
18
+ */
19
+ export declare function swimlaneResizeEdits(page: VisioPage, shapeIds: readonly string[], frame: {
20
+ width: number;
21
+ height: number;
22
+ }): VisioEdit[] | null | undefined;
23
+ /** The tab's controllers: one or two core edits per command, so undo steps back one command. */
24
+ export declare class ViewerSwimlanes {
25
+ #private;
26
+ private readonly root;
27
+ private readonly controller;
28
+ private readonly edit;
29
+ constructor(root: ShadowRoot, controller: ViewerController, edit: (run: () => Promise<void>, message: string) => void);
30
+ reason(state: ViewerState, command: Command): string | undefined;
31
+ run(action: VisioSwimlaneAction): void;
32
+ render(state: ViewerState): void;
33
+ }
34
+ export {};