@labpane/os 1.1.0 → 1.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/README.md +4 -0
- package/dist/index.js +432 -156
- package/dist/index.js.map +4 -4
- package/dist/os/browser-history.d.ts +6 -0
- package/dist/os/context.d.ts +6 -0
- package/dist/os/index.d.ts +4 -0
- package/dist/os/leave-tab.d.ts +4 -0
- package/dist/os/overlay.d.ts +1 -0
- package/dist/os/tab-history.d.ts +17 -0
- package/dist/os/tab-map.d.ts +2 -0
- package/dist/os/tab-state.d.ts +10 -0
- package/dist/os/workspace.d.ts +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -67,6 +67,10 @@ Each tab is a `WorkspaceTab`:
|
|
|
67
67
|
|
|
68
68
|
Tabs whose content has unsaved changes call `useUnsavedChanges(true)`. Closing one asks first: through `confirmClose` if you pass it, and the browser's `confirm` otherwise. The page also warns before unloading.
|
|
69
69
|
|
|
70
|
+
## Inside a tab
|
|
71
|
+
|
|
72
|
+
Background tabs stay mounted, so a tab's content asks where it stands: `useTabActive()` is true for the tab in front of the focused pane and `useTabVisible()` for every tab on screen, including split panes (`useTabVisibleRef()` for listeners, `useShownOnce(visible)` to mount once). Gate polling, intervals, window listeners, and portaled overlays on them; redraw charts and canvases from a `ResizeObserver` on their own element and skip zero width; pause media when its tab is no longer visible. `useLeaveTab()` returns a function that closes the tab and returns to the tab it was opened from. With the `history` prop, each tab keeps its own history behind the browser's Back and Forward, starting at its `href`: `useTabHistory()` gives `{ path, canGoBack, canGoForward, navigate, back, forward }`. `hasOpenOverlay()` is true while a dialog, menu, listbox, or full-screen element is open, and the workspace's shortcuts wait for it.
|
|
73
|
+
|
|
70
74
|
## Slots
|
|
71
75
|
|
|
72
76
|
The workspace renders no menus or buttons of its own. You fill these slots with your own components, or with `@labpane/ui`:
|