@niivue/nv-web-component 1.0.0-rc.8 → 1.0.0-rc.81
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
|
@@ -155,7 +155,7 @@ Properties:
|
|
|
155
155
|
- `volumes: ImageFromUrlOptions[]` - declarative volume list, diffed automatically.
|
|
156
156
|
- `options: Partial<NiiVueOptions>` - NiiVue construction options.
|
|
157
157
|
- `sliceType: number` / `slice-type` attribute - active slice type.
|
|
158
|
-
- `nv:
|
|
158
|
+
- `nv: NiiVue | null` - raw NiiVue instance after initialization.
|
|
159
159
|
|
|
160
160
|
Methods:
|
|
161
161
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NiiVueOptions, NVImage, default as
|
|
1
|
+
import { NiiVueOptions, NVImage, default as NiiVue, DRAG_MODE, SLICE_TYPE } from '@niivue/niivue';
|
|
2
2
|
import { LitElement, PropertyValues } from 'lit';
|
|
3
3
|
import { defaultLayouts } from './layouts';
|
|
4
4
|
import { defaultSliceLayouts, defaultViewerOptions, NvSceneController, NvSceneControllerSnapshot, SliceLayoutTile } from './nvscene-controller';
|
|
@@ -42,7 +42,7 @@ export declare class NiivueViewerElement extends LitElement {
|
|
|
42
42
|
private loadedVolumes;
|
|
43
43
|
private attachmentReady;
|
|
44
44
|
private attachmentGeneration;
|
|
45
|
-
get nv():
|
|
45
|
+
get nv(): NiiVue | null;
|
|
46
46
|
render(): import('lit-html').TemplateResult<1>;
|
|
47
47
|
firstUpdated(): void;
|
|
48
48
|
updated(changed: PropertyValues<this>): void;
|
package/dist/nv-web-component.js
CHANGED
|
@@ -961,7 +961,7 @@ var q = {
|
|
|
961
961
|
let n = this.viewers[e];
|
|
962
962
|
if (!n || !await this.waitForViewerReady(n)) return;
|
|
963
963
|
let r = n.niivue, i = r.volumes.findIndex((e) => e.url === t || e.name === t);
|
|
964
|
-
i >= 0 && (r.
|
|
964
|
+
i >= 0 && (await r.removeVolume(i), this.emit("volumeRemoved", e, t), this.broadcasting && this.rewireBroadcasting(), this.notify());
|
|
965
965
|
}
|
|
966
966
|
async findVolume(e, t) {
|
|
967
967
|
let n = this.viewers[e];
|
|
@@ -1184,7 +1184,7 @@ var q = {
|
|
|
1184
1184
|
let t = new Set(this.volumes.map(X));
|
|
1185
1185
|
for (let n of this.loadedVolumes.keys()) if (!t.has(n)) {
|
|
1186
1186
|
let t = Z(e.volumes, n);
|
|
1187
|
-
t >= 0 &&
|
|
1187
|
+
t >= 0 && await e.removeVolume(t), this.loadedVolumes.delete(n);
|
|
1188
1188
|
}
|
|
1189
1189
|
for (let t of this.volumes) {
|
|
1190
1190
|
let n = X(t), r = Fe(t), i = this.loadedVolumes.get(n);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { NiiVueOptions, NVImage, default as
|
|
1
|
+
import { NiiVueOptions, NVImage, default as NiiVue, SLICE_TYPE } from '@niivue/niivue';
|
|
2
2
|
import { LayoutConfig } from './layouts';
|
|
3
3
|
import { ImageFromUrlOptions, NvSceneEventMap, ViewerState } from './types';
|
|
4
4
|
export { SLICE_TYPE };
|
|
5
|
-
export type NiivueCallback = (nv:
|
|
5
|
+
export type NiivueCallback = (nv: NiiVue, index: number) => void;
|
|
6
6
|
export interface ViewerSlot {
|
|
7
7
|
id: string;
|
|
8
|
-
niivue:
|
|
8
|
+
niivue: NiiVue;
|
|
9
9
|
canvasElement: HTMLCanvasElement;
|
|
10
10
|
containerDiv: HTMLDivElement;
|
|
11
11
|
ready: Promise<void>;
|
|
@@ -100,8 +100,8 @@ export declare class NvSceneController {
|
|
|
100
100
|
setLayout(layoutName: string): void;
|
|
101
101
|
updateLayout(): void;
|
|
102
102
|
canAddViewer(): boolean;
|
|
103
|
-
getNiivue(index: number):
|
|
104
|
-
getAllNiivue():
|
|
103
|
+
getNiivue(index: number): NiiVue | undefined;
|
|
104
|
+
getAllNiivue(): NiiVue[];
|
|
105
105
|
forEachNiivue(callback: NiivueCallback): void;
|
|
106
106
|
private hasSyncableContent;
|
|
107
107
|
private safeBroadcastTo;
|
|
@@ -111,7 +111,7 @@ export declare class NvSceneController {
|
|
|
111
111
|
setViewerSliceLayout(index: number, layout: SliceLayoutTile[] | null): void;
|
|
112
112
|
getViewerSliceLayout(index: number): SliceLayoutTile[] | null;
|
|
113
113
|
private applySliceLayout;
|
|
114
|
-
getNiivueById(id: string):
|
|
114
|
+
getNiivueById(id: string): NiiVue | undefined;
|
|
115
115
|
getViewerById(id: string): ViewerSlot | undefined;
|
|
116
116
|
private waitForViewerReady;
|
|
117
117
|
loadVolume(index: number, opts: ImageFromUrlOptions): Promise<NVImage>;
|
package/dist/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { default as
|
|
1
|
+
import { default as NiiVue, ImageFromUrlOptions, NiiVueOptions, NVImage } from '@niivue/niivue';
|
|
2
2
|
export type { ImageFromUrlOptions, NiiVueOptions, NVImage };
|
|
3
3
|
export interface NvSceneEventMap {
|
|
4
|
-
viewerCreated: (nv:
|
|
4
|
+
viewerCreated: (nv: NiiVue, index: number) => void;
|
|
5
5
|
viewerRemoved: (index: number) => void;
|
|
6
6
|
locationChange: (viewerIndex: number, data: unknown) => void;
|
|
7
7
|
imageLoaded: (viewerIndex: number, volume: NVImage) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@niivue/nv-web-component",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.81",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Web component bindings for NiiVue",
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
"test": "bun test"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"@niivue/niivue": "1.0.0-rc.
|
|
29
|
+
"@niivue/niivue": "1.0.0-rc.83"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@niivue/niivue": "1.0.0-rc.
|
|
32
|
+
"@niivue/niivue": "1.0.0-rc.83",
|
|
33
33
|
"@types/bun": "^1.3.12",
|
|
34
34
|
"typescript": "^5.9.3",
|
|
35
35
|
"vite": "^8.0.9",
|