visio-svelte-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.
@@ -3,8 +3,8 @@
3
3
  import { readonly, writable } from 'svelte/store';
4
4
  import { mountFrameworkViewer, viewerHandle, viewerOptions, viewerStateSource, type ViewerState, type MountedViewer, type ViewerProps, type VsdxSource, type VisioEdit, type VisioShapeSelection, type SvgExportOptions, type CurrentPagePrintSnapshotOptions } from './runtime.js';
5
5
  type Props = ViewerProps & { class?: string; style?: string; 'aria-label'?: string };
6
- let { document, pageIndex, zoom, showToolbar, canEdit, ribbonAddIns, collaboration, events, class: className, style, 'aria-label': ariaLabel }: Props = $props();
7
- const options = $derived({ document, pageIndex, zoom, showToolbar, canEdit, ribbonAddIns, collaboration, events } satisfies Required<ViewerProps>);
6
+ let { document, pageIndex, zoom, showToolbar, canEdit, readOnly, ribbonAddIns, collaboration, customization, storage, events, class: className, style, 'aria-label': ariaLabel }: Props = $props();
7
+ const options = $derived({ document, pageIndex, zoom, showToolbar, canEdit, readOnly, ribbonAddIns, collaboration, customization, storage, events } satisfies Required<ViewerProps>);
8
8
  let binding: MountedViewer | undefined;
9
9
  const handle = viewerHandle(() => binding);
10
10
  // The component owns its state store, so subscribers made before mount still see updates.
package/dist/index.js CHANGED
@@ -38,6 +38,7 @@ function mountFrameworkViewer(container, initial) {
38
38
  const touchedByOlderCall = [...activePatches].some((active) => key in active);
39
39
  if (snapshot[key] !== void 0 && (snapshot[key] !== previous[key] || touchedByOlderCall)) Object.assign(patch, { [key]: snapshot[key] });
40
40
  }
41
+ if (snapshot.readOnly === void 0 && previous.readOnly !== void 0) Object.assign(patch, { readOnly: false });
41
42
  activePatches.add(patch);
42
43
  try {
43
44
  binding.update(patch);
@@ -158,8 +159,11 @@ function VisioViewer($$anchor, $$props) {
158
159
  zoom: $$props.zoom,
159
160
  showToolbar: $$props.showToolbar,
160
161
  canEdit: $$props.canEdit,
162
+ readOnly: $$props.readOnly,
161
163
  ribbonAddIns: $$props.ribbonAddIns,
162
164
  collaboration: $$props.collaboration,
165
+ customization: $$props.customization,
166
+ storage: $$props.storage,
163
167
  events: $$props.events
164
168
  }));
165
169
  let binding;
@@ -87,15 +87,18 @@ function viewerHandle(current) {
87
87
  //#region packages/bindings/src/VisioViewer.svelte
88
88
  function VisioViewer($$renderer, $$props) {
89
89
  $$renderer.component(($$renderer) => {
90
- let { document, pageIndex, zoom, showToolbar, canEdit, ribbonAddIns, collaboration, events, class: className, style, "aria-label": ariaLabel } = $$props;
90
+ let { document, pageIndex, zoom, showToolbar, canEdit, readOnly, ribbonAddIns, collaboration, customization, storage, events, class: className, style, "aria-label": ariaLabel } = $$props;
91
91
  $.derived(() => ({
92
92
  document,
93
93
  pageIndex,
94
94
  zoom,
95
95
  showToolbar,
96
96
  canEdit,
97
+ readOnly,
97
98
  ribbonAddIns,
98
99
  collaboration,
100
+ customization,
101
+ storage,
99
102
  events
100
103
  }));
101
104
  let binding;
package/dist/runtime.js CHANGED
@@ -36,6 +36,7 @@ function mountFrameworkViewer(container, initial) {
36
36
  const touchedByOlderCall = [...activePatches].some((active) => key in active);
37
37
  if (snapshot[key] !== void 0 && (snapshot[key] !== previous[key] || touchedByOlderCall)) Object.assign(patch, { [key]: snapshot[key] });
38
38
  }
39
+ if (snapshot.readOnly === void 0 && previous.readOnly !== void 0) Object.assign(patch, { readOnly: false });
39
40
  activePatches.add(patch);
40
41
  try {
41
42
  binding.update(patch);
@@ -151,7 +152,7 @@ function withEventEmitter(props, emit) {
151
152
  const callbacks = {};
152
153
  for (const name of eventKeys) Object.assign(callbacks, { [name]: (value) => {
153
154
  try {
154
- (props.events?.[name])?.(value);
155
+ return (props.events?.[name])?.(value);
155
156
  } finally {
156
157
  emit(name, value);
157
158
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "visio-svelte-viewer",
3
- "version": "1.0.1",
3
+ "version": "1.1.0",
4
4
  "description": "Local-first Visio viewer for svelte",
5
5
  "homepage": "https://christophervr.github.io/ooxml/visio/",
6
6
  "bugs": {
@@ -38,8 +38,8 @@
38
38
  },
39
39
  "dependencies": {
40
40
  "emf-converter": "4.21.0",
41
- "ooxml-core": "^1.23.0",
42
- "ooxml-ui": "^1.22.0",
41
+ "ooxml-core": "^1.24.0",
42
+ "ooxml-ui": "^1.23.0",
43
43
  "visio-core": "^1.0.1"
44
44
  },
45
45
  "peerDependencies": {