@seekbuddy/dsh-ui 0.2.0-beta.0 → 0.2.0-beta.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/CHANGELOG.md +34 -0
- package/README.md +1 -1
- package/README.zh.md +1 -1
- package/THIRD_PARTY_NOTICES.md +1 -1
- package/UPSTREAM.md +7 -4
- package/dist/blocks.js +170 -135
- package/dist/chunks/{chunk-VIH56PDF.js → chunk-6SGSJ5KW.js} +2 -2
- package/dist/chunks/{chunk-QJKAQ6PO.js → chunk-7NH2UOZO.js} +2 -2
- package/dist/chunks/{chunk-KETGFAOH.js → chunk-7SKW4S35.js} +2 -2
- package/dist/chunks/chunk-ENKPNYOB.js +26 -0
- package/dist/chunks/{chunk-WUL523OW.js → chunk-EWAZFWLW.js} +1 -1
- package/dist/chunks/{chunk-5JXG4BHW.js → chunk-FFJ6TCCF.js} +1 -1
- package/dist/chunks/{chunk-R6AUJQ3G.js → chunk-FZXK4LTI.js} +1 -1
- package/dist/chunks/chunk-JA3XDLIA.js +1115 -0
- package/dist/chunks/{chunk-TUK6UGXM.js → chunk-L7XALG4J.js} +1 -1
- package/dist/chunks/{chunk-AY44MQMD.js → chunk-OCAQFVT3.js} +180 -60
- package/dist/chunks/{chunk-CI73NXA5.js → chunk-RAXDA2PT.js} +4 -4
- package/dist/chunks/{chunk-5XDVPALS.js → chunk-SN6RSUWC.js} +1 -1
- package/dist/chunks/{chunk-CTQPGUZP.js → chunk-SNVSQWCU.js} +1 -1
- package/dist/chunks/{chunk-ZZNL5PWF.js → chunk-SO3DCAWG.js} +2 -2
- package/dist/chunks/{chunk-IOBKTEKP.js → chunk-UAEFKTV3.js} +1 -1
- package/dist/chunks/{chunk-NE62SYOZ.js → chunk-UGEORMLD.js} +2 -2
- package/dist/chunks/{chunk-TQU54HSM.js → chunk-W6FLI3AK.js} +1 -1
- package/dist/chunks/{chunk-TZ7HRE6D.js → chunk-WX46TSKP.js} +1 -1
- package/dist/chunks/{chunk-XX6MSZLS.js → chunk-XL33IPCV.js} +1 -1
- package/dist/chunks/chunk-XW4L4ZGL.js +967 -0
- package/dist/chunks/chunk-YOBY6PSL.js +850 -0
- package/dist/icons.js +58 -2
- package/dist/index.js +810 -317
- package/dist/markdown.js +84 -7
- package/dist/meta.json +1038 -339
- package/dist/root-inputs.json +20 -1
- package/dist/seekbuddy-card.js +1 -1
- package/dist/seekbuddy-empty.js +2 -2
- package/dist/seekbuddy-internal/Message.js +2 -2
- package/dist/seekbuddy-internal/Pagination.js +1 -1
- package/dist/seekbuddy-internal/StatusBadge.js +1 -1
- package/dist/seekbuddy-internal/Switch.js +1 -1
- package/dist/seekbuddy-internal/Upload.js +1 -1
- package/dist/seekbuddy-internal/date/Calendar.js +1 -1
- package/dist/seekbuddy-internal/date/DatePicker.js +2 -2
- package/dist/seekbuddy-internal/date/DateRangePicker.js +2 -2
- package/dist/seekbuddy-internal/date/TimePicker.js +1 -1
- package/dist/seekbuddy-internal/date/fields.js +5 -5
- package/dist/seekbuddy-spinner.js +1 -1
- package/dist/seekbuddy-tabs.js +1 -1
- package/dist/seekbuddy-timeline.js +2 -2
- package/dist/seekbuddy.js +15 -15
- package/dist/tokens.css +60 -20
- package/dist/types/AnimatedRows.d.ts +45 -0
- package/dist/types/Button.d.ts +1 -1
- package/dist/types/CommandText.d.ts +15 -0
- package/dist/types/DetailDocument.d.ts +77 -0
- package/dist/types/DisclosureRow.d.ts +4 -2
- package/dist/types/DraggableImage.d.ts +18 -0
- package/dist/types/HoverCard.d.ts +11 -3
- package/dist/types/HoverCardGroup.d.ts +24 -0
- package/dist/types/ImageLightbox.d.ts +4 -1
- package/dist/types/InlineEditor.d.ts +22 -0
- package/dist/types/Menu.d.ts +30 -9
- package/dist/types/MenuSurface.d.ts +9 -0
- package/dist/types/PermissionIcon.d.ts +12 -0
- package/dist/types/QuotePreview.d.ts +23 -0
- package/dist/types/SegmentedTabs.d.ts +3 -1
- package/dist/types/TerminalBlock.d.ts +10 -2
- package/dist/types/Tooltip.d.ts +21 -15
- package/dist/types/UserMessageBubble.d.ts +10 -0
- package/dist/types/ZoomControls.d.ts +26 -0
- package/dist/types/blocks.d.ts +2 -0
- package/dist/types/document-zoom.d.ts +16 -0
- package/dist/types/file-drag-actions.d.ts +36 -0
- package/dist/types/focus.d.ts +7 -0
- package/dist/types/icons/artwork.d.ts +421 -0
- package/dist/types/icons/index.d.ts +205 -192
- package/dist/types/icons/shared-artwork.d.ts +6 -12
- package/dist/types/icons.d.ts +1 -1
- package/dist/types/image-drag.d.ts +16 -0
- package/dist/types/index.d.ts +21 -3
- package/dist/types/markdown/MarkdownDelegate.d.ts +26 -3
- package/dist/types/markdown/MarkdownText.d.ts +12 -5
- package/dist/types/markdown/file-link.d.ts +13 -3
- package/dist/types/markdown/highlight.d.ts +22 -0
- package/dist/types/markdown/quote-text.d.ts +7 -0
- package/dist/types/markdown/render.d.ts +9 -4
- package/dist/types/markdown/windows-path-destinations.d.ts +10 -0
- package/dist/types/markdown.d.ts +5 -2
- package/dist/types/overlay-top-margin.d.ts +9 -2
- package/dist/types/tooltip-placement.d.ts +34 -0
- package/dist/types/use-clipboard-copy.d.ts +13 -0
- package/dist/types/useAnchoredPosition.d.ts +22 -22
- package/dist/types/useRowDragPreview.d.ts +19 -0
- package/dist/types/user-text.d.ts +26 -31
- package/package.json +2 -2
- package/dist/chunks/chunk-3HCOU44R.js +0 -697
- package/dist/chunks/chunk-LA3QDZYN.js +0 -2777
- package/dist/chunks/chunk-OQPH36OI.js +0 -754
- package/dist/types/use-copy-feedback.d.ts +0 -13
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type MarkdownLabels, type MarkdownPathImages } from './markdown/MarkdownText.js';
|
|
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;
|
|
@@ -8,13 +8,15 @@ export interface DisclosureRowProps {
|
|
|
8
8
|
onToggle: () => void;
|
|
9
9
|
/** Animate the complete header while its owning operation is running. */
|
|
10
10
|
running?: boolean | undefined;
|
|
11
|
-
/** Makes the
|
|
11
|
+
/** Makes the title row the disclosure target; with an accessory, it shrinks to its content width. */
|
|
12
12
|
expandOnRowClick?: boolean | undefined;
|
|
13
13
|
/** Replaces the collapsed icon with a chevron while the row is hovered. */
|
|
14
14
|
previewChevron?: boolean | undefined;
|
|
15
15
|
/** Keeps `collapsedContent` inline while open. */
|
|
16
16
|
keepContentWhenOpen?: boolean | undefined;
|
|
17
17
|
collapsedContent?: ReactNode;
|
|
18
|
+
/** Independent action beside the title, outside the disclosure target and shimmer. */
|
|
19
|
+
headerAccessory?: ReactNode;
|
|
18
20
|
children?: ReactNode;
|
|
19
21
|
className?: string | undefined;
|
|
20
22
|
rowClassName?: string | undefined;
|
|
@@ -32,4 +34,4 @@ export interface DisclosureRowProps {
|
|
|
32
34
|
* @param props - Visual content, controlled state, and interaction policy.
|
|
33
35
|
* @returns the disclosure row.
|
|
34
36
|
*/
|
|
35
|
-
export declare const DisclosureRow: import("react").MemoExoticComponent<({ icon, title, open, expandable, onToggle, running, expandOnRowClick, previewChevron, keepContentWhenOpen, collapsedContent, children, className, rowClassName, contentClassName, contentLayoutClassName, leadingClassName, chevronClassName, titleClassName, }: DisclosureRowProps) => import("react").JSX.Element>;
|
|
37
|
+
export declare const DisclosureRow: import("react").MemoExoticComponent<({ icon, title, open, expandable, onToggle, running, expandOnRowClick, previewChevron, keepContentWhenOpen, collapsedContent, headerAccessory, children, className, rowClassName, contentClassName, contentLayoutClassName, leadingClassName, chevronClassName, titleClassName, }: DisclosureRowProps) => import("react").JSX.Element>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** Original-image drag gestures owned by a presentation primitive. */
|
|
2
|
+
import { type ImgHTMLAttributes } from 'react';
|
|
3
|
+
import type { FileDragActions } from './file-drag-actions.js';
|
|
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>>;
|
|
@@ -1,28 +1,36 @@
|
|
|
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 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
|
|
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.
|
|
17
|
+
* @param props.grouped - share first-display dwell across the surrounding list and active portal.
|
|
18
|
+
* Group replacement removes the previous card immediately, including a fading preview.
|
|
13
19
|
* @param props.copyText - optional primary value copied by activation and
|
|
14
20
|
* included in the card's accessible name.
|
|
15
21
|
* @param props.copyLabel - localized accessible activation-label prefix.
|
|
16
22
|
* @param props.copiedLabel - localized visible success label.
|
|
17
23
|
* @returns anchor wrapper with the conditional portaled card.
|
|
18
24
|
*/
|
|
19
|
-
export declare function HoverCard({ anchor, content, openDelayMs, disabled, copyText, copyLabel, copiedLabel, variant, widthAnchorRef, inline, }: {
|
|
25
|
+
export declare function HoverCard({ anchor, content, openDelayMs, disabled, grouped, copyText, copyLabel, copiedLabel, variant, widthAnchorRef, inline, fitContent, }: {
|
|
20
26
|
anchor: ReactNode;
|
|
21
27
|
/** Inline media preview using the shared menu material and keyboard focus. */
|
|
22
28
|
inline?: boolean;
|
|
29
|
+
fitContent?: boolean;
|
|
23
30
|
content: ReactNode;
|
|
24
31
|
openDelayMs?: number;
|
|
25
32
|
disabled?: boolean;
|
|
33
|
+
grouped?: boolean;
|
|
26
34
|
variant?: 'compact' | 'preview';
|
|
27
35
|
widthAnchorRef?: RefObject<HTMLElement | null>;
|
|
28
36
|
} & ({
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
+
* @param props.as - physical container tag; use span to preserve inline text layout.
|
|
17
|
+
* @returns the list container and its private hover coordinator.
|
|
18
|
+
*/
|
|
19
|
+
export declare function HoverCardGroup({ children, className, as: Container, }: {
|
|
20
|
+
children: ReactNode;
|
|
21
|
+
className?: string | undefined;
|
|
22
|
+
as?: 'div' | 'span';
|
|
23
|
+
}): import("react").JSX.Element;
|
|
24
|
+
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'react';
|
|
1
2
|
/** Lightbox strings the owner resolves from its own locale namespace. */
|
|
2
3
|
export interface ImageLightboxLabels {
|
|
3
4
|
/** Accessible name of the preview dialog. */
|
|
@@ -15,12 +16,14 @@ export interface ImageLightboxLabels {
|
|
|
15
16
|
* @param props.src - the original image URL.
|
|
16
17
|
* @param props.alt - the image's alt text.
|
|
17
18
|
* @param props.labels - dialog and close-control strings.
|
|
19
|
+
* @param props.contextMenuProps - optional original-image gesture bindings.
|
|
18
20
|
* @param props.onClose - dismiss callback owned by the opener.
|
|
19
21
|
* @returns the modal preview dialog.
|
|
20
22
|
*/
|
|
21
|
-
export declare function ImageLightbox({ src, alt, labels, onClose, }: {
|
|
23
|
+
export declare function ImageLightbox({ src, alt, labels, onClose, contextMenuProps, }: {
|
|
22
24
|
src: string;
|
|
23
25
|
alt: string;
|
|
24
26
|
labels: ImageLightboxLabels;
|
|
25
27
|
onClose: () => void;
|
|
28
|
+
contextMenuProps?: Pick<HTMLAttributes<HTMLElement>, 'onContextMenu' | 'onKeyDown' | 'tabIndex'> | undefined;
|
|
26
29
|
}): import("react").ReactPortal;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** Multi-line inline editor for short saved-on-Enter drafts such as queued messages and goals. */
|
|
2
|
+
/**
|
|
3
|
+
* Render an autofocused textarea that grows with its text up to six lines, then scrolls.
|
|
4
|
+
* A textarea rather than an input: HTML strips newlines from single-line input values.
|
|
5
|
+
* Enter saves, Shift+Enter breaks the line, Enter during IME composition does nothing,
|
|
6
|
+
* and Escape cancels.
|
|
7
|
+
* @param props.value - current draft text.
|
|
8
|
+
* @param props.label - localized accessible name.
|
|
9
|
+
* @param props.onChange - receives the edited text.
|
|
10
|
+
* @param props.onSave - called for a plain Enter.
|
|
11
|
+
* @param props.onCancel - called for Escape.
|
|
12
|
+
* @param props.className - extra class for the editor's placement.
|
|
13
|
+
* @returns the textarea.
|
|
14
|
+
*/
|
|
15
|
+
export declare function InlineEditor({ value, label, onChange, onSave, onCancel, className, }: {
|
|
16
|
+
value: string;
|
|
17
|
+
label: string;
|
|
18
|
+
onChange: (value: string) => void;
|
|
19
|
+
onSave: () => void;
|
|
20
|
+
onCancel: () => void;
|
|
21
|
+
className?: string;
|
|
22
|
+
}): import("react").JSX.Element;
|
package/dist/types/Menu.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export interface MenuItem {
|
|
|
14
14
|
/** Destructive row: error-colored text/icon and danger hover fill. */
|
|
15
15
|
danger?: boolean;
|
|
16
16
|
/** Nested card opened to the right on hover/focus. */
|
|
17
|
-
submenu?: readonly
|
|
17
|
+
submenu?: readonly MenuEntry[];
|
|
18
18
|
}
|
|
19
19
|
/** Hairline between item groups (not selectable). */
|
|
20
20
|
export interface MenuSeparator {
|
|
@@ -37,8 +37,16 @@ export interface MenuItemButtonProps {
|
|
|
37
37
|
shortcut?: MenuItem['shortcut'];
|
|
38
38
|
/** Leading icon (figma .Menu_cell gap 8). */
|
|
39
39
|
icon?: ReactNode;
|
|
40
|
+
/** Whether this row identifies the currently displayed page or view. */
|
|
41
|
+
current?: boolean;
|
|
40
42
|
/** Whether the row cannot be activated. */
|
|
41
43
|
disabled?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Why the disabled row cannot be activated. The row then stays hoverable and
|
|
46
|
+
* focusable, shows the reason in a tooltip, and exposes it as the row's
|
|
47
|
+
* description; an enabled row ignores it.
|
|
48
|
+
*/
|
|
49
|
+
disabledReason?: string | undefined;
|
|
42
50
|
/** Destructive row: error-colored text/icon and danger hover fill. */
|
|
43
51
|
danger?: boolean;
|
|
44
52
|
/**
|
|
@@ -60,13 +68,15 @@ export interface MenuItemButtonProps {
|
|
|
60
68
|
* @param props.children - visible row label.
|
|
61
69
|
* @param props.shortcut - effective key labels and accessible combination.
|
|
62
70
|
* @param props.icon - optional leading icon.
|
|
71
|
+
* @param props.current - whether the row identifies the currently displayed page or view.
|
|
63
72
|
* @param props.disabled - whether the row cannot be activated.
|
|
73
|
+
* @param props.disabledReason - why a disabled row cannot be activated, shown in a tooltip and read as its description.
|
|
64
74
|
* @param props.danger - whether to use the destructive row colors.
|
|
65
75
|
* @param props.separatorBefore - whether this row starts a new group (hairline above it).
|
|
66
76
|
* @param props.onSelect - row activation callback.
|
|
67
77
|
* @returns one menu-item row.
|
|
68
78
|
*/
|
|
69
|
-
export declare function MenuItemButton({ children, shortcut, icon, disabled, danger, separatorBefore, onSelect, }: MenuItemButtonProps): import("react").JSX.Element;
|
|
79
|
+
export declare function MenuItemButton({ children, shortcut, icon, current, disabled, disabledReason, danger, separatorBefore, onSelect, }: MenuItemButtonProps): import("react").JSX.Element;
|
|
70
80
|
/**
|
|
71
81
|
* Render an anchored dropdown menu. While the list is open its keys mirror the
|
|
72
82
|
* composer's: Tab settles the focused row — from the trigger, Tab enters the
|
|
@@ -74,6 +84,9 @@ export declare function MenuItemButton({ children, shortcut, icon, disabled, dan
|
|
|
74
84
|
* anchor's first button, and selecting a row does the same — the rows unmount
|
|
75
85
|
* with the list. Only a keyboard on the trigger or inside the list is
|
|
76
86
|
* intercepted; Tab presses elsewhere on the page stay the browser's.
|
|
87
|
+
* @param props.contextual - cursor positioning, context dismissal, and per-divider icon alignment.
|
|
88
|
+
* @param props.exiting - retain an inert popup during dismissal or replacement fade.
|
|
89
|
+
* @param props.returnFocus - original control captured before asynchronous menu preparation.
|
|
77
90
|
* @param props.autoFocus - focus the first item on open; the arrow keys walk the list either way.
|
|
78
91
|
* @param props.open - whether the list is showing (owner-controlled).
|
|
79
92
|
* @param props.anchor - the trigger element (rendered in place).
|
|
@@ -87,9 +100,9 @@ export declare function MenuItemButton({ children, shortcut, icon, disabled, dan
|
|
|
87
100
|
* @param props.align - list alignment against the anchor (default 'start').
|
|
88
101
|
* @param props.side - open below (`bottom`, default) or above (`top`) the anchor.
|
|
89
102
|
* @param props.portal - render the list into document.body, fixed-positioned
|
|
90
|
-
*
|
|
91
|
-
* ancestor's overflow clipping would crop the
|
|
92
|
-
* keeps the pure-CSS in-place behavior.
|
|
103
|
+
* synchronously (follows movement, resizing, and browser zoom while open)
|
|
104
|
+
* and clamped inside the visual viewport. Use when an ancestor's overflow clipping would crop the
|
|
105
|
+
* in-place list; default false keeps the pure-CSS in-place behavior.
|
|
93
106
|
* @param props.closeOnPointerLeave - close the list once the pointer has left
|
|
94
107
|
* both trigger and list for the pointer grace (default false keeps it open
|
|
95
108
|
* until outside click/Escape/selection). The grace makes the 4px trigger->list
|
|
@@ -100,10 +113,11 @@ export declare function MenuItemButton({ children, shortcut, icon, disabled, dan
|
|
|
100
113
|
* directly (e.g. from a host-owned trigger button) instead of measuring the
|
|
101
114
|
* Menu's own wrapper span. Required when the wrapper isn't itself laid out at
|
|
102
115
|
* the trigger (render-prop anchors, effect-positioned proxies — measuring the
|
|
103
|
-
* wrapper there races the host's layout effects). Called
|
|
104
|
-
*
|
|
116
|
+
* wrapper there races the host's layout effects). Called while tracking the
|
|
117
|
+
* anchor and on scroll/resize; return null to defer placement.
|
|
118
|
+
* @param props.minWidthFromAnchor - in portal mode, keep the menu at least as wide as its anchor, bounded by viewport margins.
|
|
105
119
|
* @param props.footer - rows pinned below the scrolling items area, separated
|
|
106
|
-
* by a hairline;
|
|
120
|
+
* by a hairline; contextual menus reuse an explicit leading separator. These rows stay visible while the items above scroll.
|
|
107
121
|
* @param props.children - component rows rendered after `items` in the same
|
|
108
122
|
* list, each a `role="menuitem"` button such as {@link MenuItemButton}; they
|
|
109
123
|
* share the keyboard walk, the submenu exclusivity, and the post-selection
|
|
@@ -118,8 +132,14 @@ export declare function MenuItemButton({ children, shortcut, icon, disabled, dan
|
|
|
118
132
|
* document.body outside the owner's DOM subtree.
|
|
119
133
|
* @returns anchor wrapper with the conditional list.
|
|
120
134
|
*/
|
|
121
|
-
export declare function Menu({ open, anchor, items, children, selectedId, selectedIds, onSelect, onClose, align, side, portal, closeOnPointerLeave, dense, compact, autoFocus, selection, getAnchorRect, footer, className, listClassName, }: {
|
|
135
|
+
export declare function Menu({ open, anchor, items, children, selectedId, selectedIds, onSelect, onClose, align, side, portal, closeOnPointerLeave, dense, compact, autoFocus, selection, getAnchorRect, minWidthFromAnchor, footer, className, listClassName, contextual, exiting, returnFocus, }: {
|
|
122
136
|
open: boolean;
|
|
137
|
+
/** Pointer-positioned popup: cursor clearance, grouped icons, and context gestures. */
|
|
138
|
+
contextual?: boolean;
|
|
139
|
+
/** Resolve the original control for focus restoration and inert/hidden dismissal. */
|
|
140
|
+
returnFocus?: (() => HTMLElement | null) | undefined;
|
|
141
|
+
/** Retain a dismissed context popup during its short fade. */
|
|
142
|
+
exiting?: 'dismiss' | 'replace' | undefined;
|
|
123
143
|
autoFocus?: boolean;
|
|
124
144
|
anchor: ReactNode;
|
|
125
145
|
items?: readonly MenuEntry[];
|
|
@@ -137,6 +157,7 @@ export declare function Menu({ open, anchor, items, children, selectedId, select
|
|
|
137
157
|
compact?: boolean;
|
|
138
158
|
selection?: 'check' | 'fill';
|
|
139
159
|
getAnchorRect?: () => DOMRect | null;
|
|
160
|
+
minWidthFromAnchor?: boolean;
|
|
140
161
|
className?: string | undefined;
|
|
141
162
|
listClassName?: string | undefined;
|
|
142
163
|
}): import("react").JSX.Element;
|
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
/** Shared menu material and the macOS backing that lets Chromium blur transparent windows. */
|
|
2
2
|
import { type ComponentPropsWithoutRef } from 'react';
|
|
3
|
+
/** Context-menu transition durations in milliseconds, shared with its lifecycle owner. */
|
|
4
|
+
export declare const MENU_TRANSITION_MS: Readonly<{
|
|
5
|
+
enter: 40;
|
|
6
|
+
dismiss: 80;
|
|
7
|
+
replace: 10;
|
|
8
|
+
prepare: 20;
|
|
9
|
+
}>;
|
|
3
10
|
/** Menu containers preserve native div props and refs. */
|
|
4
11
|
export interface MenuSurfaceProps extends ComponentPropsWithoutRef<'div'> {
|
|
5
12
|
/** Match the shared compact menu's smaller outer radius. */
|
|
6
13
|
compact?: boolean;
|
|
14
|
+
/** Fade direct content, material, and native backing without isolating the material's backdrop. */
|
|
15
|
+
phase?: 'enter' | 'dismiss' | 'replace' | undefined;
|
|
7
16
|
}
|
|
8
17
|
/**
|
|
9
18
|
* Paint a menu and, on macOS, an opaque backing behind the page content within its bounds.
|
|
@@ -36,3 +36,15 @@ 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;
|
|
@@ -0,0 +1,23 @@
|
|
|
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;
|
|
@@ -14,12 +14,14 @@ 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;
|
|
@@ -5,6 +5,8 @@ export declare const DEFAULT_TERMINAL_MAX_LINES = 16;
|
|
|
5
5
|
* (this package is cordis-free, so copy arrives via props).
|
|
6
6
|
*/
|
|
7
7
|
export interface TerminalBlockLabels {
|
|
8
|
+
/** Accessible name for an overflowing authored command line, numbered from one. */
|
|
9
|
+
commandLine: (line: number) => string;
|
|
8
10
|
/** Status pill text for a signal-terminated command. */
|
|
9
11
|
signal: (signal: string) => string;
|
|
10
12
|
/** Status pill text for a non-zero exit code. */
|
|
@@ -33,7 +35,7 @@ export interface TerminalBlockLabels {
|
|
|
33
35
|
expand: (hidden: number) => string;
|
|
34
36
|
}
|
|
35
37
|
export interface TerminalBlockProps {
|
|
36
|
-
/** The command
|
|
38
|
+
/** The command, rendered verbatim after the prompt label; long lines scroll horizontally unless the host enables wrapping. */
|
|
37
39
|
command: string;
|
|
38
40
|
/** Working directory for the prompt label; absent renders a plain `$`. */
|
|
39
41
|
cwd?: string | undefined;
|
|
@@ -50,6 +52,12 @@ export interface TerminalBlockProps {
|
|
|
50
52
|
* line alone; with output it renders the live text under the running state.
|
|
51
53
|
*/
|
|
52
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;
|
|
53
61
|
/** Height cap in output lines before the middle collapses (default {@link DEFAULT_TERMINAL_MAX_LINES}); Infinity disables the cap. */
|
|
54
62
|
maxLines?: number | undefined;
|
|
55
63
|
/**
|
|
@@ -74,4 +82,4 @@ export interface TerminalBlockProps {
|
|
|
74
82
|
* @param props - see {@link TerminalBlockProps}.
|
|
75
83
|
* @returns the terminal block element.
|
|
76
84
|
*/
|
|
77
|
-
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;
|
package/dist/types/Tooltip.d.ts
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
/** Anchor-preserving tooltips; an optional body portal escapes clipping containers and stacking contexts that cap the bubble's z-index. */
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import type { Context, FocusEventHandler, MouseEventHandler, ReactElement, Ref } from 'react';
|
|
4
|
-
|
|
5
|
-
export type TooltipSide
|
|
3
|
+
import type { Context, FocusEventHandler, MouseEventHandler, PointerEventHandler, ReactElement, Ref } from 'react';
|
|
4
|
+
import { type TooltipSide } from './tooltip-placement.js';
|
|
5
|
+
export type { TooltipSide } from './tooltip-placement.js';
|
|
6
6
|
/**
|
|
7
|
-
* Suppression channel for
|
|
8
|
-
*
|
|
7
|
+
* Suppression channel for nested tooltips: a visible descendant tooltip
|
|
8
|
+
* withdraws the enclosing tooltip while its bubble is shown.
|
|
9
9
|
*/
|
|
10
10
|
export declare const TooltipSuppression: Context<((suppressed: boolean) => void) | null>;
|
|
11
11
|
/** Props Tooltip injects into its anchor child; the child's own handlers are chained ahead of the tooltip's. */
|
|
12
12
|
interface AnchorProps {
|
|
13
13
|
'aria-describedby'?: string | undefined;
|
|
14
14
|
ref?: Ref<HTMLElement> | undefined;
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
onPointerEnter?: PointerEventHandler | undefined;
|
|
16
|
+
onPointerLeave?: PointerEventHandler | undefined;
|
|
17
|
+
onPointerDown?: PointerEventHandler | undefined;
|
|
17
18
|
onClick?: MouseEventHandler | undefined;
|
|
18
19
|
onFocus?: FocusEventHandler | undefined;
|
|
19
20
|
onBlur?: FocusEventHandler | undefined;
|
|
@@ -23,30 +24,35 @@ type TooltipLabel = string | (() => string);
|
|
|
23
24
|
* Attach a hover/focus tooltip to an anchor element.
|
|
24
25
|
* @param props.label - bubble text, or a resolver evaluated only while visible; an empty string shows only shortcut keys.
|
|
25
26
|
* @param props.shortcutKeys - effective key labels rendered as platform-formatted keycaps after optional text.
|
|
26
|
-
* @param props.side - placement
|
|
27
|
+
* @param props.side - preferred placement (default 'right'); fitting tries the opposite then perpendicular sides.
|
|
27
28
|
* @param props.align - horizontal anchor-edge alignment for 'bottom'/'top' bubbles: 'end' pins
|
|
28
29
|
* the bubble's right edge to the anchor's (for anchors beside other hover surfaces the centered
|
|
29
|
-
* bubble would overlap); default 'center'.
|
|
30
|
+
* bubble would overlap); default 'center'. Horizontal placements ignore it.
|
|
30
31
|
* @param props.portal - render the bubble under document.body, so an ancestor's clipping or its
|
|
31
32
|
* stacking context (which confines the bubble's z-index to that context) cannot hide it.
|
|
32
33
|
* @param props.delayMs - hover delay in milliseconds (default 0).
|
|
33
34
|
* @param props.focusDelayMs - keyboard focus delay in milliseconds (default 0); blur, click,
|
|
34
35
|
* mouse leave, disabling, and unmount cancel a pending show.
|
|
35
36
|
* @param props.gap - anchor-to-bubble distance in pixels for 'bottom'/'top' bubbles (default 8);
|
|
36
|
-
*
|
|
37
|
+
* horizontal placements use 10px, including after a flip.
|
|
37
38
|
* @param props.disabled - suppress the bubble while true; the anchor renders identically so
|
|
38
39
|
* toggling never remounts it (which would cut its CSS transitions).
|
|
39
40
|
* @param props.maxWidth - bubble width cap in pixels, for labels long enough that the default
|
|
40
|
-
* half-viewport cap would render a slab wider than the surface the anchor sits on.
|
|
41
|
-
* @param props.openOnClick - clicking also pins the bubble for reading; another click, Escape,
|
|
41
|
+
* half-viewport cap would render a slab wider than the surface the anchor sits on; always bounded by viewport margins.
|
|
42
|
+
* @param props.openOnClick - clicking or tapping also pins the bubble for reading; another click, Escape,
|
|
42
43
|
* Tab, or an outside pointerdown dismisses it. Defaults to false for ordinary action tooltips.
|
|
44
|
+
* @param props.onlyWhenClipped - show the bubble only when the anchor or an HTML element inside it
|
|
45
|
+
* overflows horizontally, measured when the bubble is about to show; for labels that repeat
|
|
46
|
+
* text an ellipsis may cut off. Defaults to false.
|
|
43
47
|
* @param props.children - a single anchor element; its own ref (callback or object) is forwarded alongside the tooltip's.
|
|
44
48
|
* @returns the cloned anchor plus a fixed-position bubble, optionally portaled to the body.
|
|
45
49
|
* The bubble stays hidden until ResizeObserver supplies its size for viewport fitting; clicking the
|
|
46
50
|
* anchor dismisses the bubble unless openOnClick is enabled, and focus arriving after a pointer
|
|
47
|
-
* interaction (a closing menu refocusing its trigger) never raises it.
|
|
51
|
+
* interaction (a closing menu refocusing its trigger) never raises it. Touch cannot trigger hover
|
|
52
|
+
* tooltips; tapping still invokes the child's action and can open an openOnClick explanation.
|
|
53
|
+
* When no side fits, the viewport-bounded fallback may overlap the anchor; oversized content is scrollable when pinned.
|
|
48
54
|
*/
|
|
49
|
-
export declare function Tooltip({ label, shortcutKeys, side, align, delayMs, focusDelayMs, gap, disabled, portal, maxWidth, openOnClick, children, }: {
|
|
55
|
+
export declare function Tooltip({ label, shortcutKeys, side, align, delayMs, focusDelayMs, gap, disabled, portal, maxWidth, openOnClick, onlyWhenClipped, children, }: {
|
|
50
56
|
label: TooltipLabel;
|
|
51
57
|
shortcutKeys?: readonly string[] | undefined;
|
|
52
58
|
side?: TooltipSide;
|
|
@@ -58,6 +64,6 @@ export declare function Tooltip({ label, shortcutKeys, side, align, delayMs, foc
|
|
|
58
64
|
portal?: boolean;
|
|
59
65
|
maxWidth?: number;
|
|
60
66
|
openOnClick?: boolean;
|
|
67
|
+
onlyWhenClipped?: boolean;
|
|
61
68
|
children: ReactElement<AnchorProps>;
|
|
62
69
|
}): React.JSX.Element;
|
|
63
|
-
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
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;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type DocumentZoomLabels } from './document-zoom.js';
|
|
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>>;
|
package/dist/types/blocks.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ export { JsonTree } from './JsonTree.js';
|
|
|
2
2
|
export type { JsonTreeProps, JsonTreeLabels } from './JsonTree.js';
|
|
3
3
|
export { TerminalBlock, DEFAULT_TERMINAL_MAX_LINES } from './TerminalBlock.js';
|
|
4
4
|
export type { TerminalBlockProps, TerminalBlockLabels } from './TerminalBlock.js';
|
|
5
|
+
export { CommandText } from './CommandText.js';
|
|
6
|
+
export type { CommandTextProps } from './CommandText.js';
|
|
5
7
|
export { ReadBlock, DEFAULT_READ_MAX_LINES } from './ReadBlock.js';
|
|
6
8
|
export type { ReadBlockProps, ReadBlockLine, ReadBlockLabels } from './ReadBlock.js';
|
|
7
9
|
export { DiffBlock, DEFAULT_DIFF_MAX_LINES, diffTotals } from './DiffBlock.js';
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/** Stable file preparation callbacks supplied by a transfer-owning plugin. */
|
|
2
|
+
/** Caller-supplied export naming, shared by Web and Desktop (`@deepseek-ai/dsh-util-file-drag`). */
|
|
3
|
+
export interface DragFileName {
|
|
4
|
+
readonly name?: string | undefined;
|
|
5
|
+
readonly mediaType: string;
|
|
6
|
+
readonly outputExtension?: string | undefined;
|
|
7
|
+
}
|
|
8
|
+
/** Content source and optional Host-verifiable identity of its unmodified local original. */
|
|
9
|
+
export type FileDragSource = DragFileName & {
|
|
10
|
+
readonly resourceAddress?: string | undefined;
|
|
11
|
+
} & ({
|
|
12
|
+
readonly kind: 'blob';
|
|
13
|
+
readonly blob: Blob;
|
|
14
|
+
} | {
|
|
15
|
+
readonly kind: 'url';
|
|
16
|
+
readonly url: string;
|
|
17
|
+
});
|
|
18
|
+
/** Prepared operation; release cancels unused resources without ending an active browser transfer. */
|
|
19
|
+
export interface PreparedFileDrag {
|
|
20
|
+
/**
|
|
21
|
+
* Start the prepared transfer while the browser payload is writable.
|
|
22
|
+
* @param transfer - writable dragstart payload.
|
|
23
|
+
* @param source - native source node, retained through drag end.
|
|
24
|
+
* @returns true for browser dragging; false when native dragging takes over.
|
|
25
|
+
*/
|
|
26
|
+
start(transfer: DataTransfer, source: HTMLElement): boolean;
|
|
27
|
+
/** Release this preparation once the pointer leaves or the source unmounts. */
|
|
28
|
+
release(): void;
|
|
29
|
+
}
|
|
30
|
+
/** Presentation sees preparation and feedback; transport selection belongs to the plugin. */
|
|
31
|
+
export interface FileDragActions {
|
|
32
|
+
/** @param source - file content and export name. @param signal - preparation cancellation. @returns the ready start/release operation. */
|
|
33
|
+
prepare(source: FileDragSource, signal: AbortSignal): Promise<PreparedFileDrag>;
|
|
34
|
+
/** Display the plugin's localized retry message, independently of the originating component. */
|
|
35
|
+
reportFailure(): void;
|
|
36
|
+
}
|