visio-angular-viewer 0.7.4 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +244 -3
- package/dist/types/packages/angular/src/building-blocks.d.ts +91 -0
- package/dist/types/packages/angular/src/index.d.ts +1 -0
- package/dist/types/packages/bindings/src/angular.d.ts +1 -0
- package/dist/types/packages/bindings/src/building-blocks.d.ts +53 -0
- package/package.json +10 -5
package/dist/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import * as ui from "ooxml-ui/visio";
|
|
2
|
+
import { ViewerController, createWorkerParser, eventKeys, mountViewer, propertyKeys } from "ooxml-ui/visio";
|
|
3
|
+
import { Component, DestroyRef, ElementRef, EventEmitter, Injectable, Input, Output, computed, effect, inject, signal, untracked } from "@angular/core";
|
|
4
|
+
import * as officeTheme from "ooxml-ui/theme";
|
|
3
5
|
export * from "ooxml-ui/visio";
|
|
4
6
|
export * from "visio-core";
|
|
5
7
|
//#region packages/bindings/src/common.ts
|
|
@@ -287,6 +289,7 @@ __decorate([Input()], VisioViewerComponent.prototype, "document", void 0);
|
|
|
287
289
|
__decorate([Input()], VisioViewerComponent.prototype, "pageIndex", void 0);
|
|
288
290
|
__decorate([Input()], VisioViewerComponent.prototype, "zoom", void 0);
|
|
289
291
|
__decorate([Input()], VisioViewerComponent.prototype, "showToolbar", void 0);
|
|
292
|
+
__decorate([Input()], VisioViewerComponent.prototype, "canEdit", void 0);
|
|
290
293
|
__decorate([Input()], VisioViewerComponent.prototype, "ribbonAddIns", void 0);
|
|
291
294
|
__decorate([Input()], VisioViewerComponent.prototype, "events", void 0);
|
|
292
295
|
__decorate([Output()], VisioViewerComponent.prototype, "documentLoad", void 0);
|
|
@@ -303,4 +306,242 @@ VisioViewerComponent = __decorate([Component({
|
|
|
303
306
|
template: ""
|
|
304
307
|
})], VisioViewerComponent);
|
|
305
308
|
//#endregion
|
|
306
|
-
|
|
309
|
+
//#region packages/bindings/src/building-blocks.ts
|
|
310
|
+
function buildingBlock(key) {
|
|
311
|
+
const value = Reflect.get(ui, key);
|
|
312
|
+
if (typeof value !== "function") throw new Error("Update ooxml-ui to use Visio building blocks.");
|
|
313
|
+
return value;
|
|
314
|
+
}
|
|
315
|
+
/** Framework-neutral ownership only; each adapter supplies its own reactive state. */
|
|
316
|
+
function createBuildingBlockSession() {
|
|
317
|
+
const controller = new ViewerController(createWorkerParser());
|
|
318
|
+
let options = {};
|
|
319
|
+
let source;
|
|
320
|
+
let host = null;
|
|
321
|
+
let disposeCanvas;
|
|
322
|
+
let destroyed = false;
|
|
323
|
+
const stopEvents = controller.onEvent((name, detail) => {
|
|
324
|
+
if (name === "document-change") {
|
|
325
|
+
const change = detail;
|
|
326
|
+
options.onDocumentChange?.(change.document);
|
|
327
|
+
options.onDirtyChange?.(change.dirty);
|
|
328
|
+
} else if (name === "document-error") options.onDocumentError?.(detail);
|
|
329
|
+
});
|
|
330
|
+
const fit = () => {
|
|
331
|
+
if (host) buildingBlock("fitDiagramCanvas")(host, controller);
|
|
332
|
+
};
|
|
333
|
+
return {
|
|
334
|
+
controller,
|
|
335
|
+
mount(node) {
|
|
336
|
+
if (destroyed || node === host) return;
|
|
337
|
+
disposeCanvas?.();
|
|
338
|
+
disposeCanvas = void 0;
|
|
339
|
+
host = node;
|
|
340
|
+
if (node) disposeCanvas = buildingBlock("mountDiagramCanvas")(node, controller);
|
|
341
|
+
},
|
|
342
|
+
toolbar(locale = options.locale) {
|
|
343
|
+
return buildingBlock("diagramToolbarProps")(controller, fit, locale);
|
|
344
|
+
},
|
|
345
|
+
update(next) {
|
|
346
|
+
if (destroyed) return;
|
|
347
|
+
options = next;
|
|
348
|
+
controller.canEdit = next.canEdit !== false;
|
|
349
|
+
if (source === next.content) return;
|
|
350
|
+
source = next.content;
|
|
351
|
+
controller.cancelLoad();
|
|
352
|
+
if (!source) return;
|
|
353
|
+
const input = source;
|
|
354
|
+
controller.loadSource(async () => {
|
|
355
|
+
return input instanceof Blob ? new Uint8Array(await input.arrayBuffer()) : input;
|
|
356
|
+
}).catch(() => {});
|
|
357
|
+
},
|
|
358
|
+
destroy() {
|
|
359
|
+
if (destroyed) return;
|
|
360
|
+
destroyed = true;
|
|
361
|
+
disposeCanvas?.();
|
|
362
|
+
disposeCanvas = void 0;
|
|
363
|
+
host = null;
|
|
364
|
+
stopEvents();
|
|
365
|
+
controller.destroy();
|
|
366
|
+
}
|
|
367
|
+
};
|
|
368
|
+
}
|
|
369
|
+
/** Resolve the new optional-control theme API only when that control is mounted. */
|
|
370
|
+
function prepareDiagramBlock(host, kind) {
|
|
371
|
+
if (!host) return;
|
|
372
|
+
const prepare = Reflect.get(officeTheme, "prepareOfficeUiBlock");
|
|
373
|
+
if (typeof prepare !== "function") throw new Error("Update ooxml-ui to theme Visio building blocks.");
|
|
374
|
+
prepare(host, kind, "visio");
|
|
375
|
+
}
|
|
376
|
+
//#endregion
|
|
377
|
+
//#region packages/angular/src/building-blocks.ts
|
|
378
|
+
var ViewerBuildingBlocks = class ViewerBuildingBlocks {
|
|
379
|
+
session = createBuildingBlockSession();
|
|
380
|
+
controller = this.session.controller;
|
|
381
|
+
current = signal(this.controller.state);
|
|
382
|
+
state = this.current.asReadonly();
|
|
383
|
+
locale = signal(void 0);
|
|
384
|
+
toolbarProps = computed(() => {
|
|
385
|
+
this.state();
|
|
386
|
+
return this.session.toolbar(this.locale());
|
|
387
|
+
});
|
|
388
|
+
loading = computed(() => this.state().loading);
|
|
389
|
+
error = computed(() => this.state().error ?? this.state().edit.error);
|
|
390
|
+
mode = computed(() => this.state().canEdit ? "edit" : "view");
|
|
391
|
+
documentChange = new EventEmitter();
|
|
392
|
+
dirtyChange = new EventEmitter();
|
|
393
|
+
documentError = new EventEmitter();
|
|
394
|
+
canvasProps = { mount: (node) => this.session.mount(node) };
|
|
395
|
+
inspectorProps = { controller: this.controller };
|
|
396
|
+
constructor() {
|
|
397
|
+
this.update({});
|
|
398
|
+
const stop = this.controller.subscribe((state) => this.current.set(state));
|
|
399
|
+
inject(DestroyRef).onDestroy(() => {
|
|
400
|
+
stop();
|
|
401
|
+
this.session.destroy();
|
|
402
|
+
});
|
|
403
|
+
}
|
|
404
|
+
update(options) {
|
|
405
|
+
this.locale.set(options.locale);
|
|
406
|
+
this.session.update({
|
|
407
|
+
...options,
|
|
408
|
+
onDocumentChange: (document) => {
|
|
409
|
+
this.documentChange.emit(document);
|
|
410
|
+
options.onDocumentChange?.(document);
|
|
411
|
+
},
|
|
412
|
+
onDirtyChange: (dirty) => {
|
|
413
|
+
this.dirtyChange.emit(dirty);
|
|
414
|
+
options.onDirtyChange?.(dirty);
|
|
415
|
+
},
|
|
416
|
+
onDocumentError: (error) => {
|
|
417
|
+
this.documentError.emit(error);
|
|
418
|
+
options.onDocumentError?.(error);
|
|
419
|
+
}
|
|
420
|
+
});
|
|
421
|
+
}
|
|
422
|
+
};
|
|
423
|
+
ViewerBuildingBlocks = __decorate([Injectable()], ViewerBuildingBlocks);
|
|
424
|
+
/** Connect host signals to the scoped owner within an Angular injection context. */
|
|
425
|
+
function createViewerBuildingBlocks(options = () => ({})) {
|
|
426
|
+
const blocks = inject(ViewerBuildingBlocks);
|
|
427
|
+
effect(() => {
|
|
428
|
+
const next = options();
|
|
429
|
+
untracked(() => blocks.update(next));
|
|
430
|
+
});
|
|
431
|
+
return blocks;
|
|
432
|
+
}
|
|
433
|
+
var ViewerBuildingBlocksComponent = class ViewerBuildingBlocksComponent {
|
|
434
|
+
blocks = inject(ViewerBuildingBlocks);
|
|
435
|
+
content;
|
|
436
|
+
canEdit = true;
|
|
437
|
+
locale;
|
|
438
|
+
documentChange = this.blocks.documentChange;
|
|
439
|
+
dirtyChange = this.blocks.dirtyChange;
|
|
440
|
+
documentError = this.blocks.documentError;
|
|
441
|
+
ngOnInit() {
|
|
442
|
+
this.ngOnChanges();
|
|
443
|
+
}
|
|
444
|
+
ngOnChanges() {
|
|
445
|
+
this.blocks.update({
|
|
446
|
+
content: this.content,
|
|
447
|
+
canEdit: this.canEdit,
|
|
448
|
+
locale: this.locale
|
|
449
|
+
});
|
|
450
|
+
}
|
|
451
|
+
};
|
|
452
|
+
__decorate([Input()], ViewerBuildingBlocksComponent.prototype, "content", void 0);
|
|
453
|
+
__decorate([Input()], ViewerBuildingBlocksComponent.prototype, "canEdit", void 0);
|
|
454
|
+
__decorate([Input()], ViewerBuildingBlocksComponent.prototype, "locale", void 0);
|
|
455
|
+
__decorate([Output()], ViewerBuildingBlocksComponent.prototype, "documentChange", void 0);
|
|
456
|
+
__decorate([Output()], ViewerBuildingBlocksComponent.prototype, "dirtyChange", void 0);
|
|
457
|
+
__decorate([Output()], ViewerBuildingBlocksComponent.prototype, "documentError", void 0);
|
|
458
|
+
ViewerBuildingBlocksComponent = __decorate([Component({
|
|
459
|
+
selector: "visio-building-blocks",
|
|
460
|
+
standalone: true,
|
|
461
|
+
template: "<ng-content />",
|
|
462
|
+
providers: [ViewerBuildingBlocks]
|
|
463
|
+
})], ViewerBuildingBlocksComponent);
|
|
464
|
+
var DiagramCanvasComponent = class DiagramCanvasComponent {
|
|
465
|
+
blocks = inject(ViewerBuildingBlocks);
|
|
466
|
+
host = inject(ElementRef);
|
|
467
|
+
ngAfterViewInit() {
|
|
468
|
+
this.blocks.canvasProps.mount(this.host.nativeElement);
|
|
469
|
+
}
|
|
470
|
+
ngOnDestroy() {
|
|
471
|
+
this.blocks.canvasProps.mount(null);
|
|
472
|
+
}
|
|
473
|
+
};
|
|
474
|
+
DiagramCanvasComponent = __decorate([Component({
|
|
475
|
+
selector: "visio-diagram-canvas",
|
|
476
|
+
standalone: true,
|
|
477
|
+
template: ""
|
|
478
|
+
})], DiagramCanvasComponent);
|
|
479
|
+
var ToolbarComponent = class ToolbarComponent {
|
|
480
|
+
host = inject(ElementRef);
|
|
481
|
+
ngAfterViewInit() {
|
|
482
|
+
prepareDiagramBlock(this.host.nativeElement.querySelector("div"), "toolbar");
|
|
483
|
+
}
|
|
484
|
+
blocks = inject(ViewerBuildingBlocks);
|
|
485
|
+
};
|
|
486
|
+
ToolbarComponent = __decorate([Component({
|
|
487
|
+
selector: "visio-diagram-toolbar",
|
|
488
|
+
standalone: true,
|
|
489
|
+
template: `<div role="toolbar">
|
|
490
|
+
<button
|
|
491
|
+
type="button"
|
|
492
|
+
[disabled]="!blocks.toolbarProps().canUndo"
|
|
493
|
+
(click)="blocks.toolbarProps().onUndo()"
|
|
494
|
+
>
|
|
495
|
+
{{ blocks.toolbarProps().labels['Undo'] }}</button
|
|
496
|
+
><button
|
|
497
|
+
type="button"
|
|
498
|
+
[disabled]="!blocks.toolbarProps().canRedo"
|
|
499
|
+
(click)="blocks.toolbarProps().onRedo()"
|
|
500
|
+
>
|
|
501
|
+
{{ blocks.toolbarProps().labels['Redo'] }}</button
|
|
502
|
+
><button type="button" (click)="blocks.toolbarProps().onFit()">
|
|
503
|
+
{{ blocks.toolbarProps().labels['Fit to Window'] }}
|
|
504
|
+
</button>
|
|
505
|
+
</div>`
|
|
506
|
+
})], ToolbarComponent);
|
|
507
|
+
var PageNavigationComponent = class PageNavigationComponent {
|
|
508
|
+
host = inject(ElementRef);
|
|
509
|
+
ngAfterViewInit() {
|
|
510
|
+
prepareDiagramBlock(this.host.nativeElement.querySelector("select"), "tabs");
|
|
511
|
+
}
|
|
512
|
+
blocks = inject(ViewerBuildingBlocks);
|
|
513
|
+
change(event) {
|
|
514
|
+
this.blocks.toolbarProps().onPageChange(Number(event.target.value));
|
|
515
|
+
}
|
|
516
|
+
};
|
|
517
|
+
PageNavigationComponent = __decorate([Component({
|
|
518
|
+
selector: "visio-page-navigation",
|
|
519
|
+
standalone: true,
|
|
520
|
+
template: `<select
|
|
521
|
+
[attr.aria-label]="blocks.toolbarProps().labels['Page']"
|
|
522
|
+
[value]="blocks.toolbarProps().pageIndex"
|
|
523
|
+
(change)="change($event)"
|
|
524
|
+
>
|
|
525
|
+
@for (page of blocks.toolbarProps().pages; track page.id; let index = $index) {
|
|
526
|
+
<option [value]="index">{{ page.name }}</option>
|
|
527
|
+
}
|
|
528
|
+
</select>`
|
|
529
|
+
})], PageNavigationComponent);
|
|
530
|
+
var InspectorComponent = class InspectorComponent {
|
|
531
|
+
blocks = inject(ViewerBuildingBlocks);
|
|
532
|
+
host = inject(ElementRef);
|
|
533
|
+
stop;
|
|
534
|
+
ngAfterViewInit() {
|
|
535
|
+
this.stop = buildingBlock("mountDiagramInspector")(this.host.nativeElement, this.blocks.controller);
|
|
536
|
+
}
|
|
537
|
+
ngOnDestroy() {
|
|
538
|
+
this.stop?.();
|
|
539
|
+
}
|
|
540
|
+
};
|
|
541
|
+
InspectorComponent = __decorate([Component({
|
|
542
|
+
selector: "visio-diagram-inspector",
|
|
543
|
+
standalone: true,
|
|
544
|
+
template: ""
|
|
545
|
+
})], InspectorComponent);
|
|
546
|
+
//#endregion
|
|
547
|
+
export { DiagramCanvasComponent, InspectorComponent, PageNavigationComponent, ToolbarComponent, ViewerBuildingBlocks, ViewerBuildingBlocksComponent, VisioViewerComponent, createViewerBuildingBlocks };
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { EventEmitter, type AfterViewInit, type OnChanges, type OnDestroy, type OnInit } from '@angular/core';
|
|
2
|
+
import { type BuildingBlockOptions } from '../../bindings/src/building-blocks.js';
|
|
3
|
+
export declare class ViewerBuildingBlocks {
|
|
4
|
+
private readonly session;
|
|
5
|
+
readonly controller: import("ooxml-ui/visio").ViewerController;
|
|
6
|
+
private readonly current;
|
|
7
|
+
readonly state: import("@angular/core").Signal<import("ooxml-ui/visio").ViewerState>;
|
|
8
|
+
private readonly locale;
|
|
9
|
+
readonly toolbarProps: import("@angular/core").Signal<{
|
|
10
|
+
labels: {
|
|
11
|
+
[k: string]: string;
|
|
12
|
+
};
|
|
13
|
+
canEdit: boolean;
|
|
14
|
+
pageIndex: number;
|
|
15
|
+
pages: {
|
|
16
|
+
id: string;
|
|
17
|
+
name: string;
|
|
18
|
+
}[];
|
|
19
|
+
zoom: number;
|
|
20
|
+
selection: readonly import("ooxml-ui/visio").VisioShapeSelection[];
|
|
21
|
+
canUndo: boolean;
|
|
22
|
+
canRedo: boolean;
|
|
23
|
+
canDuplicate: boolean;
|
|
24
|
+
canGroup: boolean;
|
|
25
|
+
canUngroup: boolean;
|
|
26
|
+
onPageChange: (index: number) => void;
|
|
27
|
+
onZoomChange: (zoom: number) => void;
|
|
28
|
+
onFit: () => void;
|
|
29
|
+
onUndo: () => Promise<void>;
|
|
30
|
+
onRedo: () => Promise<void>;
|
|
31
|
+
onDuplicate: () => Promise<void>;
|
|
32
|
+
onGroup: () => Promise<void>;
|
|
33
|
+
onUngroup: () => Promise<void>;
|
|
34
|
+
onTextChange: (pageId: string, shapeId: string, text: string) => Promise<void>;
|
|
35
|
+
onSearchChange: (query: string) => void;
|
|
36
|
+
onNextSearchResult: () => void;
|
|
37
|
+
onPreviousSearchResult: () => void;
|
|
38
|
+
}>;
|
|
39
|
+
readonly loading: import("@angular/core").Signal<boolean>;
|
|
40
|
+
readonly error: import("@angular/core").Signal<Error | null>;
|
|
41
|
+
readonly mode: import("@angular/core").Signal<"edit" | "view">;
|
|
42
|
+
readonly documentChange: EventEmitter<import("visio-core").VisioDocument>;
|
|
43
|
+
readonly dirtyChange: EventEmitter<boolean>;
|
|
44
|
+
readonly documentError: EventEmitter<Error>;
|
|
45
|
+
readonly canvasProps: {
|
|
46
|
+
mount: (node: HTMLElement | null) => void;
|
|
47
|
+
};
|
|
48
|
+
readonly inspectorProps: {
|
|
49
|
+
controller: import("ooxml-ui/visio").ViewerController;
|
|
50
|
+
};
|
|
51
|
+
constructor();
|
|
52
|
+
update(options: BuildingBlockOptions): void;
|
|
53
|
+
}
|
|
54
|
+
/** Connect host signals to the scoped owner within an Angular injection context. */
|
|
55
|
+
export declare function createViewerBuildingBlocks(options?: () => BuildingBlockOptions): ViewerBuildingBlocks;
|
|
56
|
+
export declare class ViewerBuildingBlocksComponent implements OnChanges, OnInit {
|
|
57
|
+
readonly blocks: ViewerBuildingBlocks;
|
|
58
|
+
content?: BuildingBlockOptions['content'];
|
|
59
|
+
canEdit: boolean;
|
|
60
|
+
locale?: string;
|
|
61
|
+
readonly documentChange: EventEmitter<import("visio-core").VisioDocument>;
|
|
62
|
+
readonly dirtyChange: EventEmitter<boolean>;
|
|
63
|
+
readonly documentError: EventEmitter<Error>;
|
|
64
|
+
ngOnInit(): void;
|
|
65
|
+
ngOnChanges(): void;
|
|
66
|
+
}
|
|
67
|
+
export declare class DiagramCanvasComponent implements AfterViewInit, OnDestroy {
|
|
68
|
+
readonly blocks: ViewerBuildingBlocks;
|
|
69
|
+
private readonly host;
|
|
70
|
+
ngAfterViewInit(): void;
|
|
71
|
+
ngOnDestroy(): void;
|
|
72
|
+
}
|
|
73
|
+
export declare class ToolbarComponent implements AfterViewInit {
|
|
74
|
+
private readonly host;
|
|
75
|
+
ngAfterViewInit(): void;
|
|
76
|
+
readonly blocks: ViewerBuildingBlocks;
|
|
77
|
+
}
|
|
78
|
+
export declare class PageNavigationComponent implements AfterViewInit {
|
|
79
|
+
private readonly host;
|
|
80
|
+
ngAfterViewInit(): void;
|
|
81
|
+
readonly blocks: ViewerBuildingBlocks;
|
|
82
|
+
change(event: Event): void;
|
|
83
|
+
}
|
|
84
|
+
export declare class InspectorComponent implements AfterViewInit, OnDestroy {
|
|
85
|
+
readonly blocks: ViewerBuildingBlocks;
|
|
86
|
+
private readonly host;
|
|
87
|
+
private stop;
|
|
88
|
+
ngAfterViewInit(): void;
|
|
89
|
+
ngOnDestroy(): void;
|
|
90
|
+
}
|
|
91
|
+
export type { BuildingBlockOptions, DiagramToolbarProps } from '../../bindings/src/building-blocks.js';
|
|
@@ -6,6 +6,7 @@ export declare class VisioViewerComponent implements AfterViewInit, OnChanges, O
|
|
|
6
6
|
pageIndex?: number;
|
|
7
7
|
zoom?: number;
|
|
8
8
|
showToolbar?: boolean;
|
|
9
|
+
canEdit?: boolean;
|
|
9
10
|
ribbonAddIns?: ViewerProperties['ribbonAddIns'];
|
|
10
11
|
events?: ViewerCallbacks;
|
|
11
12
|
documentLoad: EventEmitter<import("visio-core").VisioDocument>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { ViewerController, type VsdxSource } from 'ooxml-ui/visio';
|
|
2
|
+
import * as ui from 'ooxml-ui/visio';
|
|
3
|
+
export interface BuildingBlockOptions {
|
|
4
|
+
content?: VsdxSource | undefined;
|
|
5
|
+
canEdit?: boolean | undefined;
|
|
6
|
+
locale?: string | undefined;
|
|
7
|
+
onDocumentChange?: ((document: NonNullable<ViewerController['state']['document']>) => void) | undefined;
|
|
8
|
+
onDirtyChange?: ((dirty: boolean) => void) | undefined;
|
|
9
|
+
onDocumentError?: ((error: Error) => void) | undefined;
|
|
10
|
+
}
|
|
11
|
+
type Api = Pick<typeof ui, 'mountDiagramCanvas' | 'fitDiagramCanvas' | 'mountDiagramInspector' | 'diagramToolbarProps'>;
|
|
12
|
+
export declare function buildingBlock<K extends keyof Api>(key: K): Api[K];
|
|
13
|
+
/** Framework-neutral ownership only; each adapter supplies its own reactive state. */
|
|
14
|
+
export declare function createBuildingBlockSession(): {
|
|
15
|
+
controller: ViewerController;
|
|
16
|
+
mount(node: HTMLElement | null): void;
|
|
17
|
+
toolbar(locale?: string | undefined): {
|
|
18
|
+
labels: {
|
|
19
|
+
[k: string]: string;
|
|
20
|
+
};
|
|
21
|
+
canEdit: boolean;
|
|
22
|
+
pageIndex: number;
|
|
23
|
+
pages: {
|
|
24
|
+
id: string;
|
|
25
|
+
name: string;
|
|
26
|
+
}[];
|
|
27
|
+
zoom: number;
|
|
28
|
+
selection: readonly import("ooxml-core/visio/ui").VisioShapeSelection[];
|
|
29
|
+
canUndo: boolean;
|
|
30
|
+
canRedo: boolean;
|
|
31
|
+
canDuplicate: boolean;
|
|
32
|
+
canGroup: boolean;
|
|
33
|
+
canUngroup: boolean;
|
|
34
|
+
onPageChange: (index: number) => void;
|
|
35
|
+
onZoomChange: (zoom: number) => void;
|
|
36
|
+
onFit: () => void;
|
|
37
|
+
onUndo: () => Promise<void>;
|
|
38
|
+
onRedo: () => Promise<void>;
|
|
39
|
+
onDuplicate: () => Promise<void>;
|
|
40
|
+
onGroup: () => Promise<void>;
|
|
41
|
+
onUngroup: () => Promise<void>;
|
|
42
|
+
onTextChange: (pageId: string, shapeId: string, text: string) => Promise<void>;
|
|
43
|
+
onSearchChange: (query: string) => void;
|
|
44
|
+
onNextSearchResult: () => void;
|
|
45
|
+
onPreviousSearchResult: () => void;
|
|
46
|
+
};
|
|
47
|
+
update(next: BuildingBlockOptions): void;
|
|
48
|
+
destroy(): void;
|
|
49
|
+
};
|
|
50
|
+
export type BuildingBlockSession = ReturnType<typeof createBuildingBlockSession>;
|
|
51
|
+
export type { DiagramToolbarProps, ViewerController } from 'ooxml-ui/visio';
|
|
52
|
+
/** Resolve the new optional-control theme API only when that control is mounted. */
|
|
53
|
+
export declare function prepareDiagramBlock(host: HTMLElement | null, kind: 'toolbar' | 'tabs'): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "visio-angular-viewer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Local-first Visio viewer for angular",
|
|
5
5
|
"homepage": "https://christophervr.github.io/ooxml/visio/",
|
|
6
6
|
"bugs": {
|
|
@@ -31,11 +31,16 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"emf-converter": "4.21.0",
|
|
34
|
-
"ooxml-core": "^1.
|
|
35
|
-
"ooxml-ui": "^1.
|
|
36
|
-
"visio-core": "^0.
|
|
34
|
+
"ooxml-core": "^1.20.0",
|
|
35
|
+
"ooxml-ui": "^1.19.0",
|
|
36
|
+
"visio-core": "^0.5.0"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@angular/compiler": "^22.2.3",
|
|
40
|
+
"@angular/core": "^22.2.3",
|
|
41
|
+
"@angular/platform-browser": "^22.2.3"
|
|
37
42
|
},
|
|
38
43
|
"peerDependencies": {
|
|
39
|
-
"@angular/core": "^21.0.0"
|
|
44
|
+
"@angular/core": "^21.0.0 || ^22.0.0"
|
|
40
45
|
}
|
|
41
46
|
}
|