@silo-code/sdk 0.38.0 → 0.40.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/dist/MenuButton.d.ts +52 -0
- package/dist/MenuButton.d.ts.map +1 -0
- package/dist/MenuButton.js +47 -0
- package/dist/MenuButton.js.map +1 -0
- package/dist/Section.d.ts +1 -1
- package/dist/Section.d.ts.map +1 -1
- package/dist/domain-types.d.ts +8 -0
- package/dist/domain-types.d.ts.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/layout-service.d.ts +57 -0
- package/dist/layout-service.d.ts.map +1 -1
- package/dist/menu-button-classes.d.ts +15 -0
- package/dist/menu-button-classes.d.ts.map +1 -0
- package/dist/menu-button-classes.js +12 -0
- package/dist/menu-button-classes.js.map +1 -0
- package/dist/system-service.d.ts +21 -0
- package/dist/system-service.d.ts.map +1 -1
- package/dist/ui-service.d.ts +67 -0
- package/dist/ui-service.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/MenuButton.tsx +89 -0
- package/src/Section.tsx +1 -1
- package/src/domain-types.ts +13 -0
- package/src/index.ts +5 -0
- package/src/layout-service.ts +62 -0
- package/src/menu-button-classes.test.ts +15 -0
- package/src/menu-button-classes.ts +19 -0
- package/src/system-service.ts +21 -0
- package/src/ui-service.ts +66 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { ButtonHTMLAttributes, ReactNode } from "react";
|
|
2
|
+
import { type MenuButtonSize } from "./menu-button-classes.js";
|
|
3
|
+
export type { MenuButtonSize };
|
|
4
|
+
/**
|
|
5
|
+
* A **labelled** button that opens a menu — the counterpart to
|
|
6
|
+
* {@link IconButton} for the cases where a bare `⋮` doesn't tell anyone what
|
|
7
|
+
* they'd get. Renders its label with a trailing chevron, the standard signal
|
|
8
|
+
* that pressing it reveals more rather than performing something.
|
|
9
|
+
*
|
|
10
|
+
* Reach for this over `IconButton` whenever the menu is a place a user is
|
|
11
|
+
* *meant* to go rather than an escape hatch: a `⋮` is discoverable only by the
|
|
12
|
+
* people who already know to look. Keep `IconButton` for dense rows and
|
|
13
|
+
* toolbars where a label won't fit.
|
|
14
|
+
*
|
|
15
|
+
* It is the trigger only — it does not own the menu. Open one from `onClick`
|
|
16
|
+
* with {@link UiService.showMenu}, anchoring to `e.currentTarget` so the menu
|
|
17
|
+
* lines up under the button.
|
|
18
|
+
*
|
|
19
|
+
* Styled purely via host-provided `.silo-menu-button*` classes — no stylesheet
|
|
20
|
+
* import is needed in the extension.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* <MenuButton
|
|
25
|
+
* label="More"
|
|
26
|
+
* onClick={(e) =>
|
|
27
|
+
* ctx.ui.showMenu({
|
|
28
|
+
* items: [
|
|
29
|
+
* { id: "disable", label: "Disable", run: disable },
|
|
30
|
+
* { id: "uninstall", label: "Uninstall", run: uninstall },
|
|
31
|
+
* ],
|
|
32
|
+
* at: e.currentTarget,
|
|
33
|
+
* })
|
|
34
|
+
* }
|
|
35
|
+
* />
|
|
36
|
+
*
|
|
37
|
+
* // compact — e.g. in a card footer or a ListRow's trailing slot
|
|
38
|
+
* <MenuButton size="sm" label="More" onClick={openMenu} />
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* @category Consumer Services
|
|
42
|
+
* @public
|
|
43
|
+
*/
|
|
44
|
+
export declare function MenuButton({ label, size, className, type, children, ...rest }: {
|
|
45
|
+
/** The visible label — the whole point of reaching for this over `IconButton`. */
|
|
46
|
+
label: ReactNode;
|
|
47
|
+
/** `sm` for compact contexts (card footers, list rows). */
|
|
48
|
+
size?: MenuButtonSize;
|
|
49
|
+
/** Optional leading content, e.g. an icon before the label. */
|
|
50
|
+
children?: ReactNode;
|
|
51
|
+
} & Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children">): import("react").JSX.Element;
|
|
52
|
+
//# sourceMappingURL=MenuButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MenuButton.d.ts","sourceRoot":"","sources":["../src/MenuButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC7D,OAAO,EAAmB,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE7E,YAAY,EAAE,cAAc,EAAE,CAAC;AAE/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,IAAe,EACf,SAAS,EACT,IAAe,EACf,QAAQ,EACR,GAAG,IAAI,EACR,EAAE;IACD,kFAAkF;IAClF,KAAK,EAAE,SAAS,CAAC;IACjB,2DAA2D;IAC3D,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,GAAG,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,UAAU,CAAC,+BA6B5D"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { menuButtonClass } from "./menu-button-classes.js";
|
|
3
|
+
/**
|
|
4
|
+
* A **labelled** button that opens a menu — the counterpart to
|
|
5
|
+
* {@link IconButton} for the cases where a bare `⋮` doesn't tell anyone what
|
|
6
|
+
* they'd get. Renders its label with a trailing chevron, the standard signal
|
|
7
|
+
* that pressing it reveals more rather than performing something.
|
|
8
|
+
*
|
|
9
|
+
* Reach for this over `IconButton` whenever the menu is a place a user is
|
|
10
|
+
* *meant* to go rather than an escape hatch: a `⋮` is discoverable only by the
|
|
11
|
+
* people who already know to look. Keep `IconButton` for dense rows and
|
|
12
|
+
* toolbars where a label won't fit.
|
|
13
|
+
*
|
|
14
|
+
* It is the trigger only — it does not own the menu. Open one from `onClick`
|
|
15
|
+
* with {@link UiService.showMenu}, anchoring to `e.currentTarget` so the menu
|
|
16
|
+
* lines up under the button.
|
|
17
|
+
*
|
|
18
|
+
* Styled purely via host-provided `.silo-menu-button*` classes — no stylesheet
|
|
19
|
+
* import is needed in the extension.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```tsx
|
|
23
|
+
* <MenuButton
|
|
24
|
+
* label="More"
|
|
25
|
+
* onClick={(e) =>
|
|
26
|
+
* ctx.ui.showMenu({
|
|
27
|
+
* items: [
|
|
28
|
+
* { id: "disable", label: "Disable", run: disable },
|
|
29
|
+
* { id: "uninstall", label: "Uninstall", run: uninstall },
|
|
30
|
+
* ],
|
|
31
|
+
* at: e.currentTarget,
|
|
32
|
+
* })
|
|
33
|
+
* }
|
|
34
|
+
* />
|
|
35
|
+
*
|
|
36
|
+
* // compact — e.g. in a card footer or a ListRow's trailing slot
|
|
37
|
+
* <MenuButton size="sm" label="More" onClick={openMenu} />
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* @category Consumer Services
|
|
41
|
+
* @public
|
|
42
|
+
*/
|
|
43
|
+
export function MenuButton({ label, size = "normal", className, type = "button", children, ...rest }) {
|
|
44
|
+
const classes = menuButtonClass(size);
|
|
45
|
+
return (_jsxs("button", { type: type, className: className ? `${classes} ${className}` : classes, "aria-haspopup": "menu", ...rest, children: [children, _jsx("span", { className: "silo-menu-button-label", children: label }), _jsx("svg", { className: "silo-menu-button-chevron", viewBox: "0 0 16 16", "aria-hidden": "true", children: _jsx("path", { d: "M4 6l4 4 4-4", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })] }));
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=MenuButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MenuButton.js","sourceRoot":"","sources":["../src/MenuButton.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,eAAe,EAAuB,MAAM,uBAAuB,CAAC;AAI7E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,MAAM,UAAU,UAAU,CAAC,EACzB,KAAK,EACL,IAAI,GAAG,QAAQ,EACf,SAAS,EACT,IAAI,GAAG,QAAQ,EACf,QAAQ,EACR,GAAG,IAAI,EAQoD;IAC3D,MAAM,OAAO,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;IACtC,OAAO,CACL,kBACE,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,OAAO,IAAI,SAAS,EAAE,CAAC,CAAC,CAAC,OAAO,mBAG5C,MAAM,KAChB,IAAI,aAEP,QAAQ,EACT,eAAM,SAAS,EAAC,wBAAwB,YAAE,KAAK,GAAQ,EACvD,cACE,SAAS,EAAC,0BAA0B,EACpC,OAAO,EAAC,WAAW,iBACP,MAAM,YAElB,eACE,CAAC,EAAC,cAAc,EAChB,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,WAAW,EAAC,KAAK,EACjB,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,GACtB,GACE,IACC,CACV,CAAC;AACJ,CAAC"}
|
package/dist/Section.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ import type { ReactNode } from "react";
|
|
|
26
26
|
* @public
|
|
27
27
|
*/
|
|
28
28
|
export declare function Section({ label, accessory, children, }: {
|
|
29
|
-
/** Rendered uppercase, letter-spaced, chrome−1, `text-lo`. */
|
|
29
|
+
/** Rendered uppercase, semibold, letter-spaced, chrome−1, `text-lo`. */
|
|
30
30
|
label: string;
|
|
31
31
|
/** Right-aligned — a count badge, an add affordance. */
|
|
32
32
|
accessory?: ReactNode;
|
package/dist/Section.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Section.d.ts","sourceRoot":"","sources":["../src/Section.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,OAAO,CAAC,EACtB,KAAK,EACL,SAAS,EACT,QAAQ,GACT,EAAE;IACD,
|
|
1
|
+
{"version":3,"file":"Section.d.ts","sourceRoot":"","sources":["../src/Section.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,OAAO,CAAC,EACtB,KAAK,EACL,SAAS,EACT,QAAQ,GACT,EAAE;IACD,wEAAwE;IACxE,KAAK,EAAE,MAAM,CAAC;IACd,wDAAwD;IACxD,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,+BAUA"}
|
package/dist/domain-types.d.ts
CHANGED
|
@@ -181,6 +181,7 @@ export interface ThemeVars {
|
|
|
181
181
|
"--silo-color-err": string;
|
|
182
182
|
"--silo-color-input-bg": string;
|
|
183
183
|
"--silo-color-input-text": string;
|
|
184
|
+
"--silo-color-input-border": string;
|
|
184
185
|
"--silo-color-button-bg": string;
|
|
185
186
|
"--silo-color-button-text": string;
|
|
186
187
|
"--silo-color-toolbar-bg": string;
|
|
@@ -189,6 +190,13 @@ export interface ThemeVars {
|
|
|
189
190
|
"--silo-color-toolbar-input-bg": string;
|
|
190
191
|
"--silo-color-content-bg": string;
|
|
191
192
|
"--silo-color-content-text": string;
|
|
193
|
+
"--silo-button-bg": string;
|
|
194
|
+
"--silo-button-text": string;
|
|
195
|
+
"--silo-button-border": string;
|
|
196
|
+
"--silo-button-primary-bg": string;
|
|
197
|
+
"--silo-button-primary-text": string;
|
|
198
|
+
"--silo-button-danger-bg": string;
|
|
199
|
+
"--silo-button-danger-text": string;
|
|
192
200
|
"--silo-font-ui"?: string;
|
|
193
201
|
"--silo-font-mono"?: string;
|
|
194
202
|
"--silo-content-text": string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"domain-types.d.ts","sourceRoot":"","sources":["../src/domain-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,QAAQ,GAAG,IAAI,CAAC;AAErD;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,YAAY,CAAC;IACnB;;;;;;;;;;;OAWG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,uEAAuE;IACvE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,mGAAmG;IACnG,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,MAAM,CAAC;AAEzC;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,8DAA8D;IAC9D,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,kGAAkG;IAClG,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B;;;;;;;;;OASG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,OAAO,GAAG,aAAa,GAAG,cAAc,CAAC;AAE9E;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,SAAS;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AEpC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,wBAAwB,EAAE,MAAM,CAAC;IACjC,qBAAqB,EAAE,MAAM,CAAC;IAC9B,0BAA0B,EAAE,MAAM,CAAC;IAEnC,gBAAgB,EAAE,MAAM,CAAC;IACzB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,2BAA2B,EAAE,MAAM,CAAC;IACpC,oBAAoB,EAAE,MAAM,CAAC;IAE7B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,qBAAqB,EAAE,MAAM,CAAC;IAE9B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,uBAAuB,EAAE,MAAM,CAAC;IAEhC,oBAAoB,EAAE,MAAM,CAAC;IAC7B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,uBAAuB,EAAE,MAAM,CAAC;IAChC,mFAAmF;IACnF,4BAA4B,EAAE,MAAM,CAAC;CACtC;AAED;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX;;;OAGG;IACH,OAAO,EAAE,CAAC,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,SAAS,CAAC;IAChB,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC;IAC9B,IAAI,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;CAC1B;AAED;;;;;;GAMG;AACH,MAAM,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export type { Disposable, DockPanelApi, DockPanelProps, EditorProps, EditorCapab
|
|
|
19
19
|
export type { Workspace, EditorMode, EditorRecord, SidePanelSlot, } from "./domain-types.js";
|
|
20
20
|
export type { WorkspaceService, WorkspaceState, CreateWorkspaceInput, WorkspaceStatusRow, WorkspaceStatusProvider, WorkspaceSectionProps, WorkspaceSectionProvider, WorkspaceBadge, WorkspaceBadgeProvider, WorkspacePropertyPage, WorkspacePropertyPageProps, } from "./workspace-service.js";
|
|
21
21
|
export type { EditorService, EditorSaveHandlers, OpenFileOptions, EditorViewInfo, OpenDiffSpec, DiffContent, DiffContentRequest, DiffContentProvider, ActiveEditorInfo, EditorsState, EditorSaveEvent, } from "./editor-service.js";
|
|
22
|
-
export type { LayoutService, LayoutState, SidePanelColumnState, SideLocation, } from "./layout-service.js";
|
|
22
|
+
export type { LayoutService, LayoutState, SidePanelColumnState, SideLocation, SheetOptions, } from "./layout-service.js";
|
|
23
23
|
export type { ProcessService, ProcessSession, ProcessSpawnOptions, ProcessExecOptions, ProcessExecResult, } from "./process-service.js";
|
|
24
24
|
export type { ProcessesService, ProcessInfo, ProcessStats, ProcessTreeNode, } from "./processes-service.js";
|
|
25
25
|
export type { AgentsService, AgentInfo, AgentActivity } from "./agents-service.js";
|
|
@@ -38,7 +38,7 @@ export type { ThemeService, ThemeState, ThemePreset, ResolvedTheme, ThemeBase, T
|
|
|
38
38
|
export type { ExtensionStorage, ExtensionStorageScopes, } from "./extension-storage.js";
|
|
39
39
|
export type { DndService, DndItem, DndMime, DragInit, DndMode, DropContext, DropTargetHandlers, } from "./dnd-service.js";
|
|
40
40
|
export { DND_MIME } from "./dnd-service.js";
|
|
41
|
-
export type { UiService, FileFilter, MenuItem, MenuItemTrailing, MenuSeparator, MenuHeader, MenuEntry, ShowMenuOptions, ConfirmOptions, PromptOptions, ModalOptions, NotifyAction, NotifyOptions, BusyStatusUrgency, BusyStatusEntry, BusyStatusApi, } from "./ui-service.js";
|
|
41
|
+
export type { UiService, FileFilter, MenuItem, MenuItemTrailing, MenuSeparator, MenuHeader, MenuEntry, ShowMenuOptions, ConfirmOptions, PromptOptions, ModalOptions, ConfirmDontShowAgainMode, ConfirmDontShowAgainOptions, NotifyAction, NotifyOptions, BusyStatusUrgency, BusyStatusEntry, BusyStatusApi, } from "./ui-service.js";
|
|
42
42
|
export { NetworkError } from "./network-service.js";
|
|
43
43
|
export type { NetworkService, NetworkRequestOptions, NetworkResponse, NetworkBytesResponse, } from "./network-service.js";
|
|
44
44
|
export type { WebviewService, WebFrame, WebviewNavType, WebviewNavigateEvent, WebviewRect, PickedElement, } from "./webview-service.js";
|
|
@@ -52,6 +52,8 @@ export { Button } from "./Button.js";
|
|
|
52
52
|
export type { ButtonVariant, ButtonSize } from "./Button.js";
|
|
53
53
|
export { IconButton } from "./IconButton.js";
|
|
54
54
|
export type { IconButtonSize, IconButtonVariant } from "./IconButton.js";
|
|
55
|
+
export { MenuButton } from "./MenuButton.js";
|
|
56
|
+
export type { MenuButtonSize } from "./MenuButton.js";
|
|
55
57
|
export { Input } from "./Input.js";
|
|
56
58
|
export { Textarea } from "./Textarea.js";
|
|
57
59
|
export { SearchInput } from "./SearchInput.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,YAAY,EACV,UAAU,EACV,YAAY,EACZ,cAAc,EACd,WAAW,EACX,kBAAkB,EAClB,MAAM,EACN,eAAe,EACf,QAAQ,EACR,OAAO,EACP,MAAM,EACN,oBAAoB,EACpB,WAAW,EACX,WAAW,EACX,uBAAuB,EACvB,UAAU,EACV,cAAc,EACd,SAAS,EACT,aAAa,EACb,kBAAkB,EAClB,aAAa,EACb,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,SAAS,EACT,iBAAiB,EACjB,eAAe,GAChB,MAAM,SAAS,CAAC;AAKjB,YAAY,EACV,SAAS,EACT,UAAU,EACV,YAAY,EACZ,aAAa,GACd,MAAM,gBAAgB,CAAC;AAGxB,YAAY,EACV,gBAAgB,EAChB,cAAc,EACd,oBAAoB,EACpB,kBAAkB,EAClB,uBAAuB,EACvB,qBAAqB,EACrB,wBAAwB,EACxB,cAAc,EACd,sBAAsB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E,MAAM,mBAAmB,CAAC;AACvE,YAAY,EACV,UAAU,EACV,iBAAiB,EACjB,wBAAwB,EACxB,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,mBAAmB,CAAC;AAK3B,OAAO,EACL,yBAAyB,EACzB,uBAAuB,GACxB,MAAM,0BAA0B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -32,6 +32,7 @@ export { Tooltip } from "./Tooltip.js";
|
|
|
32
32
|
// styled purely via host-provided `.silo-*` classes.
|
|
33
33
|
export { Button } from "./Button.js";
|
|
34
34
|
export { IconButton } from "./IconButton.js";
|
|
35
|
+
export { MenuButton } from "./MenuButton.js";
|
|
35
36
|
export { Input } from "./Input.js";
|
|
36
37
|
export { Textarea } from "./Textarea.js";
|
|
37
38
|
export { SearchInput } from "./SearchInput.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAsHH,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAgChD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AA6BhD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAyBzC,sEAAsE;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAkCjD,8EAA8E;AAC9E,8EAA8E;AAC9E,6DAA6D;AAC7D,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,yEAAyE;AACzE,iFAAiF;AACjF,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,4EAA4E;AAC5E,q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E;AAC9E,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAUvE,6EAA6E;AAC7E,wEAAwE;AACxE,+CAA+C;AAC/C,OAAO,EACL,yBAAyB,EACzB,uBAAuB,GACxB,MAAM,0BAA0B,CAAC"}
|
package/dist/layout-service.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
1
2
|
import type { Disposable } from "./types.js";
|
|
2
3
|
/**
|
|
3
4
|
* Which side column a layout operation targets.
|
|
@@ -26,6 +27,32 @@ export interface LayoutState {
|
|
|
26
27
|
left: SidePanelColumnState;
|
|
27
28
|
right: SidePanelColumnState;
|
|
28
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* Options for {@link LayoutService.openPanelSheet}.
|
|
32
|
+
*
|
|
33
|
+
* @category Consumer Services
|
|
34
|
+
* @public
|
|
35
|
+
*/
|
|
36
|
+
export interface SheetOptions {
|
|
37
|
+
/** Header rendered at the top of the sheet; omit for a bare surface. */
|
|
38
|
+
title?: ReactNode;
|
|
39
|
+
/** Width in CSS px. Omit for the default (~520px). */
|
|
40
|
+
width?: number;
|
|
41
|
+
/**
|
|
42
|
+
* Skip the sheet's own header and body padding — your content *is* the
|
|
43
|
+
* surface, and owns its own chrome (including a close affordance).
|
|
44
|
+
*/
|
|
45
|
+
bare?: boolean;
|
|
46
|
+
/** Extra class on the sheet surface. */
|
|
47
|
+
className?: string;
|
|
48
|
+
/** Accessible name for a sheet without a visible {@link SheetOptions.title}. */
|
|
49
|
+
ariaLabel?: string;
|
|
50
|
+
/**
|
|
51
|
+
* `"overlay"` covers the center dock, `"push"` narrows it so the sheet
|
|
52
|
+
* takes real layout space. Default `"overlay"`.
|
|
53
|
+
*/
|
|
54
|
+
mode?: "overlay" | "push";
|
|
55
|
+
}
|
|
29
56
|
/**
|
|
30
57
|
* Consumer API for app layout, exposed as {@link ExtensionContext.layout}.
|
|
31
58
|
* Read side-panel collapse state and drive it.
|
|
@@ -49,6 +76,36 @@ export interface LayoutService {
|
|
|
49
76
|
* focusing the Search panel). No-op if no panel with that id is registered.
|
|
50
77
|
*/
|
|
51
78
|
revealSidePanel(id: string): void;
|
|
79
|
+
/**
|
|
80
|
+
* Open a host-owned sheet that grows out of the side dock currently hosting
|
|
81
|
+
* `panelId` — reveals that panel first (the same unhide + activate-tab +
|
|
82
|
+
* expand-column work {@link LayoutService.revealSidePanel} does), then
|
|
83
|
+
* slides a sheet out from its side. Never modal: no scrim, `Escape` does
|
|
84
|
+
* nothing, the rest of the workbench stays live and interactive.
|
|
85
|
+
*
|
|
86
|
+
* Like {@link LayoutService.revealSidePanel}, `panelId` isn't restricted to
|
|
87
|
+
* a panel the calling extension itself registered — a status-bar button or
|
|
88
|
+
* command from one extension can open a companion sheet for another's panel.
|
|
89
|
+
*
|
|
90
|
+
* Supply a `render` callback that receives a `close` function and returns
|
|
91
|
+
* the sheet's content; the returned promise resolves (with no value) once
|
|
92
|
+
* the sheet closes. Rejects if `panelId` names no registered
|
|
93
|
+
* {@link SidePanel}.
|
|
94
|
+
*
|
|
95
|
+
* @param panelId - The {@link SidePanel.id} to anchor and reveal.
|
|
96
|
+
* @param render - Returns the sheet's content; receives `close` to settle it.
|
|
97
|
+
* @param opts - Presentation options — see {@link SheetOptions}.
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* ```tsx
|
|
101
|
+
* void ctx.layout.openPanelSheet(
|
|
102
|
+
* "skills",
|
|
103
|
+
* (close) => <BrowseBody onClose={close} />,
|
|
104
|
+
* { title: <BrandMark />, width: 560 },
|
|
105
|
+
* );
|
|
106
|
+
* ```
|
|
107
|
+
*/
|
|
108
|
+
openPanelSheet(panelId: string, render: (close: () => void) => ReactNode, opts?: SheetOptions): Promise<void>;
|
|
52
109
|
/**
|
|
53
110
|
* Open a new tab in the center dock for the given registered
|
|
54
111
|
* {@link DockPanelKind}. Use this to programmatically open a custom panel
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout-service.d.ts","sourceRoot":"","sources":["../src/layout-service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,OAAO,CAAC;AAE5C;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACnC,kDAAkD;IAClD,SAAS,EAAE,OAAO,CAAC;CACpB;AAED;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,oBAAoB,CAAC;IAC3B,KAAK,EAAE,oBAAoB,CAAC;CAC7B;AAED;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC5B,mCAAmC;IACnC,QAAQ,IAAI,WAAW,CAAC;IACxB,oDAAoD;IACpD,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,WAAW,KAAK,IAAI,GAAG,UAAU,CAAC;IAC1D,2DAA2D;IAC3D,eAAe,CAAC,QAAQ,EAAE,YAAY,GAAG,IAAI,CAAC;IAC9C,sDAAsD;IACtD,qBAAqB,CAAC,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAE,OAAO,GAAG,IAAI,CAAC;IACxE;;;;;OAKG;IACH,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC;;;;;;;;;;;;;;;;OAgBG;IACH,SAAS,CACP,MAAM,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,OAAO,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE,GAChC,IAAI,CAAC;IACR;;;;OAIG;IACH,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;CAC5E"}
|
|
1
|
+
{"version":3,"file":"layout-service.d.ts","sourceRoot":"","sources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;;;;;OA4BG;IACH,cAAc,CACZ,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,IAAI,KAAK,SAAS,EACxC,IAAI,CAAC,EAAE,YAAY,GAClB,OAAO,CAAC,IAAI,CAAC,CAAC;IACjB;;;;;;;;;;;;;;;;OAgBG;IACH,SAAS,CACP,MAAM,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,OAAO,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE,GAChC,IAAI,CAAC;IACR;;;;OAIG;IACH,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;CAC5E"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Class-string mapping for {@link MenuButton} — pinned by unit tests so a
|
|
3
|
+
* rename of the host contract classes fails CI (RFC 0016).
|
|
4
|
+
*
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export type MenuButtonSize = "normal" | "sm";
|
|
8
|
+
/**
|
|
9
|
+
* Resolve the host `.silo-menu-button*` class string for a MenuButton's `size`.
|
|
10
|
+
* `sm` composes with the base class, matching how `.silo-button-sm` works.
|
|
11
|
+
*
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
export declare function menuButtonClass(size?: MenuButtonSize): string;
|
|
15
|
+
//# sourceMappingURL=menu-button-classes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu-button-classes.d.ts","sourceRoot":"","sources":["../src/menu-button-classes.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,IAAI,CAAC;AAE7C;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,IAAI,GAAE,cAAyB,GAAG,MAAM,CAIvE"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve the host `.silo-menu-button*` class string for a MenuButton's `size`.
|
|
3
|
+
* `sm` composes with the base class, matching how `.silo-button-sm` works.
|
|
4
|
+
*
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export function menuButtonClass(size = "normal") {
|
|
8
|
+
return size === "sm"
|
|
9
|
+
? "silo-menu-button silo-menu-button-sm"
|
|
10
|
+
: "silo-menu-button";
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=menu-button-classes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu-button-classes.js","sourceRoot":"","sources":["../src/menu-button-classes.ts"],"names":[],"mappings":"AAQA;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,OAAuB,QAAQ;IAC7D,OAAO,IAAI,KAAK,IAAI;QAClB,CAAC,CAAC,sCAAsC;QACxC,CAAC,CAAC,kBAAkB,CAAC;AACzB,CAAC"}
|
package/dist/system-service.d.ts
CHANGED
|
@@ -68,5 +68,26 @@ export interface SystemService {
|
|
|
68
68
|
* call (the result is cached) — safe to `await` in `activate`.
|
|
69
69
|
*/
|
|
70
70
|
getInfo(): Promise<SystemInfo>;
|
|
71
|
+
/**
|
|
72
|
+
* Absolute path of the current user's home directory (`$HOME` on
|
|
73
|
+
* macOS/Linux, `%USERPROFILE%` on Windows). Host-mediated — there's no
|
|
74
|
+
* Node/`os` access in extensions. Resolves immediately after the first call
|
|
75
|
+
* (cached, like {@link SystemService.getInfo}).
|
|
76
|
+
*
|
|
77
|
+
* Returning the path string is not itself a file read: reading or watching
|
|
78
|
+
* anything under it still goes through {@link ExtensionContext.files} and
|
|
79
|
+
* that service's normal permission rules (typically `fs:read` for an
|
|
80
|
+
* untrusted extension).
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* ```ts
|
|
84
|
+
* const home = await ctx.system.homeDir();
|
|
85
|
+
* const skillsDir = path.join(home, ".claude", "skills");
|
|
86
|
+
* if (await ctx.files.pathExists(skillsDir)) {
|
|
87
|
+
* const entries = await ctx.files.readDir(skillsDir);
|
|
88
|
+
* }
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
homeDir(): Promise<string>;
|
|
71
92
|
}
|
|
72
93
|
//# sourceMappingURL=system-service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system-service.d.ts","sourceRoot":"","sources":["../src/system-service.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AACH,MAAM,WAAW,UAAU;IACzB;;;;;;OAMG;IACH,EAAE,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,CAAC;IAClC;;;;;OAKG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,OAAO,IAAI,OAAO,CAAC,UAAU,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"system-service.d.ts","sourceRoot":"","sources":["../src/system-service.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AACH,MAAM,WAAW,UAAU;IACzB;;;;;;OAMG;IACH,EAAE,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,CAAC;IAClC;;;;;OAKG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,OAAO,IAAI,OAAO,CAAC,UAAU,CAAC,CAAC;IAC/B;;;;;;;;;;;;;;;;;;;OAmBG;IACH,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;CAC5B"}
|
package/dist/ui-service.d.ts
CHANGED
|
@@ -191,6 +191,45 @@ export interface ModalOptions {
|
|
|
191
191
|
/** Accessible name for dialogs without a visible {@link ModalOptions.title}. */
|
|
192
192
|
ariaLabel?: string;
|
|
193
193
|
}
|
|
194
|
+
/**
|
|
195
|
+
* Which two-button shape {@link UiService.confirmWithDontShowAgain} renders:
|
|
196
|
+
* `"confirm"` pairs Cancel with a primary/danger button, dismissible (Escape /
|
|
197
|
+
* backdrop resolve like Cancel) — mirrors {@link UiService.confirm}. `"info"`
|
|
198
|
+
* is a single acknowledgement button, not dismissible — there's nothing to
|
|
199
|
+
* cancel, so forcing the explicit click keeps the checkbox's fate unambiguous.
|
|
200
|
+
*
|
|
201
|
+
* @category Core Types
|
|
202
|
+
* @public
|
|
203
|
+
*/
|
|
204
|
+
export type ConfirmDontShowAgainMode = {
|
|
205
|
+
kind: "confirm";
|
|
206
|
+
danger?: boolean;
|
|
207
|
+
} | {
|
|
208
|
+
kind: "info";
|
|
209
|
+
};
|
|
210
|
+
/**
|
|
211
|
+
* Options for {@link UiService.confirmWithDontShowAgain}.
|
|
212
|
+
*
|
|
213
|
+
* @category Core Types
|
|
214
|
+
* @public
|
|
215
|
+
*/
|
|
216
|
+
export interface ConfirmDontShowAgainOptions {
|
|
217
|
+
/**
|
|
218
|
+
* Key in the **calling extension's** global storage
|
|
219
|
+
* ({@link ExtensionContext.storage}`.global`) that remembers the user opted
|
|
220
|
+
* out. The host binds storage to the caller — you don't pass an
|
|
221
|
+
* `ExtensionStorage` handle yourself.
|
|
222
|
+
*/
|
|
223
|
+
storageKey: string;
|
|
224
|
+
/** The dialog's heading. */
|
|
225
|
+
title: string;
|
|
226
|
+
/** Explanatory body text. */
|
|
227
|
+
body: string;
|
|
228
|
+
/** Label for the confirm/acknowledge button. */
|
|
229
|
+
confirmLabel: string;
|
|
230
|
+
/** Which two-button shape to render — see {@link ConfirmDontShowAgainMode}. */
|
|
231
|
+
mode: ConfirmDontShowAgainMode;
|
|
232
|
+
}
|
|
194
233
|
/**
|
|
195
234
|
* A horizontal rule between groups of menu items.
|
|
196
235
|
*
|
|
@@ -437,6 +476,34 @@ export interface UiService {
|
|
|
437
476
|
* ```
|
|
438
477
|
*/
|
|
439
478
|
showModal<T = void>(render: (close: (result?: T) => void) => ReactNode, options?: ModalOptions): Promise<T | undefined>;
|
|
479
|
+
/**
|
|
480
|
+
* Pop a confirm/info dialog with a persisted "Don't show this again"
|
|
481
|
+
* checkbox — the one shape {@link UiService.confirm} has no room for. If
|
|
482
|
+
* `opts.storageKey` is already set in the calling extension's global
|
|
483
|
+
* storage, resolves `true` immediately without opening anything.
|
|
484
|
+
*
|
|
485
|
+
* Cancelling (or dismissing, in `"confirm"` mode) never persists the
|
|
486
|
+
* checkbox, even if it was checked — so an accidental cancel can't silently
|
|
487
|
+
* suppress a safety warning for good. Proceeding persists it iff it was
|
|
488
|
+
* checked.
|
|
489
|
+
*
|
|
490
|
+
* @param opts - See {@link ConfirmDontShowAgainOptions}.
|
|
491
|
+
* @returns `true` if the user proceeded (or the dialog was already
|
|
492
|
+
* suppressed), `false` on cancel/dismiss.
|
|
493
|
+
*
|
|
494
|
+
* @example
|
|
495
|
+
* ```ts
|
|
496
|
+
* const ok = await ctx.ui.confirmWithDontShowAgain({
|
|
497
|
+
* storageKey: "installSkill.dontShowAgain",
|
|
498
|
+
* title: "Install skill?",
|
|
499
|
+
* body: `This runs ${cmd} in a new terminal.`,
|
|
500
|
+
* confirmLabel: "Install",
|
|
501
|
+
* mode: { kind: "confirm" },
|
|
502
|
+
* });
|
|
503
|
+
* if (ok) runInstall();
|
|
504
|
+
* ```
|
|
505
|
+
*/
|
|
506
|
+
confirmWithDontShowAgain(opts: ConfirmDontShowAgainOptions): Promise<boolean>;
|
|
440
507
|
/**
|
|
441
508
|
* Hand a URL to the operating system — open an `http`/`https` link in the
|
|
442
509
|
* user's default browser, or a `mailto:` link in their mail client. The host
|
package/dist/ui-service.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file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AAK,EAAE,eAAe,GAAG,UAAU,CAAC;IACxC,8BAA8B;IAC9B,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import type { ButtonHTMLAttributes, ReactNode } from "react";
|
|
2
|
+
import { menuButtonClass, type MenuButtonSize } from "./menu-button-classes";
|
|
3
|
+
|
|
4
|
+
export type { MenuButtonSize };
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A **labelled** button that opens a menu — the counterpart to
|
|
8
|
+
* {@link IconButton} for the cases where a bare `⋮` doesn't tell anyone what
|
|
9
|
+
* they'd get. Renders its label with a trailing chevron, the standard signal
|
|
10
|
+
* that pressing it reveals more rather than performing something.
|
|
11
|
+
*
|
|
12
|
+
* Reach for this over `IconButton` whenever the menu is a place a user is
|
|
13
|
+
* *meant* to go rather than an escape hatch: a `⋮` is discoverable only by the
|
|
14
|
+
* people who already know to look. Keep `IconButton` for dense rows and
|
|
15
|
+
* toolbars where a label won't fit.
|
|
16
|
+
*
|
|
17
|
+
* It is the trigger only — it does not own the menu. Open one from `onClick`
|
|
18
|
+
* with {@link UiService.showMenu}, anchoring to `e.currentTarget` so the menu
|
|
19
|
+
* lines up under the button.
|
|
20
|
+
*
|
|
21
|
+
* Styled purely via host-provided `.silo-menu-button*` classes — no stylesheet
|
|
22
|
+
* import is needed in the extension.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```tsx
|
|
26
|
+
* <MenuButton
|
|
27
|
+
* label="More"
|
|
28
|
+
* onClick={(e) =>
|
|
29
|
+
* ctx.ui.showMenu({
|
|
30
|
+
* items: [
|
|
31
|
+
* { id: "disable", label: "Disable", run: disable },
|
|
32
|
+
* { id: "uninstall", label: "Uninstall", run: uninstall },
|
|
33
|
+
* ],
|
|
34
|
+
* at: e.currentTarget,
|
|
35
|
+
* })
|
|
36
|
+
* }
|
|
37
|
+
* />
|
|
38
|
+
*
|
|
39
|
+
* // compact — e.g. in a card footer or a ListRow's trailing slot
|
|
40
|
+
* <MenuButton size="sm" label="More" onClick={openMenu} />
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* @category Consumer Services
|
|
44
|
+
* @public
|
|
45
|
+
*/
|
|
46
|
+
export function MenuButton({
|
|
47
|
+
label,
|
|
48
|
+
size = "normal",
|
|
49
|
+
className,
|
|
50
|
+
type = "button",
|
|
51
|
+
children,
|
|
52
|
+
...rest
|
|
53
|
+
}: {
|
|
54
|
+
/** The visible label — the whole point of reaching for this over `IconButton`. */
|
|
55
|
+
label: ReactNode;
|
|
56
|
+
/** `sm` for compact contexts (card footers, list rows). */
|
|
57
|
+
size?: MenuButtonSize;
|
|
58
|
+
/** Optional leading content, e.g. an icon before the label. */
|
|
59
|
+
children?: ReactNode;
|
|
60
|
+
} & Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children">) {
|
|
61
|
+
const classes = menuButtonClass(size);
|
|
62
|
+
return (
|
|
63
|
+
<button
|
|
64
|
+
type={type}
|
|
65
|
+
className={className ? `${classes} ${className}` : classes}
|
|
66
|
+
// The chevron is decorative — the label already names the control, and
|
|
67
|
+
// announcing "down arrow" after it would be noise.
|
|
68
|
+
aria-haspopup="menu"
|
|
69
|
+
{...rest}
|
|
70
|
+
>
|
|
71
|
+
{children}
|
|
72
|
+
<span className="silo-menu-button-label">{label}</span>
|
|
73
|
+
<svg
|
|
74
|
+
className="silo-menu-button-chevron"
|
|
75
|
+
viewBox="0 0 16 16"
|
|
76
|
+
aria-hidden="true"
|
|
77
|
+
>
|
|
78
|
+
<path
|
|
79
|
+
d="M4 6l4 4 4-4"
|
|
80
|
+
fill="none"
|
|
81
|
+
stroke="currentColor"
|
|
82
|
+
strokeWidth="1.5"
|
|
83
|
+
strokeLinecap="round"
|
|
84
|
+
strokeLinejoin="round"
|
|
85
|
+
/>
|
|
86
|
+
</svg>
|
|
87
|
+
</button>
|
|
88
|
+
);
|
|
89
|
+
}
|
package/src/Section.tsx
CHANGED
|
@@ -31,7 +31,7 @@ export function Section({
|
|
|
31
31
|
accessory,
|
|
32
32
|
children,
|
|
33
33
|
}: {
|
|
34
|
-
/** Rendered uppercase, letter-spaced, chrome−1, `text-lo`. */
|
|
34
|
+
/** Rendered uppercase, semibold, letter-spaced, chrome−1, `text-lo`. */
|
|
35
35
|
label: string;
|
|
36
36
|
/** Right-aligned — a count badge, an add affordance. */
|
|
37
37
|
accessory?: ReactNode;
|
package/src/domain-types.ts
CHANGED
|
@@ -190,6 +190,7 @@ export interface ThemeVars {
|
|
|
190
190
|
"--silo-color-err": string;
|
|
191
191
|
"--silo-color-input-bg": string;
|
|
192
192
|
"--silo-color-input-text": string;
|
|
193
|
+
"--silo-color-input-border": string;
|
|
193
194
|
"--silo-color-button-bg": string;
|
|
194
195
|
"--silo-color-button-text": string;
|
|
195
196
|
// ── Design tokens — toolbar surface (panel header bars) ──
|
|
@@ -200,6 +201,18 @@ export interface ThemeVars {
|
|
|
200
201
|
// ── Design tokens — content viewport surface (editor, terminal, viewer panels) ──
|
|
201
202
|
"--silo-color-content-bg": string;
|
|
202
203
|
"--silo-color-content-text": string;
|
|
204
|
+
// ── Design tokens — button treatment (themeable, per theme.css) ──
|
|
205
|
+
// A theme can restyle buttons without moving the global accent. Chiefly
|
|
206
|
+
// `--silo-button-primary-text`: dark's default paints the primary label in
|
|
207
|
+
// the page background because its accent is a light neutral, so a theme with
|
|
208
|
+
// a *dark* or saturated accent has to set white back.
|
|
209
|
+
"--silo-button-bg": string;
|
|
210
|
+
"--silo-button-text": string;
|
|
211
|
+
"--silo-button-border": string;
|
|
212
|
+
"--silo-button-primary-bg": string;
|
|
213
|
+
"--silo-button-primary-text": string;
|
|
214
|
+
"--silo-button-danger-bg": string;
|
|
215
|
+
"--silo-button-danger-text": string;
|
|
203
216
|
// ── Design tokens — font families ──
|
|
204
217
|
"--silo-font-ui"?: string;
|
|
205
218
|
"--silo-font-mono"?: string;
|
package/src/index.ts
CHANGED
|
@@ -88,6 +88,7 @@ export type {
|
|
|
88
88
|
LayoutState,
|
|
89
89
|
SidePanelColumnState,
|
|
90
90
|
SideLocation,
|
|
91
|
+
SheetOptions,
|
|
91
92
|
} from "./layout-service";
|
|
92
93
|
export type {
|
|
93
94
|
ProcessService,
|
|
@@ -209,6 +210,8 @@ export type {
|
|
|
209
210
|
ConfirmOptions,
|
|
210
211
|
PromptOptions,
|
|
211
212
|
ModalOptions,
|
|
213
|
+
ConfirmDontShowAgainMode,
|
|
214
|
+
ConfirmDontShowAgainOptions,
|
|
212
215
|
NotifyAction,
|
|
213
216
|
NotifyOptions,
|
|
214
217
|
BusyStatusUrgency,
|
|
@@ -266,6 +269,8 @@ export { Button } from "./Button";
|
|
|
266
269
|
export type { ButtonVariant, ButtonSize } from "./Button";
|
|
267
270
|
export { IconButton } from "./IconButton";
|
|
268
271
|
export type { IconButtonSize, IconButtonVariant } from "./IconButton";
|
|
272
|
+
export { MenuButton } from "./MenuButton";
|
|
273
|
+
export type { MenuButtonSize } from "./MenuButton";
|
|
269
274
|
export { Input } from "./Input";
|
|
270
275
|
export { Textarea } from "./Textarea";
|
|
271
276
|
export { SearchInput } from "./SearchInput";
|
package/src/layout-service.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
1
2
|
import type { Disposable } from "./types";
|
|
2
3
|
|
|
3
4
|
/**
|
|
@@ -30,6 +31,33 @@ export interface LayoutState {
|
|
|
30
31
|
right: SidePanelColumnState;
|
|
31
32
|
}
|
|
32
33
|
|
|
34
|
+
/**
|
|
35
|
+
* Options for {@link LayoutService.openPanelSheet}.
|
|
36
|
+
*
|
|
37
|
+
* @category Consumer Services
|
|
38
|
+
* @public
|
|
39
|
+
*/
|
|
40
|
+
export interface SheetOptions {
|
|
41
|
+
/** Header rendered at the top of the sheet; omit for a bare surface. */
|
|
42
|
+
title?: ReactNode;
|
|
43
|
+
/** Width in CSS px. Omit for the default (~520px). */
|
|
44
|
+
width?: number;
|
|
45
|
+
/**
|
|
46
|
+
* Skip the sheet's own header and body padding — your content *is* the
|
|
47
|
+
* surface, and owns its own chrome (including a close affordance).
|
|
48
|
+
*/
|
|
49
|
+
bare?: boolean;
|
|
50
|
+
/** Extra class on the sheet surface. */
|
|
51
|
+
className?: string;
|
|
52
|
+
/** Accessible name for a sheet without a visible {@link SheetOptions.title}. */
|
|
53
|
+
ariaLabel?: string;
|
|
54
|
+
/**
|
|
55
|
+
* `"overlay"` covers the center dock, `"push"` narrows it so the sheet
|
|
56
|
+
* takes real layout space. Default `"overlay"`.
|
|
57
|
+
*/
|
|
58
|
+
mode?: "overlay" | "push";
|
|
59
|
+
}
|
|
60
|
+
|
|
33
61
|
/**
|
|
34
62
|
* Consumer API for app layout, exposed as {@link ExtensionContext.layout}.
|
|
35
63
|
* Read side-panel collapse state and drive it.
|
|
@@ -53,6 +81,40 @@ export interface LayoutService {
|
|
|
53
81
|
* focusing the Search panel). No-op if no panel with that id is registered.
|
|
54
82
|
*/
|
|
55
83
|
revealSidePanel(id: string): void;
|
|
84
|
+
/**
|
|
85
|
+
* Open a host-owned sheet that grows out of the side dock currently hosting
|
|
86
|
+
* `panelId` — reveals that panel first (the same unhide + activate-tab +
|
|
87
|
+
* expand-column work {@link LayoutService.revealSidePanel} does), then
|
|
88
|
+
* slides a sheet out from its side. Never modal: no scrim, `Escape` does
|
|
89
|
+
* nothing, the rest of the workbench stays live and interactive.
|
|
90
|
+
*
|
|
91
|
+
* Like {@link LayoutService.revealSidePanel}, `panelId` isn't restricted to
|
|
92
|
+
* a panel the calling extension itself registered — a status-bar button or
|
|
93
|
+
* command from one extension can open a companion sheet for another's panel.
|
|
94
|
+
*
|
|
95
|
+
* Supply a `render` callback that receives a `close` function and returns
|
|
96
|
+
* the sheet's content; the returned promise resolves (with no value) once
|
|
97
|
+
* the sheet closes. Rejects if `panelId` names no registered
|
|
98
|
+
* {@link SidePanel}.
|
|
99
|
+
*
|
|
100
|
+
* @param panelId - The {@link SidePanel.id} to anchor and reveal.
|
|
101
|
+
* @param render - Returns the sheet's content; receives `close` to settle it.
|
|
102
|
+
* @param opts - Presentation options — see {@link SheetOptions}.
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* ```tsx
|
|
106
|
+
* void ctx.layout.openPanelSheet(
|
|
107
|
+
* "skills",
|
|
108
|
+
* (close) => <BrowseBody onClose={close} />,
|
|
109
|
+
* { title: <BrandMark />, width: 560 },
|
|
110
|
+
* );
|
|
111
|
+
* ```
|
|
112
|
+
*/
|
|
113
|
+
openPanelSheet(
|
|
114
|
+
panelId: string,
|
|
115
|
+
render: (close: () => void) => ReactNode,
|
|
116
|
+
opts?: SheetOptions,
|
|
117
|
+
): Promise<void>;
|
|
56
118
|
/**
|
|
57
119
|
* Open a new tab in the center dock for the given registered
|
|
58
120
|
* {@link DockPanelKind}. Use this to programmatically open a custom panel
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { menuButtonClass } from "./menu-button-classes";
|
|
3
|
+
|
|
4
|
+
// Pins the host contract classes (components.css) so renaming one fails here
|
|
5
|
+
// rather than silently unstyling every extension's menu triggers.
|
|
6
|
+
describe("menuButtonClass", () => {
|
|
7
|
+
it("defaults to the base class", () => {
|
|
8
|
+
expect(menuButtonClass()).toBe("silo-menu-button");
|
|
9
|
+
expect(menuButtonClass("normal")).toBe("silo-menu-button");
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it("composes the compact modifier onto the base, like .silo-button-sm", () => {
|
|
13
|
+
expect(menuButtonClass("sm")).toBe("silo-menu-button silo-menu-button-sm");
|
|
14
|
+
});
|
|
15
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Class-string mapping for {@link MenuButton} — pinned by unit tests so a
|
|
3
|
+
* rename of the host contract classes fails CI (RFC 0016).
|
|
4
|
+
*
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export type MenuButtonSize = "normal" | "sm";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Resolve the host `.silo-menu-button*` class string for a MenuButton's `size`.
|
|
11
|
+
* `sm` composes with the base class, matching how `.silo-button-sm` works.
|
|
12
|
+
*
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
export function menuButtonClass(size: MenuButtonSize = "normal"): string {
|
|
16
|
+
return size === "sm"
|
|
17
|
+
? "silo-menu-button silo-menu-button-sm"
|
|
18
|
+
: "silo-menu-button";
|
|
19
|
+
}
|
package/src/system-service.ts
CHANGED
|
@@ -73,4 +73,25 @@ export interface SystemService {
|
|
|
73
73
|
* call (the result is cached) — safe to `await` in `activate`.
|
|
74
74
|
*/
|
|
75
75
|
getInfo(): Promise<SystemInfo>;
|
|
76
|
+
/**
|
|
77
|
+
* Absolute path of the current user's home directory (`$HOME` on
|
|
78
|
+
* macOS/Linux, `%USERPROFILE%` on Windows). Host-mediated — there's no
|
|
79
|
+
* Node/`os` access in extensions. Resolves immediately after the first call
|
|
80
|
+
* (cached, like {@link SystemService.getInfo}).
|
|
81
|
+
*
|
|
82
|
+
* Returning the path string is not itself a file read: reading or watching
|
|
83
|
+
* anything under it still goes through {@link ExtensionContext.files} and
|
|
84
|
+
* that service's normal permission rules (typically `fs:read` for an
|
|
85
|
+
* untrusted extension).
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```ts
|
|
89
|
+
* const home = await ctx.system.homeDir();
|
|
90
|
+
* const skillsDir = path.join(home, ".claude", "skills");
|
|
91
|
+
* if (await ctx.files.pathExists(skillsDir)) {
|
|
92
|
+
* const entries = await ctx.files.readDir(skillsDir);
|
|
93
|
+
* }
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
96
|
+
homeDir(): Promise<string>;
|
|
76
97
|
}
|
package/src/ui-service.ts
CHANGED
|
@@ -204,6 +204,44 @@ export interface ModalOptions {
|
|
|
204
204
|
ariaLabel?: string;
|
|
205
205
|
}
|
|
206
206
|
|
|
207
|
+
/**
|
|
208
|
+
* Which two-button shape {@link UiService.confirmWithDontShowAgain} renders:
|
|
209
|
+
* `"confirm"` pairs Cancel with a primary/danger button, dismissible (Escape /
|
|
210
|
+
* backdrop resolve like Cancel) — mirrors {@link UiService.confirm}. `"info"`
|
|
211
|
+
* is a single acknowledgement button, not dismissible — there's nothing to
|
|
212
|
+
* cancel, so forcing the explicit click keeps the checkbox's fate unambiguous.
|
|
213
|
+
*
|
|
214
|
+
* @category Core Types
|
|
215
|
+
* @public
|
|
216
|
+
*/
|
|
217
|
+
export type ConfirmDontShowAgainMode =
|
|
218
|
+
| { kind: "confirm"; danger?: boolean }
|
|
219
|
+
| { kind: "info" };
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Options for {@link UiService.confirmWithDontShowAgain}.
|
|
223
|
+
*
|
|
224
|
+
* @category Core Types
|
|
225
|
+
* @public
|
|
226
|
+
*/
|
|
227
|
+
export interface ConfirmDontShowAgainOptions {
|
|
228
|
+
/**
|
|
229
|
+
* Key in the **calling extension's** global storage
|
|
230
|
+
* ({@link ExtensionContext.storage}`.global`) that remembers the user opted
|
|
231
|
+
* out. The host binds storage to the caller — you don't pass an
|
|
232
|
+
* `ExtensionStorage` handle yourself.
|
|
233
|
+
*/
|
|
234
|
+
storageKey: string;
|
|
235
|
+
/** The dialog's heading. */
|
|
236
|
+
title: string;
|
|
237
|
+
/** Explanatory body text. */
|
|
238
|
+
body: string;
|
|
239
|
+
/** Label for the confirm/acknowledge button. */
|
|
240
|
+
confirmLabel: string;
|
|
241
|
+
/** Which two-button shape to render — see {@link ConfirmDontShowAgainMode}. */
|
|
242
|
+
mode: ConfirmDontShowAgainMode;
|
|
243
|
+
}
|
|
244
|
+
|
|
207
245
|
/**
|
|
208
246
|
* A horizontal rule between groups of menu items.
|
|
209
247
|
*
|
|
@@ -456,6 +494,34 @@ export interface UiService {
|
|
|
456
494
|
render: (close: (result?: T) => void) => ReactNode,
|
|
457
495
|
options?: ModalOptions,
|
|
458
496
|
): Promise<T | undefined>;
|
|
497
|
+
/**
|
|
498
|
+
* Pop a confirm/info dialog with a persisted "Don't show this again"
|
|
499
|
+
* checkbox — the one shape {@link UiService.confirm} has no room for. If
|
|
500
|
+
* `opts.storageKey` is already set in the calling extension's global
|
|
501
|
+
* storage, resolves `true` immediately without opening anything.
|
|
502
|
+
*
|
|
503
|
+
* Cancelling (or dismissing, in `"confirm"` mode) never persists the
|
|
504
|
+
* checkbox, even if it was checked — so an accidental cancel can't silently
|
|
505
|
+
* suppress a safety warning for good. Proceeding persists it iff it was
|
|
506
|
+
* checked.
|
|
507
|
+
*
|
|
508
|
+
* @param opts - See {@link ConfirmDontShowAgainOptions}.
|
|
509
|
+
* @returns `true` if the user proceeded (or the dialog was already
|
|
510
|
+
* suppressed), `false` on cancel/dismiss.
|
|
511
|
+
*
|
|
512
|
+
* @example
|
|
513
|
+
* ```ts
|
|
514
|
+
* const ok = await ctx.ui.confirmWithDontShowAgain({
|
|
515
|
+
* storageKey: "installSkill.dontShowAgain",
|
|
516
|
+
* title: "Install skill?",
|
|
517
|
+
* body: `This runs ${cmd} in a new terminal.`,
|
|
518
|
+
* confirmLabel: "Install",
|
|
519
|
+
* mode: { kind: "confirm" },
|
|
520
|
+
* });
|
|
521
|
+
* if (ok) runInstall();
|
|
522
|
+
* ```
|
|
523
|
+
*/
|
|
524
|
+
confirmWithDontShowAgain(opts: ConfirmDontShowAgainOptions): Promise<boolean>;
|
|
459
525
|
/**
|
|
460
526
|
* Hand a URL to the operating system — open an `http`/`https` link in the
|
|
461
527
|
* user's default browser, or a `mailto:` link in their mail client. The host
|