@jini-ai/ui 0.6.23 → 0.7.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/CHANGELOG.md +23 -0
- package/dist/features/admin-widgets/components/ImagePreviewModal.d.ts +3 -3
- package/dist/features/admin-widgets/components/ImagePreviewModal.js +3 -1
- package/dist/features/admin-widgets/components/InfoTip.d.ts +2 -2
- package/dist/features/admin-widgets/components/InfoTip.js +3 -1
- package/dist/features/admin-widgets/components/SeeMore/SeeMore.d.ts +2 -2
- package/dist/features/admin-widgets/components/SeeMore/SeeMore.js +3 -1
- package/dist/features/admin-widgets/components/Select/Select.d.ts +2 -2
- package/dist/features/admin-widgets/components/Select/Select.js +12 -8
- package/dist/features/admin-widgets/components/SuggestInput/SuggestInput.d.ts +2 -2
- package/dist/features/admin-widgets/components/SuggestInput/SuggestInput.js +3 -1
- package/dist/features/execution/react/components/SearchableModelSelect.d.ts +5 -5
- package/dist/features/execution/react/components/SearchableModelSelect.js +4 -2
- package/dist/features/interactive-ui/providers/shadcn/checkbox-field.d.ts +3 -2
- package/dist/features/interactive-ui/providers/shadcn/checkbox-field.js +5 -2
- package/dist/features/interactive-ui/providers/shadcn/select-field.d.ts +4 -2
- package/dist/features/interactive-ui/providers/shadcn/select-field.js +9 -2
- package/dist/features/interactive-ui/providers/shadcn/select.d.ts +5 -3
- package/dist/features/interactive-ui/providers/shadcn/select.js +9 -4
- package/dist/features/mcp-ui/cards.d.ts +12 -0
- package/dist/features/mcp-ui/cards.js +8 -0
- package/dist/features/mcp-ui/credential-card.d.ts +34 -0
- package/dist/features/mcp-ui/credential-card.js +42 -0
- package/dist/features/mcp-ui/secret-card.d.ts +2 -16
- package/dist/features/mcp-ui/sign-in-card.d.ts +57 -0
- package/dist/features/mcp-ui/sign-in-card.js +67 -0
- package/dist/features/mcp-ui/surfaces/access-approval.d.ts +15 -0
- package/dist/features/mcp-ui/surfaces/access-approval.js +17 -0
- package/dist/features/mcp-ui/surfaces/bridge.d.ts +2 -8
- package/dist/features/mcp-ui/surfaces/confirmation.d.ts +9 -8
- package/dist/features/mcp-ui/surfaces/confirmation.js +23 -8
- package/dist/features/mcp-ui/surfaces/document.d.ts +3 -22
- package/dist/features/mcp-ui/surfaces/document.js +4 -0
- package/dist/features/mcp-ui/surfaces/fields.d.ts +2 -74
- package/dist/features/mcp-ui/surfaces/form.d.ts +2 -42
- package/dist/features/mcp-ui/surfaces/index.d.ts +1 -0
- package/dist/features/mcp-ui/surfaces/index.js +1 -0
- package/dist/features/mcp-ui/surfaces/outcome.d.ts +2 -39
- package/dist/features/mcp-ui/surfaces/outcome.js +25 -2
- package/dist/features/mcp-ui/surfaces/select.d.ts +2 -7
- package/dist/features/mcp-ui/surfaces/structured-details.d.ts +2 -19
- package/dist/features/mcp-ui/surfaces/text-input.d.ts +2 -5
- package/dist/features/mcp-ui/surfaces/tokens.d.ts +2 -2
- package/dist/features/panel-kit/failure-channel.d.ts +25 -0
- package/dist/features/panel-kit/failure-channel.js +36 -0
- package/dist/features/panel-kit/index.d.ts +2 -0
- package/dist/features/panel-kit/index.js +1 -0
- package/dist/features/site-card/SiteCard.d.ts +40 -0
- package/dist/features/site-card/SiteCard.js +15 -0
- package/dist/features/site-card/SiteListToolbar.d.ts +28 -0
- package/dist/features/site-card/SiteListToolbar.js +15 -0
- package/dist/features/site-card/index.d.ts +5 -0
- package/dist/features/site-card/index.js +5 -0
- package/dist/features/site-card/site-card.css +136 -0
- package/dist/features/site-card/site-list-view.d.ts +53 -0
- package/dist/features/site-card/site-list-view.js +62 -0
- package/dist/features/site-card/use-site-list-view.hooks.d.ts +24 -0
- package/dist/features/site-card/use-site-list-view.hooks.js +26 -0
- package/dist/features/tab-strip/react/components/TabStrip.d.ts +3 -2
- package/dist/features/tab-strip/react/components/TabStrip.js +5 -2
- package/dist/features/tab-strip/react/components/TabStripItem.d.ts +3 -2
- package/dist/features/tab-strip/react/components/TabStripItem.js +5 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -0
- package/dist/react/components/CustomSelect.d.ts +5 -3
- package/dist/react/components/CustomSelect.js +18 -11
- package/dist/react/components/PillButton.d.ts +3 -2
- package/dist/react/components/PillButton.js +5 -2
- package/dist/react/components/PopoverItem.d.ts +3 -2
- package/dist/react/components/PopoverItem.js +5 -2
- package/dist/react/components/PopoverMenu.d.ts +3 -2
- package/dist/react/components/PopoverMenu.js +5 -2
- package/dist/react/components/select-popover.d.ts +8 -2
- package/dist/react/components/select-popover.js +8 -3
- package/dist/react/hooks/useAgentHandle.d.ts +17 -0
- package/dist/react/hooks/useAgentHandle.js +17 -0
- package/dist/styles/admin.css +1 -0
- package/package.json +38 -12
|
@@ -1,21 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
readonly label: string;
|
|
4
|
-
readonly value: unknown;
|
|
5
|
-
/** Presence enables a diff, including an explicitly absent previous override. */
|
|
6
|
-
readonly previous?: unknown;
|
|
7
|
-
/** Explicit, optionally translated labels keyed by dotted object path. */
|
|
8
|
-
readonly labels?: Readonly<Record<string, string>>;
|
|
9
|
-
/** Optional secondary context beneath the label, using the shared muted hint style. */
|
|
10
|
-
readonly description?: string;
|
|
11
|
-
/**
|
|
12
|
-
* `code` discloses a monospace `<pre>` that keeps line breaks and scrolls inside its own box
|
|
13
|
-
* past a fixed height, so long SQL or JSON remains readable without stretching the dialog past
|
|
14
|
-
* its frame. `status` reserves one line for a short outcome value. Omitted (or `text`) permits
|
|
15
|
-
* value-sensitive presentation, preserving plain inline strings for short prose.
|
|
16
|
-
*/
|
|
17
|
-
readonly format?: 'text' | 'code' | 'status';
|
|
18
|
-
}
|
|
1
|
+
import type { SurfaceDetail } from '@jini-ai/core/contracts/cards';
|
|
2
|
+
export type { SurfaceDetail } from '@jini-ai/core/contracts/cards';
|
|
19
3
|
type ValueContext = {
|
|
20
4
|
value: unknown;
|
|
21
5
|
path: string;
|
|
@@ -36,5 +20,4 @@ export declare function surfaceDetailLabel({ key, path, labels }: {
|
|
|
36
20
|
export declare function renderStructuredDetail({ detail }: {
|
|
37
21
|
detail: SurfaceDetail;
|
|
38
22
|
}, _options?: {}): string;
|
|
39
|
-
export {};
|
|
40
23
|
//# sourceMappingURL=structured-details.d.ts.map
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
readonly showSecret: string;
|
|
4
|
-
readonly hideSecret: string;
|
|
5
|
-
}
|
|
1
|
+
import type { SecretInputText } from '@jini-ai/core/contracts/cards';
|
|
2
|
+
export type { SecretInputText } from '@jini-ai/core/contracts/cards';
|
|
6
3
|
export declare const DEFAULT_SECRET_INPUT_TEXT: SecretInputText;
|
|
7
4
|
export interface TextInputProps extends Partial<SecretInputText> {
|
|
8
5
|
/** HTML `name`, DOM `id` suffix, and the params key the value is posted under. */
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { SurfaceTokenName } from '@jini-ai/core/contracts/cards';
|
|
2
|
+
export type { SurfaceTokenName } from '@jini-ai/core/contracts/cards';
|
|
1
3
|
/**
|
|
2
4
|
* @module features/mcp-ui/surfaces/tokens
|
|
3
5
|
*
|
|
@@ -65,8 +67,6 @@ export declare const SURFACE_TOKENS: {
|
|
|
65
67
|
readonly '--jini-mcpui-font': string;
|
|
66
68
|
readonly '--jini-mcpui-font-mono': string;
|
|
67
69
|
};
|
|
68
|
-
/** The token names a caller may override. */
|
|
69
|
-
export type SurfaceTokenName = keyof typeof SURFACE_TOKENS;
|
|
70
70
|
/**
|
|
71
71
|
* The dark-scheme value for every token in {@link SURFACE_TOKENS}, keyed the same way and typed as
|
|
72
72
|
* `Record<SurfaceTokenName, string>` rather than a partial — a token added to the light palette and
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { UserFacingError } from '@jini-ai/core';
|
|
2
|
+
/** One retained incident per host instance; no history, timers, requests or persistence. */
|
|
3
|
+
export interface FailureChannel {
|
|
4
|
+
publish(input: {
|
|
5
|
+
failure: UserFacingError;
|
|
6
|
+
generation?: number;
|
|
7
|
+
}): void;
|
|
8
|
+
subscribe(listener: () => void): () => void;
|
|
9
|
+
getSnapshot(): UserFacingError | null;
|
|
10
|
+
getGeneration(): number;
|
|
11
|
+
reset(): void;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Create a host-owned external store for the final unexpected failure after transport retries.
|
|
15
|
+
* Reset invalidates pending work across identity/site changes, including when no incident is shown.
|
|
16
|
+
* Optional publication effects are injected and isolated: a broken subscriber cannot replace a transport error or prevent a scope reset.
|
|
17
|
+
* @complexity O(s) time/temporary space per publish/reset for s subscribers; O(s + one bounded failure) retained.
|
|
18
|
+
* @overallScore 98 — host formatting owns disclosure and payload bounds; notification has no recovery effects.
|
|
19
|
+
*/
|
|
20
|
+
export declare function createFailureChannel(_requiredArgs: Record<string, never>, { onPublish }?: {
|
|
21
|
+
onPublish?: (input: {
|
|
22
|
+
failure: UserFacingError;
|
|
23
|
+
}) => void;
|
|
24
|
+
}): FailureChannel;
|
|
25
|
+
//# sourceMappingURL=failure-channel.d.ts.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Create a host-owned external store for the final unexpected failure after transport retries.
|
|
3
|
+
* Reset invalidates pending work across identity/site changes, including when no incident is shown.
|
|
4
|
+
* Optional publication effects are injected and isolated: a broken subscriber cannot replace a transport error or prevent a scope reset.
|
|
5
|
+
* @complexity O(s) time/temporary space per publish/reset for s subscribers; O(s + one bounded failure) retained.
|
|
6
|
+
* @overallScore 98 — host formatting owns disclosure and payload bounds; notification has no recovery effects.
|
|
7
|
+
*/
|
|
8
|
+
export function createFailureChannel(_requiredArgs, { onPublish } = {}) {
|
|
9
|
+
let snapshot = null;
|
|
10
|
+
let generation = 0;
|
|
11
|
+
const listeners = new Set();
|
|
12
|
+
const notify = () => { for (const listener of [...listeners])
|
|
13
|
+
notifySafely(listener); };
|
|
14
|
+
return {
|
|
15
|
+
publish({ failure, generation: sourceGeneration = generation }) {
|
|
16
|
+
if (sourceGeneration !== generation)
|
|
17
|
+
return;
|
|
18
|
+
snapshot = failure;
|
|
19
|
+
notify();
|
|
20
|
+
if (onPublish)
|
|
21
|
+
notifySafely(() => onPublish({ failure }));
|
|
22
|
+
},
|
|
23
|
+
subscribe(listener) { listeners.add(listener); return () => { listeners.delete(listener); }; },
|
|
24
|
+
getSnapshot: () => snapshot,
|
|
25
|
+
getGeneration: () => generation,
|
|
26
|
+
reset() { generation += 1; snapshot = null; notify(); },
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/** Notification failures must never block session invalidation or replace the original request error. */
|
|
30
|
+
function notifySafely(effect) {
|
|
31
|
+
try {
|
|
32
|
+
effect();
|
|
33
|
+
}
|
|
34
|
+
catch { /* The retained incident remains available to other subscribers. */ }
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=failure-channel.js.map
|
|
@@ -24,4 +24,6 @@ export { useStandingDraftAutosave } from './hooks/use-standing-draft-autosave.ho
|
|
|
24
24
|
export type { StandingDraftAutosavePort, StandingDraftAutosaveInput, StandingDraftAutosaveSnapshot, StandingDraftAutosaveController, StandingDraftStaleBasis, StandingDraftAutosaveOptions } from './hooks/use-standing-draft-autosave.hooks.js';
|
|
25
25
|
export { createStandingDraftLocalBackup, LOCAL_BACKUP_PRINCIPAL_ID } from './helpers/standing-draft-local-backup.js';
|
|
26
26
|
export { standingDraftRecoveryMessage } from './helpers/standing-draft-recovery-message.js';
|
|
27
|
+
export { createFailureChannel } from './failure-channel.js';
|
|
28
|
+
export type { FailureChannel } from './failure-channel.js';
|
|
27
29
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -15,4 +15,5 @@ export { useSettingsSlice, mergeSaveStates, commitQueuedSave, canAcceptRefresh,
|
|
|
15
15
|
export { useStandingDraftAutosave } from './hooks/use-standing-draft-autosave.hooks.js';
|
|
16
16
|
export { createStandingDraftLocalBackup, LOCAL_BACKUP_PRINCIPAL_ID } from './helpers/standing-draft-local-backup.js';
|
|
17
17
|
export { standingDraftRecoveryMessage } from './helpers/standing-draft-recovery-message.js';
|
|
18
|
+
export { createFailureChannel } from './failure-channel.js';
|
|
18
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* @file One site's card, shared by the desktop app's Websites grid and the web admin's Sites page
|
|
4
|
+
* (owner, 2026-11-04). Layout only: a preview tile, then a head grid (name | menu, details | status),
|
|
5
|
+
* then the action row, in the desktop's shape. Each host fills the slots with its own controls, so
|
|
6
|
+
* what a button does stays with the host. Grid auto-placement fills the head in DOM order, so the
|
|
7
|
+
* order below IS the layout and also the Tab order.
|
|
8
|
+
*/
|
|
9
|
+
export type SiteCardTone = "neutral" | "running" | "busy" | "warning" | "danger";
|
|
10
|
+
export interface SiteCardProps extends Omit<HTMLAttributes<HTMLElement>, "children"> {
|
|
11
|
+
name: string;
|
|
12
|
+
/** Under the name in the same cell, e.g. a duplicate name's parent folder. */
|
|
13
|
+
nameDetail?: ReactNode;
|
|
14
|
+
/** The last captured picture of the site; a neutral placeholder without one. */
|
|
15
|
+
previewSrc?: string | null | undefined;
|
|
16
|
+
onPreviewError?: (() => void) | undefined;
|
|
17
|
+
/** Beside the name, before the menu. */
|
|
18
|
+
nameExtra?: ReactNode;
|
|
19
|
+
/** Top-right, level with the name: the pin and the menu. */
|
|
20
|
+
menu?: ReactNode;
|
|
21
|
+
/** Muted line under the name. */
|
|
22
|
+
details?: ReactNode;
|
|
23
|
+
/** Right-aligned under the menu; usually a {@link SiteCardStatus}. */
|
|
24
|
+
status?: ReactNode;
|
|
25
|
+
/** Anything else the card says, on full-width lines below the head. */
|
|
26
|
+
notes?: ReactNode;
|
|
27
|
+
/** The row of buttons under the text; give its element the class `jini-site-card__actions`. */
|
|
28
|
+
actions?: ReactNode;
|
|
29
|
+
/** A panel covering the card, e.g. a confirmation. */
|
|
30
|
+
overlay?: ReactNode;
|
|
31
|
+
}
|
|
32
|
+
/** The whole card; extra attributes (click target, title, role) go on the `<article>`. @complexity O(1). */
|
|
33
|
+
export declare function SiteCard({ name, nameDetail, previewSrc, onPreviewError, nameExtra, menu, details, status, notes, actions, overlay, className, ...article }: SiteCardProps): import("react").JSX.Element;
|
|
34
|
+
/** A dot and a word, tinted by tone. @complexity O(1). */
|
|
35
|
+
export declare function SiteCardStatus({ label, tone, title }: {
|
|
36
|
+
label: ReactNode;
|
|
37
|
+
tone?: SiteCardTone;
|
|
38
|
+
title?: string | undefined;
|
|
39
|
+
}): import("react").JSX.Element;
|
|
40
|
+
//# sourceMappingURL=SiteCard.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/** The placeholder keeps the tile's shape and tells nothing false about the site. @complexity O(1). */
|
|
3
|
+
function SiteCardTile({ previewSrc, onPreviewError }) {
|
|
4
|
+
// Decorative: the name right below already says which site this is.
|
|
5
|
+
return (_jsx("div", { className: "jini-site-card__tile", "aria-hidden": "true", children: previewSrc ? (_jsx("img", { className: "jini-site-card__preview", src: previewSrc, alt: "", loading: "lazy", decoding: "async", onError: onPreviewError })) : (_jsxs("svg", { className: "jini-site-card__placeholder", viewBox: "0 0 48 36", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: [_jsx("rect", { x: "1", y: "1", width: "46", height: "34", rx: "4" }), _jsx("path", { d: "M1 9h46M7 5h.01M11 5h.01M15 5h.01M9 17h30M9 23h20", strokeLinecap: "round" })] })) }));
|
|
6
|
+
}
|
|
7
|
+
/** The whole card; extra attributes (click target, title, role) go on the `<article>`. @complexity O(1). */
|
|
8
|
+
export function SiteCard({ name, nameDetail, previewSrc, onPreviewError, nameExtra, menu, details, status, notes, actions, overlay, className, ...article }) {
|
|
9
|
+
return (_jsxs("article", { ...article, className: className ? `jini-site-card ${className}` : "jini-site-card", children: [_jsx(SiteCardTile, { previewSrc: previewSrc, onPreviewError: onPreviewError }), _jsxs("div", { className: "jini-site-card__body", children: [_jsxs("div", { className: "jini-site-card__head", children: [_jsxs("div", { className: "jini-site-card__namewrap", children: [_jsxs("div", { className: "jini-site-card__nameline", children: [_jsx("h3", { className: "jini-site-card__name", title: name, children: name }), nameExtra] }), nameDetail] }), _jsx("div", { className: "jini-site-card__menu", children: menu }), _jsx("div", { className: "jini-site-card__details", children: details }), _jsx("div", { className: "jini-site-card__meta", children: status }), notes] }), actions] }), overlay] }));
|
|
10
|
+
}
|
|
11
|
+
/** A dot and a word, tinted by tone. @complexity O(1). */
|
|
12
|
+
export function SiteCardStatus({ label, tone = "neutral", title }) {
|
|
13
|
+
return (_jsxs("span", { className: `jini-site-card__status jini-site-card__status--${tone}`, title: title, children: [_jsx("span", { className: "jini-site-card__status-dot", "aria-hidden": "true" }), label] }));
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=SiteCard.js.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { SiteListController } from "./use-site-list-view.hooks.js";
|
|
2
|
+
/** Every word on the toolbar, supplied by the host so it can translate them. */
|
|
3
|
+
export interface SiteListToolbarCopy {
|
|
4
|
+
views: string;
|
|
5
|
+
pinnedRecent: string;
|
|
6
|
+
/** With its count, e.g. "All sites (12)". */
|
|
7
|
+
all: string;
|
|
8
|
+
/** With its count, e.g. "Hidden (2)". */
|
|
9
|
+
hidden: string;
|
|
10
|
+
sortBy: string;
|
|
11
|
+
recent: string;
|
|
12
|
+
oldest: string;
|
|
13
|
+
name: string;
|
|
14
|
+
}
|
|
15
|
+
type ToolbarController = Pick<SiteListController<unknown>, "filter" | "setFilter" | "sort" | "setSort" | "hiddenCount">;
|
|
16
|
+
/** View chips and the "Sort by" dropdown. "Hidden" appears only once something is hidden. @complexity O(1). */
|
|
17
|
+
export declare function SiteListToolbar({ list, copy }: {
|
|
18
|
+
list: ToolbarController;
|
|
19
|
+
copy: SiteListToolbarCopy;
|
|
20
|
+
}): import("react").JSX.Element;
|
|
21
|
+
/** The pin on a card. Stops its events, since a card can itself be a click target. @complexity O(1). */
|
|
22
|
+
export declare function SiteCardPin({ pinned, label, onToggle }: {
|
|
23
|
+
pinned: boolean;
|
|
24
|
+
label: string;
|
|
25
|
+
onToggle: () => void;
|
|
26
|
+
}): import("react").JSX.Element;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=SiteListToolbar.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/** View chips and the "Sort by" dropdown. "Hidden" appears only once something is hidden. @complexity O(1). */
|
|
3
|
+
export function SiteListToolbar({ list, copy }) {
|
|
4
|
+
const views = [
|
|
5
|
+
{ id: "pinned-recent", label: copy.pinnedRecent },
|
|
6
|
+
{ id: "all", label: copy.all },
|
|
7
|
+
...(list.hiddenCount > 0 ? [{ id: "hidden", label: copy.hidden }] : []),
|
|
8
|
+
];
|
|
9
|
+
return (_jsxs("div", { className: "jini-site-list-toolbar", children: [_jsx("div", { className: "jini-site-list-toolbar__views", role: "group", "aria-label": copy.views, children: views.map((view) => (_jsx("button", { type: "button", className: "jini-site-list-toolbar__view", "aria-pressed": list.filter === view.id, onClick: () => list.setFilter(view.id), children: view.label }, view.id))) }), _jsxs("label", { className: "jini-site-list-toolbar__sort", children: [copy.sortBy, _jsxs("select", { value: list.sort, onChange: (event) => list.setSort(event.target.value), children: [_jsx("option", { value: "recent", children: copy.recent }), _jsx("option", { value: "oldest", children: copy.oldest }), _jsx("option", { value: "name", children: copy.name })] })] })] }));
|
|
10
|
+
}
|
|
11
|
+
/** The pin on a card. Stops its events, since a card can itself be a click target. @complexity O(1). */
|
|
12
|
+
export function SiteCardPin({ pinned, label, onToggle }) {
|
|
13
|
+
return (_jsx("button", { type: "button", className: "jini-site-card__pin", "aria-pressed": pinned, "aria-label": label, title: label, onClick: (event) => { event.stopPropagation(); onToggle(); }, onKeyDown: (event) => event.stopPropagation(), children: _jsx("svg", { viewBox: "0 0 24 24", fill: pinned ? "currentColor" : "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinejoin: "round", strokeLinecap: "round", "aria-hidden": "true", children: _jsx("path", { d: "M9 3.5h6l-.8 7 3.3 3.5h-11l3.3-3.5zM12 14v6.5" }) }) }));
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=SiteListToolbar.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { SiteCard, SiteCardStatus, type SiteCardProps, type SiteCardTone } from "./SiteCard.js";
|
|
2
|
+
export { SiteCardPin, SiteListToolbar, type SiteListToolbarCopy } from "./SiteListToolbar.js";
|
|
3
|
+
export { useSiteListView, type SiteListController } from "./use-site-list-view.hooks.js";
|
|
4
|
+
export { DEFAULT_SITE_LIST_PREFS, parseSiteListPrefs, type SiteListFilter, type SiteListItem, type SiteListPrefs, type SiteListSort } from "./site-list-view.js";
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { SiteCard, SiteCardStatus } from "./SiteCard.js";
|
|
2
|
+
export { SiteCardPin, SiteListToolbar } from "./SiteListToolbar.js";
|
|
3
|
+
export { useSiteListView } from "./use-site-list-view.hooks.js";
|
|
4
|
+
export { DEFAULT_SITE_LIST_PREFS, parseSiteListPrefs } from "./site-list-view.js";
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The shared site card and the list controls above it. The host's own token comes first: the admin's
|
|
3
|
+
* --jini-* palette is a flat grey behind its --surface and --border, and the desktop shell defines no
|
|
4
|
+
* --jini-* outside its dialogs. The --jini-* name is the fallback for any other host.
|
|
5
|
+
*/
|
|
6
|
+
.jini-site-card {
|
|
7
|
+
min-width: 0;
|
|
8
|
+
position: relative;
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
border: 1px solid var(--border, var(--jini-border));
|
|
12
|
+
border-radius: var(--r-md, var(--jini-radius-md));
|
|
13
|
+
background: var(--surface, var(--jini-bg-panel));
|
|
14
|
+
color: var(--fg, var(--jini-text));
|
|
15
|
+
overflow: hidden;
|
|
16
|
+
text-align: left;
|
|
17
|
+
box-shadow: var(--shadow-sm);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/* Fixed ratio: a capture landing causes no layout jump. `top`: a thumbnail is recognised by its hero. */
|
|
21
|
+
.jini-site-card__tile {
|
|
22
|
+
position: relative;
|
|
23
|
+
display: grid;
|
|
24
|
+
place-items: center;
|
|
25
|
+
aspect-ratio: 16 / 10;
|
|
26
|
+
background: var(--sunken, var(--surface-2));
|
|
27
|
+
border-bottom: 1px solid var(--border, var(--jini-border));
|
|
28
|
+
}
|
|
29
|
+
.jini-site-card__placeholder { width: 3rem; height: auto; color: var(--faint); opacity: 0.6; }
|
|
30
|
+
.jini-site-card__preview { width: 100%; height: 100%; object-fit: cover; object-position: top; }
|
|
31
|
+
|
|
32
|
+
.jini-site-card__body {
|
|
33
|
+
flex: 1;
|
|
34
|
+
padding: 0.75rem 0.875rem 0.875rem;
|
|
35
|
+
display: flex;
|
|
36
|
+
flex-direction: column;
|
|
37
|
+
gap: 0.5rem;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* `minmax(0, 1fr)` is load-bearing: a bare `1fr` would not shrink, and a long name would push the menu off the card. */
|
|
41
|
+
.jini-site-card__head {
|
|
42
|
+
display: grid;
|
|
43
|
+
grid-template-columns: minmax(0, 1fr) auto;
|
|
44
|
+
column-gap: 0.75rem;
|
|
45
|
+
row-gap: 0.3125rem;
|
|
46
|
+
align-items: center;
|
|
47
|
+
}
|
|
48
|
+
/* Anything beyond the head's four cells spans both columns, below row 2. */
|
|
49
|
+
.jini-site-card__head > :nth-child(n + 5) { grid-column: 1 / -1; }
|
|
50
|
+
|
|
51
|
+
.jini-site-card__namewrap { min-width: 0; }
|
|
52
|
+
.jini-site-card__nameline { display: flex; align-items: center; gap: 0.25rem; min-width: 0; }
|
|
53
|
+
.jini-site-card__name {
|
|
54
|
+
margin: 0;
|
|
55
|
+
font-size: 0.875rem;
|
|
56
|
+
font-weight: 500;
|
|
57
|
+
overflow: hidden;
|
|
58
|
+
text-overflow: ellipsis;
|
|
59
|
+
white-space: nowrap;
|
|
60
|
+
min-width: 0;
|
|
61
|
+
}
|
|
62
|
+
.jini-site-card__menu { position: relative; z-index: 3; justify-self: end; align-self: start; display: inline-flex; align-items: center; gap: 0.25rem; }
|
|
63
|
+
.jini-site-card__details { margin: 0; min-width: 0; color: var(--faint); font-family: var(--font-mono); font-size: 0.6875rem; }
|
|
64
|
+
.jini-site-card__meta { margin: 0; justify-self: end; display: flex; align-items: center; gap: 0.5rem; font-size: 0.75rem; }
|
|
65
|
+
|
|
66
|
+
/* The row of buttons under the text: no `margin-top: auto`, it sits directly under the last line. */
|
|
67
|
+
.jini-site-card__actions { display: flex; flex-direction: row; align-items: center; gap: 0.375rem; }
|
|
68
|
+
.jini-site-card__actions:empty { display: none; }
|
|
69
|
+
|
|
70
|
+
.jini-site-card__status { display: inline-flex; align-items: center; gap: 0.375rem; color: var(--faint); }
|
|
71
|
+
.jini-site-card__status-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
|
|
72
|
+
.jini-site-card__status--running { color: var(--primary); }
|
|
73
|
+
.jini-site-card__status--running .jini-site-card__status-dot { box-shadow: 0 0 0 3px var(--primary-ring, var(--primary-dim)); }
|
|
74
|
+
.jini-site-card__status--busy, .jini-site-card__status--warning { color: var(--warning); }
|
|
75
|
+
.jini-site-card__status--danger { color: var(--danger); }
|
|
76
|
+
/* Both transitions, not only the boot: a stop takes as long as its drain does. */
|
|
77
|
+
.jini-site-card__status--busy .jini-site-card__status-dot { animation: jini-site-card-pulse 1.4s ease-in-out infinite; }
|
|
78
|
+
@keyframes jini-site-card-pulse { 50% { opacity: 0.3; } }
|
|
79
|
+
@media (prefers-reduced-motion: reduce) {
|
|
80
|
+
.jini-site-card__status--busy .jini-site-card__status-dot { animation: none; }
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/* List controls: the view chips on the left, "Sort by" on the right; they wrap at phone width. */
|
|
84
|
+
.jini-site-list-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-block-end: 1rem; }
|
|
85
|
+
.jini-site-list-toolbar__views { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem; }
|
|
86
|
+
.jini-site-list-toolbar__view {
|
|
87
|
+
min-height: 2rem;
|
|
88
|
+
padding: 0 0.75rem;
|
|
89
|
+
border: 1px solid var(--border, var(--jini-border));
|
|
90
|
+
border-radius: 999px;
|
|
91
|
+
background: transparent;
|
|
92
|
+
color: var(--muted);
|
|
93
|
+
font: inherit;
|
|
94
|
+
font-size: 0.8125rem;
|
|
95
|
+
cursor: pointer;
|
|
96
|
+
}
|
|
97
|
+
.jini-site-list-toolbar__view:hover { background: var(--surface-2); color: var(--fg, var(--jini-text)); }
|
|
98
|
+
.jini-site-list-toolbar__view[aria-pressed="true"] { background: var(--surface-2); color: var(--fg, var(--jini-text)); border-color: var(--border-strong); font-weight: 500; }
|
|
99
|
+
.jini-site-list-toolbar__view:focus-visible,
|
|
100
|
+
.jini-site-list-toolbar__sort select:focus-visible,
|
|
101
|
+
.jini-site-card__pin:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
|
|
102
|
+
.jini-site-list-toolbar__sort { display: inline-flex; align-items: center; gap: 0.5rem; margin-inline-start: auto; color: var(--muted); font-size: 0.8125rem; }
|
|
103
|
+
.jini-site-list-toolbar__sort select {
|
|
104
|
+
min-height: 2rem;
|
|
105
|
+
width: auto;
|
|
106
|
+
/* Room for the host's chevron; `background-color`, since the shorthand would erase that chevron. */
|
|
107
|
+
padding: 0 1.75rem 0 0.5rem;
|
|
108
|
+
border: 1px solid var(--border, var(--jini-border));
|
|
109
|
+
border-radius: var(--r-sm, var(--jini-radius-sm));
|
|
110
|
+
background-color: var(--surface, var(--jini-bg-panel));
|
|
111
|
+
color: var(--fg, var(--jini-text));
|
|
112
|
+
font: inherit;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.jini-site-card__pin {
|
|
116
|
+
display: inline-grid;
|
|
117
|
+
place-items: center;
|
|
118
|
+
flex: none;
|
|
119
|
+
width: 26px;
|
|
120
|
+
height: 26px;
|
|
121
|
+
padding: 0;
|
|
122
|
+
border: 0;
|
|
123
|
+
border-radius: var(--r-sm, var(--jini-radius-sm));
|
|
124
|
+
background: transparent;
|
|
125
|
+
color: var(--faint);
|
|
126
|
+
cursor: pointer;
|
|
127
|
+
}
|
|
128
|
+
.jini-site-card__pin:hover { background: var(--surface-2); color: var(--fg, var(--jini-text)); }
|
|
129
|
+
.jini-site-card__pin[aria-pressed="true"] { color: var(--primary); }
|
|
130
|
+
.jini-site-card__pin svg { width: 14px; height: 14px; }
|
|
131
|
+
|
|
132
|
+
/* A finger needs 44px; the pointer rules above stay compact. */
|
|
133
|
+
@media (pointer: coarse), (max-width: 480px) {
|
|
134
|
+
.jini-site-list-toolbar__view, .jini-site-list-toolbar__sort select { min-height: 44px; }
|
|
135
|
+
.jini-site-card__pin { width: 44px; height: 44px; }
|
|
136
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file What the Websites list shows, as plain functions (owner, 2026-11-04): newest first by default,
|
|
3
|
+
* a remembered "Sort by", pinned and recent sites by default with the rest one click away, and a
|
|
4
|
+
* "Hidden" filter. Hiding only leaves the list; the site stays on disk.
|
|
5
|
+
*/
|
|
6
|
+
export type SiteListSort = "recent" | "oldest" | "name";
|
|
7
|
+
export type SiteListFilter = "pinned-recent" | "all" | "hidden";
|
|
8
|
+
/** What is remembered per person. */
|
|
9
|
+
export interface SiteListPrefs {
|
|
10
|
+
sort: SiteListSort;
|
|
11
|
+
pinned: readonly string[];
|
|
12
|
+
hidden: readonly string[];
|
|
13
|
+
}
|
|
14
|
+
export interface SiteListItem {
|
|
15
|
+
id: string;
|
|
16
|
+
name: string;
|
|
17
|
+
createdAt: string;
|
|
18
|
+
/** A running site is always listed: no filter and no hide takes it out of sight (owner, 2026-11-06). */
|
|
19
|
+
running?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export declare const DEFAULT_SITE_LIST_PREFS: SiteListPrefs;
|
|
22
|
+
/** How many of the newest sites the default view shows besides the pinned ones. */
|
|
23
|
+
export declare const SITE_LIST_RECENT_COUNT = 6;
|
|
24
|
+
/**
|
|
25
|
+
* Reads a stored value; anything malformed falls back to the defaults, so a damaged entry can never
|
|
26
|
+
* blank the list.
|
|
27
|
+
* @returns Valid preferences. @complexity O(n) stored ids.
|
|
28
|
+
*/
|
|
29
|
+
export declare function parseSiteListPrefs({ stored }: {
|
|
30
|
+
stored: unknown;
|
|
31
|
+
}, _options?: {}): SiteListPrefs;
|
|
32
|
+
export interface SiteListView<Item> {
|
|
33
|
+
visible: readonly Item[];
|
|
34
|
+
/** Every site not hidden, the number on "All sites (n)". */
|
|
35
|
+
allCount: number;
|
|
36
|
+
/** The number on "Hidden (n)". */
|
|
37
|
+
hiddenCount: number;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* The cards for one filter, pinned first and then in the chosen order.
|
|
41
|
+
* @returns The visible items and both counts. @complexity O(n log n) in `items`.
|
|
42
|
+
*/
|
|
43
|
+
export declare function siteListView<Item extends SiteListItem>({ items, prefs, filter }: {
|
|
44
|
+
items: readonly Item[];
|
|
45
|
+
prefs: SiteListPrefs;
|
|
46
|
+
filter: SiteListFilter;
|
|
47
|
+
}, _options?: {}): SiteListView<Item>;
|
|
48
|
+
/** Adds or removes one id. @returns A new list. @complexity O(n). */
|
|
49
|
+
export declare function toggleListed({ list, id }: {
|
|
50
|
+
list: readonly string[];
|
|
51
|
+
id: string;
|
|
52
|
+
}, _options?: {}): readonly string[];
|
|
53
|
+
//# sourceMappingURL=site-list-view.d.ts.map
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file What the Websites list shows, as plain functions (owner, 2026-11-04): newest first by default,
|
|
3
|
+
* a remembered "Sort by", pinned and recent sites by default with the rest one click away, and a
|
|
4
|
+
* "Hidden" filter. Hiding only leaves the list; the site stays on disk.
|
|
5
|
+
*/
|
|
6
|
+
export const DEFAULT_SITE_LIST_PREFS = { sort: "recent", pinned: [], hidden: [] };
|
|
7
|
+
/** How many of the newest sites the default view shows besides the pinned ones. */
|
|
8
|
+
export const SITE_LIST_RECENT_COUNT = 6;
|
|
9
|
+
const SORTS = ["recent", "oldest", "name"];
|
|
10
|
+
function createdTime(item) {
|
|
11
|
+
const time = Date.parse(item.createdAt);
|
|
12
|
+
return Number.isNaN(time) ? 0 : time;
|
|
13
|
+
}
|
|
14
|
+
function byName(a, b) {
|
|
15
|
+
return a.name.localeCompare(b.name, undefined, { sensitivity: "base" }) || a.id.localeCompare(b.id);
|
|
16
|
+
}
|
|
17
|
+
const COMPARE = {
|
|
18
|
+
recent: (a, b) => createdTime(b) - createdTime(a) || byName(a, b),
|
|
19
|
+
oldest: (a, b) => createdTime(a) - createdTime(b) || byName(a, b),
|
|
20
|
+
name: byName,
|
|
21
|
+
};
|
|
22
|
+
function stringList(value) {
|
|
23
|
+
return Array.isArray(value) ? value.filter((entry) => typeof entry === "string") : [];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Reads a stored value; anything malformed falls back to the defaults, so a damaged entry can never
|
|
27
|
+
* blank the list.
|
|
28
|
+
* @returns Valid preferences. @complexity O(n) stored ids.
|
|
29
|
+
*/
|
|
30
|
+
export function parseSiteListPrefs({ stored }, _options = {}) {
|
|
31
|
+
if (typeof stored !== "object" || stored === null)
|
|
32
|
+
return DEFAULT_SITE_LIST_PREFS;
|
|
33
|
+
const value = stored;
|
|
34
|
+
return {
|
|
35
|
+
sort: SORTS.includes(value.sort) ? value.sort : DEFAULT_SITE_LIST_PREFS.sort,
|
|
36
|
+
pinned: stringList(value.pinned),
|
|
37
|
+
hidden: stringList(value.hidden),
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The cards for one filter, pinned first and then in the chosen order.
|
|
42
|
+
* @returns The visible items and both counts. @complexity O(n log n) in `items`.
|
|
43
|
+
*/
|
|
44
|
+
export function siteListView({ items, prefs, filter }, _options = {}) {
|
|
45
|
+
const hidden = new Set(items.filter((item) => !item.running).map((item) => item.id).filter((id) => prefs.hidden.includes(id)));
|
|
46
|
+
const pinned = new Set(prefs.pinned);
|
|
47
|
+
const compare = COMPARE[prefs.sort];
|
|
48
|
+
const inOrder = (list) => [...list].sort((a, b) => Number(pinned.has(b.id)) - Number(pinned.has(a.id)) || compare(a, b));
|
|
49
|
+
const shown = items.filter((item) => !hidden.has(item.id));
|
|
50
|
+
const counts = { allCount: shown.length, hiddenCount: items.length - shown.length };
|
|
51
|
+
if (filter === "hidden")
|
|
52
|
+
return { visible: inOrder(items.filter((item) => hidden.has(item.id))), ...counts };
|
|
53
|
+
if (filter === "all")
|
|
54
|
+
return { visible: inOrder(shown), ...counts };
|
|
55
|
+
const newest = new Set([...shown].sort(COMPARE.recent).slice(0, SITE_LIST_RECENT_COUNT).map((item) => item.id));
|
|
56
|
+
return { visible: inOrder(shown.filter((item) => pinned.has(item.id) || newest.has(item.id) || item.running === true)), ...counts };
|
|
57
|
+
}
|
|
58
|
+
/** Adds or removes one id. @returns A new list. @complexity O(n). */
|
|
59
|
+
export function toggleListed({ list, id }, _options = {}) {
|
|
60
|
+
return list.includes(id) ? list.filter((entry) => entry !== id) : [...list, id];
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=site-list-view.js.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type SiteListFilter, type SiteListItem, type SiteListPrefs, type SiteListSort, type SiteListView } from "./site-list-view.js";
|
|
2
|
+
export interface SiteListController<Item> extends SiteListView<Item> {
|
|
3
|
+
filter: SiteListFilter;
|
|
4
|
+
setFilter(filter: SiteListFilter): void;
|
|
5
|
+
sort: SiteListSort;
|
|
6
|
+
setSort(sort: SiteListSort): void;
|
|
7
|
+
isPinned(id: string): boolean;
|
|
8
|
+
togglePin(id: string): void;
|
|
9
|
+
isHidden(id: string): boolean;
|
|
10
|
+
toggleHidden(id: string): void;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The list's current view and its actions. The host owns storing `prefs`, which is what makes them
|
|
14
|
+
* per person; the open filter lasts as long as the page. A "Hidden" filter with nothing left to show
|
|
15
|
+
* falls back to the default view, so showing the last hidden site never strands the person on an
|
|
16
|
+
* empty list.
|
|
17
|
+
* @returns The view and its actions. @complexity O(n log n) per render in `items`.
|
|
18
|
+
*/
|
|
19
|
+
export declare function useSiteListView<Item extends SiteListItem>({ items, prefs, onPrefsChange }: {
|
|
20
|
+
items: readonly Item[];
|
|
21
|
+
prefs: SiteListPrefs;
|
|
22
|
+
onPrefsChange: (next: SiteListPrefs) => void;
|
|
23
|
+
}, _options?: {}): SiteListController<Item>;
|
|
24
|
+
//# sourceMappingURL=use-site-list-view.hooks.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import { siteListView, toggleListed } from "./site-list-view.js";
|
|
3
|
+
/**
|
|
4
|
+
* The list's current view and its actions. The host owns storing `prefs`, which is what makes them
|
|
5
|
+
* per person; the open filter lasts as long as the page. A "Hidden" filter with nothing left to show
|
|
6
|
+
* falls back to the default view, so showing the last hidden site never strands the person on an
|
|
7
|
+
* empty list.
|
|
8
|
+
* @returns The view and its actions. @complexity O(n log n) per render in `items`.
|
|
9
|
+
*/
|
|
10
|
+
export function useSiteListView({ items, prefs, onPrefsChange }, _options = {}) {
|
|
11
|
+
const [chosenFilter, setFilter] = useState("pinned-recent");
|
|
12
|
+
const hiddenLeft = items.some((item) => prefs.hidden.includes(item.id) && !item.running);
|
|
13
|
+
const filter = chosenFilter === "hidden" && !hiddenLeft ? "pinned-recent" : chosenFilter;
|
|
14
|
+
return {
|
|
15
|
+
...siteListView({ items, prefs, filter }),
|
|
16
|
+
filter,
|
|
17
|
+
setFilter,
|
|
18
|
+
sort: prefs.sort,
|
|
19
|
+
setSort: (sort) => onPrefsChange({ ...prefs, sort }),
|
|
20
|
+
isPinned: (id) => prefs.pinned.includes(id),
|
|
21
|
+
togglePin: (id) => onPrefsChange({ ...prefs, pinned: toggleListed({ list: prefs.pinned, id }) }),
|
|
22
|
+
isHidden: (id) => prefs.hidden.includes(id),
|
|
23
|
+
toggleHidden: (id) => onPrefsChange({ ...prefs, hidden: toggleListed({ list: prefs.hidden, id }) }),
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=use-site-list-view.hooks.js.map
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { type AgentControlProps } from '../../../../react/hooks/useAgentHandle.js';
|
|
1
2
|
import type { ReactNode } from 'react';
|
|
2
3
|
import type { TabStripHapticsPort } from '../../ports.js';
|
|
3
4
|
import type { TabStripDropEdge, TabStripReorderTiming, TabStripTab } from '../../types.js';
|
|
4
5
|
import { useTabStripDragReorder } from '../hooks/useTabStripDragReorder.js';
|
|
5
|
-
export interface TabStripProps {
|
|
6
|
+
export interface TabStripProps extends AgentControlProps {
|
|
6
7
|
tabs: TabStripTab[];
|
|
7
8
|
activeTabId: string | null;
|
|
8
9
|
onActivate: (tabId: string) => void;
|
|
@@ -36,5 +37,5 @@ export interface TabStripProps {
|
|
|
36
37
|
* all `WorkspaceTabsBar.tsx`-only chrome that remain host-composed, not
|
|
37
38
|
* part of this primitive).
|
|
38
39
|
*/
|
|
39
|
-
export declare function TabStrip({ tabs, activeTabId, onActivate, onClose, onReorder, reorderTiming, haptics, closeLabel, closeIcon, trailing, ariaLabel, className, useTabStripDragReorder: useTabStripDragReorderHook, }: TabStripProps): import("react").JSX.Element;
|
|
40
|
+
export declare function TabStrip({ tabs, activeTabId, onActivate, onClose, onReorder, reorderTiming, haptics, closeLabel, closeIcon, trailing, ariaLabel, className, useTabStripDragReorder: useTabStripDragReorderHook, ...agentProps }: TabStripProps): import("react").JSX.Element;
|
|
40
41
|
//# sourceMappingURL=TabStrip.d.ts.map
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { agentHandleSegment } from '@jini-ai/agentic';
|
|
3
|
+
import { useAgentHandle } from '../../../../react/hooks/useAgentHandle.js';
|
|
2
4
|
import { noopTabStripHaptics } from '../../ports.js';
|
|
3
5
|
import { useTabStripDragReorder } from '../hooks/useTabStripDragReorder.js';
|
|
4
6
|
import { TabStripItem } from './TabStripItem.js';
|
|
@@ -17,13 +19,14 @@ import { TabStripFrame } from './TabStripFrame.js';
|
|
|
17
19
|
* all `WorkspaceTabsBar.tsx`-only chrome that remain host-composed, not
|
|
18
20
|
* part of this primitive).
|
|
19
21
|
*/
|
|
20
|
-
export function TabStrip({ tabs, activeTabId, onActivate, onClose, onReorder, reorderTiming, haptics = noopTabStripHaptics, closeLabel, closeIcon, trailing, ariaLabel, className, useTabStripDragReorder: useTabStripDragReorderHook = useTabStripDragReorder, }) {
|
|
22
|
+
export function TabStrip({ tabs, activeTabId, onActivate, onClose, onReorder, reorderTiming, haptics = noopTabStripHaptics, closeLabel, closeIcon, trailing, ariaLabel, className, useTabStripDragReorder: useTabStripDragReorderHook = useTabStripDragReorder, ...agentProps }) {
|
|
23
|
+
const base = useAgentHandle(agentProps);
|
|
21
24
|
const { draggingTabId, dragOverTarget, stripRef, stripDragProps, getItemDragProps } = useTabStripDragReorderHook({
|
|
22
25
|
tabs,
|
|
23
26
|
onReorder,
|
|
24
27
|
reorderTiming,
|
|
25
28
|
haptics,
|
|
26
29
|
});
|
|
27
|
-
return (_jsxs(TabStripFrame, { className: ['jini-tab-strip', className].filter(Boolean).join(' '), role: "tablist", "aria-label": ariaLabel, ref: stripRef, onDragOver: stripDragProps.onDragOver, onDrop: stripDragProps.onDrop, onDragLeave: stripDragProps.onDragLeave, children: [tabs.map((tab) => (_jsx(TabStripItem, { tab: tab, active: tab.id === activeTabId, dragging: draggingTabId === tab.id, dragOverEdge: dragOverTarget?.tabId === tab.id && draggingTabId !== tab.id ? dragOverTarget.edge : null, dragProps: getItemDragProps(tab.id), onActivate: onActivate, onClose: onClose, closeLabel: closeLabel, closeIcon: closeIcon }, tab.id))), trailing] }));
|
|
30
|
+
return (_jsxs(TabStripFrame, { className: ['jini-tab-strip', className].filter(Boolean).join(' '), role: "tablist", "aria-label": ariaLabel, ref: stripRef, onDragOver: stripDragProps.onDragOver, onDrop: stripDragProps.onDrop, onDragLeave: stripDragProps.onDragLeave, children: [tabs.map((tab) => (_jsx(TabStripItem, { agentHandle: base ? `${base}-tab-${agentHandleSegment({ value: tab.id })}` : false, "data-agent-page": agentProps['data-agent-page'], tab: tab, active: tab.id === activeTabId, dragging: draggingTabId === tab.id, dragOverEdge: dragOverTarget?.tabId === tab.id && draggingTabId !== tab.id ? dragOverTarget.edge : null, dragProps: getItemDragProps(tab.id), onActivate: onActivate, onClose: onClose, closeLabel: closeLabel, closeIcon: closeIcon }, tab.id))), trailing] }));
|
|
28
31
|
}
|
|
29
32
|
//# sourceMappingURL=TabStrip.js.map
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { type AgentControlProps } from '../../../../react/hooks/useAgentHandle.js';
|
|
1
2
|
import type { ReactNode } from 'react';
|
|
2
3
|
import type { TabStripDropEdge, TabStripTab } from '../../types.js';
|
|
3
4
|
import type { TabStripItemDragProps } from '../hooks/useTabStripDragReorder.js';
|
|
4
|
-
export interface TabStripItemProps {
|
|
5
|
+
export interface TabStripItemProps extends AgentControlProps {
|
|
5
6
|
tab: TabStripTab;
|
|
6
7
|
active: boolean;
|
|
7
8
|
dragging: boolean;
|
|
@@ -26,5 +27,5 @@ export interface TabStripItemProps {
|
|
|
26
27
|
* purpose is redundant once the outer element itself is focusable/
|
|
27
28
|
* keyboard-activatable, so this follows the simpler of the two shapes).
|
|
28
29
|
*/
|
|
29
|
-
export declare function TabStripItem({ tab, active, dragging, dragOverEdge, dragProps, onActivate, onClose, closeLabel, closeIcon, }: TabStripItemProps): import("react").JSX.Element;
|
|
30
|
+
export declare function TabStripItem({ tab, active, dragging, dragOverEdge, dragProps, onActivate, onClose, closeLabel, closeIcon, ...agentProps }: TabStripItemProps): import("react").JSX.Element;
|
|
30
31
|
//# sourceMappingURL=TabStripItem.d.ts.map
|