@x-tech-laboratories/x-app 0.124.0 → 0.125.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 +1 -1
- package/dist/web/react/layout.d.ts +5 -1
- package/dist/web/react/layout.js +4 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -165,7 +165,7 @@ an app moves over by changing the package name in its imports and its `x-libs-*`
|
|
|
165
165
|
| `web/prefs`, `web/react/prefs` | Remembered view settings that read as their default when stored corrupt, stale or of the wrong shape; `use_pref` keeps one as component state. |
|
|
166
166
|
| `web/selection`, `web/virtual`, `web/drag` | Picking rows with plain, Ctrl and Shift clicks from a fixed anchor, or as lists of ids with the anchor kept by id, the row an arrow or page key moves to; which rows of a long list a viewport needs; a badge such as "3 tasks" as the drag image. |
|
|
167
167
|
| `web/react/shell` | `Shell`: top bar with the brand and its icon and the app's `tools`; section links, or, once a section has `children`, a `SectionTree` of section rows folding open onto their items on `Tree`, the folded ones kept in the `sections_pref` pref and a folded section lit up in place of its hidden `active_item`; or the app's `views` as rows with their icons (from `web/react/icons`) in the sidebar's navigation, the one `active` names raised and marked as the current page, above the app's own sidebar in a `.sidebar-content` box, the sidebar then an aside so the views are its only navigation landmark, or that sidebar alone, scrolling above a foot pinned to the sidebar's bottom that holds the app's `sidebar_foot` rows, then the theme, the signed-in `user` linked to `user_href` with Sign out, and `settings` last; resizable; a `side_pane` docked on the right beside main ([A pane on the right](#a-pane-on-the-right)), its open state kept by `use_side_pane` in a pref; `brand_logo` for a full logo that already holds the name, drawn alone in its place; a `status_bar` at the foot of the window, toasts, dialogs and menus, with or without logins (no account row without a `user`, `logged_out` hiding the sidebar and tools), its phone menu held by the Shell or the app, and for app-like pages a `contained` window where only main scrolls and the brand heading the sidebar; `labels` for its own words in another language; `ThemeRow`, the theme as a sidebar row, `ThemeButton`, as an icon button, both drawing the system theme on a server and until the page is picked up, and `use_route`. |
|
|
168
|
-
| `web/react/layout`, `badges`, `states` | `PageHeading` with a subtitle, icon, banner, actions and a `level` for inside dialogs and panels; panels (`Section`, with a `level` for one inside a dialog or under another heading), `GroupSections`, a panel per group from `group_items` headed by its name and count, facts, tiles, cards, tabs, `Crumbs` with chevrons between steps that link, run a function or mark where the reader is, `PathText` for a path shown with the same chevrons, steppers, `FormRow` for a form's labelled fields, `FormGroup` folding part of a form under a summary line such as "More options", `SettingsPage` with an `Outline` beside its sections, settings rows, `RowActions` and `moved` for ordered lists, `SelectionBar` for picked rows, their count with its thousands separated; badges, `StateBadge` naming each state's text and tone and `ToneBadge` showing the state's own name in its tone, chips in an item's own colour, dashed or removable, `ColorDot` and `StatusPill`, a state dot with text and an action; `use_resource` with its `status` (idle until `enabled`, loading, loaded, failed), a `watch` that reloads it quietly (bumps during a load fold into one load after it), and its loading states, `Loaded` going by the status so a null result shows its `empty` slot or the children. |
|
|
168
|
+
| `web/react/layout`, `badges`, `states` | `PageHeading` with a subtitle, icon, banner, actions and a `level` for inside dialogs and panels; panels (`Section`, with a `level` for one inside a dialog or under another heading, and a `fold` for one that opens and shuts from its head), `GroupSections`, a panel per group from `group_items` headed by its name and count, facts, tiles, cards, tabs, `Crumbs` with chevrons between steps that link, run a function or mark where the reader is, `PathText` for a path shown with the same chevrons, steppers, `FormRow` for a form's labelled fields, `FormGroup` folding part of a form under a summary line such as "More options", `SettingsPage` with an `Outline` beside its sections, settings rows, `RowActions` and `moved` for ordered lists, `SelectionBar` for picked rows, their count with its thousands separated; badges, `StateBadge` naming each state's text and tone and `ToneBadge` showing the state's own name in its tone, chips in an item's own colour, dashed or removable, `ColorDot` and `StatusPill`, a state dot with text and an action; `use_resource` with its `status` (idle until `enabled`, loading, loaded, failed), a `watch` that reloads it quietly (bumps during a load fold into one load after it), and its loading states, `Loaded` going by the status so a null result shows its `empty` slot or the children. |
|
|
169
169
|
| `web/react/sync_settings`, `backup_settings` | The settings rows every device shows: `SyncSettings`, the sync status, this device with its id and where others reach it, a pairing code to show when they can, each paired device with how it was last reached and Remove after a confirm, and a field to enter another device's code; `SyncButton`, the same status as a sidebar row with the changes waiting, syncing on a click or opening the settings when sync failed or no device is paired, and shown even then; `BackupSettings`, back up now, the daily schedule, and each backup to restore or delete after a confirm. |
|
|
170
170
|
| `web/react/connections` | `ConnectionSettings`: the Connections section of Settings, every daemon the app can talk to with the one in use marked Connected, Connect to switch, Rename and Remove (after a confirm) for daemons on other hosts, and a form to add one by address, name and password, asking for the code when the daemon does and offering to trust a certificate the device refuses given `certificates`. |
|
|
171
171
|
| `web/react/remote_access_settings` | `RemoteAccessSettings`: "Let other devices connect" for a desktop daemon, with its state (listening where, or why not), address, port, https certificate and key files, Save, and the admins other devices sign in as, added with a password of 10 characters or more and removed after asking; `reach` words what they can do once in. The base app shows it under Settings → Other devices. |
|
|
@@ -19,9 +19,13 @@ interface SectionProps {
|
|
|
19
19
|
class_name?: string;
|
|
20
20
|
on_context_menu?: (event: MouseEvent<HTMLElement>) => void;
|
|
21
21
|
level?: 2 | 3 | 4;
|
|
22
|
+
fold?: {
|
|
23
|
+
open: boolean;
|
|
24
|
+
on_toggle: () => void;
|
|
25
|
+
};
|
|
22
26
|
children?: ReactNode;
|
|
23
27
|
}
|
|
24
|
-
export declare function Section({ title, tools, class_name, on_context_menu, level, children }: SectionProps): import("react").JSX.Element;
|
|
28
|
+
export declare function Section({ title, tools, class_name, on_context_menu, level, fold, children }: SectionProps): import("react").JSX.Element;
|
|
25
29
|
interface GroupSectionsProps<Item> {
|
|
26
30
|
groups: ItemGroup<Item>[];
|
|
27
31
|
name_of: (key: string | null) => string;
|
package/dist/web/react/layout.js
CHANGED
|
@@ -9,9 +9,11 @@ export function PageHeading({ title, subtitle, icon, banner, actions, class_name
|
|
|
9
9
|
const Title = `h${level}`;
|
|
10
10
|
return (_jsxs("header", { className: class_name ? `page-head ${class_name}` : "page-head", children: [typeof banner === "string" ? _jsx("img", { className: "page-banner", src: banner, alt: "", loading: "lazy" }) : banner, _jsxs("div", { className: "page-title spread", children: [_jsxs("div", { className: "page-identity", children: [icon, _jsxs("div", { children: [_jsx(Title, { children: title }), subtitle && _jsx("p", { className: "page-subtitle muted", children: subtitle })] })] }), actions && _jsx("div", { className: "head-actions", children: actions })] }), children] }));
|
|
11
11
|
}
|
|
12
|
-
export function Section({ title, tools, class_name, on_context_menu, level = 2, children }) {
|
|
12
|
+
export function Section({ title, tools, class_name, on_context_menu, level = 2, fold, children }) {
|
|
13
13
|
const Title = `h${level}`;
|
|
14
|
-
|
|
14
|
+
const classes = ["panel", fold && "folds", fold && !fold.open && "folded", class_name].filter(Boolean).join(" ");
|
|
15
|
+
return (_jsxs("section", { className: classes, onContextMenu: on_context_menu, children: [_jsxs("div", { className: "panel-head", onClick: fold ? (event) => { if (!event.target.closest(".panel-tools, button"))
|
|
16
|
+
fold.on_toggle(); } : undefined, children: [fold && _jsx("button", { type: "button", className: "tree-toggle", "aria-expanded": fold.open, "aria-label": fold.open ? "Fold" : "Open", onClick: fold.on_toggle, children: fold.open ? "▾" : "▸" }), _jsx(Title, { children: title }), tools && _jsx("div", { className: "panel-tools", children: tools })] }), children] }));
|
|
15
17
|
}
|
|
16
18
|
// A section per group from `group_items`, headed by its name and how many items it holds.
|
|
17
19
|
export function GroupSections({ groups, name_of, level, children }) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@x-tech-laboratories/x-app",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.125.0",
|
|
4
4
|
"description": "Code the X-apps share: agents and their long runs, passwords and sign-in, the Fastify server pieces, durations, and the web page's helpers and widgets",
|
|
5
5
|
"license": "GPL-3.0-or-later",
|
|
6
6
|
"repository": {
|