@deepseek-ai/dsh-client-ui-primitives 0.2.1-rc.4 → 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.
- package/README.i18n.yaml +18 -18
- package/README.md +35 -14
- package/README.zh.md +35 -14
- package/lib/AnimatedRows.module.css +7 -0
- package/lib/Button.module.css +18 -11
- package/lib/CodeCard.module.css +4 -2
- package/lib/ConnectionIndicator.module.css +8 -6
- package/lib/DetailDocument.module.css +67 -0
- package/lib/DiffBlock.module.css +4 -2
- package/lib/DisclosureRow.module.css +11 -7
- package/lib/HoverCard.module.css +13 -0
- package/lib/JsonTree.module.css +45 -9
- package/lib/Menu.module.css +14 -4
- package/lib/Modal.module.css +4 -2
- package/lib/Pill.module.css +4 -2
- package/lib/QuotePreview.module.css +101 -0
- package/lib/ReadBlock.module.css +4 -2
- package/lib/RowDragPreview.module.css +12 -0
- package/lib/SearchBlock.module.css +4 -2
- package/lib/SegmentedControl.module.css +6 -1
- package/lib/SegmentedTabs.module.css +25 -3
- package/lib/TerminalBlock.module.css +4 -2
- package/lib/Toast.module.css +4 -2
- package/lib/UserMessageBubble.module.css +11 -0
- package/lib/WebBlock.module.css +14 -2
- package/lib/ZoomControls.module.css +54 -0
- package/lib/index.js +3346 -4315
- package/lib/markdown/JsonBlock.module.css +4 -2
- package/lib/markdown/MarkdownText.module.css +37 -12
- package/lib/settings-form/fields.module.css +11 -3
- package/lib/types/AnimatedRows.d.ts +46 -0
- package/lib/types/Button.d.ts +1 -1
- package/lib/types/DetailDocument.d.ts +78 -0
- package/lib/types/DraggableImage.d.ts +19 -0
- package/lib/types/HoverCard.d.ts +7 -2
- package/lib/types/HoverCardGroup.d.ts +4 -2
- package/lib/types/QuotePreview.d.ts +24 -0
- package/lib/types/SegmentedTabs.d.ts +3 -1
- package/lib/types/Tooltip.d.ts +13 -7
- package/lib/types/UserMessageBubble.d.ts +11 -0
- package/lib/types/ZoomControls.d.ts +27 -0
- package/lib/types/document-zoom.d.ts +17 -0
- package/lib/types/file-drag-actions.d.ts +32 -0
- package/lib/types/focus.d.ts +7 -0
- package/lib/types/icons/artwork.d.ts +418 -0
- package/lib/types/icons/index.d.ts +195 -194
- package/lib/types/icons/shared-artwork.d.ts +6 -12
- package/lib/types/image-drag.d.ts +17 -0
- package/lib/types/index.d.ts +20 -1
- package/lib/types/markdown/MarkdownDelegate.d.ts +6 -1
- package/lib/types/markdown/MarkdownText.d.ts +9 -4
- package/lib/types/markdown/highlight.d.ts +22 -0
- package/lib/types/markdown/mathCompatibility.d.ts +14 -5
- package/lib/types/markdown/quote-text.d.ts +8 -0
- package/lib/types/markdown/render.d.ts +4 -1
- package/lib/types/markdown/windows-path-destinations.d.ts +11 -0
- package/lib/types/overlay-top-margin.d.ts +9 -2
- package/lib/types/use-clipboard-copy.d.ts +14 -0
- package/lib/types/useRowDragPreview.d.ts +20 -0
- package/package.json +9 -7
- package/lib/types/use-copy-feedback.d.ts +0 -14
|
@@ -3,38 +3,32 @@ interface WeightedArtworkProps extends IconProps {
|
|
|
3
3
|
strokeWidth: number;
|
|
4
4
|
}
|
|
5
5
|
/**
|
|
6
|
-
* Render
|
|
7
|
-
*
|
|
8
|
-
* @returns The decorative SVG artwork.
|
|
9
|
-
*/
|
|
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.
|
|
6
|
+
* Render conversation geometry — the chat bubble around two text lines —
|
|
7
|
+
* for session reference icons; it matches the `queue-outline` product glyph.
|
|
14
8
|
* @param props - Size, optional CSS class, and inherited stroke width.
|
|
15
9
|
* @returns The decorative SVG artwork.
|
|
16
10
|
*/
|
|
17
11
|
export declare const ChatLinesOutlineArtwork: ({ size, className, strokeWidth }: WeightedArtworkProps) => import("react").JSX.Element;
|
|
18
12
|
/**
|
|
19
|
-
* Render
|
|
13
|
+
* Render globe geometry for link icons; it matches the `globe-outline` product glyph.
|
|
20
14
|
* @param props - Size, optional CSS class, and inherited stroke width.
|
|
21
15
|
* @returns The decorative SVG artwork.
|
|
22
16
|
*/
|
|
23
17
|
export declare const GlobeOutlineArtwork: ({ size, className, strokeWidth }: WeightedArtworkProps) => import("react").JSX.Element;
|
|
24
18
|
/**
|
|
25
|
-
* Render
|
|
19
|
+
* Render code-bracket geometry for link icons; it matches the `inspect-outline` product glyph.
|
|
26
20
|
* @param props - Size, optional CSS class, and inherited stroke width.
|
|
27
21
|
* @returns The decorative SVG artwork.
|
|
28
22
|
*/
|
|
29
23
|
export declare const CodeBracketsArtwork: ({ size, className, strokeWidth }: WeightedArtworkProps) => import("react").JSX.Element;
|
|
30
24
|
/**
|
|
31
|
-
* Render
|
|
25
|
+
* Render document-browse geometry for reference icons; it matches the `browse-outline` product glyph.
|
|
32
26
|
* @param props - Size, optional CSS class, and inherited stroke width.
|
|
33
27
|
* @returns The decorative SVG artwork.
|
|
34
28
|
*/
|
|
35
29
|
export declare const BrowseOutlineArtwork: ({ size, className, strokeWidth }: WeightedArtworkProps) => import("react").JSX.Element;
|
|
36
30
|
/**
|
|
37
|
-
* Render
|
|
31
|
+
* Render closed-folder geometry for reference and link icons; it matches the `folder-close` product glyph.
|
|
38
32
|
* @param props - Size, optional CSS class, and inherited stroke width.
|
|
39
33
|
* @returns The decorative SVG artwork.
|
|
40
34
|
*/
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** Image gestures delegate file preparation and transport to the owning feature. */
|
|
2
|
+
import { type ImgHTMLAttributes } from 'react';
|
|
3
|
+
import type { FileDragActions } from './file-drag-actions.ts';
|
|
4
|
+
type ImageGestures = Required<Pick<ImgHTMLAttributes<HTMLImageElement>, 'onPointerEnter' | 'onPointerDown' | 'onPointerLeave' | 'onDragStart' | 'onDragEnd' | 'onClickCapture'>>;
|
|
5
|
+
/**
|
|
6
|
+
* Prepare resource-backed images on primary press, other images also on hover; release on leave.
|
|
7
|
+
* Releasing inside the image retains preparation for the next gesture; cancelled drags never start late.
|
|
8
|
+
* @param actions - stable file preparation and error callbacks.
|
|
9
|
+
* @param src - displayed image URL.
|
|
10
|
+
* @param name - proposed export name.
|
|
11
|
+
* @param original - already loaded original bytes.
|
|
12
|
+
* @param resourceAddress - verifiable reference to an unmodified local original.
|
|
13
|
+
* @returns image gesture handlers; overflowing images remain owned by their pan handler.
|
|
14
|
+
*/
|
|
15
|
+
export declare function useImageDrag(actions: FileDragActions, src: string, name: string, original?: File, resourceAddress?: string): ImageGestures;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=image-drag.d.ts.map
|
package/lib/types/index.d.ts
CHANGED
|
@@ -2,14 +2,23 @@
|
|
|
2
2
|
* Cordis-free React primitives styled only through `--dsw-*` tokens.
|
|
3
3
|
*/
|
|
4
4
|
export type { CodeToolbarLabels } from './CodeToolbar.tsx';
|
|
5
|
+
export { UserMessageBubble } from './UserMessageBubble.tsx';
|
|
6
|
+
export type { UserMessageBubbleProps } from './UserMessageBubble.tsx';
|
|
5
7
|
export { StateDot } from './StateDot.tsx';
|
|
6
8
|
export type { StateDotState } from './StateDot.tsx';
|
|
7
9
|
export { DisclosureRow } from './DisclosureRow.tsx';
|
|
8
10
|
export type { DisclosureRowProps } from './DisclosureRow.tsx';
|
|
11
|
+
export { AnimatedRows } from './AnimatedRows.tsx';
|
|
12
|
+
export type { AnimatedRowsProps } from './AnimatedRows.tsx';
|
|
13
|
+
export { useRowDragPreview } from './useRowDragPreview.ts';
|
|
9
14
|
export { TextShimmer } from './TextShimmer.tsx';
|
|
10
15
|
export type { TextShimmerProps } from './TextShimmer.tsx';
|
|
11
16
|
export { Button } from './Button.tsx';
|
|
12
17
|
export type { ButtonVariant } from './Button.tsx';
|
|
18
|
+
export { ZoomControls } from './ZoomControls.tsx';
|
|
19
|
+
export type { ZoomControlsHandle } from './ZoomControls.tsx';
|
|
20
|
+
export { DOCUMENT_ZOOM } from './document-zoom.ts';
|
|
21
|
+
export type { DocumentZoomLabels } from './document-zoom.ts';
|
|
13
22
|
export { Pill } from './Pill.tsx';
|
|
14
23
|
export { SegmentedTabs } from './SegmentedTabs.tsx';
|
|
15
24
|
export type { SegmentedTab } from './SegmentedTabs.tsx';
|
|
@@ -35,7 +44,7 @@ export { HoverCard } from './HoverCard.tsx';
|
|
|
35
44
|
export { HoverCardGroup } from './HoverCardGroup.tsx';
|
|
36
45
|
export { ShortcutKeys } from './ShortcutKeys.tsx';
|
|
37
46
|
export { observeComposition } from './keyboard-composition.ts';
|
|
38
|
-
export { focusWithoutRing } from './focus.ts';
|
|
47
|
+
export { focusWithoutRing, isMobileDevice } from './focus.ts';
|
|
39
48
|
export { closeTopModal, isBehindModal, modalSelector, useModalLayer } from './useModalLayer.ts';
|
|
40
49
|
export { Modal } from './Modal.tsx';
|
|
41
50
|
export { RiskConfirmation } from './RiskConfirmation.tsx';
|
|
@@ -59,6 +68,11 @@ export { pointerModality } from './input-modality.ts';
|
|
|
59
68
|
export { Toast } from './Toast.tsx';
|
|
60
69
|
export { fileSizeText } from './file-size.ts';
|
|
61
70
|
export { writeClipboard } from './clipboard.ts';
|
|
71
|
+
export type { FileDragActions, FileDragSource, PreparedFileDrag } from './file-drag-actions.ts';
|
|
72
|
+
export { DraggableImage } from './DraggableImage.tsx';
|
|
73
|
+
export type { DraggableImageProps } from './DraggableImage.tsx';
|
|
74
|
+
export { useClipboardCopy } from './use-clipboard-copy.ts';
|
|
75
|
+
export type { ClipboardCopyState } from './use-clipboard-copy.ts';
|
|
62
76
|
export { SettingsForm } from './settings-form/SettingsForm.tsx';
|
|
63
77
|
export type { SettingsFormLabels, SettingsFormProps } from './settings-form/SettingsForm.tsx';
|
|
64
78
|
export { SettingsSecretField, SettingsValueField } from './settings-form/fields.tsx';
|
|
@@ -90,6 +104,8 @@ export type { CodeBlockProps } from './markdown/CodeBlock.tsx';
|
|
|
90
104
|
export { JsonBlock } from './markdown/JsonBlock.tsx';
|
|
91
105
|
export { MarkdownDelegateProvider } from './markdown/MarkdownDelegate.tsx';
|
|
92
106
|
export type { MarkdownDelegate, MarkdownDelegateProviderProps, MarkdownExternalLinkHandler } from './markdown/MarkdownDelegate.tsx';
|
|
107
|
+
export { DetailDocument, detailDocumentState, useDetailDocumentLabels } from './DetailDocument.tsx';
|
|
108
|
+
export type { DetailDocumentCopy, DetailDocumentLabels, DetailDocumentRead, DetailDocumentState } from './DetailDocument.tsx';
|
|
93
109
|
export { MarkdownText } from './markdown/MarkdownText.tsx';
|
|
94
110
|
export type { MarkdownCodeLabels, MarkdownFileMentions, MarkdownLabels, MarkdownPathImages } from './markdown/MarkdownText.tsx';
|
|
95
111
|
export { extractMarkdownPlainText } from './markdown/plain-text.ts';
|
|
@@ -99,4 +115,7 @@ export { PluginArtworkTerminal, PluginArtworkLoop, PluginArtworkSubagent, Plugin
|
|
|
99
115
|
export { GuideArtworkBrowser, GuideArtworkFiles } from './guide-artwork.tsx';
|
|
100
116
|
export { ImageLightbox } from './ImageLightbox.tsx';
|
|
101
117
|
export type { ImageLightboxLabels } from './ImageLightbox.tsx';
|
|
118
|
+
export { QuotePreview } from './QuotePreview.tsx';
|
|
119
|
+
export type { QuotePreviewProps, QuotePreviewRemoval } from './QuotePreview.tsx';
|
|
120
|
+
export { formatQuoteText } from './markdown/quote-text.ts';
|
|
102
121
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -7,9 +7,14 @@ import type { ImageLightboxLabels } from '../ImageLightbox.tsx';
|
|
|
7
7
|
export type MarkdownExternalLinkHandler = (href: string) => void;
|
|
8
8
|
/** Navigation capabilities supplied by the nearest Markdown owner. */
|
|
9
9
|
export interface MarkdownDelegate {
|
|
10
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* Image previews for decoded local paths in this owner's workspace. The renderer
|
|
12
|
+
* appends a per-mount `load` query parameter to `api/file` route URLs.
|
|
13
|
+
*/
|
|
11
14
|
readonly fileImages?: {
|
|
15
|
+
fileDrag: import('../file-drag-actions.ts').FileDragActions;
|
|
12
16
|
resolve: (path: string) => string | undefined;
|
|
17
|
+
resourceAddress?: ((path: string) => string) | undefined;
|
|
13
18
|
labels: ImageLightboxLabels & {
|
|
14
19
|
open: string;
|
|
15
20
|
loading: string;
|
|
@@ -31,19 +31,24 @@ export type { MarkdownCodeLabels, MarkdownFileMentions, MarkdownLabels, Markdown
|
|
|
31
31
|
* `MarkdownDelegateProvider` can delegate ordinary HTTP(S) activation while
|
|
32
32
|
* modified clicks retain native behavior. `variant="compact"` uses secondary
|
|
33
33
|
* text sizing, uniform bold headings, and tight block spacing; the default
|
|
34
|
-
* `body` variant uses the full document typography.
|
|
34
|
+
* `body` variant uses the full document typography. `omitHtml` renders raw
|
|
35
|
+
* HTML as nothing instead of literal text, for documents written for HTML
|
|
36
|
+
* renderers, such as package READMEs. `textInteractionSource` marks the
|
|
37
|
+
* existing root as a source for text selection interactions.
|
|
35
38
|
* The provider's `openFile` enables local Markdown links in settled messages,
|
|
36
39
|
* including `#L24` and `#L24-L30` destinations (ranges open at their first line).
|
|
37
|
-
* @returns A GFM document with TeX math rendered through KaTeX; raw HTML
|
|
38
|
-
* unsafe protocols are disabled. Local links without an opener remain text;
|
|
40
|
+
* @returns A GFM document with TeX math rendered through KaTeX; raw HTML never
|
|
41
|
+
* renders as markup, and unsafe protocols are disabled. Local links without an opener remain text;
|
|
39
42
|
* absolute HTTP(S) images render directly.
|
|
40
43
|
*/
|
|
41
|
-
export declare const MarkdownText: import("react").MemoExoticComponent<({ text, streaming, labels, fileMentions, pathImages, variant, }: {
|
|
44
|
+
export declare const MarkdownText: import("react").MemoExoticComponent<({ text, streaming, labels, fileMentions, pathImages, variant, omitHtml, textInteractionSource, }: {
|
|
42
45
|
text: string;
|
|
43
46
|
streaming?: boolean;
|
|
44
47
|
labels: MarkdownLabels;
|
|
45
48
|
fileMentions?: MarkdownFileMentions | undefined;
|
|
46
49
|
pathImages?: MarkdownPathImages | undefined;
|
|
47
50
|
variant?: "body" | "compact";
|
|
51
|
+
omitHtml?: boolean;
|
|
52
|
+
textInteractionSource?: boolean;
|
|
48
53
|
}) => import("react").JSX.Element>;
|
|
49
54
|
//# sourceMappingURL=MarkdownText.d.ts.map
|
|
@@ -17,7 +17,28 @@
|
|
|
17
17
|
* An unknown or absent language falls back to plain text (no highlighting, still
|
|
18
18
|
* monospace) — never an error.
|
|
19
19
|
*/
|
|
20
|
+
import langTs from '@shikijs/langs/typescript';
|
|
20
21
|
import type { CSSProperties } from 'react';
|
|
22
|
+
/** A shiki grammar module's default export (a `LanguageRegistration[]`), taken
|
|
23
|
+
* from a boot grammar so no direct `@shikijs/types` dependency is needed. */
|
|
24
|
+
type LangModule = {
|
|
25
|
+
default: typeof langTs;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Replace the Go grammar's repeated one-line struct-field rule with the rule
|
|
29
|
+
* worlpaker/go-syntax merged in 4a9b120a52c (https://github.com/worlpaker/go-syntax/pull/25):
|
|
30
|
+
* the repeated rule backtracks exponentially on lines such as a brace-bearing
|
|
31
|
+
* comment after `struct {`. Delete this patch once `@shikijs/langs` ships that
|
|
32
|
+
* commit; 4.5.0 does not. The rule is located as the only rule in
|
|
33
|
+
* `struct_variables_types_fields` containing the field-token literal below,
|
|
34
|
+
* taken from `@shikijs/langs` 4.4.3.
|
|
35
|
+
* @param grammars - the `@shikijs/langs/go` default export, left unmodified.
|
|
36
|
+
* @returns copies of `grammars` with that rule's match replaced in the `go` grammar.
|
|
37
|
+
* @throws When the module has no `go` grammar, the grammar lacks
|
|
38
|
+
* `struct_variables_types_fields`, or that entry has no or several such rules.
|
|
39
|
+
* The lazy load then rejects unhandled and Go code renders as plain text.
|
|
40
|
+
*/
|
|
41
|
+
export declare function patchGoGrammar(grammars: LangModule['default']): LangModule['default'];
|
|
21
42
|
/**
|
|
22
43
|
* Resolve a language hint to the grammar id {@link LANG_ALIASES} selects.
|
|
23
44
|
* @param lang - Language hint from a code surface: a canonical grammar id or the read card's persisted short id.
|
|
@@ -145,4 +166,5 @@ export interface StreamingHighlightFrame {
|
|
|
145
166
|
* @returns one entry per source line (each an array of runs), or `undefined` for unknown or not-yet-loaded languages.
|
|
146
167
|
*/
|
|
147
168
|
export declare function highlightLines(code: string, lang: string | undefined): HighlightSpan[][] | undefined;
|
|
169
|
+
export {};
|
|
148
170
|
//# sourceMappingURL=highlight.d.ts.map
|
|
@@ -1,10 +1,19 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Extend upstream dollar-only math syntax with TeX delimiters while reusing its
|
|
3
|
+
* token vocabulary. The dollar construct is dispatched before upstream's
|
|
4
|
+
* `mathFlow`, so the shapes it accepts keep the opening line's text as math
|
|
5
|
+
* instead of fence meta, which the renderer does not read. A `$$` candidate it
|
|
6
|
+
* declines — a `$$` sequence the line does not end after, or a block left open
|
|
7
|
+
* — is left to that upstream flow.
|
|
8
|
+
*/
|
|
2
9
|
import type { Extension } from 'micromark-util-types';
|
|
3
10
|
/**
|
|
4
|
-
* TeX backslash delimiters and
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
11
|
+
* TeX backslash delimiters and display-dollar blocks as a micromark syntax
|
|
12
|
+
* extension reusing `micromark-extension-math`'s token vocabulary; the caller
|
|
13
|
+
* must also register `math()` on the same parse so the emitted tokens compile
|
|
14
|
+
* to standard math nodes. Both `$$<math>$$` on one line and a `$$<math>` block
|
|
15
|
+
* closed by a trailing `$$` parse as one math node, and a closing `$$` may sit
|
|
16
|
+
* at the end of a content line.
|
|
8
17
|
* @returns The micromark syntax extension.
|
|
9
18
|
*/
|
|
10
19
|
export declare function mathCompatibility(): Extension;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Shared Markdown blockquote formatting for browser text. */
|
|
2
|
+
/**
|
|
3
|
+
* Project selected visible text as an ordinary Markdown blockquote.
|
|
4
|
+
* @param text - selected visible text without quote markers.
|
|
5
|
+
* @returns one `> `-prefixed line per normalized input line.
|
|
6
|
+
*/
|
|
7
|
+
export declare function formatQuoteText(text: string): string;
|
|
8
|
+
//# sourceMappingURL=quote-text.d.ts.map
|
|
@@ -65,7 +65,8 @@ export interface MarkdownPathImages {
|
|
|
65
65
|
* Resolve one authored image destination.
|
|
66
66
|
* @param value - The destination exactly as the markdown author wrote it.
|
|
67
67
|
* @returns A displayable absolute URL, or undefined when the destination
|
|
68
|
-
* names no displayable image — it then stays inert alt text.
|
|
68
|
+
* names no displayable image — it then stays inert alt text. The renderer
|
|
69
|
+
* appends a per-mount `load` query parameter to `api/file` route results.
|
|
69
70
|
*/
|
|
70
71
|
resolve(value: string): string | undefined;
|
|
71
72
|
}
|
|
@@ -102,6 +103,8 @@ export interface MarkdownRenderContext {
|
|
|
102
103
|
readonly fileMentions: MarkdownFileMentions | undefined;
|
|
103
104
|
/** Local-path image vocabulary; absent wherever no rewriting owner exists. */
|
|
104
105
|
readonly pathImages: MarkdownPathImages | undefined;
|
|
106
|
+
/** Raw HTML renders nothing instead of literal text. */
|
|
107
|
+
readonly omitHtml: boolean;
|
|
105
108
|
/** Inside an anchor's children: interactive mentions must not nest there. */
|
|
106
109
|
readonly inLink?: boolean;
|
|
107
110
|
/** Reference targets visible to this pass. */
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Extension } from 'mdast-util-from-markdown';
|
|
2
|
+
/**
|
|
3
|
+
* CommonMark reads `\.` or `\_` in a destination as an escaped character, so
|
|
4
|
+
* `D:\repo\.github` would parse as `D:\repo.github`. For a destination that
|
|
5
|
+
* is a Windows path, this `fromMarkdown` extension keeps every backslash
|
|
6
|
+
* literally, including one before punctuation such as `\(`, while character
|
|
7
|
+
* references such as `&` still decode; other destinations parse unchanged.
|
|
8
|
+
* @returns The mdast extension.
|
|
9
|
+
*/
|
|
10
|
+
export declare function windowsPathDestinations(): Extension;
|
|
11
|
+
//# sourceMappingURL=windows-path-destinations.d.ts.map
|
|
@@ -2,7 +2,14 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Resolve the top margin an overlay keeps from the viewport edge.
|
|
4
4
|
* @param min - the overlay's own viewport margin in px, used as the floor.
|
|
5
|
-
* @
|
|
5
|
+
* @param anchor - the overlay's anchor rect in viewport coordinates. While the anchor's top edge is inside the
|
|
6
|
+
* viewport, the margin never exceeds `anchor.bottom + gap`, so an overlay opened from a control inside the top strip
|
|
7
|
+
* stays next to it.
|
|
8
|
+
* @param gap - the distance the overlay keeps below `anchor`.
|
|
9
|
+
* @returns the frame clearance plus 20px (20px in fullscreen), capped by a visible `anchor`, but never below `min`.
|
|
6
10
|
*/
|
|
7
|
-
export declare function overlayTopMargin(min: number
|
|
11
|
+
export declare function overlayTopMargin(min: number, anchor?: {
|
|
12
|
+
readonly top: number;
|
|
13
|
+
readonly bottom: number;
|
|
14
|
+
}, gap?: number): number;
|
|
8
15
|
//# sourceMappingURL=overlay-top-margin.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** Clipboard action and its temporary success state. */
|
|
2
|
+
export interface ClipboardCopyState {
|
|
3
|
+
/** True for one second after an accepted clipboard write. */
|
|
4
|
+
readonly copied: boolean;
|
|
5
|
+
/** Write the current text unless a write or success indication is already active. */
|
|
6
|
+
readonly onCopy: () => void;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Keep clipboard feedback local to the mounted control and release its reset timer on unmount.
|
|
10
|
+
* @param text - Exact text to copy when the action is invoked.
|
|
11
|
+
* @returns Success feedback and a callback stable while text and feedback are unchanged.
|
|
12
|
+
*/
|
|
13
|
+
export declare function useClipboardCopy(text: string): ClipboardCopyState;
|
|
14
|
+
//# sourceMappingURL=use-clipboard-copy.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { DragEvent } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Own a row's inert drag preview until drag end, replacement, or unmount.
|
|
4
|
+
* The offscreen copy keeps WebKit snapshots separate from overlapping panels.
|
|
5
|
+
* The wrapper copies only explicitly requested computed custom properties.
|
|
6
|
+
* Its cloned slot DOM remains in document.body for that lifetime; query live rows
|
|
7
|
+
* within their list to exclude duplicate text and element IDs.
|
|
8
|
+
* @param className - preview background matching the row's surface; WebKit fills
|
|
9
|
+
* transparent snapshot pixels white, including rounded corners.
|
|
10
|
+
* @param inheritedProperties - custom-property names whose computed values the preview needs.
|
|
11
|
+
* Omit to copy none. Keep the list reference stable; replacing it clears the active preview.
|
|
12
|
+
* @returns preview callbacks; cleanup reports whether this row started a drag,
|
|
13
|
+
* even when its preview failed or the row became non-draggable before drag end.
|
|
14
|
+
* Start accepts the source row when a child handle owns the drag event.
|
|
15
|
+
*/
|
|
16
|
+
export declare function useRowDragPreview(className: string, inheritedProperties?: readonly `--${string}`[]): {
|
|
17
|
+
start: (event: DragEvent<HTMLElement>, row?: HTMLElement) => void;
|
|
18
|
+
clear: () => boolean;
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=useRowDragPreview.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-client-ui-primitives",
|
|
3
3
|
"description": "Pure React atoms for the dsh web UI: controls, icons, markdown, and JSON inspectors (zero cordis)",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.2-alpha.2",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
},
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@deepseek-ai/dsh-client-store": "0.2.
|
|
27
|
-
"@deepseek-ai/cordis": "~4.0.
|
|
28
|
-
"@deepseek-ai/dsh-util-code-language": "0.2.
|
|
26
|
+
"@deepseek-ai/dsh-client-store": "0.2.2-alpha.2",
|
|
27
|
+
"@deepseek-ai/cordis": "~4.0.6-alpha.1",
|
|
28
|
+
"@deepseek-ai/dsh-util-code-language": "0.2.2-alpha.2",
|
|
29
29
|
"react": "^18.2.0",
|
|
30
30
|
"clsx": "^2.0.0",
|
|
31
31
|
"diff": "^9.0.0",
|
|
@@ -34,11 +34,12 @@
|
|
|
34
34
|
"katex": "^0.18.7",
|
|
35
35
|
"micromark-core-commonmark": "^2.0.3",
|
|
36
36
|
"micromark-util-character": "^2.1.1",
|
|
37
|
+
"micromark-util-decode-string": "^2.0.1",
|
|
37
38
|
"micromark-util-classify-character": "^2.0.1",
|
|
38
39
|
"micromark-util-symbol": "^2.0.1",
|
|
39
40
|
"micromark-util-types": "^2.0.2",
|
|
40
41
|
"shiki": "^4.4.3",
|
|
41
|
-
"@deepseek-ai/dsh-util-workspace-path": "0.2.
|
|
42
|
+
"@deepseek-ai/dsh-util-workspace-path": "0.2.2-alpha.2",
|
|
42
43
|
"@shikijs/langs": "^4.4.3",
|
|
43
44
|
"@types/mdast": "^4.0.4",
|
|
44
45
|
"micromark-factory-space": "^2.0.1",
|
|
@@ -48,7 +49,8 @@
|
|
|
48
49
|
"mdast-util-math": "^3.0.0",
|
|
49
50
|
"micromark-extension-gfm": "^3.0.0",
|
|
50
51
|
"micromark-util-sanitize-uri": "^2.0.1",
|
|
51
|
-
"simple-icons": "16.31.0"
|
|
52
|
+
"simple-icons": "16.31.0",
|
|
53
|
+
"@deepseek-ai/dsh-util-file-drag": "0.2.2-alpha.2"
|
|
52
54
|
},
|
|
53
55
|
"files": [
|
|
54
56
|
"lib/index.js",
|
|
@@ -56,6 +58,6 @@
|
|
|
56
58
|
"lib/types/**/*.d.ts"
|
|
57
59
|
],
|
|
58
60
|
"peerDependencies": {
|
|
59
|
-
"@deepseek-ai/cordis": "~4.0.
|
|
61
|
+
"@deepseek-ai/cordis": "~4.0.6-alpha.1"
|
|
60
62
|
}
|
|
61
63
|
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/** The copy-feedback hook's return: the transient flag and the copy handler. */
|
|
2
|
-
export interface CopyFeedback {
|
|
3
|
-
/** True for {@link COPIED_FEEDBACK_MS} after a successful write; render the success label off it. */
|
|
4
|
-
copied: boolean;
|
|
5
|
-
/** Copy the hook's text; no-op while `copied` is still true, silent on a refused write. */
|
|
6
|
-
onCopy: () => void;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Copy `text` to the clipboard with one-second success feedback.
|
|
10
|
-
* @param text - the text to write on copy.
|
|
11
|
-
* @returns the `copied` flag and the `onCopy` handler.
|
|
12
|
-
*/
|
|
13
|
-
export declare function useCopyFeedback(text: string): CopyFeedback;
|
|
14
|
-
//# sourceMappingURL=use-copy-feedback.d.ts.map
|