visio-angular-viewer 1.0.0 → 1.0.1

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/README.md CHANGED
@@ -52,22 +52,34 @@ export class DiagramComponent {
52
52
 
53
53
  The shared properties are `document` (a parsed `VisioDocument`, or `null` to clear),
54
54
  `pageIndex` (zero-based), `zoom` (`1` means 100%), `showToolbar`, `ribbonAddIns` (tabs the host adds
55
- after Help) and `events`.
56
- The callback map uses `document-load`, `document-change`, `document-error`,
57
- `page-change`, `zoom-change` and `shape-select`. File loading uses the imperative
55
+ after Help), `canEdit` (editing permission; the viewer is editable unless you pass `false`),
56
+ `collaboration` (shares the open drawing in a room while set; `null` leaves it) and `events`.
57
+ The callback map uses `document-load`, `document-change` (`{ document, dirty, kind }` with kind
58
+ `edit`, `undo`, `redo`, `remote` or `save`), `document-error`, `page-change`, `zoom-change`,
59
+ `shape-select`, `selection-change`, `office-ribbon-add-in` and `collaboration-change`. File loading uses the imperative
58
60
  `load(File | Blob | Uint8Array | ArrayBuffer)` handle; `document` is not a file URL.
59
61
  Provide a height for the viewer host. Mount and load files in the browser.
60
62
 
61
63
  The handle supports `fit()`, `replacePlainText(pageId, shapeId, text)`,
62
64
  `applyEdits(edits)`, `undo()`, `redo()` and `exportVsdx()`.
63
65
  `exportVsdx()` returns `{ bytes, dirty, diagnostics }`; saving or downloading those
64
- bytes is the application's responsibility. Load original bytes through `load()`
66
+ bytes is the application's responsibility, and `handle.controller.markClean()` declares them saved.
67
+ Sharing state is on the handle's element: `collaborationState`, `reconnectCollaboration()` and
68
+ `stopCollaboration()`. Load original bytes through `load()`
65
69
  to enable source-backed editing and export. Handles are usable after mount.
66
70
 
67
71
  Every viewer package includes the same browser UI and re-exports the
68
72
  `visio-core` document API. Parsing and editing belong to `ooxml-core/visio`;
69
73
  framework bindings only manage lifecycle, properties and events.
70
74
 
75
+ ## Compose your own UI
76
+
77
+ To build a custom diagram UI instead of mounting the whole viewer, use the building blocks: `createViewerBuildingBlocks` and the `ViewerBuildingBlocks` class, with the standalone `DiagramCanvasComponent`, `ToolbarComponent`, `PageNavigationComponent`, `InspectorComponent` and `ShapesPaneComponent`. They expose signals
78
+ for the flat `toolbarProps` (page, zoom, selection, search, enabled flags and callbacks), `mode`,
79
+ `loading`/`error` and `markClean()`. Hosts pass `canEdit` (read-only until `true`) and optional
80
+ `onOpenSettings`/`onOpenShareDialog`/`onOpenPageSetup`/`onOpenFile` callbacks for dialogs they own.
81
+ See [composable building blocks](https://github.com/ChristopherVR/ooxml/blob/main/viewers/visio/docs/building-blocks.md).
82
+
71
83
  ## Limitations
72
84
 
73
85
  Rendering and editing are beta features. Supported text and geometry edits are
@@ -77,7 +89,7 @@ Files stay in the browser unless your application sends them elsewhere.
77
89
 
78
90
  ## Documentation
79
91
 
80
- [Viewer guide](https://christophervr.github.io/ooxml/visio/docs/) |
92
+ [Viewer guide](https://christophervr.github.io/ooxml/visio/) |
81
93
  [Demo](https://christophervr.github.io/ooxml/visio/demo/) |
82
94
  [Source](https://github.com/ChristopherVR/ooxml/tree/main/viewers/visio)
83
95
 
@@ -8,7 +8,7 @@ export declare class ViewerBuildingBlocks {
8
8
  readonly state: import("@angular/core").Signal<import("ooxml-ui/visio").ViewerState>;
9
9
  private readonly latest;
10
10
  readonly toolbarProps: import("@angular/core").Signal<{
11
- labels: Readonly<Record<"Arc" | "Copy" | "Cut" | "Delete" | "Duplicate" | "Ellipse" | "Find" | "Fit to Window" | "Freeform" | "Group" | "Line" | "Next Result" | "Open" | "Options" | "Page" | "Page Setup" | "Paste" | "Pencil" | "Pointer Tool" | "Previous Result" | "Rectangle" | "Redo" | "Shapes" | "Share" | "Undo" | "Ungroup" | "Zoom In" | "Zoom Out", string>>;
11
+ labels: Readonly<Record<"Arc" | "Connector" | "Copy" | "Cut" | "Delete" | "Duplicate" | "Ellipse" | "Find" | "Fit to Window" | "Freeform" | "Group" | "Line" | "Next Result" | "Open" | "Options" | "Page" | "Page Setup" | "Paste" | "Pencil" | "Pointer Tool" | "Previous Result" | "Rectangle" | "Redo" | "Shapes" | "Share" | "Text" | "Undo" | "Ungroup" | "Zoom In" | "Zoom Out", string>>;
12
12
  mode: import("ooxml-ui/visio").DiagramMode;
13
13
  canEdit: boolean;
14
14
  pageIndex: number;
@@ -26,7 +26,7 @@ export declare function createBuildingBlockSession(initial?: BuildingBlockOption
26
26
  mount(node: HTMLElement | null): void;
27
27
  /** Flat control props; pass the framework's latest options so callbacks stay current. */
28
28
  toolbar(latest?: BuildingBlockOptions): {
29
- labels: Readonly<Record<"Arc" | "Copy" | "Cut" | "Delete" | "Duplicate" | "Ellipse" | "Find" | "Fit to Window" | "Freeform" | "Group" | "Line" | "Next Result" | "Open" | "Options" | "Page" | "Page Setup" | "Paste" | "Pencil" | "Pointer Tool" | "Previous Result" | "Rectangle" | "Redo" | "Shapes" | "Share" | "Undo" | "Ungroup" | "Zoom In" | "Zoom Out", string>>;
29
+ labels: Readonly<Record<"Arc" | "Connector" | "Copy" | "Cut" | "Delete" | "Duplicate" | "Ellipse" | "Find" | "Fit to Window" | "Freeform" | "Group" | "Line" | "Next Result" | "Open" | "Options" | "Page" | "Page Setup" | "Paste" | "Pencil" | "Pointer Tool" | "Previous Result" | "Rectangle" | "Redo" | "Shapes" | "Share" | "Text" | "Undo" | "Ungroup" | "Zoom In" | "Zoom Out", string>>;
30
30
  mode: ui.DiagramMode;
31
31
  canEdit: boolean;
32
32
  pageIndex: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "visio-angular-viewer",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Local-first Visio viewer for angular",
5
5
  "homepage": "https://christophervr.github.io/ooxml/visio/",
6
6
  "bugs": {
@@ -31,9 +31,9 @@
31
31
  },
32
32
  "dependencies": {
33
33
  "emf-converter": "4.21.0",
34
- "ooxml-core": "^1.22.0",
35
- "ooxml-ui": "^1.21.0",
36
- "visio-core": "^1.0.0"
34
+ "ooxml-core": "^1.23.0",
35
+ "ooxml-ui": "^1.22.0",
36
+ "visio-core": "^1.0.1"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@angular/compiler": "^22.2.3",