@qilin-agent/client-ui-primitives 3.1.5 → 3.1.7
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 +10 -10
- package/README.md +8 -5
- package/README.zh.md +8 -5
- package/lib/ImageLightbox.module.css +14 -5
- package/lib/InlineEditor.module.css +23 -0
- package/lib/MenuSurface.module.css +2 -2
- package/lib/SecretText.module.css +52 -0
- package/lib/SegmentedTabs.module.css +55 -0
- package/lib/Tooltip.module.css +18 -3
- package/lib/index.js +4363 -1570
- package/lib/types/InlineEditor.d.ts +23 -0
- package/lib/types/LinkIcon.d.ts +15 -30
- package/lib/types/Menu.d.ts +24 -9
- package/lib/types/PermissionIcon.d.ts +51 -0
- package/lib/types/ReferenceIcon.d.ts +12 -7
- package/lib/types/SecretText.d.ts +25 -0
- package/lib/types/SegmentedTabs.d.ts +26 -0
- package/lib/types/SiteGlyph.d.ts +1 -1
- package/lib/types/TerminalBlock.d.ts +7 -1
- package/lib/types/Tooltip.d.ts +32 -13
- package/lib/types/code-file-types.d.ts +1 -1
- package/lib/types/credential-formats.d.ts +63 -0
- package/lib/types/credential-masks.d.ts +60 -0
- package/lib/types/credential-scanner.d.ts +146 -0
- package/lib/types/format-tables.d.ts +29 -0
- package/lib/types/icons/index.d.ts +398 -211
- package/lib/types/icons/props.d.ts +1 -1
- package/lib/types/icons/shared-artwork.d.ts +43 -0
- package/lib/types/index.d.ts +9 -3
- package/lib/types/plugin-artwork.d.ts +17 -0
- package/lib/types/tooltip-placement.d.ts +35 -0
- package/lib/types/useAnchoredPosition.d.ts +3 -1
- package/lib/types/user-text.d.ts +13 -2
- package/package.json +5 -5
|
@@ -0,0 +1,23 @@
|
|
|
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;
|
|
23
|
+
//# sourceMappingURL=InlineEditor.d.ts.map
|
package/lib/types/LinkIcon.d.ts
CHANGED
|
@@ -1,34 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Leading category
|
|
3
|
-
*
|
|
4
|
-
* every glyph renders fill="currentColor" and so rides the link's own
|
|
5
|
-
* color. Glyphs stay private to this module: the public surface is the
|
|
6
|
-
* category vocabulary, not the individual glyph components, so consumers
|
|
7
|
-
* cannot compose a glyph outside a link. Design sources:
|
|
8
|
-
* ic_globe_language_outline_20, ic_code_outline_20, ic_folder_outline_20,
|
|
9
|
-
* ic_photo_outline_20, ic_paper_doc_outline_20, ic_paper_outline_20.
|
|
10
|
-
*
|
|
11
|
-
* A `url` glyph whose destination names a well-known site is that site's own
|
|
12
|
-
* mark instead of the globe (`SiteGlyph.tsx`); every mark keeps the same
|
|
13
|
-
* currentColor-only rule.
|
|
2
|
+
* Leading current-color category glyphs for clickable artifact links. The
|
|
3
|
+
* public component keeps individual artwork private to the link vocabulary.
|
|
14
4
|
*/
|
|
15
5
|
import type { ReactNode } from 'react';
|
|
16
6
|
import type { IconProps } from './icons/props.ts';
|
|
17
|
-
/**
|
|
18
|
-
* Link categories with distinct leading glyphs. `url` and `folder` are
|
|
19
|
-
* destination categories the consumer states directly; the rest are file
|
|
20
|
-
* categories `classifyLinkPath` derives from a path. Code, web, and data
|
|
21
|
-
* files share the `code` glyph by design.
|
|
22
|
-
*/
|
|
7
|
+
/** Link categories with distinct leading glyphs. */
|
|
23
8
|
export type LinkIconKind = 'url' | 'folder' | 'code' | 'image' | 'document' | 'other';
|
|
24
|
-
/** Props for
|
|
9
|
+
/** Props for link icons: the category plus the shared icon sizing seat. */
|
|
25
10
|
export interface LinkIconProps extends IconProps {
|
|
26
11
|
kind: LinkIconKind;
|
|
27
|
-
/**
|
|
28
|
-
* Destination of a `url` link. A well-known site draws its own mark, so
|
|
29
|
-
* callers that know the destination should pass it; anything else keeps the
|
|
30
|
-
* globe. Other kinds ignore it — their destination is a path, not a site.
|
|
31
|
-
*/
|
|
12
|
+
/** Destination of a URL link; known HTTP(S) hosts render their site mark. */
|
|
32
13
|
href?: string | undefined;
|
|
33
14
|
}
|
|
34
15
|
/**
|
|
@@ -39,11 +20,15 @@ export interface LinkIconProps extends IconProps {
|
|
|
39
20
|
*/
|
|
40
21
|
export declare function classifyLinkPath(path: string): LinkIconKind;
|
|
41
22
|
/**
|
|
42
|
-
* Render
|
|
43
|
-
* @param props -
|
|
44
|
-
*
|
|
45
|
-
|
|
46
|
-
|
|
23
|
+
* Render a regular one-pixel link icon.
|
|
24
|
+
* @param props - Link category, size, and optional class.
|
|
25
|
+
* @returns The regular decorative link glyph.
|
|
26
|
+
*/
|
|
27
|
+
export declare function LinkIconRegular(props: LinkIconProps): ReactNode;
|
|
28
|
+
/**
|
|
29
|
+
* Render a medium 1.3px link icon.
|
|
30
|
+
* @param props - Link category, size, and optional class.
|
|
31
|
+
* @returns The medium decorative link glyph.
|
|
47
32
|
*/
|
|
48
|
-
export declare function
|
|
33
|
+
export declare function LinkIconMedium(props: LinkIconProps): ReactNode;
|
|
49
34
|
//# sourceMappingURL=LinkIcon.d.ts.map
|
package/lib/types/Menu.d.ts
CHANGED
|
@@ -37,6 +37,8 @@ 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;
|
|
42
44
|
/** Destructive row: error-colored text/icon and danger hover fill. */
|
|
@@ -60,13 +62,14 @@ export interface MenuItemButtonProps {
|
|
|
60
62
|
* @param props.children - visible row label.
|
|
61
63
|
* @param props.shortcut - effective key labels and accessible combination.
|
|
62
64
|
* @param props.icon - optional leading icon.
|
|
65
|
+
* @param props.current - whether the row identifies the currently displayed page or view.
|
|
63
66
|
* @param props.disabled - whether the row cannot be activated.
|
|
64
67
|
* @param props.danger - whether to use the destructive row colors.
|
|
65
68
|
* @param props.separatorBefore - whether this row starts a new group (hairline above it).
|
|
66
69
|
* @param props.onSelect - row activation callback.
|
|
67
70
|
* @returns one menu-item row.
|
|
68
71
|
*/
|
|
69
|
-
export declare function MenuItemButton({ children, shortcut, icon, disabled, danger, separatorBefore, onSelect, }: MenuItemButtonProps): import("react").JSX.Element;
|
|
72
|
+
export declare function MenuItemButton({ children, shortcut, icon, current, disabled, danger, separatorBefore, onSelect, }: MenuItemButtonProps): import("react").JSX.Element;
|
|
70
73
|
/**
|
|
71
74
|
* Render an anchored dropdown menu. While the list is open its keys mirror the
|
|
72
75
|
* composer's: Tab settles the focused row — from the trigger, Tab enters the
|
|
@@ -77,17 +80,17 @@ export declare function MenuItemButton({ children, shortcut, icon, disabled, dan
|
|
|
77
80
|
* @param props.autoFocus - focus the first item on open; the arrow keys walk the list either way.
|
|
78
81
|
* @param props.open - whether the list is showing (owner-controlled).
|
|
79
82
|
* @param props.anchor - the trigger element (rendered in place).
|
|
80
|
-
* @param props.items - selectable rows and optional separators.
|
|
83
|
+
* @param props.items - selectable data rows and optional separators (default none; with no `children` either, the list is empty).
|
|
81
84
|
* @param props.selectedId - row shown as selected.
|
|
82
85
|
* @param props.selectedIds - rows shown as selected when a menu contains independent option groups.
|
|
83
|
-
* @param props.onSelect - row
|
|
86
|
+
* @param props.onSelect - data-row activation callback (not called for disabled rows or submenu parents that only open children).
|
|
84
87
|
* @param props.onClose - invoked on outside click, Escape, or a window blur
|
|
85
88
|
* that moved focus into an iframe (the only signal a pointerdown inside a
|
|
86
89
|
* cross-origin iframe leaves).
|
|
87
90
|
* @param props.align - list alignment against the anchor (default 'start').
|
|
88
91
|
* @param props.side - open below (`bottom`, default) or above (`top`) the anchor.
|
|
89
92
|
* @param props.portal - render the list into document.body, fixed-positioned
|
|
90
|
-
* from the anchor rect (
|
|
93
|
+
* from the anchor rect (follows movement and resizing while open). Use when an
|
|
91
94
|
* ancestor's overflow clipping would crop the in-place list; default false
|
|
92
95
|
* keeps the pure-CSS in-place behavior.
|
|
93
96
|
* @param props.closeOnPointerLeave - close the list once the pointer has left
|
|
@@ -100,25 +103,35 @@ export declare function MenuItemButton({ children, shortcut, icon, disabled, dan
|
|
|
100
103
|
* directly (e.g. from a host-owned trigger button) instead of measuring the
|
|
101
104
|
* Menu's own wrapper span. Required when the wrapper isn't itself laid out at
|
|
102
105
|
* the trigger (render-prop anchors, effect-positioned proxies — measuring the
|
|
103
|
-
* wrapper there races the host's layout effects). Called on open
|
|
104
|
-
* scroll/resize; return null to skip placement for that frame.
|
|
106
|
+
* wrapper there races the host's layout effects). Called on open, each animation
|
|
107
|
+
* frame, and scroll/resize; return null to skip placement for that frame.
|
|
108
|
+
* @param props.minWidthFromAnchor - in portal mode, keep the menu at least as wide as its anchor, bounded by viewport margins.
|
|
105
109
|
* @param props.footer - rows pinned below the scrolling items area, separated
|
|
106
110
|
* by a hairline; they stay visible while the items above scroll.
|
|
111
|
+
* @param props.children - component rows rendered after `items` in the same
|
|
112
|
+
* list, each a `role="menuitem"` button such as {@link MenuItemButton}; they
|
|
113
|
+
* share the keyboard walk, the submenu exclusivity, and the post-selection
|
|
114
|
+
* focus return.
|
|
107
115
|
* @param props.selection - how a selected row is marked: a trailing check
|
|
108
116
|
* (`'check'`, default — figma .Menu_cell) or the hover fill held on the row
|
|
109
117
|
* with no check (`'fill'`, for icon-labelled rows where a trailing glyph
|
|
110
118
|
* crowds the cell).
|
|
119
|
+
* @param props.className - extra class on the anchor wrapper span.
|
|
120
|
+
* @param props.listClassName - extra class on the dropdown card itself; the
|
|
121
|
+
* only style hook that reaches a portaled list, which renders under
|
|
122
|
+
* document.body outside the owner's DOM subtree.
|
|
111
123
|
* @returns anchor wrapper with the conditional list.
|
|
112
124
|
*/
|
|
113
|
-
export declare function Menu({ open, anchor, items, selectedId, selectedIds, onSelect, onClose, align, side, portal, closeOnPointerLeave, dense, compact, autoFocus, selection, getAnchorRect, footer, className }: {
|
|
125
|
+
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 }: {
|
|
114
126
|
open: boolean;
|
|
115
127
|
autoFocus?: boolean;
|
|
116
128
|
anchor: ReactNode;
|
|
117
|
-
items
|
|
129
|
+
items?: readonly MenuEntry[];
|
|
130
|
+
children?: ReactNode;
|
|
118
131
|
footer?: readonly MenuEntry[];
|
|
119
132
|
selectedId?: string | undefined;
|
|
120
133
|
selectedIds?: readonly string[] | undefined;
|
|
121
|
-
onSelect
|
|
134
|
+
onSelect?: (id: string) => void;
|
|
122
135
|
onClose: () => void;
|
|
123
136
|
align?: 'start' | 'end';
|
|
124
137
|
side?: 'bottom' | 'top' | 'right';
|
|
@@ -128,6 +141,8 @@ export declare function Menu({ open, anchor, items, selectedId, selectedIds, onS
|
|
|
128
141
|
compact?: boolean;
|
|
129
142
|
selection?: 'check' | 'fill';
|
|
130
143
|
getAnchorRect?: () => DOMRect | null;
|
|
144
|
+
minWidthFromAnchor?: boolean;
|
|
131
145
|
className?: string | undefined;
|
|
146
|
+
listClassName?: string | undefined;
|
|
132
147
|
}): import("react").JSX.Element;
|
|
133
148
|
//# sourceMappingURL=Menu.d.ts.map
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { IconProps } from './icons/props.ts';
|
|
3
|
+
/**
|
|
4
|
+
* Render the read-only permission icon with a one-pixel stroke.
|
|
5
|
+
* @param props - Size and optional class.
|
|
6
|
+
* @returns The regular decorative permission glyph.
|
|
7
|
+
*/
|
|
8
|
+
export declare function PermissionIconReadOnlyRegular(props: IconProps): ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* Render the read-only permission icon with a 1.3px stroke.
|
|
11
|
+
* @param props - Size and optional class.
|
|
12
|
+
* @returns The medium decorative permission glyph.
|
|
13
|
+
*/
|
|
14
|
+
export declare function PermissionIconReadOnlyMedium(props: IconProps): ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* Render the workspace-write permission icon with a one-pixel stroke.
|
|
17
|
+
* @param props - Size and optional class.
|
|
18
|
+
* @returns The regular decorative permission glyph.
|
|
19
|
+
*/
|
|
20
|
+
export declare function PermissionIconWorkspaceWriteRegular(props: IconProps): ReactNode;
|
|
21
|
+
/**
|
|
22
|
+
* Render the workspace-write permission icon with a 1.3px stroke.
|
|
23
|
+
* @param props - Size and optional class.
|
|
24
|
+
* @returns The medium decorative permission glyph.
|
|
25
|
+
*/
|
|
26
|
+
export declare function PermissionIconWorkspaceWriteMedium(props: IconProps): ReactNode;
|
|
27
|
+
/**
|
|
28
|
+
* Render the full-access permission icon with a one-pixel stroke.
|
|
29
|
+
* @param props - Size and optional class.
|
|
30
|
+
* @returns The regular decorative permission glyph.
|
|
31
|
+
*/
|
|
32
|
+
export declare function PermissionIconFullAccessRegular(props: IconProps): ReactNode;
|
|
33
|
+
/**
|
|
34
|
+
* Render the full-access permission icon with a 1.3px stroke.
|
|
35
|
+
* @param props - Size and optional class.
|
|
36
|
+
* @returns The medium decorative permission glyph.
|
|
37
|
+
*/
|
|
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;
|
|
51
|
+
//# sourceMappingURL=PermissionIcon.d.ts.map
|
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
+
import type { IconProps } from './icons/props.ts';
|
|
2
3
|
/** Reference domains with distinct composer and transcript glyphs. */
|
|
3
4
|
export type ReferenceIconKind = 'session' | 'file' | 'folder';
|
|
4
5
|
/** Props shared by inline reference glyphs. */
|
|
5
|
-
export interface ReferenceIconProps {
|
|
6
|
+
export interface ReferenceIconProps extends IconProps {
|
|
6
7
|
kind: ReferenceIconKind;
|
|
7
|
-
size?: number;
|
|
8
|
-
className?: string | undefined;
|
|
9
8
|
}
|
|
10
9
|
/**
|
|
11
|
-
* Render
|
|
12
|
-
* @param props - Reference kind,
|
|
13
|
-
* @returns The
|
|
10
|
+
* Render a regular one-pixel reference icon.
|
|
11
|
+
* @param props - Reference kind, size, and optional class.
|
|
12
|
+
* @returns The regular decorative reference glyph.
|
|
14
13
|
*/
|
|
15
|
-
export declare function
|
|
14
|
+
export declare function ReferenceIconRegular(props: ReferenceIconProps): ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* Render a medium 1.3px reference icon.
|
|
17
|
+
* @param props - Reference kind, size, and optional class.
|
|
18
|
+
* @returns The medium decorative reference glyph.
|
|
19
|
+
*/
|
|
20
|
+
export declare function ReferenceIconMedium(props: ReferenceIconProps): ReactNode;
|
|
16
21
|
//# sourceMappingURL=ReferenceIcon.d.ts.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** Copy for the control that reveals one masked credential. */
|
|
2
|
+
export interface SecretTextLabels {
|
|
3
|
+
/** Name while the value stays masked. */
|
|
4
|
+
readonly reveal: string;
|
|
5
|
+
/** Name while the value is shown. */
|
|
6
|
+
readonly hide: string;
|
|
7
|
+
}
|
|
8
|
+
/** Props of one masked credential. */
|
|
9
|
+
export interface SecretTextProps {
|
|
10
|
+
/** Display form of the range; line breaks stay in place. */
|
|
11
|
+
readonly masked: string;
|
|
12
|
+
/** Original spelling, revealed on demand, and the identity that re-masks a different value. */
|
|
13
|
+
readonly raw: string;
|
|
14
|
+
/** Reveal-control copy; absent in text that offers no reveal control. */
|
|
15
|
+
readonly labels?: SecretTextLabels | undefined;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Draw one credential masked. Interactive text adds a control that reveals or
|
|
19
|
+
* hides this value; every mount, and every different original value at the same
|
|
20
|
+
* position, starts masked.
|
|
21
|
+
* @param props - the masked form, the original spelling, and optional control copy.
|
|
22
|
+
* @returns the masked run, with the reveal control when copy is supplied.
|
|
23
|
+
*/
|
|
24
|
+
export declare function SecretText({ masked, raw, labels }: SecretTextProps): import("react").JSX.Element;
|
|
25
|
+
//# sourceMappingURL=SecretText.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
/** A tab links its localized label to a caller-owned panel. */
|
|
3
|
+
export interface SegmentedTab<Value extends string = string> {
|
|
4
|
+
value: Value;
|
|
5
|
+
label: ReactNode;
|
|
6
|
+
id: string;
|
|
7
|
+
panelId: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Render equal-width, controlled tabs with a sliding selection indicator.
|
|
11
|
+
* @param props.items - non-empty ordered tabs with unique values and DOM ids.
|
|
12
|
+
* @param props.value - selected value, which must belong to items.
|
|
13
|
+
* @param props.onChange - selection requested by click, Left/Right, or Home/End.
|
|
14
|
+
* Keyboard selection also moves focus; only the selected tab is a tab stop.
|
|
15
|
+
* @param props.label - localized accessible name for the tab list.
|
|
16
|
+
* @param props.className - layout placement; panels remain caller-owned.
|
|
17
|
+
* @returns the tab list, without its panels.
|
|
18
|
+
*/
|
|
19
|
+
export declare function SegmentedTabs<Value extends string>({ items, value, onChange, label, className }: {
|
|
20
|
+
items: readonly [SegmentedTab<Value>, ...SegmentedTab<Value>[]];
|
|
21
|
+
value: Value;
|
|
22
|
+
onChange: (value: Value) => void;
|
|
23
|
+
label: string;
|
|
24
|
+
className?: string | undefined;
|
|
25
|
+
}): ReactNode;
|
|
26
|
+
//# sourceMappingURL=SegmentedTabs.d.ts.map
|
package/lib/types/SiteGlyph.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Site marks for well-known external link hosts. {@link
|
|
2
|
+
* Site marks for well-known external link hosts. {@link LinkIconMedium} renders one in
|
|
3
3
|
* the leading glyph seat, so a familiar destination leads with its own mark
|
|
4
4
|
* instead of the generic globe. The marks are the `simple-icons` artwork set
|
|
5
5
|
* (CC0-1.0), pinned by this package's dependency on it; each mark takes the
|
|
@@ -52,6 +52,12 @@ export interface TerminalBlockProps {
|
|
|
52
52
|
* output printed so far when there is any, with no copy control until it settles.
|
|
53
53
|
*/
|
|
54
54
|
running?: boolean | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* The call launches background work (default false). `running` describes the
|
|
57
|
+
* launch call only; after it returns, retain the command without job status
|
|
58
|
+
* or output.
|
|
59
|
+
*/
|
|
60
|
+
background?: boolean | undefined;
|
|
55
61
|
/** Height cap in output lines before the middle collapses (default {@link DEFAULT_TERMINAL_MAX_LINES}); Infinity disables the cap. */
|
|
56
62
|
maxLines?: number | undefined;
|
|
57
63
|
/** Extra class merged onto the wrapper (callers position; this component draws). */
|
|
@@ -64,5 +70,5 @@ export interface TerminalBlockProps {
|
|
|
64
70
|
* @param props - see {@link TerminalBlockProps}.
|
|
65
71
|
* @returns the terminal block element.
|
|
66
72
|
*/
|
|
67
|
-
export declare function TerminalBlock({ command, cwd, home, output, exitCode, signal, running, maxLines, className, labels, }: TerminalBlockProps): import("react").JSX.Element;
|
|
73
|
+
export declare function TerminalBlock({ command, cwd, home, output, exitCode, signal, running, background, maxLines, className, labels, }: TerminalBlockProps): import("react").JSX.Element;
|
|
68
74
|
//# sourceMappingURL=TerminalBlock.d.ts.map
|
package/lib/types/Tooltip.d.ts
CHANGED
|
@@ -1,45 +1,64 @@
|
|
|
1
|
+
/** Anchor-preserving tooltips; an optional body portal escapes clipping containers and stacking contexts that cap the bubble's z-index. */
|
|
1
2
|
import type { FocusEventHandler, MouseEventHandler, ReactElement, Ref } from 'react';
|
|
2
|
-
|
|
3
|
-
export type TooltipSide
|
|
3
|
+
import { type TooltipSide } from './tooltip-placement.ts';
|
|
4
|
+
export type { TooltipSide } from './tooltip-placement.ts';
|
|
4
5
|
/**
|
|
5
|
-
* Suppression channel for
|
|
6
|
-
*
|
|
6
|
+
* Suppression channel for nested tooltips: a visible descendant tooltip
|
|
7
|
+
* withdraws the enclosing tooltip while its bubble is shown.
|
|
7
8
|
*/
|
|
8
9
|
export declare const TooltipSuppression: import("react").Context<((suppressed: boolean) => void) | null>;
|
|
9
10
|
/** Props Tooltip injects into its anchor child; the child's own handlers are chained ahead of the tooltip's. */
|
|
10
11
|
interface AnchorProps {
|
|
12
|
+
'aria-describedby'?: string | undefined;
|
|
11
13
|
ref?: Ref<HTMLElement> | undefined;
|
|
12
14
|
onMouseEnter?: MouseEventHandler | undefined;
|
|
13
15
|
onMouseLeave?: MouseEventHandler | undefined;
|
|
16
|
+
onClick?: MouseEventHandler | undefined;
|
|
14
17
|
onFocus?: FocusEventHandler | undefined;
|
|
15
18
|
onBlur?: FocusEventHandler | undefined;
|
|
16
19
|
}
|
|
17
20
|
type TooltipLabel = string | (() => string);
|
|
18
21
|
/**
|
|
19
22
|
* Attach a hover/focus tooltip to an anchor element.
|
|
20
|
-
* @param props.label - bubble text, or a resolver evaluated only while
|
|
23
|
+
* @param props.label - bubble text, or a resolver evaluated only while visible; an empty string shows only shortcut keys.
|
|
21
24
|
* @param props.shortcutKeys - effective key labels rendered as platform-formatted keycaps after optional text.
|
|
22
|
-
* @param props.side - placement
|
|
23
|
-
* @param props.
|
|
25
|
+
* @param props.side - preferred placement (default 'right'); fitting tries the opposite then perpendicular sides.
|
|
26
|
+
* @param props.align - horizontal anchor-edge alignment for 'bottom'/'top' bubbles: 'end' pins
|
|
27
|
+
* the bubble's right edge to the anchor's (for anchors beside other hover surfaces the centered
|
|
28
|
+
* bubble would overlap); default 'center'. Horizontal placements ignore it.
|
|
29
|
+
* @param props.portal - render the bubble under document.body, so an ancestor's clipping or its
|
|
30
|
+
* stacking context (which confines the bubble's z-index to that context) cannot hide it.
|
|
31
|
+
* @param props.delayMs - hover delay in milliseconds (default 0).
|
|
32
|
+
* @param props.focusDelayMs - keyboard focus delay in milliseconds (default 0); blur, click,
|
|
33
|
+
* mouse leave, disabling, and unmount cancel a pending show.
|
|
34
|
+
* @param props.gap - anchor-to-bubble distance in pixels for 'bottom'/'top' bubbles (default 8);
|
|
35
|
+
* horizontal placements use 10px, including after a flip.
|
|
24
36
|
* @param props.disabled - suppress the bubble while true; the anchor renders identically so
|
|
25
37
|
* toggling never remounts it (which would cut its CSS transitions).
|
|
26
|
-
* @param props.portal - render the bubble under document.body, so an ancestor's clipping or its
|
|
27
|
-
* stacking context can neither clip the bubble nor paint over it.
|
|
28
38
|
* @param props.maxWidth - bubble width cap in pixels, for labels long enough that the default
|
|
29
|
-
* half-viewport cap would render a slab wider than the surface the anchor sits on.
|
|
39
|
+
* half-viewport cap would render a slab wider than the surface the anchor sits on; always bounded by viewport margins.
|
|
40
|
+
* @param props.openOnClick - clicking also pins the bubble for reading; another click, Escape,
|
|
41
|
+
* Tab, or an outside pointerdown dismisses it. Defaults to false for ordinary action tooltips.
|
|
30
42
|
* @param props.children - a single anchor element; its own ref (callback or object) is forwarded alongside the tooltip's.
|
|
31
43
|
* An anchor that accepts no ref still positions the bubble: a raise records the element the event ran on.
|
|
32
|
-
* @returns the cloned anchor plus a fixed-position bubble
|
|
44
|
+
* @returns the cloned anchor plus a fixed-position bubble, optionally portaled to the body.
|
|
45
|
+
* The bubble stays hidden until ResizeObserver supplies its size for viewport fitting; clicking the
|
|
46
|
+
* 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. When no side fits, the
|
|
48
|
+
* viewport-bounded fallback may overlap the anchor; oversized content is scrollable when pinned.
|
|
33
49
|
*/
|
|
34
|
-
export declare function Tooltip({ label, shortcutKeys, side, delayMs, disabled, portal, maxWidth, children }: {
|
|
50
|
+
export declare function Tooltip({ label, shortcutKeys, side, align, delayMs, focusDelayMs, gap, disabled, portal, maxWidth, openOnClick, children }: {
|
|
35
51
|
label: TooltipLabel;
|
|
36
52
|
shortcutKeys?: readonly string[] | undefined;
|
|
37
53
|
side?: TooltipSide;
|
|
54
|
+
align?: 'center' | 'end';
|
|
38
55
|
delayMs?: number;
|
|
56
|
+
focusDelayMs?: number;
|
|
57
|
+
gap?: number;
|
|
39
58
|
disabled?: boolean;
|
|
40
59
|
portal?: boolean;
|
|
41
60
|
maxWidth?: number;
|
|
61
|
+
openOnClick?: boolean;
|
|
42
62
|
children: ReactElement<AnchorProps>;
|
|
43
63
|
}): import("react").JSX.Element;
|
|
44
|
-
export {};
|
|
45
64
|
//# sourceMappingURL=Tooltip.d.ts.map
|
|
@@ -14,7 +14,7 @@ export interface FileTypeProjectContext {
|
|
|
14
14
|
*/
|
|
15
15
|
export declare function isCodeFileType(type: string): type is CodeFileType;
|
|
16
16
|
/**
|
|
17
|
-
* Test whether an extension
|
|
17
|
+
* Test whether an extension belongs to the established coarse link-icon code category.
|
|
18
18
|
* @param extension - Extension without a leading dot.
|
|
19
19
|
* @returns Whether clickable links keep the code glyph for this extension.
|
|
20
20
|
*/
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The credential formats the scanner recognizes, as data: the literal each
|
|
3
|
+
* format begins with, how its candidate is validated, and the ASCII character
|
|
4
|
+
* classes those checks use. [format-tables.ts](./format-tables.ts) derives
|
|
5
|
+
* lookup tables from this list on first use.
|
|
6
|
+
*/
|
|
7
|
+
/** `[A-Za-z0-9_-]` */
|
|
8
|
+
export declare const KEY = 1;
|
|
9
|
+
/** `[A-Za-z0-9]` */
|
|
10
|
+
export declare const ALNUM = 2;
|
|
11
|
+
/** `\w` */
|
|
12
|
+
export declare const WORD = 4;
|
|
13
|
+
/** `[A-Za-z0-9-]` */
|
|
14
|
+
export declare const ALNUM_DASH = 8;
|
|
15
|
+
/** `[A-Z0-9]` */
|
|
16
|
+
export declare const UPPER_ALNUM = 16;
|
|
17
|
+
/** `[A-Z0-9 ]` */
|
|
18
|
+
export declare const LABEL = 32;
|
|
19
|
+
/** `[a-z0-9+.-]` */
|
|
20
|
+
export declare const SCHEME = 64;
|
|
21
|
+
/** `[a-z]` */
|
|
22
|
+
export declare const LOWER = 128;
|
|
23
|
+
/** `[^\s/:@?#]` */
|
|
24
|
+
export declare const USER = 256;
|
|
25
|
+
/** `[^\s/@?#]` */
|
|
26
|
+
export declare const PASSWORD = 512;
|
|
27
|
+
/** A private key block from its `-----BEGIN` line. */
|
|
28
|
+
export declare const KEY_BLOCK = 0;
|
|
29
|
+
/** The password of an address that carries credentials. */
|
|
30
|
+
export declare const ADDRESS = 1;
|
|
31
|
+
/** A provider key or token after its fixed prefix. */
|
|
32
|
+
export declare const PREFIXED = 2;
|
|
33
|
+
/** The whole run, at least `min`. */
|
|
34
|
+
export declare const RUN = 0;
|
|
35
|
+
/** `min` to `max`, then `\b`. */
|
|
36
|
+
export declare const BOUNDED = 1;
|
|
37
|
+
/** At least `min`, with a digit among the first 256. */
|
|
38
|
+
export declare const SK = 2;
|
|
39
|
+
/** Exactly `min`. */
|
|
40
|
+
export declare const GOOGLE = 3;
|
|
41
|
+
/** Three runs joined by `.eyJ` and `.`. */
|
|
42
|
+
export declare const JWT = 4;
|
|
43
|
+
/** One recognized format. */
|
|
44
|
+
export interface CredentialFormat {
|
|
45
|
+
/** ASCII literal the candidate begins with; no literal occurs inside another. */
|
|
46
|
+
readonly literal: string;
|
|
47
|
+
/** Which kind of candidate the literal heads. */
|
|
48
|
+
readonly kind: typeof KEY_BLOCK | typeof ADDRESS | typeof PREFIXED;
|
|
49
|
+
/** Prefixed formats only: how the run after the literal is validated. */
|
|
50
|
+
readonly check: number;
|
|
51
|
+
/** Prefixed formats only: the class bit of the run after the literal. */
|
|
52
|
+
readonly run: number;
|
|
53
|
+
/** Prefixed formats only: run length below which a candidate is not this format. */
|
|
54
|
+
readonly min: number;
|
|
55
|
+
/** Prefixed formats only: longest accepted run for `BOUNDED` and `JWT`. */
|
|
56
|
+
readonly max: number;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Every prefixed format matches more than the eight characters a mask leaves
|
|
60
|
+
* readable, so a near miss never exposes a whole value.
|
|
61
|
+
*/
|
|
62
|
+
export declare const CREDENTIAL_FORMATS: readonly CredentialFormat[];
|
|
63
|
+
//# sourceMappingURL=credential-formats.d.ts.map
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/** Character that replaces each hidden credential character. */
|
|
2
|
+
export declare const MASK = "*";
|
|
3
|
+
/** Builds masks; owns the shared mark strings and its sticky run pattern. */
|
|
4
|
+
export declare class CredentialMasks {
|
|
5
|
+
private readonly marksOnly;
|
|
6
|
+
private readonly marksLf;
|
|
7
|
+
private readonly marksCr;
|
|
8
|
+
/** Code units that `lines` counts without inspection: neither line breaks nor surrogates. Set `lastIndex` before each test. */
|
|
9
|
+
private readonly ordinary;
|
|
10
|
+
/**
|
|
11
|
+
* The display form of `text[start, end)`, whose earliest candidate has `kind`.
|
|
12
|
+
* @param text - the queried text.
|
|
13
|
+
* @param kind - the literal kind of the range's earliest candidate.
|
|
14
|
+
* @param plain - the range holds only prefixed-format characters: ASCII without line breaks.
|
|
15
|
+
* @param start - first offset of the range.
|
|
16
|
+
* @param end - offset after the range.
|
|
17
|
+
* @returns the mask; line breaks stay in place, one mark per code point.
|
|
18
|
+
*/
|
|
19
|
+
masked(text: string, kind: number, plain: boolean, start: number, end: number): string;
|
|
20
|
+
/**
|
|
21
|
+
* Marks for a run of hidden characters.
|
|
22
|
+
* @param count - how many marks.
|
|
23
|
+
* @returns `count` marks, one slice of the shared string where it reaches.
|
|
24
|
+
*/
|
|
25
|
+
private marks;
|
|
26
|
+
/**
|
|
27
|
+
* Marks, then one line break, in a single slice.
|
|
28
|
+
* @param count - how many marks.
|
|
29
|
+
* @param code - the line break's code unit, 10 or 13.
|
|
30
|
+
* @returns `count` marks and that line break.
|
|
31
|
+
*/
|
|
32
|
+
private marksThen;
|
|
33
|
+
/**
|
|
34
|
+
* Keep the `BEGIN` line, the `END` line when present, and every line break; a block written on
|
|
35
|
+
* one line is masked whole. Both searches stay inside the range, so they cost what the mask costs.
|
|
36
|
+
* @param text - the queried text.
|
|
37
|
+
* @param start - first offset of the range.
|
|
38
|
+
* @param end - offset after the range.
|
|
39
|
+
* @returns the masked block.
|
|
40
|
+
*/
|
|
41
|
+
private keyBlock;
|
|
42
|
+
/**
|
|
43
|
+
* Replace every character except line breaks; a surrogate pair is one character,
|
|
44
|
+
* as `[^\r\n]` with the `u` flag counts it. A character loop: a native run could read far past `end`.
|
|
45
|
+
* @param text - the queried text.
|
|
46
|
+
* @param start - first offset of the range.
|
|
47
|
+
* @param end - offset after the range.
|
|
48
|
+
* @returns the masked range.
|
|
49
|
+
*/
|
|
50
|
+
private range;
|
|
51
|
+
/**
|
|
52
|
+
* `range` for a body that ends at a line break or the end of the text, where native runs stop.
|
|
53
|
+
* @param text - the queried text.
|
|
54
|
+
* @param start - first offset of the range.
|
|
55
|
+
* @param end - offset after the range.
|
|
56
|
+
* @returns the masked body.
|
|
57
|
+
*/
|
|
58
|
+
private lines;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=credential-masks.d.ts.map
|