@tutti-os/ui-rich-text 0.0.23 → 0.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -0
- package/dist/at-panel/index.css +586 -10
- package/dist/at-panel/index.css.map +1 -1
- package/dist/at-panel/index.d.ts +124 -5
- package/dist/at-panel/index.js +921 -175
- package/dist/at-panel/index.js.map +1 -1
- package/dist/at-panel/model.d.ts +72 -86
- package/dist/at-panel/model.js +17 -19
- package/dist/chunk-3ZXEASYU.js +268 -0
- package/dist/chunk-3ZXEASYU.js.map +1 -0
- package/package.json +4 -3
- package/dist/chunk-E4PWFY3N.js +0 -264
- package/dist/chunk-E4PWFY3N.js.map +0 -1
package/dist/at-panel/model.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { RichTextTriggerQueryMatch, RichTextTriggerInsertResult } from '../types/index.js';
|
|
2
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { RichTextTriggerQueryMatch } from '../types/index.js';
|
|
3
3
|
import '../mention-DJq2OJ4K.js';
|
|
4
4
|
|
|
5
5
|
type MentionPaletteFilterId = string;
|
|
@@ -151,66 +151,6 @@ interface MentionPaletteProps<TItem> {
|
|
|
151
151
|
theme?: MentionPaletteTheme;
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
type RichTextAtFilterId = string;
|
|
155
|
-
type RichTextAtGroupId = string;
|
|
156
|
-
interface RichTextAtFilterTab {
|
|
157
|
-
id: RichTextAtFilterId;
|
|
158
|
-
label: string;
|
|
159
|
-
}
|
|
160
|
-
interface RichTextTriggerProviderGroup {
|
|
161
|
-
id: RichTextAtGroupId;
|
|
162
|
-
label: string;
|
|
163
|
-
providerIds: readonly string[];
|
|
164
|
-
filterId?: RichTextAtFilterId;
|
|
165
|
-
emptyLabel?: string;
|
|
166
|
-
pageSize?: number;
|
|
167
|
-
}
|
|
168
|
-
interface RichTextAtPanelReferenceItem {
|
|
169
|
-
key: string;
|
|
170
|
-
label: string;
|
|
171
|
-
subtitle?: string;
|
|
172
|
-
thumbnailUrl?: string | null;
|
|
173
|
-
insertResult: RichTextTriggerInsertResult;
|
|
174
|
-
}
|
|
175
|
-
interface RichTextAtPanelMatch<TItem = unknown> extends RichTextTriggerQueryMatch<TItem> {
|
|
176
|
-
thumbnailUrl?: string;
|
|
177
|
-
referenceItems?: readonly RichTextAtPanelReferenceItem[];
|
|
178
|
-
referenceItemsLoading?: boolean;
|
|
179
|
-
referenceNextCursor?: string | null;
|
|
180
|
-
}
|
|
181
|
-
interface RichTextAtSearchGroup<TItem = unknown> {
|
|
182
|
-
id: RichTextAtGroupId;
|
|
183
|
-
label: string;
|
|
184
|
-
items: readonly RichTextAtPanelMatch<TItem>[];
|
|
185
|
-
totalCount: number;
|
|
186
|
-
visibleCount: number;
|
|
187
|
-
hasMore: boolean;
|
|
188
|
-
emptyLabel?: string;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
declare function buildMentionPaletteState(input: {
|
|
192
|
-
matches: readonly RichTextTriggerQueryMatch[];
|
|
193
|
-
providerGroups: readonly RichTextTriggerProviderGroup[];
|
|
194
|
-
filterTabs: readonly {
|
|
195
|
-
id: string;
|
|
196
|
-
label: string;
|
|
197
|
-
}[];
|
|
198
|
-
activeFilterId: string;
|
|
199
|
-
expandedCounts: Record<string, number | undefined>;
|
|
200
|
-
query: string;
|
|
201
|
-
isLoading: boolean;
|
|
202
|
-
pageSize?: number;
|
|
203
|
-
showMoreLabel?: (count: number) => string;
|
|
204
|
-
/**
|
|
205
|
-
* Optional predicate gating whether a group's header label is emitted. When
|
|
206
|
-
* provided and it returns false, the group renders without a label (matching
|
|
207
|
-
* the agent composer's conditional `shouldRenderMentionGroupLabel` rule, e.g.
|
|
208
|
-
* hiding a single group's header when it just duplicates the active filter
|
|
209
|
-
* tab). When omitted, the group label is always emitted (legacy behavior).
|
|
210
|
-
*/
|
|
211
|
-
shouldRenderGroupLabel?: (groupId: string, groupCount: number) => boolean;
|
|
212
|
-
}): MentionPaletteState<RichTextTriggerQueryMatch>;
|
|
213
|
-
|
|
214
154
|
/**
|
|
215
155
|
* Pure, dependency-free file visual-kind helpers shared by every `@`-mention
|
|
216
156
|
* surface that renders a {@link MentionRow}. The *base* extension → kind
|
|
@@ -338,13 +278,19 @@ interface MentionRowIssueItem {
|
|
|
338
278
|
creatorName?: string | null;
|
|
339
279
|
statusTag?: MentionRowStatusTag | null;
|
|
340
280
|
}
|
|
281
|
+
interface MentionRowPlainItem {
|
|
282
|
+
kind: "plain";
|
|
283
|
+
label: string;
|
|
284
|
+
description?: string | null;
|
|
285
|
+
leading?: ReactNode;
|
|
286
|
+
}
|
|
341
287
|
/**
|
|
342
288
|
* The kind-discriminated view-model the shared {@link MentionRow} renders.
|
|
343
289
|
* Carries ONLY display-ready fields — no surface types, no i18n calls, no asset
|
|
344
290
|
* imports. Every surface maps its own items onto this so the rendered row stays
|
|
345
291
|
* consistent across shared mention surfaces.
|
|
346
292
|
*/
|
|
347
|
-
type MentionRowItem = MentionRowFileItem | MentionRowAppItem | MentionRowAppFactoryItem | MentionRowSessionItem | MentionRowIssueItem;
|
|
293
|
+
type MentionRowItem = MentionRowFileItem | MentionRowAppItem | MentionRowAppFactoryItem | MentionRowSessionItem | MentionRowIssueItem | MentionRowPlainItem;
|
|
348
294
|
|
|
349
295
|
/**
|
|
350
296
|
* Flatten the palette state into a stable, ordered list of navigable entries.
|
|
@@ -359,28 +305,68 @@ type MentionRowItem = MentionRowFileItem | MentionRowAppItem | MentionRowAppFact
|
|
|
359
305
|
*/
|
|
360
306
|
declare function flattenMentionPaletteEntries<TItem>(state: MentionPaletteState<TItem>, getItemKey: (item: TItem, groupId: string) => string): MentionPaletteEntry[];
|
|
361
307
|
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
308
|
+
interface MentionPaletteModelInput<TItem> {
|
|
309
|
+
activeCategoryId: string;
|
|
310
|
+
categories: readonly MentionPaletteCategory[];
|
|
311
|
+
groups: readonly MentionPaletteGroup<TItem>[];
|
|
312
|
+
loading: boolean;
|
|
313
|
+
query?: string;
|
|
314
|
+
mode?: "browse" | "results";
|
|
315
|
+
}
|
|
316
|
+
interface MentionPaletteSectionConfig<TMatch extends RichTextTriggerQueryMatch = RichTextTriggerQueryMatch> {
|
|
317
|
+
id: string;
|
|
318
|
+
label?: string;
|
|
319
|
+
providerIds?: readonly string[];
|
|
320
|
+
matches?: (match: TMatch) => boolean;
|
|
321
|
+
emptyLabel?: string;
|
|
322
|
+
}
|
|
323
|
+
interface MentionPaletteCategoryConfig<TMatch extends RichTextTriggerQueryMatch = RichTextTriggerQueryMatch> {
|
|
324
|
+
id: string;
|
|
325
|
+
label: string;
|
|
326
|
+
providerIds?: readonly string[];
|
|
327
|
+
matches?: (match: TMatch) => boolean;
|
|
328
|
+
emptyLabel?: string;
|
|
329
|
+
sections?: readonly MentionPaletteSectionConfig<TMatch>[];
|
|
330
|
+
}
|
|
331
|
+
declare function mentionPaletteGroup<TItem>(input: {
|
|
332
|
+
id: string;
|
|
333
|
+
label?: string;
|
|
334
|
+
items: readonly TItem[];
|
|
335
|
+
emptyLabel?: string;
|
|
336
|
+
}): MentionPaletteGroup<TItem>;
|
|
337
|
+
declare function buildMentionPaletteModel<TItem>(input: MentionPaletteModelInput<TItem>): MentionPaletteState<TItem>;
|
|
338
|
+
declare function buildMentionPaletteModelFromTriggerMatches<TMatch extends RichTextTriggerQueryMatch = RichTextTriggerQueryMatch>(input: {
|
|
339
|
+
activeCategoryId: string;
|
|
340
|
+
categories: readonly MentionPaletteCategoryConfig<TMatch>[];
|
|
341
|
+
matches: readonly TMatch[];
|
|
342
|
+
loading: boolean;
|
|
343
|
+
query?: string;
|
|
344
|
+
mode?: "browse" | "results";
|
|
345
|
+
}): MentionPaletteState<TMatch>;
|
|
346
|
+
declare function moveMentionPaletteHighlight<TItem>(input: {
|
|
347
|
+
state: MentionPaletteState<TItem>;
|
|
348
|
+
currentKey: string | null;
|
|
349
|
+
delta: 1 | -1;
|
|
350
|
+
getItemKey: (item: TItem, groupId: string) => string;
|
|
351
|
+
}): string | null;
|
|
352
|
+
declare function repairMentionPaletteHighlight<TItem>(input: {
|
|
353
|
+
state: MentionPaletteState<TItem>;
|
|
354
|
+
currentKey: string | null;
|
|
355
|
+
getItemKey: (item: TItem, groupId: string) => string;
|
|
356
|
+
preferredKey?: string | null;
|
|
357
|
+
}): string | null;
|
|
358
|
+
declare function findMentionPaletteEntry<TItem>(input: {
|
|
359
|
+
state: MentionPaletteState<TItem>;
|
|
360
|
+
key: string | null;
|
|
361
|
+
getItemKey: (item: TItem, groupId: string) => string;
|
|
362
|
+
}): MentionPaletteEntry | null;
|
|
363
|
+
declare function selectedMentionPaletteItem<TItem>(input: {
|
|
364
|
+
state: MentionPaletteState<TItem>;
|
|
365
|
+
key: string | null;
|
|
366
|
+
getItemKey: (item: TItem, groupId: string) => string;
|
|
367
|
+
}): TItem | null;
|
|
368
|
+
declare function nextMentionPaletteCategory<TCategoryId extends string>(categories: readonly {
|
|
369
|
+
id: TCategoryId;
|
|
370
|
+
}[], current: TCategoryId, delta: 1 | -1): TCategoryId;
|
|
385
371
|
|
|
386
|
-
export {
|
|
372
|
+
export { type MentionFileVisualKind, type MentionFileVisualKindInput, type MentionPaletteCategory, type MentionPaletteCategoryConfig, type MentionPaletteEntry, type MentionPaletteFilterId, type MentionPaletteGroup, type MentionPaletteGroupId, type MentionPaletteModelInput, type MentionPaletteProps, type MentionPaletteSectionConfig, type MentionPaletteState, type MentionPaletteTheme, type MentionRowAppFactoryItem, type MentionRowAppItem, type MentionRowFileItem, type MentionRowIssueItem, type MentionRowItem, type MentionRowPlainItem, type MentionRowSessionItem, type MentionRowStatusTag, type MentionRowStatusTone, type MentionRowStatusVariant, activityMentionStatusBadgeClassName, activityMentionStatusTone, buildMentionPaletteModel, buildMentionPaletteModelFromTriggerMatches, findMentionPaletteEntry, flattenMentionPaletteEntries, issueMentionStatusBadgeClassName, issueMentionStatusTone, mentionPaletteGroup, mentionStatusBadgeClassName, moveMentionPaletteHighlight, nextMentionPaletteCategory, repairMentionPaletteHighlight, resolveMentionFileThumbnailUrl, resolveMentionFileVisualKind, selectedMentionPaletteItem };
|
package/dist/at-panel/model.js
CHANGED
|
@@ -1,39 +1,37 @@
|
|
|
1
1
|
import {
|
|
2
|
-
DEFAULT_RICH_TEXT_AT_PANEL_PAGE_SIZE,
|
|
3
|
-
RICH_TEXT_AT_ALL_FILTER_ID,
|
|
4
2
|
activityMentionStatusBadgeClassName,
|
|
5
3
|
activityMentionStatusTone,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
findRichTextTriggerProviderGroup,
|
|
4
|
+
buildMentionPaletteModel,
|
|
5
|
+
buildMentionPaletteModelFromTriggerMatches,
|
|
6
|
+
findMentionPaletteEntry,
|
|
10
7
|
flattenMentionPaletteEntries,
|
|
11
|
-
groupRichTextAtMatches,
|
|
12
8
|
issueMentionStatusBadgeClassName,
|
|
13
9
|
issueMentionStatusTone,
|
|
10
|
+
mentionPaletteGroup,
|
|
14
11
|
mentionStatusBadgeClassName,
|
|
15
|
-
|
|
12
|
+
moveMentionPaletteHighlight,
|
|
13
|
+
nextMentionPaletteCategory,
|
|
14
|
+
repairMentionPaletteHighlight,
|
|
16
15
|
resolveMentionFileThumbnailUrl,
|
|
17
16
|
resolveMentionFileVisualKind,
|
|
18
|
-
|
|
19
|
-
} from "../chunk-
|
|
17
|
+
selectedMentionPaletteItem
|
|
18
|
+
} from "../chunk-3ZXEASYU.js";
|
|
20
19
|
export {
|
|
21
|
-
DEFAULT_RICH_TEXT_AT_PANEL_PAGE_SIZE,
|
|
22
|
-
RICH_TEXT_AT_ALL_FILTER_ID,
|
|
23
20
|
activityMentionStatusBadgeClassName,
|
|
24
21
|
activityMentionStatusTone,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
findRichTextTriggerProviderGroup,
|
|
22
|
+
buildMentionPaletteModel,
|
|
23
|
+
buildMentionPaletteModelFromTriggerMatches,
|
|
24
|
+
findMentionPaletteEntry,
|
|
29
25
|
flattenMentionPaletteEntries,
|
|
30
|
-
groupRichTextAtMatches,
|
|
31
26
|
issueMentionStatusBadgeClassName,
|
|
32
27
|
issueMentionStatusTone,
|
|
28
|
+
mentionPaletteGroup,
|
|
33
29
|
mentionStatusBadgeClassName,
|
|
34
|
-
|
|
30
|
+
moveMentionPaletteHighlight,
|
|
31
|
+
nextMentionPaletteCategory,
|
|
32
|
+
repairMentionPaletteHighlight,
|
|
35
33
|
resolveMentionFileThumbnailUrl,
|
|
36
34
|
resolveMentionFileVisualKind,
|
|
37
|
-
|
|
35
|
+
selectedMentionPaletteItem
|
|
38
36
|
};
|
|
39
37
|
//# sourceMappingURL=model.js.map
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
// src/at-panel/mentionPaletteEntries.ts
|
|
2
|
+
function hasInteractiveGroupEntries(groups) {
|
|
3
|
+
return groups.some((group) => group.items.length > 0 || group.hasMore);
|
|
4
|
+
}
|
|
5
|
+
function flattenMentionPaletteEntries(state, getItemKey) {
|
|
6
|
+
if (state.mode === "browse" && !hasInteractiveGroupEntries(state.groups)) {
|
|
7
|
+
return state.categories.map((category) => ({
|
|
8
|
+
key: `category:${category.id}`,
|
|
9
|
+
type: "category",
|
|
10
|
+
categoryId: category.id
|
|
11
|
+
}));
|
|
12
|
+
}
|
|
13
|
+
const entries = [];
|
|
14
|
+
for (const group of state.groups) {
|
|
15
|
+
group.items.forEach((item, index) => {
|
|
16
|
+
entries.push({
|
|
17
|
+
key: `${group.id}:${getItemKey(item, group.id)}`,
|
|
18
|
+
type: "item",
|
|
19
|
+
groupId: group.id,
|
|
20
|
+
itemIndex: index
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
if (group.hasMore) {
|
|
24
|
+
entries.push({
|
|
25
|
+
key: `expand:${group.id}`,
|
|
26
|
+
type: "expand",
|
|
27
|
+
groupId: group.id
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return entries;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// src/at-panel/mentionPaletteModel.ts
|
|
35
|
+
function mentionPaletteGroup(input) {
|
|
36
|
+
return {
|
|
37
|
+
id: input.id,
|
|
38
|
+
label: input.label,
|
|
39
|
+
items: input.items,
|
|
40
|
+
totalCount: input.items.length,
|
|
41
|
+
visibleCount: input.items.length,
|
|
42
|
+
hasMore: false,
|
|
43
|
+
emptyLabel: input.emptyLabel
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
function buildMentionPaletteModel(input) {
|
|
47
|
+
return {
|
|
48
|
+
status: input.loading ? "loading" : "ready",
|
|
49
|
+
query: input.query ?? "",
|
|
50
|
+
mode: input.mode ?? "results",
|
|
51
|
+
filter: input.activeCategoryId,
|
|
52
|
+
categories: input.categories,
|
|
53
|
+
groups: input.groups,
|
|
54
|
+
error: null
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
function buildMentionPaletteModelFromTriggerMatches(input) {
|
|
58
|
+
const categories = input.categories.map((category) => ({
|
|
59
|
+
id: category.id,
|
|
60
|
+
label: category.label
|
|
61
|
+
}));
|
|
62
|
+
const activeCategory = input.categories.find(
|
|
63
|
+
(category) => category.id === input.activeCategoryId
|
|
64
|
+
) ?? input.categories[0] ?? null;
|
|
65
|
+
const groups = activeCategory === null ? [] : buildMentionPaletteGroupsForCategory(activeCategory, input.matches);
|
|
66
|
+
return buildMentionPaletteModel({
|
|
67
|
+
activeCategoryId: activeCategory?.id ?? input.activeCategoryId,
|
|
68
|
+
categories,
|
|
69
|
+
groups,
|
|
70
|
+
loading: input.loading,
|
|
71
|
+
query: input.query,
|
|
72
|
+
mode: input.mode
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
function buildMentionPaletteGroupsForCategory(category, matches) {
|
|
76
|
+
const categoryMatches = matches.filter(
|
|
77
|
+
(match) => mentionPaletteConfigMatches(category, match)
|
|
78
|
+
);
|
|
79
|
+
if (!category.sections?.length) {
|
|
80
|
+
if (categoryMatches.length === 0 && category.emptyLabel == null) {
|
|
81
|
+
return [];
|
|
82
|
+
}
|
|
83
|
+
return [
|
|
84
|
+
mentionPaletteGroup({
|
|
85
|
+
id: category.id,
|
|
86
|
+
items: categoryMatches,
|
|
87
|
+
emptyLabel: category.emptyLabel
|
|
88
|
+
})
|
|
89
|
+
];
|
|
90
|
+
}
|
|
91
|
+
const sectionItems = new Map(
|
|
92
|
+
category.sections.map((section) => [section.id, []])
|
|
93
|
+
);
|
|
94
|
+
for (const match of categoryMatches) {
|
|
95
|
+
const section = category.sections.find(
|
|
96
|
+
(candidate) => mentionPaletteConfigMatches(candidate, match)
|
|
97
|
+
);
|
|
98
|
+
if (!section) {
|
|
99
|
+
continue;
|
|
100
|
+
}
|
|
101
|
+
sectionItems.get(section.id)?.push(match);
|
|
102
|
+
}
|
|
103
|
+
return category.sections.map((section) => {
|
|
104
|
+
const items = sectionItems.get(section.id) ?? [];
|
|
105
|
+
if (items.length === 0 && section.emptyLabel == null) {
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
108
|
+
return mentionPaletteGroup({
|
|
109
|
+
id: section.id,
|
|
110
|
+
label: section.label,
|
|
111
|
+
items,
|
|
112
|
+
emptyLabel: section.emptyLabel
|
|
113
|
+
});
|
|
114
|
+
}).filter((group) => group !== null);
|
|
115
|
+
}
|
|
116
|
+
function mentionPaletteConfigMatches(config, match) {
|
|
117
|
+
if (config.providerIds != null && !config.providerIds.includes(match.providerId)) {
|
|
118
|
+
return false;
|
|
119
|
+
}
|
|
120
|
+
return config.matches?.(match) ?? true;
|
|
121
|
+
}
|
|
122
|
+
function moveMentionPaletteHighlight(input) {
|
|
123
|
+
const entries = flattenMentionPaletteEntries(
|
|
124
|
+
input.state,
|
|
125
|
+
input.getItemKey
|
|
126
|
+
).filter(
|
|
127
|
+
(entry) => entry.type === "category" || entry.type === "item" || entry.type === "expand"
|
|
128
|
+
);
|
|
129
|
+
if (!entries.length) {
|
|
130
|
+
return null;
|
|
131
|
+
}
|
|
132
|
+
const foundIndex = entries.findIndex(
|
|
133
|
+
(entry) => entry.key === input.currentKey
|
|
134
|
+
);
|
|
135
|
+
const currentIndex = foundIndex >= 0 ? foundIndex : input.delta > 0 ? -1 : 0;
|
|
136
|
+
return entries[(currentIndex + input.delta + entries.length) % entries.length]?.key ?? null;
|
|
137
|
+
}
|
|
138
|
+
function repairMentionPaletteHighlight(input) {
|
|
139
|
+
const entries = flattenMentionPaletteEntries(input.state, input.getItemKey);
|
|
140
|
+
if (entries.length === 0) {
|
|
141
|
+
return null;
|
|
142
|
+
}
|
|
143
|
+
if (input.currentKey !== null && entries.some((entry) => entry.key === input.currentKey)) {
|
|
144
|
+
return input.currentKey;
|
|
145
|
+
}
|
|
146
|
+
if (input.preferredKey != null && entries.some((entry) => entry.key === input.preferredKey)) {
|
|
147
|
+
return input.preferredKey;
|
|
148
|
+
}
|
|
149
|
+
return entries[0]?.key ?? null;
|
|
150
|
+
}
|
|
151
|
+
function findMentionPaletteEntry(input) {
|
|
152
|
+
if (input.key === null) {
|
|
153
|
+
return null;
|
|
154
|
+
}
|
|
155
|
+
return flattenMentionPaletteEntries(input.state, input.getItemKey).find(
|
|
156
|
+
(entry) => entry.key === input.key
|
|
157
|
+
) ?? null;
|
|
158
|
+
}
|
|
159
|
+
function selectedMentionPaletteItem(input) {
|
|
160
|
+
for (const group of input.state.groups) {
|
|
161
|
+
const index = group.items.findIndex(
|
|
162
|
+
(candidate) => `${group.id}:${input.getItemKey(candidate, group.id)}` === input.key
|
|
163
|
+
);
|
|
164
|
+
if (index >= 0) {
|
|
165
|
+
return group.items[index] ?? null;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return null;
|
|
169
|
+
}
|
|
170
|
+
function nextMentionPaletteCategory(categories, current, delta) {
|
|
171
|
+
const index = categories.findIndex((category) => category.id === current);
|
|
172
|
+
const safeIndex = index >= 0 ? index : 0;
|
|
173
|
+
return categories[(safeIndex + delta + categories.length) % categories.length].id;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// src/at-panel/mentionStatusTone.ts
|
|
177
|
+
function activityMentionStatusBadgeClassName(tone) {
|
|
178
|
+
switch (tone) {
|
|
179
|
+
case "blue":
|
|
180
|
+
return "bg-sky-500/10 text-sky-700";
|
|
181
|
+
case "amber":
|
|
182
|
+
return "bg-[color:color-mix(in_srgb,var(--color-amber-500)_12%,transparent)] text-[var(--color-amber-500)]";
|
|
183
|
+
case "green":
|
|
184
|
+
return "bg-[var(--tsh-ui-pill-success-bg)] text-[var(--tsh-ui-pill-success-fg)]";
|
|
185
|
+
case "red":
|
|
186
|
+
return "bg-[var(--on-danger)] text-[var(--state-danger)]";
|
|
187
|
+
default:
|
|
188
|
+
return "bg-[var(--transparency-block)] text-[var(--text-secondary)]";
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
function issueMentionStatusBadgeClassName(tone) {
|
|
192
|
+
switch (tone) {
|
|
193
|
+
case "green":
|
|
194
|
+
return "bg-[color:color-mix(in_srgb,var(--state-success)_12%,transparent)] text-[var(--state-success)]";
|
|
195
|
+
case "red":
|
|
196
|
+
return "bg-[var(--on-danger)] text-[var(--state-danger)]";
|
|
197
|
+
default:
|
|
198
|
+
return "bg-[var(--transparency-block)] text-[var(--text-secondary)]";
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
function mentionStatusBadgeClassName(input) {
|
|
202
|
+
return input.variant === "issue" ? issueMentionStatusBadgeClassName(input.tone) : activityMentionStatusBadgeClassName(input.tone);
|
|
203
|
+
}
|
|
204
|
+
function activityMentionStatusTone(status) {
|
|
205
|
+
switch (status.trim().toLowerCase()) {
|
|
206
|
+
case "working":
|
|
207
|
+
return "blue";
|
|
208
|
+
case "waiting":
|
|
209
|
+
case "canceled":
|
|
210
|
+
return "amber";
|
|
211
|
+
case "completed":
|
|
212
|
+
case "idle":
|
|
213
|
+
return "green";
|
|
214
|
+
case "failed":
|
|
215
|
+
return "red";
|
|
216
|
+
default:
|
|
217
|
+
return "neutral";
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
function issueMentionStatusTone(status) {
|
|
221
|
+
switch (status.trim().toLowerCase()) {
|
|
222
|
+
case "completed":
|
|
223
|
+
return "green";
|
|
224
|
+
case "failed":
|
|
225
|
+
case "canceled":
|
|
226
|
+
return "red";
|
|
227
|
+
default:
|
|
228
|
+
return "neutral";
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
// src/at-panel/mentionFileVisualKind.ts
|
|
233
|
+
function resolveMentionFileVisualKind(input) {
|
|
234
|
+
if (input.mentionNavigation === "agent-generated-folder-back") {
|
|
235
|
+
return "back";
|
|
236
|
+
}
|
|
237
|
+
if (input.entryKind === "directory") {
|
|
238
|
+
return "folder";
|
|
239
|
+
}
|
|
240
|
+
return input.baseVisualKind;
|
|
241
|
+
}
|
|
242
|
+
function resolveMentionFileThumbnailUrl(input) {
|
|
243
|
+
if (input.visualKind !== "image") {
|
|
244
|
+
return void 0;
|
|
245
|
+
}
|
|
246
|
+
const thumbnailUrl = input.thumbnailUrl?.trim() ?? "";
|
|
247
|
+
return thumbnailUrl || void 0;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
export {
|
|
251
|
+
flattenMentionPaletteEntries,
|
|
252
|
+
mentionPaletteGroup,
|
|
253
|
+
buildMentionPaletteModel,
|
|
254
|
+
buildMentionPaletteModelFromTriggerMatches,
|
|
255
|
+
moveMentionPaletteHighlight,
|
|
256
|
+
repairMentionPaletteHighlight,
|
|
257
|
+
findMentionPaletteEntry,
|
|
258
|
+
selectedMentionPaletteItem,
|
|
259
|
+
nextMentionPaletteCategory,
|
|
260
|
+
activityMentionStatusBadgeClassName,
|
|
261
|
+
issueMentionStatusBadgeClassName,
|
|
262
|
+
mentionStatusBadgeClassName,
|
|
263
|
+
activityMentionStatusTone,
|
|
264
|
+
issueMentionStatusTone,
|
|
265
|
+
resolveMentionFileVisualKind,
|
|
266
|
+
resolveMentionFileThumbnailUrl
|
|
267
|
+
};
|
|
268
|
+
//# sourceMappingURL=chunk-3ZXEASYU.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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 at least one group has items or a \"load more\" trigger,\n * i.e. there is something interactive to render beyond category headers.\n */\nfunction hasInteractiveGroupEntries<TItem>(\n groups: MentionPaletteState<TItem>[\"groups\"]\n): boolean {\n return groups.some((group) => group.items.length > 0 || group.hasMore);\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 interactive group content → show category nav only\n if (state.mode === \"browse\" && !hasInteractiveGroupEntries(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 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 | \"red\";\n\nexport type MentionRowStatusVariant = \"activity\" | \"issue\";\n\n/**\n * Background/text classes for the agent activity status badge. Ported verbatim\n * from the agent's `mentionStatusBadgeClassName` so the rendered DOM is\n * unchanged.\n */\nexport function activityMentionStatusBadgeClassName(\n tone: MentionRowStatusTone\n): string {\n switch (tone) {\n case \"blue\":\n return \"bg-sky-500/10 text-sky-700\";\n case \"amber\":\n return \"bg-[color:color-mix(in_srgb,var(--color-amber-500)_12%,transparent)] text-[var(--color-amber-500)]\";\n case \"green\":\n return \"bg-[var(--tsh-ui-pill-success-bg)] text-[var(--tsh-ui-pill-success-fg)]\";\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\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 \"green\":\n return \"bg-[color:color-mix(in_srgb,var(--state-success)_12%,transparent)] text-[var(--state-success)]\";\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":";AASA,SAAS,2BACP,QACS;AACT,SAAO,OAAO,KAAK,CAAC,UAAU,MAAM,MAAM,SAAS,KAAK,MAAM,OAAO;AACvE;AAaO,SAAS,6BACd,OACA,YACuB;AAEvB,MAAI,MAAM,SAAS,YAAY,CAAC,2BAA2B,MAAM,MAAM,GAAG;AACxE,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,IAAI,WAAW,MAAM,MAAM,EAAE,CAA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BAAsB,+BAA+B;AAC7D,WAAO;AAAA,EACT;AACA,MAAI,MAAM,cAAc,aAAa;AACnC,WAAO;AAAA,EACT;AACA,SAAO,MAAM;AACf;AAKO,SAAS,+BAA+B,OAGxB;AACrB,MAAI,MAAM,eAAe,SAAS;AAChC,WAAO;AAAA,EACT;AACA,QAAM,eAAe,MAAM,cAAc,KAAK,KAAK;AACnD,SAAO,gBAAgB;AACzB;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tutti-os/ui-rich-text",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.24",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"types": "./dist/at-panel/index.d.ts",
|
|
14
14
|
"import": "./dist/at-panel/index.js"
|
|
15
15
|
},
|
|
16
|
+
"./at-panel/index.css": "./dist/at-panel/index.css",
|
|
16
17
|
"./at-panel/model": {
|
|
17
18
|
"types": "./dist/at-panel/model.d.ts",
|
|
18
19
|
"import": "./dist/at-panel/model.js"
|
|
@@ -44,8 +45,8 @@
|
|
|
44
45
|
"directory": "packages/ui/rich-text"
|
|
45
46
|
},
|
|
46
47
|
"dependencies": {
|
|
47
|
-
"@tutti-os/ui-i18n-runtime": "0.0.
|
|
48
|
-
"@tutti-os/ui-system": "0.0.
|
|
48
|
+
"@tutti-os/ui-i18n-runtime": "0.0.24",
|
|
49
|
+
"@tutti-os/ui-system": "0.0.24",
|
|
49
50
|
"@tiptap/core": "^3.23.6",
|
|
50
51
|
"@tiptap/extension-document": "^3.23.6",
|
|
51
52
|
"@tiptap/extension-hard-break": "^3.23.6",
|