@niivue/nvreact 1.0.0-rc.11 → 1.0.0-rc.12
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/lib.js
CHANGED
|
@@ -22,7 +22,7 @@ function useSceneContext() {
|
|
|
22
22
|
import { useEffect, useMemo, useRef, useSyncExternalStore } from "react";
|
|
23
23
|
|
|
24
24
|
// src/nvscene-controller.ts
|
|
25
|
-
import
|
|
25
|
+
import NiiVue, { DRAG_MODE, SHOW_RENDER, SLICE_TYPE } from "@niivue/niivue";
|
|
26
26
|
|
|
27
27
|
// src/layouts.ts
|
|
28
28
|
var layout1x1 = () => ({
|
|
@@ -492,7 +492,7 @@ class NvSceneController {
|
|
|
492
492
|
...this.viewerDefaults,
|
|
493
493
|
...options
|
|
494
494
|
};
|
|
495
|
-
const niivue = new
|
|
495
|
+
const niivue = new NiiVue(mergedOptions);
|
|
496
496
|
const id = `nv-${this.nextId++}`;
|
|
497
497
|
this.viewerSliceLayouts.set(id, null);
|
|
498
498
|
this.loadingCounts.set(id, 0);
|
|
@@ -637,7 +637,7 @@ var NvScene = ({
|
|
|
637
637
|
});
|
|
638
638
|
};
|
|
639
639
|
// src/nvviewer.tsx
|
|
640
|
-
import
|
|
640
|
+
import NiiVue2, { SLICE_TYPE as SLICE_TYPE2 } from "@niivue/niivue";
|
|
641
641
|
import { useEffect as useEffect3, useRef as useRef3 } from "react";
|
|
642
642
|
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
643
643
|
function extractVisualProps(opts) {
|
|
@@ -683,7 +683,7 @@ var NvViewer = ({
|
|
|
683
683
|
...defaultViewerOptions,
|
|
684
684
|
...options
|
|
685
685
|
};
|
|
686
|
-
const nv = new
|
|
686
|
+
const nv = new NiiVue2(mergedOptions);
|
|
687
687
|
nv.addEventListener("locationChange", (evt) => {
|
|
688
688
|
onLocationChangeRef.current?.(evt.detail);
|
|
689
689
|
});
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { NiiVueOptions, NVImage } from '@niivue/niivue';
|
|
2
|
-
import
|
|
2
|
+
import NiiVue, { SLICE_TYPE } from '@niivue/niivue';
|
|
3
3
|
import type { LayoutConfig } from './layouts';
|
|
4
4
|
import type { ImageFromUrlOptions, NvSceneEventMap, ViewerState } from './types';
|
|
5
5
|
export { SLICE_TYPE };
|
|
6
|
-
export type NiivueCallback = (nv:
|
|
6
|
+
export type NiivueCallback = (nv: NiiVue, index: number) => void;
|
|
7
7
|
export interface ViewerSlot {
|
|
8
8
|
id: string;
|
|
9
|
-
niivue:
|
|
9
|
+
niivue: NiiVue;
|
|
10
10
|
canvasElement: HTMLCanvasElement;
|
|
11
11
|
containerDiv: HTMLDivElement;
|
|
12
12
|
}
|
|
@@ -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
|
loadVolume(index: number, opts: ImageFromUrlOptions): Promise<NVImage>;
|
|
117
117
|
loadVolumes(index: number, opts: ImageFromUrlOptions[]): Promise<NVImage[]>;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import type NiiVue from '@niivue/niivue';
|
|
2
2
|
import type { ImageFromUrlOptions, NiiVueOptions, NVImage } from '@niivue/niivue';
|
|
3
3
|
export type { ImageFromUrlOptions, NiiVueOptions, NVImage };
|
|
4
4
|
export interface NvSceneEventMap {
|
|
5
|
-
viewerCreated: (nv:
|
|
5
|
+
viewerCreated: (nv: NiiVue, index: number) => void;
|
|
6
6
|
viewerRemoved: (index: number) => void;
|
|
7
7
|
locationChange: (viewerIndex: number, data: unknown) => void;
|
|
8
8
|
imageLoaded: (viewerIndex: number, volume: NVImage) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@niivue/nvreact",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.12",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/lib.js",
|
|
@@ -30,13 +30,13 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@niivue/niivue": "1.0.0-rc.
|
|
33
|
+
"@niivue/niivue": "1.0.0-rc.11",
|
|
34
34
|
"react": "^19",
|
|
35
35
|
"react-dom": "^19"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@happy-dom/global-registrator": "^20.6.1",
|
|
39
|
-
"@niivue/niivue": "1.0.0-rc.
|
|
39
|
+
"@niivue/niivue": "1.0.0-rc.11",
|
|
40
40
|
"@testing-library/dom": "^10.4.1",
|
|
41
41
|
"@testing-library/jest-dom": "^6.9.1",
|
|
42
42
|
"@testing-library/react": "^16.3.2",
|