@silo-code/sdk 0.6.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/Tooltip.d.ts +29 -0
- package/dist/Tooltip.d.ts.map +1 -0
- package/dist/Tooltip.js +68 -0
- package/dist/Tooltip.js.map +1 -0
- package/dist/domain-types.d.ts +6 -6
- package/dist/domain-types.d.ts.map +1 -1
- package/dist/editor-service.d.ts +18 -0
- package/dist/editor-service.d.ts.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/layout-service.d.ts +19 -0
- package/dist/layout-service.d.ts.map +1 -1
- package/dist/search-service.d.ts +117 -0
- package/dist/search-service.d.ts.map +1 -0
- package/dist/search-service.js +6 -0
- package/dist/search-service.js.map +1 -0
- package/dist/types.d.ts +76 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/ui-service.d.ts +15 -0
- package/dist/ui-service.d.ts.map +1 -1
- package/package.json +4 -2
- package/src/Tooltip.tsx +116 -0
- package/src/domain-types.ts +8 -7
- package/src/editor-service.ts +18 -0
- package/src/index.ts +14 -0
- package/src/layout-service.ts +19 -0
- package/src/search-service.ts +125 -0
- package/src/types.ts +79 -0
- package/src/ui-service.ts +15 -0
package/README.md
CHANGED
|
@@ -58,10 +58,10 @@ exactly this surface — no more, no less.
|
|
|
58
58
|
|
|
59
59
|
## Docs
|
|
60
60
|
|
|
61
|
-
- **Guide:** [Your first extension](https://
|
|
62
|
-
· [Publishing an extension](https://
|
|
61
|
+
- **Guide:** [Your first extension](https://silo.dev/guide/getting-started)
|
|
62
|
+
· [Publishing an extension](https://silo.dev/guide/publishing-an-extension)
|
|
63
63
|
- **API reference:** generated from this package — see the
|
|
64
|
-
[docs site](https://
|
|
64
|
+
[docs site](https://silo.dev/).
|
|
65
65
|
- **Examples:** [`examples/extensions`](https://github.com/silo-code/silo/tree/main/examples/extensions).
|
|
66
66
|
|
|
67
67
|
## License
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Lightweight tooltip — wraps any trigger element and shows a styled popup
|
|
4
|
+
* above it after a 600 ms hover delay. Renders via a portal so `overflow:
|
|
5
|
+
* hidden` parents and stacking contexts never clip it.
|
|
6
|
+
*
|
|
7
|
+
* The popup uses the host's design tokens and matches the status-bar tooltip
|
|
8
|
+
* style exactly. Display-only: `pointer-events: none`.
|
|
9
|
+
*
|
|
10
|
+
* The CSS classes (`.silo-tooltip`, `.silo-tooltip-host`) are provided by the
|
|
11
|
+
* host — no stylesheet import is needed in the extension.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* <Tooltip content="New File">
|
|
16
|
+
* <button onClick={createFile}>
|
|
17
|
+
* <FilePlus size="1.2em" />
|
|
18
|
+
* </button>
|
|
19
|
+
* </Tooltip>
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @category Core Types
|
|
23
|
+
* @public
|
|
24
|
+
*/
|
|
25
|
+
export declare function Tooltip({ content, children, }: {
|
|
26
|
+
content: string;
|
|
27
|
+
children: ReactNode;
|
|
28
|
+
}): import("react").JSX.Element;
|
|
29
|
+
//# sourceMappingURL=Tooltip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../src/Tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAO1E;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,OAAO,CAAC,EACtB,OAAO,EACP,QAAQ,GACT,EAAE;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,SAAS,CAAC;CACrB,+BA0CA"}
|
package/dist/Tooltip.js
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useLayoutEffect, useRef, useState } from "react";
|
|
3
|
+
import { createPortal } from "react-dom";
|
|
4
|
+
const DELAY_MS = 600;
|
|
5
|
+
const GAP_PX = 6;
|
|
6
|
+
const MARGIN_PX = 8;
|
|
7
|
+
/**
|
|
8
|
+
* Lightweight tooltip — wraps any trigger element and shows a styled popup
|
|
9
|
+
* above it after a 600 ms hover delay. Renders via a portal so `overflow:
|
|
10
|
+
* hidden` parents and stacking contexts never clip it.
|
|
11
|
+
*
|
|
12
|
+
* The popup uses the host's design tokens and matches the status-bar tooltip
|
|
13
|
+
* style exactly. Display-only: `pointer-events: none`.
|
|
14
|
+
*
|
|
15
|
+
* The CSS classes (`.silo-tooltip`, `.silo-tooltip-host`) are provided by the
|
|
16
|
+
* host — no stylesheet import is needed in the extension.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* <Tooltip content="New File">
|
|
21
|
+
* <button onClick={createFile}>
|
|
22
|
+
* <FilePlus size="1.2em" />
|
|
23
|
+
* </button>
|
|
24
|
+
* </Tooltip>
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @category Core Types
|
|
28
|
+
* @public
|
|
29
|
+
*/
|
|
30
|
+
export function Tooltip({ content, children, }) {
|
|
31
|
+
const ref = useRef(null);
|
|
32
|
+
const [anchor, setAnchor] = useState(null);
|
|
33
|
+
const timer = useRef(null);
|
|
34
|
+
const show = () => {
|
|
35
|
+
timer.current = setTimeout(() => {
|
|
36
|
+
const r = ref.current?.getBoundingClientRect();
|
|
37
|
+
if (r)
|
|
38
|
+
setAnchor({ cx: r.left + r.width / 2, top: r.top - GAP_PX });
|
|
39
|
+
}, DELAY_MS);
|
|
40
|
+
};
|
|
41
|
+
const hide = () => {
|
|
42
|
+
if (timer.current) {
|
|
43
|
+
clearTimeout(timer.current);
|
|
44
|
+
timer.current = null;
|
|
45
|
+
}
|
|
46
|
+
setAnchor(null);
|
|
47
|
+
};
|
|
48
|
+
return (_jsxs("span", { ref: ref, className: "silo-tooltip-host", onMouseEnter: show, onMouseLeave: hide, onPointerDown: hide, children: [children, anchor &&
|
|
49
|
+
createPortal(_jsx(TooltipPopup, { content: content, cx: anchor.cx, anchorTop: anchor.top }), document.body)] }));
|
|
50
|
+
}
|
|
51
|
+
function TooltipPopup({ content, cx, anchorTop, }) {
|
|
52
|
+
const popupRef = useRef(null);
|
|
53
|
+
const [style, setStyle] = useState({
|
|
54
|
+
visibility: "hidden",
|
|
55
|
+
});
|
|
56
|
+
useLayoutEffect(() => {
|
|
57
|
+
const el = popupRef.current;
|
|
58
|
+
if (!el)
|
|
59
|
+
return;
|
|
60
|
+
const w = el.offsetWidth;
|
|
61
|
+
const h = el.offsetHeight;
|
|
62
|
+
const left = Math.max(MARGIN_PX, Math.min(cx - w / 2, window.innerWidth - w - MARGIN_PX));
|
|
63
|
+
const top = anchorTop - h < MARGIN_PX ? anchorTop + GAP_PX * 2 : anchorTop - h;
|
|
64
|
+
setStyle({ left, top, visibility: "visible" });
|
|
65
|
+
}, [cx, anchorTop]);
|
|
66
|
+
return (_jsx("div", { ref: popupRef, className: "silo-tooltip", style: style, children: content }));
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=Tooltip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tooltip.js","sourceRoot":"","sources":["../src/Tooltip.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,MAAM,QAAQ,GAAG,GAAG,CAAC;AACrB,MAAM,MAAM,GAAG,CAAC,CAAC;AACjB,MAAM,SAAS,GAAG,CAAC,CAAC;AAEpB;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAC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AAY,CAAC,EACpB,OAAO,EACP,EAAE,EACF,SAAS,GAKV;IACC,MAAM,QAAQ,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAC9C,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAsB;QACtD,UAAU,EAAE,QAAQ;KACrB,CAAC,CAAC;IAEH,eAAe,CAAC,GAAG,EAAE;QACnB,MAAM,EAAE,GAAG,QAAQ,CAAC,OAAO,CAAC;QAC5B,IAAI,CAAC,EAAE;YAAE,OAAO;QAChB,MAAM,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC;QACzB,MAAM,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC;QAE1B,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CACnB,SAAS,EACT,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,GAAG,CAAC,GAAG,SAAS,CAAC,CACxD,CAAC;QACF,MAAM,GAAG,GACP,SAAS,GAAG,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,SAAS,GAAG,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC;QAErE,QAAQ,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC,CAAC;IACjD,CAAC,EAAE,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC,CAAC;IAEpB,OAAO,CACL,cAAK,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAC,cAAc,EAAC,KAAK,EAAE,KAAK,YACtD,OAAO,GACJ,CACP,CAAC;AACJ,CAAC"}
|
package/dist/domain-types.d.ts
CHANGED
|
@@ -130,8 +130,6 @@ export interface Workspace {
|
|
|
130
130
|
activeSidePanelTabs?: Record<string, string>;
|
|
131
131
|
sidePanelScrollPositions?: Record<string, number>;
|
|
132
132
|
extensionState?: Record<string, Record<string, unknown>>;
|
|
133
|
-
leftPanelCollapsed?: boolean;
|
|
134
|
-
rightPanelCollapsed?: boolean;
|
|
135
133
|
/** ID of the current preview (temporary) editor, if any. */
|
|
136
134
|
previewEditorId?: string | null;
|
|
137
135
|
}
|
|
@@ -172,6 +170,12 @@ export interface ThemeVars {
|
|
|
172
170
|
"--silo-color-input-text": string;
|
|
173
171
|
"--silo-color-button-bg": string;
|
|
174
172
|
"--silo-color-button-text": string;
|
|
173
|
+
"--silo-color-toolbar-bg": string;
|
|
174
|
+
"--silo-color-toolbar-text": string;
|
|
175
|
+
"--silo-color-toolbar-text-disabled": string;
|
|
176
|
+
"--silo-color-toolbar-input-bg": string;
|
|
177
|
+
"--silo-color-content-bg": string;
|
|
178
|
+
"--silo-color-content-text": string;
|
|
175
179
|
"--silo-font-ui"?: string;
|
|
176
180
|
"--silo-font-mono"?: string;
|
|
177
181
|
"--silo-content-text": string;
|
|
@@ -187,10 +191,6 @@ export interface ThemeVars {
|
|
|
187
191
|
"--silo-content-tab-text": string;
|
|
188
192
|
"--silo-content-tab-text-inactive": string;
|
|
189
193
|
"--silo-content-tab-text-active": string;
|
|
190
|
-
"--silo-breadcrumb-bg": string;
|
|
191
|
-
"--silo-breadcrumb-text": string;
|
|
192
|
-
"--silo-breadcrumb-text-active": string;
|
|
193
|
-
"--silo-breadcrumb-icon": string;
|
|
194
194
|
"--silo-statusbar-bg": string;
|
|
195
195
|
"--silo-statusbar-text": string;
|
|
196
196
|
"--silo-statusbar-bg-hover": 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,C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M,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC"}
|
package/dist/editor-service.d.ts
CHANGED
|
@@ -21,6 +21,24 @@ export interface OpenFileOptions {
|
|
|
21
21
|
* used and any existing tab's view is left unchanged.
|
|
22
22
|
*/
|
|
23
23
|
viewType?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Reveal and select a range when the editor opens — used to jump to a search
|
|
26
|
+
* match or a definition. Applied whether the tab is newly opened or already
|
|
27
|
+
* open (re-jumps an existing tab). All positions are **1-indexed**; `column`
|
|
28
|
+
* defaults to 1, and an omitted `endLine`/`endColumn` collapses the selection
|
|
29
|
+
* to a caret (just scrolls the line into view). Best-effort: editor views that
|
|
30
|
+
* can't honor a selection ignore it.
|
|
31
|
+
*/
|
|
32
|
+
selection?: {
|
|
33
|
+
/** 1-indexed start line. */
|
|
34
|
+
line: number;
|
|
35
|
+
/** 1-indexed start column. Defaults to 1. */
|
|
36
|
+
column?: number;
|
|
37
|
+
/** 1-indexed end line. Defaults to `line`. */
|
|
38
|
+
endLine?: number;
|
|
39
|
+
/** 1-indexed end column. Defaults to `column`. */
|
|
40
|
+
endColumn?: number;
|
|
41
|
+
};
|
|
24
42
|
}
|
|
25
43
|
/**
|
|
26
44
|
* One editor view that can render a given file — its id, user-facing label, and
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor-service.d.ts","sourceRoot":"","sources":["../src/editor-service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAM1C;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B,0DAA0D;IAC1D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"editor-service.d.ts","sourceRoot":"","sources":["../src/editor-service.ts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E,kBAAkB,GAC3B,UAAU,CAAC;IACd;;;;OAIG;IACH,2BAA2B,CACzB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,mBAAmB,GAC5B,UAAU,CAAC;CACf"}
|
package/dist/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*
|
|
10
10
|
* @packageDocumentation
|
|
11
11
|
*/
|
|
12
|
-
export type { Disposable, DockPanelApi, EditorProps, EditorCapabilities, Editor, NewFileTemplate, FileType, Command, MenuId, MenuItemContribution, Keybinding, SidePanelProps, SidePanel, DockPanelKind, StatusItem, SettingsPage, ExtensionContext, Extension, ExtensionHandle, } from "./types";
|
|
12
|
+
export type { Disposable, DockPanelApi, DockPanelProps, EditorProps, EditorCapabilities, Editor, NewFileTemplate, FileType, Command, MenuId, MenuItemContribution, Keybinding, SidePanelProps, SidePanel, DockPanelKind, StatusItem, SettingsPage, ExtensionContext, Extension, ExtensionManifest, ExtensionHandle, } from "./types";
|
|
13
13
|
export type { Workspace, EditorMode, EditorRecord, SidePanelSlot, } from "./domain-types";
|
|
14
14
|
export type { WorkspaceService, WorkspaceState, CreateWorkspaceInput, } from "./workspace-service";
|
|
15
15
|
export type { EditorService, EditorSaveHandlers, OpenFileOptions, EditorViewInfo, OpenDiffSpec, DiffContent, DiffContentRequest, DiffContentProvider, } from "./editor-service";
|
|
@@ -17,6 +17,7 @@ export type { LayoutService, LayoutState, SidePanelColumnState, SideLocation, }
|
|
|
17
17
|
export type { ProcessService, ProcessSession, ProcessSpawnOptions, ProcessExecOptions, ProcessExecResult, } from "./process-service";
|
|
18
18
|
export type { TerminalService, CreateTerminalInput, TerminalKind, TerminalRecord, } from "./terminal-service";
|
|
19
19
|
export type { FileService, FileMeta, FileChangeEvent } from "./file-service";
|
|
20
|
+
export type { SearchService, SearchOptions, SearchMatch, SearchFileResult, SearchResponse, } from "./search-service";
|
|
20
21
|
export type { Permission } from "./permissions";
|
|
21
22
|
export { PathDeniedError } from "./permissions";
|
|
22
23
|
export type { ThemeService, ThemeState, ThemePreset, ResolvedTheme, ThemeBase, ThemeVars, CustomTheme, ThemeExport, } from "./theme-service";
|
|
@@ -25,6 +26,7 @@ export type { DndService, DndItem, DndMime, DragInit, DndMode, DropContext, Drop
|
|
|
25
26
|
export { DND_MIME } from "./dnd-service";
|
|
26
27
|
export type { UiService, FileFilter, MenuItem, MenuItemTrailing, MenuSeparator, MenuHeader, MenuEntry, ShowMenuOptions, ConfirmOptions, PromptOptions, ModalOptions, NotifyAction, NotifyOptions, } from "./ui-service";
|
|
27
28
|
export type { ContextKeys } from "./context-keys";
|
|
29
|
+
export { Tooltip } from "./Tooltip";
|
|
28
30
|
export { useServiceState } from "./use-service-state";
|
|
29
31
|
export type { ReactiveService } from "./use-service-state";
|
|
30
32
|
export { useFocusGroup, focusGroupNextIndex } from "./use-focus-group";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,YAAY,EACV,UAAU,EACV,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,MAAM,EACN,eAAe,EACf,QAAQ,EACR,OAAO,EACP,MAAM,EACN,oBAAoB,EACpB,UAAU,EACV,cAAc,EACd,SAAS,EACT,aAAa,EACb,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,SAAS,EACT,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,GACrB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACV,aAAa,EACb,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACV,aAAa,EACb,WAAW,EACX,oBAAoB,EACpB,YAAY,GACb,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACV,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACV,eAAe,EACf,mBAAmB,EACnB,YAAY,EACZ,cAAc,GACf,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;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,UAAU,EACV,cAAc,EACd,SAAS,EACT,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,GACrB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACV,aAAa,EACb,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACV,aAAa,EACb,WAAW,EACX,oBAAoB,EACpB,YAAY,GACb,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACV,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACV,eAAe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B,MAAM,mBAAmB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -11,6 +11,9 @@
|
|
|
11
11
|
*/
|
|
12
12
|
export { PathDeniedError } from "./permissions";
|
|
13
13
|
export { DND_MIME } from "./dnd-service";
|
|
14
|
+
// Tooltip — the same styled hover popup the host uses in the status bar.
|
|
15
|
+
// Extensions use this instead of native `title` attributes to match host chrome.
|
|
16
|
+
export { Tooltip } from "./Tooltip";
|
|
14
17
|
// Runtime helpers. The one blessed way for an extension to read a `ctx`
|
|
15
18
|
// service's reactive state in React — replaces hand-rolled useSyncExternalStore.
|
|
16
19
|
export { useServiceState } from "./use-service-state";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAqFH,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AA0BhD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAuBzC,yEAAyE;AACzE,iFAAiF;AACjF,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,wEAAwE;AACxE,iFAAiF;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,8EAA8E;AAC9E,4EAA4E;AAC5E,8EAA8E;AAC9E,8EAA8E;AAC9E,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/layout-service.d.ts
CHANGED
|
@@ -42,5 +42,24 @@ export interface LayoutService {
|
|
|
42
42
|
toggleSidePanel(location: SideLocation): void;
|
|
43
43
|
/** Set a side column's collapsed state explicitly. */
|
|
44
44
|
setSidePanelCollapsed(location: SideLocation, collapsed: boolean): void;
|
|
45
|
+
/**
|
|
46
|
+
* Reveal a registered side panel by its {@link SidePanel.id}: make it the
|
|
47
|
+
* active panel in its column and expand that column if collapsed. Use to bring
|
|
48
|
+
* a panel to the foreground from a command or keybinding (e.g. "Find in Files"
|
|
49
|
+
* focusing the Search panel). No-op if no panel with that id is registered.
|
|
50
|
+
*/
|
|
51
|
+
revealSidePanel(id: string): void;
|
|
52
|
+
/**
|
|
53
|
+
* Open a new tab in the center dock for the given registered
|
|
54
|
+
* {@link DockPanelKind}. Use this to programmatically open a custom panel
|
|
55
|
+
* kind from a command (e.g. a "Web Viewer: Open" command that creates a new
|
|
56
|
+
* web-viewer tab). No-op when the center dock has no active workspace.
|
|
57
|
+
*
|
|
58
|
+
* @param kindId - The {@link DockPanelKind.id} to instantiate.
|
|
59
|
+
* @param params - Arbitrary params forwarded to the panel's
|
|
60
|
+
* `IDockviewPanelProps`. Serialized into `ws.dockLayout` so URL/state
|
|
61
|
+
* survives workspace close/reopen.
|
|
62
|
+
*/
|
|
63
|
+
openPanel(kindId: string, params?: Record<string, unknown>): void;
|
|
45
64
|
}
|
|
46
65
|
//# sourceMappingURL=layout-service.d.ts.map
|
|
@@ -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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
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options for {@link SearchService.search}. All flags default to off / empty;
|
|
3
|
+
* an omitted `options` runs a plain, case-insensitive substring search over the
|
|
4
|
+
* active workspace, respecting `.gitignore`.
|
|
5
|
+
*
|
|
6
|
+
* @category Consumer Services
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
export interface SearchOptions {
|
|
10
|
+
/**
|
|
11
|
+
* Search root. Defaults to the open **workspace folder** when omitted. A `cwd`
|
|
12
|
+
* outside the workspace throws {@link PathDeniedError} unless the extension
|
|
13
|
+
* declared the `process` {@link Permission}; first-party extensions are unscoped.
|
|
14
|
+
*/
|
|
15
|
+
cwd?: string;
|
|
16
|
+
/** Treat `query` as a regular expression instead of a literal string. */
|
|
17
|
+
regex?: boolean;
|
|
18
|
+
/** Match case exactly. When false (default), the search is case-insensitive. */
|
|
19
|
+
caseSensitive?: boolean;
|
|
20
|
+
/** Match whole words only (word boundaries around the query). */
|
|
21
|
+
wholeWord?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Glob patterns of files to include (e.g. `["*.ts", "src/**"]`). When empty,
|
|
24
|
+
* all files are eligible (still subject to `.gitignore` and `excludeGlobs`).
|
|
25
|
+
*/
|
|
26
|
+
includeGlobs?: string[];
|
|
27
|
+
/** Glob patterns of files to exclude (e.g. `["**\/dist/**"]`), on top of `.gitignore`. */
|
|
28
|
+
excludeGlobs?: string[];
|
|
29
|
+
/**
|
|
30
|
+
* Cap on the total number of matches collected across all files. When the cap
|
|
31
|
+
* is hit, the search stops early and {@link SearchResponse.truncated} is true.
|
|
32
|
+
*/
|
|
33
|
+
maxResults?: number;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* One matching line within a file, returned in {@link SearchFileResult.matches}.
|
|
37
|
+
*
|
|
38
|
+
* @category Consumer Services
|
|
39
|
+
* @public
|
|
40
|
+
*/
|
|
41
|
+
export interface SearchMatch {
|
|
42
|
+
/** 1-indexed line number of the match within the file. */
|
|
43
|
+
line: number;
|
|
44
|
+
/**
|
|
45
|
+
* The matched line's text, suitable for a preview. Very long lines are
|
|
46
|
+
* truncated by the host; `ranges` are adjusted to stay valid against this string.
|
|
47
|
+
*/
|
|
48
|
+
preview: string;
|
|
49
|
+
/**
|
|
50
|
+
* Character ranges of the matches within {@link SearchMatch.preview}, each
|
|
51
|
+
* `[start, end)` (0-indexed, end-exclusive). A line can contain several matches.
|
|
52
|
+
*/
|
|
53
|
+
ranges: Array<[number, number]>;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* All matches for a single file, returned in {@link SearchResponse.files}.
|
|
57
|
+
*
|
|
58
|
+
* @category Consumer Services
|
|
59
|
+
* @public
|
|
60
|
+
*/
|
|
61
|
+
export interface SearchFileResult {
|
|
62
|
+
/** File path **relative to** the search `cwd` (the workspace folder by default). */
|
|
63
|
+
path: string;
|
|
64
|
+
/** The matching lines within this file, in file order. */
|
|
65
|
+
matches: SearchMatch[];
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* The result of a {@link SearchService.search} call — matches grouped by file
|
|
69
|
+
* plus totals for the summary line ("N results in M files").
|
|
70
|
+
*
|
|
71
|
+
* @category Consumer Services
|
|
72
|
+
* @public
|
|
73
|
+
*/
|
|
74
|
+
export interface SearchResponse {
|
|
75
|
+
/** Files that contained at least one match, in traversal order. */
|
|
76
|
+
files: SearchFileResult[];
|
|
77
|
+
/** Total number of matches across every file. */
|
|
78
|
+
totalMatches: number;
|
|
79
|
+
/**
|
|
80
|
+
* True when the search stopped early at {@link SearchOptions.maxResults} — the
|
|
81
|
+
* results are a prefix, not the complete set.
|
|
82
|
+
*/
|
|
83
|
+
truncated: boolean;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Cross-file content search, exposed as {@link ExtensionContext.search}. Runs a
|
|
87
|
+
* native search engine in the host (off the UI thread) over the workspace,
|
|
88
|
+
* honoring `.gitignore`, and resolves with matches grouped by file.
|
|
89
|
+
*
|
|
90
|
+
* The contract is intentionally extensible: a future replace capability can be
|
|
91
|
+
* added as an additional method without breaking this one, and
|
|
92
|
+
* {@link SearchMatch.ranges} + {@link SearchFileResult.path} already carry the
|
|
93
|
+
* precise locations such a replace would target.
|
|
94
|
+
*
|
|
95
|
+
* @category Consumer Services
|
|
96
|
+
* @public
|
|
97
|
+
*/
|
|
98
|
+
export interface SearchService {
|
|
99
|
+
/**
|
|
100
|
+
* Search file contents under {@link SearchOptions.cwd} (the active workspace
|
|
101
|
+
* folder by default). Resolves with an empty {@link SearchResponse} for an
|
|
102
|
+
* empty `query`. Rejects only if the search could not be started (e.g. the cwd
|
|
103
|
+
* is denied); a search that simply finds nothing resolves with no files.
|
|
104
|
+
*
|
|
105
|
+
* @param query - The text or regex (see {@link SearchOptions.regex}) to find.
|
|
106
|
+
* @param options - Optional {@link SearchOptions}.
|
|
107
|
+
* @example
|
|
108
|
+
* ```ts
|
|
109
|
+
* const { files, totalMatches } = await ctx.search.search("tokyo", {
|
|
110
|
+
* caseSensitive: false,
|
|
111
|
+
* excludeGlobs: ["**\/dist/**"],
|
|
112
|
+
* });
|
|
113
|
+
* ```
|
|
114
|
+
*/
|
|
115
|
+
search(query: string, options?: SearchOptions): Promise<SearchResponse>;
|
|
116
|
+
}
|
|
117
|
+
//# sourceMappingURL=search-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-service.d.ts","sourceRoot":"","sources":["../src/search-service.ts"],"names":[],"mappings":"AAKA;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,yEAAyE;IACzE,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,gFAAgF;IAChF,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,iEAAiE;IACjE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,0FAA0F;IAC1F,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,0DAA0D;IAC1D,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,MAAM,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACjC;AAED;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,oFAAoF;IACpF,IAAI,EAAE,MAAM,CAAC;IACb,0DAA0D;IAC1D,OAAO,EAAE,WAAW,EAAE,CAAC;CACxB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,cAAc;IAC7B,mEAAmE;IACnE,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAC1B,iDAAiD;IACjD,YAAY,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,SAAS,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;;;;;;;;;;;;OAeG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;CACzE"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// `ctx.search` — cross-file content search over the workspace. The core
|
|
2
|
+
// primitive under the Search panel (and future quick-open / find-references).
|
|
3
|
+
// Backed by a native search engine in the host; results come back grouped by
|
|
4
|
+
// file so a UI can render collapsible per-file sections with line previews.
|
|
5
|
+
export {};
|
|
6
|
+
//# sourceMappingURL=search-service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-service.js","sourceRoot":"","sources":["../src/search-service.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,8EAA8E;AAC9E,6EAA6E;AAC7E,4EAA4E"}
|
package/dist/types.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ import type { LayoutService } from "./layout-service";
|
|
|
26
26
|
import type { ProcessService } from "./process-service";
|
|
27
27
|
import type { TerminalService } from "./terminal-service";
|
|
28
28
|
import type { FileService } from "./file-service";
|
|
29
|
+
import type { SearchService } from "./search-service";
|
|
29
30
|
import type { ThemeService, ThemePreset } from "./theme-service";
|
|
30
31
|
import type { DndService } from "./dnd-service";
|
|
31
32
|
import type { UiService } from "./ui-service";
|
|
@@ -52,6 +53,16 @@ export interface Disposable {
|
|
|
52
53
|
* @public
|
|
53
54
|
*/
|
|
54
55
|
export type DockPanelApi = IDockviewPanelProps["api"];
|
|
56
|
+
/**
|
|
57
|
+
* Props handed to a {@link DockPanelKind} component. Use this type to annotate
|
|
58
|
+
* your component instead of importing `IDockviewPanelProps` from `dockview`
|
|
59
|
+
* directly — the SDK wraps it so extensions remain insulated from dockview
|
|
60
|
+
* version changes. The optional generic `T` narrows the shape of `params`.
|
|
61
|
+
*
|
|
62
|
+
* @category Core Types
|
|
63
|
+
* @public
|
|
64
|
+
*/
|
|
65
|
+
export type DockPanelProps<T extends object = Record<string, unknown>> = IDockviewPanelProps<T>;
|
|
55
66
|
/**
|
|
56
67
|
* Props passed to an {@link Editor} component. An editor renders the contents of
|
|
57
68
|
* one editor tab (a presenter for a file type — distinct from
|
|
@@ -290,6 +301,21 @@ export interface DockPanelKind {
|
|
|
290
301
|
id: string;
|
|
291
302
|
/** The React component; receives the raw dockview panel props. */
|
|
292
303
|
component: React.ComponentType<IDockviewPanelProps>;
|
|
304
|
+
/**
|
|
305
|
+
* When set, this kind appears as an entry in the center dock's **+** add
|
|
306
|
+
* menu (the per-group header button). Omit to keep the kind internal.
|
|
307
|
+
*/
|
|
308
|
+
addMenuItem?: {
|
|
309
|
+
/** Label shown in the menu, e.g. `"New Web Viewer"`. */
|
|
310
|
+
label: string;
|
|
311
|
+
/** Optional icon rendered to the left of the label. */
|
|
312
|
+
icon?: React.ReactNode;
|
|
313
|
+
/**
|
|
314
|
+
* Params forwarded to the new panel instance. Merged with a generated
|
|
315
|
+
* panel id — include `title` here to control the tab label.
|
|
316
|
+
*/
|
|
317
|
+
params?: Record<string, unknown>;
|
|
318
|
+
};
|
|
293
319
|
}
|
|
294
320
|
/**
|
|
295
321
|
* A widget in the status bar (the strip along the bottom of the window).
|
|
@@ -304,6 +330,14 @@ export interface StatusItem {
|
|
|
304
330
|
alignment: "left" | "right";
|
|
305
331
|
/** Sort order within its alignment group. Lower sorts first. Defaults to 0. */
|
|
306
332
|
priority?: number;
|
|
333
|
+
/**
|
|
334
|
+
* Tooltip shown on hover over the entire status item. The host renders a
|
|
335
|
+
* custom-styled popup (not the browser's native `title` tooltip). For items
|
|
336
|
+
* that need per-button or reactive tooltips, omit this and manage tooltips
|
|
337
|
+
* inside the component instead (core extensions use `<Tooltip>` from the
|
|
338
|
+
* internal barrel; external extensions may use the native `title` attribute).
|
|
339
|
+
*/
|
|
340
|
+
tooltip?: string;
|
|
307
341
|
/** The React component (renders its own content; no props). */
|
|
308
342
|
component: React.ComponentType;
|
|
309
343
|
}
|
|
@@ -409,6 +443,13 @@ export interface ExtensionContext {
|
|
|
409
443
|
* for the filesystem; watcher lifecycle is host-owned (see {@link FileService}).
|
|
410
444
|
*/
|
|
411
445
|
readonly files: FileService;
|
|
446
|
+
/**
|
|
447
|
+
* Cross-file content search over the workspace — the core primitive under the
|
|
448
|
+
* Search panel (and future quick-open / find-references). Runs a native search
|
|
449
|
+
* engine in the host (off the UI thread), honoring `.gitignore`, and resolves
|
|
450
|
+
* with matches grouped by file. See {@link SearchService}.
|
|
451
|
+
*/
|
|
452
|
+
readonly search: SearchService;
|
|
412
453
|
/**
|
|
413
454
|
* Consumer API for the theme domain — read the merged preset set + active
|
|
414
455
|
* theme, switch themes, and manage custom themes. Read via getState /
|
|
@@ -462,6 +503,34 @@ export interface ExtensionHandle<API = unknown> {
|
|
|
462
503
|
* hasn't activated or published nothing. */
|
|
463
504
|
readonly api: API | undefined;
|
|
464
505
|
}
|
|
506
|
+
/**
|
|
507
|
+
* Display metadata for an extension, surfaced in the **Extensions** settings
|
|
508
|
+
* page (name, one-line description, version, and {@link ExtensionManifest.publisher
|
|
509
|
+
* | publisher} brand). For built-in extensions this is declared in-code on the
|
|
510
|
+
* {@link Extension}; for runtime-loaded third-party extensions the host reads
|
|
511
|
+
* the equivalent fields from the package manifest (`displayName`/`description`/
|
|
512
|
+
* `version` and the `silo.publisher` key) instead. Every field is optional — the
|
|
513
|
+
* host falls back to the extension {@link Extension.id | id} (and the id's
|
|
514
|
+
* namespace for the publisher) when one is absent.
|
|
515
|
+
*
|
|
516
|
+
* @category Extension Contract
|
|
517
|
+
* @public
|
|
518
|
+
*/
|
|
519
|
+
export interface ExtensionManifest {
|
|
520
|
+
/** Human-friendly name shown in the Extensions list (falls back to the id). */
|
|
521
|
+
readonly name?: string;
|
|
522
|
+
/** One-line description shown beneath the name. */
|
|
523
|
+
readonly description?: string;
|
|
524
|
+
/** Version string shown next to the name. */
|
|
525
|
+
readonly version?: string;
|
|
526
|
+
/**
|
|
527
|
+
* The publisher/brand shown beside the name (e.g. `"Silo"`). Built-in
|
|
528
|
+
* extensions are always branded `"Silo"` by the host regardless of this field;
|
|
529
|
+
* third-party extensions set it via the `silo.publisher` manifest key and fall
|
|
530
|
+
* back to their id's namespace (e.g. `"acme"` for `"acme.foo"`).
|
|
531
|
+
*/
|
|
532
|
+
readonly publisher?: string;
|
|
533
|
+
}
|
|
465
534
|
/**
|
|
466
535
|
* The shape of a Silo extension: a stable id plus an
|
|
467
536
|
* {@link Extension.activate | activate} function the host calls once, passing
|
|
@@ -482,6 +551,13 @@ export interface Extension<API = unknown> {
|
|
|
482
551
|
* third parties (e.g. `"core.editor"`, `"silo.git"`, `"acme.foo"`).
|
|
483
552
|
*/
|
|
484
553
|
id: string;
|
|
554
|
+
/**
|
|
555
|
+
* Optional display metadata for the **Extensions** settings page. Built-in
|
|
556
|
+
* extensions declare it here so they can be listed (and disabled) with a name
|
|
557
|
+
* and description; third-party extensions supply the equivalent through their
|
|
558
|
+
* package manifest instead. See {@link ExtensionManifest}.
|
|
559
|
+
*/
|
|
560
|
+
manifest?: ExtensionManifest;
|
|
485
561
|
/**
|
|
486
562
|
* Called once by the host; register contributions against `ctx` here.
|
|
487
563
|
* **Optionally return an API object** to publish it for other extensions to
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D;;;;;;;;;GASG;AACH,MAAM,WAAW,UAAU;IACzB,OAAO,IAAI,IAAI,CAAC;CACjB;AAED;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CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,6CAA6C;IAC7C,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;;OAKG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,SAAS,CAAC,GAAG,GAAG,OAAO;IACtC;;;;OAIG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B;;;;;OAKG;IACH,QAAQ,CAAC,GAAG,EAAE,gBAAgB,GAAG,GAAG,GAAG,IAAI,CAAC;IAC5C,gEAAgE;IAChE,UAAU,CAAC,IAAI,IAAI,CAAC;CACrB"}
|
package/dist/ui-service.d.ts
CHANGED
|
@@ -465,5 +465,20 @@ export interface UiService {
|
|
|
465
465
|
* ```
|
|
466
466
|
*/
|
|
467
467
|
openExternal(url: string): Promise<void>;
|
|
468
|
+
/**
|
|
469
|
+
* The text currently selected in the **focused surface** — the active editor
|
|
470
|
+
* or a focused terminal — or `null` when nothing is selected. Reads the
|
|
471
|
+
* most-recently-focused of the two, so a command (e.g. "Find in Files") can
|
|
472
|
+
* seed itself with whatever the user has highlighted regardless of which
|
|
473
|
+
* surface has focus. Returns `null` (never throws) when no surface is focused
|
|
474
|
+
* or the selection is empty.
|
|
475
|
+
*
|
|
476
|
+
* @example
|
|
477
|
+
* ```ts
|
|
478
|
+
* const seed = ctx.ui.getActiveSelectionText();
|
|
479
|
+
* if (seed) runSearch(seed);
|
|
480
|
+
* ```
|
|
481
|
+
*/
|
|
482
|
+
getActiveSelectionText(): string | null;
|
|
468
483
|
}
|
|
469
484
|
//# sourceMappingURL=ui-service.d.ts.map
|
package/dist/ui-service.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui-service.d.ts","sourceRoot":"","sources":["../src/ui-service.ts"],"names":[],"mappings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,CAAC,CAAC;IAC/C;;;;;;;;;;;;;;;;;OAiBG;IACH,OAAO,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAChD;;;;;;;;;OASG;IACH,MAAM,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmCG;IACH,SAAS,CAAC,CAAC,GAAG,IAAI,EAChB,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,IAAI,KAAK,SAAS,EAClD,OAAO,CAAC,EAAE,YAAY,GACrB,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC;IAC1B;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC;;;;;;;;;;;;;OAaG;IACH,sBAAsB,IAAI,MAAM,GAAG,IAAI,CAAC;CACzC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@silo-code/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "The public, types-first SDK for building Silo extensions — the only surface third-party extensions import.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Dave Weaver",
|
|
@@ -33,13 +33,15 @@
|
|
|
33
33
|
"access": "public"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"react": "^19.1.0"
|
|
36
|
+
"react": "^19.1.0",
|
|
37
|
+
"react-dom": "^19.1.0"
|
|
37
38
|
},
|
|
38
39
|
"dependencies": {
|
|
39
40
|
"dockview": "~6.3.0"
|
|
40
41
|
},
|
|
41
42
|
"devDependencies": {
|
|
42
43
|
"@types/react": "^19.1.8",
|
|
44
|
+
"@types/react-dom": "^19.1.0",
|
|
43
45
|
"typescript": "~5.8.3",
|
|
44
46
|
"vitest": "^4.1.7"
|
|
45
47
|
},
|
package/src/Tooltip.tsx
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { useLayoutEffect, useRef, useState, type ReactNode } from "react";
|
|
2
|
+
import { createPortal } from "react-dom";
|
|
3
|
+
|
|
4
|
+
const DELAY_MS = 600;
|
|
5
|
+
const GAP_PX = 6;
|
|
6
|
+
const MARGIN_PX = 8;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Lightweight tooltip — wraps any trigger element and shows a styled popup
|
|
10
|
+
* above it after a 600 ms hover delay. Renders via a portal so `overflow:
|
|
11
|
+
* hidden` parents and stacking contexts never clip it.
|
|
12
|
+
*
|
|
13
|
+
* The popup uses the host's design tokens and matches the status-bar tooltip
|
|
14
|
+
* style exactly. Display-only: `pointer-events: none`.
|
|
15
|
+
*
|
|
16
|
+
* The CSS classes (`.silo-tooltip`, `.silo-tooltip-host`) are provided by the
|
|
17
|
+
* host — no stylesheet import is needed in the extension.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* <Tooltip content="New File">
|
|
22
|
+
* <button onClick={createFile}>
|
|
23
|
+
* <FilePlus size="1.2em" />
|
|
24
|
+
* </button>
|
|
25
|
+
* </Tooltip>
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* @category Core Types
|
|
29
|
+
* @public
|
|
30
|
+
*/
|
|
31
|
+
export function Tooltip({
|
|
32
|
+
content,
|
|
33
|
+
children,
|
|
34
|
+
}: {
|
|
35
|
+
content: string;
|
|
36
|
+
children: ReactNode;
|
|
37
|
+
}) {
|
|
38
|
+
const ref = useRef<HTMLSpanElement>(null);
|
|
39
|
+
const [anchor, setAnchor] = useState<{ cx: number; top: number } | null>(
|
|
40
|
+
null,
|
|
41
|
+
);
|
|
42
|
+
const timer = useRef<ReturnType<typeof setTimeout> | null>(null);
|
|
43
|
+
|
|
44
|
+
const show = () => {
|
|
45
|
+
timer.current = setTimeout(() => {
|
|
46
|
+
const r = ref.current?.getBoundingClientRect();
|
|
47
|
+
if (r) setAnchor({ cx: r.left + r.width / 2, top: r.top - GAP_PX });
|
|
48
|
+
}, DELAY_MS);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const hide = () => {
|
|
52
|
+
if (timer.current) {
|
|
53
|
+
clearTimeout(timer.current);
|
|
54
|
+
timer.current = null;
|
|
55
|
+
}
|
|
56
|
+
setAnchor(null);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<span
|
|
61
|
+
ref={ref}
|
|
62
|
+
className="silo-tooltip-host"
|
|
63
|
+
onMouseEnter={show}
|
|
64
|
+
onMouseLeave={hide}
|
|
65
|
+
onPointerDown={hide}
|
|
66
|
+
>
|
|
67
|
+
{children}
|
|
68
|
+
{anchor &&
|
|
69
|
+
createPortal(
|
|
70
|
+
<TooltipPopup
|
|
71
|
+
content={content}
|
|
72
|
+
cx={anchor.cx}
|
|
73
|
+
anchorTop={anchor.top}
|
|
74
|
+
/>,
|
|
75
|
+
document.body,
|
|
76
|
+
)}
|
|
77
|
+
</span>
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function TooltipPopup({
|
|
82
|
+
content,
|
|
83
|
+
cx,
|
|
84
|
+
anchorTop,
|
|
85
|
+
}: {
|
|
86
|
+
content: string;
|
|
87
|
+
cx: number;
|
|
88
|
+
anchorTop: number;
|
|
89
|
+
}) {
|
|
90
|
+
const popupRef = useRef<HTMLDivElement>(null);
|
|
91
|
+
const [style, setStyle] = useState<React.CSSProperties>({
|
|
92
|
+
visibility: "hidden",
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
useLayoutEffect(() => {
|
|
96
|
+
const el = popupRef.current;
|
|
97
|
+
if (!el) return;
|
|
98
|
+
const w = el.offsetWidth;
|
|
99
|
+
const h = el.offsetHeight;
|
|
100
|
+
|
|
101
|
+
const left = Math.max(
|
|
102
|
+
MARGIN_PX,
|
|
103
|
+
Math.min(cx - w / 2, window.innerWidth - w - MARGIN_PX),
|
|
104
|
+
);
|
|
105
|
+
const top =
|
|
106
|
+
anchorTop - h < MARGIN_PX ? anchorTop + GAP_PX * 2 : anchorTop - h;
|
|
107
|
+
|
|
108
|
+
setStyle({ left, top, visibility: "visible" });
|
|
109
|
+
}, [cx, anchorTop]);
|
|
110
|
+
|
|
111
|
+
return (
|
|
112
|
+
<div ref={popupRef} className="silo-tooltip" style={style}>
|
|
113
|
+
{content}
|
|
114
|
+
</div>
|
|
115
|
+
);
|
|
116
|
+
}
|
package/src/domain-types.ts
CHANGED
|
@@ -133,8 +133,6 @@ export interface Workspace {
|
|
|
133
133
|
activeSidePanelTabs?: Record<string, string>;
|
|
134
134
|
sidePanelScrollPositions?: Record<string, number>;
|
|
135
135
|
extensionState?: Record<string, Record<string, unknown>>;
|
|
136
|
-
leftPanelCollapsed?: boolean;
|
|
137
|
-
rightPanelCollapsed?: boolean;
|
|
138
136
|
/** ID of the current preview (temporary) editor, if any. */
|
|
139
137
|
previewEditorId?: string | null;
|
|
140
138
|
}
|
|
@@ -178,6 +176,14 @@ export interface ThemeVars {
|
|
|
178
176
|
"--silo-color-input-text": string;
|
|
179
177
|
"--silo-color-button-bg": string;
|
|
180
178
|
"--silo-color-button-text": string;
|
|
179
|
+
// ── Design tokens — toolbar surface (panel header bars) ──
|
|
180
|
+
"--silo-color-toolbar-bg": string;
|
|
181
|
+
"--silo-color-toolbar-text": string;
|
|
182
|
+
"--silo-color-toolbar-text-disabled": string;
|
|
183
|
+
"--silo-color-toolbar-input-bg": string;
|
|
184
|
+
// ── Design tokens — content viewport surface (editor, terminal, viewer panels) ──
|
|
185
|
+
"--silo-color-content-bg": string;
|
|
186
|
+
"--silo-color-content-text": string;
|
|
181
187
|
// ── Design tokens — font families ──
|
|
182
188
|
"--silo-font-ui"?: string;
|
|
183
189
|
"--silo-font-mono"?: string;
|
|
@@ -195,11 +201,6 @@ export interface ThemeVars {
|
|
|
195
201
|
"--silo-content-tab-text": string;
|
|
196
202
|
"--silo-content-tab-text-inactive": string;
|
|
197
203
|
"--silo-content-tab-text-active": string;
|
|
198
|
-
// ── Component tokens — breadcrumb colors ──
|
|
199
|
-
"--silo-breadcrumb-bg": string;
|
|
200
|
-
"--silo-breadcrumb-text": string;
|
|
201
|
-
"--silo-breadcrumb-text-active": string;
|
|
202
|
-
"--silo-breadcrumb-icon": string;
|
|
203
204
|
// ── Component tokens — status bar colors ──
|
|
204
205
|
"--silo-statusbar-bg": string;
|
|
205
206
|
"--silo-statusbar-text": string;
|
package/src/editor-service.ts
CHANGED
|
@@ -26,6 +26,24 @@ export interface OpenFileOptions {
|
|
|
26
26
|
* used and any existing tab's view is left unchanged.
|
|
27
27
|
*/
|
|
28
28
|
viewType?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Reveal and select a range when the editor opens — used to jump to a search
|
|
31
|
+
* match or a definition. Applied whether the tab is newly opened or already
|
|
32
|
+
* open (re-jumps an existing tab). All positions are **1-indexed**; `column`
|
|
33
|
+
* defaults to 1, and an omitted `endLine`/`endColumn` collapses the selection
|
|
34
|
+
* to a caret (just scrolls the line into view). Best-effort: editor views that
|
|
35
|
+
* can't honor a selection ignore it.
|
|
36
|
+
*/
|
|
37
|
+
selection?: {
|
|
38
|
+
/** 1-indexed start line. */
|
|
39
|
+
line: number;
|
|
40
|
+
/** 1-indexed start column. Defaults to 1. */
|
|
41
|
+
column?: number;
|
|
42
|
+
/** 1-indexed end line. Defaults to `line`. */
|
|
43
|
+
endLine?: number;
|
|
44
|
+
/** 1-indexed end column. Defaults to `column`. */
|
|
45
|
+
endColumn?: number;
|
|
46
|
+
};
|
|
29
47
|
}
|
|
30
48
|
|
|
31
49
|
/**
|
package/src/index.ts
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
export type {
|
|
15
15
|
Disposable,
|
|
16
16
|
DockPanelApi,
|
|
17
|
+
DockPanelProps,
|
|
17
18
|
EditorProps,
|
|
18
19
|
EditorCapabilities,
|
|
19
20
|
Editor,
|
|
@@ -30,6 +31,7 @@ export type {
|
|
|
30
31
|
SettingsPage,
|
|
31
32
|
ExtensionContext,
|
|
32
33
|
Extension,
|
|
34
|
+
ExtensionManifest,
|
|
33
35
|
ExtensionHandle,
|
|
34
36
|
} from "./types";
|
|
35
37
|
|
|
@@ -79,6 +81,14 @@ export type {
|
|
|
79
81
|
TerminalRecord,
|
|
80
82
|
} from "./terminal-service";
|
|
81
83
|
export type { FileService, FileMeta, FileChangeEvent } from "./file-service";
|
|
84
|
+
// Cross-file content search exposed on the ExtensionContext as `ctx.search`.
|
|
85
|
+
export type {
|
|
86
|
+
SearchService,
|
|
87
|
+
SearchOptions,
|
|
88
|
+
SearchMatch,
|
|
89
|
+
SearchFileResult,
|
|
90
|
+
SearchResponse,
|
|
91
|
+
} from "./search-service";
|
|
82
92
|
// The permission surface: the capability vocabulary an extension declares, and
|
|
83
93
|
// the error the host throws when an extension reaches outside the workspace
|
|
84
94
|
// without the matching grant. `PathDeniedError` is a class (a runtime value).
|
|
@@ -132,6 +142,10 @@ export type {
|
|
|
132
142
|
// Context keys referenced by `when` predicates on menu items / keybindings.
|
|
133
143
|
export type { ContextKeys } from "./context-keys";
|
|
134
144
|
|
|
145
|
+
// Tooltip — the same styled hover popup the host uses in the status bar.
|
|
146
|
+
// Extensions use this instead of native `title` attributes to match host chrome.
|
|
147
|
+
export { Tooltip } from "./Tooltip";
|
|
148
|
+
|
|
135
149
|
// Runtime helpers. The one blessed way for an extension to read a `ctx`
|
|
136
150
|
// service's reactive state in React — replaces hand-rolled useSyncExternalStore.
|
|
137
151
|
export { useServiceState } from "./use-service-state";
|
package/src/layout-service.ts
CHANGED
|
@@ -46,4 +46,23 @@ export interface LayoutService {
|
|
|
46
46
|
toggleSidePanel(location: SideLocation): void;
|
|
47
47
|
/** Set a side column's collapsed state explicitly. */
|
|
48
48
|
setSidePanelCollapsed(location: SideLocation, collapsed: boolean): void;
|
|
49
|
+
/**
|
|
50
|
+
* Reveal a registered side panel by its {@link SidePanel.id}: make it the
|
|
51
|
+
* active panel in its column and expand that column if collapsed. Use to bring
|
|
52
|
+
* a panel to the foreground from a command or keybinding (e.g. "Find in Files"
|
|
53
|
+
* focusing the Search panel). No-op if no panel with that id is registered.
|
|
54
|
+
*/
|
|
55
|
+
revealSidePanel(id: string): void;
|
|
56
|
+
/**
|
|
57
|
+
* Open a new tab in the center dock for the given registered
|
|
58
|
+
* {@link DockPanelKind}. Use this to programmatically open a custom panel
|
|
59
|
+
* kind from a command (e.g. a "Web Viewer: Open" command that creates a new
|
|
60
|
+
* web-viewer tab). No-op when the center dock has no active workspace.
|
|
61
|
+
*
|
|
62
|
+
* @param kindId - The {@link DockPanelKind.id} to instantiate.
|
|
63
|
+
* @param params - Arbitrary params forwarded to the panel's
|
|
64
|
+
* `IDockviewPanelProps`. Serialized into `ws.dockLayout` so URL/state
|
|
65
|
+
* survives workspace close/reopen.
|
|
66
|
+
*/
|
|
67
|
+
openPanel(kindId: string, params?: Record<string, unknown>): void;
|
|
49
68
|
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
// `ctx.search` — cross-file content search over the workspace. The core
|
|
2
|
+
// primitive under the Search panel (and future quick-open / find-references).
|
|
3
|
+
// Backed by a native search engine in the host; results come back grouped by
|
|
4
|
+
// file so a UI can render collapsible per-file sections with line previews.
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Options for {@link SearchService.search}. All flags default to off / empty;
|
|
8
|
+
* an omitted `options` runs a plain, case-insensitive substring search over the
|
|
9
|
+
* active workspace, respecting `.gitignore`.
|
|
10
|
+
*
|
|
11
|
+
* @category Consumer Services
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
export interface SearchOptions {
|
|
15
|
+
/**
|
|
16
|
+
* Search root. Defaults to the open **workspace folder** when omitted. A `cwd`
|
|
17
|
+
* outside the workspace throws {@link PathDeniedError} unless the extension
|
|
18
|
+
* declared the `process` {@link Permission}; first-party extensions are unscoped.
|
|
19
|
+
*/
|
|
20
|
+
cwd?: string;
|
|
21
|
+
/** Treat `query` as a regular expression instead of a literal string. */
|
|
22
|
+
regex?: boolean;
|
|
23
|
+
/** Match case exactly. When false (default), the search is case-insensitive. */
|
|
24
|
+
caseSensitive?: boolean;
|
|
25
|
+
/** Match whole words only (word boundaries around the query). */
|
|
26
|
+
wholeWord?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Glob patterns of files to include (e.g. `["*.ts", "src/**"]`). When empty,
|
|
29
|
+
* all files are eligible (still subject to `.gitignore` and `excludeGlobs`).
|
|
30
|
+
*/
|
|
31
|
+
includeGlobs?: string[];
|
|
32
|
+
/** Glob patterns of files to exclude (e.g. `["**\/dist/**"]`), on top of `.gitignore`. */
|
|
33
|
+
excludeGlobs?: string[];
|
|
34
|
+
/**
|
|
35
|
+
* Cap on the total number of matches collected across all files. When the cap
|
|
36
|
+
* is hit, the search stops early and {@link SearchResponse.truncated} is true.
|
|
37
|
+
*/
|
|
38
|
+
maxResults?: number;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* One matching line within a file, returned in {@link SearchFileResult.matches}.
|
|
43
|
+
*
|
|
44
|
+
* @category Consumer Services
|
|
45
|
+
* @public
|
|
46
|
+
*/
|
|
47
|
+
export interface SearchMatch {
|
|
48
|
+
/** 1-indexed line number of the match within the file. */
|
|
49
|
+
line: number;
|
|
50
|
+
/**
|
|
51
|
+
* The matched line's text, suitable for a preview. Very long lines are
|
|
52
|
+
* truncated by the host; `ranges` are adjusted to stay valid against this string.
|
|
53
|
+
*/
|
|
54
|
+
preview: string;
|
|
55
|
+
/**
|
|
56
|
+
* Character ranges of the matches within {@link SearchMatch.preview}, each
|
|
57
|
+
* `[start, end)` (0-indexed, end-exclusive). A line can contain several matches.
|
|
58
|
+
*/
|
|
59
|
+
ranges: Array<[number, number]>;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* All matches for a single file, returned in {@link SearchResponse.files}.
|
|
64
|
+
*
|
|
65
|
+
* @category Consumer Services
|
|
66
|
+
* @public
|
|
67
|
+
*/
|
|
68
|
+
export interface SearchFileResult {
|
|
69
|
+
/** File path **relative to** the search `cwd` (the workspace folder by default). */
|
|
70
|
+
path: string;
|
|
71
|
+
/** The matching lines within this file, in file order. */
|
|
72
|
+
matches: SearchMatch[];
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* The result of a {@link SearchService.search} call — matches grouped by file
|
|
77
|
+
* plus totals for the summary line ("N results in M files").
|
|
78
|
+
*
|
|
79
|
+
* @category Consumer Services
|
|
80
|
+
* @public
|
|
81
|
+
*/
|
|
82
|
+
export interface SearchResponse {
|
|
83
|
+
/** Files that contained at least one match, in traversal order. */
|
|
84
|
+
files: SearchFileResult[];
|
|
85
|
+
/** Total number of matches across every file. */
|
|
86
|
+
totalMatches: number;
|
|
87
|
+
/**
|
|
88
|
+
* True when the search stopped early at {@link SearchOptions.maxResults} — the
|
|
89
|
+
* results are a prefix, not the complete set.
|
|
90
|
+
*/
|
|
91
|
+
truncated: boolean;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Cross-file content search, exposed as {@link ExtensionContext.search}. Runs a
|
|
96
|
+
* native search engine in the host (off the UI thread) over the workspace,
|
|
97
|
+
* honoring `.gitignore`, and resolves with matches grouped by file.
|
|
98
|
+
*
|
|
99
|
+
* The contract is intentionally extensible: a future replace capability can be
|
|
100
|
+
* added as an additional method without breaking this one, and
|
|
101
|
+
* {@link SearchMatch.ranges} + {@link SearchFileResult.path} already carry the
|
|
102
|
+
* precise locations such a replace would target.
|
|
103
|
+
*
|
|
104
|
+
* @category Consumer Services
|
|
105
|
+
* @public
|
|
106
|
+
*/
|
|
107
|
+
export interface SearchService {
|
|
108
|
+
/**
|
|
109
|
+
* Search file contents under {@link SearchOptions.cwd} (the active workspace
|
|
110
|
+
* folder by default). Resolves with an empty {@link SearchResponse} for an
|
|
111
|
+
* empty `query`. Rejects only if the search could not be started (e.g. the cwd
|
|
112
|
+
* is denied); a search that simply finds nothing resolves with no files.
|
|
113
|
+
*
|
|
114
|
+
* @param query - The text or regex (see {@link SearchOptions.regex}) to find.
|
|
115
|
+
* @param options - Optional {@link SearchOptions}.
|
|
116
|
+
* @example
|
|
117
|
+
* ```ts
|
|
118
|
+
* const { files, totalMatches } = await ctx.search.search("tokyo", {
|
|
119
|
+
* caseSensitive: false,
|
|
120
|
+
* excludeGlobs: ["**\/dist/**"],
|
|
121
|
+
* });
|
|
122
|
+
* ```
|
|
123
|
+
*/
|
|
124
|
+
search(query: string, options?: SearchOptions): Promise<SearchResponse>;
|
|
125
|
+
}
|
package/src/types.ts
CHANGED
|
@@ -26,6 +26,7 @@ import type { LayoutService } from "./layout-service";
|
|
|
26
26
|
import type { ProcessService } from "./process-service";
|
|
27
27
|
import type { TerminalService } from "./terminal-service";
|
|
28
28
|
import type { FileService } from "./file-service";
|
|
29
|
+
import type { SearchService } from "./search-service";
|
|
29
30
|
import type { ThemeService, ThemePreset } from "./theme-service";
|
|
30
31
|
import type { DndService } from "./dnd-service";
|
|
31
32
|
import type { UiService } from "./ui-service";
|
|
@@ -55,6 +56,18 @@ export interface Disposable {
|
|
|
55
56
|
*/
|
|
56
57
|
export type DockPanelApi = IDockviewPanelProps["api"];
|
|
57
58
|
|
|
59
|
+
/**
|
|
60
|
+
* Props handed to a {@link DockPanelKind} component. Use this type to annotate
|
|
61
|
+
* your component instead of importing `IDockviewPanelProps` from `dockview`
|
|
62
|
+
* directly — the SDK wraps it so extensions remain insulated from dockview
|
|
63
|
+
* version changes. The optional generic `T` narrows the shape of `params`.
|
|
64
|
+
*
|
|
65
|
+
* @category Core Types
|
|
66
|
+
* @public
|
|
67
|
+
*/
|
|
68
|
+
export type DockPanelProps<T extends object = Record<string, unknown>> =
|
|
69
|
+
IDockviewPanelProps<T>;
|
|
70
|
+
|
|
58
71
|
/**
|
|
59
72
|
* Props passed to an {@link Editor} component. An editor renders the contents of
|
|
60
73
|
* one editor tab (a presenter for a file type — distinct from
|
|
@@ -304,6 +317,21 @@ export interface DockPanelKind {
|
|
|
304
317
|
id: string;
|
|
305
318
|
/** The React component; receives the raw dockview panel props. */
|
|
306
319
|
component: React.ComponentType<IDockviewPanelProps>;
|
|
320
|
+
/**
|
|
321
|
+
* When set, this kind appears as an entry in the center dock's **+** add
|
|
322
|
+
* menu (the per-group header button). Omit to keep the kind internal.
|
|
323
|
+
*/
|
|
324
|
+
addMenuItem?: {
|
|
325
|
+
/** Label shown in the menu, e.g. `"New Web Viewer"`. */
|
|
326
|
+
label: string;
|
|
327
|
+
/** Optional icon rendered to the left of the label. */
|
|
328
|
+
icon?: React.ReactNode;
|
|
329
|
+
/**
|
|
330
|
+
* Params forwarded to the new panel instance. Merged with a generated
|
|
331
|
+
* panel id — include `title` here to control the tab label.
|
|
332
|
+
*/
|
|
333
|
+
params?: Record<string, unknown>;
|
|
334
|
+
};
|
|
307
335
|
}
|
|
308
336
|
|
|
309
337
|
/**
|
|
@@ -319,6 +347,14 @@ export interface StatusItem {
|
|
|
319
347
|
alignment: "left" | "right";
|
|
320
348
|
/** Sort order within its alignment group. Lower sorts first. Defaults to 0. */
|
|
321
349
|
priority?: number;
|
|
350
|
+
/**
|
|
351
|
+
* Tooltip shown on hover over the entire status item. The host renders a
|
|
352
|
+
* custom-styled popup (not the browser's native `title` tooltip). For items
|
|
353
|
+
* that need per-button or reactive tooltips, omit this and manage tooltips
|
|
354
|
+
* inside the component instead (core extensions use `<Tooltip>` from the
|
|
355
|
+
* internal barrel; external extensions may use the native `title` attribute).
|
|
356
|
+
*/
|
|
357
|
+
tooltip?: string;
|
|
322
358
|
/** The React component (renders its own content; no props). */
|
|
323
359
|
component: React.ComponentType;
|
|
324
360
|
}
|
|
@@ -426,6 +462,13 @@ export interface ExtensionContext {
|
|
|
426
462
|
* for the filesystem; watcher lifecycle is host-owned (see {@link FileService}).
|
|
427
463
|
*/
|
|
428
464
|
readonly files: FileService;
|
|
465
|
+
/**
|
|
466
|
+
* Cross-file content search over the workspace — the core primitive under the
|
|
467
|
+
* Search panel (and future quick-open / find-references). Runs a native search
|
|
468
|
+
* engine in the host (off the UI thread), honoring `.gitignore`, and resolves
|
|
469
|
+
* with matches grouped by file. See {@link SearchService}.
|
|
470
|
+
*/
|
|
471
|
+
readonly search: SearchService;
|
|
429
472
|
/**
|
|
430
473
|
* Consumer API for the theme domain — read the merged preset set + active
|
|
431
474
|
* theme, switch themes, and manage custom themes. Read via getState /
|
|
@@ -481,6 +524,35 @@ export interface ExtensionHandle<API = unknown> {
|
|
|
481
524
|
readonly api: API | undefined;
|
|
482
525
|
}
|
|
483
526
|
|
|
527
|
+
/**
|
|
528
|
+
* Display metadata for an extension, surfaced in the **Extensions** settings
|
|
529
|
+
* page (name, one-line description, version, and {@link ExtensionManifest.publisher
|
|
530
|
+
* | publisher} brand). For built-in extensions this is declared in-code on the
|
|
531
|
+
* {@link Extension}; for runtime-loaded third-party extensions the host reads
|
|
532
|
+
* the equivalent fields from the package manifest (`displayName`/`description`/
|
|
533
|
+
* `version` and the `silo.publisher` key) instead. Every field is optional — the
|
|
534
|
+
* host falls back to the extension {@link Extension.id | id} (and the id's
|
|
535
|
+
* namespace for the publisher) when one is absent.
|
|
536
|
+
*
|
|
537
|
+
* @category Extension Contract
|
|
538
|
+
* @public
|
|
539
|
+
*/
|
|
540
|
+
export interface ExtensionManifest {
|
|
541
|
+
/** Human-friendly name shown in the Extensions list (falls back to the id). */
|
|
542
|
+
readonly name?: string;
|
|
543
|
+
/** One-line description shown beneath the name. */
|
|
544
|
+
readonly description?: string;
|
|
545
|
+
/** Version string shown next to the name. */
|
|
546
|
+
readonly version?: string;
|
|
547
|
+
/**
|
|
548
|
+
* The publisher/brand shown beside the name (e.g. `"Silo"`). Built-in
|
|
549
|
+
* extensions are always branded `"Silo"` by the host regardless of this field;
|
|
550
|
+
* third-party extensions set it via the `silo.publisher` manifest key and fall
|
|
551
|
+
* back to their id's namespace (e.g. `"acme"` for `"acme.foo"`).
|
|
552
|
+
*/
|
|
553
|
+
readonly publisher?: string;
|
|
554
|
+
}
|
|
555
|
+
|
|
484
556
|
/**
|
|
485
557
|
* The shape of a Silo extension: a stable id plus an
|
|
486
558
|
* {@link Extension.activate | activate} function the host calls once, passing
|
|
@@ -501,6 +573,13 @@ export interface Extension<API = unknown> {
|
|
|
501
573
|
* third parties (e.g. `"core.editor"`, `"silo.git"`, `"acme.foo"`).
|
|
502
574
|
*/
|
|
503
575
|
id: string;
|
|
576
|
+
/**
|
|
577
|
+
* Optional display metadata for the **Extensions** settings page. Built-in
|
|
578
|
+
* extensions declare it here so they can be listed (and disabled) with a name
|
|
579
|
+
* and description; third-party extensions supply the equivalent through their
|
|
580
|
+
* package manifest instead. See {@link ExtensionManifest}.
|
|
581
|
+
*/
|
|
582
|
+
manifest?: ExtensionManifest;
|
|
504
583
|
/**
|
|
505
584
|
* Called once by the host; register contributions against `ctx` here.
|
|
506
585
|
* **Optionally return an API object** to publish it for other extensions to
|
package/src/ui-service.ts
CHANGED
|
@@ -484,4 +484,19 @@ export interface UiService {
|
|
|
484
484
|
* ```
|
|
485
485
|
*/
|
|
486
486
|
openExternal(url: string): Promise<void>;
|
|
487
|
+
/**
|
|
488
|
+
* The text currently selected in the **focused surface** — the active editor
|
|
489
|
+
* or a focused terminal — or `null` when nothing is selected. Reads the
|
|
490
|
+
* most-recently-focused of the two, so a command (e.g. "Find in Files") can
|
|
491
|
+
* seed itself with whatever the user has highlighted regardless of which
|
|
492
|
+
* surface has focus. Returns `null` (never throws) when no surface is focused
|
|
493
|
+
* or the selection is empty.
|
|
494
|
+
*
|
|
495
|
+
* @example
|
|
496
|
+
* ```ts
|
|
497
|
+
* const seed = ctx.ui.getActiveSelectionText();
|
|
498
|
+
* if (seed) runSearch(seed);
|
|
499
|
+
* ```
|
|
500
|
+
*/
|
|
501
|
+
getActiveSelectionText(): string | null;
|
|
487
502
|
}
|