@labpane/os 1.3.0 → 1.4.1
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 +41 -0
- package/dist/index.js +98 -43
- package/dist/index.js.map +2 -2
- package/dist/os/context.d.ts +2 -1
- package/dist/os/icons.d.ts +1 -0
- package/dist/os/pwa.d.ts +12 -0
- package/dist/os/surface.d.ts +3 -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/dist/os/context.d.ts
CHANGED
|
@@ -44,16 +44,17 @@ export declare function densitySize(density: Density): {
|
|
|
44
44
|
borderWidth: number;
|
|
45
45
|
};
|
|
46
46
|
export declare const WorkspaceDensity: import("react").Context<number>;
|
|
47
|
+
export declare const MinimumTabHeight: import("react").Context<number>;
|
|
47
48
|
export declare const fitTabWidth: (width: number, available: number, count: number) => number;
|
|
48
49
|
export declare function useTabSize(): {
|
|
49
50
|
value: number;
|
|
50
51
|
width: number;
|
|
51
|
-
height: number;
|
|
52
52
|
contentHeight: number;
|
|
53
53
|
columnGap: number;
|
|
54
54
|
rowGap: number;
|
|
55
55
|
logoSize: number;
|
|
56
56
|
borderWidth: number;
|
|
57
|
+
height: number;
|
|
57
58
|
};
|
|
58
59
|
export declare function useWorkspaceIds(): {
|
|
59
60
|
tab: (key: string) => string;
|
package/dist/os/icons.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { SVGProps } from "react";
|
|
2
2
|
export declare const ChevronLeftIcon: (props: SVGProps<SVGSVGElement>) => import("react").JSX.Element;
|
|
3
3
|
export declare const ChevronRightIcon: (props: SVGProps<SVGSVGElement>) => import("react").JSX.Element;
|
|
4
|
+
export declare const ChevronDownIcon: (props: SVGProps<SVGSVGElement>) => import("react").JSX.Element;
|
|
4
5
|
export declare const XIcon: (props: SVGProps<SVGSVGElement>) => import("react").JSX.Element;
|
package/dist/os/pwa.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type RefObject } from "react";
|
|
2
|
+
export type TitlebarArea = {
|
|
3
|
+
left: number;
|
|
4
|
+
right: number;
|
|
5
|
+
height: number;
|
|
6
|
+
insetRight: number;
|
|
7
|
+
};
|
|
8
|
+
export type WindowControlsOverlay = {
|
|
9
|
+
readonly root: RefObject<HTMLDivElement | null>;
|
|
10
|
+
readonly area: TitlebarArea | undefined;
|
|
11
|
+
};
|
|
12
|
+
export declare function useWindowControlsOverlay(enabled?: boolean): WindowControlsOverlay;
|
package/dist/os/surface.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { type WorkspaceMenu } from "./context.js";
|
|
|
2
2
|
import { type ReactNode, type CSSProperties } from "react";
|
|
3
3
|
import { type Box, type Edge, type Layout, type Pane } from "./layout.js";
|
|
4
4
|
import type { TabDrag } from "./tabs.js";
|
|
5
|
+
import type { TitlebarArea } from "./pwa.js";
|
|
5
6
|
export declare const position: (box: Box) => CSSProperties;
|
|
6
7
|
export type Docking = {
|
|
7
8
|
move: (drag: TabDrag) => boolean;
|
|
@@ -13,7 +14,8 @@ export type Docking = {
|
|
|
13
14
|
insertion?: number;
|
|
14
15
|
};
|
|
15
16
|
type Header = (pane: Pane, first: boolean, last: boolean, docking: Docking, surface: (key?: string) => HTMLElement | null) => ReactNode;
|
|
16
|
-
export declare function WorkspaceSurface({ layout, change, header, content, menu, }: {
|
|
17
|
+
export declare function WorkspaceSurface({ layout, change, header, content, menu, titlebarArea, }: {
|
|
18
|
+
titlebarArea?: TitlebarArea;
|
|
17
19
|
layout: Layout;
|
|
18
20
|
change: (layout: Layout) => void;
|
|
19
21
|
menu?: WorkspaceMenu;
|
package/dist/os/workspace.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
2
|
import { type Layout } from "./layout.js";
|
|
3
3
|
import { type Density, type WorkspaceMenu } from "./context.js";
|
|
4
|
+
import type { WindowControlsOverlay } from "./pwa.js";
|
|
4
5
|
export type WorkspaceTab = {
|
|
5
6
|
key: string;
|
|
6
7
|
label: string;
|
|
@@ -21,6 +22,8 @@ export type WorkspaceProps<T extends WorkspaceTab> = {
|
|
|
21
22
|
leading?: ReactNode;
|
|
22
23
|
trailing?: ReactNode;
|
|
23
24
|
titleBar?: boolean;
|
|
25
|
+
/** Use an installed PWA's title-bar area, keeping the browser's native controls. */
|
|
26
|
+
windowControlsOverlay?: WindowControlsOverlay;
|
|
24
27
|
toolbar?: (pane: WorkspacePane) => ReactNode;
|
|
25
28
|
menu?: WorkspaceMenu;
|
|
26
29
|
confirmClose?: (tab: T) => boolean | Promise<boolean>;
|
package/dist/pwa.js
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// pwa.ts
|
|
2
|
+
import {
|
|
3
|
+
useLayoutEffect,
|
|
4
|
+
useMemo,
|
|
5
|
+
useRef,
|
|
6
|
+
useState
|
|
7
|
+
} from "react";
|
|
8
|
+
function useWindowControlsOverlay(enabled = true) {
|
|
9
|
+
const root = useRef(null);
|
|
10
|
+
const [area, setArea] = useState();
|
|
11
|
+
useLayoutEffect(() => {
|
|
12
|
+
const overlay = navigator.windowControlsOverlay;
|
|
13
|
+
const element = root.current;
|
|
14
|
+
if (!enabled || !overlay || !element) {
|
|
15
|
+
setArea(void 0);
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
const measure = () => {
|
|
19
|
+
const rect = overlay.getTitlebarAreaRect();
|
|
20
|
+
const bounds = element.getBoundingClientRect();
|
|
21
|
+
const height = rect.y + rect.height - bounds.top;
|
|
22
|
+
const next = overlay.visible && !document.fullscreenElement && rect.width > 0 && rect.height > 0 && bounds.top >= rect.y && height > 0 ? {
|
|
23
|
+
left: Math.max(0, rect.x - bounds.left),
|
|
24
|
+
right: Math.min(bounds.width, rect.x + rect.width - bounds.left),
|
|
25
|
+
height,
|
|
26
|
+
insetRight: Math.max(0, bounds.right - rect.x - rect.width)
|
|
27
|
+
} : void 0;
|
|
28
|
+
setArea(
|
|
29
|
+
(previous) => previous?.left === next?.left && previous?.right === next?.right && previous?.height === next?.height && previous?.insetRight === next?.insetRight ? previous : next
|
|
30
|
+
);
|
|
31
|
+
};
|
|
32
|
+
let frame = 0;
|
|
33
|
+
const schedule = () => {
|
|
34
|
+
cancelAnimationFrame(frame);
|
|
35
|
+
frame = requestAnimationFrame(measure);
|
|
36
|
+
};
|
|
37
|
+
measure();
|
|
38
|
+
const observer = new ResizeObserver(schedule);
|
|
39
|
+
observer.observe(element);
|
|
40
|
+
overlay.addEventListener("geometrychange", schedule);
|
|
41
|
+
window.addEventListener("resize", schedule);
|
|
42
|
+
window.addEventListener("scroll", schedule, true);
|
|
43
|
+
document.addEventListener("fullscreenchange", schedule);
|
|
44
|
+
return () => {
|
|
45
|
+
cancelAnimationFrame(frame);
|
|
46
|
+
observer.disconnect();
|
|
47
|
+
overlay.removeEventListener("geometrychange", schedule);
|
|
48
|
+
window.removeEventListener("resize", schedule);
|
|
49
|
+
window.removeEventListener("scroll", schedule, true);
|
|
50
|
+
document.removeEventListener("fullscreenchange", schedule);
|
|
51
|
+
};
|
|
52
|
+
}, [enabled, root]);
|
|
53
|
+
return useMemo(
|
|
54
|
+
() => ({ root, area: enabled ? area : void 0 }),
|
|
55
|
+
[area, enabled]
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
export {
|
|
59
|
+
useWindowControlsOverlay
|
|
60
|
+
};
|
|
61
|
+
//# sourceMappingURL=pwa.js.map
|
package/dist/pwa.js.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../pwa.ts"],
|
|
4
|
+
"sourcesContent": ["import {\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n type RefObject,\n} from \"react\";\n\ntype Overlay = EventTarget & {\n visible: boolean;\n getTitlebarAreaRect: () => DOMRect;\n};\n\nexport type TitlebarArea = {\n left: number;\n right: number;\n height: number;\n insetRight: number;\n};\n\nexport type WindowControlsOverlay = {\n readonly root: RefObject<HTMLDivElement | null>;\n readonly area: TitlebarArea | undefined;\n};\n\n// Coordinates supplied by the browser are viewport-relative, while pane boxes\n// are workspace-relative. Never infer an overlay from the OS or display mode.\nexport function useWindowControlsOverlay(\n enabled = true,\n): WindowControlsOverlay {\n const root = useRef<HTMLDivElement>(null);\n const [area, setArea] = useState<TitlebarArea>();\n useLayoutEffect(() => {\n const overlay = (\n navigator as Navigator & { windowControlsOverlay?: Overlay }\n ).windowControlsOverlay;\n const element = root.current;\n if (!enabled || !overlay || !element) {\n setArea(undefined);\n return;\n }\n const measure = () => {\n const rect = overlay.getTitlebarAreaRect();\n const bounds = element.getBoundingClientRect();\n const height = rect.y + rect.height - bounds.top;\n const next =\n overlay.visible &&\n !document.fullscreenElement &&\n rect.width > 0 &&\n rect.height > 0 &&\n bounds.top >= rect.y &&\n height > 0\n ? {\n left: Math.max(0, rect.x - bounds.left),\n right: Math.min(bounds.width, rect.x + rect.width - bounds.left),\n height,\n insetRight: Math.max(0, bounds.right - rect.x - rect.width),\n }\n : undefined;\n setArea((previous) =>\n previous?.left === next?.left &&\n previous?.right === next?.right &&\n previous?.height === next?.height &&\n previous?.insetRight === next?.insetRight\n ? previous\n : next,\n );\n };\n let frame = 0;\n const schedule = () => {\n cancelAnimationFrame(frame);\n frame = requestAnimationFrame(measure);\n };\n measure();\n const observer = new ResizeObserver(schedule);\n observer.observe(element);\n overlay.addEventListener(\"geometrychange\", schedule);\n window.addEventListener(\"resize\", schedule);\n window.addEventListener(\"scroll\", schedule, true);\n document.addEventListener(\"fullscreenchange\", schedule);\n return () => {\n cancelAnimationFrame(frame);\n observer.disconnect();\n overlay.removeEventListener(\"geometrychange\", schedule);\n window.removeEventListener(\"resize\", schedule);\n window.removeEventListener(\"scroll\", schedule, true);\n document.removeEventListener(\"fullscreenchange\", schedule);\n };\n }, [enabled, root]);\n return useMemo(\n () => ({ root, area: enabled ? area : undefined }),\n [area, enabled],\n );\n}\n"],
|
|
5
|
+
"mappings": ";AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AAqBA,SAAS,yBACd,UAAU,MACa;AACvB,QAAM,OAAO,OAAuB,IAAI;AACxC,QAAM,CAAC,MAAM,OAAO,IAAI,SAAuB;AAC/C,kBAAgB,MAAM;AACpB,UAAM,UACJ,UACA;AACF,UAAM,UAAU,KAAK;AACrB,QAAI,CAAC,WAAW,CAAC,WAAW,CAAC,SAAS;AACpC,cAAQ,MAAS;AACjB;AAAA,IACF;AACA,UAAM,UAAU,MAAM;AACpB,YAAM,OAAO,QAAQ,oBAAoB;AACzC,YAAM,SAAS,QAAQ,sBAAsB;AAC7C,YAAM,SAAS,KAAK,IAAI,KAAK,SAAS,OAAO;AAC7C,YAAM,OACJ,QAAQ,WACR,CAAC,SAAS,qBACV,KAAK,QAAQ,KACb,KAAK,SAAS,KACd,OAAO,OAAO,KAAK,KACnB,SAAS,IACL;AAAA,QACE,MAAM,KAAK,IAAI,GAAG,KAAK,IAAI,OAAO,IAAI;AAAA,QACtC,OAAO,KAAK,IAAI,OAAO,OAAO,KAAK,IAAI,KAAK,QAAQ,OAAO,IAAI;AAAA,QAC/D;AAAA,QACA,YAAY,KAAK,IAAI,GAAG,OAAO,QAAQ,KAAK,IAAI,KAAK,KAAK;AAAA,MAC5D,IACA;AACN;AAAA,QAAQ,CAAC,aACP,UAAU,SAAS,MAAM,QACzB,UAAU,UAAU,MAAM,SAC1B,UAAU,WAAW,MAAM,UAC3B,UAAU,eAAe,MAAM,aAC3B,WACA;AAAA,MACN;AAAA,IACF;AACA,QAAI,QAAQ;AACZ,UAAM,WAAW,MAAM;AACrB,2BAAqB,KAAK;AAC1B,cAAQ,sBAAsB,OAAO;AAAA,IACvC;AACA,YAAQ;AACR,UAAM,WAAW,IAAI,eAAe,QAAQ;AAC5C,aAAS,QAAQ,OAAO;AACxB,YAAQ,iBAAiB,kBAAkB,QAAQ;AACnD,WAAO,iBAAiB,UAAU,QAAQ;AAC1C,WAAO,iBAAiB,UAAU,UAAU,IAAI;AAChD,aAAS,iBAAiB,oBAAoB,QAAQ;AACtD,WAAO,MAAM;AACX,2BAAqB,KAAK;AAC1B,eAAS,WAAW;AACpB,cAAQ,oBAAoB,kBAAkB,QAAQ;AACtD,aAAO,oBAAoB,UAAU,QAAQ;AAC7C,aAAO,oBAAoB,UAAU,UAAU,IAAI;AACnD,eAAS,oBAAoB,oBAAoB,QAAQ;AAAA,IAC3D;AAAA,EACF,GAAG,CAAC,SAAS,IAAI,CAAC;AAClB,SAAO;AAAA,IACL,OAAO,EAAE,MAAM,MAAM,UAAU,OAAO,OAAU;AAAA,IAChD,CAAC,MAAM,OAAO;AAAA,EAChB;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/styles.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:where([class^=lab-],[class*=" lab-"]){box-sizing:border-box;margin:0;padding:0;border:0 solid}:where(button,a):is([class^=lab-],[class*=" lab-"]){font:inherit;color:inherit;background:transparent;text-decoration:none}:where(svg[class^=lab-],svg[class*=" lab-"]){display:block;vertical-align:middle}.lab-sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border-width:0}.lab-workspace{position:relative;display:flex;flex-direction:column;height:100%;min-height:0;min-width:0;overflow:hidden;background-color:var(--lab-background);font-family:var(--lab-font-sans);font-size:.875rem;font-weight:400;line-height:1.5;color:var(--lab-foreground)}.lab-surface{min-height:0;flex:1;overflow:auto}.lab-board{position:relative;isolation:isolate;height:100%;width:100%;overflow:clip}.lab-pane-header,.lab-panel{position:absolute;transition-property:left,top,width,height;transition-timing-function:cubic-bezier(0,0,.2,1);transition-duration:.18s}.lab-pane-header{z-index:30}.lab-panel{min-height:0;min-width:0;overflow:auto;overscroll-behavior:contain;border:1px solid var(--lab-border);border-radius:1rem;background-color:var(--lab-card);padding:.75rem;outline-style:none}.lab-panel:focus-visible:not([data-pointer]){box-shadow:inset 0 0 0 2px var(--lab-ring)}@media(min-width:40rem){.lab-panel{padding:1.25rem}}.lab-divider,.lab-frame-handle{position:absolute;touch-action:none;user-select:none;border-radius:.25rem;outline-style:none}.lab-divider{z-index:20;cursor:row-resize}.lab-divider[aria-orientation=vertical]{cursor:col-resize}.lab-divider:focus-visible{box-shadow:0 0 0 2px var(--lab-ring)}.lab-frame{height:100%;min-width:0}.lab-frame-content{position:relative;margin-inline:auto;height:100%}.lab-frame-handle{top:2.75rem;bottom:.75rem;z-index:40;width:1.5rem;cursor:col-resize}.lab-frame-handle:focus-visible{box-shadow:inset 0 0 0 2px var(--lab-ring)}.lab-toolbar{position:relative;z-index:30;display:flex;flex-shrink:0;align-items:center;gap:.25rem;padding-left:1rem;user-select:none}.lab-toolbar[data-leading]{padding-left:1px}@media(min-width:40rem){.lab-toolbar[data-leading]{padding-left:9px}}.lab-toolbar-tabs{min-width:0}.lab-toolbar-end{display:flex;flex-shrink:0;align-self:flex-end;align-items:center;height:var(--lab-tab-content-height);gap:.25rem}.lab-toolbar-trailing{flex-shrink:0;margin-inline-start:auto}.lab-trailing{position:absolute;top:0;right:0;z-index:1;display:flex;align-items:center}.lab-workspace[data-title-bar] .lab-pane-header[data-top] .lab-toolbar>:not(.lab-toolbar-tabs,.lab-toolbar-end),.lab-workspace[data-title-bar] .lab-trailing>:not(.lab-window-controls){translate:0 calc(var(--lab-title-inset) / -2)}.lab-toolbar[data-leading]:has(>.lab-traffic-lights){padding-left:0}.lab-traffic-lights{flex-shrink:0;align-self:stretch;width:72px}.lab-window-controls{align-self:stretch;width:138px}.lab-window-buttons{position:fixed;top:0;right:0;z-index:40;display:flex;height:calc(var(--lab-window-top) + var(--lab-tab-height) - 1px)}.lab-window-button{display:flex;align-items:center;justify-content:center;width:46px;height:100%;color:var(--lab-foreground);outline-style:none;transition-property:color,background-color;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.1s}.lab-window-button:hover{background-color:#0000000d}.lab-window-button:active,.lab-window-button:focus-visible{background-color:#0000001a}:where(.dark) .lab-window-button:hover{background-color:#ffffff1a}:where(.dark) .lab-window-button:active{background-color:#ffffff0d}:where(.dark) .lab-window-button:focus-visible{background-color:#ffffff26}.lab-window-close:hover{background-color:#c42b1c;color:#fff}.lab-window-close:active{background-color:#c84031;color:#fff}.lab-tabs{position:relative;isolation:isolate;display:flex;align-items:center;min-width:0;max-width:100%}.lab-tablist{position:relative;display:flex;align-items:center;min-width:0;max-width:100%;overflow-x:auto;padding-inline:.5rem;scrollbar-width:none;user-select:none}.lab-scroll{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;border-radius:.625rem;font-size:.875rem;font-weight:500;line-height:calc(1.25 / .875);outline-style:none;transition:background-color .15s cubic-bezier(.4,0,.2,1)}.lab-scroll:focus-visible{box-shadow:0 0 0 2px var(--lab-ring)}.lab-scroll:disabled{opacity:.3}.lab-icon{width:1rem;height:1rem}.lab-tab{position:relative;flex-shrink:0;transition:margin-right .16s cubic-bezier(0,0,.2,1)}.lab-tab[data-dragging]{opacity:0}.lab-tab-link,.lab-ghost-content{position:relative;display:flex;align-items:center;padding-right:2.5rem;padding-left:1.25rem;font-size:.875rem;line-height:calc(1.25 / .875)}.lab-tab-link{isolation:isolate;border-top-left-radius:.75rem;border-top-right-radius:.75rem;outline-style:none;touch-action:none;color:var(--lab-muted-foreground)}.lab-tab[data-dragging] .lab-tab-link{cursor:grabbing;touch-action:auto}.lab-tab-link[aria-selected=true],.lab-ghost-content{font-weight:500}.lab-tab-link[aria-selected=true],.lab-tab-link:focus-visible{color:var(--lab-foreground)}.lab-tab-icon{margin-right:.5rem;flex-shrink:0}.lab-tab-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.lab-tab-placeholder{flex-shrink:0}.lab-tab-close{position:absolute;right:.75rem;display:grid;width:1.5rem;height:1.5rem;place-items:center;translate:0 -50%;border-radius:9999px;color:var(--lab-muted-foreground);transition-property:color,background-color;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.lab-tab-close:focus-visible{background-color:color-mix(in oklab,var(--lab-foreground) 10%,transparent);outline:2px solid var(--lab-ring)}.lab-tab-close-icon{width:.875rem;height:.875rem}@media(hover:hover){.lab-scroll:hover{background-color:var(--lab-accent)}.lab-tab-link:hover{color:var(--lab-foreground)}.lab-tab-close:hover{background-color:color-mix(in oklab,var(--lab-foreground) 10%,transparent);color:var(--lab-foreground)}.lab-tab:hover .lab-tab-fill:not([data-selected]){fill:color-mix(in srgb,var(--lab-card) 65%,var(--lab-background))}}.lab-tab-surface{pointer-events:none;position:absolute;top:0;left:-.5rem;height:100%;width:calc(100% + 16px);overflow:visible}.lab-tab-fill{fill:color-mix(in srgb,var(--lab-card) 45%,var(--lab-background));transition:fill .15s cubic-bezier(.4,0,.2,1)}.lab-tab-fill[data-selected]{fill:var(--lab-card);transition:none}.lab-outline{fill:none;stroke:var(--lab-border)}.lab-tab-focus{display:none;fill:none;stroke:var(--lab-ring);stroke-width:3px}.lab-tab:has(a:focus-visible) .lab-tab-focus{display:block}.lab-pane-frame{pointer-events:none;position:absolute;z-index:42;overflow:visible}.lab-ghost{position:fixed;left:0;top:0;will-change:transform;z-index:40;pointer-events:none;user-select:none;font-family:var(--lab-font-sans);line-height:1.5;color:var(--lab-foreground)}body:has([data-dragged-tab]) *{cursor:grabbing!important;user-select:none!important}[data-drag-content]{position:fixed!important;left:0!important;top:0!important;width:var(--lab-drag-width)!important;height:var(--lab-drag-height)!important;will-change:transform;clip-path:inset(0 round 16px);border-color:transparent!important;pointer-events:none!important;transition:none!important;z-index:40}:where([data-pane-sheet],[data-pane-sheet] *){scrollbar-width:thin;scrollbar-color:color-mix(in srgb,var(--lab-foreground) 35%,transparent) transparent}@supports selector(::-webkit-scrollbar){:where([data-pane-sheet],[data-pane-sheet] *){scrollbar-width:auto;scrollbar-color:auto}:where([data-pane-sheet],[data-pane-sheet] *)::-webkit-scrollbar{width:12px;height:12px}:where([data-pane-sheet],[data-pane-sheet] *)::-webkit-scrollbar-thumb{border:3px solid transparent;border-radius:999px;background:color-mix(in srgb,var(--lab-foreground) 35%,transparent);background-clip:padding-box}:where([data-pane-sheet],[data-pane-sheet] *)::-webkit-scrollbar-thumb:hover{background-color:color-mix(in srgb,var(--lab-foreground) 55%,transparent)}:where([data-pane-sheet],[data-pane-sheet] *)::-webkit-scrollbar-track{margin:12px}:where([data-pane-sheet],[data-pane-sheet] *)::-webkit-scrollbar-corner{background:transparent}:where([data-pane-sheet],[data-pane-sheet] *)::-webkit-scrollbar-button{display:none}}@media(prefers-reduced-motion:reduce){.lab-pane-header,.lab-panel,.lab-tab{transition-property:none}:where([class^=lab-],[class*=" lab-"]){animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}@media(forced-colors:active){.lab-tab-link[aria-selected=true]{text-decoration:underline;text-underline-offset:.3em}.lab-window-button:hover,.lab-window-button:focus-visible{outline:2px solid;outline-offset:-2px}:where([data-pane-sheet],[data-pane-sheet] *){scrollbar-color:auto;scrollbar-width:auto}:where([data-pane-sheet],[data-pane-sheet] *)::-webkit-scrollbar-thumb,:where([data-pane-sheet],[data-pane-sheet] *)::-webkit-scrollbar-thumb:hover{background-color:CanvasText}}:where(:root){--lab-font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;--lab-background: #eeeeee;--lab-foreground: #242424;--lab-card: #ffffff;--lab-muted-foreground: #626262;--lab-accent: #e6e6e6;--lab-border: #d6d6d6;--lab-ring: #1d9db4}:where(.dark){--lab-background: #1c1c1c;--lab-foreground: #e8e8e8;--lab-card: #242424;--lab-muted-foreground: #a3a3a3;--lab-accent: #363636;--lab-border: #363636;--lab-ring: #68bccf}@media(forced-colors:active){:root,.dark{--lab-background: Canvas !important;--lab-card: Canvas !important;--lab-border: CanvasText !important;--lab-foreground: CanvasText !important}}
|
|
1
|
+
:where([class^=lab-],[class*=" lab-"]){box-sizing:border-box;margin:0;padding:0;border:0 solid}:where(button,a):is([class^=lab-],[class*=" lab-"]){font:inherit;color:inherit;background:transparent;text-decoration:none}:where(svg[class^=lab-],svg[class*=" lab-"]){display:block;vertical-align:middle}.lab-sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border-width:0}.lab-workspace{position:relative;display:flex;flex-direction:column;height:100%;min-height:0;min-width:0;overflow:hidden;background-color:var(--lab-background);font-family:var(--lab-font-sans);font-size:.875rem;font-weight:400;line-height:1.5;color:var(--lab-foreground)}.lab-surface{min-height:0;flex:1;overflow:auto}.lab-board{position:relative;isolation:isolate;height:100%;width:100%;overflow:clip}.lab-pane-header,.lab-panel{position:absolute;transition-property:left,top,width,height;transition-timing-function:cubic-bezier(0,0,.2,1);transition-duration:.18s}.lab-pane-header{z-index:30}.lab-pane-header[data-titlebar-overlay]{overflow:clip}.lab-pane-header[data-titlebar-overlay] .lab-toolbar{-webkit-app-region:drag;app-region:drag}.lab-pane-header[data-titlebar-overlay] .lab-toolbar>:not(.lab-toolbar-trailing),.lab-workspace[data-window-controls-overlay] .lab-trailing,.lab-pane-header[data-titlebar-overlay] :is(button,a,input,textarea,select,[role],[tabindex],[contenteditable],[data-window-no-drag]){-webkit-app-region:no-drag;app-region:no-drag}.lab-pane-header[data-titlebar-overlay] [data-window-drag]:not(button,a,input,textarea,select,[role],[tabindex],[contenteditable],[data-window-no-drag]){-webkit-app-region:drag;app-region:drag}.lab-panel{min-height:0;min-width:0;overflow:auto;overscroll-behavior:contain;border:1px solid var(--lab-border);border-radius:1rem;background-color:var(--lab-card);padding:.75rem;outline-style:none}.lab-panel:focus-visible:not([data-pointer]){box-shadow:inset 0 0 0 2px var(--lab-ring)}@media(min-width:40rem){.lab-panel{padding:1.25rem}}.lab-divider,.lab-frame-handle{position:absolute;touch-action:none;user-select:none;border-radius:.25rem;outline-style:none}.lab-divider{z-index:20;cursor:row-resize}.lab-divider[aria-orientation=vertical]{cursor:col-resize}.lab-divider:focus-visible{box-shadow:0 0 0 2px var(--lab-ring)}.lab-frame{height:100%;min-width:0}.lab-frame-content{position:relative;margin-inline:auto;height:100%}.lab-frame-handle{top:2.75rem;bottom:.75rem;z-index:40;width:1.5rem;cursor:col-resize}.lab-frame-handle:focus-visible{box-shadow:inset 0 0 0 2px var(--lab-ring)}.lab-toolbar{position:relative;z-index:30;display:flex;flex-shrink:0;align-items:center;gap:.25rem;padding-left:1rem;user-select:none}.lab-toolbar[data-leading]{padding-left:1px}@media(min-width:40rem){.lab-toolbar[data-leading]{padding-left:9px}}.lab-toolbar-tabs{min-width:0}.lab-toolbar-end{display:flex;flex-shrink:0;align-self:flex-end;align-items:center;height:var(--lab-tab-content-height);gap:.25rem}.lab-toolbar-trailing{flex-shrink:0;margin-inline-start:auto}.lab-trailing{position:absolute;top:0;right:0;z-index:1;display:flex;align-items:center}.lab-workspace[data-title-bar] .lab-pane-header[data-top] .lab-toolbar>:not(.lab-toolbar-tabs,.lab-toolbar-end),.lab-workspace[data-title-bar] .lab-trailing>:not(.lab-window-controls){translate:0 calc(var(--lab-title-inset) / -2)}.lab-toolbar[data-leading]:has(>.lab-traffic-lights){padding-left:0}.lab-traffic-lights{flex-shrink:0;align-self:stretch;width:72px}.lab-window-controls{align-self:stretch;width:138px}.lab-window-buttons{position:fixed;top:0;right:0;z-index:40;display:flex;height:calc(var(--lab-window-top) + var(--lab-tab-height) - 1px)}.lab-window-button{display:flex;align-items:center;justify-content:center;width:46px;height:100%;color:var(--lab-foreground);outline-style:none;transition-property:color,background-color;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.1s}.lab-window-button:hover{background-color:#0000000d}.lab-window-button:active,.lab-window-button:focus-visible{background-color:#0000001a}:where(.dark) .lab-window-button:hover{background-color:#ffffff1a}:where(.dark) .lab-window-button:active{background-color:#ffffff0d}:where(.dark) .lab-window-button:focus-visible{background-color:#ffffff26}.lab-window-close:hover{background-color:#c42b1c;color:#fff}.lab-window-close:active{background-color:#c84031;color:#fff}.lab-tabs{position:relative;isolation:isolate;display:flex;align-items:center;min-width:0;max-width:100%}.lab-tablist{position:relative;display:flex;align-items:center;min-width:0;max-width:100%;overflow-x:auto;padding-inline:.5rem;scrollbar-width:none;user-select:none}.lab-scroll{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;border-radius:.625rem;font-size:.875rem;font-weight:500;line-height:calc(1.25 / .875);outline-style:none;transition:background-color .15s cubic-bezier(.4,0,.2,1)}.lab-scroll:focus-visible{box-shadow:0 0 0 2px var(--lab-ring)}.lab-scroll:disabled{opacity:.3}.lab-icon{width:1rem;height:1rem}.lab-tab{position:relative;flex-shrink:0;transition:margin-right .16s cubic-bezier(0,0,.2,1)}.lab-tab[data-dragging]{opacity:0}.lab-tab-link,.lab-ghost-content{position:relative;display:flex;align-items:center;padding-right:2.5rem;padding-left:1.25rem;font-size:.875rem;line-height:calc(1.25 / .875)}.lab-tab-link{isolation:isolate;border-top-left-radius:.75rem;border-top-right-radius:.75rem;outline-style:none;touch-action:auto;color:var(--lab-muted-foreground)}.lab-tab[data-dragging] .lab-tab-link{cursor:grabbing;touch-action:auto}.lab-tab-link[aria-selected=true],.lab-ghost-content{font-weight:500}.lab-tab-link[aria-selected=true],.lab-tab-link:focus-visible{color:var(--lab-foreground)}.lab-tab-icon{margin-right:.5rem;flex-shrink:0}.lab-tab-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.lab-tab-placeholder{flex-shrink:0}.lab-tab-close{position:absolute;right:.75rem;display:grid;width:1.5rem;height:1.5rem;place-items:center;translate:0 -50%;border-radius:9999px;color:var(--lab-muted-foreground);transition-property:color,background-color;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.lab-tab-close:focus-visible{background-color:color-mix(in oklab,var(--lab-foreground) 10%,transparent);outline:2px solid var(--lab-ring)}.lab-tab-close-icon{width:.875rem;height:.875rem}.lab-tab-picker{display:none}@media(pointer:coarse){.lab-scroll{display:none}.lab-tab-picker{position:relative;display:grid;flex-shrink:0;place-items:center;width:2.75rem;height:min(2.75rem,var(--lab-tab-height));border-radius:.625rem}.lab-tab-picker select{position:absolute;inset:0;width:100%;height:100%;opacity:0;font-size:1rem}.lab-tab-picker:has(select:focus-visible){outline:2px solid var(--lab-ring);outline-offset:-2px}.lab-tab-close{width:2rem;height:min(2rem,var(--lab-tab-content-height));right:.5rem}}@media(hover:hover){.lab-scroll:hover{background-color:var(--lab-accent)}.lab-tab-link:hover{color:var(--lab-foreground)}.lab-tab-close:hover{background-color:color-mix(in oklab,var(--lab-foreground) 10%,transparent);color:var(--lab-foreground)}.lab-tab:hover .lab-tab-fill:not([data-selected]){fill:color-mix(in srgb,var(--lab-card) 65%,var(--lab-background))}}.lab-tab-surface{pointer-events:none;position:absolute;top:0;left:-.5rem;height:100%;width:calc(100% + 16px);overflow:visible}.lab-tab-fill{fill:color-mix(in srgb,var(--lab-card) 45%,var(--lab-background));transition:fill .15s cubic-bezier(.4,0,.2,1)}.lab-tab-fill[data-selected]{fill:var(--lab-card);transition:none}.lab-outline{fill:none;stroke:var(--lab-border)}.lab-tab-focus{display:none;fill:none;stroke:var(--lab-ring);stroke-width:3px}.lab-tab:has(a:focus-visible) .lab-tab-focus{display:block}.lab-pane-frame{pointer-events:none;position:absolute;z-index:42;overflow:visible}.lab-ghost{position:fixed;left:0;top:0;will-change:transform;z-index:40;pointer-events:none;user-select:none;font-family:var(--lab-font-sans);line-height:1.5;color:var(--lab-foreground)}body:has([data-dragged-tab]) *{cursor:grabbing!important;user-select:none!important}[data-drag-content]{position:fixed!important;left:0!important;top:0!important;width:var(--lab-drag-width)!important;height:var(--lab-drag-height)!important;will-change:transform;clip-path:inset(0 round 16px);border-color:transparent!important;pointer-events:none!important;transition:none!important;z-index:40}:where([data-pane-sheet],[data-pane-sheet] *){scrollbar-width:thin;scrollbar-color:color-mix(in srgb,var(--lab-foreground) 35%,transparent) transparent}@supports selector(::-webkit-scrollbar){:where([data-pane-sheet],[data-pane-sheet] *){scrollbar-width:auto;scrollbar-color:auto}:where([data-pane-sheet],[data-pane-sheet] *)::-webkit-scrollbar{width:12px;height:12px}:where([data-pane-sheet],[data-pane-sheet] *)::-webkit-scrollbar-thumb{border:3px solid transparent;border-radius:999px;background:color-mix(in srgb,var(--lab-foreground) 35%,transparent);background-clip:padding-box}:where([data-pane-sheet],[data-pane-sheet] *)::-webkit-scrollbar-thumb:hover{background-color:color-mix(in srgb,var(--lab-foreground) 55%,transparent)}:where([data-pane-sheet],[data-pane-sheet] *)::-webkit-scrollbar-track{margin:12px}:where([data-pane-sheet],[data-pane-sheet] *)::-webkit-scrollbar-corner{background:transparent}:where([data-pane-sheet],[data-pane-sheet] *)::-webkit-scrollbar-button{display:none}}@media(prefers-reduced-motion:reduce){.lab-pane-header,.lab-panel,.lab-tab{transition-property:none}:where([class^=lab-],[class*=" lab-"]){animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}@media(forced-colors:active){.lab-tab-link[aria-selected=true]{text-decoration:underline;text-underline-offset:.3em}.lab-window-button:hover,.lab-window-button:focus-visible{outline:2px solid;outline-offset:-2px}:where([data-pane-sheet],[data-pane-sheet] *){scrollbar-color:auto;scrollbar-width:auto}:where([data-pane-sheet],[data-pane-sheet] *)::-webkit-scrollbar-thumb,:where([data-pane-sheet],[data-pane-sheet] *)::-webkit-scrollbar-thumb:hover{background-color:CanvasText}}:where(:root){--lab-font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;--lab-background: #eeeeee;--lab-foreground: #242424;--lab-card: #ffffff;--lab-muted-foreground: #626262;--lab-accent: #e6e6e6;--lab-border: #d6d6d6;--lab-ring: #1d9db4}:where(.dark){--lab-background: #1c1c1c;--lab-foreground: #e8e8e8;--lab-card: #242424;--lab-muted-foreground: #a3a3a3;--lab-accent: #363636;--lab-border: #363636;--lab-ring: #68bccf}@media(forced-colors:active){:root,.dark{--lab-background: Canvas !important;--lab-card: Canvas !important;--lab-border: CanvasText !important;--lab-foreground: CanvasText !important}}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@labpane/os",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.1",
|
|
4
4
|
"description": "Tabs and resizable split panes for React",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://labpane.com",
|
|
@@ -19,6 +19,10 @@
|
|
|
19
19
|
"types": "./dist/os/index.d.ts",
|
|
20
20
|
"default": "./dist/index.js"
|
|
21
21
|
},
|
|
22
|
+
"./pwa": {
|
|
23
|
+
"types": "./dist/os/pwa.d.ts",
|
|
24
|
+
"default": "./dist/pwa.js"
|
|
25
|
+
},
|
|
22
26
|
"./styles.css": {
|
|
23
27
|
"types": "./dist/styles.d.ts",
|
|
24
28
|
"default": "./dist/styles.css"
|
|
@@ -39,7 +43,7 @@
|
|
|
39
43
|
"directory": "packages/os"
|
|
40
44
|
},
|
|
41
45
|
"scripts": {
|
|
42
|
-
"build": "node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\" && tsc -p tsconfig.json && esbuild index.ts --bundle --sourcemap --format=esm --packages=external --
|
|
46
|
+
"build": "node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\" && tsc -p tsconfig.json && esbuild index.ts pwa.ts --bundle --sourcemap --format=esm --packages=external --outdir=dist && esbuild styles.css --minify --outfile=dist/styles.css && node ../package-assets.mjs",
|
|
43
47
|
"test": "bun test",
|
|
44
48
|
"prepack": "npm run build"
|
|
45
49
|
},
|