@deepseek-ai/dsh-client-ui-primitives 0.2.1-rc.5 → 0.2.2-alpha.2

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.
Files changed (61) hide show
  1. package/README.i18n.yaml +18 -18
  2. package/README.md +35 -14
  3. package/README.zh.md +35 -14
  4. package/lib/AnimatedRows.module.css +7 -0
  5. package/lib/Button.module.css +18 -11
  6. package/lib/CodeCard.module.css +4 -2
  7. package/lib/ConnectionIndicator.module.css +8 -6
  8. package/lib/DetailDocument.module.css +67 -0
  9. package/lib/DiffBlock.module.css +4 -2
  10. package/lib/DisclosureRow.module.css +11 -7
  11. package/lib/HoverCard.module.css +13 -0
  12. package/lib/JsonTree.module.css +45 -9
  13. package/lib/Menu.module.css +14 -4
  14. package/lib/Modal.module.css +4 -2
  15. package/lib/Pill.module.css +4 -2
  16. package/lib/QuotePreview.module.css +101 -0
  17. package/lib/ReadBlock.module.css +4 -2
  18. package/lib/RowDragPreview.module.css +12 -0
  19. package/lib/SearchBlock.module.css +4 -2
  20. package/lib/SegmentedControl.module.css +6 -1
  21. package/lib/SegmentedTabs.module.css +25 -3
  22. package/lib/TerminalBlock.module.css +4 -2
  23. package/lib/Toast.module.css +4 -2
  24. package/lib/UserMessageBubble.module.css +11 -0
  25. package/lib/WebBlock.module.css +14 -2
  26. package/lib/ZoomControls.module.css +54 -0
  27. package/lib/index.js +3346 -4315
  28. package/lib/markdown/JsonBlock.module.css +4 -2
  29. package/lib/markdown/MarkdownText.module.css +37 -12
  30. package/lib/settings-form/fields.module.css +11 -3
  31. package/lib/types/AnimatedRows.d.ts +46 -0
  32. package/lib/types/Button.d.ts +1 -1
  33. package/lib/types/DetailDocument.d.ts +78 -0
  34. package/lib/types/DraggableImage.d.ts +19 -0
  35. package/lib/types/HoverCard.d.ts +7 -2
  36. package/lib/types/HoverCardGroup.d.ts +4 -2
  37. package/lib/types/QuotePreview.d.ts +24 -0
  38. package/lib/types/SegmentedTabs.d.ts +3 -1
  39. package/lib/types/Tooltip.d.ts +13 -7
  40. package/lib/types/UserMessageBubble.d.ts +11 -0
  41. package/lib/types/ZoomControls.d.ts +27 -0
  42. package/lib/types/document-zoom.d.ts +17 -0
  43. package/lib/types/file-drag-actions.d.ts +32 -0
  44. package/lib/types/focus.d.ts +7 -0
  45. package/lib/types/icons/artwork.d.ts +418 -0
  46. package/lib/types/icons/index.d.ts +195 -194
  47. package/lib/types/icons/shared-artwork.d.ts +6 -12
  48. package/lib/types/image-drag.d.ts +17 -0
  49. package/lib/types/index.d.ts +20 -1
  50. package/lib/types/markdown/MarkdownDelegate.d.ts +6 -1
  51. package/lib/types/markdown/MarkdownText.d.ts +9 -4
  52. package/lib/types/markdown/highlight.d.ts +22 -0
  53. package/lib/types/markdown/mathCompatibility.d.ts +14 -5
  54. package/lib/types/markdown/quote-text.d.ts +8 -0
  55. package/lib/types/markdown/render.d.ts +4 -1
  56. package/lib/types/markdown/windows-path-destinations.d.ts +11 -0
  57. package/lib/types/overlay-top-margin.d.ts +9 -2
  58. package/lib/types/use-clipboard-copy.d.ts +14 -0
  59. package/lib/types/useRowDragPreview.d.ts +20 -0
  60. package/package.json +9 -7
  61. package/lib/types/use-copy-feedback.d.ts +0 -14
@@ -13,8 +13,10 @@
13
13
  border-radius: var(--dsw-radius-sm);
14
14
  }
15
15
 
16
- .toggle:hover {
17
- background: var(--dsw-alias-interactive-bg-hover);
16
+ @media (hover: hover) {
17
+ .toggle:hover {
18
+ background: var(--dsw-alias-interactive-bg-hover);
19
+ }
18
20
  }
19
21
 
20
22
  .body {
@@ -74,13 +74,20 @@
74
74
  margin-right: -3px;
75
75
  }
76
76
 
77
- .markdown a:hover,
78
77
  .markdown a:focus {
79
78
  outline: none;
80
79
  text-decoration: underline dotted var(--dsw-alias-link);
81
80
  text-underline-offset: 3px;
82
81
  }
83
82
 
83
+ @media (hover: hover) {
84
+ .markdown a:hover {
85
+ outline: none;
86
+ text-decoration: underline dotted var(--dsw-alias-link);
87
+ text-underline-offset: 3px;
88
+ }
89
+ }
90
+
84
91
  .markdown a:focus-visible,
85
92
  .fileMention:focus-visible {
86
93
  box-shadow: 0 0 0 2px var(--dsw-focus-ring-color, var(--dsw-alias-state-business-primary));
@@ -195,8 +202,8 @@
195
202
  overscroll-behavior-x: contain;
196
203
  }
197
204
 
198
- /* Wide tables reveal their horizontal bar on hover (or keyboard focus)
199
- instead of keeping it painted. Chromium never repaints state-conditioned
205
+ /* Hover-capable inputs reveal a wide table's bar on hover or keyboard focus.
206
+ Other inputs keep native horizontal scrolling. Chromium never repaints state-conditioned
200
207
  scrollbar STYLES (neither hover-conditioned `::-webkit-scrollbar*` rules
201
208
  nor a :hover `scrollbar-color` change reaches the painted bar), so the
202
209
  toggle is `overflow-x` itself — a layout change repaints reliably. The
@@ -205,17 +212,23 @@
205
212
  Other engines and overlay scrollbars may reserve a different height.
206
213
  Wheel and trackpad scrolling need the pointer over the table, which is
207
214
  already the hover that re-enables scrolling. */
208
- .tableScroll:global(.md-table-wide) {
209
- overflow-x: hidden;
210
- padding-bottom: var(--dsh-scrollbar-width, 5px);
211
- }
212
-
213
- .tableScroll:global(.md-table-wide):hover,
214
215
  .tableScroll:global(.md-table-wide):focus-visible {
215
216
  overflow-x: scroll;
216
217
  padding-bottom: 0;
217
218
  }
218
219
 
220
+ @media (hover: hover) {
221
+ .tableScroll:global(.md-table-wide) {
222
+ overflow-x: hidden;
223
+ padding-bottom: var(--dsh-scrollbar-width, 5px);
224
+ }
225
+
226
+ .tableScroll:global(.md-table-wide):hover {
227
+ overflow-x: scroll;
228
+ padding-bottom: 0;
229
+ }
230
+ }
231
+
219
232
  /* Chromium keyboard-focuses scrollable containers by default; the ring uses
220
233
  the sheet's link focus color. */
221
234
  .tableScroll:focus-visible {
@@ -321,13 +334,20 @@
321
334
  text-align: inherit;
322
335
  }
323
336
 
324
- .fileMention:hover,
325
337
  .fileMention:focus {
326
338
  outline: none;
327
339
  text-decoration: underline dotted var(--dsw-alias-link);
328
340
  text-underline-offset: 3px;
329
341
  }
330
342
 
343
+ @media (hover: hover) {
344
+ .fileMention:hover {
345
+ outline: none;
346
+ text-decoration: underline dotted var(--dsw-alias-link);
347
+ text-underline-offset: 3px;
348
+ }
349
+ }
350
+
331
351
  .compact {
332
352
  max-width: 100%;
333
353
  font-size: var(--dsh-content-font-size-secondary, 13px);
@@ -374,13 +394,18 @@
374
394
  text-decoration: underline dotted;
375
395
  }
376
396
 
377
- .compact a:hover,
378
397
  .compact a:focus,
379
- .compact .fileMention:hover,
380
398
  .compact .fileMention:focus {
381
399
  text-decoration-color: currentColor;
382
400
  }
383
401
 
402
+ @media (hover: hover) {
403
+ .compact a:hover,
404
+ .compact .fileMention:hover {
405
+ text-decoration-color: currentColor;
406
+ }
407
+ }
408
+
384
409
  .compact :not(pre) > code {
385
410
  display: inline;
386
411
  font: inherit;
@@ -53,12 +53,18 @@
53
53
  cursor: pointer;
54
54
  }
55
55
 
56
- .helpButton:hover,
57
56
  .helpButton[aria-expanded='true'] {
58
57
  background: var(--dsw-alias-bg-layer-4);
59
58
  color: var(--dsw-alias-label-secondary);
60
59
  }
61
60
 
61
+ @media (hover: hover) {
62
+ .helpButton:hover {
63
+ background: var(--dsw-alias-bg-layer-4);
64
+ color: var(--dsw-alias-label-secondary);
65
+ }
66
+ }
67
+
62
68
  .helpButton:focus-visible {
63
69
  outline: var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color, var(--dsw-alias-state-business-primary));
64
70
  outline-offset: 1px;
@@ -96,8 +102,10 @@
96
102
  cursor: pointer;
97
103
  }
98
104
 
99
- .reset:hover:not(:disabled) {
100
- color: var(--dsw-alias-label-primary);
105
+ @media (hover: hover) {
106
+ .reset:hover:not(:disabled) {
107
+ color: var(--dsw-alias-label-primary);
108
+ }
101
109
  }
102
110
 
103
111
  .reset:disabled {
@@ -0,0 +1,46 @@
1
+ /** React-commit-driven movement and entry/exit fades for keyed rows. */
2
+ import { Component, type AriaRole, type ReactNode } from 'react';
3
+ /** Keyed row content, list semantics, and animation readiness. */
4
+ export interface AnimatedRowsProps {
5
+ children: ReactNode;
6
+ className: string;
7
+ role?: AriaRole;
8
+ label?: string;
9
+ /** Unique DOM-order keys matching the rendered data-row-key attributes. */
10
+ rowKeys: readonly string[];
11
+ ready: boolean;
12
+ /** Changes that replace the view or reveal hidden rows settle immediately. */
13
+ resetKey: string;
14
+ }
15
+ interface RowPosition {
16
+ element: HTMLElement;
17
+ rect: DOMRect;
18
+ opacity: number;
19
+ }
20
+ interface RowSnapshot {
21
+ positions: Map<string, RowPosition>;
22
+ removed: Map<string, RowPosition>;
23
+ }
24
+ /**
25
+ * Animates keyed rows only when their rendered membership or order changes.
26
+ * Motion starts after the first pointer or keyboard input inside the mounted list.
27
+ * The parent supplies a positioned container for the inert exit overlay.
28
+ */
29
+ export declare class AnimatedRows extends Component<AnimatedRowsProps> {
30
+ private armed;
31
+ private readonly list;
32
+ private readonly overlay;
33
+ private readonly movements;
34
+ private readonly exits;
35
+ getSnapshotBeforeUpdate(previous: AnimatedRowsProps): RowSnapshot | null;
36
+ componentDidUpdate(previous: AnimatedRowsProps, _state: unknown, snapshot: RowSnapshot | null): void;
37
+ componentWillUnmount(): void;
38
+ private readPositions;
39
+ private move;
40
+ private cancelMovements;
41
+ private removeExit;
42
+ private clear;
43
+ render(): ReactNode;
44
+ }
45
+ export {};
46
+ //# sourceMappingURL=AnimatedRows.d.ts.map
@@ -3,7 +3,7 @@ import { type ButtonHTMLAttributes, type ReactNode } from 'react';
3
3
  export type ButtonVariant = 'primary' | 'ghost' | 'outline' | 'toolbar';
4
4
  /**
5
5
  * Render a button.
6
- * @param props.variant - visual family (default 'ghost').
6
+ * @param props.variant - visual family (default 'ghost'); outlined buttons use a DPR-aware inset stroke.
7
7
  * @param props.size - 'md' 36px control with 12px corners or 'sm' 28px control with 8px corners.
8
8
  * @param props.icon - optional leading 16px icon node.
9
9
  * @param ref - native button for focus management and overlay anchors.
@@ -0,0 +1,78 @@
1
+ import { type ReactNode } from 'react';
2
+ import { type MarkdownLabels, type MarkdownPathImages } from './markdown/MarkdownText.tsx';
3
+ /** One read of a long Markdown description, such as a plugin's detail document. */
4
+ export type DetailDocumentState = {
5
+ readonly status: 'loading';
6
+ } | {
7
+ readonly status: 'found';
8
+ readonly markdown: string;
9
+ } | {
10
+ readonly status: 'none';
11
+ } | {
12
+ readonly status: 'error';
13
+ readonly message: string;
14
+ };
15
+ /** A read as owners track it: in flight, settled with a document or none, or failed with a localized message. */
16
+ export type DetailDocumentRead = undefined | {
17
+ readonly status: 'loading';
18
+ } | {
19
+ readonly status: 'ready';
20
+ readonly markdown: string | undefined;
21
+ } | {
22
+ readonly status: 'error';
23
+ readonly message: string;
24
+ };
25
+ /**
26
+ * The state {@link DetailDocument} shows for an owner's read: loading until it settles, then the document, none, or the
27
+ * failure.
28
+ * @param read - the owner's read; undefined before it starts.
29
+ * @returns the state to show.
30
+ */
31
+ export declare function detailDocumentState(read: DetailDocumentRead): DetailDocumentState;
32
+ /** Translated strings of a detail document's chrome, as an owner's dictionary supplies them. */
33
+ export interface DetailDocumentCopy {
34
+ readonly title: string;
35
+ readonly loading: string;
36
+ readonly retry: string;
37
+ readonly copy: string;
38
+ readonly copied: string;
39
+ readonly codeBlock: string;
40
+ readonly wrap: string;
41
+ readonly unwrap: string;
42
+ readonly footnotes: string;
43
+ }
44
+ /**
45
+ * Assemble reference-stable labels for {@link DetailDocument} from translated strings.
46
+ * @param copy - the translated strings.
47
+ * @returns labels that keep their identity while the strings stay equal.
48
+ */
49
+ export declare function useDetailDocumentLabels(copy: DetailDocumentCopy): DetailDocumentLabels;
50
+ /** Localized chrome of a detail document. */
51
+ export interface DetailDocumentLabels {
52
+ /** Accessible name of the scrollable document region; the section shows no heading of its own. */
53
+ readonly title: string;
54
+ /** Accessible name of the loading placeholder. */
55
+ readonly loading: string;
56
+ /** Retry button text. */
57
+ readonly retry: string;
58
+ readonly markdown: MarkdownLabels;
59
+ }
60
+ /**
61
+ * A section showing a long Markdown description, without a heading of its own: three skeleton lines while it loads, the
62
+ * document once found, or the owner's failure message with a retry. Nothing renders for `none`. A document taller than
63
+ * the section's height limit scrolls inside it, and the scroll region, named by `labels.title`, takes keyboard focus.
64
+ * Raw HTML is omitted, relative links stay text, and only images the owner's `images` resolver accepts, or absolute
65
+ * HTTP(S) images, load.
66
+ * @param props.state - the read to show.
67
+ * @param props.labels - localized region name, placeholder name, retry text, and Markdown chrome; keep `markdown` reference-stable.
68
+ * @param props.images - resolves the document's relative image destinations to displayable URLs.
69
+ * @param props.onRetry - reads the document again after a failure.
70
+ * @returns the section, or null.
71
+ */
72
+ export declare function DetailDocument({ state, labels, images, onRetry }: {
73
+ readonly state: DetailDocumentState;
74
+ readonly labels: DetailDocumentLabels;
75
+ readonly images?: MarkdownPathImages | undefined;
76
+ readonly onRetry: () => void;
77
+ }): ReactNode;
78
+ //# sourceMappingURL=DetailDocument.d.ts.map
@@ -0,0 +1,19 @@
1
+ /** Original-image drag gestures owned by a presentation primitive. */
2
+ import { type ImgHTMLAttributes } from 'react';
3
+ import type { FileDragActions } from './file-drag-actions.ts';
4
+ /** Image presentation plus original content and explicit file preparation callbacks. */
5
+ export interface DraggableImageProps extends Omit<ImgHTMLAttributes<HTMLImageElement>, 'src' | 'draggable' | 'onDragStart' | 'onDragEnd' | 'onPointerEnter' | 'onPointerLeave' | 'onPointerDown' | 'onPointerUp' | 'onClickCapture'> {
6
+ readonly fileDrag: FileDragActions;
7
+ readonly src: string;
8
+ readonly name: string;
9
+ readonly resourceAddress?: string | undefined;
10
+ readonly original?: File | undefined;
11
+ }
12
+ /**
13
+ * Render an image with original-file dragging; using explicit application-owned callbacks.
14
+ * @param props - image attributes, original filename and file preparation callbacks.
15
+ * @param ref - image element for measurement and pointer-mode bindings.
16
+ * @returns a draggable image that suppresses only the mouse click following its drag.
17
+ */
18
+ export declare const DraggableImage: import("react").ForwardRefExoticComponent<DraggableImageProps & import("react").RefAttributes<HTMLImageElement>>;
19
+ //# sourceMappingURL=DraggableImage.d.ts.map
@@ -1,14 +1,18 @@
1
1
  import type { ReactNode, RefObject } from 'react';
2
2
  /**
3
3
  * Render an anchor with a hover-triggered preview card independently of nested tooltips.
4
+ * Touch entry does not open a preview or intercept the anchor's action.
4
5
  * @param props.anchor - the hover target (rendered in place inside a wrapper span).
5
6
  * @param props.content - card content; the pointer may rest on it, so it is
6
7
  * readable and selectable, but it carries no dismissal affordance of its own.
7
8
  * @param props.openDelayMs - hover dwell before the card shows (default 500).
8
9
  * @param props.variant - compact card beside the anchor, or a preview above/below it
9
- * with 24px side insets, a 420px height cap, frame-top clearance, and 100ms opacity transitions.
10
+ * with 24px side insets, a 420px height cap, the frame-top clearance (capped below an anchor inside the top strip),
11
+ * and 100ms opacity transitions.
10
12
  * @param props.widthAnchorRef - optional element whose width and horizontal position size the preview.
11
13
  * @param props.inline - keep the anchor in prose; show a contained preview on hover or keyboard focus.
14
+ * Its hover region connects the anchor and preview across the visual gap.
15
+ * @param props.fitContent - size an inline card to its content within the usual width cap.
12
16
  * @param props.disabled - suppress opening; turning true dismisses an open card.
13
17
  * @param props.grouped - share first-display dwell across the surrounding list and active portal.
14
18
  * Group replacement removes the previous card immediately, including a fading preview.
@@ -18,10 +22,11 @@ import type { ReactNode, RefObject } from 'react';
18
22
  * @param props.copiedLabel - localized visible success label.
19
23
  * @returns anchor wrapper with the conditional portaled card.
20
24
  */
21
- export declare function HoverCard({ anchor, content, openDelayMs, disabled, grouped, copyText, copyLabel, copiedLabel, variant, widthAnchorRef, inline, }: {
25
+ export declare function HoverCard({ anchor, content, openDelayMs, disabled, grouped, copyText, copyLabel, copiedLabel, variant, widthAnchorRef, inline, fitContent, }: {
22
26
  anchor: ReactNode;
23
27
  /** Inline media preview using the shared menu material and keyboard focus. */
24
28
  inline?: boolean;
29
+ fitContent?: boolean;
25
30
  content: ReactNode;
26
31
  openDelayMs?: number;
27
32
  disabled?: boolean;
@@ -13,11 +13,13 @@ export declare const HoverCardGroupContext: import("react").Context<GroupState |
13
13
  * Share first-display dwell across a list and its active portal, including the card's existing pointer grace.
14
14
  * @param props.children - list contents, including opted-in HoverCards.
15
15
  * @param props.className - classes for the physical list container.
16
+ * @param props.as - physical container tag; use span to preserve inline text layout.
16
17
  * @returns the list container and its private hover coordinator.
17
18
  */
18
- export declare function HoverCardGroup({ children, className }: {
19
+ export declare function HoverCardGroup({ children, className, as: Container }: {
19
20
  children: ReactNode;
20
- className?: string;
21
+ className?: string | undefined;
22
+ as?: 'div' | 'span';
21
23
  }): import("react").JSX.Element;
22
24
  export {};
23
25
  //# sourceMappingURL=HoverCardGroup.d.ts.map
@@ -0,0 +1,24 @@
1
+ /** Shared compact presentation for draft and sent text quotes. */
2
+ import type { JSX } from 'react';
3
+ /** Optional whole-quote removal control supplied by an editable owner. */
4
+ export interface QuotePreviewRemoval {
5
+ /** Localized accessible name for the removal button. */
6
+ readonly label: string;
7
+ /** Remove the complete owning quote node. */
8
+ readonly onRemove: () => void;
9
+ }
10
+ /** Presentation inputs for one compact quote excerpt. */
11
+ export interface QuotePreviewProps {
12
+ /** Exact selected text rendered inline and exposed in a popover while clipped. */
13
+ readonly text: string;
14
+ /** Composer-only removal action; omit for inert sent quotes. */
15
+ readonly removal?: QuotePreviewRemoval | undefined;
16
+ }
17
+ /**
18
+ * Render one width-capped quote preview shared by editable drafts and sent messages.
19
+ * Clipped excerpts open a content-sized, scrollable popover that fits within the viewport.
20
+ * @param props - selected text and optional localized removal action.
21
+ * @returns a non-navigating quote preview with a full-text popover only while clipped.
22
+ */
23
+ export declare function QuotePreview({ text, removal }: QuotePreviewProps): JSX.Element;
24
+ //# sourceMappingURL=QuotePreview.d.ts.map
@@ -14,13 +14,15 @@ export interface SegmentedTab<Value extends string = string> {
14
14
  * Keyboard selection also moves focus; only the selected tab is a tab stop.
15
15
  * @param props.label - localized accessible name for the tab list.
16
16
  * @param props.className - layout placement; panels remain caller-owned.
17
+ * @param props.size - `sm` draws 30px tabs with a 2px inset (34px tall); the default `md` draws 34px tabs with a 4px inset (42px tall).
17
18
  * @returns the tab list, without its panels.
18
19
  */
19
- export declare function SegmentedTabs<Value extends string>({ items, value, onChange, label, className }: {
20
+ export declare function SegmentedTabs<Value extends string>({ items, value, onChange, label, className, size }: {
20
21
  items: readonly [SegmentedTab<Value>, ...SegmentedTab<Value>[]];
21
22
  value: Value;
22
23
  onChange: (value: Value) => void;
23
24
  label: string;
24
25
  className?: string | undefined;
26
+ size?: 'sm' | 'md' | undefined;
25
27
  }): ReactNode;
26
28
  //# sourceMappingURL=SegmentedTabs.d.ts.map
@@ -1,5 +1,5 @@
1
1
  /** Anchor-preserving tooltips; an optional body portal escapes clipping containers and stacking contexts that cap the bubble's z-index. */
2
- import type { FocusEventHandler, MouseEventHandler, ReactElement, Ref } from 'react';
2
+ import type { FocusEventHandler, MouseEventHandler, PointerEventHandler, ReactElement, Ref } from 'react';
3
3
  import { type TooltipSide } from './tooltip-placement.ts';
4
4
  export type { TooltipSide } from './tooltip-placement.ts';
5
5
  /**
@@ -11,8 +11,9 @@ export declare const TooltipSuppression: import("react").Context<((suppressed: b
11
11
  interface AnchorProps {
12
12
  'aria-describedby'?: string | undefined;
13
13
  ref?: Ref<HTMLElement> | undefined;
14
- onMouseEnter?: MouseEventHandler | undefined;
15
- onMouseLeave?: MouseEventHandler | undefined;
14
+ onPointerEnter?: PointerEventHandler | undefined;
15
+ onPointerLeave?: PointerEventHandler | undefined;
16
+ onPointerDown?: PointerEventHandler | undefined;
16
17
  onClick?: MouseEventHandler | undefined;
17
18
  onFocus?: FocusEventHandler | undefined;
18
19
  onBlur?: FocusEventHandler | undefined;
@@ -37,16 +38,20 @@ type TooltipLabel = string | (() => string);
37
38
  * toggling never remounts it (which would cut its CSS transitions).
38
39
  * @param props.maxWidth - bubble width cap in pixels, for labels long enough that the default
39
40
  * half-viewport cap would render a slab wider than the surface the anchor sits on; always bounded by viewport margins.
40
- * @param props.openOnClick - clicking also pins the bubble for reading; another click, Escape,
41
+ * @param props.openOnClick - clicking or tapping also pins the bubble for reading; another click, Escape,
41
42
  * Tab, or an outside pointerdown dismisses it. Defaults to false for ordinary action tooltips.
43
+ * @param props.onlyWhenClipped - show the bubble only when the anchor or an HTML element inside it
44
+ * overflows horizontally, measured when the bubble is about to show; for labels that repeat
45
+ * text an ellipsis may cut off. Defaults to false.
42
46
  * @param props.children - a single anchor element; its own ref (callback or object) is forwarded alongside the tooltip's.
43
47
  * @returns the cloned anchor plus a fixed-position bubble, optionally portaled to the body.
44
48
  * The bubble stays hidden until ResizeObserver supplies its size for viewport fitting; clicking the
45
49
  * anchor dismisses the bubble unless openOnClick is enabled, and focus arriving after a pointer
46
- * interaction (a closing menu refocusing its trigger) never raises it. When no side fits, the
47
- * viewport-bounded fallback may overlap the anchor; oversized content is scrollable when pinned.
50
+ * interaction (a closing menu refocusing its trigger) never raises it. Touch cannot trigger hover
51
+ * tooltips; tapping still invokes the child's action and can open an openOnClick explanation.
52
+ * When no side fits, the viewport-bounded fallback may overlap the anchor; oversized content is scrollable when pinned.
48
53
  */
49
- export declare function Tooltip({ label, shortcutKeys, side, align, delayMs, focusDelayMs, gap, disabled, portal, maxWidth, openOnClick, children }: {
54
+ export declare function Tooltip({ label, shortcutKeys, side, align, delayMs, focusDelayMs, gap, disabled, portal, maxWidth, openOnClick, onlyWhenClipped, children }: {
50
55
  label: TooltipLabel;
51
56
  shortcutKeys?: readonly string[] | undefined;
52
57
  side?: TooltipSide;
@@ -58,6 +63,7 @@ export declare function Tooltip({ label, shortcutKeys, side, align, delayMs, foc
58
63
  portal?: boolean;
59
64
  maxWidth?: number;
60
65
  openOnClick?: boolean;
66
+ onlyWhenClipped?: boolean;
61
67
  children: ReactElement<AnchorProps>;
62
68
  }): import("react").JSX.Element;
63
69
  //# sourceMappingURL=Tooltip.d.ts.map
@@ -0,0 +1,11 @@
1
+ /** Shared user-message background, typography, and content inset. */
2
+ import type { ComponentPropsWithoutRef } from 'react';
3
+ /** Native div attributes for user-authored message content. */
4
+ export type UserMessageBubbleProps = ComponentPropsWithoutRef<'div'>;
5
+ /**
6
+ * Render user-style message content without row placement or actions.
7
+ * @param props - Native div attributes and the caller-owned content.
8
+ * @returns A theme-aware message surface that wraps its content.
9
+ */
10
+ export declare function UserMessageBubble({ className, ...props }: UserMessageBubbleProps): import("react").JSX.Element;
11
+ //# sourceMappingURL=UserMessageBubble.d.ts.map
@@ -0,0 +1,27 @@
1
+ import { type DocumentZoomLabels } from './document-zoom.ts';
2
+ /** Live percentage display updated independently from the document tree. */
3
+ export interface ZoomControlsHandle {
4
+ /** @param zoom - current gesture scale multiplier. */
5
+ showZoom: (zoom: number) => void;
6
+ }
7
+ /**
8
+ * Present optional fitting, fixed presets, and incremental controls.
9
+ * @param props - committed `zoom`, optional `fit` row (omitted: no fitting row), localized labels, `visible`, optional
10
+ * owner `className`, and zoom and activity callbacks.
11
+ * @param ref - `showZoom` displays a transient scale until `zoom` changes.
12
+ * @returns a localized zoom toolbar.
13
+ */
14
+ export declare const ZoomControls: import("react").ForwardRefExoticComponent<{
15
+ readonly zoom: number;
16
+ readonly fit?: {
17
+ readonly label: string;
18
+ readonly selected: boolean;
19
+ readonly onSelect: () => void;
20
+ } | undefined;
21
+ readonly className?: string | undefined;
22
+ readonly labels: DocumentZoomLabels;
23
+ readonly visible: boolean;
24
+ readonly onZoom: (zoom: number) => void;
25
+ readonly onActiveChange: (active: boolean) => void;
26
+ } & import("react").RefAttributes<ZoomControlsHandle>>;
27
+ //# sourceMappingURL=ZoomControls.d.ts.map
@@ -0,0 +1,17 @@
1
+ /** Shared fixed document scales used by preview surfaces and their controls. */
2
+ /** Fixed scale limits, incremental step, and menu choices. */
3
+ export declare const DOCUMENT_ZOOM: {
4
+ readonly minimum: 0.25;
5
+ readonly maximum: 4;
6
+ readonly step: 0.25;
7
+ readonly presets: readonly [0.25, 0.5, 1, 1.5, 2];
8
+ };
9
+ /** Localized labels supplied by the document renderer. */
10
+ export interface DocumentZoomLabels {
11
+ readonly controls: string;
12
+ readonly menu: string;
13
+ readonly out: string;
14
+ readonly into: string;
15
+ readonly value: (percent: number) => string;
16
+ }
17
+ //# sourceMappingURL=document-zoom.d.ts.map
@@ -0,0 +1,32 @@
1
+ /** Stable file preparation callbacks supplied by a transfer-owning plugin. */
2
+ import type { DragFileName } from '@deepseek-ai/dsh-util-file-drag';
3
+ /** Content source and optional Host-verifiable identity of its unmodified local original. */
4
+ export type FileDragSource = DragFileName & {
5
+ readonly resourceAddress?: string | undefined;
6
+ } & ({
7
+ readonly kind: 'blob';
8
+ readonly blob: Blob;
9
+ } | {
10
+ readonly kind: 'url';
11
+ readonly url: string;
12
+ });
13
+ /** Prepared operation; release cancels unused resources without ending an active browser transfer. */
14
+ export interface PreparedFileDrag {
15
+ /**
16
+ * Start the prepared transfer while the browser payload is writable.
17
+ * @param transfer - writable dragstart payload.
18
+ * @param source - native source node, retained through drag end.
19
+ * @returns true for browser dragging; false when native dragging takes over.
20
+ */
21
+ start(transfer: DataTransfer, source: HTMLElement): boolean;
22
+ /** Release this preparation once the pointer leaves or the source unmounts. */
23
+ release(): void;
24
+ }
25
+ /** Presentation sees preparation and feedback; transport selection belongs to the plugin. */
26
+ export interface FileDragActions {
27
+ /** @param source - file content and export name. @param signal - preparation cancellation. @returns the ready start/release operation. */
28
+ prepare(source: FileDragSource, signal: AbortSignal): Promise<PreparedFileDrag>;
29
+ /** Display the plugin's localized retry message, independently of the originating component. */
30
+ reportFailure(): void;
31
+ }
32
+ //# sourceMappingURL=file-drag-actions.d.ts.map
@@ -1,3 +1,10 @@
1
+ /**
2
+ * Identify iOS and Android phones and tablets from the current browser's device information.
3
+ * MacIntel with multiple touch points identifies desktop-mode iPads.
4
+ * The first result is shared by all callers until the page reloads.
5
+ * @returns true for recognized mobile devices; false for other devices, including unrecognized UAs.
6
+ */
7
+ export declare function isMobileDevice(): boolean;
1
8
  /**
2
9
  * Focus an automatic destination without a focus outline until keyboard navigation or blur.
3
10
  * The theme suppresses outlines while data-dsh-automatic-focus is present; borders and shadows remain intact.