@deepseek-ai/dsh-client-ui-primitives 0.1.7-alpha.2 → 0.1.7-rc.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.
- package/README.i18n.yaml +60 -5
- package/README.md +27 -10
- package/README.zh.md +27 -10
- package/lib/Button.module.css +6 -8
- package/lib/Checkbox.module.css +1 -1
- package/lib/CodeCard.module.css +3 -3
- package/lib/ConnectionIndicator.module.css +6 -2
- package/lib/HoverCard.module.css +17 -8
- package/lib/ImageLightbox.module.css +46 -0
- package/lib/ImagePreview.module.css +24 -0
- package/lib/Input.module.css +2 -2
- package/lib/JsonTree.module.css +3 -3
- package/lib/Menu.module.css +22 -18
- package/lib/MenuSurface.module.css +49 -0
- package/lib/Modal.module.css +27 -6
- package/lib/Pill.module.css +2 -1
- package/lib/RiskConfirmation.module.css +1 -1
- package/lib/SearchBlock.module.css +1 -1
- package/lib/SegmentedControl.module.css +9 -9
- package/lib/SegmentedTabs.module.css +3 -3
- package/lib/ShortcutKeys.module.css +33 -0
- package/lib/Switch.module.css +3 -8
- package/lib/TerminalBlock.module.css +3 -3
- package/lib/Toast.module.css +2 -2
- package/lib/Tooltip.module.css +9 -1
- package/lib/WebBlock.module.css +1 -1
- package/lib/index.js +1592 -825
- package/lib/markdown/CodeBlock.module.css +1 -1
- package/lib/markdown/JsonBlock.module.css +2 -2
- package/lib/markdown/MarkdownText.module.css +28 -5
- package/lib/settings-form/SettingsForm.module.css +2 -2
- package/lib/settings-form/fields.module.css +4 -4
- package/lib/types/Button.d.ts +6 -5
- package/lib/types/HoverCard.d.ts +5 -2
- package/lib/types/ImageLightbox.d.ts +27 -0
- package/lib/types/ImagePreview.d.ts +12 -0
- package/lib/types/Menu.d.ts +9 -1
- package/lib/types/MenuSurface.d.ts +16 -0
- package/lib/types/Modal.d.ts +12 -4
- package/lib/types/ShortcutKeys.d.ts +11 -0
- package/lib/types/Tooltip.d.ts +15 -4
- package/lib/types/code-highlighting.d.ts +1 -8
- package/lib/types/focus.d.ts +9 -0
- package/lib/types/guide-artwork.d.ts +15 -0
- package/lib/types/icons/index.d.ts +8 -4
- package/lib/types/icons/shared-artwork.d.ts +8 -1
- package/lib/types/index.d.ts +9 -1
- package/lib/types/input-modality.d.ts +19 -0
- package/lib/types/keyboard-composition.d.ts +11 -0
- package/lib/types/markdown/MarkdownDelegate.d.ts +11 -1
- package/lib/types/markdown/highlight.d.ts +16 -10
- package/lib/types/markdown/local-image-syntax.d.ts +10 -0
- package/lib/types/plugin-artwork.d.ts +1 -1
- package/lib/types/settings-form/fields.d.ts +1 -0
- package/lib/types/useModalLayer.d.ts +27 -0
- package/package.json +4 -3
- package/lib/OnboardingSurface.module.css +0 -28
- package/lib/types/OnboardingSurface.d.ts +0 -11
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
.block {
|
|
5
5
|
--dsl-code-block-banner-background-color: var(--dsw-alias-markdown-code-block-banner);
|
|
6
|
-
--dsl-code-block-border-radius:
|
|
6
|
+
--dsl-code-block-border-radius: var(--dsw-radius-lg);
|
|
7
7
|
/* Local 11/18 instead of the shared --dsw-font-xs-13: the banner scales
|
|
8
8
|
with the markdown 0.875 ladder without shrinking every other xs-13 use. */
|
|
9
9
|
--dsl-code-block-banner-font: 11px/18px var(--dsw-font-family);
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
border: none;
|
|
11
11
|
background: transparent;
|
|
12
12
|
cursor: pointer;
|
|
13
|
-
border-radius:
|
|
13
|
+
border-radius: var(--dsw-radius-sm);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
.toggle:hover {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
overflow: auto;
|
|
25
25
|
background: var(--dsw-alias-markdown-code-block);
|
|
26
26
|
border: 0.5px solid var(--dsw-alias-border-l1);
|
|
27
|
-
border-radius:
|
|
27
|
+
border-radius: var(--dsw-radius-lg);
|
|
28
28
|
font-family: var(--ds-font-family-code);
|
|
29
29
|
font-size: 11px;
|
|
30
30
|
line-height: 16px;
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
|
|
84
84
|
.markdown a:focus-visible,
|
|
85
85
|
.fileMention:focus-visible {
|
|
86
|
-
box-shadow: 0 0 0 2px var(--dsw-alias-state-business-primary);
|
|
86
|
+
box-shadow: 0 0 0 2px var(--dsw-focus-ring-color, var(--dsw-alias-state-business-primary));
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
/* Leading link-category glyph inside anchors, file mentions, and
|
|
@@ -169,7 +169,7 @@
|
|
|
169
169
|
font-size: 0.875em !important;
|
|
170
170
|
background-color: var(--dsw-alias-markdown-inline-code);
|
|
171
171
|
border: 0.5px solid var(--dsw-alias-border-l1);
|
|
172
|
-
border-radius:
|
|
172
|
+
border-radius: var(--dsw-radius-sm);
|
|
173
173
|
padding: 0 5px;
|
|
174
174
|
}
|
|
175
175
|
|
|
@@ -220,7 +220,7 @@
|
|
|
220
220
|
the sheet's link focus color. */
|
|
221
221
|
.tableScroll:focus-visible {
|
|
222
222
|
outline: none;
|
|
223
|
-
box-shadow: 0 0 0 2px var(--dsw-alias-state-business-primary);
|
|
223
|
+
box-shadow: 0 0 0 2px var(--dsw-focus-ring-color, var(--dsw-alias-state-business-primary));
|
|
224
224
|
}
|
|
225
225
|
|
|
226
226
|
/* Many-column tables (the renderer's `md-table-wide` hook) keep their
|
|
@@ -295,7 +295,7 @@
|
|
|
295
295
|
max-width: 100%;
|
|
296
296
|
height: auto;
|
|
297
297
|
margin: 0;
|
|
298
|
-
border-radius:
|
|
298
|
+
border-radius: var(--dsw-radius-md);
|
|
299
299
|
background: var(--dsw-alias-bg-base);
|
|
300
300
|
object-fit: contain;
|
|
301
301
|
}
|
|
@@ -386,7 +386,7 @@
|
|
|
386
386
|
font: inherit;
|
|
387
387
|
font-family: var(--ds-font-family-code);
|
|
388
388
|
font-size: 1em !important;
|
|
389
|
-
border-radius:
|
|
389
|
+
border-radius: var(--dsw-radius-xs);
|
|
390
390
|
padding: 0 3px;
|
|
391
391
|
box-decoration-break: clone;
|
|
392
392
|
}
|
|
@@ -442,3 +442,26 @@
|
|
|
442
442
|
.compact :global(.katex-display) {
|
|
443
443
|
margin: 4px 0;
|
|
444
444
|
}
|
|
445
|
+
|
|
446
|
+
.imageButton {
|
|
447
|
+
display: inline-block;
|
|
448
|
+
max-width: 100%;
|
|
449
|
+
padding: 0;
|
|
450
|
+
border: 0;
|
|
451
|
+
border-radius: var(--dsw-radius-sm);
|
|
452
|
+
background: transparent;
|
|
453
|
+
vertical-align: middle;
|
|
454
|
+
cursor: zoom-in;
|
|
455
|
+
}
|
|
456
|
+
.imageButton .image { max-width: min(100%, 640px); max-height: 360px; }
|
|
457
|
+
.imageButton:focus-visible { outline: var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color, var(--dsw-alias-state-business-primary)); outline-offset: 3px; }
|
|
458
|
+
.previewName {
|
|
459
|
+
display: block;
|
|
460
|
+
margin-top: 8px;
|
|
461
|
+
overflow: hidden;
|
|
462
|
+
text-overflow: ellipsis;
|
|
463
|
+
white-space: nowrap;
|
|
464
|
+
color: var(--dsw-alias-label-secondary);
|
|
465
|
+
font-size: 12px;
|
|
466
|
+
line-height: 18px;
|
|
467
|
+
}
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
.save {
|
|
33
33
|
appearance: none;
|
|
34
34
|
border: 1px solid transparent;
|
|
35
|
-
border-radius:
|
|
35
|
+
border-radius: var(--dsw-radius-md);
|
|
36
36
|
padding: 5px 14px;
|
|
37
37
|
font: inherit;
|
|
38
38
|
font-size: 13px;
|
|
@@ -48,6 +48,6 @@
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
.save:focus-visible {
|
|
51
|
-
outline:
|
|
51
|
+
outline: var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color, var(--dsw-alias-state-business-primary));
|
|
52
52
|
outline-offset: 1px;
|
|
53
53
|
}
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
height: 24px;
|
|
48
48
|
padding: 0;
|
|
49
49
|
border: 0;
|
|
50
|
-
border-radius:
|
|
50
|
+
border-radius: var(--dsw-radius-sm);
|
|
51
51
|
background: none;
|
|
52
52
|
color: var(--dsw-alias-label-tertiary);
|
|
53
53
|
cursor: pointer;
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
.helpButton:focus-visible {
|
|
63
|
-
outline:
|
|
63
|
+
outline: var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color, var(--dsw-alias-state-business-primary));
|
|
64
64
|
outline-offset: 1px;
|
|
65
65
|
}
|
|
66
66
|
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
height: 34px;
|
|
109
109
|
padding: 0 12px;
|
|
110
110
|
border: 0.5px solid var(--dsw-alias-border-l4);
|
|
111
|
-
border-radius:
|
|
111
|
+
border-radius: var(--dsw-radius-md);
|
|
112
112
|
background: var(--dsw-alias-bg-layer-3);
|
|
113
113
|
font: inherit;
|
|
114
114
|
font-size: 13px;
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
|
|
119
119
|
.input:focus-visible {
|
|
120
120
|
outline: none;
|
|
121
|
-
border-color: var(--dsw-alias-
|
|
121
|
+
border-color: var(--dsw-alias-state-business-primary);
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
.input:disabled {
|
package/lib/types/Button.d.ts
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ButtonHTMLAttributes, type ReactNode } from 'react';
|
|
2
2
|
/** Visual variant, each backed by its --dsw-alias-button-* token family. */
|
|
3
3
|
export type ButtonVariant = 'primary' | 'ghost' | 'outline' | 'toolbar';
|
|
4
4
|
/**
|
|
5
5
|
* Render a button.
|
|
6
6
|
* @param props.variant - visual family (default 'ghost').
|
|
7
|
-
* @param props.size - 'md' 36px
|
|
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
|
+
* @param ref - native button for focus management and overlay anchors.
|
|
9
10
|
* @returns the button element; native button attributes pass through.
|
|
10
11
|
*/
|
|
11
|
-
export declare
|
|
12
|
+
export declare const Button: import("react").ForwardRefExoticComponent<{
|
|
12
13
|
variant?: ButtonVariant;
|
|
13
|
-
size?:
|
|
14
|
+
size?: "md" | "sm";
|
|
14
15
|
icon?: ReactNode;
|
|
15
16
|
className?: string | undefined;
|
|
16
17
|
children?: ReactNode;
|
|
17
|
-
} & ButtonHTMLAttributes<HTMLButtonElement>
|
|
18
|
+
} & ButtonHTMLAttributes<HTMLButtonElement> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
18
19
|
//# sourceMappingURL=Button.d.ts.map
|
package/lib/types/HoverCard.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactNode, RefObject } from 'react';
|
|
2
2
|
/**
|
|
3
|
-
* Render an anchor with a hover-triggered preview card.
|
|
3
|
+
* Render an anchor with a hover-triggered preview card, hidden while a tooltip within the anchor is visible.
|
|
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.
|
|
@@ -8,6 +8,7 @@ import type { ReactNode, RefObject } from 'react';
|
|
|
8
8
|
* @param props.variant - compact card beside the anchor, or a preview above/below it
|
|
9
9
|
* with 24px side insets, a 420px height cap, frame-top clearance, and 100ms opacity transitions.
|
|
10
10
|
* @param props.widthAnchorRef - optional element whose width and horizontal position size the preview.
|
|
11
|
+
* @param props.inline - keep the anchor in prose; show a contained preview on hover or keyboard focus.
|
|
11
12
|
* @param props.disabled - suppress opening; turning true dismisses an open card.
|
|
12
13
|
* @param props.copyText - optional primary value copied by activation and
|
|
13
14
|
* included in the card's accessible name.
|
|
@@ -15,8 +16,10 @@ import type { ReactNode, RefObject } from 'react';
|
|
|
15
16
|
* @param props.copiedLabel - localized visible success label.
|
|
16
17
|
* @returns anchor wrapper with the conditional portaled card.
|
|
17
18
|
*/
|
|
18
|
-
export declare function HoverCard({ anchor, content, openDelayMs, disabled, copyText, copyLabel, copiedLabel, variant, widthAnchorRef, }: {
|
|
19
|
+
export declare function HoverCard({ anchor, content, openDelayMs, disabled, copyText, copyLabel, copiedLabel, variant, widthAnchorRef, inline, }: {
|
|
19
20
|
anchor: ReactNode;
|
|
21
|
+
/** Inline media preview using the shared menu material and keyboard focus. */
|
|
22
|
+
inline?: boolean;
|
|
20
23
|
content: ReactNode;
|
|
21
24
|
openDelayMs?: number;
|
|
22
25
|
disabled?: boolean;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** Lightbox strings the owner resolves from its own locale namespace. */
|
|
2
|
+
export interface ImageLightboxLabels {
|
|
3
|
+
/** Accessible name of the preview dialog. */
|
|
4
|
+
dialog: string;
|
|
5
|
+
/** Accessible label of the close control. */
|
|
6
|
+
close: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Document-level original-image preview opened by clicking a thumbnail.
|
|
10
|
+
* Closes on Escape, backdrop press, or the close control, and restores focus
|
|
11
|
+
* to the opener on unmount. Rendered through a body portal: an opener inside
|
|
12
|
+
* a transformed or filtered ancestor would otherwise trap the fixed backdrop
|
|
13
|
+
* in that ancestor's box instead of covering the viewport.
|
|
14
|
+
*
|
|
15
|
+
* @param props.src - the original image URL.
|
|
16
|
+
* @param props.alt - the image's alt text.
|
|
17
|
+
* @param props.labels - dialog and close-control strings.
|
|
18
|
+
* @param props.onClose - dismiss callback owned by the opener.
|
|
19
|
+
* @returns the modal preview dialog.
|
|
20
|
+
*/
|
|
21
|
+
export declare function ImageLightbox({ src, alt, labels, onClose }: {
|
|
22
|
+
src: string;
|
|
23
|
+
alt: string;
|
|
24
|
+
labels: ImageLightboxLabels;
|
|
25
|
+
onClose: () => void;
|
|
26
|
+
}): import("react").ReactPortal;
|
|
27
|
+
//# sourceMappingURL=ImageLightbox.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Render an image without introducing a second activation target.
|
|
3
|
+
* @param props - Source, accessible description, localized status.
|
|
4
|
+
* @returns A contained preview with loading or failure status.
|
|
5
|
+
*/
|
|
6
|
+
export declare function ImagePreview({ src, alt, loadingLabel, failedLabel }: {
|
|
7
|
+
src: string;
|
|
8
|
+
alt: string;
|
|
9
|
+
loadingLabel: string;
|
|
10
|
+
failedLabel: string;
|
|
11
|
+
}): import("react").JSX.Element;
|
|
12
|
+
//# sourceMappingURL=ImagePreview.d.ts.map
|
package/lib/types/Menu.d.ts
CHANGED
|
@@ -4,6 +4,11 @@ export interface MenuItem {
|
|
|
4
4
|
id: string;
|
|
5
5
|
label: ReactNode;
|
|
6
6
|
disabled?: boolean;
|
|
7
|
+
/** Effective binding supplied by the command owner; omitted for unbound actions. */
|
|
8
|
+
shortcut?: {
|
|
9
|
+
keys: readonly string[];
|
|
10
|
+
aria?: string | undefined;
|
|
11
|
+
};
|
|
7
12
|
/** Leading icon (figma .Menu_cell gap 8). */
|
|
8
13
|
icon?: ReactNode;
|
|
9
14
|
/** Destructive row: error-colored text/icon and danger hover fill. */
|
|
@@ -28,6 +33,8 @@ export type MenuEntry = MenuItem | MenuSeparator | MenuLabel;
|
|
|
28
33
|
export interface MenuItemButtonProps {
|
|
29
34
|
/** Visible row label. */
|
|
30
35
|
children: ReactNode;
|
|
36
|
+
/** Effective binding supplied by the command owner; omitted for unbound actions. */
|
|
37
|
+
shortcut?: MenuItem['shortcut'];
|
|
31
38
|
/** Leading icon (figma .Menu_cell gap 8). */
|
|
32
39
|
icon?: ReactNode;
|
|
33
40
|
/** Whether the row cannot be activated. */
|
|
@@ -51,6 +58,7 @@ export interface MenuItemButtonProps {
|
|
|
51
58
|
* without any shared state. Closing the menu stays the owner's decision, as
|
|
52
59
|
* it is for data rows.
|
|
53
60
|
* @param props.children - visible row label.
|
|
61
|
+
* @param props.shortcut - effective key labels and accessible combination.
|
|
54
62
|
* @param props.icon - optional leading icon.
|
|
55
63
|
* @param props.disabled - whether the row cannot be activated.
|
|
56
64
|
* @param props.danger - whether to use the destructive row colors.
|
|
@@ -58,7 +66,7 @@ export interface MenuItemButtonProps {
|
|
|
58
66
|
* @param props.onSelect - row activation callback.
|
|
59
67
|
* @returns one menu-item row.
|
|
60
68
|
*/
|
|
61
|
-
export declare function MenuItemButton({ children, icon, disabled, danger, separatorBefore, onSelect, }: MenuItemButtonProps): import("react").JSX.Element;
|
|
69
|
+
export declare function MenuItemButton({ children, shortcut, icon, disabled, danger, separatorBefore, onSelect, }: MenuItemButtonProps): import("react").JSX.Element;
|
|
62
70
|
/**
|
|
63
71
|
* Render an anchored dropdown menu. While the list is open its keys mirror the
|
|
64
72
|
* composer's: Tab settles the focused row — from the trigger, Tab enters the
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Shared menu material and the macOS backing that lets Chromium blur transparent windows. */
|
|
2
|
+
import { type ComponentPropsWithoutRef } from 'react';
|
|
3
|
+
/** Menu containers preserve native div props and refs. */
|
|
4
|
+
export interface MenuSurfaceProps extends ComponentPropsWithoutRef<'div'> {
|
|
5
|
+
/** Match the shared compact menu's smaller outer radius. */
|
|
6
|
+
compact?: boolean;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Paint a menu and, on macOS, an opaque backing behind the page content within its bounds.
|
|
10
|
+
* CSS anchors keep each backing aligned during placement, resizing, and nested-menu movement.
|
|
11
|
+
* @param props - Div content and placement, and compact geometry.
|
|
12
|
+
* @param ref - The visible menu div, excluding the non-interactive backing.
|
|
13
|
+
* @returns Menu content plus a backing portal removed with the menu.
|
|
14
|
+
*/
|
|
15
|
+
export declare const MenuSurface: import("react").ForwardRefExoticComponent<MenuSurfaceProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
16
|
+
//# sourceMappingURL=MenuSurface.d.ts.map
|
package/lib/types/Modal.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
1
|
+
import type { KeyboardEventHandler, ReactNode } from 'react';
|
|
2
2
|
interface ModalBaseProps {
|
|
3
3
|
open: boolean;
|
|
4
4
|
onClose: () => void;
|
|
@@ -8,6 +8,9 @@ interface ModalBaseProps {
|
|
|
8
8
|
footer?: ReactNode;
|
|
9
9
|
className?: string;
|
|
10
10
|
contentClassName?: string;
|
|
11
|
+
shortcutModal?: string;
|
|
12
|
+
onKeyDownCapture?: KeyboardEventHandler<HTMLDivElement>;
|
|
13
|
+
backdropBlur?: boolean;
|
|
11
14
|
}
|
|
12
15
|
type ModalProps = ModalBaseProps & ({
|
|
13
16
|
headless: true;
|
|
@@ -19,18 +22,23 @@ type ModalProps = ModalBaseProps & ({
|
|
|
19
22
|
/**
|
|
20
23
|
* Render a centered, body-portaled modal over a blurred page mask.
|
|
21
24
|
* @param props.open - whether the dialog is showing.
|
|
22
|
-
* @param props.onClose - Escape or mask click; while a menu is open inside the
|
|
25
|
+
* @param props.onClose - application close command, Escape, or mask click; while a menu is open inside the
|
|
23
26
|
* dialog, Escape belongs to that menu first.
|
|
24
27
|
* @param props.title - dialog heading (aria-label in every mode).
|
|
25
28
|
* @param props.closeLabel - localized accessible close-button label.
|
|
26
29
|
* @param props.description - optional supporting sentence under the title.
|
|
27
|
-
* @param props.children - body
|
|
30
|
+
* @param props.children - dialog body; mark its initial-focus control with
|
|
31
|
+
* data-modal-autofocus instead of React autoFocus to preserve return focus.
|
|
28
32
|
* @param props.footer - action row (Cancel / Create).
|
|
29
33
|
* @param props.contentClassName - optional class for a scrollable content region.
|
|
34
|
+
* @param props.backdropBlur - disable when the caller already blurs the page; defaults to true.
|
|
35
|
+
* @param props.shortcutModal - command scope allowed by shortcut owners; unnamed
|
|
36
|
+
* dialogs block application commands unless their owner allows the "other" scope.
|
|
30
37
|
* @param props.headless - render children directly in the card (no default
|
|
31
38
|
* header/close/body chrome); mask, card, Escape, and aria-label remain.
|
|
39
|
+
* @param props.onKeyDownCapture - handle a nested dialog's keys before the document Escape listeners.
|
|
32
40
|
* @returns null when closed; otherwise the overlay tree.
|
|
33
41
|
*/
|
|
34
|
-
export declare function Modal({ open, onClose, title, closeLabel, description, children, footer, className, contentClassName, headless, }: ModalProps): import("react").ReactPortal | null;
|
|
42
|
+
export declare function Modal({ open, onClose, title, closeLabel, description, children, footer, className, contentClassName, onKeyDownCapture, headless, backdropBlur, shortcutModal, }: ModalProps): import("react").ReactPortal | null;
|
|
35
43
|
export {};
|
|
36
44
|
//# sourceMappingURL=Modal.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Render one command's keycaps without owning binding defaults or localized copy.
|
|
3
|
+
* @param props - effective key labels, presentation variant and optional interaction styling.
|
|
4
|
+
* @returns unboxed keys by default, or tooltip keycaps with plus-separated combinations grouped together.
|
|
5
|
+
*/
|
|
6
|
+
export declare function ShortcutKeys({ keys, variant, className }: {
|
|
7
|
+
keys: readonly string[];
|
|
8
|
+
variant?: 'plain' | 'tooltip';
|
|
9
|
+
className?: string | undefined;
|
|
10
|
+
}): import("react").JSX.Element;
|
|
11
|
+
//# sourceMappingURL=ShortcutKeys.d.ts.map
|
package/lib/types/Tooltip.d.ts
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
/** Anchor-preserving tooltips
|
|
1
|
+
/** Anchor-preserving tooltips; an optional body portal escapes clipping containers and stacking contexts that cap the bubble's z-index. */
|
|
2
2
|
import type { FocusEventHandler, MouseEventHandler, ReactElement, Ref } from 'react';
|
|
3
3
|
/** Bubble placement relative to the anchor. */
|
|
4
4
|
export type TooltipSide = 'right' | 'bottom' | 'top';
|
|
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.
|
|
8
|
+
*/
|
|
9
|
+
export declare const TooltipSuppression: import("react").Context<((suppressed: boolean) => void) | null>;
|
|
5
10
|
/** Props Tooltip injects into its anchor child; the child's own handlers are chained ahead of the tooltip's. */
|
|
6
11
|
interface AnchorProps {
|
|
7
12
|
ref?: Ref<HTMLElement> | undefined;
|
|
@@ -14,13 +19,17 @@ interface AnchorProps {
|
|
|
14
19
|
type TooltipLabel = string | (() => string);
|
|
15
20
|
/**
|
|
16
21
|
* Attach a hover/focus tooltip to an anchor element.
|
|
17
|
-
* @param props.label - bubble text, or a resolver evaluated only while
|
|
22
|
+
* @param props.label - bubble text, or a resolver evaluated only while visible; an empty string shows only shortcut keys.
|
|
23
|
+
* @param props.shortcutKeys - effective key labels rendered as platform-formatted keycaps after optional text.
|
|
18
24
|
* @param props.side - placement relative to the anchor (default 'right').
|
|
19
25
|
* @param props.align - horizontal anchor-edge alignment for 'bottom'/'top' bubbles: 'end' pins
|
|
20
26
|
* the bubble's right edge to the anchor's (for anchors beside other hover surfaces the centered
|
|
21
27
|
* bubble would overlap); default 'center'. Ignored for side 'right'.
|
|
22
|
-
* @param props.portal - render the bubble under document.body
|
|
28
|
+
* @param props.portal - render the bubble under document.body, so an ancestor's clipping or its
|
|
29
|
+
* stacking context (which confines the bubble's z-index to that context) cannot hide it.
|
|
23
30
|
* @param props.delayMs - hover delay in milliseconds; keyboard focus remains immediate.
|
|
31
|
+
* @param props.gap - anchor-to-bubble distance in pixels for 'bottom'/'top' bubbles (default 8);
|
|
32
|
+
* ignored for side 'right'.
|
|
24
33
|
* @param props.disabled - suppress the bubble while true; the anchor renders identically so
|
|
25
34
|
* toggling never remounts it (which would cut its CSS transitions).
|
|
26
35
|
* @param props.maxWidth - bubble width cap in pixels, for labels long enough that the default
|
|
@@ -31,11 +40,13 @@ type TooltipLabel = string | (() => string);
|
|
|
31
40
|
* anchor dismisses the bubble until the next trigger, and focus arriving after a pointer
|
|
32
41
|
* interaction (a closing menu refocusing its trigger) never raises it.
|
|
33
42
|
*/
|
|
34
|
-
export declare function Tooltip({ label, side, align, delayMs, disabled, portal, maxWidth, children }: {
|
|
43
|
+
export declare function Tooltip({ label, shortcutKeys, side, align, delayMs, gap, disabled, portal, maxWidth, children }: {
|
|
35
44
|
label: TooltipLabel;
|
|
45
|
+
shortcutKeys?: readonly string[] | undefined;
|
|
36
46
|
side?: TooltipSide;
|
|
37
47
|
align?: 'center' | 'end';
|
|
38
48
|
delayMs?: number;
|
|
49
|
+
gap?: number;
|
|
39
50
|
disabled?: boolean;
|
|
40
51
|
portal?: boolean;
|
|
41
52
|
maxWidth?: number;
|
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
import { type HighlightSpan } from './markdown/highlight.ts';
|
|
2
|
-
|
|
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;
|
|
2
|
+
export { CODE_HIGHLIGHT_EXTENSIONS, languageForPath } from '@deepseek-ai/dsh-util-code-language';
|
|
10
3
|
/** Highlight one source fragment into one token list per line. */
|
|
11
4
|
export type CodeHighlighter = (code: string) => HighlightSpan[][] | undefined;
|
|
12
5
|
/**
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Focus an automatic destination without a focus outline until keyboard navigation or blur.
|
|
3
|
+
* The theme suppresses outlines while data-dsh-automatic-focus is present; borders and shadows remain intact.
|
|
4
|
+
* Tab and directional navigation restore normal focus styling.
|
|
5
|
+
* @param element - control or container receiving automatic focus.
|
|
6
|
+
* @param options - browser focus options, including scroll preservation.
|
|
7
|
+
*/
|
|
8
|
+
export declare function focusWithoutRing(element: HTMLElement, options?: FocusOptions): void;
|
|
9
|
+
//# sourceMappingURL=focus.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Fixed-palette artwork for sidebar guide entries. */
|
|
2
|
+
import type { IconProps } from './icons/props.ts';
|
|
3
|
+
/**
|
|
4
|
+
* Render fixed-palette artwork for a sidebar guide entry.
|
|
5
|
+
* @param props - canvas size and layout class supplied by the guide.
|
|
6
|
+
* @returns an ornamental SVG hidden from assistive technology.
|
|
7
|
+
*/
|
|
8
|
+
export declare function GuideArtworkBrowser({ size, className }: IconProps): import("react").JSX.Element;
|
|
9
|
+
/**
|
|
10
|
+
* Render fixed-palette artwork for a sidebar guide entry.
|
|
11
|
+
* @param props - canvas size and layout class supplied by the guide.
|
|
12
|
+
* @returns an ornamental SVG hidden from assistive technology.
|
|
13
|
+
*/
|
|
14
|
+
export declare function GuideArtworkFiles({ size, className }: IconProps): import("react").JSX.Element;
|
|
15
|
+
//# sourceMappingURL=guide-artwork.d.ts.map
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared current-color product icons. Names identify the glyph and weight;
|
|
3
|
-
* rendered size remains a prop instead of part of the component name.
|
|
4
|
-
*/
|
|
5
1
|
import type { IconProps } from './props.ts';
|
|
6
2
|
export type { IconProps } from './props.ts';
|
|
7
3
|
/** Shared shield contour used by composite icons outside this module. */
|
|
@@ -162,6 +158,10 @@ export declare const IconWarningTriangleOutlineMedium: (props: IconProps) => imp
|
|
|
162
158
|
export declare const IconUserOutlineRegular: (props: IconProps) => import("react").JSX.Element;
|
|
163
159
|
/** Medium IconUserOutline artwork with a 1.3px stroke. */
|
|
164
160
|
export declare const IconUserOutlineMedium: (props: IconProps) => import("react").JSX.Element;
|
|
161
|
+
/** Regular one-pixel IconUsersOutline artwork: a front person with a second person behind. */
|
|
162
|
+
export declare const IconUsersOutlineRegular: (props: IconProps) => import("react").JSX.Element;
|
|
163
|
+
/** Medium IconUsersOutline artwork with a 1.3px stroke. */
|
|
164
|
+
export declare const IconUsersOutlineMedium: (props: IconProps) => import("react").JSX.Element;
|
|
165
165
|
/** Regular one-pixel IconPaperPlaneOutline artwork. */
|
|
166
166
|
export declare const IconPaperPlaneOutlineRegular: (props: IconProps) => import("react").JSX.Element;
|
|
167
167
|
/** Medium IconPaperPlaneOutline artwork with a 1.3px stroke. */
|
|
@@ -366,6 +366,10 @@ export declare const IconWorkspaceTreeOutlineMedium: (props: IconProps) => impor
|
|
|
366
366
|
export declare const IconChevronsUpDownOutlineRegular: (props: IconProps) => import("react").JSX.Element;
|
|
367
367
|
/** Medium IconChevronsUpDownOutline artwork with a 1.3px stroke. */
|
|
368
368
|
export declare const IconChevronsUpDownOutlineMedium: (props: IconProps) => import("react").JSX.Element;
|
|
369
|
+
/** Regular one-pixel IconArchiveOffOutline artwork. */
|
|
370
|
+
export declare const IconArchiveOffOutlineRegular: (props: IconProps) => import("react").JSX.Element;
|
|
371
|
+
/** Medium IconArchiveOffOutline artwork with a 1.3px stroke. */
|
|
372
|
+
export declare const IconArchiveOffOutlineMedium: (props: IconProps) => import("react").JSX.Element;
|
|
369
373
|
/** Regular one-pixel IconArchiveCheckOutline artwork. */
|
|
370
374
|
export declare const IconArchiveCheckOutlineRegular: (props: IconProps) => import("react").JSX.Element;
|
|
371
375
|
/** Medium IconArchiveCheckOutline artwork with a 1.3px stroke. */
|
|
@@ -3,11 +3,18 @@ interface WeightedArtworkProps extends IconProps {
|
|
|
3
3
|
strokeWidth: number;
|
|
4
4
|
}
|
|
5
5
|
/**
|
|
6
|
-
* Render
|
|
6
|
+
* Render new-conversation geometry — the bubble around a plus — for product icons.
|
|
7
7
|
* @param props - Size, optional CSS class, and inherited stroke width.
|
|
8
8
|
* @returns The decorative SVG artwork.
|
|
9
9
|
*/
|
|
10
10
|
export declare const NewChatOutlineArtwork: ({ size, className, strokeWidth }: WeightedArtworkProps) => import("react").JSX.Element;
|
|
11
|
+
/**
|
|
12
|
+
* Render shared conversation geometry — the chat bubble around two text
|
|
13
|
+
* lines — for the queue product icon and session reference icons.
|
|
14
|
+
* @param props - Size, optional CSS class, and inherited stroke width.
|
|
15
|
+
* @returns The decorative SVG artwork.
|
|
16
|
+
*/
|
|
17
|
+
export declare const ChatLinesOutlineArtwork: ({ size, className, strokeWidth }: WeightedArtworkProps) => import("react").JSX.Element;
|
|
11
18
|
/**
|
|
12
19
|
* Render shared globe geometry for product and link icons.
|
|
13
20
|
* @param props - Size, optional CSS class, and inherited stroke width.
|
package/lib/types/index.d.ts
CHANGED
|
@@ -22,14 +22,19 @@ export type { SegmentedControlOption } from './SegmentedControl.tsx';
|
|
|
22
22
|
export { Checkbox } from './Checkbox.tsx';
|
|
23
23
|
export { Input } from './Input.tsx';
|
|
24
24
|
export { Menu, MenuItemButton } from './Menu.tsx';
|
|
25
|
+
export { MenuSurface } from './MenuSurface.tsx';
|
|
26
|
+
export type { MenuSurfaceProps } from './MenuSurface.tsx';
|
|
25
27
|
export type { MenuItemButtonProps, MenuEntry, MenuItem, MenuSeparator, MenuLabel } from './Menu.tsx';
|
|
26
28
|
export { useAnchoredMaxHeight } from './useAnchoredMaxHeight.ts';
|
|
27
29
|
export { useAnchoredPosition } from './useAnchoredPosition.ts';
|
|
28
30
|
export type { AnchoredPositionOptions } from './useAnchoredPosition.ts';
|
|
29
31
|
export { useDismissOnOutsidePointer } from './useDismissOnOutsidePointer.ts';
|
|
30
32
|
export { HoverCard } from './HoverCard.tsx';
|
|
33
|
+
export { ShortcutKeys } from './ShortcutKeys.tsx';
|
|
34
|
+
export { observeComposition } from './keyboard-composition.ts';
|
|
35
|
+
export { focusWithoutRing } from './focus.ts';
|
|
36
|
+
export { closeTopModal, isBehindModal, modalSelector, useModalLayer } from './useModalLayer.ts';
|
|
31
37
|
export { Modal } from './Modal.tsx';
|
|
32
|
-
export { OnboardingSurface } from './OnboardingSurface.tsx';
|
|
33
38
|
export { RiskConfirmation } from './RiskConfirmation.tsx';
|
|
34
39
|
export type { RiskConfirmationProps } from './RiskConfirmation.tsx';
|
|
35
40
|
export { ConnectionIndicator } from './ConnectionIndicator.tsx';
|
|
@@ -85,4 +90,7 @@ export { extractMarkdownPlainText } from './markdown/plain-text.ts';
|
|
|
85
90
|
export type { MarkdownPlainTextMode, MarkdownPlainTextOptions } from './markdown/plain-text.ts';
|
|
86
91
|
export * from './icons/index.tsx';
|
|
87
92
|
export { PluginArtworkTerminal, PluginArtworkLoop, PluginArtworkSubagent, PluginArtworkSearch, PluginArtworkDefault, } from './plugin-artwork.tsx';
|
|
93
|
+
export { GuideArtworkBrowser, GuideArtworkFiles } from './guide-artwork.tsx';
|
|
94
|
+
export { ImageLightbox } from './ImageLightbox.tsx';
|
|
95
|
+
export type { ImageLightboxLabels } from './ImageLightbox.tsx';
|
|
88
96
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Document-wide input tracking shared by tooltips and focus-ring styles.
|
|
3
|
+
* Tooltips follow the last input; rings follow navigation or a key followed by
|
|
4
|
+
* focus on a different control. Modifiers and refocusing alone keep rings silent.
|
|
5
|
+
* Module-level listeners live for the document lifetime; Node imports are inert.
|
|
6
|
+
*/
|
|
7
|
+
/** Modality values published on the document element. */
|
|
8
|
+
export declare const INPUT_MODALITY: {
|
|
9
|
+
readonly pointer: "pointer";
|
|
10
|
+
readonly keyboard: "keyboard";
|
|
11
|
+
};
|
|
12
|
+
/** Attribute carrying whether focus navigation last owned focus. */
|
|
13
|
+
export declare const INPUT_MODALITY_ATTRIBUTE = "data-input-modality";
|
|
14
|
+
/**
|
|
15
|
+
* Whether the last input came from a pointer, independently of ring visibility.
|
|
16
|
+
* @returns True after pointer input; false after any key.
|
|
17
|
+
*/
|
|
18
|
+
export declare function pointerModality(): boolean;
|
|
19
|
+
//# sourceMappingURL=input-modality.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Composition lifetime for local keyboard handlers, including a late closing keydown. */
|
|
2
|
+
/**
|
|
3
|
+
* Observe composition until its closing key is released or consumed.
|
|
4
|
+
* @param document - document whose input events belong to the caller.
|
|
5
|
+
* @returns an event guard and a disposer for all listeners.
|
|
6
|
+
*/
|
|
7
|
+
export declare function observeComposition(document: Document): {
|
|
8
|
+
guards(event: KeyboardEvent): boolean;
|
|
9
|
+
dispose(): void;
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=keyboard-composition.d.ts.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ImageLightboxLabels } from '../ImageLightbox.tsx';
|
|
2
3
|
/**
|
|
3
4
|
* Handle one sanitized absolute HTTP(S) URL selected from Markdown.
|
|
4
5
|
* @param href - destination URL.
|
|
@@ -6,6 +7,15 @@ import type { ReactNode } from 'react';
|
|
|
6
7
|
export type MarkdownExternalLinkHandler = (href: string) => void;
|
|
7
8
|
/** Navigation capabilities supplied by the nearest Markdown owner. */
|
|
8
9
|
export interface MarkdownDelegate {
|
|
10
|
+
/** Image previews for decoded local paths in this owner's workspace. */
|
|
11
|
+
readonly fileImages?: {
|
|
12
|
+
resolve: (path: string) => string | undefined;
|
|
13
|
+
labels: ImageLightboxLabels & {
|
|
14
|
+
open: string;
|
|
15
|
+
loading: string;
|
|
16
|
+
failed: string;
|
|
17
|
+
};
|
|
18
|
+
} | undefined;
|
|
9
19
|
/** Ordinary HTTP(S) activation; absent handlers retain native anchor behavior. */
|
|
10
20
|
readonly openExternalLink?: MarkdownExternalLinkHandler | undefined;
|
|
11
21
|
/**
|
|
@@ -27,7 +37,7 @@ export interface MarkdownDelegateProviderProps extends MarkdownDelegate {
|
|
|
27
37
|
* @param props - Child tree and its file and HTTP(S) link handlers.
|
|
28
38
|
* @returns the scoped child tree.
|
|
29
39
|
*/
|
|
30
|
-
export declare function MarkdownDelegateProvider({ children, openExternalLink, openFile, }: MarkdownDelegateProviderProps): ReactNode;
|
|
40
|
+
export declare function MarkdownDelegateProvider({ children, openExternalLink, openFile, fileImages, }: MarkdownDelegateProviderProps): ReactNode;
|
|
31
41
|
/**
|
|
32
42
|
* Read the nearest Markdown navigation capabilities.
|
|
33
43
|
* @returns Owner callbacks, or an empty delegate outside a provider.
|
|
@@ -6,18 +6,24 @@
|
|
|
6
6
|
* dark blocks), never here — the repo's tokens-only styling rule.
|
|
7
7
|
*
|
|
8
8
|
* Only the three markdown-fence and `run_code` grammars (TypeScript, shell,
|
|
9
|
-
* JSON) load into the singleton at boot — the set every session renders.
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
9
|
+
* JSON) load into the singleton at boot — the set every session renders. Every
|
|
10
|
+
* other language in the shared extension table
|
|
11
|
+
* (`@deepseek-ai/dsh-util-code-language`: python, rust, yaml, markup, …) is
|
|
12
|
+
* imported lazily and registered the first time such a language is requested,
|
|
13
|
+
* so a session that never opens a code surface in one of those languages pays
|
|
14
|
+
* neither the grammar modules nor their synchronous init. The first render of a
|
|
15
|
+
* lazy language falls back to plain text while its grammar loads, then
|
|
16
|
+
* {@link onGrammarLoaded} notifies subscribers to re-render with highlighting.
|
|
17
|
+
* An unknown or absent language falls back to plain text (no highlighting, still
|
|
18
|
+
* monospace) — never an error.
|
|
19
19
|
*/
|
|
20
20
|
import type { CSSProperties } from 'react';
|
|
21
|
+
/**
|
|
22
|
+
* Resolve a language hint to the grammar id {@link LANG_ALIASES} selects.
|
|
23
|
+
* @param lang - Language hint from a code surface: a canonical grammar id or the read card's persisted short id.
|
|
24
|
+
* @returns The resolved grammar id, or `undefined` when the table aliases no grammar.
|
|
25
|
+
*/
|
|
26
|
+
export declare function grammarForHint(lang: string | undefined): string | undefined;
|
|
21
27
|
/**
|
|
22
28
|
* Whether a language hint can use the shared syntax highlighter.
|
|
23
29
|
* @param lang - Language hint from a code surface.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Recover standalone local image references with bare spaces without changing code or source offsets. */
|
|
2
|
+
import type { Root } from 'mdast';
|
|
3
|
+
/**
|
|
4
|
+
* Recover only unambiguous, unescaped image-only paragraphs containing a local path with spaces.
|
|
5
|
+
* @param root - Parsed Markdown tree, modified in place.
|
|
6
|
+
* @param source - Original source used to distinguish authored syntax from escaped examples.
|
|
7
|
+
* @returns The same root with recovered image nodes.
|
|
8
|
+
*/
|
|
9
|
+
export declare function recoverLocalImages(root: Root, source: string): Root;
|
|
10
|
+
//# sourceMappingURL=local-image-syntax.d.ts.map
|