@niivue/nvreact 0.1.1 → 0.1.3
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 +9 -9
- package/package.json +4 -4
package/dist/lib.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/nvscene.tsx
|
|
2
2
|
import { useEffect, useRef } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
var NvScene = ({
|
|
5
5
|
scene,
|
|
6
6
|
className,
|
|
@@ -27,11 +27,11 @@ var NvScene = ({
|
|
|
27
27
|
ro.observe(el);
|
|
28
28
|
return () => ro.disconnect();
|
|
29
29
|
}, [scene]);
|
|
30
|
-
return /* @__PURE__ */
|
|
30
|
+
return /* @__PURE__ */ jsx("div", {
|
|
31
31
|
ref: containerRef,
|
|
32
32
|
className,
|
|
33
33
|
style
|
|
34
|
-
}
|
|
34
|
+
});
|
|
35
35
|
};
|
|
36
36
|
// src/nvviewer.tsx
|
|
37
37
|
import { useEffect as useEffect2, useRef as useRef2 } from "react";
|
|
@@ -602,7 +602,7 @@ class NvSceneController {
|
|
|
602
602
|
}
|
|
603
603
|
|
|
604
604
|
// src/nvviewer.tsx
|
|
605
|
-
import {
|
|
605
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
606
606
|
function extractVisualProps(opts) {
|
|
607
607
|
return {
|
|
608
608
|
colormap: opts.colormap ?? opts.colorMap,
|
|
@@ -731,11 +731,11 @@ var NvViewer = ({
|
|
|
731
731
|
nv.updateGLVolume();
|
|
732
732
|
}
|
|
733
733
|
}, [volumes]);
|
|
734
|
-
return /* @__PURE__ */
|
|
734
|
+
return /* @__PURE__ */ jsx2("div", {
|
|
735
735
|
ref: containerRef,
|
|
736
736
|
className,
|
|
737
737
|
style: { position: "relative", ...style }
|
|
738
|
-
}
|
|
738
|
+
});
|
|
739
739
|
};
|
|
740
740
|
// src/hooks.ts
|
|
741
741
|
import { useEffect as useEffect3, useMemo, useSyncExternalStore, useRef as useRef3 } from "react";
|
|
@@ -760,16 +760,16 @@ function useSceneEvent(scene, event, callback) {
|
|
|
760
760
|
}
|
|
761
761
|
// src/context.tsx
|
|
762
762
|
import { createContext, useContext } from "react";
|
|
763
|
-
import {
|
|
763
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
764
764
|
var NvSceneContext = createContext(null);
|
|
765
765
|
function NvSceneProvider({
|
|
766
766
|
scene,
|
|
767
767
|
children
|
|
768
768
|
}) {
|
|
769
|
-
return /* @__PURE__ */
|
|
769
|
+
return /* @__PURE__ */ jsx3(NvSceneContext.Provider, {
|
|
770
770
|
value: scene,
|
|
771
771
|
children
|
|
772
|
-
}
|
|
772
|
+
});
|
|
773
773
|
}
|
|
774
774
|
function useSceneContext() {
|
|
775
775
|
const scene = useContext(NvSceneContext);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@niivue/nvreact",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/lib.js",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"dev": "bun --hot src/index.ts",
|
|
23
23
|
"build": "bun build ./src/index.html --outdir=dist --sourcemap --target=browser --minify --define:process.env.NODE_ENV='\"production\"' --env='BUN_PUBLIC_*'",
|
|
24
24
|
"start": "NODE_ENV=production bun src/index.ts",
|
|
25
|
-
"build:lib": "bun build ./src/lib.ts --outdir=dist --target=browser --format=esm --external react --external react-dom --external @niivue/niivue",
|
|
25
|
+
"build:lib": "NODE_ENV=production bun build ./src/lib.ts --outdir=dist --target=browser --format=esm --external react --external react-dom --external @niivue/niivue",
|
|
26
26
|
"build:types": "tsc -p tsconfig.build.json",
|
|
27
27
|
"build:package": "bun run build:lib && bun run build:types",
|
|
28
28
|
"pack:local": "bun run build:package && bun pm pack",
|
|
@@ -31,13 +31,13 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"@niivue/niivue": "0.
|
|
34
|
+
"@niivue/niivue": "^0.68.1",
|
|
35
35
|
"react": "^19",
|
|
36
36
|
"react-dom": "^19"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@happy-dom/global-registrator": "^20.6.1",
|
|
40
|
-
"@niivue/niivue": "0.
|
|
40
|
+
"@niivue/niivue": "^0.68.1",
|
|
41
41
|
"@testing-library/dom": "^10.4.1",
|
|
42
42
|
"@testing-library/jest-dom": "^6.9.1",
|
|
43
43
|
"@testing-library/react": "^16.3.2",
|