@deepseek-ai/dsh-client-ui-primitives 0.2.1-alpha.2 → 0.2.1-alpha.3

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.
@@ -1,6 +1,6 @@
1
1
  import type { ReactNode, RefObject } from 'react';
2
2
  /**
3
- * Render an anchor with a hover-triggered preview card, hidden while a tooltip within the anchor is visible.
3
+ * Render an anchor with a hover-triggered preview card independently of nested tooltips.
4
4
  * @param props.anchor - the hover target (rendered in place inside a wrapper span).
5
5
  * @param props.content - card content; the pointer may rest on it, so it is
6
6
  * readable and selectable, but it carries no dismissal affordance of its own.
@@ -10,19 +10,22 @@ import type { ReactNode, RefObject } from 'react';
10
10
  * @param props.widthAnchorRef - optional element whose width and horizontal position size the preview.
11
11
  * @param props.inline - keep the anchor in prose; show a contained preview on hover or keyboard focus.
12
12
  * @param props.disabled - suppress opening; turning true dismisses an open card.
13
+ * @param props.grouped - share first-display dwell across the surrounding list and active portal.
14
+ * Group replacement removes the previous card immediately, including a fading preview.
13
15
  * @param props.copyText - optional primary value copied by activation and
14
16
  * included in the card's accessible name.
15
17
  * @param props.copyLabel - localized accessible activation-label prefix.
16
18
  * @param props.copiedLabel - localized visible success label.
17
19
  * @returns anchor wrapper with the conditional portaled card.
18
20
  */
19
- export declare function HoverCard({ anchor, content, openDelayMs, disabled, copyText, copyLabel, copiedLabel, variant, widthAnchorRef, inline, }: {
21
+ export declare function HoverCard({ anchor, content, openDelayMs, disabled, grouped, copyText, copyLabel, copiedLabel, variant, widthAnchorRef, inline, }: {
20
22
  anchor: ReactNode;
21
23
  /** Inline media preview using the shared menu material and keyboard focus. */
22
24
  inline?: boolean;
23
25
  content: ReactNode;
24
26
  openDelayMs?: number;
25
27
  disabled?: boolean;
28
+ grouped?: boolean;
26
29
  variant?: 'compact' | 'preview';
27
30
  widthAnchorRef?: RefObject<HTMLElement | null>;
28
31
  } & ({
@@ -0,0 +1,23 @@
1
+ import { type ReactNode } from 'react';
2
+ interface GroupState {
3
+ isWarm: () => boolean;
4
+ enter: (overCard: boolean) => void;
5
+ leave: () => void;
6
+ containsCard: (target: EventTarget | null) => boolean;
7
+ shown: (owner: symbol, dismiss: () => void, element: HTMLElement) => void;
8
+ release: (owner: symbol) => void;
9
+ }
10
+ /** Private coordination shared only by opted-in HoverCards inside one mounted group. */
11
+ export declare const HoverCardGroupContext: import("react").Context<GroupState | null>;
12
+ /**
13
+ * Share first-display dwell across a list and its active portal, including the card's existing pointer grace.
14
+ * @param props.children - list contents, including opted-in HoverCards.
15
+ * @param props.className - classes for the physical list container.
16
+ * @returns the list container and its private hover coordinator.
17
+ */
18
+ export declare function HoverCardGroup({ children, className }: {
19
+ children: ReactNode;
20
+ className?: string;
21
+ }): import("react").JSX.Element;
22
+ export {};
23
+ //# sourceMappingURL=HoverCardGroup.d.ts.map
@@ -36,4 +36,16 @@ export declare function PermissionIconFullAccessRegular(props: IconProps): React
36
36
  * @returns The medium decorative permission glyph.
37
37
  */
38
38
  export declare function PermissionIconFullAccessMedium(props: IconProps): ReactNode;
39
+ /**
40
+ * Render the auto-review permission icon with a one-pixel stroke.
41
+ * @param props - Size and optional class.
42
+ * @returns The regular decorative permission glyph.
43
+ */
44
+ export declare function PermissionIconAutoReviewRegular(props: IconProps): ReactNode;
45
+ /**
46
+ * Render the auto-review permission icon with a 1.3px stroke.
47
+ * @param props - Size and optional class.
48
+ * @returns The medium decorative permission glyph.
49
+ */
50
+ export declare function PermissionIconAutoReviewMedium(props: IconProps): ReactNode;
39
51
  //# sourceMappingURL=PermissionIcon.d.ts.map
@@ -52,6 +52,12 @@ export interface TerminalBlockProps {
52
52
  * line alone; with output it renders the live text under the running state.
53
53
  */
54
54
  running?: boolean | undefined;
55
+ /**
56
+ * The call launches background work (default false). `running` describes the
57
+ * launch call only; after it returns, retain the command without job status
58
+ * or output. An explicit `copyText` override remains available.
59
+ */
60
+ background?: boolean | undefined;
55
61
  /** Height cap in output lines before the middle collapses (default {@link DEFAULT_TERMINAL_MAX_LINES}); Infinity disables the cap. */
56
62
  maxLines?: number | undefined;
57
63
  /**
@@ -76,5 +82,5 @@ export interface TerminalBlockProps {
76
82
  * @param props - see {@link TerminalBlockProps}.
77
83
  * @returns the terminal block element.
78
84
  */
79
- export declare function TerminalBlock({ command, cwd, home, output, exitCode, signal, running, maxLines, copyText, runStateDot, className, labels, }: TerminalBlockProps): import("react").JSX.Element;
85
+ export declare function TerminalBlock({ command, cwd, home, output, exitCode, signal, running, background, maxLines, copyText, runStateDot, className, labels, }: TerminalBlockProps): import("react").JSX.Element;
80
86
  //# sourceMappingURL=TerminalBlock.d.ts.map
@@ -3,8 +3,8 @@ import type { FocusEventHandler, MouseEventHandler, ReactElement, Ref } from 're
3
3
  /** Bubble placement relative to the anchor. */
4
4
  export type TooltipSide = 'right' | 'bottom' | 'top';
5
5
  /**
6
- * Suppression channel for enclosing tooltip and hover-card anchors: a visible
7
- * tooltip within an anchor withdraws the enclosing preview while its bubble is shown.
6
+ * Suppression channel for nested tooltips: a visible descendant tooltip
7
+ * withdraws the enclosing tooltip while its bubble is shown.
8
8
  */
9
9
  export declare const TooltipSuppression: import("react").Context<((suppressed: boolean) => void) | null>;
10
10
  /** Props Tooltip injects into its anchor child; the child's own handlers are chained ahead of the tooltip's. */
@@ -32,6 +32,7 @@ export { useAnchoredPosition } from './useAnchoredPosition.ts';
32
32
  export type { AnchoredPositionOptions } from './useAnchoredPosition.ts';
33
33
  export { useDismissOnOutsidePointer } from './useDismissOnOutsidePointer.ts';
34
34
  export { HoverCard } from './HoverCard.tsx';
35
+ export { HoverCardGroup } from './HoverCardGroup.tsx';
35
36
  export { ShortcutKeys } from './ShortcutKeys.tsx';
36
37
  export { observeComposition } from './keyboard-composition.ts';
37
38
  export { focusWithoutRing } from './focus.ts';
@@ -44,14 +45,14 @@ export type { ConnectionIndicatorState } from './ConnectionIndicator.tsx';
44
45
  export { FishLogo, FISH_LOGO_PATH, FISH_LOGO_VIEWBOX } from './FishLogo.tsx';
45
46
  export { BrandWordmark } from './BrandWordmark.tsx';
46
47
  export type { BrandWordmarkProps } from './BrandWordmark.tsx';
47
- export { PermissionIconFullAccessMedium, PermissionIconFullAccessRegular, PermissionIconReadOnlyMedium, PermissionIconReadOnlyRegular, PermissionIconWorkspaceWriteMedium, PermissionIconWorkspaceWriteRegular, } from './PermissionIcon.tsx';
48
+ export { PermissionIconAutoReviewMedium, PermissionIconAutoReviewRegular, PermissionIconFullAccessMedium, PermissionIconFullAccessRegular, PermissionIconReadOnlyMedium, PermissionIconReadOnlyRegular, PermissionIconWorkspaceWriteMedium, PermissionIconWorkspaceWriteRegular, } from './PermissionIcon.tsx';
48
49
  export { ReferenceIconMedium, ReferenceIconRegular } from './ReferenceIcon.tsx';
49
50
  export type { ReferenceIconKind, ReferenceIconProps } from './ReferenceIcon.tsx';
50
51
  export { LinkIconMedium, LinkIconRegular, classifyLinkPath } from './LinkIcon.tsx';
51
52
  export type { LinkIconKind, LinkIconProps } from './LinkIcon.tsx';
52
53
  export { FileTypeIcon, classifyFileType, fileExtension } from './FileTypeIcon.tsx';
53
54
  export type { CodeFileType, FileType, FileTypeIconProps, FileTypeKind, FileTypeProjectContext, } from './FileTypeIcon.tsx';
54
- export { projectUserText, type UserTextReferences } from './user-text.tsx';
55
+ export { UserTextRun, ReferenceChip, type UserTextRunProps, type ReferenceChipProps } from './user-text.tsx';
55
56
  export { Tooltip } from './Tooltip.tsx';
56
57
  export type { TooltipSide } from './Tooltip.tsx';
57
58
  export { pointerModality } from './input-modality.ts';
@@ -1,37 +1,29 @@
1
+ /** Inline text and reference presentation; business rules supply resolved JSON data and actions. */
2
+ import type { ReactNode } from 'react';
3
+ import { type ReferenceIconKind } from './ReferenceIcon.tsx';
4
+ /** Plain text follows the wrapping and typography of its host. */
5
+ export interface UserTextRunProps {
6
+ readonly text: string;
7
+ }
1
8
  /**
2
- * Display projection of reference forms in sent user text (bubble and queue
3
- * rows). The logged model text remains the single truth; this is presentation
4
- * only. Inline references follow the consumer's wrapping policy and keep long
5
- * labels within its width. Four decoration sources, by precedence: the wire session form
6
- * `@[label](dsh-session:...)` folds to its label; exact session labels
7
- * supplied by an adjacent recall decorate their bare `@label` mention; plain
8
- * `@name` word-boundary tokens decorate by shape alone; and a plain `/name`
9
- * token decorates only when the caller names it — a skill the host actually
10
- * loaded for that message (ui-chat reads the step's `skill-invocation`
11
- * injections) or the command a command-input bubble echoes — so `/123` or a
12
- * stray `/word` stays plain text. A `/name` token is whitespace-bounded like
13
- * the host skill gesture (`dsh-tool-skill`): it ends at whitespace or the
14
- * text end, so slash paths (`/nfs-hg/xxx`, `/plan.md`) and punctuation-glued
15
- * tokens (`/plan。`) stay plain even for a loaded name.
9
+ * Render an uninterpreted inline text run.
10
+ * @param props - text retained verbatim from the caller's document.
11
+ * @returns one inline run without Markdown or reference recognition.
16
12
  */
17
- import type { ReactNode } from 'react';
18
- /** Optional navigation supplied by consumers that can preview references. */
19
- export interface UserTextReferences {
20
- /** Open a file path decoded from an `@` mention. */
21
- openFile: (path: string) => void;
22
- /** Open the source of a skill loaded for this message. */
23
- openSkill: (name: string) => void;
13
+ export declare function UserTextRun({ text }: UserTextRunProps): ReactNode;
14
+ /** Presentation selected by a reference renderer, independent of its matching grammar. */
15
+ export interface ReferenceChipProps {
16
+ readonly appearance: ReferenceIconKind | 'skill' | 'command';
17
+ readonly label: string;
18
+ readonly title: string;
19
+ /** Absent for display-only references and previews. */
20
+ readonly onActivate?: () => void;
24
21
  }
25
22
  /**
26
- * Split one sent text into inline plain runs and reference chips.
27
- * @param text - the logged model text of the message or queue row.
28
- * @param sessionLabels - exact session mention labels associated by an adjacent recall.
29
- * @param slashNames - names a `/name` token may decorate as: the skills the
30
- * host loaded for this message, or the command a command bubble echoes
31
- * (unsent queue rows pass none).
32
- * @param slashKind - the chip kind those tokens render as.
33
- * @param references - optional file and skill preview actions; session and command tokens stay labels.
34
- * @returns inline nodes covering the whole text.
23
+ * Render a reference label or its explicitly supplied activation action.
24
+ * Text selection and repeated pointer clicks do not activate the reference.
25
+ * @param props - resolved visual fields and optional action from the owning renderer.
26
+ * @returns an inline label, or a keyboard-accessible button when activation is supplied.
35
27
  */
36
- export declare function projectUserText(text: string, sessionLabels: readonly string[], slashNames?: readonly string[], slashKind?: 'skill' | 'command', references?: UserTextReferences): ReactNode;
28
+ export declare function ReferenceChip({ appearance, label, title, onActivate }: ReferenceChipProps): ReactNode;
37
29
  //# sourceMappingURL=user-text.d.ts.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deepseek-ai/dsh-client-ui-primitives",
3
3
  "description": "Pure React atoms for the dsh web UI: controls, icons, markdown, and JSON inspectors (zero cordis)",
4
- "version": "0.2.1-alpha.2",
4
+ "version": "0.2.1-alpha.3",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -23,11 +23,9 @@
23
23
  },
24
24
  "license": "MIT",
25
25
  "devDependencies": {
26
- "@deepseek-ai/dsh-client-store": "0.2.1-alpha.2",
27
- "@types/react": "~18.3.1",
28
- "@types/react-dom": "~18.3.0",
29
- "@deepseek-ai/cordis": "~4.0.5-alpha.1",
30
- "@deepseek-ai/dsh-util-code-language": "0.2.1-alpha.2",
26
+ "@deepseek-ai/dsh-client-store": "0.2.1-alpha.3",
27
+ "@deepseek-ai/cordis": "~4.0.5-alpha.2",
28
+ "@deepseek-ai/dsh-util-code-language": "0.2.1-alpha.3",
31
29
  "react": "^18.2.0",
32
30
  "clsx": "^2.0.0",
33
31
  "diff": "^9.0.0",
@@ -40,7 +38,7 @@
40
38
  "micromark-util-symbol": "^2.0.1",
41
39
  "micromark-util-types": "^2.0.2",
42
40
  "shiki": "^4.4.3",
43
- "@deepseek-ai/dsh-util-workspace-path": "0.2.1-alpha.2",
41
+ "@deepseek-ai/dsh-util-workspace-path": "0.2.1-alpha.3",
44
42
  "@shikijs/langs": "^4.4.3",
45
43
  "@types/mdast": "^4.0.4",
46
44
  "micromark-factory-space": "^2.0.1",
@@ -58,6 +56,6 @@
58
56
  "lib/types/**/*.d.ts"
59
57
  ],
60
58
  "peerDependencies": {
61
- "@deepseek-ai/cordis": "~4.0.5-alpha.1"
59
+ "@deepseek-ai/cordis": "~4.0.5-alpha.2"
62
60
  }
63
61
  }