@netless/fastboard-react 0.2.3 → 0.2.4

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netless/fastboard-react",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "A UI kit built on top of @netless/fastboard.",
5
5
  "main": "dist/index.js",
6
6
  "files": [
@@ -22,7 +22,7 @@
22
22
  "white-web-sdk": ">=2.16.0"
23
23
  },
24
24
  "devDependencies": {
25
- "@netless/fastboard-core": "0.2.3",
25
+ "@netless/fastboard-core": "0.2.4",
26
26
  "@netless/window-manager": "^0.4.0-canary.31",
27
27
  "@types/react": "^17.0.38",
28
28
  "@types/react-dom": "^17.0.11",
@@ -46,9 +46,14 @@ export function useMaximized() {
46
46
  const AppsShouldShowToolbar = /* @__PURE__ */ (() => [BuiltinApps.DocsViewer, "Slide"])();
47
47
 
48
48
  export function useHideControls() {
49
+ const writable = useWritable();
49
50
  const maximized = useMaximized();
50
51
  const focusedApp = useFocusedApp();
51
52
 
53
+ if (!writable) {
54
+ return true;
55
+ }
56
+
52
57
  if (maximized) {
53
58
  if (AppsShouldShowToolbar.some(kind => focusedApp?.includes(kind))) {
54
59
  return "toolbar-only";