@streamsai/ui 0.1.3 → 0.1.4
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.
|
@@ -73,8 +73,6 @@ export type SlashCommandCandidate = {
|
|
|
73
73
|
insertText?: string | null;
|
|
74
74
|
/** Menu section; the menu lists `cycles` before `commands`. Ungrouped candidates show under one title. */
|
|
75
75
|
group?: 'cycles' | 'commands';
|
|
76
|
-
/** Draws a soft sweeping highlight behind the row, to point a first-time user at it. */
|
|
77
|
-
emphasis?: boolean;
|
|
78
76
|
};
|
|
79
77
|
/** Host-supplied emoji for the `:` shortcode typeahead (Slack-style `:smile:`). */
|
|
80
78
|
export type EmojiCandidate = {
|
|
@@ -21,8 +21,7 @@ import { $createLinkNode, $isLinkNode, LinkNode, AutoLinkNode } from '@lexical/l
|
|
|
21
21
|
import { $createCodeNode, $isCodeNode, CodeNode } from '@lexical/code';
|
|
22
22
|
import { BOLD_ITALIC_STAR, BOLD_ITALIC_UNDERSCORE, BOLD_STAR, BOLD_UNDERSCORE, CODE, INLINE_CODE, ITALIC_STAR, ITALIC_UNDERSCORE, LINK, ORDERED_LIST, STRIKETHROUGH, UNORDERED_LIST, } from '@lexical/markdown';
|
|
23
23
|
import { cn } from '../../lib/utils.js';
|
|
24
|
-
import { Collapse
|
|
25
|
-
import { loops } from '../../motion/config.js';
|
|
24
|
+
import { Collapse } from '../../motion/index.js';
|
|
26
25
|
import { detectTextDirection, hasStrongCharacter } from '../../lib/text-direction.js';
|
|
27
26
|
import { AgentAvatar } from './agent-avatar.js';
|
|
28
27
|
import { ProviderBadge } from './provider-badge.js';
|
|
@@ -1403,22 +1402,13 @@ function SlashCommandsPlugin({ searchSlashCommands, onSelectCommand, onSlashType
|
|
|
1403
1402
|
: labels.slashTitle;
|
|
1404
1403
|
return (_jsxs(React.Fragment, { children: [startsGroup ? _jsx(SlashGroupHeader, { label: title, first: index === 0 }) : null, _jsxs("button", { id: `slash-typeahead-item-${index}`, type: "button", role: "option", tabIndex: -1, "aria-selected": selected,
|
|
1405
1404
|
// Lexical scrolls the highlighted row into the max-h menu via this ref.
|
|
1406
|
-
ref: option.setRefElement, className: cn('
|
|
1405
|
+
ref: option.setRefElement, className: cn('flex w-full flex-col rounded-lg p-2 text-start text-sm in-data-[platform=mobile]:mb-0.5 in-data-[platform=mobile]:text-base', selected ? 'bg-accent text-accent-foreground' : 'hover:bg-accent'), onClick: () => {
|
|
1407
1406
|
setHighlightedIndex(index);
|
|
1408
1407
|
selectOptionAndCleanUp(option);
|
|
1409
|
-
}, onMouseEnter: () => setHighlightedIndex(index), children: [
|
|
1408
|
+
}, onMouseEnter: () => setHighlightedIndex(index), children: [_jsxs("span", { children: ["/", option.candidate.name] }), _jsx("span", { className: "text-muted-foreground", children: option.candidate.description })] })] }, option.key));
|
|
1410
1409
|
})) }), document.body);
|
|
1411
1410
|
} }));
|
|
1412
1411
|
}
|
|
1413
|
-
/** A tinted wash with a light band sweeping across it; still (tint only) under reduced motion. */
|
|
1414
|
-
function SlashEmphasis() {
|
|
1415
|
-
const reduceMotion = useReducedMotion();
|
|
1416
|
-
return (_jsx(motion.span, { "aria-hidden": true, "data-slot": "slash-emphasis", className: "pointer-events-none absolute inset-0 -z-10 rounded-lg bg-primary/8", style: {
|
|
1417
|
-
backgroundImage: 'linear-gradient(100deg, transparent 30%, color-mix(in oklab, var(--primary) 22%, transparent) 50%, transparent 70%)',
|
|
1418
|
-
backgroundSize: '220% 100%',
|
|
1419
|
-
backgroundRepeat: 'no-repeat',
|
|
1420
|
-
}, initial: { backgroundPosition: '160% 0' }, animate: reduceMotion === true ? undefined : { backgroundPosition: ['160% 0', '-60% 0'] }, transition: { ...loops.shimmer, duration: 1.8 } }));
|
|
1421
|
-
}
|
|
1422
1412
|
function SlashGroupHeader({ label, first }) {
|
|
1423
1413
|
return (_jsxs("div", { className: cn('flex items-center gap-2.5 px-2 pb-1 text-sm text-muted-foreground', first ? 'pt-1.5' : 'pt-3'), children: [_jsx("span", { children: label }), _jsx("span", { className: "h-px flex-1 bg-border", "aria-hidden": true })] }));
|
|
1424
1414
|
}
|
package/package.json
CHANGED