@lijian-ui/dsh-file-manager 0.1.20
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/LICENSE +38 -0
- package/README.i18n.yaml +6 -0
- package/README.md +66 -0
- package/README.zh.md +66 -0
- package/cordis.patch.yml +13 -0
- package/lib/assets/mermaid.min.js +3587 -0
- package/lib/client.js +7621 -0
- package/lib/client.js.map +1 -0
- package/lib/index.js +3207 -0
- package/lib/tsconfig.client.tsbuildinfo +1 -0
- package/lib/tsconfig.host.tsbuildinfo +1 -0
- package/lib/types/client/FileManagerSettingsCard.d.ts +56 -0
- package/lib/types/client/FileManagerSettingsCard.d.ts.map +1 -0
- package/lib/types/client/PluginSettingsCard.d.ts +104 -0
- package/lib/types/client/PluginSettingsCard.d.ts.map +1 -0
- package/lib/types/client/api.d.ts +75 -0
- package/lib/types/client/api.d.ts.map +1 -0
- package/lib/types/client/chat/AttachedFilesDock.d.ts +51 -0
- package/lib/types/client/chat/AttachedFilesDock.d.ts.map +1 -0
- package/lib/types/client/chat/file-ref.d.ts +35 -0
- package/lib/types/client/chat/file-ref.d.ts.map +1 -0
- package/lib/types/client/chat/mermaid-chat.d.ts +30 -0
- package/lib/types/client/chat/mermaid-chat.d.ts.map +1 -0
- package/lib/types/client/chat/placeholder-hint.d.ts +16 -0
- package/lib/types/client/chat/placeholder-hint.d.ts.map +1 -0
- package/lib/types/client/components/ExplorerPanel.d.ts +26 -0
- package/lib/types/client/components/ExplorerPanel.d.ts.map +1 -0
- package/lib/types/client/components/FileIcon.d.ts +15 -0
- package/lib/types/client/components/FileIcon.d.ts.map +1 -0
- package/lib/types/client/components/ScmPanel.d.ts +23 -0
- package/lib/types/client/components/ScmPanel.d.ts.map +1 -0
- package/lib/types/client/components/a11y.d.ts +12 -0
- package/lib/types/client/components/a11y.d.ts.map +1 -0
- package/lib/types/client/components/icons.d.ts +41 -0
- package/lib/types/client/components/icons.d.ts.map +1 -0
- package/lib/types/client/components/overlay.d.ts +45 -0
- package/lib/types/client/components/overlay.d.ts.map +1 -0
- package/lib/types/client/drag/DragFileInlay.d.ts +31 -0
- package/lib/types/client/drag/DragFileInlay.d.ts.map +1 -0
- package/lib/types/client/drag/file-drag.d.ts +47 -0
- package/lib/types/client/drag/file-drag.d.ts.map +1 -0
- package/lib/types/client/drag.d.ts +31 -0
- package/lib/types/client/drag.d.ts.map +1 -0
- package/lib/types/client/file-source.d.ts +29 -0
- package/lib/types/client/file-source.d.ts.map +1 -0
- package/lib/types/client/fileType.d.ts +31 -0
- package/lib/types/client/fileType.d.ts.map +1 -0
- package/lib/types/client/floating.d.ts +27 -0
- package/lib/types/client/floating.d.ts.map +1 -0
- package/lib/types/client/hooks/useResizableSplit.d.ts +37 -0
- package/lib/types/client/hooks/useResizableSplit.d.ts.map +1 -0
- package/lib/types/client/hooks/useStore.d.ts +10 -0
- package/lib/types/client/hooks/useStore.d.ts.map +1 -0
- package/lib/types/client/index.d.ts +57 -0
- package/lib/types/client/index.d.ts.map +1 -0
- package/lib/types/client/layout.d.ts +104 -0
- package/lib/types/client/layout.d.ts.map +1 -0
- package/lib/types/client/locales.d.ts +125 -0
- package/lib/types/client/locales.d.ts.map +1 -0
- package/lib/types/client/maximize.d.ts +24 -0
- package/lib/types/client/maximize.d.ts.map +1 -0
- package/lib/types/client/mention.d.ts +44 -0
- package/lib/types/client/mention.d.ts.map +1 -0
- package/lib/types/client/mount.d.ts +22 -0
- package/lib/types/client/mount.d.ts.map +1 -0
- package/lib/types/client/persist.d.ts +55 -0
- package/lib/types/client/persist.d.ts.map +1 -0
- package/lib/types/client/picker/FilePickerModal.d.ts +47 -0
- package/lib/types/client/picker/FilePickerModal.d.ts.map +1 -0
- package/lib/types/client/picker/file-picker.d.ts +62 -0
- package/lib/types/client/picker/file-picker.d.ts.map +1 -0
- package/lib/types/client/preview/PreviewPanel.d.ts +17 -0
- package/lib/types/client/preview/PreviewPanel.d.ts.map +1 -0
- package/lib/types/client/preview/PreviewTabs.d.ts +30 -0
- package/lib/types/client/preview/PreviewTabs.d.ts.map +1 -0
- package/lib/types/client/preview/PreviewToolbar.d.ts +37 -0
- package/lib/types/client/preview/PreviewToolbar.d.ts.map +1 -0
- package/lib/types/client/preview/content.d.ts +43 -0
- package/lib/types/client/preview/content.d.ts.map +1 -0
- package/lib/types/client/preview/markdown.d.ts +60 -0
- package/lib/types/client/preview/markdown.d.ts.map +1 -0
- package/lib/types/client/preview/mermaid.d.ts +78 -0
- package/lib/types/client/preview/mermaid.d.ts.map +1 -0
- package/lib/types/client/preview/selection.d.ts +26 -0
- package/lib/types/client/preview/selection.d.ts.map +1 -0
- package/lib/types/client/reference.d.ts +75 -0
- package/lib/types/client/reference.d.ts.map +1 -0
- package/lib/types/client/settings-form.d.ts +206 -0
- package/lib/types/client/settings-form.d.ts.map +1 -0
- package/lib/types/client/store.d.ts +279 -0
- package/lib/types/client/store.d.ts.map +1 -0
- package/lib/types/core/types.d.ts +132 -0
- package/lib/types/core/types.d.ts.map +1 -0
- package/lib/types/host/fs-service.d.ts +96 -0
- package/lib/types/host/fs-service.d.ts.map +1 -0
- package/lib/types/host/gate.d.ts +45 -0
- package/lib/types/host/gate.d.ts.map +1 -0
- package/lib/types/host/git-runner.d.ts +80 -0
- package/lib/types/host/git-runner.d.ts.map +1 -0
- package/lib/types/host/git-service.d.ts +130 -0
- package/lib/types/host/git-service.d.ts.map +1 -0
- package/lib/types/host/loopback.d.ts +25 -0
- package/lib/types/host/loopback.d.ts.map +1 -0
- package/lib/types/host/poll-guard.d.ts +55 -0
- package/lib/types/host/poll-guard.d.ts.map +1 -0
- package/lib/types/host/routes.d.ts +54 -0
- package/lib/types/host/routes.d.ts.map +1 -0
- package/lib/types/index.d.ts +35 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/mount-once.d.ts +25 -0
- package/lib/types/mount-once.d.ts.map +1 -0
- package/package.json +85 -0
- package/src/client/FileManagerSettingsCard.tsx +117 -0
- package/src/client/PluginSettingsCard.tsx +337 -0
- package/src/client/api.ts +141 -0
- package/src/client/chat/file-ref.ts +144 -0
- package/src/client/chat/mermaid-chat.tsx +102 -0
- package/src/client/chat/placeholder-hint.tsx +46 -0
- package/src/client/components/ExplorerPanel.tsx +534 -0
- package/src/client/components/FileIcon.tsx +46 -0
- package/src/client/components/ScmPanel.tsx +480 -0
- package/src/client/components/a11y.ts +20 -0
- package/src/client/components/icons.tsx +274 -0
- package/src/client/components/overlay.tsx +225 -0
- package/src/client/css-modules.d.ts +5 -0
- package/src/client/drag/DragFileInlay.tsx +89 -0
- package/src/client/drag/file-drag.ts +67 -0
- package/src/client/drag.ts +154 -0
- package/src/client/file-source.ts +58 -0
- package/src/client/fileType.ts +129 -0
- package/src/client/floating.ts +63 -0
- package/src/client/hooks/useResizableSplit.ts +91 -0
- package/src/client/hooks/useStore.ts +15 -0
- package/src/client/index.ts +389 -0
- package/src/client/layout.ts +546 -0
- package/src/client/locales.ts +247 -0
- package/src/client/maximize.ts +34 -0
- package/src/client/mount.tsx +74 -0
- package/src/client/persist.ts +194 -0
- package/src/client/picker/FilePickerModal.tsx +506 -0
- package/src/client/picker/file-picker.ts +86 -0
- package/src/client/preview/PreviewPanel.tsx +233 -0
- package/src/client/preview/PreviewTabs.tsx +159 -0
- package/src/client/preview/PreviewToolbar.tsx +160 -0
- package/src/client/preview/content.tsx +617 -0
- package/src/client/preview/markdown.ts +351 -0
- package/src/client/preview/mermaid.ts +274 -0
- package/src/client/preview/selection.ts +82 -0
- package/src/client/reference.ts +161 -0
- package/src/client/settings-card.module.css +316 -0
- package/src/client/settings-form.ts +451 -0
- package/src/client/store.ts +1290 -0
- package/src/client/styles/chip.module.css +38 -0
- package/src/client/styles/drag.module.css +30 -0
- package/src/client/styles/explorer.module.css +371 -0
- package/src/client/styles/picker.module.css +344 -0
- package/src/client/styles/preview.module.css +904 -0
- package/src/client/styles/scm.module.css +380 -0
- package/src/client/styles/tokens.module.css +480 -0
- package/src/core/types.ts +162 -0
- package/src/host/fs-service.ts +513 -0
- package/src/host/gate.ts +74 -0
- package/src/host/git-runner.ts +116 -0
- package/src/host/git-service.ts +395 -0
- package/src/host/loopback.ts +63 -0
- package/src/host/poll-guard.ts +109 -0
- package/src/host/routes.ts +695 -0
- package/src/index.ts +97 -0
- package/src/mount-once.ts +48 -0
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Family-shared chrome for plugin settings cards: a disclosure header naming
|
|
3
|
+
* the plugin and what its settings govern, the controls inside, and the save
|
|
4
|
+
* that writes them. Renders nothing while the namespace is unavailable — a
|
|
5
|
+
* deployment that does not compose the owning plugin should show no trace of
|
|
6
|
+
* it. Inlined into each consumer's client bundle; mirrors the official
|
|
7
|
+
* ui-plugin-config PluginCard in a self-contained slice.
|
|
8
|
+
*/
|
|
9
|
+
import { type ReactNode } from 'react';
|
|
10
|
+
import type { CardShell } from './settings-form.ts';
|
|
11
|
+
/** Copy keys the card chrome itself reads; every consumer locale carries this shared vocabulary. */
|
|
12
|
+
export declare const CARD_COPY_KEYS: readonly ["settings.collapse", "settings.expand", "settings.notExposed", "settings.unsaved", "settings.readOnly", "settings.saveFailed", "settings.discard", "settings.save", "settings.saving"];
|
|
13
|
+
/** Copy key the card chrome itself reads. */
|
|
14
|
+
export type CardCopyKey = (typeof CARD_COPY_KEYS)[number];
|
|
15
|
+
/** Key domain for the plugin's own copy (inferred per consumer). */
|
|
16
|
+
export type SettingsCardKey<TKey extends string = string> = TKey | CardCopyKey;
|
|
17
|
+
/** Card chrome shared by every plugin settings card. */
|
|
18
|
+
export interface PluginSettingsCardProps<TKey extends string = string> {
|
|
19
|
+
/** Locale reader for this card's copy. */
|
|
20
|
+
t: (key: SettingsCardKey<TKey>, params?: Record<string, string | number>) => string;
|
|
21
|
+
/** Locale key of the plugin's name. */
|
|
22
|
+
titleKey: TKey;
|
|
23
|
+
/** Locale key of the line describing what this plugin's settings govern. */
|
|
24
|
+
descriptionKey: TKey;
|
|
25
|
+
/** The card's form state: availability, writability, and what a save would do. */
|
|
26
|
+
state: CardShell;
|
|
27
|
+
/** Write every staged edit. */
|
|
28
|
+
onSave: () => void;
|
|
29
|
+
/** Drop every staged edit. */
|
|
30
|
+
onDiscard: () => void;
|
|
31
|
+
/**
|
|
32
|
+
* Render the controls expanded on arrival (still collapsible). Defaults to
|
|
33
|
+
* true: promoted first-level sections show their settings immediately.
|
|
34
|
+
*/
|
|
35
|
+
defaultOpen?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Render without the collapse affordance: a static header and an always
|
|
38
|
+
* visible body. Used by first-level settings sections whose nav entry
|
|
39
|
+
* already provides the selection.
|
|
40
|
+
*/
|
|
41
|
+
alwaysOpen?: boolean;
|
|
42
|
+
/** The plugin's controls. */
|
|
43
|
+
children: ReactNode;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Render one plugin settings card.
|
|
47
|
+
* @param props - the plugin's copy keys, its form state, and its controls.
|
|
48
|
+
* @returns the card, or nothing while the namespace is still loading.
|
|
49
|
+
*/
|
|
50
|
+
export declare function PluginSettingsCard<TKey extends string = string>(props: PluginSettingsCardProps<TKey>): import("react").JSX.Element | null;
|
|
51
|
+
/** Props every field control needs regardless of its value type. */
|
|
52
|
+
export interface FieldProps {
|
|
53
|
+
/** Stable id associating the label with its control. */
|
|
54
|
+
id: string;
|
|
55
|
+
/** Visible label. */
|
|
56
|
+
label: string;
|
|
57
|
+
/** One-line explanation rendered under the control. */
|
|
58
|
+
hint: string;
|
|
59
|
+
/** Draft text this control renders. */
|
|
60
|
+
text: string;
|
|
61
|
+
/** True when saving would leave a user-layer entry for this field. */
|
|
62
|
+
overridden: boolean;
|
|
63
|
+
/** True when the draft is not a value this field accepts. */
|
|
64
|
+
invalid: boolean;
|
|
65
|
+
/** Copy for the overridden badge. */
|
|
66
|
+
overriddenLabel: string;
|
|
67
|
+
/** Copy for the reset control. */
|
|
68
|
+
resetLabel: string;
|
|
69
|
+
/** Copy shown in place of the hint while the draft is invalid. */
|
|
70
|
+
invalidLabel: string;
|
|
71
|
+
/** Disables every control (read-only document, or an unavailable namespace). */
|
|
72
|
+
disabled: boolean;
|
|
73
|
+
/** Stage draft text. */
|
|
74
|
+
onEdit: (text: string) => void;
|
|
75
|
+
/** Stage a clear so the field re-inherits the composition layer. */
|
|
76
|
+
onReset: () => void;
|
|
77
|
+
}
|
|
78
|
+
/** A staged value field. `numeric` only hints the keypad: which drafts a field accepts is decided by its spec. */
|
|
79
|
+
export declare function ValueField(props: FieldProps & {
|
|
80
|
+
/** Hints a numeric keypad without narrowing what the control accepts. */
|
|
81
|
+
numeric?: boolean;
|
|
82
|
+
/** Placeholder shown while the draft is empty. */
|
|
83
|
+
placeholder?: string;
|
|
84
|
+
}): import("react").JSX.Element;
|
|
85
|
+
/** A staged boolean field: 继承 / 开 / 关. */
|
|
86
|
+
export declare function BooleanField(props: FieldProps & {
|
|
87
|
+
/** Copy for the inherit option. */
|
|
88
|
+
inheritLabel: string;
|
|
89
|
+
/** Copy for the on option. */
|
|
90
|
+
onLabel: string;
|
|
91
|
+
/** Copy for the off option. */
|
|
92
|
+
offLabel: string;
|
|
93
|
+
}): import("react").JSX.Element;
|
|
94
|
+
/** A staged enumerated field rendered as a select. */
|
|
95
|
+
export declare function ChoiceField(props: FieldProps & {
|
|
96
|
+
/** Copy for the inherit option (draft text is the empty string). */
|
|
97
|
+
inheritLabel: string;
|
|
98
|
+
/** Choices rendered in order; `value` is the draft/stored text. */
|
|
99
|
+
choices: ReadonlyArray<{
|
|
100
|
+
value: string;
|
|
101
|
+
label: string;
|
|
102
|
+
}>;
|
|
103
|
+
}): import("react").JSX.Element;
|
|
104
|
+
//# sourceMappingURL=PluginSettingsCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PluginSettingsCard.d.ts","sourceRoot":"","sources":["../../../src/client/PluginSettingsCard.tsx"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,OAAO,EAAY,KAAK,SAA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the SSE change subscription. Same-origin relative fetch (the
|
|
4
|
+
* page and the routes share the webserver).
|
|
5
|
+
* @module dsh-filemgr/client/api
|
|
6
|
+
*/
|
|
7
|
+
import type { DirListing, FileRead, GitBatchResult, GitStatusView, PanelEnvelope, SearchView } from '../core/types.ts';
|
|
8
|
+
/** Typed panel operations over the wire. */
|
|
9
|
+
export declare class PanelApi {
|
|
10
|
+
/** List one directory of the project root (rel path; '' = root). */
|
|
11
|
+
list(root: string, path: string): Promise<PanelEnvelope<DirListing>>;
|
|
12
|
+
/** Read one file (text or image data URL). */
|
|
13
|
+
read(root: string, path: string, asImage: boolean): Promise<PanelEnvelope<FileRead>>;
|
|
14
|
+
/** Write text content back with an optional mtime conflict base. */
|
|
15
|
+
write(root: string, path: string, content: string, baseMtime?: number): Promise<PanelEnvelope<{
|
|
16
|
+
mtime: number;
|
|
17
|
+
}>>;
|
|
18
|
+
/** Filename search under the root. */
|
|
19
|
+
search(root: string, query: string): Promise<PanelEnvelope<SearchView>>;
|
|
20
|
+
/** Delete a path (untracked discard). */
|
|
21
|
+
delete(root: string, path: string): Promise<PanelEnvelope<{
|
|
22
|
+
ok: true;
|
|
23
|
+
}>>;
|
|
24
|
+
/** Reveal a path in the OS file manager (selecting the entry). */
|
|
25
|
+
reveal(root: string, path: string): Promise<PanelEnvelope<{
|
|
26
|
+
ok: true;
|
|
27
|
+
}>>;
|
|
28
|
+
/** Open a path with the OS default app. */
|
|
29
|
+
openWithDefault(root: string, path: string): Promise<PanelEnvelope<{
|
|
30
|
+
ok: true;
|
|
31
|
+
}>>;
|
|
32
|
+
/** Rename a path (newName is a bare name, no separators). */
|
|
33
|
+
rename(root: string, path: string, newName: string): Promise<PanelEnvelope<{
|
|
34
|
+
ok: true;
|
|
35
|
+
}>>;
|
|
36
|
+
/** Create a directory at a relative path (parent must exist). */
|
|
37
|
+
mkdir(root: string, path: string): Promise<PanelEnvelope<{
|
|
38
|
+
ok: true;
|
|
39
|
+
}>>;
|
|
40
|
+
/** Create an empty file at a relative path (refuses to overwrite). */
|
|
41
|
+
newFile(root: string, path: string): Promise<PanelEnvelope<{
|
|
42
|
+
ok: true;
|
|
43
|
+
}>>;
|
|
44
|
+
/** The repo status view; null when the root is not a repository. */
|
|
45
|
+
gitStatus(root: string): Promise<PanelEnvelope<GitStatusView | null>>;
|
|
46
|
+
/** The unified diff text of one path (staged = index vs HEAD). */
|
|
47
|
+
gitDiff(root: string, path: string, staged: boolean): Promise<PanelEnvelope<{
|
|
48
|
+
content: string;
|
|
49
|
+
}>>;
|
|
50
|
+
/** Stage paths. */
|
|
51
|
+
gitStage(root: string, paths: string[]): Promise<PanelEnvelope<GitBatchResult>>;
|
|
52
|
+
/** Unstage paths. */
|
|
53
|
+
gitUnstage(root: string, paths: string[]): Promise<PanelEnvelope<GitBatchResult>>;
|
|
54
|
+
/** Discard paths (worktree side; untracked paths are deleted). */
|
|
55
|
+
gitDiscard(root: string, paths: string[]): Promise<PanelEnvelope<GitBatchResult>>;
|
|
56
|
+
}
|
|
57
|
+
/** One SSE change event pushed by the host. */
|
|
58
|
+
export type PanelChangeEvent = {
|
|
59
|
+
kind: 'fs';
|
|
60
|
+
} | {
|
|
61
|
+
kind: 'git';
|
|
62
|
+
status: GitStatusView;
|
|
63
|
+
} | {
|
|
64
|
+
kind: 'gitUnavailable';
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* Subscribe to host-pushed changes for one project root (fs watch events and
|
|
68
|
+
* git status polls). Reconnects are handled by the EventSource; the caller
|
|
69
|
+
* re-subscribes when the root changes.
|
|
70
|
+
* @param root - project root to watch.
|
|
71
|
+
* @param onChange - fired on every pushed change.
|
|
72
|
+
* @returns the disposer closing the stream.
|
|
73
|
+
*/
|
|
74
|
+
export declare function subscribePanelEvents(root: string, onChange: (event: PanelChangeEvent) => void): () => void;
|
|
75
|
+
//# sourceMappingURL=api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"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;AAC/C,MAAM,MAAM,gBAAgB,GACxB;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,GACd;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,aAAa,CAAA;CAAE,GACtC;IAAE,IAAI,EAAE,gBAAgB,CAAA;CAAE,CAAA;AAE9B;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,GAAG,MAAM,IAAI,CAW1G"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Attached file reference pills, rendered in the `conversation.input.dock`
|
|
3
|
+
* band directly above the composer card.
|
|
4
|
+
*
|
|
5
|
+
* Design: the composer draft is the single source of truth. The pill row is
|
|
6
|
+
* a pure visual scan of `@<path>:<line>` tokens in the live draft — no
|
|
7
|
+
* occurrence table, no `slash/input-insert-reference` bail (that path
|
|
8
|
+
* requires a registered codec and fails with
|
|
9
|
+
* `no serializer for reference source "file"`), so sending is always a
|
|
10
|
+
* plain-text sink. Because the row derives from the draft, every mutation
|
|
11
|
+
* (typing, backspace, send, session switch) updates the pills for free.
|
|
12
|
+
*
|
|
13
|
+
* Each pill shows the basename (directory suffix only when the basename is
|
|
14
|
+
* ambiguous), the line range, and a dismiss × that removes the token from
|
|
15
|
+
* the draft. The full relative path rides the title tooltip.
|
|
16
|
+
* @module dsh-filemgr/client/chat/AttachedFilesDock
|
|
17
|
+
*/
|
|
18
|
+
import type { JSX } from 'react';
|
|
19
|
+
import type { ClientContext, SessionId } from '@deepseek-ai/dsh-client-runtime/client';
|
|
20
|
+
/** Minimal structural view of the conversation input service (see reference.ts). */
|
|
21
|
+
interface DraftInput {
|
|
22
|
+
state: {
|
|
23
|
+
getSnapshot(): {
|
|
24
|
+
draft: string;
|
|
25
|
+
draftRev: number;
|
|
26
|
+
};
|
|
27
|
+
subscribe(listener: () => void): () => void;
|
|
28
|
+
};
|
|
29
|
+
setDraft(draft: string): void;
|
|
30
|
+
}
|
|
31
|
+
interface ConversationService {
|
|
32
|
+
input: {
|
|
33
|
+
for(actx: ClientContext): DraftInput;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* The dock entry: subscribes to the session's draft and renders one pill per
|
|
38
|
+
* `@path:line` token. Renders nothing while the draft carries no references.
|
|
39
|
+
* @param sessionId - the addressed session (the dock is session-scoped).
|
|
40
|
+
* @param sessions - session scope resolver (actx for the input shell).
|
|
41
|
+
* @param conversation - conversation service face.
|
|
42
|
+
*/
|
|
43
|
+
export declare function AttachedFilesDock({ sessionId, sessions, conversation, }: {
|
|
44
|
+
sessionId: SessionId;
|
|
45
|
+
sessions: {
|
|
46
|
+
scope(id: SessionId): ClientContext | undefined;
|
|
47
|
+
};
|
|
48
|
+
conversation: ConversationService;
|
|
49
|
+
}): JSX.Element | null;
|
|
50
|
+
export {};
|
|
51
|
+
//# sourceMappingURL=AttachedFilesDock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AttachedFilesDock.d.ts","sourceRoot":"","sources":["../../../../src/client/chat/AttachedFilesDock.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAChC,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,wCAAwC,CAAA;AAMtF,oFAAoF;AACpF,UAAU,UAAU;IAClB,KAAK,EAAE;QACL,WAAW,IAAI;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,QAAQ,EAAE,MAAM,CAAA;SAAE,CAAA;QAClD,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAA;KAC5C,CAAA;IACD,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CAC9B;AACD,UAAU,mBAAmB;IAC3B,KAAK,EAAE;QAAE,GAAG,CAAC,IAAI,EAAE,aAAa,GAAG,UAAU,CAAA;KAAE,CAAA;CAChD;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,SAAS,EACT,QAAQ,EACR,YAAY,GACb,EAAE;IACD,SAAS,EAAE,SAAS,CAAA;IACpB,QAAQ,EAAE;QAAE,KAAK,CAAC,EAAE,EAAE,SAAS,GAAG,aAAa,GAAG,SAAS,CAAA;KAAE,CAAA;IAC7D,YAAY,EAAE,mBAAmB,CAAA;CAClC,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CAoDrB"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Chat file-reference click handling (issue #314): the transcript renders
|
|
3
|
+
* workspace file paths as inline code, and clicking one should locate the
|
|
4
|
+
* file in the Explorer (switch to the Files tab, expand the ancestor chain,
|
|
5
|
+
* select the node) and open it in the Preview panel — directories are
|
|
6
|
+
* reveal-only. A document-level click listener (wired in the client apply)
|
|
7
|
+
* recognizes a conservative subset: a single-line `code` element whose text
|
|
8
|
+
* is a workspace-relative path or an absolute path under the project root.
|
|
9
|
+
* Links (`a`), multi-line fences, URLs, escaped (`..`) paths and anything
|
|
10
|
+
* inside the panels' own subtrees keep their existing behavior.
|
|
11
|
+
* @module dsh-filemgr/client/chat/file-ref
|
|
12
|
+
*/
|
|
13
|
+
import type { PanelApi } from '../api.ts';
|
|
14
|
+
import type { PanelStores } from '../store.ts';
|
|
15
|
+
/**
|
|
16
|
+
* Interpret a code span's text as a workspace path. Returns the workspace
|
|
17
|
+
* RELATIVE path ('' = the root itself), or null when the text is not a
|
|
18
|
+
* recognizable in-workspace path. Never resolves above the root: `..`
|
|
19
|
+
* segments, absolute outside paths, URLs and whitespace/multi-line text all
|
|
20
|
+
* fall back to null so the transcript keeps its normal behavior.
|
|
21
|
+
*/
|
|
22
|
+
export declare function pathFromText(text: string, root: string): string | null;
|
|
23
|
+
/** The `code` element a click targets, when it is a candidate file ref. */
|
|
24
|
+
export declare function fileRefElement(target: EventTarget | null): HTMLElement | null;
|
|
25
|
+
/**
|
|
26
|
+
* Locate a workspace-relative path from the transcript: Files tab + expand
|
|
27
|
+
* ancestors + select; directories stay reveal-only, files also open in the
|
|
28
|
+
* Preview panel (dedup focuses the existing tab). The parent listing is
|
|
29
|
+
* consulted to classify the node; unknown paths keep the reveal and never
|
|
30
|
+
* issue a preview request.
|
|
31
|
+
*/
|
|
32
|
+
export declare function locateFileRef(stores: PanelStores, api: PanelApi, rel: string): Promise<void>;
|
|
33
|
+
/** Document-level click handler: locate recognized chat file references. */
|
|
34
|
+
export declare function handleFileRefClick(stores: PanelStores, api: PanelApi, event: MouseEvent): void;
|
|
35
|
+
//# sourceMappingURL=file-ref.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-ref.d.ts","sourceRoot":"","sources":["../../../../src/client/chat/file-ref.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAW9C;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CA8BtE;AAkBD,2EAA2E;AAC3E,wBAAgB,cAAc,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,GAAG,WAAW,GAAG,IAAI,CAU7E;AAED;;;;;;GAMG;AACH,wBAAsB,aAAa,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAoBlG;AAED,4EAA4E;AAC5E,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,GAAG,IAAI,CAoB9F"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Chat-transcript mermaid enhancement: the core conversation renderer emits
|
|
3
|
+
* fenced code as `pre > code.language-mermaid`, and the shell has no slot
|
|
4
|
+
* for message-body post-processing — so this component rides the
|
|
5
|
+
* conversation input dock as a zero-render sentinel and observes the
|
|
6
|
+
* document for mermaid blocks the transcript mounts. Blocks inside the
|
|
7
|
+
* preview panel's own subtree are excluded (each surface owns its blocks).
|
|
8
|
+
*
|
|
9
|
+
* Streaming awareness: an assistant message re-renders continuously, so a
|
|
10
|
+
* diagram fence is often incomplete mid-stream. Renders that fail restore
|
|
11
|
+
* the block and the next mutation retries it — once the fence closes the
|
|
12
|
+
* diagram lands. Mutations are debounced to one rAF so long transcripts do
|
|
13
|
+
* not re-scan the whole document: each batch is mapped to the minimal
|
|
14
|
+
* mutated subtrees and scoped per-frame while the first scheduled pass scans
|
|
15
|
+
* the body once. The observer is disconnected on unmount.
|
|
16
|
+
* @module dsh-filemgr/client/chat/mermaid-chat
|
|
17
|
+
*/
|
|
18
|
+
import type { JSX } from 'react';
|
|
19
|
+
/**
|
|
20
|
+
* Map a mutation batch to the minimal scan scopes that may contain new
|
|
21
|
+
* mermaid fences. Each record contributes its target and its added nodes
|
|
22
|
+
* (an added element directly; otherwise that node's parentElement), deduped
|
|
23
|
+
* by identity. Disconnected nodes and removed-only records yield nothing —
|
|
24
|
+
* removal never introduces a fence. Pure (DOM-read only) so tests can drive
|
|
25
|
+
* it in jsdom.
|
|
26
|
+
*/
|
|
27
|
+
export declare function enhanceScopesFor(records: MutationRecord[]): Element[];
|
|
28
|
+
/** Hidden sentinel: renders nothing, owns the transcript observer. */
|
|
29
|
+
export declare function MermaidChatEnhancer(): JSX.Element | null;
|
|
30
|
+
//# sourceMappingURL=mermaid-chat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mermaid-chat.d.ts","sourceRoot":"","sources":["../../../../src/client/chat/mermaid-chat.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAIhC;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,cAAc,EAAE,GAAG,OAAO,EAAE,CAerE;AAED,sEAAsE;AACtE,wBAAgB,mBAAmB,IAAI,GAAG,CAAC,OAAO,GAAG,IAAI,CAoDxD"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Composer placeholder hint: the shell owns the input-bar placeholder
|
|
3
|
+
* ("给智能体发消息") and exposes no override seam (the composer bar is a
|
|
4
|
+
* single slot owned by ui-conversation, and its locale namespace rejects
|
|
5
|
+
* duplicate registration), so this zero-render sentinel — riding the same
|
|
6
|
+
* `conversation.input.dock` band as the mermaid enhancer — rewrites the
|
|
7
|
+
* placeholder attribute in the DOM. It re-applies on any placeholder
|
|
8
|
+
* attribute change or node insert, which covers React re-renders that
|
|
9
|
+
* reset the attribute to the shell default. English UI is left untouched
|
|
10
|
+
* (exact-match on the Chinese string only).
|
|
11
|
+
* @module dsh-filemgr/client/chat/placeholder-hint
|
|
12
|
+
*/
|
|
13
|
+
import type { JSX } from 'react';
|
|
14
|
+
/** Hidden sentinel: renders nothing, owns the placeholder rewriting observer. */
|
|
15
|
+
export declare function PlaceholderHint(): JSX.Element | null;
|
|
16
|
+
//# sourceMappingURL=placeholder-hint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"placeholder-hint.d.ts","sourceRoot":"","sources":["../../../../src/client/chat/placeholder-hint.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAYhC,iFAAiF;AACjF,wBAAgB,eAAe,IAAI,GAAG,CAAC,OAAO,GAAG,IAAI,CAkBpD"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Explorer column: Files/Changes tab bar (37px), the persistent filename
|
|
3
|
+
* search at the top of the Files tab (150ms debounced; a hit click REVEALS
|
|
4
|
+
* the file in the tree — expand ancestors + select — never opens preview),
|
|
5
|
+
* the lazy file tree (34px rows, full-row expand/collapse, 16px icons), and
|
|
6
|
+
* the in-column collapse chevron.
|
|
7
|
+
*
|
|
8
|
+
* FileManager Explorer behavior (Apache-2.0, re-implemented): row click toggles
|
|
9
|
+
* folders (no need to hit the arrow), search results are reveal-only, and
|
|
10
|
+
* clicking a file opens it in the preview panel (dedup focuses the tab).
|
|
11
|
+
* @module dsh-filemgr/client/components/ExplorerPanel
|
|
12
|
+
*/
|
|
13
|
+
import type { JSX } from 'react';
|
|
14
|
+
import type { PanelStores } from '../store.ts';
|
|
15
|
+
import '../styles/tokens.module.css';
|
|
16
|
+
/**
|
|
17
|
+
* The whole explorer column content.
|
|
18
|
+
* @param stores - the panel store bundle.
|
|
19
|
+
* @param onToggleCollapse - collapse the column (host chrome).
|
|
20
|
+
*/
|
|
21
|
+
export declare function ExplorerPanel({ stores, onToggleCollapse, onReference, }: {
|
|
22
|
+
stores: PanelStores;
|
|
23
|
+
onToggleCollapse: () => void;
|
|
24
|
+
onReference: (path: string, isDir: boolean) => void;
|
|
25
|
+
}): JSX.Element;
|
|
26
|
+
//# sourceMappingURL=ExplorerPanel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExplorerPanel.d.ts","sourceRoot":"","sources":["../../../../src/client/components/ExplorerPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,KAAK,EAAa,GAAG,EAAiC,MAAM,OAAO,CAAA;AAK1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAQ9C,OAAO,6BAA6B,CAAA;AAKpC;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,EAC5B,MAAM,EACN,gBAAgB,EAChB,WAAW,GACZ,EAAE;IACD,MAAM,EAAE,WAAW,CAAA;IACnB,gBAAgB,EAAE,MAAM,IAAI,CAAA;IAC5B,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAA;CACpD,GAAG,GAAG,CAAC,OAAO,CAyMd"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 16x16 file/folder icons for the tree — a small built-in set (folder
|
|
3
|
+
* open/closed, file variants by kind) using the token colors, so both themes
|
|
4
|
+
* stay consistent without pulling in a vscode-icons package.
|
|
5
|
+
* @module dsh-filemgr/client/components/FileIcon
|
|
6
|
+
*/
|
|
7
|
+
import type { JSX } from 'react';
|
|
8
|
+
/** The icon for one tree entry (16x16, currentColor). */
|
|
9
|
+
export declare function FileTypeIcon({ name, isDir, expanded, className, }: {
|
|
10
|
+
name: string;
|
|
11
|
+
isDir: boolean;
|
|
12
|
+
expanded: boolean;
|
|
13
|
+
className?: string;
|
|
14
|
+
}): JSX.Element;
|
|
15
|
+
//# sourceMappingURL=FileIcon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileIcon.d.ts","sourceRoot":"","sources":["../../../../src/client/components/FileIcon.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAMhC,yDAAyD;AACzD,wBAAgB,YAAY,CAAC,EAC3B,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,SAAS,GACV,EAAE;IACD,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,OAAO,CAAA;IACd,QAAQ,EAAE,OAAO,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,GAAG,GAAG,CAAC,OAAO,CAqBd"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Changes (SCM) panel: per-repo working-tree status grouped into staged /
|
|
3
|
+
* unstaged / untracked, with stage/unstage/discard actions on every row and
|
|
4
|
+
* bulk actions in the section header. The host status is the only truth — no
|
|
5
|
+
* optimistic rows; a failed batch surfaces its paths and the next refresh
|
|
6
|
+
* clears the flag. Discard confirms with copy split by recoverability
|
|
7
|
+
* (untracked = delete vs tracked = irreversible restore).
|
|
8
|
+
*
|
|
9
|
+
* FileManager ScmPanel behavior (Apache-2.0, re-implemented): window focus
|
|
10
|
+
* refreshes (external editors write without git events), unknown states
|
|
11
|
+
* render as a quiet '?', conflicted rows are visually distinct AND have no
|
|
12
|
+
* actions.
|
|
13
|
+
* @module dsh-filemgr/client/components/ScmPanel
|
|
14
|
+
*/
|
|
15
|
+
import type { JSX } from 'react';
|
|
16
|
+
import type { PanelStores } from '../store.ts';
|
|
17
|
+
/** The SCM tab body.
|
|
18
|
+
* @param stores - the panel store bundle.
|
|
19
|
+
*/
|
|
20
|
+
export declare function ScmPanel({ stores }: {
|
|
21
|
+
stores: PanelStores;
|
|
22
|
+
}): JSX.Element;
|
|
23
|
+
//# sourceMappingURL=ScmPanel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScmPanel.d.ts","sourceRoot":"","sources":["../../../../src/client/components/ScmPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAIhC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAuC9C;;GAEG;AACH,wBAAgB,QAAQ,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,WAAW,CAAA;CAAE,GAAG,GAAG,CAAC,OAAO,CA2KzE"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { KeyboardEvent } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Keyboard activation parity for focusable rows/divs styled as buttons
|
|
4
|
+
* (role="button" + tabIndex={0}): Enter and Space trigger the same action as
|
|
5
|
+
* a click, and events bubbling out of nested interactive elements (a row's
|
|
6
|
+
* inline action buttons, a tab's close control) are ignored so they never
|
|
7
|
+
* double-activate the row.
|
|
8
|
+
* @param handler - the activation handler (the element's click action).
|
|
9
|
+
* @returns a keydown handler for the focusable element.
|
|
10
|
+
*/
|
|
11
|
+
export declare function activateOnKey(handler: () => void): (event: KeyboardEvent<HTMLElement>) => void;
|
|
12
|
+
//# sourceMappingURL=a11y.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"a11y.d.ts","sourceRoot":"","sources":["../../../../src/client/components/a11y.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAE1C;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,IAAI,WAChC,aAAa,CAAC,WAAW,CAAC,KAAG,IAAI,CAOjD"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inline 16px icon set for the panel surfaces (outline style, currentColor).
|
|
3
|
+
* No icon package is introduced; the set covers the explorer tree, SCM rows,
|
|
4
|
+
* and the preview toolbar/tabs with plain geometric shapes.
|
|
5
|
+
* @module dsh-filemgr/client/components/icons
|
|
6
|
+
*/
|
|
7
|
+
import type { JSX } from 'react';
|
|
8
|
+
interface IconProps {
|
|
9
|
+
size?: number;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function FolderIcon({ size, className }: IconProps): JSX.Element;
|
|
13
|
+
export declare function FolderOpenIcon({ size, className }: IconProps): JSX.Element;
|
|
14
|
+
export declare function FileIcon({ size, className }: IconProps): JSX.Element;
|
|
15
|
+
export declare function FileCodeIcon({ size, className }: IconProps): JSX.Element;
|
|
16
|
+
export declare function FileImageIcon({ size, className }: IconProps): JSX.Element;
|
|
17
|
+
export declare function FileTextIcon({ size, className }: IconProps): JSX.Element;
|
|
18
|
+
export declare function ChevronRightIcon({ size, className }: IconProps): JSX.Element;
|
|
19
|
+
export declare function ChevronDownIcon({ size, className }: IconProps): JSX.Element;
|
|
20
|
+
export declare function CloseIcon({ size, className }: IconProps): JSX.Element;
|
|
21
|
+
export declare function PlusIcon({ size, className }: IconProps): JSX.Element;
|
|
22
|
+
export declare function MinusIcon({ size, className }: IconProps): JSX.Element;
|
|
23
|
+
export declare function UndoIcon({ size, className }: IconProps): JSX.Element;
|
|
24
|
+
export declare function RefreshIcon({ size, className }: IconProps): JSX.Element;
|
|
25
|
+
export declare function SplitIcon({ size, className }: IconProps): JSX.Element;
|
|
26
|
+
export declare function CodeIcon({ size, className }: IconProps): JSX.Element;
|
|
27
|
+
export declare function EyeIcon({ size, className }: IconProps): JSX.Element;
|
|
28
|
+
export declare function SaveIcon({ size, className }: IconProps): JSX.Element;
|
|
29
|
+
export declare function DownloadIcon({ size, className }: IconProps): JSX.Element;
|
|
30
|
+
export declare function ExternalIcon({ size, className }: IconProps): JSX.Element;
|
|
31
|
+
export declare function SearchIcon({ size, className }: IconProps): JSX.Element;
|
|
32
|
+
export declare function BranchIcon({ size, className }: IconProps): JSX.Element;
|
|
33
|
+
export declare function ListIcon({ size, className }: IconProps): JSX.Element;
|
|
34
|
+
export declare function TreeIcon({ size, className }: IconProps): JSX.Element;
|
|
35
|
+
export declare function ShrinkIcon({ size, className }: IconProps): JSX.Element;
|
|
36
|
+
export declare function ExpandRightIcon({ size, className }: IconProps): JSX.Element;
|
|
37
|
+
export declare function EmptyFolderIcon({ size, className }: IconProps): JSX.Element;
|
|
38
|
+
export declare function MaximizeIcon({ size, className }: IconProps): JSX.Element;
|
|
39
|
+
export declare function RestoreIcon({ size, className }: IconProps): JSX.Element;
|
|
40
|
+
export {};
|
|
41
|
+
//# sourceMappingURL=icons.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../../src/client/components/icons.tsx"],"names":[],"mappings":"AAAA;;;;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AC,EAAE,IAAS,EAAE,SAAS,EAAE,EAAE,SAAS,GAAG,GAAG,CAAC,OAAO,CAO3E;AAED,wBAAgB,eAAe,CAAC,EAAE,IAAS,EAAE,SAAS,EAAE,EAAE,SAAS,GAAG,GAAG,CAAC,OAAO,CAMhF;AAED,wBAAgB,eAAe,CAAC,EAAE,IAAS,EAAE,SAAS,EAAE,EAAE,SAAS,GAAG,GAAG,CAAC,OAAO,CAMhF;AAED,wBAAgB,YAAY,CAAC,EAAE,IAAS,EAAE,SAAS,EAAE,EAAE,SAAS,GAAG,GAAG,CAAC,OAAO,CAM7E;AAED,wBAAgB,WAAW,CAAC,EAAE,IAAS,EAAE,SAAS,EAAE,EAAE,SAAS,GAAG,GAAG,CAAC,OAAO,CAO5E"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal overlay primitives for the panel: a toast and a context menu,
|
|
3
|
+
* rendered through plain DOM + portals so they can live outside the grid
|
|
4
|
+
* columns (fixed positioning, high z-index).
|
|
5
|
+
* @module dsh-filemgr/client/components/overlay
|
|
6
|
+
*/
|
|
7
|
+
import type { JSX } from 'react';
|
|
8
|
+
/** One transient toast message. */
|
|
9
|
+
export declare function toast(message: string): void;
|
|
10
|
+
/** One context-menu entry (separators carry no handler). */
|
|
11
|
+
export interface MenuEntry {
|
|
12
|
+
key: string;
|
|
13
|
+
label: string;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
danger?: boolean;
|
|
16
|
+
onSelect?: () => void;
|
|
17
|
+
}
|
|
18
|
+
export interface MenuState {
|
|
19
|
+
x: number;
|
|
20
|
+
y: number;
|
|
21
|
+
entries: MenuEntry[];
|
|
22
|
+
}
|
|
23
|
+
/** The shared context-menu portal host (one at a time). */
|
|
24
|
+
export declare function ContextMenu({ state, onClose }: {
|
|
25
|
+
state: MenuState | null;
|
|
26
|
+
onClose: () => void;
|
|
27
|
+
}): JSX.Element | null;
|
|
28
|
+
/** A single-text-input dialog (rename, new file / new folder). */
|
|
29
|
+
export declare function PromptDialog({ title, initialValue, confirmLabel, onConfirm, onCancel, }: {
|
|
30
|
+
title: string;
|
|
31
|
+
initialValue?: string;
|
|
32
|
+
confirmLabel?: string;
|
|
33
|
+
onConfirm: (value: string) => void;
|
|
34
|
+
onCancel: () => void;
|
|
35
|
+
}): JSX.Element;
|
|
36
|
+
/** A confirmation dialog (dirty-close confirm, discard confirm). */
|
|
37
|
+
export declare function ConfirmDialog({ title, body, confirmLabel, danger, onConfirm, onCancel, }: {
|
|
38
|
+
title: string;
|
|
39
|
+
body: string;
|
|
40
|
+
confirmLabel?: string;
|
|
41
|
+
danger?: boolean;
|
|
42
|
+
onConfirm: () => void;
|
|
43
|
+
onCancel: () => void;
|
|
44
|
+
}): JSX.Element;
|
|
45
|
+
//# sourceMappingURL=overlay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"overlay.d.ts","sourceRoot":"","sources":["../../../../src/client/components/overlay.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAIhC,mCAAmC;AACnC,wBAAgB,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAU3C;AAED,4DAA4D;AAC5D,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;CACtB;AAED,MAAM,WAAW,SAAS;IACxB,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;IACT,OAAO,EAAE,SAAS,EAAE,CAAA;CACrB;AAED,2DAA2D;AAC3D,wBAAgB,WAAW,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;IAAE,KAAK,EAAE,SAAS,GAAG,IAAI,CAAC;IAAC,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CAwEpH;AAED,kEAAkE;AAClE,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,QAAQ,GACT,EAAE;IACD,KAAK,EAAE,MAAM,CAAA;IACb,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC,QAAQ,EAAE,MAAM,IAAI,CAAA;CACrB,GAAG,GAAG,CAAC,OAAO,CAmDd;AAED,oEAAoE;AACpE,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,IAAI,EACJ,YAAY,EACZ,MAAM,EACN,SAAS,EACT,QAAQ,GACT,EAAE;IACD,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,SAAS,EAAE,MAAM,IAAI,CAAA;IACrB,QAAQ,EAAE,MAAM,IAAI,CAAA;CACrB,GAAG,GAAG,CAAC,OAAO,CA2Bd"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Composer dock inlay: the drop target for explorer file drags. It mounts
|
|
3
|
+
* in the official `conversation.input.dock` band (a session-scoped list
|
|
4
|
+
* slot declared by the shipped ui-conversation rc.6 shell), so it stacks
|
|
5
|
+
* with the git-graph chip above the composer card. While a file row is
|
|
6
|
+
* dragged over the page it shows a hint strip; on drop it splices the
|
|
7
|
+
* workspace-relative path into the active session's draft through the
|
|
8
|
+
* conversation input facade.
|
|
9
|
+
*
|
|
10
|
+
* The document-level listeners only claim drags carrying our custom MIME —
|
|
11
|
+
* the composer host's own drop handling (OS image files) is untouched. The
|
|
12
|
+
* host's `dragover` refuses every drop it does not claim, so this inlay
|
|
13
|
+
* must `preventDefault` its own drags to make the drop land.
|
|
14
|
+
* @module dsh-filemgr/client/drag/DragFileInlay
|
|
15
|
+
*/
|
|
16
|
+
import { type ReactElement } from 'react';
|
|
17
|
+
import type { PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
|
|
18
|
+
/** Injected business face of the drag inlay (session-routed). */
|
|
19
|
+
export interface DragFileInjected {
|
|
20
|
+
/** Splice a workspace-relative path into the active session's draft. */
|
|
21
|
+
insertPath: (path: string) => boolean;
|
|
22
|
+
}
|
|
23
|
+
/** Composed props: the dock's runtime share (sessionId) + the injected verb. */
|
|
24
|
+
export type DragFileInlayProps = PropsRuntime<'conversation.input.dock'> & DragFileInjected;
|
|
25
|
+
/**
|
|
26
|
+
* The composer dock entry: a zero-height anchor that shows a hint strip
|
|
27
|
+
* while a file row is dragged over the page and inserts the path on drop.
|
|
28
|
+
* @param props - the composed dock entry props.
|
|
29
|
+
*/
|
|
30
|
+
export declare function DragFileInlay(props: DragFileInlayProps): ReactElement;
|
|
31
|
+
//# sourceMappingURL=DragFileInlay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DragFileInlay.d.ts","sourceRoot":"","sources":["../../../../src/client/drag/DragFileInlay.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAA+B,KAAK,YAAY,EAAE,MAAM,OAAO,CAAA;AACtE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AAMpE,iEAAiE;AACjE,MAAM,WAAW,gBAAgB;IAC/B,wEAAwE;IACxE,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAA;CACtC;AAED,gFAAgF;AAChF,MAAM,MAAM,kBAAkB,GAC5B,YAAY,CAAC,yBAAyB,CAAC,GACrC,gBAAgB,CAAA;AAEpB;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,GAAG,YAAY,CAiDrE"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure drag-to-composer helpers shared by the explorer rows (the drag
|
|
3
|
+
* source) and the composer dock inlay (the drop target): the custom MIME
|
|
4
|
+
* type, the drag-state detector, and the draft-splicing rule. Deliberately
|
|
5
|
+
* framework-free so the splicing math is unit-testable in isolation.
|
|
6
|
+
*
|
|
7
|
+
* The composer host only accepts OS image drops (its document-level drop
|
|
8
|
+
* handler checks `dataTransfer.types` for `Files` and routes through the
|
|
9
|
+
* image pipeline), so a workspace file needs its own MIME. A plain relative
|
|
10
|
+
* path is inserted into the draft — the agent reads the file through its
|
|
11
|
+
* existing tools without any prefix grammar.
|
|
12
|
+
* @module dsh-filemgr/client/drag/file-drag
|
|
13
|
+
*/
|
|
14
|
+
/** Custom MIME carrying a workspace-relative file path. */
|
|
15
|
+
export declare const FILE_DRAG_MIME = "application/x-dsh-file";
|
|
16
|
+
/**
|
|
17
|
+
* Whether a drag event carries our file payload.
|
|
18
|
+
* @param types - the live `dataTransfer.types` list (read-only during drag).
|
|
19
|
+
* @returns true when our MIME is present.
|
|
20
|
+
*/
|
|
21
|
+
export declare function hasFileDrag(types: readonly string[] | undefined): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Whether a drop payload is a plausible workspace-relative path. The custom
|
|
24
|
+
* MIME only proves the drag carries *some* string — a foreign page can set it
|
|
25
|
+
* too, so the payload itself is validated before it reaches the draft:
|
|
26
|
+
* relative POSIX shape only; no absolute paths, no '..' segments, no
|
|
27
|
+
* backslashes, no control characters, and a sane length.
|
|
28
|
+
* @param path - the raw payload from dataTransfer.
|
|
29
|
+
* @returns true when the payload is safe to splice into the draft.
|
|
30
|
+
*/
|
|
31
|
+
export declare function isValidFileDragPayload(path: string): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Splice a workspace-relative path into a composer draft at the caret.
|
|
34
|
+
*
|
|
35
|
+
* Separator rule: one space is added before the path unless the caret sits
|
|
36
|
+
* at the start of the draft or right after whitespace; one space is added
|
|
37
|
+
* after the path unless the caret sits at the end of the draft or right
|
|
38
|
+
* before whitespace. Empty path or an out-of-range caret are no-ops.
|
|
39
|
+
*
|
|
40
|
+
* @param draft - the current draft text.
|
|
41
|
+
* @param path - the relative path to insert.
|
|
42
|
+
* @param caret - insertion offset (default: the end of the draft).
|
|
43
|
+
* @returns the next draft; the caller owns writing it through the input
|
|
44
|
+
* facade.
|
|
45
|
+
*/
|
|
46
|
+
export declare function insertPathIntoDraft(draft: string, path: string, caret?: number): string;
|
|
47
|
+
//# sourceMappingURL=file-drag.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-drag.d.ts","sourceRoot":"","sources":["../../../../src/client/drag/file-drag.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,2DAA2D;AAC3D,eAAO,MAAM,cAAc,2BAA2B,CAAA;AAEtD;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,GAAG,OAAO,CAEzE;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAO5D;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAQvF"}
|