@deepseek-ai/dsh-client-ui-primitives 0.1.6-alpha.2 → 0.1.7-alpha.1
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.i18n.yaml +2 -2
- package/README.md +25 -11
- package/README.zh.md +25 -11
- package/lib/ConnectionIndicator.module.css +1 -10
- package/lib/HoverCard.module.css +27 -0
- package/lib/Menu.module.css +68 -48
- package/lib/Modal.module.css +6 -2
- package/lib/OnboardingSurface.module.css +1 -2
- package/lib/PathLabel.module.css +28 -0
- package/lib/RiskConfirmation.module.css +1 -1
- package/lib/SegmentedControl.module.css +76 -0
- package/lib/SegmentedTabs.module.css +55 -0
- package/lib/StateDot.module.css +64 -37
- package/lib/TerminalBlock.module.css +13 -6
- package/lib/TextShimmer.module.css +27 -0
- package/lib/Toast.module.css +31 -2
- package/lib/Tooltip.module.css +12 -0
- package/lib/index.js +5418 -2739
- package/lib/markdown/MarkdownText.module.css +1 -1
- package/lib/settings-form/SettingsForm.module.css +53 -0
- package/lib/settings-form/fields.module.css +145 -0
- package/lib/types/ConfigField.d.ts +33 -0
- package/lib/types/DisclosureRow.d.ts +4 -1
- package/lib/types/HoverCard.d.ts +14 -4
- package/lib/types/LinkIcon.d.ts +15 -30
- package/lib/types/Menu.d.ts +50 -5
- package/lib/types/PathLabel.d.ts +13 -0
- package/lib/types/PermissionIcon.d.ts +39 -0
- package/lib/types/ReferenceIcon.d.ts +12 -7
- package/lib/types/SegmentedControl.d.ts +35 -0
- package/lib/types/SegmentedTabs.d.ts +26 -0
- package/lib/types/SiteGlyph.d.ts +1 -1
- package/lib/types/StateDot.d.ts +6 -4
- package/lib/types/TerminalBlock.d.ts +15 -3
- package/lib/types/TextShimmer.d.ts +13 -0
- package/lib/types/Toast.d.ts +19 -2
- package/lib/types/Tooltip.d.ts +12 -2
- package/lib/types/code-file-types.d.ts +1 -1
- package/lib/types/code-highlighting.d.ts +19 -0
- package/lib/types/icons/index.d.ts +376 -195
- package/lib/types/icons/props.d.ts +1 -1
- package/lib/types/icons/shared-artwork.d.ts +36 -0
- package/lib/types/index.d.ts +21 -4
- package/lib/types/overlay-top-margin.d.ts +14 -0
- package/lib/types/plugin-artwork.d.ts +17 -0
- package/lib/types/settings-form/SettingsForm.d.ts +46 -0
- package/lib/types/settings-form/fields.d.ts +69 -0
- package/lib/types/settings-form/form-model.d.ts +214 -0
- package/lib/types/useAnchoredMaxHeight.d.ts +4 -1
- package/lib/types/useAnchoredPosition.d.ts +3 -1
- package/package.json +5 -3
|
@@ -46,12 +46,24 @@ export interface TerminalBlockProps {
|
|
|
46
46
|
/** Settled terminating signal name; any value renders the status pill, taking precedence over the exit code. */
|
|
47
47
|
signal?: string | undefined;
|
|
48
48
|
/**
|
|
49
|
-
* The command is still running: the block shows the prompt
|
|
50
|
-
*
|
|
49
|
+
* The command is still running: with no `output` the block shows the prompt
|
|
50
|
+
* line alone; with output it renders the live text under the running state.
|
|
51
51
|
*/
|
|
52
52
|
running?: boolean | undefined;
|
|
53
53
|
/** Height cap in output lines before the middle collapses (default {@link DEFAULT_TERMINAL_MAX_LINES}); Infinity disables the cap. */
|
|
54
54
|
maxLines?: number | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* Copy-control payload override; the control copies the raw output when
|
|
57
|
+
* absent. Supplying it also keeps the control rendered before any output
|
|
58
|
+
* exists — a command is copyable before it prints.
|
|
59
|
+
*/
|
|
60
|
+
copyText?: string | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* Draw the run-state dot and its assistive label in the card gutter
|
|
63
|
+
* (default true). Hosts whose surrounding row already carries the same
|
|
64
|
+
* state omit both and reclaim the gutter via `--dsl-terminal-gutter`.
|
|
65
|
+
*/
|
|
66
|
+
runStateDot?: boolean | undefined;
|
|
55
67
|
/** Extra class merged onto the wrapper (callers position; this component draws). */
|
|
56
68
|
className?: string | undefined;
|
|
57
69
|
/** Localized display copy supplied by the owning render site. */
|
|
@@ -62,5 +74,5 @@ export interface TerminalBlockProps {
|
|
|
62
74
|
* @param props - see {@link TerminalBlockProps}.
|
|
63
75
|
* @returns the terminal block element.
|
|
64
76
|
*/
|
|
65
|
-
export declare function TerminalBlock({ command, cwd, home, output, exitCode, signal, running, maxLines, className, labels, }: TerminalBlockProps): import("react").JSX.Element;
|
|
77
|
+
export declare function TerminalBlock({ command, cwd, home, output, exitCode, signal, running, maxLines, copyText, runStateDot, className, labels, }: TerminalBlockProps): import("react").JSX.Element;
|
|
66
78
|
//# sourceMappingURL=TerminalBlock.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** Text and activity supplied by the owning row. */
|
|
2
|
+
export interface TextShimmerProps {
|
|
3
|
+
children: string;
|
|
4
|
+
active: boolean;
|
|
5
|
+
className?: string | undefined;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Render text with an optional moving highlight; inactive text keeps the same node.
|
|
9
|
+
* @param props - localized text, running state, and owner styling.
|
|
10
|
+
* @returns the retained text span.
|
|
11
|
+
*/
|
|
12
|
+
export declare const TextShimmer: import("react").MemoExoticComponent<({ children, active, className }: TextShimmerProps) => import("react").JSX.Element>;
|
|
13
|
+
//# sourceMappingURL=TextShimmer.d.ts.map
|
package/lib/types/Toast.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ import type { ReactNode } from 'react';
|
|
|
6
6
|
* per-show sequence). Rendered through a body portal so an owner inside a
|
|
7
7
|
* transformed or filtered ancestor cannot trap the fixed banner in that
|
|
8
8
|
* ancestor's box.
|
|
9
|
+
* With unchanged holdMs, parent rerenders do not extend the lifetime.
|
|
10
|
+
* Completion calls the latest onDone handler; fully faded actions receive no input.
|
|
9
11
|
*
|
|
10
12
|
* The hold is the owner's to set, because how long a banner has to stay
|
|
11
13
|
* depends on how much there is to read: a one-line limit lands in the default
|
|
@@ -14,7 +16,16 @@ import type { ReactNode } from 'react';
|
|
|
14
16
|
* reads it as a custom property — so the two can no longer disagree and leave
|
|
15
17
|
* the banner unmounting mid-fade.
|
|
16
18
|
* @param props.text - resolved banner copy; the owner passes localized text.
|
|
17
|
-
* @param props.icon - optional leading glyph (e.g. a warning icon)
|
|
19
|
+
* @param props.icon - optional leading glyph (e.g. a warning icon); ignored
|
|
20
|
+
* under `tone="success"`, which brings its own glyph.
|
|
21
|
+
* @param props.tone - 'success' renders the design's circled green check as
|
|
22
|
+
* the leading glyph; omitted, the icon seat keeps its warning tint.
|
|
23
|
+
* @param props.actions - optional inline actions continuing the sentence:
|
|
24
|
+
* each renders its plain-text `prefix` (a connective like 或) followed by its
|
|
25
|
+
* localized `label` as blue clickable text, flowing after `text` as one
|
|
26
|
+
* sentence. Each press is the owner's to handle (e.g. undo the reported
|
|
27
|
+
* change, then unmount the toast). The banner surface stays click-through —
|
|
28
|
+
* only the action text takes the pointer.
|
|
18
29
|
* @param props.holdMs - full-opacity hold before the fade; defaults to 3000.
|
|
19
30
|
* @param props.anchor - optional element whose horizontal center the banner
|
|
20
31
|
* follows (e.g. the composer card, so the banner centers over the chat column
|
|
@@ -22,11 +33,17 @@ import type { ReactNode } from 'react';
|
|
|
22
33
|
* @param props.onDone - called once the fade completes; unmount the toast here.
|
|
23
34
|
* @returns the floating banner.
|
|
24
35
|
*/
|
|
25
|
-
export declare function Toast({ text, icon, anchor, holdMs, onDone }: {
|
|
36
|
+
export declare function Toast({ text, icon, tone, anchor, holdMs, actions, onDone }: {
|
|
26
37
|
text: string;
|
|
27
38
|
icon?: ReactNode;
|
|
39
|
+
tone?: 'success';
|
|
28
40
|
anchor?: HTMLElement | null;
|
|
29
41
|
holdMs?: number;
|
|
42
|
+
actions?: readonly {
|
|
43
|
+
label: string;
|
|
44
|
+
prefix?: string;
|
|
45
|
+
onClick: () => void;
|
|
46
|
+
}[];
|
|
30
47
|
onDone: () => void;
|
|
31
48
|
}): import("react").ReactPortal;
|
|
32
49
|
//# sourceMappingURL=Toast.d.ts.map
|
package/lib/types/Tooltip.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** Anchor-preserving tooltips with optional body portals for clipping containers. */
|
|
1
2
|
import type { FocusEventHandler, MouseEventHandler, ReactElement, Ref } from 'react';
|
|
2
3
|
/** Bubble placement relative to the anchor. */
|
|
3
4
|
export type TooltipSide = 'right' | 'bottom' | 'top';
|
|
@@ -6,6 +7,7 @@ interface AnchorProps {
|
|
|
6
7
|
ref?: Ref<HTMLElement> | undefined;
|
|
7
8
|
onMouseEnter?: MouseEventHandler | undefined;
|
|
8
9
|
onMouseLeave?: MouseEventHandler | undefined;
|
|
10
|
+
onClick?: MouseEventHandler | undefined;
|
|
9
11
|
onFocus?: FocusEventHandler | undefined;
|
|
10
12
|
onBlur?: FocusEventHandler | undefined;
|
|
11
13
|
}
|
|
@@ -14,19 +16,27 @@ type TooltipLabel = string | (() => string);
|
|
|
14
16
|
* Attach a hover/focus tooltip to an anchor element.
|
|
15
17
|
* @param props.label - bubble text, or a resolver evaluated only while the bubble is visible.
|
|
16
18
|
* @param props.side - placement relative to the anchor (default 'right').
|
|
19
|
+
* @param props.align - horizontal anchor-edge alignment for 'bottom'/'top' bubbles: 'end' pins
|
|
20
|
+
* the bubble's right edge to the anchor's (for anchors beside other hover surfaces the centered
|
|
21
|
+
* bubble would overlap); default 'center'. Ignored for side 'right'.
|
|
22
|
+
* @param props.portal - render the bubble under document.body to escape containing blocks and clipping ancestors.
|
|
17
23
|
* @param props.delayMs - hover delay in milliseconds; keyboard focus remains immediate.
|
|
18
24
|
* @param props.disabled - suppress the bubble while true; the anchor renders identically so
|
|
19
25
|
* toggling never remounts it (which would cut its CSS transitions).
|
|
20
26
|
* @param props.maxWidth - bubble width cap in pixels, for labels long enough that the default
|
|
21
27
|
* half-viewport cap would render a slab wider than the surface the anchor sits on.
|
|
22
28
|
* @param props.children - a single anchor element; its own ref (callback or object) is forwarded alongside the tooltip's.
|
|
23
|
-
* @returns the cloned anchor plus a fixed-position bubble
|
|
29
|
+
* @returns the cloned anchor plus a fixed-position bubble, optionally portaled to the body; clicking the
|
|
30
|
+
* anchor dismisses the bubble until the next trigger, and focus arriving after a pointer
|
|
31
|
+
* interaction (a closing menu refocusing its trigger) never raises it.
|
|
24
32
|
*/
|
|
25
|
-
export declare function Tooltip({ label, side, delayMs, disabled, maxWidth, children }: {
|
|
33
|
+
export declare function Tooltip({ label, side, align, delayMs, disabled, portal, maxWidth, children }: {
|
|
26
34
|
label: TooltipLabel;
|
|
27
35
|
side?: TooltipSide;
|
|
36
|
+
align?: 'center' | 'end';
|
|
28
37
|
delayMs?: number;
|
|
29
38
|
disabled?: boolean;
|
|
39
|
+
portal?: boolean;
|
|
30
40
|
maxWidth?: number;
|
|
31
41
|
children: ReactElement<AnchorProps>;
|
|
32
42
|
}): import("react").JSX.Element;
|
|
@@ -14,7 +14,7 @@ export interface FileTypeProjectContext {
|
|
|
14
14
|
*/
|
|
15
15
|
export declare function isCodeFileType(type: string): type is CodeFileType;
|
|
16
16
|
/**
|
|
17
|
-
* Test whether an extension
|
|
17
|
+
* Test whether an extension belongs to the established coarse link-icon code category.
|
|
18
18
|
* @param extension - Extension without a leading dot.
|
|
19
19
|
* @returns Whether clickable links keep the code glyph for this extension.
|
|
20
20
|
*/
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type HighlightSpan } from './markdown/highlight.ts';
|
|
2
|
+
/** Recognized filename suffixes whose source can use the shared syntax highlighter. */
|
|
3
|
+
export declare const CODE_HIGHLIGHT_EXTENSIONS: readonly string[];
|
|
4
|
+
/**
|
|
5
|
+
* Select the shared syntax highlighter's grammar from a filename.
|
|
6
|
+
* @param path - decoded source filename or path.
|
|
7
|
+
* @returns a supported grammar hint, or `undefined` for other suffixes.
|
|
8
|
+
*/
|
|
9
|
+
export declare function languageForPath(path: string): string | undefined;
|
|
10
|
+
/** Highlight one source fragment into one token list per line. */
|
|
11
|
+
export type CodeHighlighter = (code: string) => HighlightSpan[][] | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* Bind the shared lazy highlighter to one language and refresh after its grammar loads.
|
|
14
|
+
* @param language - grammar hint selected from the source filename.
|
|
15
|
+
* @returns a stable fragment highlighter; unknown and loading grammars return `undefined` for plain-text fallback.
|
|
16
|
+
*/
|
|
17
|
+
export declare function useCodeHighlighter(language: string | undefined): CodeHighlighter;
|
|
18
|
+
export type { HighlightSpan };
|
|
19
|
+
//# sourceMappingURL=code-highlighting.d.ts.map
|