@netless/fastboard-react 0.2.10 → 0.2.11
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/index.js +10 -2831
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -2831
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/components/tippy-util.ts +4 -14
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netless/fastboard-react",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.11",
|
|
4
4
|
"description": "A UI kit built on top of @netless/fastboard.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"files": [
|
|
@@ -22,13 +22,13 @@
|
|
|
22
22
|
"white-web-sdk": ">=2.16.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@netless/fastboard-core": "0.2.
|
|
25
|
+
"@netless/fastboard-core": "0.2.11",
|
|
26
26
|
"@netless/window-manager": "^0.4.10",
|
|
27
27
|
"@types/react": "^17.0.39",
|
|
28
28
|
"@types/react-dom": "^17.0.13",
|
|
29
29
|
"sass": "^1.49.9",
|
|
30
30
|
"tippy.js": "^6.3.7",
|
|
31
|
-
"tsup": "^5.
|
|
31
|
+
"tsup": "^5.12.0",
|
|
32
32
|
"white-web-sdk": "^2.16.10"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
|
@@ -1,18 +1,8 @@
|
|
|
1
1
|
import type { Instance } from "tippy.js";
|
|
2
|
-
import tippy from "tippy.js";
|
|
3
|
-
|
|
4
|
-
export const instances = new Set<Instance>();
|
|
5
|
-
|
|
6
|
-
export function onCreate(instance: Instance) {
|
|
7
|
-
instances.add(instance);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export function onDestroy(instance: Instance) {
|
|
11
|
-
instances.delete(instance);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
tippy.setDefaultProps({ onCreate, onDestroy });
|
|
15
2
|
|
|
16
3
|
export function hideAll() {
|
|
17
|
-
|
|
4
|
+
Array.from(document.querySelectorAll("[data-tippy-root]")).forEach(e => {
|
|
5
|
+
const instance = (e as unknown as { _tippy?: Instance })._tippy;
|
|
6
|
+
if (instance) instance.hide();
|
|
7
|
+
});
|
|
18
8
|
}
|