@tooee/layout 0.2.1 → 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/README.md +7 -0
- package/dist/AppLayout.d.ts +4 -0
- package/dist/AppLayout.d.ts.map +1 -1
- package/dist/AppLayout.js +2 -2
- package/dist/AppLayout.js.map +1 -1
- package/package.json +6 -6
- package/src/AppLayout.tsx +9 -6
package/README.md
CHANGED
|
@@ -3,3 +3,10 @@
|
|
|
3
3
|
Standard app chrome (title bar, status bar) for Tooee.
|
|
4
4
|
|
|
5
5
|
Part of the [Tooee](https://github.com/gingerhendrix/tooee) monorepo. See the main repo for documentation.
|
|
6
|
+
|
|
7
|
+
## Overlays
|
|
8
|
+
|
|
9
|
+
Open overlays through the `@tooee/overlays` store (`useOverlay().open()` or
|
|
10
|
+
`show()`). `AppLayout.overlay` remains available for 0.2.x source compatibility,
|
|
11
|
+
but is deprecated and will be removed in 0.3.0. Store-backed overlays preserve
|
|
12
|
+
stacking, command-surface ownership, and mode restoration.
|
package/dist/AppLayout.d.ts
CHANGED
|
@@ -17,6 +17,10 @@ export interface AppLayoutProps {
|
|
|
17
17
|
focused?: boolean;
|
|
18
18
|
};
|
|
19
19
|
searchBar?: SearchState;
|
|
20
|
+
/**
|
|
21
|
+
* @deprecated Open overlays through `useOverlay()` instead. This compatibility
|
|
22
|
+
* prop will be removed in Tooee 0.3.0.
|
|
23
|
+
*/
|
|
20
24
|
overlay?: ReactNode;
|
|
21
25
|
children: ReactNode;
|
|
22
26
|
}
|
package/dist/AppLayout.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppLayout.d.ts","sourceRoot":"","sources":["../src/AppLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAA;AAGxD,OAAO,K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AAK,EAAE,aAAa,EAAE,CAAA;KAAE,CAAA;IACrC,SAAS,CAAC,EAAE,SAAS,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAAA;IACjD,WAAW,CAAC,EAAE;QACZ,YAAY,CAAC,EAAE,OAAO,CAAA;QACtB,WAAW,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAA;QAC9B,OAAO,CAAC,EAAE,OAAO,CAAA;KAClB,CAAA;IACD,SAAS,CAAC,EAAE,WAAW,CAAA;IACvB;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED,wBAAgB,SAAS,CAAC,EACxB,QAAQ,EACR,SAAS,EACT,SAAS,EACT,WAAW,EACX,SAAS,EACT,OAAO,EACP,QAAQ,GACT,EAAE,cAAc,aAgDhB"}
|
package/dist/AppLayout.js
CHANGED
|
@@ -9,7 +9,7 @@ import { ToastContainer } from "@tooee/toasts";
|
|
|
9
9
|
export function AppLayout({ titleBar, statusBar, scrollRef, scrollProps, searchBar, overlay, children, }) {
|
|
10
10
|
const { theme } = useTheme();
|
|
11
11
|
const contextOverlay = useCurrentOverlay();
|
|
12
|
-
const
|
|
13
|
-
return (_jsxs("box", { flexDirection: "column", width: "100%", height: "100%", backgroundColor: theme.background, children: [titleBar && _jsx(TitleBar, { title: titleBar.title, subtitle: titleBar.subtitle }), _jsxs("box", { style: { flexGrow: 1, position: "relative" }, children: [scrollRef ? (_jsx("scrollbox", { ref: scrollRef, style: { flexGrow: 1 }, stickyScroll: scrollProps?.stickyScroll, stickyStart: scrollProps?.stickyStart, focused: scrollProps?.focused ?? true, children: children })) : (_jsx("box", { style: { flexGrow: 1, overflow: "hidden" }, children: children })),
|
|
12
|
+
const compatibilityOverlay = overlay != null ? (_jsx(CommandSurfaceProvider, { id: "app-layout.overlay", role: "modal", initialMode: "insert", children: overlay })) : null;
|
|
13
|
+
return (_jsxs("box", { flexDirection: "column", width: "100%", height: "100%", backgroundColor: theme.background, children: [titleBar && _jsx(TitleBar, { title: titleBar.title, subtitle: titleBar.subtitle }), _jsxs("box", { style: { flexGrow: 1, position: "relative" }, children: [scrollRef ? (_jsx("scrollbox", { ref: scrollRef, style: { flexGrow: 1 }, stickyScroll: scrollProps?.stickyScroll, stickyStart: scrollProps?.stickyStart, focused: scrollProps?.focused ?? true, children: children })) : (_jsx("box", { style: { flexGrow: 1, overflow: "hidden" }, children: children })), (contextOverlay || compatibilityOverlay) && (_jsxs("box", { position: "absolute", left: 0, top: 0, width: "100%", height: "100%", children: [contextOverlay, compatibilityOverlay] })), _jsx(ToastContainer, {})] }), searchBar?.searchActive ? (_jsx(SearchBar, { query: searchBar.searchQuery, onQueryChange: searchBar.setSearchQuery, onSubmit: searchBar.submitSearch, onCancel: () => searchBar.setSearchQuery(""), matchCount: searchBar.matchingLines.length, currentMatch: searchBar.currentMatchIndex })) : (_jsx(StatusBar, { items: statusBar.items }))] }));
|
|
14
14
|
}
|
|
15
15
|
//# sourceMappingURL=AppLayout.js.map
|
package/dist/AppLayout.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppLayout.js","sourceRoot":"","sources":["../src/AppLayout.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAEzC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAA;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"AppLayout.js","sourceRoot":"","sources":["../src/AppLayout.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,QAAQ,EAAE,MAA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AE,WAAW,EAAE,WAAW,EACrC,OAAO,EAAE,WAAW,EAAE,OAAO,IAAI,IAAI,YAEpC,QAAQ,GACC,CACb,CAAC,CAAC,CAAC,CACF,cAAK,KAAK,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAG,QAAQ,GAAO,CAClE,EACA,CAAC,cAAc,IAAI,oBAAoB,CAAC,IAAI,CAC3C,eAAK,QAAQ,EAAC,UAAU,EAAC,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,EAAC,MAAM,EAAC,MAAM,EAAC,MAAM,aACjE,cAAc,EACd,oBAAoB,IACjB,CACP,EACD,KAAC,cAAc,KAAG,IACd,EACL,SAAS,EAAE,YAAY,CAAC,CAAC,CAAC,CACzB,KAAC,SAAS,IACR,KAAK,EAAE,SAAS,CAAC,WAAW,EAC5B,aAAa,EAAE,SAAS,CAAC,cAAc,EACvC,QAAQ,EAAE,SAAS,CAAC,YAAY,EAChC,QAAQ,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,cAAc,CAAC,EAAE,CAAC,EAC5C,UAAU,EAAE,SAAS,CAAC,aAAa,CAAC,MAAM,EAC1C,YAAY,EAAE,SAAS,CAAC,iBAAiB,GACzC,CACH,CAAC,CAAC,CAAC,CACF,KAAC,SAAS,IAAC,KAAK,EAAE,SAAS,CAAC,KAAK,GAAI,CACtC,IACG,CACP,CAAA;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tooee/layout",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "Standard app chrome (title bar, status bar) for Tooee",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
"typecheck": "tsc --noEmit"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@tooee/commands": "0.2.
|
|
39
|
-
"@tooee/overlays": "0.2.
|
|
40
|
-
"@tooee/search": "0.2.
|
|
41
|
-
"@tooee/themes": "0.2.
|
|
42
|
-
"@tooee/toasts": "0.2.
|
|
38
|
+
"@tooee/commands": "0.2.3",
|
|
39
|
+
"@tooee/overlays": "0.2.3",
|
|
40
|
+
"@tooee/search": "0.2.3",
|
|
41
|
+
"@tooee/themes": "0.2.3",
|
|
42
|
+
"@tooee/toasts": "0.2.3"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@opentui/core": "^0.4.3",
|
package/src/AppLayout.tsx
CHANGED
|
@@ -20,6 +20,10 @@ export interface AppLayoutProps {
|
|
|
20
20
|
focused?: boolean
|
|
21
21
|
}
|
|
22
22
|
searchBar?: SearchState
|
|
23
|
+
/**
|
|
24
|
+
* @deprecated Open overlays through `useOverlay()` instead. This compatibility
|
|
25
|
+
* prop will be removed in Tooee 0.3.0.
|
|
26
|
+
*/
|
|
23
27
|
overlay?: ReactNode
|
|
24
28
|
children: ReactNode
|
|
25
29
|
}
|
|
@@ -35,14 +39,12 @@ export function AppLayout({
|
|
|
35
39
|
}: AppLayoutProps) {
|
|
36
40
|
const { theme } = useTheme()
|
|
37
41
|
const contextOverlay = useCurrentOverlay()
|
|
38
|
-
const
|
|
42
|
+
const compatibilityOverlay =
|
|
39
43
|
overlay != null ? (
|
|
40
44
|
<CommandSurfaceProvider id="app-layout.overlay" role="modal" initialMode="insert">
|
|
41
45
|
{overlay}
|
|
42
46
|
</CommandSurfaceProvider>
|
|
43
|
-
) :
|
|
44
|
-
contextOverlay
|
|
45
|
-
)
|
|
47
|
+
) : null
|
|
46
48
|
return (
|
|
47
49
|
<box flexDirection="column" width="100%" height="100%" backgroundColor={theme.background}>
|
|
48
50
|
{titleBar && <TitleBar title={titleBar.title} subtitle={titleBar.subtitle} />}
|
|
@@ -60,9 +62,10 @@ export function AppLayout({
|
|
|
60
62
|
) : (
|
|
61
63
|
<box style={{ flexGrow: 1, overflow: "hidden" }}>{children}</box>
|
|
62
64
|
)}
|
|
63
|
-
{
|
|
65
|
+
{(contextOverlay || compatibilityOverlay) && (
|
|
64
66
|
<box position="absolute" left={0} top={0} width="100%" height="100%">
|
|
65
|
-
{
|
|
67
|
+
{contextOverlay}
|
|
68
|
+
{compatibilityOverlay}
|
|
66
69
|
</box>
|
|
67
70
|
)}
|
|
68
71
|
<ToastContainer />
|