@tutti-os/ui-rich-text 0.0.110 → 0.0.111
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/dist/at-panel/index.css +7 -0
- package/dist/at-panel/index.css.map +1 -1
- package/dist/at-panel/index.d.ts +4 -3
- package/dist/at-panel/index.js +2 -2
- package/dist/at-panel/model.d.ts +3 -3
- package/dist/at-panel/model.js +1 -1
- package/dist/{chunk-VFZ4TL22.js → chunk-AB4LAEBH.js} +18 -8
- package/dist/chunk-AB4LAEBH.js.map +1 -0
- package/dist/{chunk-IJDSAZLI.js → chunk-IU7RTTKI.js} +25 -9
- package/dist/chunk-IU7RTTKI.js.map +1 -0
- package/dist/editor/index.css +7 -0
- package/dist/editor/index.css.map +1 -1
- package/dist/editor/index.d.ts +1 -1
- package/dist/editor/index.js +2 -2
- package/dist/{mentionPaletteModel-DgRcsoxg.d.ts → mentionPaletteModel-CT8fzBE2.d.ts} +5 -0
- package/package.json +3 -3
- package/dist/chunk-IJDSAZLI.js.map +0 -1
- package/dist/chunk-VFZ4TL22.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/at-panel/MentionPalette.tsx","../src/at-panel/mentionPaletteScrollbar.tsx","../src/at-panel/mentionPaletteStateAdapter.ts","../src/at-panel/MentionPaletteFromState.tsx","../src/at-panel/MentionPaletteControls.tsx","../src/at-panel/MentionRow.tsx","../src/at-panel/mentionRowDataAttributes.ts","../src/at-panel/mentionReferenceIcon.ts","../src/at-panel/mentionTriggerRowItem.ts","../src/at-panel/useAtPanelKeyboard.ts"],"sourcesContent":["import {\n useEffect,\n useRef,\n useState,\n type CSSProperties,\n type JSX,\n type MutableRefObject,\n type ReactNode\n} from \"react\";\nimport {\n FolderFailedFilledIcon,\n KeyboardFilledIcon\n} from \"@tutti-os/ui-system/icons\";\nimport { UnderlineTabs } from \"@tutti-os/ui-system/components\";\nimport { cn } from \"@tutti-os/ui-system/utils\";\nimport { flattenMentionPaletteEntries } from \"./mentionPaletteEntries.ts\";\nimport { mentionPaletteExpandLabel } from \"./mentionPaletteModel.ts\";\nimport { MentionPaletteScrollbar } from \"./mentionPaletteScrollbar.tsx\";\nimport type {\n MentionPaletteGroup,\n MentionPaletteProps,\n MentionPaletteState,\n MentionPaletteTheme\n} from \"./mentionPaletteTypes.ts\";\nimport \"./mentionPalette.css\";\n\nconst DEFAULT_THEME = {\n classNames: {\n palette: \"rich-text-at-mention-palette\",\n header: \"rich-text-at-mention-palette-header\",\n footer: \"rich-text-at-mention-palette-footer\",\n tabs: \"rich-text-at-mention-palette-tabs\",\n scrollRegion: \"rich-text-at-mention-palette-scroll-region\",\n scrollbar: \"rich-text-at-mention-palette-scrollbar\",\n scrollbarThumb: \"rich-text-at-mention-palette-scrollbar-thumb\",\n hint: \"rich-text-at-mention-palette-hint\",\n hintItem: \"rich-text-at-mention-palette-hint-item\",\n hintButton: \"rich-text-at-mention-palette-hint-button\",\n hintSeparator: \"rich-text-at-mention-palette-hint-separator\",\n shortcut: \"rich-text-at-mention-palette-shortcut\",\n shortcutArrow: \"rich-text-at-mention-palette-shortcut--arrow\",\n shortcutButton: \"rich-text-at-mention-palette-shortcut-button\",\n shortcutGroup: \"rich-text-at-mention-palette-shortcut-group\"\n },\n testIds: {\n emptyState: \"rich-text-at-mention-palette-empty-state\",\n hint: \"rich-text-at-mention-palette-hint\",\n scrollbar: \"rich-text-at-mention-palette-scrollbar\",\n loadingSpinner: \"rich-text-at-mention-loading-spinner\"\n },\n groupDividerAttribute: \"data-rich-text-at-mention-group-divider\"\n} as const;\n\ninterface ResolvedMentionPaletteTheme {\n classNames: Required<NonNullable<MentionPaletteTheme[\"classNames\"]>>;\n testIds: Required<NonNullable<MentionPaletteTheme[\"testIds\"]>>;\n groupDividerAttribute: string;\n}\n\nfunction resolveMentionPaletteTheme(\n theme: MentionPaletteTheme | undefined\n): ResolvedMentionPaletteTheme {\n return {\n classNames: { ...DEFAULT_THEME.classNames, ...theme?.classNames },\n testIds: { ...DEFAULT_THEME.testIds, ...theme?.testIds },\n groupDividerAttribute:\n theme?.groupDividerAttribute ?? DEFAULT_THEME.groupDividerAttribute\n };\n}\n\nfunction mentionPaletteRootClassName(\n theme: ResolvedMentionPaletteTheme\n): string {\n return cn(\n DEFAULT_THEME.classNames.palette,\n theme.classNames.palette,\n paletteStyles.palette\n );\n}\n\nconst paletteStyles = {\n palette: \"rich-text-at-mention-palette__shell\",\n header: \"rich-text-at-mention-palette__header\",\n footer: \"rich-text-at-mention-palette__footer\",\n scrollShell: \"rich-text-at-mention-palette__scroll-shell\",\n scrollBody: \"rich-text-at-mention-palette__scroll-body\",\n groups: \"rich-text-at-mention-palette__groups\",\n group: \"rich-text-at-mention-palette__group\",\n groupDivider: \"rich-text-at-mention-palette__group-divider\",\n groupLabel: \"rich-text-at-mention-palette__group-label\",\n groupItems: \"rich-text-at-mention-palette__group-items\",\n groupEmpty: \"rich-text-at-mention-palette__group-empty\",\n rowButton: \"rich-text-at-mention-palette__row-button\",\n expandButton: \"rich-text-at-mention-palette__expand-button\",\n emptyState: \"rich-text-at-mention-palette__empty-state\",\n emptyStateInner: \"rich-text-at-mention-palette__empty-state-inner\",\n emptyStateIcon: \"rich-text-at-mention-palette__empty-state-icon\",\n emptyStateText: \"rich-text-at-mention-palette__empty-state-text\",\n loading: \"rich-text-at-mention-palette__loading\",\n loadingSpinner: \"rich-text-at-mention-palette__loading-spinner\"\n} as const;\n\nconst MENTION_PALETTE_LOADING_MIN_VISIBLE_MS = 320;\n\nexport function MentionPalette<TItem>(\n props: MentionPaletteProps<TItem>\n): JSX.Element {\n \"use memo\";\n const {\n state,\n highlightedKey,\n getItemKey,\n renderItem,\n labels,\n hintLabels,\n maxHeightPx,\n onHighlightChange,\n onSelectItem,\n onSelectCategory,\n onSelectFilter,\n onExpandGroup,\n onCycleFilter,\n onMoveSelection,\n onNavigateHierarchy,\n renderListFooter,\n headerActions,\n loadingBanner,\n scrollHighlightedIntoViewCentered = false,\n theme: themeProp\n } = props;\n const theme = resolveMentionPaletteTheme(themeProp);\n\n const highlightedOptionRef = useRef<HTMLButtonElement | null>(null);\n const scrollBodyRef = useRef<HTMLDivElement | null>(null);\n const loadingVisibleUntilRef = useRef(0);\n const loadingHideTimerRef = useRef<ReturnType<typeof setTimeout> | null>(\n null\n );\n const [loadingIndicatorVisible, setLoadingIndicatorVisible] = useState(\n state.status === \"loading\"\n );\n\n const interactiveEntries = flattenMentionPaletteEntries(\n state,\n (item, groupId) => getItemKey(item, findGroup(state.groups, groupId))\n );\n const hasInteractiveEntries = interactiveEntries.some(\n (entry) => entry.type === \"item\" || entry.type === \"expand\"\n );\n\n const showLoadingState =\n loadingIndicatorVisible &&\n (!hasInteractiveEntries || state.mode === \"browse\");\n const showLoadingBanner =\n Boolean(loadingBanner) &&\n loadingIndicatorVisible &&\n hasInteractiveEntries &&\n state.mode === \"results\";\n\n useEffect(() => {\n const highlightedElement = highlightedOptionRef.current;\n if (!highlightedElement) {\n return;\n }\n const scrollContainer = scrollBodyRef.current;\n if (!scrollContainer || !scrollContainer.contains(highlightedElement)) {\n highlightedElement.scrollIntoView({ block: \"nearest\" });\n return;\n }\n if (scrollHighlightedIntoViewCentered) {\n centerElementInScrollContainer(scrollContainer, highlightedElement);\n return;\n }\n scrollElementIntoScrollContainerNearest(\n scrollContainer,\n highlightedElement\n );\n }, [highlightedKey, scrollHighlightedIntoViewCentered]);\n\n useEffect(() => {\n if (loadingHideTimerRef.current !== null) {\n clearTimeout(loadingHideTimerRef.current);\n loadingHideTimerRef.current = null;\n }\n\n if (state.status === \"loading\") {\n loadingVisibleUntilRef.current =\n Date.now() + MENTION_PALETTE_LOADING_MIN_VISIBLE_MS;\n setLoadingIndicatorVisible(true);\n return;\n }\n\n const remainingMs = loadingVisibleUntilRef.current - Date.now();\n if (remainingMs <= 0) {\n setLoadingIndicatorVisible(false);\n return;\n }\n\n loadingHideTimerRef.current = setTimeout(() => {\n loadingHideTimerRef.current = null;\n setLoadingIndicatorVisible(false);\n }, remainingMs);\n\n return () => {\n if (loadingHideTimerRef.current !== null) {\n clearTimeout(loadingHideTimerRef.current);\n loadingHideTimerRef.current = null;\n }\n };\n }, [state.status]);\n\n const paletteMaxHeightStyle: CSSProperties | undefined =\n maxHeightPx > 0 ? { maxHeight: `${maxHeightPx}px` } : undefined;\n\n if (state.status === \"error\") {\n return (\n <div\n className={mentionPaletteRootClassName(theme)}\n style={paletteMaxHeightStyle}\n role=\"listbox\"\n aria-label={labels.listbox ?? labels.tabHint}\n >\n <MentionPaletteEmptyState\n icon=\"folder-failed\"\n label={labels.error}\n testId={theme.testIds.emptyState}\n />\n </div>\n );\n }\n\n const isBrowse = state.mode === \"browse\";\n\n let body: ReactNode;\n if (showLoadingState) {\n body = (\n <MentionPaletteLoading\n label={labels.loading}\n spinnerTestId={theme.testIds.loadingSpinner}\n />\n );\n } else if (state.groups.length === 0) {\n body = (\n <MentionPaletteEmptyState\n icon={isBrowse ? \"keyboard\" : \"folder-failed\"}\n label={labels.empty}\n testId={theme.testIds.emptyState}\n />\n );\n } else {\n body = (\n <MentionPaletteGroups\n state={state}\n highlightedKey={highlightedKey}\n highlightedOptionRef={highlightedOptionRef}\n getItemKey={getItemKey}\n renderItem={renderItem}\n onHighlightChange={onHighlightChange}\n onSelectItem={onSelectItem}\n onExpandGroup={onExpandGroup}\n renderListFooter={renderListFooter}\n groupDividerAttribute={theme.groupDividerAttribute}\n />\n );\n }\n\n return (\n <div\n className={mentionPaletteRootClassName(theme)}\n style={paletteMaxHeightStyle}\n >\n <div className={cn(theme.classNames.header, paletteStyles.header)}>\n <div className=\"rich-text-at-mention-palette__tabs-layout\">\n <UnderlineTabs\n tabs={state.categories.map((category) => ({\n value: category.id,\n label: category.label\n }))}\n value={state.filter}\n onValueChange={isBrowse ? onSelectCategory : onSelectFilter}\n className={theme.classNames.tabs}\n preventMouseDownDefault\n />\n </div>\n {headerActions ? (\n <div className=\"rich-text-at-mention-palette__header-actions\">\n {headerActions}\n </div>\n ) : null}\n {showLoadingBanner ? loadingBanner : null}\n </div>\n <div className={paletteStyles.scrollShell}>\n <div\n ref={scrollBodyRef}\n className={cn(\n theme.classNames.scrollRegion,\n paletteStyles.scrollBody\n )}\n role=\"listbox\"\n aria-label={labels.listbox ?? labels.tabHint}\n >\n {body}\n </div>\n <MentionPaletteScrollbar\n scrollBodyRef={scrollBodyRef}\n className={theme.classNames.scrollbar}\n thumbClassName={theme.classNames.scrollbarThumb}\n testId={theme.testIds.scrollbar}\n />\n </div>\n <div className={cn(theme.classNames.footer, paletteStyles.footer)}>\n <MentionPaletteHint\n ariaLabel={labels.tabHint}\n cycleFilterLabel={hintLabels.cycleFilter}\n moveSelectionLabel={hintLabels.moveSelection}\n navigateHierarchyLabel={hintLabels.navigateHierarchy}\n onCycleFilter={onCycleFilter}\n onMoveSelection={onMoveSelection}\n onNavigateHierarchy={onNavigateHierarchy}\n classNames={theme.classNames}\n testId={theme.testIds.hint}\n />\n </div>\n </div>\n );\n}\n\nfunction centerElementInScrollContainer(\n container: HTMLElement,\n element: HTMLElement\n): void {\n const containerRect = container.getBoundingClientRect();\n const elementRect = element.getBoundingClientRect();\n const currentScrollTop = container.scrollTop;\n const elementTop = elementRect.top - containerRect.top + currentScrollTop;\n const centeredScrollTop =\n elementTop - (container.clientHeight - elementRect.height) / 2;\n const maxScrollTop = Math.max(\n 0,\n container.scrollHeight - container.clientHeight\n );\n const nextScrollTop = Math.min(Math.max(0, centeredScrollTop), maxScrollTop);\n container.scrollTo({ top: nextScrollTop, behavior: \"auto\" });\n}\n\nfunction scrollElementIntoScrollContainerNearest(\n container: HTMLElement,\n element: HTMLElement\n): void {\n const containerRect = container.getBoundingClientRect();\n const elementRect = element.getBoundingClientRect();\n let nextScrollTop = container.scrollTop;\n\n if (elementRect.top < containerRect.top) {\n nextScrollTop -= containerRect.top - elementRect.top;\n } else if (elementRect.bottom > containerRect.bottom) {\n nextScrollTop += elementRect.bottom - containerRect.bottom;\n } else {\n return;\n }\n\n const maxScrollTop = Math.max(\n 0,\n container.scrollHeight - container.clientHeight\n );\n container.scrollTo({\n top: Math.min(Math.max(0, nextScrollTop), maxScrollTop),\n behavior: \"auto\"\n });\n}\n\nfunction findGroup<TItem>(\n groups: MentionPaletteState<TItem>[\"groups\"],\n groupId: string\n): MentionPaletteGroup<TItem> {\n const group = groups.find((candidate) => candidate.id === groupId);\n if (!group) {\n throw new Error(`MentionPalette: unknown group id \"${groupId}\"`);\n }\n return group;\n}\n\nfunction MentionPaletteGroups<TItem>({\n state,\n highlightedKey,\n highlightedOptionRef,\n getItemKey,\n renderItem,\n onHighlightChange,\n onSelectItem,\n onExpandGroup,\n renderListFooter,\n groupDividerAttribute\n}: {\n state: MentionPaletteState<TItem>;\n highlightedKey: string | null;\n highlightedOptionRef: MutableRefObject<HTMLButtonElement | null>;\n getItemKey: (item: TItem, group: MentionPaletteGroup<TItem>) => string;\n renderItem: (\n item: TItem,\n ctx: { active: boolean; group: MentionPaletteGroup<TItem> }\n ) => ReactNode;\n onHighlightChange: (key: string) => void;\n onSelectItem: (item: TItem, group: MentionPaletteGroup<TItem>) => void;\n onExpandGroup: (groupId: string) => void;\n renderListFooter?: () => ReactNode;\n groupDividerAttribute: string;\n}): JSX.Element {\n return (\n <div className={paletteStyles.groups}>\n {state.groups.map((group, index) => {\n const showGroupDivider = index > 0 && !group.hideTopDivider;\n return (\n <section\n key={group.id}\n className={cn(paletteStyles.group, group.sectionClassName)}\n >\n {showGroupDivider ? (\n <div\n className={paletteStyles.groupDivider}\n {...{ [groupDividerAttribute]: \"true\" }}\n aria-hidden=\"true\"\n />\n ) : null}\n {group.label ? (\n <div className={paletteStyles.groupLabel}>{group.label}</div>\n ) : null}\n <div className={paletteStyles.groupItems}>\n {group.items.length === 0 && group.emptyLabel ? (\n <div className={paletteStyles.groupEmpty}>\n {group.emptyLabel}\n </div>\n ) : null}\n {group.items.map((item) => {\n const entryKey = `${group.id}:${getItemKey(item, group)}`;\n const isHighlighted = entryKey === highlightedKey;\n return (\n <button\n key={entryKey}\n ref={isHighlighted ? highlightedOptionRef : null}\n type=\"button\"\n className={paletteStyles.rowButton}\n role=\"option\"\n aria-selected={isHighlighted}\n data-highlighted={isHighlighted ? \"\" : undefined}\n onPointerMove={() => {\n if (!isHighlighted) {\n onHighlightChange(entryKey);\n }\n }}\n onMouseDown={(event) => event.preventDefault()}\n onClick={() => onSelectItem(item, group)}\n >\n {renderItem(item, { active: isHighlighted, group })}\n </button>\n );\n })}\n {group.hasMore ? (\n <button\n key={`expand:${group.id}`}\n ref={\n `expand:${group.id}` === highlightedKey\n ? highlightedOptionRef\n : null\n }\n type=\"button\"\n className={paletteStyles.expandButton}\n disabled={group.expandStatus === \"loading\"}\n aria-busy={group.expandStatus === \"loading\" || undefined}\n data-highlighted={\n `expand:${group.id}` === highlightedKey ? \"\" : undefined\n }\n onPointerMove={() => {\n if (`expand:${group.id}` !== highlightedKey) {\n onHighlightChange(`expand:${group.id}`);\n }\n }}\n onMouseDown={(event) => event.preventDefault()}\n onClick={() => {\n if (group.expandStatus !== \"loading\") {\n onExpandGroup(group.id);\n }\n }}\n >\n {mentionPaletteExpandLabel(group)}\n </button>\n ) : null}\n </div>\n </section>\n );\n })}\n {renderListFooter?.()}\n </div>\n );\n}\n\nfunction MentionPaletteEmptyState({\n icon = \"folder-failed\",\n label,\n testId\n}: {\n icon?: \"folder-failed\" | \"keyboard\";\n label: string;\n testId: string;\n}): JSX.Element {\n \"use memo\";\n const EmptyStateIcon =\n icon === \"keyboard\" ? KeyboardFilledIcon : FolderFailedFilledIcon;\n\n return (\n <div\n className={paletteStyles.emptyState}\n data-empty-state-icon={icon}\n data-testid={testId}\n >\n <div className={paletteStyles.emptyStateInner}>\n <EmptyStateIcon\n className={paletteStyles.emptyStateIcon}\n aria-hidden=\"true\"\n />\n <span className={paletteStyles.emptyStateText}>{label}</span>\n </div>\n </div>\n );\n}\n\nfunction MentionPaletteLoading({\n label,\n spinnerTestId\n}: {\n label: string;\n spinnerTestId: string;\n}): JSX.Element {\n \"use memo\";\n return (\n <div className={paletteStyles.loading}>\n <span\n aria-hidden=\"true\"\n className={paletteStyles.loadingSpinner}\n data-testid={spinnerTestId}\n />\n <span>{label}</span>\n </div>\n );\n}\n\nfunction MentionPaletteHint({\n ariaLabel,\n cycleFilterLabel,\n moveSelectionLabel,\n navigateHierarchyLabel,\n onCycleFilter,\n onMoveSelection,\n onNavigateHierarchy,\n classNames,\n testId\n}: {\n ariaLabel: string;\n cycleFilterLabel: string;\n moveSelectionLabel: string;\n navigateHierarchyLabel?: string;\n onCycleFilter: (delta: 1 | -1) => void;\n onMoveSelection: (delta: 1 | -1) => void;\n onNavigateHierarchy?: (delta: 1 | -1) => void;\n classNames: ResolvedMentionPaletteTheme[\"classNames\"];\n testId: string;\n}): JSX.Element {\n \"use memo\";\n const showHierarchyHints = Boolean(\n navigateHierarchyLabel && onNavigateHierarchy\n );\n return (\n <div\n className={classNames.hint}\n aria-label={ariaLabel}\n data-testid={testId}\n >\n <span className={classNames.hintItem} data-tooltip={cycleFilterLabel}>\n <span className={classNames.shortcutGroup}>\n <button\n className={cn(classNames.shortcut, classNames.shortcutButton)}\n type=\"button\"\n aria-label={`Tab ${cycleFilterLabel}`}\n onMouseDown={(event) => event.preventDefault()}\n onClick={() => onCycleFilter(1)}\n >\n {/* i18n-check-ignore: Keyboard key label. */}\n Tab\n </button>\n {!showHierarchyHints ? (\n <>\n <button\n className={cn(\n classNames.shortcut,\n classNames.shortcutArrow,\n classNames.shortcutButton\n )}\n type=\"button\"\n aria-label={`← ${cycleFilterLabel}`}\n onMouseDown={(event) => event.preventDefault()}\n onClick={() => onCycleFilter(-1)}\n >\n ←\n </button>\n <button\n className={cn(\n classNames.shortcut,\n classNames.shortcutArrow,\n classNames.shortcutButton\n )}\n type=\"button\"\n aria-label={`→ ${cycleFilterLabel}`}\n onMouseDown={(event) => event.preventDefault()}\n onClick={() => onCycleFilter(1)}\n >\n →\n </button>\n </>\n ) : null}\n </span>\n <span>{cycleFilterLabel}</span>\n </span>\n {showHierarchyHints ? (\n <>\n <span className={classNames.hintSeparator} aria-hidden=\"true\">\n |\n </span>\n <span\n className={classNames.hintItem}\n data-tooltip={navigateHierarchyLabel}\n >\n <span className={classNames.shortcutGroup}>\n <button\n className={cn(\n classNames.shortcut,\n classNames.shortcutArrow,\n classNames.shortcutButton\n )}\n type=\"button\"\n aria-label={`← ${navigateHierarchyLabel}`}\n onMouseDown={(event) => event.preventDefault()}\n onClick={() => onNavigateHierarchy?.(-1)}\n >\n ←\n </button>\n <button\n className={cn(\n classNames.shortcut,\n classNames.shortcutArrow,\n classNames.shortcutButton\n )}\n type=\"button\"\n aria-label={`→ ${navigateHierarchyLabel}`}\n onMouseDown={(event) => event.preventDefault()}\n onClick={() => onNavigateHierarchy?.(1)}\n >\n →\n </button>\n </span>\n <span>{navigateHierarchyLabel}</span>\n </span>\n </>\n ) : null}\n <span className={classNames.hintSeparator} aria-hidden=\"true\">\n |\n </span>\n <span className={classNames.hintItem} data-tooltip={moveSelectionLabel}>\n <span className={classNames.shortcutGroup}>\n <button\n className={cn(\n classNames.shortcut,\n classNames.shortcutArrow,\n classNames.shortcutButton\n )}\n type=\"button\"\n aria-label={`↑ ${moveSelectionLabel}`}\n onMouseDown={(event) => event.preventDefault()}\n onClick={() => onMoveSelection(-1)}\n >\n ↑\n </button>\n <button\n className={cn(\n classNames.shortcut,\n classNames.shortcutArrow,\n classNames.shortcutButton\n )}\n type=\"button\"\n aria-label={`↓ ${moveSelectionLabel}`}\n onMouseDown={(event) => event.preventDefault()}\n onClick={() => onMoveSelection(1)}\n >\n ↓\n </button>\n </span>\n <span>{moveSelectionLabel}</span>\n </span>\n </div>\n );\n}\n","import {\n useCallback,\n useEffect,\n useRef,\n useState,\n type JSX,\n type MouseEvent as ReactMouseEvent,\n type RefObject\n} from \"react\";\nimport { cn } from \"@tutti-os/ui-system/utils\";\n\ninterface MentionPaletteScrollbarState {\n scrollable: boolean;\n thumbHeight: number;\n thumbTop: number;\n}\n\ninterface MentionPaletteScrollbarDragState {\n maxScrollTop: number;\n maxThumbTop: number;\n startClientY: number;\n startScrollTop: number;\n}\n\nconst MENTION_PALETTE_SCROLLBAR_MIN_THUMB_HEIGHT = 24;\nconst MENTION_PALETTE_SCROLLBAR_HIDDEN_STATE: MentionPaletteScrollbarState = {\n scrollable: false,\n thumbHeight: 0,\n thumbTop: 0\n};\n\nexport function MentionPaletteScrollbar({\n scrollBodyRef,\n className,\n thumbClassName,\n testId\n}: {\n scrollBodyRef: RefObject<HTMLDivElement | null>;\n className: string;\n thumbClassName: string;\n testId: string;\n}): JSX.Element {\n \"use memo\";\n const trackRef = useRef<HTMLDivElement | null>(null);\n const dragStateRef = useRef<MentionPaletteScrollbarDragState | null>(null);\n const [scrollbarState, setScrollbarState] =\n useState<MentionPaletteScrollbarState>({\n scrollable: false,\n thumbHeight: 0,\n thumbTop: 0\n });\n const [dragging, setDragging] = useState(false);\n\n const hideScrollbar = useCallback((): void => {\n setScrollbarState((previous) =>\n previous.scrollable ||\n previous.thumbHeight !== 0 ||\n previous.thumbTop !== 0\n ? MENTION_PALETTE_SCROLLBAR_HIDDEN_STATE\n : previous\n );\n }, []);\n\n const syncScrollbarState = useCallback((): void => {\n const contentElement = scrollBodyRef.current;\n if (!contentElement) {\n hideScrollbar();\n return;\n }\n\n const { scrollHeight, scrollTop, clientHeight } = contentElement;\n const measuredTrackHeight = trackRef.current?.clientHeight ?? 0;\n const trackHeight =\n measuredTrackHeight > 0 ? measuredTrackHeight : clientHeight;\n const maxScrollTop = Math.max(0, scrollHeight - clientHeight);\n\n if (clientHeight <= 0 || trackHeight <= 0 || maxScrollTop <= 0) {\n hideScrollbar();\n return;\n }\n\n const thumbHeight = Math.max(\n MENTION_PALETTE_SCROLLBAR_MIN_THUMB_HEIGHT,\n Math.round((clientHeight / scrollHeight) * trackHeight)\n );\n const maxThumbTop = Math.max(0, trackHeight - thumbHeight);\n const thumbTop = Math.round((scrollTop / maxScrollTop) * maxThumbTop);\n setScrollbarState((previous) =>\n previous.scrollable &&\n previous.thumbHeight === thumbHeight &&\n previous.thumbTop === thumbTop\n ? previous\n : { scrollable: true, thumbHeight, thumbTop }\n );\n }, [hideScrollbar, scrollBodyRef]);\n\n useEffect(() => {\n const contentElement = scrollBodyRef.current;\n if (!contentElement) {\n hideScrollbar();\n return;\n }\n\n syncScrollbarState();\n contentElement.addEventListener(\"scroll\", syncScrollbarState, {\n passive: true\n });\n const resizeObserver =\n typeof ResizeObserver !== \"undefined\"\n ? new ResizeObserver(syncScrollbarState)\n : null;\n resizeObserver?.observe(contentElement);\n if (trackRef.current) {\n resizeObserver?.observe(trackRef.current);\n }\n const animationFrameId = window.requestAnimationFrame(syncScrollbarState);\n return () => {\n contentElement.removeEventListener(\"scroll\", syncScrollbarState);\n resizeObserver?.disconnect();\n window.cancelAnimationFrame(animationFrameId);\n };\n }, [hideScrollbar, scrollBodyRef, syncScrollbarState]);\n\n useEffect(() => {\n if (!dragging) {\n return;\n }\n\n const handleMouseMove = (event: MouseEvent): void => {\n const contentElement = scrollBodyRef.current;\n const dragState = dragStateRef.current;\n if (!contentElement || !dragState || dragState.maxThumbTop <= 0) {\n return;\n }\n const delta = event.clientY - dragState.startClientY;\n const nextThumbTop =\n (dragState.startScrollTop / dragState.maxScrollTop) *\n dragState.maxThumbTop +\n delta;\n contentElement.scrollTop =\n (Math.min(Math.max(0, nextThumbTop), dragState.maxThumbTop) /\n dragState.maxThumbTop) *\n dragState.maxScrollTop;\n syncScrollbarState();\n };\n\n const handleMouseUp = (): void => {\n dragStateRef.current = null;\n setDragging(false);\n };\n\n window.addEventListener(\"mousemove\", handleMouseMove);\n window.addEventListener(\"mouseup\", handleMouseUp);\n return () => {\n window.removeEventListener(\"mousemove\", handleMouseMove);\n window.removeEventListener(\"mouseup\", handleMouseUp);\n };\n }, [dragging, scrollBodyRef, syncScrollbarState]);\n\n const scrollContentToThumbTop = (thumbTop: number): void => {\n const contentElement = scrollBodyRef.current;\n const trackElement = trackRef.current;\n if (!contentElement || !trackElement) {\n return;\n }\n const maxScrollTop = Math.max(\n 0,\n contentElement.scrollHeight - contentElement.clientHeight\n );\n const maxThumbTop = Math.max(\n 0,\n trackElement.clientHeight - scrollbarState.thumbHeight\n );\n if (maxScrollTop <= 0 || maxThumbTop <= 0) {\n return;\n }\n contentElement.scrollTop =\n (Math.min(Math.max(0, thumbTop), maxThumbTop) / maxThumbTop) *\n maxScrollTop;\n syncScrollbarState();\n };\n\n const handleTrackMouseDown = (\n event: ReactMouseEvent<HTMLDivElement>\n ): void => {\n if (\n event.button !== 0 ||\n !scrollbarState.scrollable ||\n event.target !== event.currentTarget\n ) {\n return;\n }\n event.preventDefault();\n const trackRect = event.currentTarget.getBoundingClientRect();\n scrollContentToThumbTop(\n event.clientY - trackRect.top - scrollbarState.thumbHeight / 2\n );\n };\n\n const handleThumbMouseDown = (\n event: ReactMouseEvent<HTMLDivElement>\n ): void => {\n if (event.button !== 0 || !scrollbarState.scrollable) {\n return;\n }\n const contentElement = scrollBodyRef.current;\n const trackElement = trackRef.current;\n if (!contentElement || !trackElement) {\n return;\n }\n event.preventDefault();\n event.stopPropagation();\n dragStateRef.current = {\n maxScrollTop: Math.max(\n 0,\n contentElement.scrollHeight - contentElement.clientHeight\n ),\n maxThumbTop: Math.max(\n 0,\n trackElement.clientHeight - scrollbarState.thumbHeight\n ),\n startClientY: event.clientY,\n startScrollTop: contentElement.scrollTop\n };\n setDragging(true);\n };\n\n if (!scrollbarState.scrollable && !dragging) {\n return <div ref={trackRef} className=\"hidden\" aria-hidden=\"true\" />;\n }\n\n return (\n <div\n ref={trackRef}\n className={cn(\"group/status-scrollbar\", className)}\n data-scrollable={scrollbarState.scrollable ? \"true\" : \"false\"}\n data-dragging={dragging ? \"true\" : \"false\"}\n data-testid={testId}\n aria-hidden=\"true\"\n onMouseDown={handleTrackMouseDown}\n >\n <div\n className={thumbClassName}\n onMouseDown={handleThumbMouseDown}\n style={{\n height: `${scrollbarState.thumbHeight}px`,\n transform: `translateY(${scrollbarState.thumbTop}px)`\n }}\n />\n </div>\n );\n}\n","import type {\n MentionPaletteGroup,\n MentionPaletteProps,\n MentionPaletteState\n} from \"./mentionPaletteTypes.ts\";\nimport {\n findMentionPaletteEntry,\n moveMentionPaletteHighlight,\n nextMentionPaletteCategory,\n selectedMentionPaletteItem\n} from \"./mentionPaletteModel.ts\";\n\ntype MentionPaletteCycleCategory =\n | string\n | {\n id: string;\n };\n\nexport interface MentionPaletteStateCallbacks<TItem> {\n onHighlightChange?: (key: string) => void;\n onActiveCategoryIdChange?: (categoryId: string) => void;\n onSelectItem?: (item: TItem) => void;\n onExpandGroup?: (groupId: string) => void;\n}\n\nexport interface MentionPaletteStateAdapterInput<TItem> {\n state: MentionPaletteState<TItem>;\n highlightedKey: string | null;\n /**\n * Optional order used by Tab/Shift+Tab. Defaults to the rendered category\n * order; callers with a surface-specific results-mode tab order can pass it\n * here and keep that policy outside the shell.\n */\n categoryCycleOrder?: readonly MentionPaletteCycleCategory[];\n getItemKey: (item: TItem, groupId: string) => string;\n callbacks?: MentionPaletteStateCallbacks<TItem>;\n}\n\nexport type MentionPaletteStateCommitResult<TItem> =\n | { type: \"none\" }\n | { type: \"category\"; categoryId: string }\n | { type: \"expand\"; groupId: string }\n | { type: \"item\"; item: TItem };\n\nexport interface MentionPaletteStateAdapter<TItem> {\n selectedItem: TItem | null;\n paletteProps: Pick<\n MentionPaletteProps<TItem>,\n | \"state\"\n | \"highlightedKey\"\n | \"getItemKey\"\n | \"onHighlightChange\"\n | \"onSelectItem\"\n | \"onSelectCategory\"\n | \"onSelectFilter\"\n | \"onExpandGroup\"\n | \"onCycleFilter\"\n | \"onMoveSelection\"\n >;\n moveSelection: (delta: 1 | -1) => string | null;\n selectCategory: (categoryId: string) => void;\n expandGroup: (groupId: string) => void;\n cycleCategory: (delta: 1 | -1) => string | null;\n commitHighlighted: () => MentionPaletteStateCommitResult<TItem>;\n}\n\nexport function createMentionPaletteStateAdapter<TItem>(\n input: MentionPaletteStateAdapterInput<TItem>\n): MentionPaletteStateAdapter<TItem> {\n const getPaletteItemKey = (\n item: TItem,\n group: MentionPaletteGroup<TItem>\n ): string => input.getItemKey(item, group.id);\n\n const selectCategory = (categoryId: string): void => {\n input.callbacks?.onActiveCategoryIdChange?.(categoryId);\n };\n\n const expandGroup = (groupId: string): void => {\n input.callbacks?.onExpandGroup?.(groupId);\n };\n\n const moveSelection = (delta: 1 | -1): string | null => {\n const nextKey = moveMentionPaletteHighlight({\n state: input.state,\n currentKey: input.highlightedKey,\n delta,\n getItemKey: input.getItemKey\n });\n if (nextKey !== null) {\n input.callbacks?.onHighlightChange?.(nextKey);\n }\n return nextKey;\n };\n\n const cycleCategory = (delta: 1 | -1): string | null => {\n const cycleCategories = resolveCycleCategories(input.categoryCycleOrder);\n const categories = cycleCategories.length\n ? cycleCategories\n : input.state.categories;\n if (categories.length === 0) {\n return null;\n }\n const nextCategoryId = nextMentionPaletteCategory(\n categories,\n input.state.filter,\n delta\n );\n selectCategory(nextCategoryId);\n return nextCategoryId;\n };\n\n const selectedItem = selectedMentionPaletteItem({\n state: input.state,\n key: input.highlightedKey,\n getItemKey: input.getItemKey\n });\n\n const commitHighlighted = (): MentionPaletteStateCommitResult<TItem> => {\n const activeEntry = findMentionPaletteEntry({\n state: input.state,\n key: input.highlightedKey,\n getItemKey: input.getItemKey\n });\n const fallbackCategoryId = categoryIdFromKey(input.highlightedKey);\n\n if (!activeEntry) {\n // A highlighted key that decodes to the *already-active* filter is not\n // a pending \"drill into this category\" action — it means the active\n // category resolved to having nothing flatten-able (e.g. a\n // structurally empty category like \"No tasks yet\", not a query that\n // filtered a category down to zero). Re-selecting the same category\n // would be a no-op that silently swallows Enter forever, so treat it\n // the same as a zero-result search: nothing to commit.\n if (\n fallbackCategoryId !== null &&\n fallbackCategoryId !== input.state.filter &&\n input.state.categories.some(\n (category) => category.id === fallbackCategoryId\n )\n ) {\n selectCategory(fallbackCategoryId);\n return { type: \"category\", categoryId: fallbackCategoryId };\n }\n return { type: \"none\" };\n }\n\n if (activeEntry.type === \"category\" && activeEntry.categoryId) {\n selectCategory(activeEntry.categoryId);\n return { type: \"category\", categoryId: activeEntry.categoryId };\n }\n\n if (activeEntry.type === \"expand\" && activeEntry.groupId) {\n expandGroup(activeEntry.groupId);\n return { type: \"expand\", groupId: activeEntry.groupId };\n }\n\n if (activeEntry.type === \"item\") {\n const item = selectedMentionPaletteItem({\n state: input.state,\n key: activeEntry.key,\n getItemKey: input.getItemKey\n });\n if (item !== null) {\n input.callbacks?.onSelectItem?.(item);\n return { type: \"item\", item };\n }\n }\n\n return { type: \"none\" };\n };\n\n return {\n selectedItem,\n paletteProps: {\n state: input.state,\n highlightedKey: input.highlightedKey,\n getItemKey: getPaletteItemKey,\n onHighlightChange: (key) => {\n input.callbacks?.onHighlightChange?.(key);\n },\n onSelectItem: (item) => {\n input.callbacks?.onSelectItem?.(item);\n },\n onSelectCategory: selectCategory,\n onSelectFilter: selectCategory,\n onExpandGroup: expandGroup,\n onCycleFilter: cycleCategory,\n onMoveSelection: moveSelection\n },\n moveSelection,\n selectCategory,\n expandGroup,\n cycleCategory,\n commitHighlighted\n };\n}\n\nfunction resolveCycleCategories(\n categories: readonly MentionPaletteCycleCategory[] | undefined\n): readonly { id: string }[] {\n return (\n categories?.map((category) =>\n typeof category === \"string\" ? { id: category } : category\n ) ?? []\n );\n}\n\nfunction categoryIdFromKey(key: string | null): string | null {\n const prefix = \"category:\";\n return key?.startsWith(prefix) ? key.slice(prefix.length) : null;\n}\n","import type { JSX, ReactNode } from \"react\";\nimport { MentionPalette } from \"./MentionPalette.tsx\";\nimport {\n createMentionPaletteStateAdapter,\n type MentionPaletteStateAdapterInput\n} from \"./mentionPaletteStateAdapter.ts\";\nimport type {\n MentionPaletteGroup,\n MentionPaletteProps,\n MentionPaletteTheme\n} from \"./mentionPaletteTypes.ts\";\n\nexport interface MentionPaletteFromStateProps<\n TItem\n> extends MentionPaletteStateAdapterInput<TItem> {\n labels: MentionPaletteProps<TItem>[\"labels\"];\n hintLabels: MentionPaletteProps<TItem>[\"hintLabels\"];\n maxHeightPx: number;\n renderItem: (\n item: TItem,\n ctx: { active: boolean; group: MentionPaletteGroup<TItem> }\n ) => ReactNode;\n renderListFooter?: () => ReactNode;\n headerActions?: ReactNode;\n loadingBanner?: ReactNode;\n scrollHighlightedIntoViewCentered?: boolean;\n theme?: MentionPaletteTheme;\n onNavigateHierarchy?: MentionPaletteProps<TItem>[\"onNavigateHierarchy\"];\n}\n\nexport function MentionPaletteFromState<TItem>(\n props: MentionPaletteFromStateProps<TItem>\n): JSX.Element {\n \"use memo\";\n const {\n labels,\n hintLabels,\n maxHeightPx,\n renderItem,\n renderListFooter,\n headerActions,\n loadingBanner,\n scrollHighlightedIntoViewCentered,\n theme,\n onNavigateHierarchy,\n ...adapterInput\n } = props;\n const adapter = createMentionPaletteStateAdapter(adapterInput);\n\n return (\n <MentionPalette\n {...adapter.paletteProps}\n labels={labels}\n hintLabels={hintLabels}\n maxHeightPx={maxHeightPx}\n renderItem={renderItem}\n renderListFooter={renderListFooter}\n headerActions={headerActions}\n loadingBanner={loadingBanner}\n scrollHighlightedIntoViewCentered={scrollHighlightedIntoViewCentered}\n theme={theme}\n onNavigateHierarchy={onNavigateHierarchy}\n />\n );\n}\n","import { CheckIcon } from \"@tutti-os/ui-system/icons\";\n\nexport function MentionPaletteSelectIndicator(props: { selected: boolean }) {\n return (\n <span\n aria-hidden=\"true\"\n className=\"rich-text-at-mention-select-indicator\"\n data-selected={props.selected ? \"true\" : \"false\"}\n >\n <CheckIcon size={13} />\n </span>\n );\n}\n\nexport function MentionPaletteMultiSelectFooter(props: {\n count: number;\n countLabel: string;\n cancelLabel: string;\n confirmLabel: string;\n onCancel: () => void;\n onConfirm: () => void;\n}) {\n return (\n <div className=\"rich-text-at-mention-multiselect-footer\">\n <span className=\"rich-text-at-mention-multiselect-footer__count\">\n {props.countLabel}\n </span>\n <div className=\"rich-text-at-mention-multiselect-footer__actions\">\n <button\n type=\"button\"\n className=\"rich-text-at-mention-multiselect-footer__button rich-text-at-mention-multiselect-footer__button--secondary\"\n onMouseDown={(event) => event.preventDefault()}\n onClick={props.onCancel}\n >\n {props.cancelLabel}\n </button>\n <button\n type=\"button\"\n disabled={props.count === 0}\n className=\"rich-text-at-mention-multiselect-footer__button rich-text-at-mention-multiselect-footer__button--primary\"\n onMouseDown={(event) => event.preventDefault()}\n onClick={props.onConfirm}\n >\n {props.confirmLabel}\n </button>\n </div>\n </div>\n );\n}\n","import {\n ArrowLeftIcon,\n ArrowRightIcon,\n Badge,\n FileCodeIcon,\n FileTextIcon,\n FolderIcon,\n ImageFileIcon,\n ProductIcon,\n StatusDot,\n VideoFileIcon,\n cn,\n type IconProps\n} from \"@tutti-os/ui-system\";\nimport type { MentionFileVisualKind } from \"./mentionFileVisualKind.ts\";\nimport {\n mentionRowDataAttribute,\n mentionRowRootDataAttributes,\n type MentionRowDataAttributeMode\n} from \"./mentionRowDataAttributes.ts\";\nimport type {\n MentionRowFileItem,\n MentionRowItem,\n MentionRowSessionItem,\n MentionRowStatusTag\n} from \"./mentionRowTypes.ts\";\nimport { mentionStatusBadgeClassName } from \"./mentionStatusTone.ts\";\n\n/**\n * Default file kind-icon shapes for surfaces that do NOT ship the agent's\n * CSS-masked glyph stylesheet. These mirror the agent's mask glyph shapes\n * (`agentactivity.css`: folder-filled / doc-filled / code-filled / image-filled\n * / video-filled / arrow-left-filled) using ui-system icon components, so a\n * file row renders a real glyph without `agentactivity.css`. The agent composer\n * passes its own `fileIcon` class and keeps rendering masked `<span>` glyphs,\n * except `back` rows which always use {@link ArrowLeftIcon}.\n */\nconst MENTION_FILE_VISUAL_KIND_ICON: Record<\n MentionFileVisualKind,\n (props: IconProps) => React.JSX.Element\n> = {\n back: ArrowLeftIcon,\n folder: FolderIcon,\n document: FileTextIcon,\n // The agent maps markdown to `product-filled.svg`; ProductIcon is the\n // matching boundary-safe ui-system glyph.\n markdown: ProductIcon,\n code: FileCodeIcon,\n image: ImageFileIcon,\n video: VideoFileIcon\n};\n\n/**\n * Structural class-name hooks for the elements a {@link MentionRow} renders that\n * rely on a stylesheet (file icon/thumb, the app fallback kind-icon, and the\n * session avatar placeholder modifier). Every key is optional and defaults to a\n * PACKAGE-OWNED `rich-text-at-mention-*` class whose CSS ships with\n * `mentionPalette.css`, so any consumer renders styled rows out of the box.\n *\n * Surfaces with their own stylesheet (e.g. the agent composer) pass their exact\n * existing class names here so their rendered DOM stays byte-identical.\n */\nexport interface MentionRowClassNames {\n /** The masked file kind-icon `<span>`. */\n fileIcon?: string;\n /** The image-thumbnail wrapper `<span>` (rendered for image files). */\n fileThumb?: string;\n /** The fallback app icon glyph rendered when no `iconUrl` is present. */\n kindIcon?: string;\n /**\n * Modifier class added to the session user avatar `<img>` when the user has no\n * avatar URL and the placeholder asset is shown.\n */\n avatarImgUserPlaceholder?: string;\n}\n\nexport interface MentionRowRenderOptions {\n classNames?: MentionRowClassNames;\n dataAttributeMode?: MentionRowDataAttributeMode;\n /**\n * 当提供时,issue / app 行末尾渲染一个「查看产物」入口(独立点击热区,\n * 不触发整行选中)。点击回调由调用方注入(如打开引用文件 picker 并定位到该实体)。\n */\n onOpenReferences?: () => void;\n /** 入口的无障碍标签 / tooltip 文案。 */\n openReferencesLabel?: string;\n /** 当提供时,文件夹行末尾渲染一个「进入下一级」箭头按钮。 */\n onNavigateInto?: () => void;\n /** 「进入下一级」箭头按钮的无障碍标签 / tooltip 文案。 */\n navigateIntoLabel?: string;\n}\n\ninterface ResolvedMentionRowRenderOptions {\n classNames?: MentionRowClassNames;\n dataAttributeMode: MentionRowDataAttributeMode;\n onOpenReferences?: () => void;\n openReferencesLabel?: string;\n onNavigateInto?: () => void;\n navigateIntoLabel?: string;\n}\n\nconst DEFAULT_MENTION_ROW_CLASS_NAMES = {\n fileIcon: \"rich-text-at-mention-file-icon\",\n fileThumb: \"rich-text-at-mention-file-thumb\",\n kindIcon: \"rich-text-at-mention-kind-icon\",\n avatarImgUserPlaceholder: \"rich-text-at-mention-avatar-img--user-placeholder\"\n} as const satisfies Required<MentionRowClassNames>;\n\nfunction resolveMentionRowClassNames(\n classNames?: MentionRowClassNames\n): Required<MentionRowClassNames> {\n return {\n fileIcon: classNames?.fileIcon ?? DEFAULT_MENTION_ROW_CLASS_NAMES.fileIcon,\n fileThumb:\n classNames?.fileThumb ?? DEFAULT_MENTION_ROW_CLASS_NAMES.fileThumb,\n kindIcon: classNames?.kindIcon ?? DEFAULT_MENTION_ROW_CLASS_NAMES.kindIcon,\n avatarImgUserPlaceholder:\n classNames?.avatarImgUserPlaceholder ??\n DEFAULT_MENTION_ROW_CLASS_NAMES.avatarImgUserPlaceholder\n };\n}\n\nfunction resolveMentionRowRenderOptions(\n options?: MentionRowClassNames | MentionRowRenderOptions\n): ResolvedMentionRowRenderOptions {\n if (isMentionRowRenderOptions(options)) {\n return {\n classNames: options.classNames,\n dataAttributeMode: options.dataAttributeMode ?? \"shared\",\n onOpenReferences: options.onOpenReferences,\n openReferencesLabel: options.openReferencesLabel,\n onNavigateInto: options.onNavigateInto,\n navigateIntoLabel: options.navigateIntoLabel\n };\n }\n return {\n classNames: options,\n dataAttributeMode: \"shared\"\n };\n}\n\nfunction isMentionRowRenderOptions(\n options: MentionRowClassNames | MentionRowRenderOptions | undefined\n): options is MentionRowRenderOptions {\n return (\n options !== undefined &&\n (\"classNames\" in options ||\n \"dataAttributeMode\" in options ||\n \"onOpenReferences\" in options ||\n \"onNavigateInto\" in options)\n );\n}\n\n/**\n * Render the inner content of a single `@`-mention palette row from a\n * fully-resolved {@link MentionRowItem}. The surrounding option button / active\n * state is provided by the shared `MentionPalette` shell; this renders only the\n * row body.\n *\n * Pass {@link classNames} to override the package-owned structural class hooks\n * (e.g. so the agent composer keeps emitting its own stylesheet's class names).\n */\nexport function renderMentionRow(\n item: MentionRowItem,\n options?: MentionRowClassNames | MentionRowRenderOptions\n): React.ReactNode {\n const {\n classNames,\n dataAttributeMode,\n onOpenReferences,\n openReferencesLabel,\n onNavigateInto,\n navigateIntoLabel\n } = resolveMentionRowRenderOptions(options);\n const resolved = resolveMentionRowClassNames(classNames);\n const referencesButton = onOpenReferences ? (\n <MentionOpenReferencesButton\n label={openReferencesLabel}\n onOpenReferences={onOpenReferences}\n dataAttributeMode={dataAttributeMode}\n />\n ) : null;\n if (item.kind === \"file\") {\n return (\n <MentionFileRow\n item={item}\n classNames={resolved}\n dataAttributeMode={dataAttributeMode}\n navigateIntoLabel={navigateIntoLabel}\n onNavigateInto={onNavigateInto}\n />\n );\n }\n\n if (item.kind === \"plain\") {\n return (\n <span className=\"rich-text-at-mention-row rich-text-at-mention-row--plain\">\n {item.leading}\n <span className=\"rich-text-at-mention-row__text-stack\">\n <span className=\"rich-text-at-mention-row__title\">{item.label}</span>\n {item.description ? (\n <span className=\"rich-text-at-mention-row__description\">\n {item.description}\n </span>\n ) : null}\n </span>\n </span>\n );\n }\n\n if (item.kind === \"session\") {\n return (\n <span className=\"rich-text-at-mention-row rich-text-at-mention-row--session\">\n <MentionSessionAvatarStack\n item={item}\n classNames={resolved}\n dataAttributeMode={dataAttributeMode}\n />\n <span className=\"rich-text-at-mention-row__entity-text rich-text-at-mention-row__session-title\">\n <MentionSessionTitle item={item} />\n </span>\n {item.statusTag ? (\n <MentionStatusBadge\n statusTag={item.statusTag}\n dataAttributeMode={dataAttributeMode}\n />\n ) : null}\n </span>\n );\n }\n\n if (item.kind === \"app\") {\n return (\n <span className=\"rich-text-at-mention-row rich-text-at-mention-row--app\">\n <MentionWorkspaceAppIcon\n iconUrl={item.iconUrl}\n kindIconClassName={resolved.kindIcon}\n dataAttributeMode={dataAttributeMode}\n />\n <span className=\"rich-text-at-mention-row__entity-text rich-text-at-mention-row__app-text\">\n <span className=\"rich-text-at-mention-row__entity-name rich-text-at-mention-row__app-name\">\n {item.name}\n </span>\n {item.description ? (\n <span className=\"rich-text-at-mention-row__entity-description rich-text-at-mention-row__app-description\">\n {item.description}\n </span>\n ) : null}\n </span>\n {item.statusTag ? (\n <MentionStatusBadge\n statusTag={item.statusTag}\n dataAttributeMode={dataAttributeMode}\n />\n ) : null}\n {referencesButton}\n </span>\n );\n }\n\n if (item.kind === \"app-factory\") {\n return (\n <span className=\"rich-text-at-mention-row__text-stack\">\n <span className=\"rich-text-at-mention-row__title\">{item.name}</span>\n </span>\n );\n }\n\n return (\n <span className=\"rich-text-at-mention-row rich-text-at-mention-row--issue\">\n <span className=\"rich-text-at-mention-row__text-stack rich-text-at-mention-row__text-stack--fill\">\n <span className=\"rich-text-at-mention-row__inline\">\n <span className=\"rich-text-at-mention-row__title\">{item.title}</span>\n </span>\n {item.creatorName ? (\n <span className=\"rich-text-at-mention-row__description\">\n {item.creatorName}\n </span>\n ) : null}\n </span>\n {item.statusTag ? (\n <MentionStatusBadge\n statusTag={item.statusTag}\n dataAttributeMode={dataAttributeMode}\n />\n ) : null}\n {referencesButton}\n </span>\n );\n}\n\n/**\n * 「查看产物」入口。issue / app 行末尾的独立点击热区:点击只触发\n * {@link onOpenReferences}(如打开引用文件 picker 并定位),阻断冒泡以免触发整行选中。\n */\nfunction MentionOpenReferencesButton({\n label,\n onOpenReferences,\n dataAttributeMode\n}: {\n label?: string;\n onOpenReferences: () => void;\n dataAttributeMode: MentionRowDataAttributeMode;\n}): React.JSX.Element {\n const resolvedLabel = label?.trim() || \"查看产物\";\n return (\n <span\n role=\"button\"\n tabIndex={-1}\n aria-label={resolvedLabel}\n title={resolvedLabel}\n className=\"rich-text-at-mention-row__open-references\"\n {...mentionRowDataAttribute(dataAttributeMode, \"openReferences\", \"true\")}\n onMouseDown={(event) => {\n event.preventDefault();\n event.stopPropagation();\n }}\n onClick={(event) => {\n event.preventDefault();\n event.stopPropagation();\n onOpenReferences();\n }}\n >\n {resolvedLabel}\n </span>\n );\n}\n\nfunction MentionNavigateIntoButton({\n label,\n onNavigateInto,\n dataAttributeMode\n}: {\n label?: string;\n onNavigateInto: () => void;\n dataAttributeMode: MentionRowDataAttributeMode;\n}): React.JSX.Element {\n return (\n <span\n role=\"button\"\n tabIndex={-1}\n aria-label={label}\n title={label}\n className=\"rich-text-at-mention-row__navigate-into\"\n {...mentionRowDataAttribute(dataAttributeMode, \"navigateInto\", \"true\")}\n onMouseDown={(event) => {\n event.preventDefault();\n event.stopPropagation();\n }}\n onClick={(event) => {\n event.preventDefault();\n event.stopPropagation();\n onNavigateInto();\n }}\n >\n <ArrowRightIcon size={16} />\n </span>\n );\n}\n\nfunction MentionFileRow({\n item,\n classNames,\n dataAttributeMode,\n navigateIntoLabel,\n onNavigateInto\n}: {\n item: MentionRowFileItem;\n classNames: Required<MentionRowClassNames>;\n dataAttributeMode: MentionRowDataAttributeMode;\n navigateIntoLabel?: string;\n onNavigateInto?: () => void;\n}): React.JSX.Element {\n return (\n <span\n className=\"rich-text-at-mention-row rich-text-at-mention-row--file\"\n {...mentionRowRootDataAttributes(dataAttributeMode, \"file\")}\n {...(item.entryKind\n ? mentionRowDataAttribute(\n dataAttributeMode,\n \"fileEntryKind\",\n item.entryKind\n )\n : {})}\n {...mentionRowDataAttribute(\n dataAttributeMode,\n \"fileVisualKind\",\n item.visualKind\n )}\n {...(item.mentionNavigation\n ? mentionRowDataAttribute(\n dataAttributeMode,\n \"navigation\",\n item.mentionNavigation\n )\n : {})}\n >\n <MentionFileIcon\n item={item}\n classNames={classNames}\n dataAttributeMode={dataAttributeMode}\n />\n <span className=\"rich-text-at-mention-row__file-text\">\n <span className=\"rich-text-at-mention-row__title\">{item.name}</span>\n </span>\n {item.childCountLabel ? (\n <span className=\"rich-text-at-mention-row__file-count\">\n {item.childCountLabel}\n </span>\n ) : null}\n {onNavigateInto ? (\n <MentionNavigateIntoButton\n label={navigateIntoLabel}\n onNavigateInto={onNavigateInto}\n dataAttributeMode={dataAttributeMode}\n />\n ) : null}\n </span>\n );\n}\n\nfunction MentionFileIcon({\n item,\n classNames,\n dataAttributeMode\n}: {\n item: MentionRowFileItem;\n classNames: Required<MentionRowClassNames>;\n dataAttributeMode: MentionRowDataAttributeMode;\n}): React.JSX.Element {\n const thumbnailUrl =\n item.visualKind === \"image\" ? item.thumbnailUrl?.trim() || \"\" : \"\";\n if (thumbnailUrl) {\n return (\n <span\n className={classNames.fileThumb}\n {...mentionRowDataAttribute(dataAttributeMode, \"fileThumb\", \"true\")}\n aria-hidden=\"true\"\n >\n <img\n src={thumbnailUrl}\n alt=\"\"\n className=\"rich-text-at-mention-row__media\"\n decoding=\"async\"\n loading=\"lazy\"\n draggable={false}\n />\n </span>\n );\n }\n\n // Back navigation always renders the ui-system back glyph so every surface\n // (including the agent composer's CSS-masked file icons) shares one source.\n if (item.visualKind === \"back\") {\n return (\n <span\n className={cn(\n classNames.fileIcon,\n \"rich-text-at-mention-file-icon--glyph\"\n )}\n {...mentionRowDataAttribute(\n dataAttributeMode,\n \"fileVisualKind\",\n item.visualKind\n )}\n aria-hidden=\"true\"\n >\n <ArrowLeftIcon size={16} />\n </span>\n );\n }\n\n // Surfaces that ship a custom file-icon stylesheet (e.g. the agent composer\n // via `agentactivity.css`) render the empty CSS-masked `<span>` so their DOM\n // stays byte-identical. Surfaces using the package default class have no such\n // stylesheet, so render a real ui-system kind glyph instead of an empty box.\n const usesDefaultFileIcon =\n classNames.fileIcon === DEFAULT_MENTION_ROW_CLASS_NAMES.fileIcon;\n if (usesDefaultFileIcon) {\n const Icon = MENTION_FILE_VISUAL_KIND_ICON[item.visualKind];\n return (\n <span\n className={cn(\n classNames.fileIcon,\n \"rich-text-at-mention-file-icon--glyph\"\n )}\n {...mentionRowDataAttribute(\n dataAttributeMode,\n \"fileVisualKind\",\n item.visualKind\n )}\n aria-hidden=\"true\"\n >\n <Icon size={16} />\n </span>\n );\n }\n\n return (\n <span\n className={classNames.fileIcon}\n {...mentionRowDataAttribute(\n dataAttributeMode,\n \"fileVisualKind\",\n item.visualKind\n )}\n aria-hidden=\"true\"\n />\n );\n}\n\nfunction MentionWorkspaceAppIcon({\n iconUrl,\n kindIconClassName,\n dataAttributeMode\n}: {\n iconUrl?: string | null;\n kindIconClassName: string;\n dataAttributeMode: MentionRowDataAttributeMode;\n}): React.JSX.Element {\n const normalizedIconUrl = iconUrl?.trim() ?? \"\";\n return (\n <span\n className=\"rich-text-at-mention-app-icon\"\n {...mentionRowDataAttribute(dataAttributeMode, \"appIcon\", \"true\")}\n data-workspace-app-icon=\"true\"\n aria-hidden=\"true\"\n >\n {normalizedIconUrl ? (\n <img\n src={normalizedIconUrl}\n alt=\"\"\n className=\"rich-text-at-mention-row__media\"\n decoding=\"async\"\n loading=\"lazy\"\n draggable={false}\n />\n ) : (\n <span\n className={cn(\n kindIconClassName,\n \"rich-text-at-mention-kind-icon--app\"\n )}\n />\n )}\n </span>\n );\n}\n\nfunction MentionSessionAvatarStack({\n item,\n classNames,\n dataAttributeMode\n}: {\n item: MentionRowSessionItem;\n classNames: Required<MentionRowClassNames>;\n dataAttributeMode: MentionRowDataAttributeMode;\n}): React.JSX.Element {\n const showUserAvatar = item.showUserAvatar !== false;\n if (!showUserAvatar) {\n return (\n <span\n className={cn(\n \"rich-text-at-mention-avatar-stack\",\n \"rich-text-at-mention-avatar-stack--agent-only\"\n )}\n aria-hidden=\"true\"\n >\n <span\n className=\"rich-text-at-mention-avatar rich-text-at-mention-avatar--agent\"\n {...mentionRowDataAttribute(dataAttributeMode, \"agentAvatar\", \"true\")}\n >\n <img\n src={item.agentIconUrl}\n alt=\"\"\n className=\"rich-text-at-mention-row__media\"\n decoding=\"async\"\n loading=\"lazy\"\n draggable={false}\n />\n </span>\n </span>\n );\n }\n\n const userAvatarUrl = item.userAvatarUrl?.trim() ?? \"\";\n const placeholderUrl = item.userAvatarPlaceholderUrl;\n const userImageUrl = userAvatarUrl || placeholderUrl;\n return (\n <span className=\"rich-text-at-mention-avatar-stack\" aria-hidden=\"true\">\n <span\n className=\"rich-text-at-mention-avatar rich-text-at-mention-avatar--user\"\n {...mentionRowDataAttribute(dataAttributeMode, \"userAvatar\", \"true\")}\n >\n <img\n src={userImageUrl}\n alt=\"\"\n className={cn(\n \"rich-text-at-mention-row__media\",\n !userAvatarUrl && classNames.avatarImgUserPlaceholder\n )}\n decoding=\"async\"\n loading=\"lazy\"\n referrerPolicy=\"no-referrer\"\n draggable={false}\n onError={(event) => {\n if (event.currentTarget.dataset.fallbackAvatarApplied === \"true\") {\n return;\n }\n event.currentTarget.dataset.fallbackAvatarApplied = \"true\";\n event.currentTarget.src = placeholderUrl;\n event.currentTarget.classList.add(\n classNames.avatarImgUserPlaceholder\n );\n }}\n />\n </span>\n <span\n className=\"rich-text-at-mention-avatar rich-text-at-mention-avatar--agent\"\n {...mentionRowDataAttribute(dataAttributeMode, \"agentAvatar\", \"true\")}\n >\n <img\n src={item.agentIconUrl}\n alt=\"\"\n className=\"rich-text-at-mention-row__media\"\n decoding=\"async\"\n loading=\"lazy\"\n draggable={false}\n />\n </span>\n </span>\n );\n}\n\nfunction MentionSessionTitle({\n item\n}: {\n item: MentionRowSessionItem;\n}): React.JSX.Element {\n return (\n <>\n <span className=\"rich-text-at-mention-row__entity-name rich-text-at-mention-row__session-participant\">\n {item.participant}\n </span>\n <span className=\"rich-text-at-mention-row__entity-description rich-text-at-mention-row__session-summary\">\n {item.summary ?? \"\"}\n </span>\n </>\n );\n}\n\nfunction MentionStatusBadge({\n statusTag,\n dataAttributeMode\n}: {\n statusTag: MentionRowStatusTag;\n dataAttributeMode: MentionRowDataAttributeMode;\n}): React.JSX.Element {\n if (statusTag.variant === \"issue\") {\n return (\n <Badge\n variant=\"secondary\"\n size=\"sm\"\n className={cn(\n \"rich-text-at-mention-status rich-text-at-mention-status--issue\",\n mentionStatusBadgeClassName({\n tone: statusTag.tone,\n variant: \"issue\"\n })\n )}\n {...mentionRowDataAttribute(dataAttributeMode, \"statusTag\", \"true\")}\n {...(statusTag.dataStatus\n ? { \"data-status\": statusTag.dataStatus }\n : {})}\n data-tone={statusTag.tone}\n >\n {statusTag.label}\n </Badge>\n );\n }\n\n return (\n <Badge\n variant=\"secondary\"\n size=\"sm\"\n className={cn(\n \"rich-text-at-mention-status rich-text-at-mention-status--activity\",\n mentionStatusBadgeClassName({\n tone: statusTag.tone,\n variant: \"activity\"\n })\n )}\n {...mentionRowDataAttribute(dataAttributeMode, \"statusTag\", \"true\")}\n {...(statusTag.dataStatus ? { \"data-status\": statusTag.dataStatus } : {})}\n data-tone={statusTag.tone}\n title={statusTag.label}\n >\n <StatusDot\n tone={statusTag.tone === \"purple\" ? \"neutral\" : statusTag.tone}\n pulse={statusTag.pulse ?? false}\n size=\"xs\"\n title={statusTag.label}\n />\n <span>{statusTag.label}</span>\n </Badge>\n );\n}\n","import type { MentionRowItem } from \"./mentionRowTypes.ts\";\n\nexport type MentionRowDataAttributeMode = \"shared\" | \"agent\";\n\nexport type MentionRowDataAttributeKey =\n | \"agentAvatar\"\n | \"appIcon\"\n | \"fileEntryKind\"\n | \"fileThumb\"\n | \"fileVisualKind\"\n | \"navigation\"\n | \"navigateInto\"\n | \"openReferences\"\n | \"statusTag\"\n | \"userAvatar\";\n\nconst MENTION_ROW_DATA_ATTRIBUTES: Record<\n MentionRowDataAttributeMode,\n Record<MentionRowDataAttributeKey, string>\n> = {\n shared: {\n agentAvatar: \"data-rich-text-at-mention-agent-avatar\",\n appIcon: \"data-rich-text-at-mention-app-icon\",\n fileEntryKind: \"data-rich-text-at-mention-file-entry-kind\",\n fileThumb: \"data-rich-text-at-mention-file-thumb\",\n fileVisualKind: \"data-rich-text-at-mention-file-visual-kind\",\n navigation: \"data-rich-text-at-mention-navigation\",\n navigateInto: \"data-rich-text-at-mention-navigate-into\",\n openReferences: \"data-rich-text-at-mention-open-references\",\n statusTag: \"data-rich-text-at-mention-status-tag\",\n userAvatar: \"data-rich-text-at-mention-user-avatar\"\n },\n agent: {\n agentAvatar: \"data-agent-mention-agent-avatar\",\n appIcon: \"data-agent-mention-app-icon\",\n fileEntryKind: \"data-agent-file-entry-kind\",\n fileThumb: \"data-agent-mention-file-thumb\",\n fileVisualKind: \"data-agent-file-visual-kind\",\n navigation: \"data-agent-mention-navigation\",\n navigateInto: \"data-agent-mention-navigate-into\",\n openReferences: \"data-agent-mention-open-references\",\n statusTag: \"data-agent-mention-status-tag\",\n userAvatar: \"data-agent-mention-user-avatar\"\n }\n};\n\nexport function mentionRowRootDataAttributes(\n mode: MentionRowDataAttributeMode,\n kind: MentionRowItem[\"kind\"]\n): Record<string, string> {\n return mode === \"agent\"\n ? {\n \"data-agent-file-mention\": \"true\",\n \"data-agent-mention-kind\": kind\n }\n : {\n \"data-rich-text-at-mention-row\": \"true\",\n \"data-rich-text-at-mention-kind\": kind\n };\n}\n\nexport function mentionRowDataAttribute(\n mode: MentionRowDataAttributeMode,\n key: MentionRowDataAttributeKey,\n value: string\n): Record<string, string> {\n return {\n [MENTION_ROW_DATA_ATTRIBUTES[mode][key]]: value\n };\n}\n","import React, { type CSSProperties } from \"react\";\nimport type { MentionFileVisualKind } from \"./mentionFileVisualKind.ts\";\n\nexport type MentionReferenceProviderKind =\n | \"agent-generated-file\"\n | \"agent-session\"\n | \"file\"\n | \"workspace-app\"\n | \"workspace-issue\"\n | \"generic\";\n\nexport interface MentionReferenceLeadingInput {\n className?: string;\n fileVisualKind?: MentionFileVisualKind;\n iconUrl?: string | null;\n imageClassName?: string;\n kind: MentionReferenceProviderKind;\n label?: string | null;\n thumbnailUrl?: string | null;\n}\n\nconst REFERENCE_LEADING_STYLE = {\n alignItems: \"center\",\n background: \"var(--bg-block, var(--block, #0000000a))\",\n borderRadius: \"8px\",\n color: \"var(--rich-text-at-mention-text-secondary, currentColor)\",\n display: \"inline-grid\",\n flex: \"0 0 32px\",\n height: \"32px\",\n justifyItems: \"center\",\n overflow: \"hidden\",\n width: \"32px\"\n} as const satisfies CSSProperties;\n\nconst REFERENCE_IMAGE_STYLE = {\n display: \"block\",\n height: \"100%\",\n objectFit: \"cover\",\n width: \"100%\"\n} as const satisfies CSSProperties;\n\nconst REFERENCE_ICON_STYLE = {\n display: \"block\",\n height: \"18px\",\n width: \"18px\"\n} as const satisfies CSSProperties;\n\nexport function resolveMentionReferenceImageUrl(input: {\n iconUrl?: string | null;\n thumbnailUrl?: string | null;\n}): string | undefined {\n return input.thumbnailUrl?.trim() || input.iconUrl?.trim() || undefined;\n}\n\nexport function renderMentionReferenceLeading(\n input: MentionReferenceLeadingInput\n): React.JSX.Element {\n const imageUrl = resolveMentionReferenceImageUrl(input);\n return React.createElement(\n \"span\",\n {\n \"aria-hidden\": \"true\",\n className: input.className,\n \"data-rich-text-at-mention-reference-kind\": input.kind,\n \"data-rich-text-at-mention-reference-leading\": \"true\",\n style: REFERENCE_LEADING_STYLE\n },\n imageUrl\n ? React.createElement(\"img\", {\n alt: \"\",\n className: input.imageClassName,\n decoding: \"async\",\n draggable: false,\n loading: \"lazy\",\n src: imageUrl,\n style: REFERENCE_IMAGE_STYLE\n })\n : renderMentionReferenceFallbackIcon(input)\n );\n}\n\nfunction renderMentionReferenceFallbackIcon(\n input: Pick<MentionReferenceLeadingInput, \"fileVisualKind\" | \"kind\">\n): React.JSX.Element {\n return React.createElement(\n \"svg\",\n {\n \"aria-hidden\": \"true\",\n fill: \"none\",\n stroke: \"currentColor\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n strokeWidth: 1.8,\n style: REFERENCE_ICON_STYLE,\n viewBox: \"0 0 24 24\"\n },\n ...referenceIconPaths(input)\n );\n}\n\nfunction referenceIconPaths(\n input: Pick<MentionReferenceLeadingInput, \"fileVisualKind\" | \"kind\">\n): React.ReactNode[] {\n if (input.kind === \"workspace-app\") {\n return [\n React.createElement(\"rect\", {\n height: 7,\n key: \"a\",\n rx: 1.5,\n width: 7,\n x: 4,\n y: 4\n }),\n React.createElement(\"rect\", {\n height: 7,\n key: \"b\",\n rx: 1.5,\n width: 7,\n x: 13,\n y: 4\n }),\n React.createElement(\"rect\", {\n height: 7,\n key: \"c\",\n rx: 1.5,\n width: 7,\n x: 4,\n y: 13\n }),\n React.createElement(\"rect\", {\n height: 7,\n key: \"d\",\n rx: 1.5,\n width: 7,\n x: 13,\n y: 13\n })\n ];\n }\n if (input.kind === \"workspace-issue\") {\n return [\n React.createElement(\"circle\", { cx: 12, cy: 12, key: \"a\", r: 8 }),\n React.createElement(\"path\", { d: \"M8.5 12.5 11 15l4.5-5\", key: \"b\" })\n ];\n }\n if (input.kind === \"agent-session\") {\n return [\n React.createElement(\"path\", {\n d: \"M6 9.5a5 5 0 0 1 5-5h2a5 5 0 0 1 5 5v2.5a5 5 0 0 1-5 5h-1.5L8 19v-2.4A5 5 0 0 1 6 12z\",\n key: \"a\"\n })\n ];\n }\n if (\n input.kind === \"file\" ||\n input.kind === \"agent-generated-file\" ||\n input.fileVisualKind != null\n ) {\n if (input.fileVisualKind === \"folder\" || input.fileVisualKind === \"back\") {\n return [\n React.createElement(\"path\", {\n d: \"M3.5 7.5h6l2 2h9v8a2 2 0 0 1-2 2h-13a2 2 0 0 1-2-2z\",\n key: \"a\"\n })\n ];\n }\n if (input.fileVisualKind === \"image\") {\n return [\n React.createElement(\"rect\", {\n height: 14,\n key: \"a\",\n rx: 2,\n width: 16,\n x: 4,\n y: 5\n }),\n React.createElement(\"path\", {\n d: \"m7 16 3.5-3.5 2.5 2.5 2-2 2 3\",\n key: \"b\"\n }),\n React.createElement(\"circle\", { cx: 9, cy: 9, key: \"c\", r: 1 })\n ];\n }\n if (input.fileVisualKind === \"video\") {\n return [\n React.createElement(\"rect\", {\n height: 14,\n key: \"a\",\n rx: 2,\n width: 16,\n x: 4,\n y: 5\n }),\n React.createElement(\"path\", {\n d: \"m10 9 5 3-5 3z\",\n key: \"b\"\n })\n ];\n }\n return [\n React.createElement(\"path\", {\n d: \"M7 3.5h7l4 4V20a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V4.5a1 1 0 0 1 1-1z\",\n key: \"a\"\n }),\n React.createElement(\"path\", { d: \"M14 3.5v4h4\", key: \"b\" })\n ];\n }\n return [\n React.createElement(\"path\", {\n d: \"M9.5 14.5 14.5 9.5\",\n key: \"a\"\n }),\n React.createElement(\"path\", {\n d: \"M8.5 10.5 7 12a3.5 3.5 0 0 0 5 5l1.5-1.5\",\n key: \"b\"\n }),\n React.createElement(\"path\", {\n d: \"M15.5 13.5 17 12a3.5 3.5 0 0 0-5-5l-1.5 1.5\",\n key: \"c\"\n })\n ];\n}\n","import type { ReactNode } from \"react\";\nimport {\n resolveMentionFileThumbnailUrl,\n resolveMentionFileVisualKind,\n type MentionFileVisualKind\n} from \"./mentionFileVisualKind.ts\";\nimport {\n renderMentionReferenceLeading,\n type MentionReferenceProviderKind\n} from \"./mentionReferenceIcon.ts\";\nimport type {\n MentionRowItem,\n MentionRowPlainItem,\n MentionRowStatusTag\n} from \"./mentionRowTypes.ts\";\nimport type {\n MentionRowStatusTone,\n MentionRowStatusVariant\n} from \"./mentionStatusTone.ts\";\nimport type {\n RichTextMentionPresentation,\n RichTextTriggerQueryMatch\n} from \"../types/index.ts\";\n\nexport type MentionTriggerRowProviderId =\n | \"agent-generated-file\"\n | \"agent-session\"\n | \"file\"\n | \"workspace-app\"\n | \"workspace-issue\";\n\nexport interface MentionTriggerRowLeadingContext<\n TMatch extends RichTextTriggerQueryMatch = RichTextTriggerQueryMatch\n> {\n description: string | null;\n fileVisualKind?: MentionFileVisualKind;\n iconUrl: string | null;\n label: string;\n match: TMatch;\n providerKind: MentionReferenceProviderKind;\n thumbnailUrl: string | null;\n}\n\nexport interface MentionTriggerRowItemOptions<\n TMatch extends RichTextTriggerQueryMatch = RichTextTriggerQueryMatch\n> {\n getAgentIconUrl?: (match: TMatch) => string | null | undefined;\n getChildCountLabel?: (match: TMatch) => string | null | undefined;\n getDescription?: (match: TMatch) => string | null | undefined;\n getFileEntryKind?: (match: TMatch) => string | null | undefined;\n getFileMentionNavigation?: (match: TMatch) => string | null | undefined;\n getFileThumbnailUrl?: (match: TMatch) => string | null | undefined;\n getFileVisualKind?: (\n match: TMatch\n ) => MentionFileVisualKind | null | undefined;\n getStatusTag?: (\n match: TMatch,\n variant: MentionRowStatusVariant\n ) => MentionRowStatusTag | null | undefined;\n getUserAvatarPlaceholderUrl?: (match: TMatch) => string | null | undefined;\n getUserAvatarUrl?: (match: TMatch) => string | null | undefined;\n getWorkspaceAppIconFallbackUrl?: (match: TMatch) => string | null | undefined;\n renderLeading?: (\n context: MentionTriggerRowLeadingContext<TMatch>\n ) => ReactNode | undefined;\n}\n\nconst SUPPORTED_MENTION_TRIGGER_ROW_PROVIDER_IDS = new Set<string>([\n \"agent-generated-file\",\n \"agent-session\",\n \"file\",\n \"workspace-app\",\n \"workspace-issue\"\n]);\n\nexport function richTextTriggerQueryMatchToMentionRowItem<\n TMatch extends RichTextTriggerQueryMatch = RichTextTriggerQueryMatch\n>(\n match: TMatch,\n options: MentionTriggerRowItemOptions<TMatch> = {}\n): MentionRowItem {\n const presentation = mentionPresentation(match);\n const label = resolveMentionRowLabel(match);\n const description = resolveMentionRowDescription(match, options);\n const providerKind = mentionReferenceProviderKind(match.providerId);\n const iconUrl = resolveMentionRowIconUrl(match, presentation, options);\n const thumbnailUrl = resolveMentionRowThumbnailUrl(\n match,\n presentation,\n options\n );\n const fileVisualKind = isFileMentionProvider(match.providerId)\n ? resolveMentionRowFileVisualKind(match, options)\n : undefined;\n const customLeading = options.renderLeading?.({\n description,\n fileVisualKind,\n iconUrl,\n label,\n match,\n providerKind,\n thumbnailUrl\n });\n\n if (customLeading !== undefined) {\n return mentionRowPlainItem({\n description,\n label,\n leading: customLeading\n });\n }\n\n if (match.providerId === \"workspace-app\") {\n return {\n kind: \"app\",\n description,\n iconUrl,\n name: label\n };\n }\n\n if (match.providerId === \"workspace-issue\") {\n return {\n kind: \"issue\",\n creatorName: description,\n statusTag: resolveMentionRowStatusTag(match, \"issue\", options),\n title: label\n };\n }\n\n if (isFileMentionProvider(match.providerId)) {\n const entryKind = resolveFileEntryKind(match, options);\n const mentionNavigation = resolveFileMentionNavigation(match, options);\n const visualKind = fileVisualKind ?? \"document\";\n return {\n kind: \"file\",\n childCountLabel: normalizedText(options.getChildCountLabel?.(match)),\n entryKind,\n mentionNavigation,\n name: label,\n thumbnailUrl:\n resolveMentionFileThumbnailUrl({\n thumbnailUrl,\n visualKind\n }) ?? null,\n visualKind\n };\n }\n\n if (match.providerId === \"agent-session\") {\n const session = agentSessionMentionRowItem(match, {\n description,\n iconUrl,\n options,\n presentation\n });\n if (session) {\n return session;\n }\n }\n\n return mentionRowPlainItem({\n description,\n label,\n leading: renderMentionReferenceLeading({\n fileVisualKind,\n iconUrl,\n kind: providerKind,\n label,\n thumbnailUrl\n })\n });\n}\n\nexport function isMentionTriggerRowProviderId(\n providerId: string\n): providerId is MentionTriggerRowProviderId {\n return SUPPORTED_MENTION_TRIGGER_ROW_PROVIDER_IDS.has(providerId);\n}\n\nexport function workspaceAppIconFallbackUrlFromTriggerMatch(\n match: RichTextTriggerQueryMatch\n): string | null {\n const appId = mentionEntityId(match) || match.key.trim();\n if (!appId) {\n return null;\n }\n return `tutti://workspace-apps/${encodeURIComponent(appId)}/icon.png`;\n}\n\nexport function mentionRowStatusTagFromPresentation(\n match: RichTextTriggerQueryMatch,\n input: {\n tone?: MentionRowStatusTone;\n variant: MentionRowStatusVariant;\n }\n): MentionRowStatusTag | null {\n const presentation = mentionPresentation(match);\n const label = normalizedText(presentation?.statusLabel);\n if (!label) {\n return null;\n }\n const dataStatus =\n normalizedText(presentation?.statusDataStatus) ??\n normalizedText(presentation?.status);\n return {\n dataStatus: dataStatus ?? undefined,\n label,\n pulse: presentation?.statusPulse === \"true\",\n tone: input.tone ?? \"neutral\",\n variant: input.variant\n };\n}\n\nfunction agentSessionMentionRowItem<TMatch extends RichTextTriggerQueryMatch>(\n match: TMatch,\n input: {\n description: string | null;\n iconUrl: string | null;\n options: MentionTriggerRowItemOptions<TMatch>;\n presentation: RichTextMentionPresentation | null;\n }\n): MentionRowItem | null {\n const agentIconUrl =\n normalizedText(input.options.getAgentIconUrl?.(match)) ??\n normalizedText(input.presentation?.agentIconUrl) ??\n input.iconUrl;\n const userAvatarPlaceholderUrl =\n normalizedText(input.options.getUserAvatarPlaceholderUrl?.(match)) ??\n normalizedText(input.presentation?.userAvatarPlaceholderUrl);\n if (!agentIconUrl || !userAvatarPlaceholderUrl) {\n return null;\n }\n return {\n kind: \"session\",\n agentIconUrl,\n participant:\n normalizedText(input.presentation?.participant) ??\n resolveMentionRowLabel(match),\n statusTag: resolveMentionRowStatusTag(match, \"activity\", input.options),\n summary: input.description,\n userAvatarPlaceholderUrl,\n userAvatarUrl:\n normalizedText(input.options.getUserAvatarUrl?.(match)) ?? null\n };\n}\n\nfunction mentionRowPlainItem(input: {\n description: string | null;\n label: string;\n leading?: ReactNode;\n}): MentionRowPlainItem {\n return {\n kind: \"plain\",\n description: input.description,\n label: input.label,\n leading: input.leading\n };\n}\n\nfunction resolveMentionRowLabel(match: RichTextTriggerQueryMatch): string {\n return (\n normalizedText(\n match.insertResult.kind === \"mention\"\n ? match.insertResult.mention.label\n : match.insertResult.kind === \"markdown-link\"\n ? match.insertResult.label\n : undefined\n ) ??\n normalizedText(match.label) ??\n match.key\n );\n}\n\nfunction resolveMentionRowDescription<TMatch extends RichTextTriggerQueryMatch>(\n match: TMatch,\n options: Pick<MentionTriggerRowItemOptions<TMatch>, \"getDescription\">\n): string | null {\n const presentation = mentionPresentation(match);\n return (\n normalizedText(options.getDescription?.(match)) ??\n normalizedText(presentation?.description) ??\n normalizedText(presentation?.subtitle) ??\n normalizedText(match.subtitle) ??\n null\n );\n}\n\nfunction resolveMentionRowIconUrl<TMatch extends RichTextTriggerQueryMatch>(\n match: TMatch,\n presentation: RichTextMentionPresentation | null,\n options: Pick<\n MentionTriggerRowItemOptions<TMatch>,\n \"getWorkspaceAppIconFallbackUrl\"\n >\n): string | null {\n return (\n normalizedText(presentation?.iconUrl) ??\n normalizedText(match.iconUrl) ??\n (match.providerId === \"workspace-app\"\n ? (normalizedText(options.getWorkspaceAppIconFallbackUrl?.(match)) ??\n workspaceAppIconFallbackUrlFromTriggerMatch(match))\n : null) ??\n null\n );\n}\n\nfunction resolveMentionRowThumbnailUrl<\n TMatch extends RichTextTriggerQueryMatch\n>(\n match: TMatch,\n presentation: RichTextMentionPresentation | null,\n options: Pick<MentionTriggerRowItemOptions<TMatch>, \"getFileThumbnailUrl\">\n): string | null {\n return (\n normalizedText(options.getFileThumbnailUrl?.(match)) ??\n normalizedText(presentation?.thumbnailUrl) ??\n normalizedText(readStringProperty(match.item, \"thumbnailUrl\")) ??\n (isFileMentionProvider(match.providerId)\n ? normalizedText(match.iconUrl)\n : null) ??\n null\n );\n}\n\nfunction resolveMentionRowFileVisualKind<\n TMatch extends RichTextTriggerQueryMatch\n>(\n match: TMatch,\n options: Pick<\n MentionTriggerRowItemOptions<TMatch>,\n \"getFileEntryKind\" | \"getFileMentionNavigation\" | \"getFileVisualKind\"\n >\n): MentionFileVisualKind {\n const override = options.getFileVisualKind?.(match);\n if (override) {\n return override;\n }\n return resolveMentionFileVisualKind({\n baseVisualKind: inferMentionFileVisualKind(\n markdownLinkHref(match) ??\n normalizedText(match.subtitle) ??\n normalizedText(match.label) ??\n match.key\n ),\n entryKind: resolveFileEntryKind(match, options),\n mentionNavigation: resolveFileMentionNavigation(match, options)\n });\n}\n\nfunction resolveMentionRowStatusTag<TMatch extends RichTextTriggerQueryMatch>(\n match: TMatch,\n variant: MentionRowStatusVariant,\n options: Pick<MentionTriggerRowItemOptions<TMatch>, \"getStatusTag\">\n): MentionRowStatusTag | null {\n return (\n options.getStatusTag?.(match, variant) ??\n mentionRowStatusTagFromPresentation(match, { variant })\n );\n}\n\nfunction resolveFileEntryKind<TMatch extends RichTextTriggerQueryMatch>(\n match: TMatch,\n options: Pick<MentionTriggerRowItemOptions<TMatch>, \"getFileEntryKind\">\n): string | null {\n return (\n normalizedText(options.getFileEntryKind?.(match)) ??\n normalizedText(readStringProperty(match.item, \"entryKind\")) ??\n normalizedText(readStringProperty(match.item, \"kind\")) ??\n null\n );\n}\n\nfunction resolveFileMentionNavigation<TMatch extends RichTextTriggerQueryMatch>(\n match: TMatch,\n options: Pick<\n MentionTriggerRowItemOptions<TMatch>,\n \"getFileMentionNavigation\"\n >\n): string | null {\n return (\n normalizedText(options.getFileMentionNavigation?.(match)) ??\n normalizedText(readStringProperty(match.item, \"mentionNavigation\")) ??\n null\n );\n}\n\nfunction mentionReferenceProviderKind(\n providerId: string\n): MentionReferenceProviderKind {\n if (providerId === \"workspace-app\") {\n return \"workspace-app\";\n }\n if (providerId === \"workspace-issue\") {\n return \"workspace-issue\";\n }\n if (providerId === \"agent-session\") {\n return \"agent-session\";\n }\n if (providerId === \"agent-generated-file\") {\n return \"agent-generated-file\";\n }\n if (providerId === \"file\") {\n return \"file\";\n }\n return \"generic\";\n}\n\nfunction isFileMentionProvider(providerId: string): boolean {\n return providerId === \"file\" || providerId === \"agent-generated-file\";\n}\n\nfunction mentionPresentation(\n match: RichTextTriggerQueryMatch\n): RichTextMentionPresentation | null {\n return match.insertResult.kind === \"mention\"\n ? (match.insertResult.mention.presentation ?? null)\n : null;\n}\n\nfunction mentionEntityId(match: RichTextTriggerQueryMatch): string | null {\n return match.insertResult.kind === \"mention\"\n ? (normalizedText(match.insertResult.mention.entityId) ?? null)\n : null;\n}\n\nfunction markdownLinkHref(match: RichTextTriggerQueryMatch): string | null {\n return match.insertResult.kind === \"markdown-link\"\n ? (normalizedText(match.insertResult.href) ?? null)\n : null;\n}\n\nfunction inferMentionFileVisualKind(pathOrName: string): MentionFileVisualKind {\n const normalized = pathOrName.trim().toLowerCase();\n if (!normalized) {\n return \"document\";\n }\n if (normalized.endsWith(\"/\")) {\n return \"folder\";\n }\n const extension = normalized.match(/\\.([a-z0-9]+)(?:[?#].*)?$/)?.[1] ?? \"\";\n if (\n [\"apng\", \"avif\", \"gif\", \"jpeg\", \"jpg\", \"png\", \"svg\", \"webp\"].includes(\n extension\n )\n ) {\n return \"image\";\n }\n if ([\"avi\", \"m4v\", \"mkv\", \"mov\", \"mp4\", \"webm\"].includes(extension)) {\n return \"video\";\n }\n if ([\"markdown\", \"md\", \"mdx\"].includes(extension)) {\n return \"markdown\";\n }\n if (\n [\n \"c\",\n \"cpp\",\n \"css\",\n \"go\",\n \"h\",\n \"hpp\",\n \"html\",\n \"java\",\n \"js\",\n \"jsx\",\n \"json\",\n \"kt\",\n \"php\",\n \"py\",\n \"rb\",\n \"rs\",\n \"sh\",\n \"sql\",\n \"swift\",\n \"toml\",\n \"ts\",\n \"tsx\",\n \"xml\",\n \"yaml\",\n \"yml\"\n ].includes(extension)\n ) {\n return \"code\";\n }\n return \"document\";\n}\n\nfunction readStringProperty(value: unknown, key: string): string | undefined {\n if (value === null || typeof value !== \"object\") {\n return undefined;\n }\n const record = value as Readonly<Record<string, unknown>>;\n return typeof record[key] === \"string\" ? record[key] : undefined;\n}\n\nfunction normalizedText(value: string | null | undefined): string | null {\n const normalized = value?.trim() ?? \"\";\n return normalized || null;\n}\n","export interface AtPanelKeyboardActions {\n moveSelection: (delta: 1 | -1) => void;\n commitSelection: () => void;\n close: () => void;\n cycleFilter?: (delta: 1 | -1) => void;\n navigateHierarchy?: (delta: 1 | -1) => boolean;\n}\n\nexport interface AtPanelKeyboardEventLike {\n key: string;\n shiftKey?: boolean;\n preventDefault: () => void;\n}\n\nexport function makeAtPanelKeyDown(actions: AtPanelKeyboardActions) {\n return (event: AtPanelKeyboardEventLike): boolean => {\n if (event.key === \"ArrowDown\") {\n event.preventDefault();\n actions.moveSelection(1);\n return true;\n }\n if (event.key === \"ArrowUp\") {\n event.preventDefault();\n actions.moveSelection(-1);\n return true;\n }\n if (event.key === \"Escape\") {\n event.preventDefault();\n actions.close();\n return true;\n }\n if (event.key === \"Tab\" && actions.cycleFilter) {\n event.preventDefault();\n actions.cycleFilter(event.shiftKey ? -1 : 1);\n return true;\n }\n if (event.key === \"ArrowRight\" && actions.navigateHierarchy) {\n if (actions.navigateHierarchy(1)) {\n event.preventDefault();\n return true;\n }\n return false;\n }\n if (event.key === \"ArrowLeft\" && actions.navigateHierarchy) {\n if (actions.navigateHierarchy(-1)) {\n event.preventDefault();\n return true;\n }\n return false;\n }\n if (event.key === \"Enter\") {\n event.preventDefault();\n actions.commitSelection();\n return true;\n }\n return false;\n };\n}\n\nexport function useAtPanelKeyboard(actions: AtPanelKeyboardActions) {\n return makeAtPanelKeyDown(actions);\n}\n"],"mappings":";;;;;;;;;;;;;AAAA;AAAA,EACE,aAAAA;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC;AAAA,OAKK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,qBAAqB;AAC9B,SAAS,MAAAC,WAAU;;;ACdnB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AACP,SAAS,UAAU;AA2NR;AA5MX,IAAM,6CAA6C;AACnD,IAAM,yCAAuE;AAAA,EAC3E,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,UAAU;AACZ;AAEO,SAAS,wBAAwB;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAKgB;AACd;AACA,QAAM,WAAW,OAA8B,IAAI;AACnD,QAAM,eAAe,OAAgD,IAAI;AACzE,QAAM,CAAC,gBAAgB,iBAAiB,IACtC,SAAuC;AAAA,IACrC,YAAY;AAAA,IACZ,aAAa;AAAA,IACb,UAAU;AAAA,EACZ,CAAC;AACH,QAAM,CAAC,UAAU,WAAW,IAAI,SAAS,KAAK;AAE9C,QAAM,gBAAgB,YAAY,MAAY;AAC5C;AAAA,MAAkB,CAAC,aACjB,SAAS,cACT,SAAS,gBAAgB,KACzB,SAAS,aAAa,IAClB,yCACA;AAAA,IACN;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,QAAM,qBAAqB,YAAY,MAAY;AACjD,UAAM,iBAAiB,cAAc;AACrC,QAAI,CAAC,gBAAgB;AACnB,oBAAc;AACd;AAAA,IACF;AAEA,UAAM,EAAE,cAAc,WAAW,aAAa,IAAI;AAClD,UAAM,sBAAsB,SAAS,SAAS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ACd,aAAO;AAAA,IACT;AACA,QAAI,MAAM,QAAQ,SAAS,QAAQ,aAAa;AAC9C,YAAM,eAAe;AACrB,cAAQ,YAAY,MAAM,WAAW,KAAK,CAAC;AAC3C,aAAO;AAAA,IACT;AACA,QAAI,MAAM,QAAQ,gBAAgB,QAAQ,mBAAmB;AAC3D,UAAI,QAAQ,kBAAkB,CAAC,GAAG;AAChC,cAAM,eAAe;AACrB,eAAO;AAAA,MACT;AACA,aAAO;AAAA,IACT;AACA,QAAI,MAAM,QAAQ,eAAe,QAAQ,mBAAmB;AAC1D,UAAI,QAAQ,kBAAkB,EAAE,GAAG;AACjC,cAAM,eAAe;AACrB,eAAO;AAAA,MACT;AACA,aAAO;AAAA,IACT;AACA,QAAI,MAAM,QAAQ,SAAS;AACzB,YAAM,eAAe;AACrB,cAAQ,gBAAgB;AACxB,aAAO;AAAA,IACT;AACA,WAAO;AAAA,EACT;AACF;AAEO,SAAS,mBAAmB,SAAiC;AAClE,SAAO,mBAAmB,OAAO;AACnC;","names":["useEffect","useRef","useState","cn","jsx","cn","useRef","useState","useEffect","jsx","jsx","jsxs","cn","Fragment","jsx","jsxs","cn"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/at-panel/mentionPaletteEntries.ts","../src/at-panel/mentionPaletteModel.ts","../src/at-panel/mentionStatusTone.ts","../src/at-panel/mentionFileVisualKind.ts"],"sourcesContent":["import type {\n MentionPaletteEntry,\n MentionPaletteState\n} from \"./mentionPaletteTypes.ts\";\n\n/**\n * Returns true when the group list reflects a *resolved* answer for the\n * active category — either because a group has interactive content, or\n * because a group is present with an explicit `emptyLabel` (i.e. \"we looked,\n * there is nothing here\", as opposed to \"we haven't looked yet\"). Groups\n * with no items, no `hasMore`, and no `emptyLabel` are placeholders for\n * content that hasn't loaded, not a genuinely empty category.\n */\nfunction hasResolvedGroupData<TItem>(\n groups: MentionPaletteState<TItem>[\"groups\"]\n): boolean {\n return groups.some(\n (group) =>\n group.items.length > 0 || group.hasMore || group.emptyLabel != null\n );\n}\n\n/**\n * Flatten the palette state into a stable, ordered list of navigable entries.\n *\n * Mirrors the ordering and key format of `flattenAgentMentionPaletteEntries`\n * from AgentFileMentionPalette.tsx, but is generic over item type.\n *\n * Key formats:\n * category entry → `category:<categoryId>`\n * item entry → `<groupId>:<getItemKey(item, groupId)>`\n * expand entry → `expand:<groupId>`\n */\nexport function flattenMentionPaletteEntries<TItem>(\n state: MentionPaletteState<TItem>,\n getItemKey: (item: TItem, groupId: string) => string\n): MentionPaletteEntry[] {\n // Browse mode with no resolved group content → show category nav only.\n // This only applies while the active category truly has no answer yet\n // (e.g. still loading). A category that has resolved to \"structurally\n // empty\" (a group carrying an `emptyLabel`, like \"No tasks yet\") falls\n // through to the loop below, which naturally yields zero entries —\n // signalling callers (e.g. the composer's Enter handler) that there is\n // nothing to select, rather than re-surfacing the already-active category\n // as though it still needed picking.\n if (state.mode === \"browse\" && !hasResolvedGroupData(state.groups)) {\n return state.categories.map((category) => ({\n key: `category:${category.id}`,\n type: \"category\" as const,\n categoryId: category.id\n }));\n }\n\n const entries: MentionPaletteEntry[] = [];\n\n for (const group of state.groups) {\n group.items.forEach((item, index) => {\n entries.push({\n key: `${group.id}:${getItemKey(item, group.id)}`,\n type: \"item\",\n groupId: group.id,\n itemIndex: index\n });\n });\n\n if (group.hasMore) {\n entries.push({\n key: `expand:${group.id}`,\n type: \"expand\",\n groupId: group.id\n });\n }\n }\n\n return entries;\n}\n","import type {\n MentionPaletteCategory,\n MentionPaletteEntry,\n MentionPaletteGroup,\n MentionPaletteState\n} from \"./mentionPaletteTypes.ts\";\nimport { flattenMentionPaletteEntries } from \"./mentionPaletteEntries.ts\";\nimport type { RichTextTriggerQueryMatch } from \"../types/trigger.ts\";\n\nexport interface MentionPaletteModelInput<TItem> {\n activeCategoryId: string;\n categories: readonly MentionPaletteCategory[];\n groups: readonly MentionPaletteGroup<TItem>[];\n loading: boolean;\n query?: string;\n mode?: \"browse\" | \"results\";\n}\n\nexport interface MentionPaletteSectionConfig<\n TMatch extends RichTextTriggerQueryMatch = RichTextTriggerQueryMatch\n> {\n id: string;\n label?: string;\n providerIds?: readonly string[];\n matches?: (match: TMatch) => boolean;\n emptyLabel?: string;\n}\n\nexport interface MentionPaletteCategoryConfig<\n TMatch extends RichTextTriggerQueryMatch = RichTextTriggerQueryMatch\n> {\n id: string;\n label: string;\n providerIds?: readonly string[];\n matches?: (match: TMatch) => boolean;\n emptyLabel?: string;\n sections?: readonly MentionPaletteSectionConfig<TMatch>[];\n}\n\nexport function mentionPaletteGroup<TItem>(input: {\n id: string;\n label?: string;\n items: readonly TItem[];\n emptyLabel?: string;\n}): MentionPaletteGroup<TItem> {\n return {\n id: input.id,\n label: input.label,\n items: input.items,\n totalCount: input.items.length,\n visibleCount: input.items.length,\n hasMore: false,\n emptyLabel: input.emptyLabel\n };\n}\n\nexport function mentionPaletteExpandLabel<TItem>(\n group: Pick<\n MentionPaletteGroup<TItem>,\n | \"expandErrorLabel\"\n | \"expandLabel\"\n | \"expandLoadingLabel\"\n | \"expandStatus\"\n | \"totalCount\"\n | \"visibleCount\"\n >\n): string {\n const fallbackLabel =\n group.expandLabel ??\n `+${Math.max(0, group.totalCount - group.visibleCount)}`;\n if (group.expandStatus === \"loading\") {\n return group.expandLoadingLabel ?? fallbackLabel;\n }\n if (group.expandStatus === \"error\") {\n return group.expandErrorLabel ?? fallbackLabel;\n }\n return fallbackLabel;\n}\n\nexport function buildMentionPaletteModel<TItem>(\n input: MentionPaletteModelInput<TItem>\n): MentionPaletteState<TItem> {\n return {\n status: input.loading ? \"loading\" : \"ready\",\n query: input.query ?? \"\",\n mode: input.mode ?? \"results\",\n filter: input.activeCategoryId,\n categories: input.categories,\n groups: input.groups,\n error: null\n };\n}\n\nexport function buildMentionPaletteModelFromTriggerMatches<\n TMatch extends RichTextTriggerQueryMatch = RichTextTriggerQueryMatch\n>(input: {\n activeCategoryId: string;\n categories: readonly MentionPaletteCategoryConfig<TMatch>[];\n matches: readonly TMatch[];\n loading: boolean;\n query?: string;\n mode?: \"browse\" | \"results\";\n}): MentionPaletteState<TMatch> {\n const categories = input.categories.map((category) => ({\n id: category.id,\n label: category.label\n }));\n const activeCategory =\n input.categories.find(\n (category) => category.id === input.activeCategoryId\n ) ??\n input.categories[0] ??\n null;\n const groups =\n activeCategory === null\n ? []\n : buildMentionPaletteGroupsForCategory(activeCategory, input.matches);\n\n return buildMentionPaletteModel({\n activeCategoryId: activeCategory?.id ?? input.activeCategoryId,\n categories,\n groups,\n loading: input.loading,\n query: input.query,\n mode: input.mode\n });\n}\n\nfunction buildMentionPaletteGroupsForCategory<\n TMatch extends RichTextTriggerQueryMatch\n>(\n category: MentionPaletteCategoryConfig<TMatch>,\n matches: readonly TMatch[]\n): MentionPaletteGroup<TMatch>[] {\n const categoryMatches = matches.filter((match) =>\n mentionPaletteConfigMatches(category, match)\n );\n if (!category.sections?.length) {\n if (categoryMatches.length === 0 && category.emptyLabel == null) {\n return [];\n }\n return [\n mentionPaletteGroup({\n id: category.id,\n items: categoryMatches,\n emptyLabel: category.emptyLabel\n })\n ];\n }\n\n const sectionItems = new Map<string, TMatch[]>(\n category.sections.map((section) => [section.id, []])\n );\n for (const match of categoryMatches) {\n const section = category.sections.find((candidate) =>\n mentionPaletteConfigMatches(candidate, match)\n );\n if (!section) {\n continue;\n }\n sectionItems.get(section.id)?.push(match);\n }\n\n return category.sections\n .map((section) => {\n const items = sectionItems.get(section.id) ?? [];\n if (items.length === 0 && section.emptyLabel == null) {\n return null;\n }\n return mentionPaletteGroup({\n id: section.id,\n label: section.label,\n items,\n emptyLabel: section.emptyLabel\n });\n })\n .filter((group): group is MentionPaletteGroup<TMatch> => group !== null);\n}\n\nfunction mentionPaletteConfigMatches<TMatch extends RichTextTriggerQueryMatch>(\n config: {\n providerIds?: readonly string[];\n matches?: (match: TMatch) => boolean;\n },\n match: TMatch\n): boolean {\n if (\n config.providerIds != null &&\n !config.providerIds.includes(match.providerId)\n ) {\n return false;\n }\n return config.matches?.(match) ?? true;\n}\n\nexport function moveMentionPaletteHighlight<TItem>(input: {\n state: MentionPaletteState<TItem>;\n currentKey: string | null;\n delta: 1 | -1;\n getItemKey: (item: TItem, groupId: string) => string;\n}): string | null {\n const entries = flattenMentionPaletteEntries(\n input.state,\n input.getItemKey\n ).filter(\n (entry) =>\n entry.type === \"category\" ||\n entry.type === \"item\" ||\n entry.type === \"expand\"\n );\n if (!entries.length) {\n return null;\n }\n const foundIndex = entries.findIndex(\n (entry) => entry.key === input.currentKey\n );\n const currentIndex = foundIndex >= 0 ? foundIndex : input.delta > 0 ? -1 : 0;\n return (\n entries[(currentIndex + input.delta + entries.length) % entries.length]\n ?.key ?? null\n );\n}\n\nexport function repairMentionPaletteHighlight<TItem>(input: {\n state: MentionPaletteState<TItem>;\n currentKey: string | null;\n getItemKey: (item: TItem, groupId: string) => string;\n preferredKey?: string | null;\n}): string | null {\n const entries = flattenMentionPaletteEntries(input.state, input.getItemKey);\n if (entries.length === 0) {\n return null;\n }\n if (\n input.currentKey !== null &&\n entries.some((entry) => entry.key === input.currentKey)\n ) {\n return input.currentKey;\n }\n if (\n input.preferredKey != null &&\n entries.some((entry) => entry.key === input.preferredKey)\n ) {\n return input.preferredKey;\n }\n return entries[0]?.key ?? null;\n}\n\nexport function findMentionPaletteEntry<TItem>(input: {\n state: MentionPaletteState<TItem>;\n key: string | null;\n getItemKey: (item: TItem, groupId: string) => string;\n}): MentionPaletteEntry | null {\n if (input.key === null) {\n return null;\n }\n return (\n flattenMentionPaletteEntries(input.state, input.getItemKey).find(\n (entry) => entry.key === input.key\n ) ?? null\n );\n}\n\nexport function selectedMentionPaletteItem<TItem>(input: {\n state: MentionPaletteState<TItem>;\n key: string | null;\n getItemKey: (item: TItem, groupId: string) => string;\n}): TItem | null {\n for (const group of input.state.groups) {\n const index = group.items.findIndex(\n (candidate) =>\n `${group.id}:${input.getItemKey(candidate, group.id)}` === input.key\n );\n if (index >= 0) {\n return group.items[index] ?? null;\n }\n }\n return null;\n}\n\nexport function nextMentionPaletteCategory<TCategoryId extends string>(\n categories: readonly { id: TCategoryId }[],\n current: TCategoryId,\n delta: 1 | -1\n): TCategoryId {\n const index = categories.findIndex((category) => category.id === current);\n const safeIndex = index >= 0 ? index : 0;\n return categories[\n (safeIndex + delta + categories.length) % categories.length\n ]!.id;\n}\n","/**\n * Tone → className maps for the {@link MentionStatusBadge} rendered inside a\n * {@link MentionRow}. The surface resolves a status into a data-only\n * {@link MentionRowStatusTag} (label + tone + variant); this module owns the\n * presentational mapping so the styling stays in one place and identical across\n * surfaces.\n */\nexport type MentionRowStatusTone =\n | \"amber\"\n | \"blue\"\n | \"green\"\n | \"neutral\"\n | \"purple\"\n | \"red\";\n\nexport type MentionRowStatusVariant = \"activity\" | \"issue\";\n\n/**\n * Text classes for agent activity status signals. Activity rows already include\n * a status dot, so they render as plain signal text instead of a filled badge.\n */\nexport function activityMentionStatusBadgeClassName(\n tone: MentionRowStatusTone\n): string {\n switch (tone) {\n case \"blue\":\n return \"bg-transparent px-0 text-[var(--status-running)]\";\n case \"amber\":\n return \"bg-transparent px-0 text-[var(--state-warning)]\";\n case \"green\":\n return \"bg-transparent px-0 text-[var(--state-success)]\";\n case \"red\":\n return \"bg-transparent px-0 text-[var(--state-danger)]\";\n default:\n return \"bg-transparent px-0 text-[var(--text-secondary)]\";\n }\n}\n\n/**\n * Background/text classes for the issue status badge. Ported verbatim from the\n * agent's `issueMentionStatusBadgeClassName` (keyed by the issue tone the\n * surface resolves).\n */\nexport function issueMentionStatusBadgeClassName(\n tone: MentionRowStatusTone\n): string {\n switch (tone) {\n case \"blue\":\n return \"bg-[color:color-mix(in_srgb,var(--status-running)_12%,transparent)] text-[var(--status-running)]\";\n case \"amber\":\n return \"bg-[color:color-mix(in_srgb,var(--state-warning)_12%,transparent)] text-[var(--state-warning)]\";\n case \"green\":\n return \"bg-[color:color-mix(in_srgb,var(--state-success)_12%,transparent)] text-[var(--state-success)]\";\n case \"purple\":\n return \"bg-[color-mix(in_srgb,var(--rich-text-mention-issue)_12%,transparent)] text-[var(--rich-text-mention-issue)]\";\n case \"red\":\n return \"bg-[var(--on-danger)] text-[var(--state-danger)]\";\n default:\n return \"bg-[var(--transparency-block)] text-[var(--text-secondary)]\";\n }\n}\n\nexport function mentionStatusBadgeClassName(input: {\n tone: MentionRowStatusTone;\n variant: MentionRowStatusVariant;\n}): string {\n return input.variant === \"issue\"\n ? issueMentionStatusBadgeClassName(input.tone)\n : activityMentionStatusBadgeClassName(input.tone);\n}\n\n/**\n * Map a normalized agent-activity display status to its badge tone. Shared by\n * every `@`-mention surface that renders a session row (agent composer,\n * issue-manager) so the activity status badge color is identical across\n * surfaces. Mirrors the agent composer's local `mentionStatusTone` mapping\n * verbatim (the agent keeps its own copy producing identical values). The label\n * is resolved by each surface; only the tone lives here.\n */\nexport function activityMentionStatusTone(\n status: string\n): MentionRowStatusTone {\n switch (status.trim().toLowerCase()) {\n case \"working\":\n return \"blue\";\n case \"waiting\":\n case \"canceled\":\n return \"amber\";\n case \"completed\":\n case \"idle\":\n return \"green\";\n case \"failed\":\n return \"red\";\n default:\n return \"neutral\";\n }\n}\n\n/**\n * Map an issue status string to its badge tone. Shared by every `@`-mention\n * surface that renders an issue row (agent composer, issue-manager) so the\n * status badge color is identical across surfaces. The label is resolved by\n * each surface's own i18n; only the tone lives here.\n */\nexport function issueMentionStatusTone(status: string): MentionRowStatusTone {\n switch (status.trim().toLowerCase()) {\n case \"completed\":\n return \"green\";\n case \"failed\":\n case \"canceled\":\n return \"red\";\n default:\n return \"neutral\";\n }\n}\n","/**\n * Pure, dependency-free file visual-kind helpers shared by every `@`-mention\n * surface that renders a {@link MentionRow}. The *base* extension → kind\n * resolution lives in each surface (the agent maps file-manager kinds, etc.);\n * this module owns only the surface-agnostic vocabulary and the thumbnail rule\n * so the shared row renderer never imports a workspace feature.\n */\nexport type MentionFileVisualKind =\n | \"back\"\n | \"document\"\n | \"code\"\n | \"markdown\"\n | \"image\"\n | \"video\"\n | \"folder\";\n\nexport interface MentionFileVisualKindInput {\n entryKind?: string | null;\n mentionNavigation?: string | null;\n /**\n * The base visual kind already resolved from the file extension/name by the\n * surface (e.g. the agent's file-manager mapping). Used as the fallback when\n * the entry is neither a back-navigation marker nor a directory.\n */\n baseVisualKind: MentionFileVisualKind;\n}\n\n/**\n * Resolve the row's visual kind from a pre-resolved {@link MentionFileVisualKindInput.baseVisualKind}\n * plus the structural markers (back navigation, directory) that override it.\n */\nexport function resolveMentionFileVisualKind(\n input: MentionFileVisualKindInput\n): MentionFileVisualKind {\n if (input.mentionNavigation === \"agent-generated-folder-back\") {\n return \"back\";\n }\n if (input.entryKind === \"directory\") {\n return \"folder\";\n }\n return input.baseVisualKind;\n}\n\n/**\n * The thumbnail is only shown for image entries with a non-empty thumbnail URL.\n */\nexport function resolveMentionFileThumbnailUrl(input: {\n visualKind: MentionFileVisualKind;\n thumbnailUrl?: string | null;\n}): string | undefined {\n if (input.visualKind !== \"image\") {\n return undefined;\n }\n const thumbnailUrl = input.thumbnailUrl?.trim() ?? \"\";\n return thumbnailUrl || undefined;\n}\n"],"mappings":";AAaA,SAAS,qBACP,QACS;AACT,SAAO,OAAO;AAAA,IACZ,CAAC,UACC,MAAM,MAAM,SAAS,KAAK,MAAM,WAAW,MAAM,cAAc;AAAA,EACnE;AACF;AAaO,SAAS,6BACd,OACA,YACuB;AASvB,MAAI,MAAM,SAAS,YAAY,CAAC,qBAAqB,MAAM,MAAM,GAAG;AAClE,WAAO,MAAM,WAAW,IAAI,CAAC,cAAc;AAAA,MACzC,KAAK,YAAY,SAAS,EAAE;AAAA,MAC5B,MAAM;AAAA,MACN,YAAY,SAAS;AAAA,IACvB,EAAE;AAAA,EACJ;AAEA,QAAM,UAAiC,CAAC;AAExC,aAAW,SAAS,MAAM,QAAQ;AAChC,UAAM,MAAM,QAAQ,CAAC,MAAM,UAAU;AACnC,cAAQ,KAAK;AAAA,QACX,KAAK,GAAG,MAAM,EAAE,I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