@netless/fastboard-react 0.2.2 → 0.2.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/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/components/Toolbar/Toolbar.scss +13 -0
- package/src/components/hooks.ts +3 -1
|
@@ -152,6 +152,17 @@ $name: "fastboard-toolbar";
|
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
154
|
|
|
155
|
+
&-section + &-mask {
|
|
156
|
+
opacity: 0;
|
|
157
|
+
transition: 0.5s opacity 0.4s;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
&-section:hover + &-mask,
|
|
161
|
+
&-mask:hover {
|
|
162
|
+
opacity: 1;
|
|
163
|
+
transition: 0.2s opacity;
|
|
164
|
+
}
|
|
165
|
+
|
|
155
166
|
&-panel {
|
|
156
167
|
width: 136px - 8px * 2;
|
|
157
168
|
padding: 0;
|
|
@@ -268,6 +279,7 @@ $name: "fastboard-toolbar";
|
|
|
268
279
|
left: calc(100% + 1px);
|
|
269
280
|
top: 50%;
|
|
270
281
|
transform: translateY(-50%);
|
|
282
|
+
opacity: 0.85;
|
|
271
283
|
&.dark {
|
|
272
284
|
left: calc(100%);
|
|
273
285
|
}
|
|
@@ -277,6 +289,7 @@ $name: "fastboard-toolbar";
|
|
|
277
289
|
width: 17px;
|
|
278
290
|
height: 62px;
|
|
279
291
|
cursor: pointer;
|
|
292
|
+
opacity: 0.85;
|
|
280
293
|
&.dark {
|
|
281
294
|
filter: invert(0.8);
|
|
282
295
|
}
|
package/src/components/hooks.ts
CHANGED
|
@@ -43,12 +43,14 @@ export function useMaximized() {
|
|
|
43
43
|
return useBoxState() === "maximized";
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
+
const AppsShouldShowToolbar = /* @__PURE__ */ (() => [BuiltinApps.DocsViewer, "Slide"])();
|
|
47
|
+
|
|
46
48
|
export function useHideControls() {
|
|
47
49
|
const maximized = useMaximized();
|
|
48
50
|
const focusedApp = useFocusedApp();
|
|
49
51
|
|
|
50
52
|
if (maximized) {
|
|
51
|
-
if (
|
|
53
|
+
if (AppsShouldShowToolbar.some(kind => focusedApp?.includes(kind))) {
|
|
52
54
|
return "toolbar-only";
|
|
53
55
|
} else {
|
|
54
56
|
return true;
|