@tooee/layout 0.1.14 → 0.1.15
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/dist/AppLayout.d.ts +2 -5
- package/dist/AppLayout.d.ts.map +1 -1
- package/dist/AppLayout.js +2 -2
- package/dist/AppLayout.js.map +1 -1
- package/dist/index.d.ts +1 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/package.json +5 -4
- package/src/AppLayout.tsx +10 -14
- package/src/index.ts +1 -3
- package/dist/SearchBar.d.ts +0 -10
- package/dist/SearchBar.d.ts.map +0 -1
- package/dist/SearchBar.js +0 -18
- package/dist/SearchBar.js.map +0 -1
- package/src/SearchBar.tsx +0 -55
package/dist/AppLayout.d.ts
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import type { ReactNode, RefObject } from "react";
|
|
2
2
|
import type { ScrollBoxRenderable } from "@opentui/core";
|
|
3
3
|
import type { StatusBarItem } from "./StatusBar.js";
|
|
4
|
-
import type {
|
|
5
|
-
export interface AppLayoutSearchBar extends SearchBarProps {
|
|
6
|
-
active: boolean;
|
|
7
|
-
}
|
|
4
|
+
import type { SearchState } from "@tooee/search";
|
|
8
5
|
export interface AppLayoutProps {
|
|
9
6
|
titleBar?: {
|
|
10
7
|
title: string;
|
|
@@ -19,7 +16,7 @@ export interface AppLayoutProps {
|
|
|
19
16
|
stickyStart?: "bottom" | "top";
|
|
20
17
|
focused?: boolean;
|
|
21
18
|
};
|
|
22
|
-
searchBar?:
|
|
19
|
+
searchBar?: SearchState;
|
|
23
20
|
overlay?: ReactNode;
|
|
24
21
|
children: ReactNode;
|
|
25
22
|
}
|
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,EA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x, jsxs as _jsxs } from "@opentui/react/jsx-runtime";
|
|
2
2
|
import { TitleBar } from "./TitleBar.js";
|
|
3
3
|
import { StatusBar } from "./StatusBar.js";
|
|
4
|
-
import { SearchBar } from "
|
|
4
|
+
import { SearchBar } from "@tooee/search";
|
|
5
5
|
import { useTheme } from "@tooee/themes";
|
|
6
6
|
import { useCurrentOverlay } from "@tooee/overlays";
|
|
7
7
|
import { ToastContainer } from "@tooee/toasts";
|
|
@@ -9,6 +9,6 @@ export function AppLayout({ titleBar, statusBar, scrollRef, scrollProps, searchB
|
|
|
9
9
|
const { theme } = useTheme();
|
|
10
10
|
const contextOverlay = useCurrentOverlay();
|
|
11
11
|
const activeOverlay = overlay ?? contextOverlay;
|
|
12
|
-
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 })), activeOverlay && (_jsx("box", { position: "absolute", left: 0, top: 0, width: "100%", height: "100%", children: activeOverlay })), _jsx(ToastContainer, {})] }), searchBar?.
|
|
12
|
+
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 })), activeOverlay && (_jsx("box", { position: "absolute", left: 0, top: 0, width: "100%", height: "100%", children: activeOverlay })), _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 }))] }));
|
|
13
13
|
}
|
|
14
14
|
//# 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,
|
|
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,cAAc,EAAE,MAAM,eAAe,CAAA;AAgB9C,MAAM,UAAU,SAAS,CAAC,EACxB,QAAQ,EACR,SAAS,EACT,SAAS,EACT,WAAW,EACX,SAAS,EACT,OAAO,EACP,QAAQ,GACO;IACf,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,EAAE,CAAA;IAC5B,MAAM,cAAc,GAAG,iBAAiB,EAAE,CAAA;IAC1C,MAAM,aAAa,GAAG,OAAO,IAAI,cAAc,CAAA;IAC/C,OAAO,C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C,CAAC,CACF,KAAC,SAAS,IAAC,KAAK,EAAE,SAAS,CAAC,KAAK,GAAI,CACtC,IACG,CACP,CAAA;AACH,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
export { AppLayout } from "./AppLayout.js";
|
|
2
|
-
export type { AppLayoutProps
|
|
2
|
+
export type { AppLayoutProps } from "./AppLayout.js";
|
|
3
3
|
export { StatusBar } from "./StatusBar.js";
|
|
4
4
|
export type { StatusBarItem } from "./StatusBar.js";
|
|
5
5
|
export { TitleBar } from "./TitleBar.js";
|
|
6
|
-
export { SearchBar } from "./SearchBar.js";
|
|
7
|
-
export type { SearchBarProps } from "./SearchBar.js";
|
|
8
6
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,YAAY,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,YAAY,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tooee/layout",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.15",
|
|
4
4
|
"description": "Standard app chrome (title bar, status bar) for Tooee",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -35,9 +35,10 @@
|
|
|
35
35
|
"typecheck": "tsc --noEmit"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@tooee/overlays": "0.1.
|
|
39
|
-
"@tooee/
|
|
40
|
-
"@tooee/
|
|
38
|
+
"@tooee/overlays": "0.1.15",
|
|
39
|
+
"@tooee/search": "0.1.15",
|
|
40
|
+
"@tooee/themes": "0.1.15",
|
|
41
|
+
"@tooee/toasts": "0.1.15"
|
|
41
42
|
},
|
|
42
43
|
"devDependencies": {
|
|
43
44
|
"@opentui/core": "^0.1.86",
|
package/src/AppLayout.tsx
CHANGED
|
@@ -3,16 +3,12 @@ import type { ScrollBoxRenderable } from "@opentui/core"
|
|
|
3
3
|
import { TitleBar } from "./TitleBar.js"
|
|
4
4
|
import { StatusBar } from "./StatusBar.js"
|
|
5
5
|
import type { StatusBarItem } from "./StatusBar.js"
|
|
6
|
-
import { SearchBar } from "
|
|
7
|
-
import type {
|
|
6
|
+
import { SearchBar } from "@tooee/search"
|
|
7
|
+
import type { SearchState } from "@tooee/search"
|
|
8
8
|
import { useTheme } from "@tooee/themes"
|
|
9
9
|
import { useCurrentOverlay } from "@tooee/overlays"
|
|
10
10
|
import { ToastContainer } from "@tooee/toasts"
|
|
11
11
|
|
|
12
|
-
export interface AppLayoutSearchBar extends SearchBarProps {
|
|
13
|
-
active: boolean
|
|
14
|
-
}
|
|
15
|
-
|
|
16
12
|
export interface AppLayoutProps {
|
|
17
13
|
titleBar?: { title: string; subtitle?: string }
|
|
18
14
|
statusBar: { items: StatusBarItem[] }
|
|
@@ -22,7 +18,7 @@ export interface AppLayoutProps {
|
|
|
22
18
|
stickyStart?: "bottom" | "top"
|
|
23
19
|
focused?: boolean
|
|
24
20
|
}
|
|
25
|
-
searchBar?:
|
|
21
|
+
searchBar?: SearchState
|
|
26
22
|
overlay?: ReactNode
|
|
27
23
|
children: ReactNode
|
|
28
24
|
}
|
|
@@ -63,14 +59,14 @@ export function AppLayout({
|
|
|
63
59
|
)}
|
|
64
60
|
<ToastContainer />
|
|
65
61
|
</box>
|
|
66
|
-
{searchBar?.
|
|
62
|
+
{searchBar?.searchActive ? (
|
|
67
63
|
<SearchBar
|
|
68
|
-
query={searchBar.
|
|
69
|
-
onQueryChange={searchBar.
|
|
70
|
-
onSubmit={searchBar.
|
|
71
|
-
onCancel={searchBar.
|
|
72
|
-
matchCount={searchBar.
|
|
73
|
-
currentMatch={searchBar.
|
|
64
|
+
query={searchBar.searchQuery}
|
|
65
|
+
onQueryChange={searchBar.setSearchQuery}
|
|
66
|
+
onSubmit={searchBar.submitSearch}
|
|
67
|
+
onCancel={() => searchBar.setSearchQuery("")}
|
|
68
|
+
matchCount={searchBar.matchingLines.length}
|
|
69
|
+
currentMatch={searchBar.currentMatchIndex}
|
|
74
70
|
/>
|
|
75
71
|
) : (
|
|
76
72
|
<StatusBar items={statusBar.items} />
|
package/src/index.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
export { AppLayout } from "./AppLayout.js"
|
|
2
|
-
export type { AppLayoutProps
|
|
2
|
+
export type { AppLayoutProps } from "./AppLayout.js"
|
|
3
3
|
export { StatusBar } from "./StatusBar.js"
|
|
4
4
|
export type { StatusBarItem } from "./StatusBar.js"
|
|
5
5
|
export { TitleBar } from "./TitleBar.js"
|
|
6
|
-
export { SearchBar } from "./SearchBar.js"
|
|
7
|
-
export type { SearchBarProps } from "./SearchBar.js"
|
package/dist/SearchBar.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export interface SearchBarProps {
|
|
2
|
-
query: string;
|
|
3
|
-
onQueryChange: (query: string) => void;
|
|
4
|
-
onSubmit: () => void;
|
|
5
|
-
onCancel: () => void;
|
|
6
|
-
matchCount?: number;
|
|
7
|
-
currentMatch?: number;
|
|
8
|
-
}
|
|
9
|
-
export declare function SearchBar({ query, onQueryChange, onSubmit, onCancel: _onCancel, matchCount, currentMatch, }: SearchBarProps): import("react").ReactNode;
|
|
10
|
-
//# sourceMappingURL=SearchBar.d.ts.map
|
package/dist/SearchBar.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SearchBar.d.ts","sourceRoot":"","sources":["../src/SearchBar.tsx"],"names":[],"mappings":"AAEA,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAA;IACb,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACtC,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,aAAa,EACb,QAAQ,EACR,QAAQ,EAAE,SAAS,EACnB,UAAU,EACV,YAAY,GACb,EAAE,cAAc,6BAoChB"}
|
package/dist/SearchBar.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "@opentui/react/jsx-runtime";
|
|
2
|
-
import { useTheme } from "@tooee/themes";
|
|
3
|
-
export function SearchBar({ query, onQueryChange, onSubmit, onCancel: _onCancel, matchCount, currentMatch, }) {
|
|
4
|
-
const { theme } = useTheme();
|
|
5
|
-
const matchDisplay = matchCount !== undefined && matchCount > 0
|
|
6
|
-
? `${(currentMatch ?? 0) + 1}/${matchCount}`
|
|
7
|
-
: matchCount === 0 && query.length > 0
|
|
8
|
-
? "No matches"
|
|
9
|
-
: "";
|
|
10
|
-
return (_jsxs("box", { style: {
|
|
11
|
-
flexDirection: "row",
|
|
12
|
-
flexShrink: 0,
|
|
13
|
-
backgroundColor: theme.backgroundPanel,
|
|
14
|
-
paddingLeft: 1,
|
|
15
|
-
paddingRight: 1,
|
|
16
|
-
}, children: [_jsx("text", { content: "/", style: { fg: theme.accent } }), _jsx("input", { value: query, focused: true, onInput: onQueryChange, onSubmit: onSubmit, backgroundColor: "transparent", focusedBackgroundColor: "transparent", textColor: theme.text, cursorColor: theme.accent, cursorStyle: { style: "line", blinking: true }, style: { flexGrow: 1 } }), matchDisplay ? _jsx("text", { content: ` ${matchDisplay}`, style: { fg: theme.textMuted } }) : null] }));
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=SearchBar.js.map
|
package/dist/SearchBar.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SearchBar.js","sourceRoot":"","sources":["../src/SearchBar.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAWxC,MAAM,UAAU,SAAS,CAAC,EACxB,KAAK,EACL,aAAa,EACb,QAAQ,EACR,QAAQ,EAAE,SAAS,EACnB,UAAU,EACV,YAAY,GACG;IACf,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,EAAE,CAAA;IAE5B,MAAM,YAAY,GAChB,UAAU,KAAK,SAAS,IAAI,UAAU,GAAG,CAAC;QACxC,CAAC,CAAC,GAAG,CAAC,YAAY,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,UAAU,EAAE;QAC5C,CAAC,CAAC,UAAU,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;YACpC,CAAC,CAAC,YAAY;YACd,CAAC,CAAC,EAAE,CAAA;IAEV,OAAO,CACL,eACE,KAAK,EAAE;YACL,aAAa,EAAE,KAAK;YACpB,UAAU,EAAE,CAAC;YACb,eAAe,EAAE,KAAK,CAAC,eAAe;YACtC,WAAW,EAAE,CAAC;YACd,YAAY,EAAE,CAAC;SAChB,aAED,eAAM,OAAO,EAAC,GAAG,EAAC,KAAK,EAAE,EAAE,EAAE,EAAE,KAAK,CAAC,MAAM,EAAE,GAAI,EACjD,gBACE,KAAK,EAAE,KAAK,EACZ,OAAO,QACP,OAAO,EAAE,aAAa,EACtB,QAAQ,EAAE,QAAQ,EAClB,eAAe,EAAC,aAAa,EAC7B,sBAAsB,EAAC,aAAa,EACpC,SAAS,EAAE,KAAK,CAAC,IAAI,EACrB,WAAW,EAAE,KAAK,CAAC,MAAM,EACzB,WAAW,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,EAC9C,KAAK,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,GACtB,EACD,YAAY,CAAC,CAAC,CAAC,eAAM,OAAO,EAAE,IAAI,YAAY,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,KAAK,CAAC,SAAS,EAAE,GAAI,CAAC,CAAC,CAAC,IAAI,IACxF,CACP,CAAA;AACH,CAAC"}
|
package/src/SearchBar.tsx
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { useTheme } from "@tooee/themes"
|
|
2
|
-
|
|
3
|
-
export interface SearchBarProps {
|
|
4
|
-
query: string
|
|
5
|
-
onQueryChange: (query: string) => void
|
|
6
|
-
onSubmit: () => void
|
|
7
|
-
onCancel: () => void
|
|
8
|
-
matchCount?: number
|
|
9
|
-
currentMatch?: number
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export function SearchBar({
|
|
13
|
-
query,
|
|
14
|
-
onQueryChange,
|
|
15
|
-
onSubmit,
|
|
16
|
-
onCancel: _onCancel,
|
|
17
|
-
matchCount,
|
|
18
|
-
currentMatch,
|
|
19
|
-
}: SearchBarProps) {
|
|
20
|
-
const { theme } = useTheme()
|
|
21
|
-
|
|
22
|
-
const matchDisplay =
|
|
23
|
-
matchCount !== undefined && matchCount > 0
|
|
24
|
-
? `${(currentMatch ?? 0) + 1}/${matchCount}`
|
|
25
|
-
: matchCount === 0 && query.length > 0
|
|
26
|
-
? "No matches"
|
|
27
|
-
: ""
|
|
28
|
-
|
|
29
|
-
return (
|
|
30
|
-
<box
|
|
31
|
-
style={{
|
|
32
|
-
flexDirection: "row",
|
|
33
|
-
flexShrink: 0,
|
|
34
|
-
backgroundColor: theme.backgroundPanel,
|
|
35
|
-
paddingLeft: 1,
|
|
36
|
-
paddingRight: 1,
|
|
37
|
-
}}
|
|
38
|
-
>
|
|
39
|
-
<text content="/" style={{ fg: theme.accent }} />
|
|
40
|
-
<input
|
|
41
|
-
value={query}
|
|
42
|
-
focused
|
|
43
|
-
onInput={onQueryChange}
|
|
44
|
-
onSubmit={onSubmit}
|
|
45
|
-
backgroundColor="transparent"
|
|
46
|
-
focusedBackgroundColor="transparent"
|
|
47
|
-
textColor={theme.text}
|
|
48
|
-
cursorColor={theme.accent}
|
|
49
|
-
cursorStyle={{ style: "line", blinking: true }}
|
|
50
|
-
style={{ flexGrow: 1 }}
|
|
51
|
-
/>
|
|
52
|
-
{matchDisplay ? <text content={` ${matchDisplay}`} style={{ fg: theme.textMuted }} /> : null}
|
|
53
|
-
</box>
|
|
54
|
-
)
|
|
55
|
-
}
|