@opentabs-dev/browser-extension 0.0.62 → 0.0.64
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/background-message-handlers.d.ts +3 -1
- package/dist/background-message-handlers.d.ts.map +1 -1
- package/dist/background-message-handlers.js +77 -4
- package/dist/background-message-handlers.js.map +1 -1
- package/dist/background.js +83 -69
- package/dist/extension-messages.d.ts +8 -1
- package/dist/extension-messages.d.ts.map +1 -1
- package/dist/message-router.d.ts.map +1 -1
- package/dist/message-router.js +2 -0
- package/dist/message-router.js.map +1 -1
- package/dist/offscreen/index.js +1 -1
- package/dist/offscreen/index.js.map +1 -1
- package/dist/side-panel/App.d.ts.map +1 -1
- package/dist/side-panel/App.js +26 -5
- package/dist/side-panel/App.js.map +1 -1
- package/dist/side-panel/bridge.d.ts +5 -3
- package/dist/side-panel/bridge.d.ts.map +1 -1
- package/dist/side-panel/bridge.js +10 -3
- package/dist/side-panel/bridge.js.map +1 -1
- package/dist/side-panel/components/BrowserToolsCard.d.ts +1 -2
- package/dist/side-panel/components/BrowserToolsCard.d.ts.map +1 -1
- package/dist/side-panel/components/BrowserToolsCard.js +7 -28
- package/dist/side-panel/components/BrowserToolsCard.js.map +1 -1
- package/dist/side-panel/components/ConfirmationDialog.d.ts.map +1 -1
- package/dist/side-panel/components/ConfirmationDialog.js +2 -1
- package/dist/side-panel/components/ConfirmationDialog.js.map +1 -1
- package/dist/side-panel/components/EmptyStates.d.ts.map +1 -1
- package/dist/side-panel/components/EmptyStates.js +17 -3
- package/dist/side-panel/components/EmptyStates.js.map +1 -1
- package/dist/side-panel/components/NpmPluginCard.d.ts.map +1 -1
- package/dist/side-panel/components/NpmPluginCard.js +1 -1
- package/dist/side-panel/components/NpmPluginCard.js.map +1 -1
- package/dist/side-panel/components/PluginCard.d.ts +2 -2
- package/dist/side-panel/components/PluginCard.d.ts.map +1 -1
- package/dist/side-panel/components/PluginCard.js +55 -33
- package/dist/side-panel/components/PluginCard.js.map +1 -1
- package/dist/side-panel/components/PluginList.d.ts +3 -4
- package/dist/side-panel/components/PluginList.d.ts.map +1 -1
- package/dist/side-panel/components/PluginList.js +136 -4
- package/dist/side-panel/components/PluginList.js.map +1 -1
- package/dist/side-panel/components/PluginMenu.d.ts +3 -1
- package/dist/side-panel/components/PluginMenu.d.ts.map +1 -1
- package/dist/side-panel/components/PluginMenu.js +2 -2
- package/dist/side-panel/components/PluginMenu.js.map +1 -1
- package/dist/side-panel/components/SearchResults.d.ts +5 -2
- package/dist/side-panel/components/SearchResults.d.ts.map +1 -1
- package/dist/side-panel/components/SearchResults.js +5 -4
- package/dist/side-panel/components/SearchResults.js.map +1 -1
- package/dist/side-panel/components/ToolRow.d.ts +6 -2
- package/dist/side-panel/components/ToolRow.d.ts.map +1 -1
- package/dist/side-panel/components/ToolRow.js +9 -3
- package/dist/side-panel/components/ToolRow.js.map +1 -1
- package/dist/side-panel/components/retro/Button.d.ts +1 -1
- package/dist/side-panel/components/retro/Loader.d.ts +1 -1
- package/dist/side-panel/components/retro/Loader.d.ts.map +1 -1
- package/dist/side-panel/components/retro/Loader.js +1 -0
- package/dist/side-panel/components/retro/Loader.js.map +1 -1
- package/dist/side-panel/components/storybook-helpers.d.ts +13 -0
- package/dist/side-panel/components/storybook-helpers.d.ts.map +1 -0
- package/dist/side-panel/components/storybook-helpers.js +55 -0
- package/dist/side-panel/components/storybook-helpers.js.map +1 -0
- package/dist/side-panel/components/tool-groups.d.ts +16 -0
- package/dist/side-panel/components/tool-groups.d.ts.map +1 -0
- package/dist/side-panel/components/tool-groups.js +31 -0
- package/dist/side-panel/components/tool-groups.js.map +1 -0
- package/dist/side-panel/constants.d.ts +1 -1
- package/dist/side-panel/constants.js +1 -1
- package/dist/side-panel/group-transitions.d.ts +55 -0
- package/dist/side-panel/group-transitions.d.ts.map +1 -0
- package/dist/side-panel/group-transitions.js +84 -0
- package/dist/side-panel/group-transitions.js.map +1 -0
- package/dist/side-panel/side-panel.js +2421 -1629
- package/dist/side-panel/styles.css +1 -1
- package/manifest.json +1 -1
- package/package.json +3 -2
|
@@ -5,7 +5,7 @@ import { Button } from './retro/Button';
|
|
|
5
5
|
import { Dialog } from './retro/Dialog';
|
|
6
6
|
import { Loader } from './retro/Loader';
|
|
7
7
|
import { Menu } from './retro/Menu';
|
|
8
|
-
const PluginMenu = ({ plugin, onUpdate, onRemove, updating, removing, className }) => {
|
|
8
|
+
const PluginMenu = ({ plugin, onUpdate, onRemove, updating, removing, muted, className }) => {
|
|
9
9
|
const [confirmOpen, setConfirmOpen] = useState(false);
|
|
10
10
|
const isLocal = plugin.source === 'local';
|
|
11
11
|
const removeLabel = isLocal ? 'Remove' : 'Uninstall';
|
|
@@ -16,7 +16,7 @@ const PluginMenu = ({ plugin, onUpdate, onRemove, updating, removing, className
|
|
|
16
16
|
return (_jsxs("div", { className: className, onClick: e => e.stopPropagation(), onKeyDown: e => {
|
|
17
17
|
if (e.key === 'Enter' || e.key === ' ')
|
|
18
18
|
e.stopPropagation();
|
|
19
|
-
}, role: "presentation", children: [_jsxs(Menu, { children: [_jsx(Menu.Trigger, { asChild: true, children: _jsxs("button", { type: "button", className: "relative flex h-6 w-6 items-center justify-center rounded hover:bg-muted/50", "aria-label": "Plugin options", children: [_jsx(MoreHorizontal, { className:
|
|
19
|
+
}, role: "presentation", children: [_jsxs(Menu, { children: [_jsx(Menu.Trigger, { asChild: true, children: _jsxs("button", { type: "button", className: "relative flex h-6 w-6 items-center justify-center rounded hover:bg-muted/50", "aria-label": "Plugin options", children: [_jsx(MoreHorizontal, { className: `h-4 w-4 ${muted ? 'text-muted-foreground' : ''}` }), plugin.update && (_jsx("div", { className: "absolute top-0 right-0 h-1.5 w-1.5 rounded-full border border-background bg-primary" }))] }) }), _jsxs(Menu.Content, { align: "end", children: [plugin.update && (_jsxs(Menu.Item, { onClick: onUpdate, children: [updating ? _jsx(Loader, { size: "sm" }) : _jsx(ArrowUpCircle, { className: "h-3.5 w-3.5" }), "Update to v", plugin.update.latestVersion] })), plugin.update && _jsx(Menu.Separator, {}), _jsxs(Menu.Item, { onSelect: () => setConfirmOpen(true), className: "text-destructive focus:bg-destructive/10 focus:text-destructive data-[highlighted]:bg-destructive/10 data-[highlighted]:text-destructive", children: [removing ? _jsx(Loader, { size: "sm" }) : _jsx(Trash2, { className: "h-3.5 w-3.5" }), removeLabel] })] })] }), _jsx(Dialog, { open: confirmOpen, onOpenChange: setConfirmOpen, children: _jsxs(Dialog.Content, { children: [_jsxs(Dialog.Header, { className: "border-destructive bg-destructive text-destructive-foreground", children: [removeLabel, " Plugin"] }), _jsxs(Dialog.Body, { children: [_jsxs("p", { className: "text-foreground text-sm", children: ["Are you sure you want to ", removeLabel.toLowerCase(), ' ', _jsx("strong", { className: "font-head", children: plugin.displayName }), "?"] }), isLocal ? (_jsx("p", { className: "mt-1 text-muted-foreground text-xs", children: "This will remove the plugin path from your config." })) : (_jsx("p", { className: "mt-1 text-muted-foreground text-xs", children: "This will run npm uninstall and remove the plugin globally." }))] }), _jsxs(Dialog.Footer, { children: [_jsx(Dialog.Close, { asChild: true, children: _jsx(Button, { size: "sm", variant: "outline", children: "Cancel" }) }), _jsx(Button, { size: "sm", variant: "outline", className: "border-destructive text-destructive", onClick: handleConfirmRemove, children: removeLabel })] })] }) })] }));
|
|
20
20
|
};
|
|
21
21
|
PluginMenu.displayName = 'PluginMenu';
|
|
22
22
|
export { PluginMenu };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PluginMenu.js","sourceRoot":"","sources":["../../../src/side-panel/components/PluginMenu.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAA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IAAI,eACV,aAAG,SAAS,EAAC,yBAAyB,0CACV,WAAW,CAAC,WAAW,EAAE,EAAE,GAAG,EACxD,iBAAQ,SAAS,EAAC,WAAW,YAAE,MAAM,CAAC,WAAW,GAAU,SACzD,EACH,OAAO,CAAC,CAAC,CAAC,CACT,YAAG,SAAS,EAAC,oCAAoC,mEAAuD,CACzG,CAAC,CAAC,CAAC,CACF,YAAG,SAAS,EAAC,oCAAoC,4EAE7C,CACL,IACW,EACd,MAAC,MAAM,CAAC,MAAM,eACZ,KAAC,MAAM,CAAC,KAAK,IAAC,OAAO,kBACnB,KAAC,MAAM,IAAC,IAAI,EAAC,IAAI,EAAC,OAAO,EAAC,SAAS,uBAE1B,GACI,EACf,KAAC,MAAM,IACL,IAAI,EAAC,IAAI,EACT,OAAO,EAAC,SAAS,EACjB,SAAS,EAAC,qCAAqC,EAC/C,OAAO,EAAE,mBAAmB,YAC3B,WAAW,GACL,IACK,IACD,GACV,IACL,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,UAAU,CAAC,WAAW,GAAG,YAAY,CAAC;AAEtC,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ToolPermission } from '@opentabs-dev/shared';
|
|
1
2
|
import type { Dispatch, SetStateAction } from 'react';
|
|
2
3
|
import type { BrowserToolState, FailedPluginState, PluginSearchResult, PluginState } from '../bridge';
|
|
3
4
|
interface SearchResultsProps {
|
|
@@ -10,6 +11,7 @@ interface SearchResultsProps {
|
|
|
10
11
|
toolFilter: string;
|
|
11
12
|
npmResults: PluginSearchResult[];
|
|
12
13
|
npmSearching: boolean;
|
|
14
|
+
npmSearchError?: boolean;
|
|
13
15
|
installingPlugins: Set<string>;
|
|
14
16
|
onInstall: (name: string) => void;
|
|
15
17
|
installErrors: Map<string, string>;
|
|
@@ -18,10 +20,11 @@ interface SearchResultsProps {
|
|
|
18
20
|
removingPlugins?: Set<string>;
|
|
19
21
|
pluginErrors?: Map<string, string>;
|
|
20
22
|
serverVersion?: string;
|
|
21
|
-
|
|
23
|
+
browserPermission?: ToolPermission;
|
|
24
|
+
onBrowserPermissionChange?: (permission: ToolPermission) => void;
|
|
22
25
|
}
|
|
23
26
|
declare const SearchResults: {
|
|
24
|
-
({ plugins, failedPlugins, browserTools, activeTools, setPlugins, setBrowserTools, toolFilter, npmResults, npmSearching, installingPlugins, onInstall, installErrors, onUpdate, onRemove, removingPlugins, pluginErrors, serverVersion,
|
|
27
|
+
({ plugins, failedPlugins, browserTools, activeTools, setPlugins, setBrowserTools, toolFilter, npmResults, npmSearching, npmSearchError, installingPlugins, onInstall, installErrors, onUpdate, onRemove, removingPlugins, pluginErrors, serverVersion, browserPermission, onBrowserPermissionChange, }: SearchResultsProps): import("react/jsx-runtime").JSX.Element;
|
|
25
28
|
displayName: string;
|
|
26
29
|
};
|
|
27
30
|
export { SearchResults };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchResults.d.ts","sourceRoot":"","sources":["../../../src/side-panel/components/SearchResults.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAa,cAAc,EAAE,MAAM,OAAO,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"SearchResults.d.ts","sourceRoot":"","sources":["../../../src/side-panel/components/SearchResults.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EAAE,QAAQ,EAAa,cAAc,EAAE,MAAM,OAAO,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAStG,UAAU,kBAAkB;IAC1B,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,aAAa,EAAE,iBAAiB,EAAE,CAAC;IACnC,YAAY,EAAE,gBAAgB,EAAE,CAAC;IACjC,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACzB,UAAU,EAAE,QAAQ,CAAC,cAAc,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;IACpD,eAAe,EAAE,QAAQ,CAAC,cAAc,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC;IAC9D,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,kBAAkB,EAAE,CAAC;IACjC,YAAY,EAAE,OAAO,CAAC;IACtB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,iBAAiB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC/B,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,QAAQ,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,QAAQ,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,eAAe,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC9B,YAAY,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,cAAc,CAAC;IACnC,yBAAyB,CAAC,EAAE,CAAC,UAAU,EAAE,cAAc,KAAK,IAAI,CAAC;CAClE;AAYD,QAAA,MAAM,aAAa;6SAqBhB,kBAAkB;;CA0GpB,CAAC;AAIF,OAAO,EAAE,aAAa,EAAE,CAAC;AACzB,YAAY,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -4,13 +4,14 @@ import { BrowserToolsCard, toDisplayName } from './BrowserToolsCard';
|
|
|
4
4
|
import { NpmPluginCard } from './NpmPluginCard';
|
|
5
5
|
import { PluginList } from './PluginList';
|
|
6
6
|
import { Accordion } from './retro/Accordion';
|
|
7
|
+
import { Empty } from './retro/Empty';
|
|
7
8
|
import { Loader } from './retro/Loader';
|
|
8
9
|
const SectionHeader = ({ children }) => (_jsx("div", { className: "mb-1.5 font-head text-[10px] text-muted-foreground uppercase tracking-widest", children: children }));
|
|
9
10
|
/** Returns true if a browser tool matches the search filter */
|
|
10
11
|
const matchesBrowserTool = (tool, filterLower) => toDisplayName(tool.name).toLowerCase().includes(filterLower) ||
|
|
11
12
|
tool.name.toLowerCase().includes(filterLower) ||
|
|
12
13
|
tool.description.toLowerCase().includes(filterLower);
|
|
13
|
-
const SearchResults = ({ plugins, failedPlugins, browserTools, activeTools, setPlugins, setBrowserTools, toolFilter, npmResults, npmSearching, installingPlugins, onInstall, installErrors, onUpdate, onRemove, removingPlugins, pluginErrors, serverVersion,
|
|
14
|
+
const SearchResults = ({ plugins, failedPlugins, browserTools, activeTools, setPlugins, setBrowserTools, toolFilter, npmResults, npmSearching, npmSearchError, installingPlugins, onInstall, installErrors, onUpdate, onRemove, removingPlugins, pluginErrors, serverVersion, browserPermission = 'off', onBrowserPermissionChange, }) => {
|
|
14
15
|
const filterLower = toolFilter.toLowerCase();
|
|
15
16
|
// Filter installed plugins using matchesPlugin (name + displayName + tools)
|
|
16
17
|
const installedMatches = filterLower ? plugins.filter(p => matchesPlugin(p, filterLower)) : plugins;
|
|
@@ -25,9 +26,9 @@ const SearchResults = ({ plugins, failedPlugins, browserTools, activeTools, setP
|
|
|
25
26
|
const installedShortNames = new Set(plugins.map(p => extractShortName(p.name)));
|
|
26
27
|
const availableResults = npmResults.filter(r => !installedShortNames.has(extractShortName(r.name)));
|
|
27
28
|
const hasInstalledResults = installedMatches.length > 0 || failedMatches.length > 0 || hasBrowserToolMatches;
|
|
28
|
-
const showNoResults = toolFilter && !hasInstalledResults && !npmSearching && availableResults.length === 0;
|
|
29
|
-
return (_jsxs("div", { className: "space-y-4", children: [hasInstalledResults && (_jsxs("div", { children: [_jsx(SectionHeader, { children: "Installed" }), hasBrowserToolMatches && (_jsx(Accordion, { type: "multiple", className: "mb-2 space-y-2", children: _jsx(BrowserToolsCard, { tools: browserTools, activeTools: activeTools, onToolsChange: setBrowserTools, toolFilter: toolFilter, serverVersion: serverVersion,
|
|
30
|
-
(npmSearching ? (_jsx("div", { className: "flex justify-center py-4", children: _jsx(Loader, { size: "sm" }) })) : (availableResults.length > 0 && (_jsxs("div", { children: [_jsx(SectionHeader, { children: "Available" }), _jsx("div", { className: "space-y-2", children: availableResults.map(result => (_jsx(NpmPluginCard, { plugin: result, installing: installingPlugins.has(result.name), error: installErrors.get(result.name) ?? null, onInstall: () => onInstall(result.name) }, result.name))) })] })))), showNoResults && _jsx("
|
|
29
|
+
const showNoResults = toolFilter && !hasInstalledResults && !npmSearching && !npmSearchError && availableResults.length === 0;
|
|
30
|
+
return (_jsxs("div", { className: "space-y-4", children: [hasInstalledResults && (_jsxs("div", { children: [_jsx(SectionHeader, { children: "Installed" }), hasBrowserToolMatches && (_jsx(Accordion, { type: "multiple", className: "mb-2 space-y-2", children: _jsx(BrowserToolsCard, { tools: browserTools, activeTools: activeTools, onToolsChange: setBrowserTools, toolFilter: toolFilter, serverVersion: serverVersion, browserPermission: browserPermission, onBrowserPermissionChange: onBrowserPermissionChange }) })), _jsx(PluginList, { plugins: installedMatches, failedPlugins: failedMatches, activeTools: activeTools, setPlugins: setPlugins, toolFilter: "", onUpdate: onUpdate, onRemove: onRemove, removingPlugins: removingPlugins, pluginErrors: pluginErrors })] })), toolFilter &&
|
|
31
|
+
(npmSearching ? (_jsx("div", { className: "flex justify-center py-4", children: _jsx(Loader, { size: "sm" }) })) : npmSearchError ? (_jsxs("div", { className: "py-4 text-center", children: [_jsx("p", { className: "font-head text-muted-foreground text-sm", children: "Search unavailable" }), _jsx("p", { className: "mt-1 text-muted-foreground text-xs", children: "Could not reach the npm registry. Check your internet connection." })] })) : (availableResults.length > 0 && (_jsxs("div", { children: [_jsx(SectionHeader, { children: "Available" }), _jsx("div", { className: "space-y-2", children: availableResults.map(result => (_jsx(NpmPluginCard, { plugin: result, installing: installingPlugins.has(result.name), error: installErrors.get(result.name) ?? null, onInstall: () => onInstall(result.name) }, result.name))) })] })))), showNoResults && (_jsx(Empty, { className: "border-muted", children: _jsxs(Empty.Content, { children: [_jsx(Empty.Icon, { className: "h-10 w-10 text-muted-foreground" }), _jsxs(Empty.Title, { className: "text-base", children: ["No results for \u201C", toolFilter, "\u201D"] }), _jsx(Empty.Separator, {}), _jsx(Empty.Description, { className: "text-xs", children: "Try searching by plugin name, tool name, or description." })] }) }))] }));
|
|
31
32
|
};
|
|
32
33
|
SearchResults.displayName = 'SearchResults';
|
|
33
34
|
export { SearchResults };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchResults.js","sourceRoot":"","sources":["../../../src/side-panel/components/SearchResults.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"SearchResults.js","sourceRoot":"","sources":["../../../src/side-panel/components/SearchResults.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAyBxC,MAAM,aAAa,GAAG,CAAC,EAAE,QAAQ,EAA2B,EAAE,EAAE,CAAC,CAC/D,cAAK,SAAS,EAAC,8EAA8E,YAAE,QAAQ,GAAO,CAC/G,CAAC;AAEF,+DAA+D;AAC/D,MAAM,kBAAkB,GAAG,CAAC,IAAsB,EAAE,WA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AC,SAAS,EAAC,SAAS,yEAElB,IACN,GACV,CACT,IACG,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,aAAa,CAAC,WAAW,GAAG,eAAe,CAAC;AAE5C,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import type { ToolPermission } from '@opentabs-dev/shared';
|
|
2
|
-
declare const PermissionSelect: ({ value, onValueChange, disabled, ariaLabel, }: {
|
|
2
|
+
declare const PermissionSelect: ({ value, onValueChange, disabled, muted, ariaLabel, }: {
|
|
3
3
|
value: ToolPermission;
|
|
4
4
|
onValueChange: (value: ToolPermission) => void;
|
|
5
5
|
disabled: boolean;
|
|
6
|
+
/** Use muted border and text colors (for inactive/disconnected plugins). */
|
|
7
|
+
muted?: boolean;
|
|
6
8
|
ariaLabel: string;
|
|
7
9
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
declare const ToolRow: ({ name, displayName, description, summary, icon, permission, active, disabled, onPermissionChange, }: {
|
|
10
|
+
declare const ToolRow: ({ name, displayName, description, summary, icon, permission, active, muted, disabled, onPermissionChange, }: {
|
|
9
11
|
name: string;
|
|
10
12
|
displayName: string;
|
|
11
13
|
description: string;
|
|
@@ -14,6 +16,8 @@ declare const ToolRow: ({ name, displayName, description, summary, icon, permiss
|
|
|
14
16
|
icon: string;
|
|
15
17
|
permission: ToolPermission;
|
|
16
18
|
active: boolean;
|
|
19
|
+
/** Use muted text colors (for inactive/disconnected plugins). */
|
|
20
|
+
muted?: boolean;
|
|
17
21
|
disabled?: boolean;
|
|
18
22
|
onPermissionChange: (tool: string, permission: ToolPermission) => void;
|
|
19
23
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolRow.d.ts","sourceRoot":"","sources":["../../../src/side-panel/components/ToolRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAY3D,QAAA,MAAM,gBAAgB,GAAI,
|
|
1
|
+
{"version":3,"file":"ToolRow.d.ts","sourceRoot":"","sources":["../../../src/side-panel/components/ToolRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAY3D,QAAA,MAAM,gBAAgB,GAAI,uDAMvB;IACD,KAAK,EAAE,cAAc,CAAC;IACtB,aAAa,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IAC/C,QAAQ,EAAE,OAAO,CAAC;IAClB,4EAA4E;IAC5E,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB,4CA4BA,CAAC;AAEF,QAAA,MAAM,OAAO,GAAI,6GAWd;IACD,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,qFAAqF;IACrF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,cAAc,CAAC;IAC3B,MAAM,EAAE,OAAO,CAAC;IAChB,iEAAiE;IACjE,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kBAAkB,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,cAAc,KAAK,IAAI,CAAC;CACxE,4CAkCA,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -8,11 +8,17 @@ const PERMISSION_LABELS = {
|
|
|
8
8
|
ask: 'Ask',
|
|
9
9
|
auto: 'Auto',
|
|
10
10
|
};
|
|
11
|
-
const PermissionSelect = ({ value, onValueChange, disabled, ariaLabel, }) => (_jsxs(Select, { value: value, onValueChange: (v) => onValueChange(v), children: [_jsx(Select.Trigger, { className:
|
|
12
|
-
|
|
11
|
+
const PermissionSelect = ({ value, onValueChange, disabled, muted, ariaLabel, }) => (_jsxs(Select, { value: value, onValueChange: (v) => onValueChange(v), children: [_jsx(Select.Trigger, { className: cn('h-6 w-[4.5rem] min-w-0 px-1.5 py-0 font-mono font-semibold text-xs shadow-none focus:shadow-none', muted && 'border-border/50 text-muted-foreground'), onClick: (e) => e.stopPropagation(), disabled: disabled, "aria-label": ariaLabel, children: _jsx(Select.Value, {}) }), _jsx(Select.Content, { className: "font-mono font-semibold text-xs", children: ['off', 'ask', 'auto'].map(p => (_jsx(Select.Item, { value: p, onPointerUp: () => {
|
|
12
|
+
// Radix Select's onValueChange doesn't fire when re-selecting the
|
|
13
|
+
// current value. Fire the callback explicitly so that re-selecting
|
|
14
|
+
// the plugin-level default clears per-tool overrides.
|
|
15
|
+
if (p === value)
|
|
16
|
+
onValueChange(p);
|
|
17
|
+
}, children: PERMISSION_LABELS[p] }, p))) })] }));
|
|
18
|
+
const ToolRow = ({ name, displayName, description, summary, icon, permission, active, muted, disabled, onPermissionChange, }) => {
|
|
13
19
|
const enabled = permission !== 'off';
|
|
14
20
|
const displayDescription = summary ?? description;
|
|
15
|
-
return (_jsxs("div", { className: cn('flex items-center gap-2 border-border border-b px-3 py-1.5 transition-colors last:border-b-0 even:bg-muted/10', enabled ? 'hover:bg-primary/10' : 'hover:bg-muted/50', disabled && 'opacity-50'), children: [_jsx(ToolIcon, { icon: icon, enabled: enabled, active: active }), _jsxs(Tooltip, { children: [_jsx(Tooltip.Trigger, { asChild: true, children: _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("div", { className:
|
|
21
|
+
return (_jsxs("div", { className: cn('flex items-center gap-2 border-border border-b border-l-2 border-l-transparent px-3 py-1.5 transition-colors last:border-b-0 even:bg-muted/10', active && 'border-l-primary bg-primary/5', enabled ? 'hover:bg-primary/10' : 'hover:bg-muted/50', disabled && 'opacity-50'), children: [_jsx(ToolIcon, { icon: icon, enabled: enabled, active: active }), _jsxs(Tooltip, { children: [_jsx(Tooltip.Trigger, { asChild: true, children: _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("div", { className: `truncate text-sm ${muted ? 'text-muted-foreground' : 'text-foreground'}`, children: displayName }), _jsx("div", { className: "truncate text-muted-foreground text-xs", children: displayDescription })] }) }), _jsx(Tooltip.Content, { children: displayDescription })] }), _jsx("div", { className: "flex shrink-0 items-center gap-2", children: _jsx(PermissionSelect, { value: permission, onValueChange: p => onPermissionChange(name, p), disabled: disabled ?? false, muted: muted, ariaLabel: `Permission for ${name} tool` }) })] }));
|
|
16
22
|
};
|
|
17
23
|
export { PermissionSelect, ToolRow };
|
|
18
24
|
//# sourceMappingURL=ToolRow.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolRow.js","sourceRoot":"","sources":["../../../src/side-panel/components/ToolRow.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,MAAM,iBAAiB,GAAmC;IACxD,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,IAAI,EAAE,MAAM;CACb,CAAC;AAEF,MAAM,gBAAgB,GAAG,CAAC,EACxB,KAAK,EACL,aAAa,EACb,QAAQ,EACR,SAAS,
|
|
1
|
+
{"version":3,"file":"ToolRow.js","sourceRoot":"","sources":["../../../src/side-panel/components/ToolRow.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,MAAM,iBAAiB,GAAmC;IACxD,GAAG,EAAE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AAW,CAAC;IAClD,OAAO,CACL,eACE,SAAS,EAAE,EAAE,CACX,+IAA+I,EAC/I,MAAM,IAAI,+BAA+B,EACzC,OAAO,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,mBAAmB,EACrD,QAAQ,IAAI,YAAY,CACzB,aACD,KAAC,QAAQ,IAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAI,EAC1D,MAAC,OAAO,eACN,KAAC,OAAO,CAAC,OAAO,IAAC,OAAO,kBACtB,eAAK,SAAS,EAAC,gBAAgB,aAC7B,cAAK,SAAS,EAAE,oBAAoB,KAAK,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,iBAAiB,EAAE,YACtF,WAAW,GACR,EACN,cAAK,SAAS,EAAC,wCAAwC,YAAE,kBAAkB,GAAO,IAC9E,GACU,EAClB,KAAC,OAAO,CAAC,OAAO,cAAE,kBAAkB,GAAmB,IAC/C,EACV,cAAK,SAAS,EAAC,kCAAkC,YAC/C,KAAC,gBAAgB,IACf,KAAK,EAAE,UAAU,EACjB,aAAa,EAAE,CAAC,CAAC,EAAE,CAAC,kBAAkB,CAAC,IAAI,EAAE,CAAC,CAAC,EAC/C,QAAQ,EAAE,QAAQ,IAAI,KAAK,EAC3B,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,kBAAkB,IAAI,OAAO,GACxC,GACE,IACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { VariantProps } from 'class-variance-authority';
|
|
2
2
|
import type { ButtonHTMLAttributes, Ref } from 'react';
|
|
3
3
|
declare const buttonVariants: (props?: ({
|
|
4
|
-
variant?: "link" | "default" | "
|
|
4
|
+
variant?: "link" | "default" | "ghost" | "secondary" | "outline" | null | undefined;
|
|
5
5
|
size?: "icon" | "sm" | "md" | "lg" | null | undefined;
|
|
6
6
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
7
|
interface IButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { VariantProps } from 'class-variance-authority';
|
|
2
2
|
import type { HTMLAttributes, Ref } from 'react';
|
|
3
3
|
declare const loaderVariants: (props?: ({
|
|
4
|
-
variant?: "default" | "
|
|
4
|
+
variant?: "default" | "muted" | "secondary" | "outline" | null | undefined;
|
|
5
5
|
size?: "sm" | "md" | "lg" | null | undefined;
|
|
6
6
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
7
|
interface LoaderProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color'>, VariantProps<typeof loaderVariants> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Loader.d.ts","sourceRoot":"","sources":["../../../../src/side-panel/components/retro/Loader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAE7D,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAGjD,QAAA,MAAM,cAAc;;;
|
|
1
|
+
{"version":3,"file":"Loader.d.ts","sourceRoot":"","sources":["../../../../src/side-panel/components/retro/Loader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAE7D,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAGjD,QAAA,MAAM,cAAc;;;8EAkBlB,CAAC;AAEH,UAAU,WAAY,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC,EAAE,YAAY,CAAC,OAAO,cAAc,CAAC;IAC9G,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B;AAED,QAAA,MAAM,MAAM,GAAI,yEASb,WAAW,4CAmBb,CAAC;AAEF,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -7,6 +7,7 @@ const loaderVariants = cva('flex gap-1', {
|
|
|
7
7
|
default: '[&>div]:bg-primary [&>div]:border-border',
|
|
8
8
|
secondary: '[&>div]:bg-secondary [&>div]:border-border',
|
|
9
9
|
outline: '[&>div]:bg-transparent [&>div]:border-border',
|
|
10
|
+
muted: '[&>div]:bg-muted-foreground [&>div]:border-muted-foreground',
|
|
10
11
|
},
|
|
11
12
|
size: {
|
|
12
13
|
sm: '[&>div]:w-2 [&>div]:h-2',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Loader.js","sourceRoot":"","sources":["../../../../src/side-panel/components/retro/Loader.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAE/C,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAElC,MAAM,cAAc,GAAG,GAAG,CAAC,YAAY,EAAE;IACvC,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EAAE,0CAA0C;YACnD,SAAS,EAAE,4CAA4C;YACvD,OAAO,EAAE,8CAA8C;
|
|
1
|
+
{"version":3,"file":"Loader.js","sourceRoot":"","sources":["../../../../src/side-panel/components/retro/Loader.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAE/C,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAElC,MAAM,cAAc,GAAG,GAAG,CAAC,YAAY,EAAE;IACvC,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EAAE,0CAA0C;YACnD,SAAS,EAAE,4CAA4C;YACvD,OAAO,EAAE,8CAA8C;YACvD,KAAK,EAAE,6DAA6D;SACrE;QACD,IAAI,EAAE;YACJ,EAAE,EAAE,yBAAyB;YAC7B,EAAE,EAAE,yBAAyB;YAC7B,EAAE,EAAE,yBAAyB;SAC9B;KACF;IACD,eAAe,EAAE;QACf,OAAO,EAAE,SAAS;QAClB,IAAI,EAAE,IAAI;KACX;CACF,CAAC,CAAC;AASH,MAAM,MAAM,GAAG,CAAC,EACd,SAAS,EACT,OAAO,EACP,IAAI,EACJ,KAAK,GAAG,CAAC,EACT,QAAQ,GAAG,GAAG,EACd,SAAS,GAAG,GAAG,EACf,GAAG,EACH,GAAG,KAAK,EACI,EAAE,EAAE,CAAC,CACjB,cACE,SAAS,EAAE,EAAE,CAAC,cAAc,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,SAAS,CAAC,EAC3D,GAAG,EAAE,GAAG,EACR,IAAI,EAAC,QAAQ,gBACF,YAAY,KACnB,KAAK,YACR,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAC3C,cAEE,SAAS,EAAC,iCAAiC,EAC3C,KAAK,EAAE;YACL,iBAAiB,EAAE,GAAG,QAAQ,GAAG;YACjC,uBAAuB,EAAE,UAAU;YACnC,cAAc,EAAE,GAAG,CAAC,GAAG,SAAS,IAAI;SACrC,IANI,CAAC,CAON,CACH,CAAC,GACE,CACP,CAAC;AAEF,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Explicit CSS variable values for light and dark themes.
|
|
4
|
+
* Using inline styles guarantees correct theme isolation regardless of
|
|
5
|
+
* the Storybook global theme toggle state. Values must match styles.css.
|
|
6
|
+
*/
|
|
7
|
+
declare const lightVars: CSSProperties;
|
|
8
|
+
declare const darkVars: CSSProperties;
|
|
9
|
+
declare const ThemeGrid: ({ children }: {
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export { ThemeGrid, lightVars, darkVars };
|
|
13
|
+
//# sourceMappingURL=storybook-helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storybook-helpers.d.ts","sourceRoot":"","sources":["../../../src/side-panel/components/storybook-helpers.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtD;;;;GAIG;AACH,QAAA,MAAM,SAAS,EAsBV,aAAa,CAAC;AAEnB,QAAA,MAAM,QAAQ,EAsBT,aAAa,CAAC;AAEnB,QAAA,MAAM,SAAS,GAAI,cAAc;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,4CAevD,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Explicit CSS variable values for light and dark themes.
|
|
4
|
+
* Using inline styles guarantees correct theme isolation regardless of
|
|
5
|
+
* the Storybook global theme toggle state. Values must match styles.css.
|
|
6
|
+
*/
|
|
7
|
+
const lightVars = {
|
|
8
|
+
'--background': '#fff',
|
|
9
|
+
'--foreground': '#000',
|
|
10
|
+
'--card': '#fff',
|
|
11
|
+
'--card-foreground': '#000',
|
|
12
|
+
'--primary': '#ffdb33',
|
|
13
|
+
'--primary-hover': '#ffcc00',
|
|
14
|
+
'--primary-foreground': '#000',
|
|
15
|
+
'--secondary': '#000',
|
|
16
|
+
'--secondary-hover': '#1a1a1a',
|
|
17
|
+
'--secondary-foreground': '#fff',
|
|
18
|
+
'--muted': '#cccccc',
|
|
19
|
+
'--muted-foreground': '#5a5a5a',
|
|
20
|
+
'--accent': '#fae583',
|
|
21
|
+
'--accent-foreground': '#000',
|
|
22
|
+
'--destructive': '#e63946',
|
|
23
|
+
'--destructive-foreground': '#fff',
|
|
24
|
+
'--success': '#16a34a',
|
|
25
|
+
'--success-foreground': '#fff',
|
|
26
|
+
'--border': '#000',
|
|
27
|
+
background: 'var(--background)',
|
|
28
|
+
color: 'var(--foreground)',
|
|
29
|
+
};
|
|
30
|
+
const darkVars = {
|
|
31
|
+
'--background': '#1a1a1a',
|
|
32
|
+
'--foreground': '#f5f5f5',
|
|
33
|
+
'--card': '#242424',
|
|
34
|
+
'--card-foreground': '#f5f5f5',
|
|
35
|
+
'--primary': '#ffdb33',
|
|
36
|
+
'--primary-hover': '#ffcc00',
|
|
37
|
+
'--primary-foreground': '#000',
|
|
38
|
+
'--secondary': '#3a3a3a',
|
|
39
|
+
'--secondary-hover': '#4a4a4a',
|
|
40
|
+
'--secondary-foreground': '#f5f5f5',
|
|
41
|
+
'--muted': '#3f3f46',
|
|
42
|
+
'--muted-foreground': '#a0a0a0',
|
|
43
|
+
'--accent': '#fae583',
|
|
44
|
+
'--accent-foreground': '#000',
|
|
45
|
+
'--destructive': '#e63946',
|
|
46
|
+
'--destructive-foreground': '#fff',
|
|
47
|
+
'--success': '#22c55e',
|
|
48
|
+
'--success-foreground': '#000',
|
|
49
|
+
'--border': '#5c5c5c',
|
|
50
|
+
background: 'var(--background)',
|
|
51
|
+
color: 'var(--foreground)',
|
|
52
|
+
};
|
|
53
|
+
const ThemeGrid = ({ children }) => (_jsxs("div", { className: "flex gap-6", children: [_jsxs("div", { className: "flex flex-col gap-2", children: [_jsx("span", { className: "font-mono text-muted-foreground text-xs", children: "Light" }), _jsx("div", { className: "w-80 rounded p-3", style: lightVars, children: children })] }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx("span", { className: "font-mono text-muted-foreground text-xs", children: "Dark" }), _jsx("div", { className: "w-80 rounded p-3", style: darkVars, children: children })] })] }));
|
|
54
|
+
export { ThemeGrid, lightVars, darkVars };
|
|
55
|
+
//# sourceMappingURL=storybook-helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storybook-helpers.js","sourceRoot":"","sources":["../../../src/side-panel/components/storybook-helpers.tsx"],"names":[],"mappings":";AAEA;;;;GAIG;AACH,MAAM,SAAS,GAAG;IAChB,cAAc,EAAE,MAAM;IACtB,cAAc,EAAE,MAAM;IACtB,QAAQ,EAAE,MAAM;IAChB,mBAAmB,EAAE,MAAM;IAC3B,WAAW,EAAE,SAAS;IACtB,iBAAiB,EAAE,SAAS;IAC5B,sBAAsB,EAAE,MAAM;IAC9B,aAAa,EAAE,MAAM;IACrB,mBAAmB,EAAE,SAAS;IAC9B,wBAAwB,EAAE,MAAM;IAChC,SAAS,EAAE,SAAS;IACpB,oBAAoB,EAAE,SAAS;IAC/B,UAAU,EAAE,SAAS;IACrB,qBAAqB,EAAE,MAAM;IAC7B,eAAe,EAAE,SAAS;IAC1B,0BAA0B,EAAE,MAAM;IAClC,WAAW,EAAE,SAAS;IACtB,sBAAsB,EAAE,MAAM;IAC9B,UAAU,EAAE,MAAM;IAClB,UAAU,EAAE,mBAAmB;IAC/B,KAAK,EAAE,mBAAmB;CACV,CAAC;AAEnB,MAAM,QAAQ,GAAG;IACf,cAAc,EAAE,SAAS;IACzB,cAAc,EAAE,SAAS;IACzB,QAAQ,EAAE,SAAS;IACnB,mBAAmB,EAAE,SAAS;IAC9B,WAAW,EAAE,SAAS;IACtB,iBAAiB,EAAE,SAAS;IAC5B,sBAAsB,EAAE,MAAM;IAC9B,aAAa,EAAE,SAAS;IACxB,mBAAmB,EAAE,SAAS;IAC9B,wBAAwB,EAAE,SAAS;IACnC,SAAS,EAAE,SAAS;IACpB,oBAAoB,EAAE,SAAS;IAC/B,UAAU,EAAE,SAAS;IACrB,qBAAqB,EAAE,MAAM;IAC7B,eAAe,EAAE,SAAS;IAC1B,0BAA0B,EAAE,MAAM;IAClC,WAAW,EAAE,SAAS;IACtB,sBAAsB,EAAE,MAAM;IAC9B,UAAU,EAAE,SAAS;IACrB,UAAU,EAAE,mBAAmB;IAC/B,KAAK,EAAE,mBAAmB;CACV,CAAC;AAEnB,MAAM,SAAS,GAAG,CAAC,EAAE,QAAQ,EAA2B,EAAE,EAAE,CAAC,CAC3D,eAAK,SAAS,EAAC,YAAY,aACzB,eAAK,SAAS,EAAC,qBAAqB,aAClC,eAAM,SAAS,EAAC,yCAAyC,sBAAa,EACtE,cAAK,SAAS,EAAC,kBAAkB,EAAC,KAAK,EAAE,SAAS,YAC/C,QAAQ,GACL,IACF,EACN,eAAK,SAAS,EAAC,qBAAqB,aAClC,eAAM,SAAS,EAAC,yCAAyC,qBAAY,EACrE,cAAK,SAAS,EAAC,kBAAkB,EAAC,KAAK,EAAE,QAAQ,YAC9C,QAAQ,GACL,IACF,IACF,CACP,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
interface Groupable {
|
|
2
|
+
readonly group?: string;
|
|
3
|
+
}
|
|
4
|
+
interface ToolGroup<T> {
|
|
5
|
+
readonly name: string;
|
|
6
|
+
readonly tools: T[];
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Group tools by their `group` field, preserving first-seen order.
|
|
10
|
+
* The 'Other' group (tools with no group) is sorted to the end.
|
|
11
|
+
* Returns null if no tool has a group field (caller should render a flat list).
|
|
12
|
+
*/
|
|
13
|
+
declare function groupTools<T extends Groupable>(tools: readonly T[]): ToolGroup<T>[] | null;
|
|
14
|
+
export { groupTools };
|
|
15
|
+
export type { ToolGroup };
|
|
16
|
+
//# sourceMappingURL=tool-groups.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-groups.d.ts","sourceRoot":"","sources":["../../../src/side-panel/components/tool-groups.ts"],"names":[],"mappings":"AAAA,UAAU,SAAS;IACjB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,UAAU,SAAS,CAAC,CAAC;IACnB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC;CACrB;AAED;;;;GAIG;AACH,iBAAS,UAAU,CAAC,CAAC,SAAS,SAAS,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,GAAG,SAAS,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,CAsBnF;AAED,OAAO,EAAE,UAAU,EAAE,CAAC;AACtB,YAAY,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Group tools by their `group` field, preserving first-seen order.
|
|
3
|
+
* The 'Other' group (tools with no group) is sorted to the end.
|
|
4
|
+
* Returns null if no tool has a group field (caller should render a flat list).
|
|
5
|
+
*/
|
|
6
|
+
function groupTools(tools) {
|
|
7
|
+
if (!tools.some(t => t.group))
|
|
8
|
+
return null;
|
|
9
|
+
const groupMap = new Map();
|
|
10
|
+
for (const tool of tools) {
|
|
11
|
+
const groupName = tool.group ?? 'Other';
|
|
12
|
+
let bucket = groupMap.get(groupName);
|
|
13
|
+
if (!bucket) {
|
|
14
|
+
bucket = [];
|
|
15
|
+
groupMap.set(groupName, bucket);
|
|
16
|
+
}
|
|
17
|
+
bucket.push(tool);
|
|
18
|
+
}
|
|
19
|
+
const otherBucket = groupMap.get('Other');
|
|
20
|
+
groupMap.delete('Other');
|
|
21
|
+
const result = [];
|
|
22
|
+
for (const [name, grouped] of groupMap) {
|
|
23
|
+
result.push({ name, tools: grouped });
|
|
24
|
+
}
|
|
25
|
+
if (otherBucket) {
|
|
26
|
+
result.push({ name: 'Other', tools: otherBucket });
|
|
27
|
+
}
|
|
28
|
+
return result;
|
|
29
|
+
}
|
|
30
|
+
export { groupTools };
|
|
31
|
+
//# sourceMappingURL=tool-groups.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|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
1
|
/** Duration (ms) to display toggle-error alerts before auto-dismissing */
|
|
2
|
-
export declare const ERROR_DISPLAY_DURATION_MS =
|
|
2
|
+
export declare const ERROR_DISPLAY_DURATION_MS = 5000;
|
|
3
3
|
/** Maximum duration (ms) a tool invocation can remain in activeTools before being auto-removed */
|
|
4
4
|
export declare const TOOL_INVOCATION_TIMEOUT_MS: number;
|
|
5
5
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Duration (ms) to display toggle-error alerts before auto-dismissing */
|
|
2
|
-
export const ERROR_DISPLAY_DURATION_MS =
|
|
2
|
+
export const ERROR_DISPLAY_DURATION_MS = 5000;
|
|
3
3
|
/** Maximum duration (ms) a tool invocation can remain in activeTools before being auto-removed */
|
|
4
4
|
export const TOOL_INVOCATION_TIMEOUT_MS = 5 * 60 * 1000;
|
|
5
5
|
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure logic for plugin readiness grouping and transition animations.
|
|
3
|
+
*
|
|
4
|
+
* Extracted from PluginList so it can be tested without React rendering.
|
|
5
|
+
* The React hook in PluginList drives this state machine with timers.
|
|
6
|
+
*/
|
|
7
|
+
import type { TabState } from '@opentabs-dev/shared';
|
|
8
|
+
/** Duration for fade-in animation at the new position (ms) */
|
|
9
|
+
declare const FADE_IN_MS = 200;
|
|
10
|
+
interface GroupablePlugin {
|
|
11
|
+
readonly name: string;
|
|
12
|
+
readonly tabState: TabState;
|
|
13
|
+
}
|
|
14
|
+
interface GroupResult<T extends GroupablePlugin> {
|
|
15
|
+
readonly ready: T[];
|
|
16
|
+
readonly notReady: T[];
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Split plugins into ready and not-ready groups.
|
|
20
|
+
* A plugin is "ready" only when tabState === 'ready'.
|
|
21
|
+
* Both 'unavailable' and 'closed' are not-ready.
|
|
22
|
+
*/
|
|
23
|
+
declare function groupPlugins<T extends GroupablePlugin>(plugins: readonly T[]): GroupResult<T>;
|
|
24
|
+
/**
|
|
25
|
+
* Detect which plugins changed readiness group between two snapshots.
|
|
26
|
+
* Returns the set of plugin names that crossed the ready/not-ready boundary.
|
|
27
|
+
*
|
|
28
|
+
* A plugin that was not present in the previous snapshot is treated as new
|
|
29
|
+
* (no transition). A plugin that disappeared is ignored.
|
|
30
|
+
*/
|
|
31
|
+
declare function detectGroupChanges(prev: ReadonlyMap<string, TabState>, current: readonly GroupablePlugin[]): Set<string>;
|
|
32
|
+
/**
|
|
33
|
+
* Build a snapshot map of plugin name → tabState for change detection.
|
|
34
|
+
*/
|
|
35
|
+
declare function buildStateSnapshot(plugins: readonly GroupablePlugin[]): Map<string, TabState>;
|
|
36
|
+
/**
|
|
37
|
+
* Resolve the CSS class for a plugin that is currently animating.
|
|
38
|
+
* Returns undefined if the plugin is not animating.
|
|
39
|
+
*
|
|
40
|
+
* - Ready group target: full opacity fade-in
|
|
41
|
+
* - Not-ready group target: reduced opacity (0.7) fade-in
|
|
42
|
+
*/
|
|
43
|
+
declare function getTransitionClass(pluginName: string, isReadyGroup: boolean, animating: ReadonlySet<string>): string | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* Remove transitioning plugins from an accordion's open list.
|
|
46
|
+
* When a plugin changes groups, its expanded state must be reset
|
|
47
|
+
* so it arrives collapsed at its new position.
|
|
48
|
+
*
|
|
49
|
+
* Returns the original array (same reference) if nothing was removed,
|
|
50
|
+
* or a new filtered array if any items were removed.
|
|
51
|
+
*/
|
|
52
|
+
declare function collapseTransitioningItems(openItems: readonly string[], animating: ReadonlySet<string>): string[];
|
|
53
|
+
export { FADE_IN_MS, buildStateSnapshot, collapseTransitioningItems, detectGroupChanges, getTransitionClass, groupPlugins, };
|
|
54
|
+
export type { GroupResult, GroupablePlugin };
|
|
55
|
+
//# sourceMappingURL=group-transitions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group-transitions.d.ts","sour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kB,EAClB,YAAY,GACb,CAAC;AACF,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure logic for plugin readiness grouping and transition animations.
|
|
3
|
+
*
|
|
4
|
+
* Extracted from PluginList so it can be tested without React rendering.
|
|
5
|
+
* The React hook in PluginList drives this state machine with timers.
|
|
6
|
+
*/
|
|
7
|
+
/** Duration for fade-in animation at the new position (ms) */
|
|
8
|
+
const FADE_IN_MS = 200;
|
|
9
|
+
/**
|
|
10
|
+
* Split plugins into ready and not-ready groups.
|
|
11
|
+
* A plugin is "ready" only when tabState === 'ready'.
|
|
12
|
+
* Both 'unavailable' and 'closed' are not-ready.
|
|
13
|
+
*/
|
|
14
|
+
function groupPlugins(plugins) {
|
|
15
|
+
const ready = [];
|
|
16
|
+
const notReady = [];
|
|
17
|
+
for (const p of plugins) {
|
|
18
|
+
if (p.tabState === 'ready') {
|
|
19
|
+
ready.push(p);
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
notReady.push(p);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return { ready, notReady };
|
|
26
|
+
}
|
|
27
|
+
// ─── Change detection ────────────────────────────────────────────────────────
|
|
28
|
+
/**
|
|
29
|
+
* Detect which plugins changed readiness group between two snapshots.
|
|
30
|
+
* Returns the set of plugin names that crossed the ready/not-ready boundary.
|
|
31
|
+
*
|
|
32
|
+
* A plugin that was not present in the previous snapshot is treated as new
|
|
33
|
+
* (no transition). A plugin that disappeared is ignored.
|
|
34
|
+
*/
|
|
35
|
+
function detectGroupChanges(prev, current) {
|
|
36
|
+
const changed = new Set();
|
|
37
|
+
for (const plugin of current) {
|
|
38
|
+
const prevState = prev.get(plugin.name);
|
|
39
|
+
if (prevState === undefined)
|
|
40
|
+
continue; // new plugin — no transition
|
|
41
|
+
const wasReady = prevState === 'ready';
|
|
42
|
+
const isReady = plugin.tabState === 'ready';
|
|
43
|
+
if (wasReady !== isReady) {
|
|
44
|
+
changed.add(plugin.name);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return changed;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Build a snapshot map of plugin name → tabState for change detection.
|
|
51
|
+
*/
|
|
52
|
+
function buildStateSnapshot(plugins) {
|
|
53
|
+
return new Map(plugins.map(p => [p.name, p.tabState]));
|
|
54
|
+
}
|
|
55
|
+
// ─── Animation classes ───────────────────────────────────────────────────────
|
|
56
|
+
/**
|
|
57
|
+
* Resolve the CSS class for a plugin that is currently animating.
|
|
58
|
+
* Returns undefined if the plugin is not animating.
|
|
59
|
+
*
|
|
60
|
+
* - Ready group target: full opacity fade-in
|
|
61
|
+
* - Not-ready group target: reduced opacity (0.7) fade-in
|
|
62
|
+
*/
|
|
63
|
+
function getTransitionClass(pluginName, isReadyGroup, animating) {
|
|
64
|
+
if (!animating.has(pluginName))
|
|
65
|
+
return undefined;
|
|
66
|
+
return isReadyGroup ? 'animate-group-fade-in' : 'animate-group-fade-in-dim';
|
|
67
|
+
}
|
|
68
|
+
// ─── Accordion open state ────────────────────────────────────────────────────
|
|
69
|
+
/**
|
|
70
|
+
* Remove transitioning plugins from an accordion's open list.
|
|
71
|
+
* When a plugin changes groups, its expanded state must be reset
|
|
72
|
+
* so it arrives collapsed at its new position.
|
|
73
|
+
*
|
|
74
|
+
* Returns the original array (same reference) if nothing was removed,
|
|
75
|
+
* or a new filtered array if any items were removed.
|
|
76
|
+
*/
|
|
77
|
+
function collapseTransitioningItems(openItems, animating) {
|
|
78
|
+
if (animating.size === 0)
|
|
79
|
+
return openItems;
|
|
80
|
+
const filtered = openItems.filter(name => !animating.has(name));
|
|
81
|
+
return filtered.length === openItems.length ? openItems : filtered;
|
|
82
|
+
}
|
|
83
|
+
export { FADE_IN_MS, buildStateSnapshot, collapseTransitioningItems, detectGroupChanges, getTransitionClass, groupPlugins, };
|
|
84
|
+
//# sourceMappingURL=group-transitions.js.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