batchkit-devtools-react 0.2.0-beta.1 → 0.2.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.
- package/package.json +7 -2
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -33
- package/dist/index.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "batchkit-devtools-react",
|
|
3
|
-
"version": "0.2.0
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "React wrapper for BatchKit DevTools",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -27,8 +27,13 @@
|
|
|
27
27
|
],
|
|
28
28
|
"author": "",
|
|
29
29
|
"license": "MIT",
|
|
30
|
+
"repository": {
|
|
31
|
+
"type": "git",
|
|
32
|
+
"url": "https://github.com/SirajChokshi/batchkit.git",
|
|
33
|
+
"directory": "packages/devtools-react"
|
|
34
|
+
},
|
|
30
35
|
"peerDependencies": {
|
|
31
|
-
"batchkit-devtools": ">=0.
|
|
36
|
+
"batchkit-devtools": ">=0.2.0",
|
|
32
37
|
"react": ">=18.0.0",
|
|
33
38
|
"react-dom": ">=18.0.0"
|
|
34
39
|
},
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA+B,aAAa,EAAE,MAAM,OAAO,CAAC;AAInE,MAAM,WAAW,qBAAqB;IACpC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,aAAa,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,aAAa,CAAC;CAC5B;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,eAAe,EACf,WAAW,EACX,cAAc,EACd,UAAU,GACX,EAAE,qBAAqB,sCAoCvB;AAED,eAAe,gBAAgB,CAAC"}
|
package/dist/index.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useRef, useState } from 'react';
|
|
3
|
-
import { createPortal } from 'react-dom';
|
|
4
|
-
import { mount } from 'batchkit-devtools';
|
|
5
|
-
export function BatchkitDevtools({ buttonClassName, buttonStyle, panelClassName, panelStyle, }) {
|
|
6
|
-
const containerRef = useRef(null);
|
|
7
|
-
const [mounted, setMounted] = useState(false);
|
|
8
|
-
useEffect(() => {
|
|
9
|
-
setMounted(true);
|
|
10
|
-
return () => setMounted(false);
|
|
11
|
-
}, []);
|
|
12
|
-
useEffect(() => {
|
|
13
|
-
if (!containerRef.current)
|
|
14
|
-
return;
|
|
15
|
-
const dispose = mount(containerRef.current, {
|
|
16
|
-
buttonClass: buttonClassName,
|
|
17
|
-
buttonStyle: buttonStyle,
|
|
18
|
-
panelClass: panelClassName,
|
|
19
|
-
panelStyle: panelStyle,
|
|
20
|
-
});
|
|
21
|
-
return () => {
|
|
22
|
-
dispose();
|
|
23
|
-
};
|
|
24
|
-
}, [mounted, buttonClassName, buttonStyle, panelClassName, panelStyle]);
|
|
25
|
-
if (!mounted)
|
|
26
|
-
return null;
|
|
27
|
-
const portalContent = (_jsx("div", { ref: containerRef, "data-batchkit-devtools": true }));
|
|
28
|
-
if (typeof document === 'undefined')
|
|
29
|
-
return null;
|
|
30
|
-
return createPortal(portalContent, document.body);
|
|
31
|
-
}
|
|
32
|
-
export default BatchkitDevtools;
|
|
33
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAiB,MAAM,OAAO,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,M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