@adecore/agents-react 0.37.2 → 0.38.0

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.
Files changed (115) hide show
  1. package/dist/chat/chat-client.d.ts +1 -0
  2. package/dist/chat/chat-client.js +2 -1
  3. package/dist/chat/chat-references.d.ts +16 -1
  4. package/dist/chat/chat-references.js +29 -3
  5. package/dist/chat/drafts.d.ts +2 -0
  6. package/dist/chat/drafts.js +21 -5
  7. package/dist/chat/index.d.ts +1 -1
  8. package/dist/chat/logic/visual-height.d.ts +1 -0
  9. package/dist/chat/logic/visual-height.js +1 -1
  10. package/dist/chat/mentions.d.ts +31 -14
  11. package/dist/chat/mentions.js +186 -41
  12. package/dist/chat/stash.d.ts +1 -0
  13. package/dist/chat/stash.js +4 -2
  14. package/dist/chat/ui/Composer.js +438 -429
  15. package/dist/chat/ui/ComposerInput.d.ts +1 -0
  16. package/dist/chat/ui/ComposerInput.js +2 -0
  17. package/dist/chat/ui/HostMenuItems.d.ts +4 -0
  18. package/dist/chat/ui/HostMenuItems.js +15 -0
  19. package/dist/chat/ui/Markdown.d.ts +3 -1
  20. package/dist/chat/ui/Markdown.js +194 -120
  21. package/dist/chat/ui/MessageActions.js +70 -66
  22. package/dist/chat/ui/ReferenceChip.d.ts +15 -0
  23. package/dist/chat/ui/ReferenceChip.js +255 -0
  24. package/dist/chat/ui/Timeline.js +52 -29
  25. package/dist/chat/ui/TimelineMenu.js +84 -78
  26. package/dist/chat/ui/VisualFrame.d.ts +8 -0
  27. package/dist/chat/ui/VisualFrame.js +217 -115
  28. package/dist/chat/ui/chip-clipboard.d.ts +9 -0
  29. package/dist/chat/ui/chip-clipboard.js +105 -0
  30. package/dist/chat/ui/chips.d.ts +5 -0
  31. package/dist/chat/ui/chips.js +15 -1
  32. package/dist/chat/ui/composer/ComposerMenu.js +140 -79
  33. package/dist/chat/ui/composer/DraftParts.d.ts +0 -4
  34. package/dist/chat/ui/composer/DraftParts.js +0 -41
  35. package/dist/chat/ui/composer/chip-paste.d.ts +15 -0
  36. package/dist/chat/ui/composer/chip-paste.js +104 -0
  37. package/dist/chat/ui/composer/chips.d.ts +5 -0
  38. package/dist/chat/ui/composer/chips.js +59 -9
  39. package/dist/chat/ui/composer/key-handler.js +9 -0
  40. package/dist/chat/ui/composer/use-composer-draft.d.ts +0 -1
  41. package/dist/chat/ui/composer/use-composer-draft.js +2 -10
  42. package/dist/chat/ui/composer/use-composer-menus.d.ts +12 -2
  43. package/dist/chat/ui/composer/use-composer-menus.js +192 -149
  44. package/dist/chat/ui/composer/use-composer-submit.js +17 -12
  45. package/dist/chat/ui/composer/use-draft-files.d.ts +7 -1
  46. package/dist/chat/ui/composer/use-draft-files.js +90 -58
  47. package/dist/chat/ui/composer/use-take-back.js +2 -1
  48. package/dist/chat/ui/index.d.ts +1 -1
  49. package/dist/chat/ui/index.js +1 -1
  50. package/dist/chat/ui/reference-icons.d.ts +3 -0
  51. package/dist/chat/ui/reference-icons.js +15 -0
  52. package/dist/chat/ui/reference-lookup.d.ts +7 -0
  53. package/dist/chat/ui/reference-lookup.js +6 -0
  54. package/dist/chat/ui/rehype-chips.d.ts +8 -1
  55. package/dist/chat/ui/rehype-chips.js +35 -11
  56. package/dist/chat/ui/rows/GeneratedImageRow.js +8 -4
  57. package/dist/chat/ui/rows/MessageRows.js +218 -158
  58. package/dist/chat/ui/rows/VisualRow.js +184 -142
  59. package/dist/chat/ui/rows/row-rhythm.js +6 -4
  60. package/dist/chat/ui/thread-references.d.ts +4 -0
  61. package/dist/chat/ui/thread-references.js +78 -0
  62. package/dist/host-hooks.d.ts +2 -0
  63. package/dist/host-hooks.js +7 -0
  64. package/dist/host.d.ts +14 -1
  65. package/dist/index.d.ts +1 -1
  66. package/dist/locales/en/agent-chat.d.ts +20 -3
  67. package/dist/locales/en/agent-chat.js +24 -7
  68. package/dist/locales/nl/agent-chat.d.ts +20 -3
  69. package/dist/locales/nl/agent-chat.js +24 -7
  70. package/package.json +8 -8
  71. package/src/chat/chat-client.ts +4 -1
  72. package/src/chat/chat-references.ts +44 -3
  73. package/src/chat/drafts.ts +24 -6
  74. package/src/chat/index.ts +1 -1
  75. package/src/chat/logic/visual-height.ts +1 -1
  76. package/src/chat/mentions.ts +202 -36
  77. package/src/chat/stash.ts +6 -2
  78. package/src/chat/ui/Composer.tsx +14 -4
  79. package/src/chat/ui/ComposerInput.tsx +4 -0
  80. package/src/chat/ui/HostMenuItems.tsx +11 -0
  81. package/src/chat/ui/Markdown.tsx +57 -25
  82. package/src/chat/ui/MessageActions.tsx +5 -2
  83. package/src/chat/ui/ReferenceChip.tsx +74 -0
  84. package/src/chat/ui/Timeline.tsx +24 -2
  85. package/src/chat/ui/TimelineMenu.tsx +7 -3
  86. package/src/chat/ui/VisualFrame.tsx +68 -21
  87. package/src/chat/ui/chip-clipboard.ts +115 -0
  88. package/src/chat/ui/chips.ts +20 -1
  89. package/src/chat/ui/composer/ComposerMenu.tsx +53 -37
  90. package/src/chat/ui/composer/DraftParts.tsx +0 -12
  91. package/src/chat/ui/composer/chip-paste.ts +122 -0
  92. package/src/chat/ui/composer/chips.ts +60 -10
  93. package/src/chat/ui/composer/key-handler.ts +9 -0
  94. package/src/chat/ui/composer/use-composer-draft.ts +1 -7
  95. package/src/chat/ui/composer/use-composer-menus.ts +68 -29
  96. package/src/chat/ui/composer/use-composer-submit.ts +13 -6
  97. package/src/chat/ui/composer/use-draft-files.ts +39 -5
  98. package/src/chat/ui/composer/use-take-back.ts +2 -1
  99. package/src/chat/ui/index.ts +1 -1
  100. package/src/chat/ui/reference-icons.ts +17 -0
  101. package/src/chat/ui/reference-lookup.ts +13 -0
  102. package/src/chat/ui/rehype-chips.ts +38 -13
  103. package/src/chat/ui/rows/GeneratedImageRow.tsx +9 -4
  104. package/src/chat/ui/rows/MessageRows.tsx +88 -64
  105. package/src/chat/ui/rows/VisualRow.tsx +5 -1
  106. package/src/chat/ui/rows/row-rhythm.ts +6 -4
  107. package/src/chat/ui/thread-references.ts +47 -0
  108. package/src/host-hooks.ts +9 -0
  109. package/src/host.ts +24 -1
  110. package/src/index.ts +1 -0
  111. package/src/locales/en/agent-chat.ts +24 -7
  112. package/src/locales/nl/agent-chat.ts +24 -7
  113. package/dist/chat/ui/ChatReferenceChip.d.ts +0 -4
  114. package/dist/chat/ui/ChatReferenceChip.js +0 -110
  115. package/src/chat/ui/ChatReferenceChip.tsx +0 -26
@@ -9,14 +9,16 @@ import { markdownOf, messageTextOf } from '../logic/timeline-copy.js';
9
9
  import { useChatHost } from '../../host.js';
10
10
  import { useChatScope } from '../../scope.js';
11
11
  import { useChatRow, useChats } from '../../state/chats.js';
12
- import { ButtonGroup, copyText, IconButton, Tooltip } from '@adecore/ui';
12
+ import { ButtonGroup, IconButton, Tooltip } from '@adecore/ui';
13
13
  import { formatClock, formatDateTime, useFormatLocale } from '@adecore/ui/format';
14
+ import { copyWithChips, messageClipboardChips } from './chip-clipboard.js';
15
+ import { useReferenceLookup } from './thread-references.js';
14
16
  import { TIMESTAMP_FORMAT } from './timestamp-format.js';
15
17
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
16
18
  const COPIED_MS = 1500;
17
19
  /* Hidden actions keep their height, so hovering never forces the virtualizer to remeasure. */
18
20
  export function MessageActions(t0) {
19
- const $ = _c(58);
21
+ const $ = _c(59);
20
22
  const {
21
23
  chatId,
22
24
  row
@@ -88,6 +90,7 @@ export function MessageActions(t0) {
88
90
  }
89
91
  const canFork = t5;
90
92
  const [copied, setCopied] = useState(false);
93
+ const lookup = useReferenceLookup(chatId);
91
94
  let t6;
92
95
  let t7;
93
96
  if ($[13] !== copied) {
@@ -108,7 +111,7 @@ export function MessageActions(t0) {
108
111
  }
109
112
  useEffect(t6, t7);
110
113
  let t8;
111
- if ($[16] !== chatId || $[17] !== row || $[18] !== scope) {
114
+ if ($[16] !== chatId || $[17] !== lookup || $[18] !== row || $[19] !== scope) {
112
115
  t8 = plain => {
113
116
  const item_1 = useChats.getState().byKey[scope.keyOf(chatId)]?.items[row.id];
114
117
  const current = item_1?.kind === row.kind ? {
@@ -117,37 +120,38 @@ export function MessageActions(t0) {
117
120
  } : row;
118
121
  const text = (plain ? null : markdownOf(current)) ?? messageTextOf(current);
119
122
  if (text !== null) {
120
- copyText(text);
123
+ copyWithChips(messageClipboardChips(current.item, text, lookup));
121
124
  setCopied(true);
122
125
  }
123
126
  };
124
127
  $[16] = chatId;
125
- $[17] = row;
126
- $[18] = scope;
127
- $[19] = t8;
128
+ $[17] = lookup;
129
+ $[18] = row;
130
+ $[19] = scope;
131
+ $[20] = t8;
128
132
  } else {
129
- t8 = $[19];
133
+ t8 = $[20];
130
134
  }
131
135
  const copy = t8;
132
136
  let t9;
133
- if ($[20] !== t) {
137
+ if ($[21] !== t) {
134
138
  t9 = t("timeline.actions.label");
135
- $[20] = t;
136
- $[21] = t9;
139
+ $[21] = t;
140
+ $[22] = t9;
137
141
  } else {
138
- t9 = $[21];
142
+ t9 = $[22];
139
143
  }
140
144
  const t10 = row.kind === "user" && "mt-1.5 justify-end";
141
145
  let t11;
142
- if ($[22] !== t10) {
146
+ if ($[23] !== t10) {
143
147
  t11 = clsx("flex h-7 items-center gap-2 opacity-0 transition-opacity group-has-focus-visible/message:opacity-100 group-hover/message:opacity-100", t10);
144
- $[22] = t10;
145
- $[23] = t11;
148
+ $[23] = t10;
149
+ $[24] = t11;
146
150
  } else {
147
- t11 = $[23];
151
+ t11 = $[24];
148
152
  }
149
153
  let t12;
150
- if ($[24] !== bookmarked || $[25] !== canFork || $[26] !== chatId || $[27] !== copied || $[28] !== copy || $[29] !== fork || $[30] !== hasText || $[31] !== host || $[32] !== row.id || $[33] !== scope || $[34] !== streaming || $[35] !== t || $[36] !== turnId) {
154
+ if ($[25] !== bookmarked || $[26] !== canFork || $[27] !== chatId || $[28] !== copied || $[29] !== copy || $[30] !== fork || $[31] !== hasText || $[32] !== host || $[33] !== row.id || $[34] !== scope || $[35] !== streaming || $[36] !== t || $[37] !== turnId) {
151
155
  t12 = !streaming && /*#__PURE__*/_jsxs(ButtonGroup, {
152
156
  render: /*#__PURE__*/_jsx("span", {}),
153
157
  children: [!bookmarked && /*#__PURE__*/_jsx(IconButton, {
@@ -167,97 +171,97 @@ export function MessageActions(t0) {
167
171
  onClick: e => copy(e.shiftKey)
168
172
  })]
169
173
  });
170
- $[24] = bookmarked;
171
- $[25] = canFork;
172
- $[26] = chatId;
173
- $[27] = copied;
174
- $[28] = copy;
175
- $[29] = fork;
176
- $[30] = hasText;
177
- $[31] = host;
178
- $[32] = row.id;
179
- $[33] = scope;
180
- $[34] = streaming;
181
- $[35] = t;
182
- $[36] = turnId;
183
- $[37] = t12;
174
+ $[25] = bookmarked;
175
+ $[26] = canFork;
176
+ $[27] = chatId;
177
+ $[28] = copied;
178
+ $[29] = copy;
179
+ $[30] = fork;
180
+ $[31] = hasText;
181
+ $[32] = host;
182
+ $[33] = row.id;
183
+ $[34] = scope;
184
+ $[35] = streaming;
185
+ $[36] = t;
186
+ $[37] = turnId;
187
+ $[38] = t12;
184
188
  } else {
185
- t12 = $[37];
189
+ t12 = $[38];
186
190
  }
187
191
  let t13;
188
- if ($[38] !== row.item.createdAt) {
192
+ if ($[39] !== row.item.createdAt) {
189
193
  t13 = formatDateTime(row.item.createdAt, TIMESTAMP_FORMAT);
190
- $[38] = row.item.createdAt;
191
- $[39] = t13;
194
+ $[39] = row.item.createdAt;
195
+ $[40] = t13;
192
196
  } else {
193
- t13 = $[39];
197
+ t13 = $[40];
194
198
  }
195
199
  let t14;
196
- if ($[40] !== row.item.createdAt) {
200
+ if ($[41] !== row.item.createdAt) {
197
201
  t14 = new Date(row.item.createdAt).toISOString();
198
- $[40] = row.item.createdAt;
199
- $[41] = t14;
202
+ $[41] = row.item.createdAt;
203
+ $[42] = t14;
200
204
  } else {
201
- t14 = $[41];
205
+ t14 = $[42];
202
206
  }
203
207
  const t15 = row.kind === "assistant" && "order-first";
204
208
  let t16;
205
- if ($[42] !== t15) {
209
+ if ($[43] !== t15) {
206
210
  t16 = clsx("shrink-0 text-xs text-text-faint tabular-nums select-none", t15);
207
- $[42] = t15;
208
- $[43] = t16;
211
+ $[43] = t15;
212
+ $[44] = t16;
209
213
  } else {
210
- t16 = $[43];
214
+ t16 = $[44];
211
215
  }
212
216
  let t17;
213
- if ($[44] !== row.item.createdAt) {
217
+ if ($[45] !== row.item.createdAt) {
214
218
  t17 = formatClock(row.item.createdAt);
215
- $[44] = row.item.createdAt;
216
- $[45] = t17;
219
+ $[45] = row.item.createdAt;
220
+ $[46] = t17;
217
221
  } else {
218
- t17 = $[45];
222
+ t17 = $[46];
219
223
  }
220
224
  let t18;
221
- if ($[46] !== t14 || $[47] !== t16 || $[48] !== t17) {
225
+ if ($[47] !== t14 || $[48] !== t16 || $[49] !== t17) {
222
226
  t18 = /*#__PURE__*/_jsx("time", {
223
227
  dateTime: t14,
224
228
  className: t16,
225
229
  children: t17
226
230
  });
227
- $[46] = t14;
228
- $[47] = t16;
229
- $[48] = t17;
230
- $[49] = t18;
231
+ $[47] = t14;
232
+ $[48] = t16;
233
+ $[49] = t17;
234
+ $[50] = t18;
231
235
  } else {
232
- t18 = $[49];
236
+ t18 = $[50];
233
237
  }
234
238
  let t19;
235
- if ($[50] !== t13 || $[51] !== t18) {
239
+ if ($[51] !== t13 || $[52] !== t18) {
236
240
  t19 = /*#__PURE__*/_jsx(Tooltip, {
237
241
  label: t13,
238
242
  children: t18
239
243
  });
240
- $[50] = t13;
241
- $[51] = t18;
242
- $[52] = t19;
244
+ $[51] = t13;
245
+ $[52] = t18;
246
+ $[53] = t19;
243
247
  } else {
244
- t19 = $[52];
248
+ t19 = $[53];
245
249
  }
246
250
  let t20;
247
- if ($[53] !== t11 || $[54] !== t12 || $[55] !== t19 || $[56] !== t9) {
251
+ if ($[54] !== t11 || $[55] !== t12 || $[56] !== t19 || $[57] !== t9) {
248
252
  t20 = /*#__PURE__*/_jsxs("div", {
249
253
  role: "toolbar",
250
254
  "aria-label": t9,
251
255
  className: t11,
252
256
  children: [t12, t19]
253
257
  });
254
- $[53] = t11;
255
- $[54] = t12;
256
- $[55] = t19;
257
- $[56] = t9;
258
- $[57] = t20;
258
+ $[54] = t11;
259
+ $[55] = t12;
260
+ $[56] = t19;
261
+ $[57] = t9;
262
+ $[58] = t20;
259
263
  } else {
260
- t20 = $[57];
264
+ t20 = $[58];
261
265
  }
262
266
  return t20;
263
267
  }
@@ -0,0 +1,15 @@
1
+ import { type HTMLAttributes, type ReactNode } from 'react';
2
+ interface TokenChipProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'children'> {
3
+ kind: 'mention' | 'skill' | 'reference' | 'gone';
4
+ value?: string;
5
+ sigil?: string;
6
+ icon: ReactNode;
7
+ label: string;
8
+ tone: string;
9
+ onOpen?: () => void;
10
+ }
11
+ export declare function TokenChip({ kind, value, sigil, icon, label, tone, onOpen, className, ...rest }: TokenChipProps): import("react").JSX.Element;
12
+ export declare function ReferenceChip({ id }: {
13
+ id: string;
14
+ }): import("react").JSX.Element;
15
+ export {};
@@ -0,0 +1,255 @@
1
+ import { c as _c } from "react/compiler-runtime";
2
+ import { useContext } from 'react';
3
+ import clsx from 'clsx';
4
+ import { useTranslation } from 'react-i18next';
5
+ import { CircleOff } from 'lucide-react';
6
+ import { Icon } from '@adecore/ui';
7
+ import { REFERENCE_GONE_TONE, REFERENCE_TONE, TOKEN_ICON, TOKEN_IN_MESSAGE } from './chips.js';
8
+ import { REFERENCE_ICONS } from './reference-icons.js';
9
+ import { ReferenceLookupContext } from './reference-lookup.js';
10
+ /*
11
+ * One token in the transcript. One that opens is a span with a button's role rather than a button,
12
+ * since a button is a box with a baseline of its own and would not sit on the line the others sit on.
13
+ */
14
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
15
+ export function TokenChip(t0) {
16
+ const $ = _c(30);
17
+ let className;
18
+ let icon;
19
+ let kind;
20
+ let label;
21
+ let onOpen;
22
+ let rest;
23
+ let sigil;
24
+ let t1;
25
+ let tone;
26
+ let value;
27
+ if ($[0] !== t0) {
28
+ ({
29
+ kind,
30
+ value,
31
+ sigil,
32
+ icon,
33
+ label,
34
+ tone,
35
+ onOpen,
36
+ className,
37
+ ...rest
38
+ } = t0);
39
+ t1 = e => {
40
+ if (onOpen !== undefined && (e.key === "Enter" || e.key === " ")) {
41
+ e.preventDefault();
42
+ onOpen();
43
+ }
44
+ };
45
+ $[0] = t0;
46
+ $[1] = className;
47
+ $[2] = icon;
48
+ $[3] = kind;
49
+ $[4] = label;
50
+ $[5] = onOpen;
51
+ $[6] = rest;
52
+ $[7] = sigil;
53
+ $[8] = t1;
54
+ $[9] = tone;
55
+ $[10] = value;
56
+ } else {
57
+ className = $[1];
58
+ icon = $[2];
59
+ kind = $[3];
60
+ label = $[4];
61
+ onOpen = $[5];
62
+ rest = $[6];
63
+ sigil = $[7];
64
+ t1 = $[8];
65
+ tone = $[9];
66
+ value = $[10];
67
+ }
68
+ const onKeyDown = t1;
69
+ const t2 = onOpen !== undefined && "cursor-pointer focus-visible:outline-2 focus-visible:outline-accent";
70
+ let t3;
71
+ if ($[11] !== className || $[12] !== t2 || $[13] !== tone) {
72
+ t3 = clsx(TOKEN_IN_MESSAGE, tone, t2, className);
73
+ $[11] = className;
74
+ $[12] = t2;
75
+ $[13] = tone;
76
+ $[14] = t3;
77
+ } else {
78
+ t3 = $[14];
79
+ }
80
+ const t4 = kind === "reference" ? label : undefined;
81
+ const t5 = onOpen === undefined ? undefined : "button";
82
+ const t6 = onOpen === undefined ? undefined : 0;
83
+ const t7 = onOpen === undefined ? undefined : onKeyDown;
84
+ let t8;
85
+ if ($[15] !== sigil) {
86
+ t8 = sigil !== undefined && /*#__PURE__*/_jsx("span", {
87
+ className: "sr-only",
88
+ children: sigil
89
+ });
90
+ $[15] = sigil;
91
+ $[16] = t8;
92
+ } else {
93
+ t8 = $[16];
94
+ }
95
+ let t9;
96
+ if ($[17] !== icon || $[18] !== kind || $[19] !== label || $[20] !== onOpen || $[21] !== rest || $[22] !== t3 || $[23] !== t4 || $[24] !== t5 || $[25] !== t6 || $[26] !== t7 || $[27] !== t8 || $[28] !== value) {
97
+ t9 = /*#__PURE__*/_jsxs("span", {
98
+ ...rest,
99
+ className: t3,
100
+ "data-chip": kind,
101
+ "data-chip-value": value,
102
+ "data-chip-name": t4,
103
+ role: t5,
104
+ tabIndex: t6,
105
+ onClick: onOpen,
106
+ onKeyDown: t7,
107
+ children: [icon, t8, label]
108
+ });
109
+ $[17] = icon;
110
+ $[18] = kind;
111
+ $[19] = label;
112
+ $[20] = onOpen;
113
+ $[21] = rest;
114
+ $[22] = t3;
115
+ $[23] = t4;
116
+ $[24] = t5;
117
+ $[25] = t6;
118
+ $[26] = t7;
119
+ $[27] = t8;
120
+ $[28] = value;
121
+ $[29] = t9;
122
+ } else {
123
+ t9 = $[29];
124
+ }
125
+ return t9;
126
+ }
127
+ /* A view, node or chat a message points at, under the name it has now; one that went says so. */
128
+ export function ReferenceChip(t0) {
129
+ const $ = _c(26);
130
+ const {
131
+ id
132
+ } = t0;
133
+ const {
134
+ t
135
+ } = useTranslation("agent-chat");
136
+ const {
137
+ items,
138
+ open
139
+ } = useContext(ReferenceLookupContext);
140
+ let t1;
141
+ if ($[0] !== id || $[1] !== items) {
142
+ let t2;
143
+ if ($[3] !== id) {
144
+ t2 = candidate => candidate.id === id;
145
+ $[3] = id;
146
+ $[4] = t2;
147
+ } else {
148
+ t2 = $[4];
149
+ }
150
+ t1 = items.find(t2);
151
+ $[0] = id;
152
+ $[1] = items;
153
+ $[2] = t1;
154
+ } else {
155
+ t1 = $[2];
156
+ }
157
+ const item = t1;
158
+ if (item === undefined) {
159
+ let t2;
160
+ if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
161
+ t2 = /*#__PURE__*/_jsx(Icon, {
162
+ icon: CircleOff,
163
+ size: 14,
164
+ className: TOKEN_ICON
165
+ });
166
+ $[5] = t2;
167
+ } else {
168
+ t2 = $[5];
169
+ }
170
+ let t3;
171
+ if ($[6] !== t) {
172
+ t3 = t("references.gone");
173
+ $[6] = t;
174
+ $[7] = t3;
175
+ } else {
176
+ t3 = $[7];
177
+ }
178
+ let t4;
179
+ if ($[8] !== t3) {
180
+ t4 = /*#__PURE__*/_jsx(TokenChip, {
181
+ kind: "gone",
182
+ icon: t2,
183
+ label: t3,
184
+ tone: REFERENCE_GONE_TONE
185
+ });
186
+ $[8] = t3;
187
+ $[9] = t4;
188
+ } else {
189
+ t4 = $[9];
190
+ }
191
+ return t4;
192
+ }
193
+ const t2 = item.id;
194
+ const t3 = REFERENCE_ICONS[item.kind];
195
+ let t4;
196
+ if ($[10] !== t3) {
197
+ t4 = /*#__PURE__*/_jsx(Icon, {
198
+ icon: t3,
199
+ size: 14,
200
+ className: TOKEN_ICON
201
+ });
202
+ $[10] = t3;
203
+ $[11] = t4;
204
+ } else {
205
+ t4 = $[11];
206
+ }
207
+ let t5;
208
+ if ($[12] !== item.name || $[13] !== t) {
209
+ t5 = item.name || t("references.untitled");
210
+ $[12] = item.name;
211
+ $[13] = t;
212
+ $[14] = t5;
213
+ } else {
214
+ t5 = $[14];
215
+ }
216
+ const t6 = open !== null && "hover:bg-text/12";
217
+ let t7;
218
+ if ($[15] !== t6) {
219
+ t7 = clsx(REFERENCE_TONE, t6);
220
+ $[15] = t6;
221
+ $[16] = t7;
222
+ } else {
223
+ t7 = $[16];
224
+ }
225
+ let t8;
226
+ if ($[17] !== item.id || $[18] !== open) {
227
+ t8 = open === null ? undefined : () => open(item.id);
228
+ $[17] = item.id;
229
+ $[18] = open;
230
+ $[19] = t8;
231
+ } else {
232
+ t8 = $[19];
233
+ }
234
+ let t9;
235
+ if ($[20] !== item.id || $[21] !== t4 || $[22] !== t5 || $[23] !== t7 || $[24] !== t8) {
236
+ t9 = /*#__PURE__*/_jsx(TokenChip, {
237
+ kind: "reference",
238
+ value: t2,
239
+ sigil: "#",
240
+ icon: t4,
241
+ label: t5,
242
+ tone: t7,
243
+ onOpen: t8
244
+ });
245
+ $[20] = item.id;
246
+ $[21] = t4;
247
+ $[22] = t5;
248
+ $[23] = t7;
249
+ $[24] = t8;
250
+ $[25] = t9;
251
+ } else {
252
+ t9 = $[25];
253
+ }
254
+ return t9;
255
+ }