visio-angular-viewer 1.0.1 → 1.1.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 CHANGED
@@ -35,6 +35,7 @@ function mountFrameworkViewer(container, initial) {
35
35
  const touchedByOlderCall = [...activePatches].some((active) => key in active);
36
36
  if (snapshot[key] !== void 0 && (snapshot[key] !== previous[key] || touchedByOlderCall)) Object.assign(patch, { [key]: snapshot[key] });
37
37
  }
38
+ if (snapshot.readOnly === void 0 && previous.readOnly !== void 0) Object.assign(patch, { readOnly: false });
38
39
  activePatches.add(patch);
39
40
  try {
40
41
  binding.update(patch);
@@ -150,7 +151,7 @@ function withEventEmitter(props, emit) {
150
151
  const callbacks = {};
151
152
  for (const name of eventKeys) Object.assign(callbacks, { [name]: (value) => {
152
153
  try {
153
- (props.events?.[name])?.(value);
154
+ return (props.events?.[name])?.(value);
154
155
  } finally {
155
156
  emit(name, value);
156
157
  }
@@ -181,6 +182,7 @@ var VisioViewerComponent = class VisioViewerComponent {
181
182
  this.selectionChange = new EventEmitter();
182
183
  this.ribbonAddIn = new EventEmitter();
183
184
  this.collaborationChange = new EventEmitter();
185
+ this.fileCommand = new EventEmitter();
184
186
  this.host = inject(ElementRef);
185
187
  this.handle = viewerHandle(() => this.binding);
186
188
  this.stopState = () => {};
@@ -195,7 +197,8 @@ var VisioViewerComponent = class VisioViewerComponent {
195
197
  "shape-select": this.shapeSelect,
196
198
  "selection-change": this.selectionChange,
197
199
  "office-ribbon-add-in": this.ribbonAddIn,
198
- "collaboration-change": this.collaborationChange
200
+ "collaboration-change": this.collaborationChange,
201
+ "file-command": this.fileCommand
199
202
  };
200
203
  }
201
204
  options() {
@@ -292,8 +295,11 @@ __decorate([Input()], VisioViewerComponent.prototype, "pageIndex", void 0);
292
295
  __decorate([Input()], VisioViewerComponent.prototype, "zoom", void 0);
293
296
  __decorate([Input()], VisioViewerComponent.prototype, "showToolbar", void 0);
294
297
  __decorate([Input()], VisioViewerComponent.prototype, "canEdit", void 0);
298
+ __decorate([Input()], VisioViewerComponent.prototype, "readOnly", void 0);
295
299
  __decorate([Input()], VisioViewerComponent.prototype, "ribbonAddIns", void 0);
296
300
  __decorate([Input()], VisioViewerComponent.prototype, "collaboration", void 0);
301
+ __decorate([Input()], VisioViewerComponent.prototype, "storage", void 0);
302
+ __decorate([Input()], VisioViewerComponent.prototype, "customization", void 0);
297
303
  __decorate([Input()], VisioViewerComponent.prototype, "events", void 0);
298
304
  __decorate([Output()], VisioViewerComponent.prototype, "documentLoad", void 0);
299
305
  __decorate([Output()], VisioViewerComponent.prototype, "documentChange", void 0);
@@ -304,6 +310,7 @@ __decorate([Output()], VisioViewerComponent.prototype, "shapeSelect", void 0);
304
310
  __decorate([Output()], VisioViewerComponent.prototype, "selectionChange", void 0);
305
311
  __decorate([Output()], VisioViewerComponent.prototype, "ribbonAddIn", void 0);
306
312
  __decorate([Output()], VisioViewerComponent.prototype, "collaborationChange", void 0);
313
+ __decorate([Output()], VisioViewerComponent.prototype, "fileCommand", void 0);
307
314
  VisioViewerComponent = __decorate([Component({
308
315
  selector: "visio-viewer-host",
309
316
  standalone: true,
@@ -7,8 +7,11 @@ export declare class VisioViewerComponent implements AfterViewInit, OnChanges, O
7
7
  zoom?: number;
8
8
  showToolbar?: boolean;
9
9
  canEdit?: boolean;
10
+ readOnly?: boolean;
10
11
  ribbonAddIns?: ViewerProperties['ribbonAddIns'];
11
12
  collaboration?: ViewerProperties['collaboration'];
13
+ storage?: ViewerProperties['storage'];
14
+ customization?: ViewerProperties['customization'];
12
15
  events?: ViewerCallbacks;
13
16
  documentLoad: EventEmitter<import("visio-core").VisioDocument>;
14
17
  documentChange: EventEmitter<{
@@ -23,6 +26,8 @@ export declare class VisioViewerComponent implements AfterViewInit, OnChanges, O
23
26
  selectionChange: EventEmitter<readonly VisioShapeSelection[]>;
24
27
  ribbonAddIn: EventEmitter<import("ooxml-core/ribbon").RibbonAddInCommandDetail>;
25
28
  collaborationChange: EventEmitter<import("ooxml-core/collab").CollaborationState>;
29
+ /** Notification only: to cancel a File command, return false from `events['file-command']`. */
30
+ fileCommand: EventEmitter<import("ooxml-core/embedding").FileCommandDetail<import("ooxml-core/embedding").VisioFileCommand>>;
26
31
  private readonly host;
27
32
  private binding;
28
33
  private readonly handle;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "visio-angular-viewer",
3
- "version": "1.0.1",
3
+ "version": "1.1.0",
4
4
  "description": "Local-first Visio viewer for angular",
5
5
  "homepage": "https://christophervr.github.io/ooxml/visio/",
6
6
  "bugs": {
@@ -31,8 +31,8 @@
31
31
  },
32
32
  "dependencies": {
33
33
  "emf-converter": "4.21.0",
34
- "ooxml-core": "^1.23.0",
35
- "ooxml-ui": "^1.22.0",
34
+ "ooxml-core": "^1.24.0",
35
+ "ooxml-ui": "^1.23.0",
36
36
  "visio-core": "^1.0.1"
37
37
  },
38
38
  "devDependencies": {