@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,43 @@
|
|
|
1
|
+
import type { IconProps } from './props.ts';
|
|
2
|
+
interface WeightedArtworkProps extends IconProps {
|
|
3
|
+
strokeWidth: number;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Render new-conversation geometry — the bubble around a plus — for product icons.
|
|
7
|
+
* @param props - Size, optional CSS class, and inherited stroke width.
|
|
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.
|
|
14
|
+
* @param props - Size, optional CSS class, and inherited stroke width.
|
|
15
|
+
* @returns The decorative SVG artwork.
|
|
16
|
+
*/
|
|
17
|
+
export declare const ChatLinesOutlineArtwork: ({ size, className, strokeWidth }: WeightedArtworkProps) => import("react").JSX.Element;
|
|
18
|
+
/**
|
|
19
|
+
* Render shared globe geometry for product and link icons.
|
|
20
|
+
* @param props - Size, optional CSS class, and inherited stroke width.
|
|
21
|
+
* @returns The decorative SVG artwork.
|
|
22
|
+
*/
|
|
23
|
+
export declare const GlobeOutlineArtwork: ({ size, className, strokeWidth }: WeightedArtworkProps) => import("react").JSX.Element;
|
|
24
|
+
/**
|
|
25
|
+
* Render shared code-bracket geometry for product and link icons.
|
|
26
|
+
* @param props - Size, optional CSS class, and inherited stroke width.
|
|
27
|
+
* @returns The decorative SVG artwork.
|
|
28
|
+
*/
|
|
29
|
+
export declare const CodeBracketsArtwork: ({ size, className, strokeWidth }: WeightedArtworkProps) => import("react").JSX.Element;
|
|
30
|
+
/**
|
|
31
|
+
* Render shared document-browse geometry for product and reference icons.
|
|
32
|
+
* @param props - Size, optional CSS class, and inherited stroke width.
|
|
33
|
+
* @returns The decorative SVG artwork.
|
|
34
|
+
*/
|
|
35
|
+
export declare const BrowseOutlineArtwork: ({ size, className, strokeWidth }: WeightedArtworkProps) => import("react").JSX.Element;
|
|
36
|
+
/**
|
|
37
|
+
* Render shared closed-folder geometry for product, reference, and link icons.
|
|
38
|
+
* @param props - Size, optional CSS class, and inherited stroke width.
|
|
39
|
+
* @returns The decorative SVG artwork.
|
|
40
|
+
*/
|
|
41
|
+
export declare const FolderCloseArtwork: ({ size, className, strokeWidth }: WeightedArtworkProps) => import("react").JSX.Element;
|
|
42
|
+
export {};
|
|
43
|
+
//# sourceMappingURL=shared-artwork.d.ts.map
|
package/lib/types/index.d.ts
CHANGED
|
@@ -18,11 +18,15 @@ export type { ButtonVariant } from './Button.tsx';
|
|
|
18
18
|
export { Pill } from './Pill.tsx';
|
|
19
19
|
export { SegmentedControl } from './SegmentedControl.tsx';
|
|
20
20
|
export type { SegmentedControlOption } from './SegmentedControl.tsx';
|
|
21
|
+
export { SegmentedTabs } from './SegmentedTabs.tsx';
|
|
22
|
+
export type { SegmentedTab } from './SegmentedTabs.tsx';
|
|
23
|
+
export * from './plugin-artwork.tsx';
|
|
21
24
|
export { Tag } from './Tag.tsx';
|
|
22
25
|
export type { TagTone } from './Tag.tsx';
|
|
23
26
|
export { Switch } from './Switch.tsx';
|
|
24
27
|
export { Checkbox } from './Checkbox.tsx';
|
|
25
28
|
export { Input } from './Input.tsx';
|
|
29
|
+
export { InlineEditor } from './InlineEditor.tsx';
|
|
26
30
|
export { Menu, MenuItemButton } from './Menu.tsx';
|
|
27
31
|
export type { MenuItemButtonProps, MenuEntry, MenuItem, MenuSeparator, MenuLabel } from './Menu.tsx';
|
|
28
32
|
export { ShortcutKeys } from './ShortcutKeys.tsx';
|
|
@@ -41,16 +45,18 @@ export type { RiskConfirmationProps } from './RiskConfirmation.tsx';
|
|
|
41
45
|
export { ConnectionIndicator } from './ConnectionIndicator.tsx';
|
|
42
46
|
export type { ConnectionIndicatorState } from './ConnectionIndicator.tsx';
|
|
43
47
|
export { QilinSeal } from './QilinSeal.tsx';
|
|
44
|
-
export {
|
|
48
|
+
export { PermissionIconAutoReviewMedium, PermissionIconAutoReviewRegular, PermissionIconFullAccessMedium, PermissionIconFullAccessRegular, PermissionIconReadOnlyMedium, PermissionIconReadOnlyRegular, PermissionIconWorkspaceWriteMedium, PermissionIconWorkspaceWriteRegular, } from './PermissionIcon.tsx';
|
|
49
|
+
export { ReferenceIconMedium, ReferenceIconRegular } from './ReferenceIcon.tsx';
|
|
45
50
|
export type { ReferenceIconKind, ReferenceIconProps } from './ReferenceIcon.tsx';
|
|
46
|
-
export {
|
|
51
|
+
export { LinkIconMedium, LinkIconRegular, classifyLinkPath } from './LinkIcon.tsx';
|
|
47
52
|
export type { LinkIconKind, LinkIconProps } from './LinkIcon.tsx';
|
|
48
53
|
export { FileTypeIcon, classifyFileType, fileExtension } from './FileTypeIcon.tsx';
|
|
49
54
|
export type { CodeFileType, FileType, FileTypeIconProps, FileTypeKind, FileTypeProjectContext, } from './FileTypeIcon.tsx';
|
|
50
55
|
export { PathLabel } from './PathLabel.tsx';
|
|
51
|
-
export { projectUserText, type UserTextReferences } from './user-text.tsx';
|
|
56
|
+
export { projectUserText, type UserTextReferences, type UserTextSecretLabels } from './user-text.tsx';
|
|
52
57
|
export { Tooltip } from './Tooltip.tsx';
|
|
53
58
|
export type { TooltipSide } from './Tooltip.tsx';
|
|
59
|
+
export { pointerModality } from './input-modality.ts';
|
|
54
60
|
export { focusWithoutRing } from './focus.ts';
|
|
55
61
|
export { observeComposition } from './keyboard-composition.ts';
|
|
56
62
|
export { closeTopModal, isBehindModal, modalSelector, useModalLayer } from './useModalLayer.ts';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { IconProps } from './icons/props.ts';
|
|
2
|
+
/** Light-blue terminal artwork shared by plugin cards and sidebar guide entries. */
|
|
3
|
+
export declare const PluginArtworkTerminal: ({ size, className }: IconProps) => import("react").JSX.Element;
|
|
4
|
+
/** Agent-loop plugin artwork (four leaves circling a center). */
|
|
5
|
+
export declare const PluginArtworkLoop: ({ size, className }: IconProps) => import("react").JSX.Element;
|
|
6
|
+
/** Subagent plugin artwork (two stacked rounded squares); also marks every row inside a bundle. */
|
|
7
|
+
export declare const PluginArtworkSubagent: ({ size, className }: IconProps) => import("react").JSX.Element;
|
|
8
|
+
/**
|
|
9
|
+
* Web-search plugin artwork (conic-gradient ring and handle). SVG has no
|
|
10
|
+
* native conic gradient, so the ring clips an HTML div painted with CSS
|
|
11
|
+
* `conic-gradient` — the same emulation Figma exports; it renders inline in
|
|
12
|
+
* the browser UI but would stay empty in an `<img>` or mask context.
|
|
13
|
+
*/
|
|
14
|
+
export declare const PluginArtworkSearch: ({ size, className }: IconProps) => import("react").JSX.Element;
|
|
15
|
+
/** Default plugin artwork for plugins without one of their own (connector blocks and a node). */
|
|
16
|
+
export declare const PluginArtworkDefault: ({ size, className }: IconProps) => import("react").JSX.Element;
|
|
17
|
+
//# sourceMappingURL=plugin-artwork.d.ts.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/** Deterministic tooltip placement using measured border boxes and viewport coordinates. */
|
|
2
|
+
/** Bubble placement relative to the anchor. */
|
|
3
|
+
export type TooltipSide = 'right' | 'left' | 'bottom' | 'top';
|
|
4
|
+
interface PlacementInput {
|
|
5
|
+
anchor: {
|
|
6
|
+
left: number;
|
|
7
|
+
right: number;
|
|
8
|
+
top: number;
|
|
9
|
+
bottom: number;
|
|
10
|
+
};
|
|
11
|
+
width: number;
|
|
12
|
+
height: number;
|
|
13
|
+
viewportWidth: number;
|
|
14
|
+
viewportHeight: number;
|
|
15
|
+
side: TooltipSide;
|
|
16
|
+
align: 'center' | 'end';
|
|
17
|
+
gap: number;
|
|
18
|
+
}
|
|
19
|
+
interface TooltipPlacement {
|
|
20
|
+
left: number;
|
|
21
|
+
top: number;
|
|
22
|
+
width: number;
|
|
23
|
+
height: number;
|
|
24
|
+
side: TooltipSide;
|
|
25
|
+
/** No complete side fits, so placement is bounded by the viewport instead. */
|
|
26
|
+
overflow: boolean;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Prefer the requested side, its opposite, then perpendicular sides without covering the anchor.
|
|
30
|
+
* @param input - Observed dimensions, anchor edges, viewport and requested placement; horizontal gaps remain 10px.
|
|
31
|
+
* @returns Border-box coordinates and the selected side; if no side fits, a viewport-bounded fallback.
|
|
32
|
+
*/
|
|
33
|
+
export declare function placeTooltip(input: PlacementInput): TooltipPlacement;
|
|
34
|
+
export {};
|
|
35
|
+
//# sourceMappingURL=tooltip-placement.d.ts.map
|
|
@@ -20,6 +20,8 @@ export interface AnchoredPositionOptions {
|
|
|
20
20
|
panelRef: RefObject<HTMLElement | null>;
|
|
21
21
|
/** Which anchor edge the panel hangs from: below it (`bottom`, the default) or above it (`top`). */
|
|
22
22
|
side?: 'top' | 'bottom';
|
|
23
|
+
/** Which anchor edge the panel lines up with: its left edge (`start`, the default) or its right edge (`end`). */
|
|
24
|
+
align?: 'start' | 'end';
|
|
23
25
|
/** Distance kept between the anchor edge named by `side` and the panel. */
|
|
24
26
|
gap: number;
|
|
25
27
|
/** Distance kept between the panel and each viewport edge. */
|
|
@@ -27,7 +29,7 @@ export interface AnchoredPositionOptions {
|
|
|
27
29
|
}
|
|
28
30
|
/**
|
|
29
31
|
* Track an anchor and return the panel's fixed coordinates.
|
|
30
|
-
* @param options - the open state, the two refs, the placement side, and the gap/margin distances.
|
|
32
|
+
* @param options - the open state, the two refs, the placement side and alignment, and the gap/margin distances.
|
|
31
33
|
* @returns `left`/`top` for the panel, or `null` before the first measurement.
|
|
32
34
|
*/
|
|
33
35
|
export declare function useAnchoredPosition(options: AnchoredPositionOptions): CSSProperties | null;
|
package/lib/types/user-text.d.ts
CHANGED
|
@@ -12,7 +12,10 @@
|
|
|
12
12
|
* stray `/word` stays plain text. A `/name` token is whitespace-bounded like
|
|
13
13
|
* the host skill gesture (`qilin-tool-skill`): it ends at whitespace or the
|
|
14
14
|
* text end, so slash paths (`/nfs-hg/xxx`, `/plan.md`) and punctuation-glued
|
|
15
|
-
* tokens (`/plan。`) stay plain even for a loaded name.
|
|
15
|
+
* tokens (`/plan。`) stay plain even for a loaded name. A recognized credential
|
|
16
|
+
* always draws masked, ahead of every reference decoration, and only the display
|
|
17
|
+
* changes: the logged text, the copied text, and the model input keep the original
|
|
18
|
+
* characters.
|
|
16
19
|
*/
|
|
17
20
|
import type { ReactNode } from 'react';
|
|
18
21
|
/** Optional navigation supplied by consumers that can preview references. */
|
|
@@ -22,6 +25,13 @@ export interface UserTextReferences {
|
|
|
22
25
|
/** Open the source of a skill loaded for this message. */
|
|
23
26
|
openSkill: (name: string) => void;
|
|
24
27
|
}
|
|
28
|
+
/** Accessible names of the control that reveals one masked credential. */
|
|
29
|
+
export interface UserTextSecretLabels {
|
|
30
|
+
/** Name while the value stays masked. */
|
|
31
|
+
readonly reveal: string;
|
|
32
|
+
/** Name while the value is shown. */
|
|
33
|
+
readonly hide: string;
|
|
34
|
+
}
|
|
25
35
|
/**
|
|
26
36
|
* Split one sent text into inline plain runs and reference chips.
|
|
27
37
|
* @param text - the logged model text of the message or queue row.
|
|
@@ -31,7 +41,8 @@ export interface UserTextReferences {
|
|
|
31
41
|
* (unsent queue rows pass none).
|
|
32
42
|
* @param slashKind - the chip kind those tokens render as.
|
|
33
43
|
* @param references - optional file and skill preview actions; session and command tokens stay labels.
|
|
44
|
+
* @param secretLabels - reveal-control copy for credentials; absent in text that stays masked.
|
|
34
45
|
* @returns inline nodes covering the whole text.
|
|
35
46
|
*/
|
|
36
|
-
export declare function projectUserText(text: string, sessionLabels: readonly string[], slashNames?: readonly string[], slashKind?: 'skill' | 'command', references?: UserTextReferences): ReactNode;
|
|
47
|
+
export declare function projectUserText(text: string, sessionLabels: readonly string[], slashNames?: readonly string[], slashKind?: 'skill' | 'command', references?: UserTextReferences, secretLabels?: UserTextSecretLabels): ReactNode;
|
|
37
48
|
//# sourceMappingURL=user-text.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qilin-agent/client-ui-primitives",
|
|
3
3
|
"description": "Pure React atoms for the qilin web UI: controls, icons, markdown, and JSON inspectors (zero cordis)",
|
|
4
|
-
"version": "3.1.
|
|
4
|
+
"version": "3.1.7",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -51,9 +51,9 @@
|
|
|
51
51
|
"react-dom": "^18.2.0",
|
|
52
52
|
"shiki": "^4.3.1",
|
|
53
53
|
"simple-icons": "16.31.0",
|
|
54
|
-
"@qilin-agent/
|
|
55
|
-
"@qilin-agent/util-workspace-path": "3.1.
|
|
56
|
-
"@qilin-agent/
|
|
54
|
+
"@qilin-agent/kylin": "~4.0.5",
|
|
55
|
+
"@qilin-agent/util-workspace-path": "3.1.7",
|
|
56
|
+
"@qilin-agent/client-store": "3.1.7"
|
|
57
57
|
},
|
|
58
58
|
"files": [
|
|
59
59
|
"lib/index.js",
|
|
@@ -61,6 +61,6 @@
|
|
|
61
61
|
"lib/types/**/*.d.ts"
|
|
62
62
|
],
|
|
63
63
|
"peerDependencies": {
|
|
64
|
-
"@qilin-agent/kylin": "~4.0.
|
|
64
|
+
"@qilin-agent/kylin": "~4.0.5"
|
|
65
65
|
}
|
|
66
66
|
}
|