@labpane/os 1.2.0 → 1.4.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/README.md +37 -0
- package/dist/index.js +753 -337
- package/dist/index.js.map +4 -4
- package/dist/os/context.d.ts +2 -1
- package/dist/os/drag-content.d.ts +4 -2
- package/dist/os/frame-task.d.ts +5 -0
- package/dist/os/frame.d.ts +2 -2
- package/dist/os/geometry-task.d.ts +10 -0
- package/dist/os/pwa.d.ts +12 -0
- package/dist/os/surface.d.ts +6 -2
- package/dist/os/tabs.d.ts +1 -1
- package/dist/os/workspace.d.ts +3 -0
- package/dist/pwa.js +61 -0
- package/dist/pwa.js.map +7 -0
- package/dist/styles.css +1 -1
- package/package.json +6 -2
package/README.md
CHANGED
|
@@ -109,6 +109,41 @@ type Layout = Pane | Split;
|
|
|
109
109
|
|
|
110
110
|
## Desktop windows
|
|
111
111
|
|
|
112
|
+
### Installed PWAs
|
|
113
|
+
|
|
114
|
+
Enable the browser's window-controls overlay in your web app manifest:
|
|
115
|
+
|
|
116
|
+
```json
|
|
117
|
+
{
|
|
118
|
+
"display": "standalone",
|
|
119
|
+
"display_override": ["window-controls-overlay", "standalone"]
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Then opt your top-level workspace into the available title-bar area:
|
|
124
|
+
|
|
125
|
+
```tsx
|
|
126
|
+
import { Workspace } from "@labpane/os";
|
|
127
|
+
import { useWindowControlsOverlay } from "@labpane/os/pwa";
|
|
128
|
+
|
|
129
|
+
function App() {
|
|
130
|
+
const overlay = useWindowControlsOverlay();
|
|
131
|
+
return <Workspace windowControlsOverlay={overlay} {...workspaceProps} />;
|
|
132
|
+
}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
The PWA browser integration is a separate entry point. Importing `Workspace` or using `@labpane/ui` alone does not include that module. Pass `false` to the hook to temporarily disable the integration; it then installs no observers or event listeners.
|
|
136
|
+
|
|
137
|
+
Place the workspace at the top of the viewport; remove any separate title-bar spacer. When the installed browser reports a visible overlay, Labpane places the top row of tabs inside its safe rectangle, leaving room for the browser's real window buttons on either side. Panel content keeps the full width. Geometry changes update the layout, and dense tabs get a minimum height sufficient to clear the native title bar. All pane headers share that minimum height while the overlay is active.
|
|
138
|
+
|
|
139
|
+
Set the app's manifest `theme_color` and document `<meta name="theme-color">` to the workspace background color. Update the meta value when the app changes theme so the browser's caption area matches. The generated starter reads `--lab-background` on theme changes; the library leaves document metadata to the application.
|
|
140
|
+
|
|
141
|
+
The blank toolbar area drags the window. Tabs, toolbar actions, and leading/trailing slots remain interactive. Mark a noninteractive leading element with `data-window-drag` if it should also drag; use `data-window-no-drag` for custom interactive content. Don't render `WindowControls` or supply a `WindowHost` for this path: the installed browser owns window actions and caption buttons.
|
|
142
|
+
|
|
143
|
+
Ordinary browser tabs, unsupported browsers, disabled overlays, and fullscreen use the normal layout. The browser controls whether the overlay is enabled; Chromium may require the user to choose **Hide title bar**. A workspace below the title-bar area is left alone. Installability, service workers, and the manifest remain application responsibilities. See the [browser platform documentation](https://learn.microsoft.com/en-us/microsoft-edge/progressive-web-apps/how-to/window-controls-overlay) and [PWA test fixture](../../e2e/consumer/README.md).
|
|
144
|
+
|
|
145
|
+
### Native shells
|
|
146
|
+
|
|
112
147
|
To run the workspace in a frameless desktop window (Wails, Tauri, Electron, or your own shell), describe the window as a `WindowHost` and the workspace becomes its title bar:
|
|
113
148
|
|
|
114
149
|
```tsx
|
|
@@ -144,6 +179,8 @@ function App() {
|
|
|
144
179
|
- `useWindowFrame` moves the window when an empty part of a toolbar is dragged, maximises it on a double click, resizes it from its edges, and toggles full screen with F11, or Ctrl+Cmd+F on macOS. Add `data-window-drag` to other elements that should move the window.
|
|
145
180
|
- `useFullscreen(host)` returns `[fullscreen, setFullscreen]`. Without a host it uses the browser's Fullscreen API.
|
|
146
181
|
|
|
182
|
+
The host interface has no Wails, Go, Tauri, or Electron dependency. Applications own their shell and adapt its public APIs to these callbacks. If the shell already handles dragging and edge resizing, omit `drag` and `resize` to avoid sending duplicate commands. The [native desktop fixture](../../e2e/wails/README.md) demonstrates this boundary and checks real window actions with Wails. Its shell is test code, not part of this package.
|
|
183
|
+
|
|
147
184
|
## Keyboard
|
|
148
185
|
|
|
149
186
|
- Left and Right move between tabs, Home and End jump to the first and last, and Space selects
|