@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
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { TabHistory, TabHistoryStore } from "./tab-history.js";
|
|
2
|
+
export declare function createBrowserHistory(front: () => TabHistory | undefined): {
|
|
3
|
+
sync: () => void;
|
|
4
|
+
pop: (event: PopStateEvent) => void;
|
|
5
|
+
};
|
|
6
|
+
export declare function useBrowserHistory(front?: TabHistoryStore): void;
|
package/dist/os/context.d.ts
CHANGED
|
@@ -59,6 +59,12 @@ export declare function useWorkspaceIds(): {
|
|
|
59
59
|
tab: (key: string) => string;
|
|
60
60
|
panel: (key: string) => string;
|
|
61
61
|
};
|
|
62
|
+
export declare const TabLinks: import("react").Context<Map<string, HTMLElement>>;
|
|
63
|
+
export declare function useTabLinks(): {
|
|
64
|
+
register: (key: string) => (element: HTMLElement | null) => void;
|
|
65
|
+
get: (key: string) => HTMLElement | undefined;
|
|
66
|
+
focus: (key: string) => number;
|
|
67
|
+
};
|
|
62
68
|
export type WorkspaceAction = {
|
|
63
69
|
label: string;
|
|
64
70
|
onSelect: () => void;
|
package/dist/os/index.d.ts
CHANGED
|
@@ -2,5 +2,9 @@ export { Workspace, type WorkspaceTab, type WorkspaceProps, type WorkspacePane,
|
|
|
2
2
|
export { WorkspaceFrame } from "./workspace-frame.js";
|
|
3
3
|
export { densityPresets, densitySize, type Density as WorkspaceDensity, type WorkspaceAction, type WorkspaceMenu, } from "./context.js";
|
|
4
4
|
export { useUnsavedChanges } from "./unsaved-changes.js";
|
|
5
|
+
export { useTabActive, useTabVisible, useTabVisibleRef, useShownOnce, type TabState, } from "./tab-state.js";
|
|
6
|
+
export { useLeaveTab } from "./leave-tab.js";
|
|
7
|
+
export { useTabHistory, type TabHistory } from "./tab-history.js";
|
|
8
|
+
export { hasOpenOverlay } from "./overlay.js";
|
|
5
9
|
export { restoreLayout, reconcileLayout, dockTab, panes, type Layout, type Pane, type Split, } from "./layout.js";
|
|
6
10
|
export { TrafficLights, WindowControls, desktopSlots, useFullscreen, useWindowFrame, type WindowEdge, type WindowHost, } from "./window.js";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { WorkspaceTab } from "./workspace.js";
|
|
2
|
+
export declare function useOpeners(tabs: readonly WorkspaceTab[], front?: string): Map<string, string>;
|
|
3
|
+
export declare const LeaveTab: import("react").Context<() => void>;
|
|
4
|
+
export declare function useLeaveTab(): () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function hasOpenOverlay(): boolean;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { WorkspaceTab } from "./workspace.js";
|
|
2
|
+
export type TabHistory = {
|
|
3
|
+
path: string;
|
|
4
|
+
canGoBack: boolean;
|
|
5
|
+
canGoForward: boolean;
|
|
6
|
+
navigate: (path: string) => void;
|
|
7
|
+
back: () => void;
|
|
8
|
+
forward: () => void;
|
|
9
|
+
};
|
|
10
|
+
export type TabHistoryStore = {
|
|
11
|
+
subscribe: (listener: () => void) => () => void;
|
|
12
|
+
get: () => TabHistory;
|
|
13
|
+
};
|
|
14
|
+
export declare function createTabHistory(initial: string): TabHistoryStore;
|
|
15
|
+
export declare const TabHistoryContext: import("react").Context<TabHistoryStore>;
|
|
16
|
+
export declare function useTabHistory(): TabHistory;
|
|
17
|
+
export declare function useTabHistories(tabs: readonly WorkspaceTab[]): (tab: WorkspaceTab) => TabHistoryStore;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type TabState = {
|
|
3
|
+
active: boolean;
|
|
4
|
+
visible: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare const TabStateContext: React.Context<TabState>;
|
|
7
|
+
export declare function useTabActive(): boolean;
|
|
8
|
+
export declare function useTabVisible(): boolean;
|
|
9
|
+
export declare function useTabVisibleRef(): React.RefObject<boolean>;
|
|
10
|
+
export declare function useShownOnce(visible: boolean): boolean;
|
package/dist/os/workspace.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ export type WorkspaceProps<T extends WorkspaceTab> = {
|
|
|
26
26
|
confirmClose?: (tab: T) => boolean | Promise<boolean>;
|
|
27
27
|
layout: Layout;
|
|
28
28
|
onLayoutChange: (layout: Layout) => void;
|
|
29
|
+
history?: boolean;
|
|
29
30
|
className?: string;
|
|
30
31
|
children: (tab: T, pane: WorkspacePane) => ReactNode;
|
|
31
32
|
empty: (pane: WorkspacePane) => ReactNode;
|