@nexface/chat 0.1.15-alpha.1 → 0.1.15-alpha.11

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 (130) hide show
  1. package/dist/assistant-attachments.js +60 -17
  2. package/dist/assistant-components.d.ts +3 -3
  3. package/dist/assistant-components.js +77 -29
  4. package/dist/assistant-runtime.d.ts +1 -1
  5. package/dist/assistant-runtime.js +100 -43
  6. package/dist/attachments.js +36 -15
  7. package/dist/client.js +322 -78
  8. package/dist/config.js +4 -5
  9. package/dist/default-chat.d.ts +1 -1
  10. package/dist/default-chat.js +2102 -728
  11. package/dist/errors.d.ts +1 -0
  12. package/dist/errors.js +69 -18
  13. package/dist/index.js +0 -1
  14. package/dist/messages.js +0 -1
  15. package/dist/page-confirmation.js +3 -4
  16. package/dist/protocol-messages.js +290 -66
  17. package/dist/protocol-response.js +38 -18
  18. package/dist/react.d.ts +1 -1
  19. package/dist/react.js +147 -50
  20. package/dist/shared/errors.d.ts +1 -1
  21. package/dist/shared/errors.js +0 -1
  22. package/dist/shared/runtime-controller.d.ts +1 -0
  23. package/dist/shared/runtime-controller.js +0 -1
  24. package/dist/shared/runtime-execution.js +0 -1
  25. package/dist/shared/schema.js +45 -19
  26. package/dist/storage.js +130 -53
  27. package/dist/styles.css +99 -20
  28. package/dist/tool-result.js +7 -3
  29. package/dist/types.js +0 -1
  30. package/dist/ui/attachment.aui.d.ts +1 -1
  31. package/dist/ui/attachment.aui.js +16 -20
  32. package/dist/ui/avatar.js +0 -1
  33. package/dist/ui/button.js +0 -1
  34. package/dist/ui/code-block.js +2 -3
  35. package/dist/ui/collapsible.js +2 -3
  36. package/dist/ui/composer-voice.js +3 -2
  37. package/dist/ui/dialog.d.ts +1 -1
  38. package/dist/ui/dialog.js +9 -4
  39. package/dist/ui/dropdown-menu.js +2 -3
  40. package/dist/ui/home-demo/action-bar.js +0 -1
  41. package/dist/ui/home-demo/composer.js +7 -4
  42. package/dist/ui/home-demo/greeting.d.ts +1 -1
  43. package/dist/ui/home-demo/greeting.js +1 -2
  44. package/dist/ui/home-demo/messages.d.ts +1 -1
  45. package/dist/ui/home-demo/messages.js +4 -5
  46. package/dist/ui/home-demo/styles.js +0 -1
  47. package/dist/ui/home-demo/suggestions.d.ts +1 -1
  48. package/dist/ui/home-demo/suggestions.js +5 -3
  49. package/dist/ui/home-demo/surfaces.js +3 -2
  50. package/dist/ui/home-demo/thread.d.ts +1 -1
  51. package/dist/ui/home-demo/thread.js +1 -2
  52. package/dist/ui/home-demo/trace-line.d.ts +1 -1
  53. package/dist/ui/home-demo/trace-line.js +2 -3
  54. package/dist/ui/home-demo/trace.d.ts +1 -1
  55. package/dist/ui/home-demo/trace.js +28 -9
  56. package/dist/ui/home-demo/type.js +0 -1
  57. package/dist/ui/input.js +0 -1
  58. package/dist/ui/markdown-text.js +2 -3
  59. package/dist/ui/reasoning.aui.js +2 -3
  60. package/dist/ui/reasoning.d.ts +1 -1
  61. package/dist/ui/reasoning.js +6 -9
  62. package/dist/ui/surface.js +27 -8
  63. package/dist/ui/thread-list.aui.d.ts +2 -2
  64. package/dist/ui/thread-list.aui.js +18 -12
  65. package/dist/ui/tool-group.aui.js +2 -3
  66. package/dist/ui/tooltip-icon-button.js +1 -2
  67. package/dist/ui/tooltip.js +0 -1
  68. package/dist/ui/use-attachment-src.js +1 -2
  69. package/dist/ui/use-copy-to-clipboard.d.ts +1 -1
  70. package/dist/ui/use-copy-to-clipboard.js +1 -2
  71. package/dist/ui/utils.js +9 -3
  72. package/dist/use-next-message.js +7 -4
  73. package/dist/voice/types.js +0 -1
  74. package/dist/voice/use-voice.js +35 -13
  75. package/package.json +8 -4
  76. package/dist/assistant-attachments.js.map +0 -1
  77. package/dist/assistant-components.js.map +0 -1
  78. package/dist/assistant-runtime.js.map +0 -1
  79. package/dist/attachments.js.map +0 -1
  80. package/dist/client.js.map +0 -1
  81. package/dist/config.js.map +0 -1
  82. package/dist/default-chat.js.map +0 -7
  83. package/dist/errors.js.map +0 -1
  84. package/dist/index.js.map +0 -1
  85. package/dist/messages.js.map +0 -1
  86. package/dist/page-confirmation.js.map +0 -1
  87. package/dist/protocol-messages.js.map +0 -1
  88. package/dist/protocol-response.js.map +0 -1
  89. package/dist/react.js.map +0 -1
  90. package/dist/shared/errors.js.map +0 -1
  91. package/dist/shared/runtime-controller.js.map +0 -1
  92. package/dist/shared/runtime-execution.js.map +0 -1
  93. package/dist/shared/schema.js.map +0 -1
  94. package/dist/storage.js.map +0 -1
  95. package/dist/tool-result.js.map +0 -1
  96. package/dist/types.js.map +0 -1
  97. package/dist/ui/attachment.aui.js.map +0 -1
  98. package/dist/ui/avatar.js.map +0 -1
  99. package/dist/ui/button.js.map +0 -1
  100. package/dist/ui/code-block.js.map +0 -1
  101. package/dist/ui/collapsible.js.map +0 -1
  102. package/dist/ui/composer-voice.js.map +0 -1
  103. package/dist/ui/dialog.js.map +0 -1
  104. package/dist/ui/dropdown-menu.js.map +0 -1
  105. package/dist/ui/home-demo/action-bar.js.map +0 -1
  106. package/dist/ui/home-demo/composer.js.map +0 -1
  107. package/dist/ui/home-demo/greeting.js.map +0 -1
  108. package/dist/ui/home-demo/messages.js.map +0 -1
  109. package/dist/ui/home-demo/styles.js.map +0 -1
  110. package/dist/ui/home-demo/suggestions.js.map +0 -1
  111. package/dist/ui/home-demo/surfaces.js.map +0 -1
  112. package/dist/ui/home-demo/thread.js.map +0 -1
  113. package/dist/ui/home-demo/trace-line.js.map +0 -1
  114. package/dist/ui/home-demo/trace.js.map +0 -1
  115. package/dist/ui/home-demo/type.js.map +0 -1
  116. package/dist/ui/input.js.map +0 -1
  117. package/dist/ui/markdown-text.js.map +0 -1
  118. package/dist/ui/reasoning.aui.js.map +0 -1
  119. package/dist/ui/reasoning.js.map +0 -1
  120. package/dist/ui/surface.js.map +0 -1
  121. package/dist/ui/thread-list.aui.js.map +0 -1
  122. package/dist/ui/tool-group.aui.js.map +0 -1
  123. package/dist/ui/tooltip-icon-button.js.map +0 -1
  124. package/dist/ui/tooltip.js.map +0 -1
  125. package/dist/ui/use-attachment-src.js.map +0 -1
  126. package/dist/ui/use-copy-to-clipboard.js.map +0 -1
  127. package/dist/ui/utils.js.map +0 -1
  128. package/dist/use-next-message.js.map +0 -1
  129. package/dist/voice/types.js.map +0 -1
  130. package/dist/voice/use-voice.js.map +0 -1
package/dist/storage.js CHANGED
@@ -4,21 +4,25 @@ export const chatStorageKey = "nexface:chat:sessions:v3";
4
4
  const interruptedMessage = "页面已刷新,之前的操作未恢复,执行结果请重新核实。";
5
5
  const record = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
6
6
  function legacyPageTaskResult(message) {
7
- if (message.role !== "assistant" || message.parts.length !== 1 || message.parts[0]?.type !== "text")
7
+ if (message.role !== "assistant" ||
8
+ message.parts.length !== 1 ||
9
+ message.parts[0]?.type !== "text")
8
10
  return;
9
11
  try {
10
12
  const parsed = JSON.parse(message.parts[0].text);
11
13
  if (!record(parsed) || Object.keys(parsed).length !== 1 || !record(parsed.pageTaskResult))
12
14
  return;
13
15
  const result = parsed.pageTaskResult;
14
- if ((result.status === "done" || result.status === "blocked")
15
- && result.businessOutcome === "unverified"
16
- && record(result.task)
17
- && typeof result.task.goal === "string"
18
- && typeof result.task.completion === "string")
16
+ if ((result.status === "done" || result.status === "blocked") &&
17
+ result.businessOutcome === "unverified" &&
18
+ record(result.task) &&
19
+ typeof result.task.goal === "string" &&
20
+ typeof result.task.completion === "string")
19
21
  return result;
20
22
  }
21
- catch { /* Non-JSON assistant text remains unchanged. */ }
23
+ catch {
24
+ /* Non-JSON assistant text remains unchanged. */
25
+ }
22
26
  return;
23
27
  }
24
28
  function migratePageTaskResults(messages) {
@@ -40,15 +44,21 @@ function migratePageTaskResults(messages) {
40
44
  try {
41
45
  const accepted = JSON.parse(part.result);
42
46
  const task = result.task;
43
- if (!record(accepted) || !record(accepted.result) || accepted.result.status !== "accepted"
44
- || accepted.result.goal !== task.goal || accepted.result.completion !== task.completion)
47
+ if (!record(accepted) ||
48
+ !record(accepted.result) ||
49
+ accepted.result.status !== "accepted" ||
50
+ accepted.result.goal !== task.goal ||
51
+ accepted.result.completion !== task.completion)
45
52
  break;
46
53
  }
47
54
  catch {
48
55
  break;
49
56
  }
50
57
  const parts = [...owner.parts];
51
- parts[partIndex] = { ...part, result: JSON.stringify({ result: { pageTaskResult: result } }) };
58
+ parts[partIndex] = {
59
+ ...part,
60
+ result: JSON.stringify({ result: { pageTaskResult: result } }),
61
+ };
52
62
  migrated[index] = { ...owner, parts };
53
63
  updated = true;
54
64
  }
@@ -64,52 +74,82 @@ function isContent(value) {
64
74
  return typeof value.text === "string";
65
75
  if (value.type !== "image" || !record(value.source))
66
76
  return false;
67
- return (value.source.type === "data" || value.source.type === "url")
68
- && typeof value.source.value === "string"
69
- && (value.source.mimeType === undefined || typeof value.source.mimeType === "string");
77
+ return ((value.source.type === "data" || value.source.type === "url") &&
78
+ typeof value.source.value === "string" &&
79
+ (value.source.mimeType === undefined || typeof value.source.mimeType === "string"));
70
80
  }
71
81
  function isAttachment(value) {
72
- return record(value) && typeof value.id === "string" && typeof value.name === "string"
73
- && (isContent(value.content) || Array.isArray(value.content) && value.content.length > 0 && value.content.every(isContent))
74
- && (value.preview === undefined || typeof value.preview === "string");
82
+ return (record(value) &&
83
+ typeof value.id === "string" &&
84
+ typeof value.name === "string" &&
85
+ (isContent(value.content) ||
86
+ (Array.isArray(value.content) &&
87
+ value.content.length > 0 &&
88
+ value.content.every(isContent))) &&
89
+ (value.preview === undefined || typeof value.preview === "string"));
75
90
  }
76
91
  function isPart(value) {
77
92
  if (!record(value))
78
93
  return false;
79
94
  if (value.type === "text" || value.type === "reasoning")
80
95
  return typeof value.text === "string";
81
- return value.type === "tool" && typeof value.toolCallId === "string"
82
- && typeof value.name === "string" && typeof value.arguments === "string"
83
- && ["result", "parseError", "errorMessage"].every((key) => value[key] === undefined || typeof value[key] === "string")
84
- && (value.isError === undefined || typeof value.isError === "boolean")
85
- && (value.error === undefined || isNexfaceError(value.error))
86
- && (value.toolState === undefined || ["failed", "unknown", "not_started", "cancelled", "rejected"].includes(String(value.toolState)));
96
+ return (value.type === "tool" &&
97
+ typeof value.toolCallId === "string" &&
98
+ typeof value.name === "string" &&
99
+ typeof value.arguments === "string" &&
100
+ ["result", "parseError", "errorMessage"].every((key) => value[key] === undefined || typeof value[key] === "string") &&
101
+ (value.isError === undefined || typeof value.isError === "boolean") &&
102
+ (value.error === undefined || isNexfaceError(value.error)) &&
103
+ (value.toolState === undefined ||
104
+ ["failed", "unknown", "not_started", "cancelled", "rejected"].includes(String(value.toolState))));
87
105
  }
88
106
  function isMessage(value) {
89
- return record(value) && typeof value.id === "string" && (value.role === "user" || value.role === "assistant")
90
- && Array.isArray(value.parts) && value.parts.every(isPart)
91
- && (value.attachments === undefined || Array.isArray(value.attachments) && value.attachments.every(isAttachment))
92
- && (value.error === undefined || isNexfaceError(value.error))
93
- && (value.revisionOf === undefined || typeof value.revisionOf === "string")
94
- && (value.state === undefined || ["running", "success", "error", "cancelled"].includes(String(value.state)));
107
+ return (record(value) &&
108
+ typeof value.id === "string" &&
109
+ (value.role === "user" || value.role === "assistant") &&
110
+ Array.isArray(value.parts) &&
111
+ value.parts.every(isPart) &&
112
+ (value.attachments === undefined ||
113
+ (Array.isArray(value.attachments) && value.attachments.every(isAttachment))) &&
114
+ (value.error === undefined || isNexfaceError(value.error)) &&
115
+ (value.revisionOf === undefined || typeof value.revisionOf === "string") &&
116
+ (value.state === undefined ||
117
+ ["running", "success", "error", "cancelled"].includes(String(value.state))));
95
118
  }
96
119
  function restoreMessage(message) {
97
- const unfinished = message.state === "running" || message.parts.some((part) => part.type === "tool" && part.result === undefined && !part.isError);
98
- const error = unfinished ? runError(`restored:${message.id}`, { code: "CHAT_STREAM_INCOMPLETE" }, message.parts.some((part) => part.type === "tool" && part.result === undefined)) : message.error;
120
+ const unfinished = message.state === "running" ||
121
+ message.parts.some((part) => part.type === "tool" && part.result === undefined && !part.isError);
122
+ const error = unfinished
123
+ ? runError(`restored:${message.id}`, { code: "CHAT_STREAM_INCOMPLETE" }, message.parts.some((part) => part.type === "tool" && part.result === undefined))
124
+ : message.error;
99
125
  const parts = message.parts.map((part) => {
100
126
  if (part.type !== "tool")
101
127
  return part;
102
128
  const missing = part.result === undefined && !part.isError;
103
- const result = missing ? JSON.stringify({ error: { code: "EXECUTION_OUTCOME_UNKNOWN", message: interruptedMessage } }) : part.result;
129
+ const result = missing
130
+ ? JSON.stringify({
131
+ error: { code: "EXECUTION_OUTCOME_UNKNOWN", message: interruptedMessage },
132
+ })
133
+ : part.result;
104
134
  let presentation = toolError(part.error?.id ?? `${message.id}:${part.toolCallId}`, part.toolCallId, result ?? JSON.stringify({ error: { code: "TOOL_ERROR" } }), missing ? error?.id : part.error?.parentErrorId, false, part.name);
105
135
  if (!presentation.toolState && part.isError)
106
136
  presentation = toolError(part.error?.id ?? `${message.id}:${part.toolCallId}`, part.toolCallId, JSON.stringify({ error: { code: "TOOL_ERROR" } }));
107
- return { ...part, ...(result === undefined ? {} : { result }), isError: Boolean(presentation.error),
108
- ...(presentation.error ? { error: presentation.error, errorMessage: presentation.error.userMessage } : {}),
137
+ return {
138
+ ...part,
139
+ ...(result === undefined ? {} : { result }),
140
+ isError: Boolean(presentation.error),
141
+ ...(presentation.error
142
+ ? { error: presentation.error, errorMessage: presentation.error.userMessage }
143
+ : {}),
109
144
  ...(presentation.toolState ? { toolState: presentation.toolState } : {}),
110
145
  };
111
146
  });
112
- return { ...message, parts, ...(unfinished ? { state: "error" } : {}), ...(error ? { error } : {}) };
147
+ return {
148
+ ...message,
149
+ parts,
150
+ ...(unfinished ? { state: "error" } : {}),
151
+ ...(error ? { error } : {}),
152
+ };
113
153
  }
114
154
  function withoutReasoning(messages) {
115
155
  return messages.flatMap((message) => {
@@ -125,16 +165,26 @@ export function readChatStorage(key, version) {
125
165
  if (version)
126
166
  version.value = raw;
127
167
  const value = JSON.parse(raw ?? "null");
128
- if (!record(value) || value.version !== 3 || !Array.isArray(value.sessions) || !value.sessions.length)
168
+ if (!record(value) ||
169
+ value.version !== 3 ||
170
+ !Array.isArray(value.sessions) ||
171
+ !value.sessions.length)
129
172
  return;
130
173
  const sessions = [];
131
174
  for (const session of value.sessions) {
132
- if (!record(session) || typeof session.id !== "string" || !session.id
133
- || (session.title !== undefined && typeof session.title !== "string")
134
- || !Array.isArray(session.messages) || !session.messages.every(isMessage)
135
- || sessions.some((existing) => existing.id === session.id))
175
+ if (!record(session) ||
176
+ typeof session.id !== "string" ||
177
+ !session.id ||
178
+ (session.title !== undefined && typeof session.title !== "string") ||
179
+ !Array.isArray(session.messages) ||
180
+ !session.messages.every(isMessage) ||
181
+ sessions.some((existing) => existing.id === session.id))
136
182
  return;
137
- sessions.push({ id: session.id, ...(session.title ? { title: session.title } : {}), messages: migratePageTaskResults(withoutReasoning(session.messages)).map(restoreMessage) });
183
+ sessions.push({
184
+ id: session.id,
185
+ ...(session.title ? { title: session.title } : {}),
186
+ messages: migratePageTaskResults(withoutReasoning(session.messages)).map(restoreMessage),
187
+ });
138
188
  }
139
189
  const activeSessionId = sessions.find((session) => session.id === value.activeSessionId)?.id ?? sessions[0].id;
140
190
  return { sessions, activeSessionId };
@@ -148,12 +198,22 @@ export function writeChatStorage(key, state, version) {
148
198
  const next = JSON.stringify({
149
199
  version: 3,
150
200
  activeSessionId: state.activeSessionId,
151
- sessions: state.sessions.map(({ id, title, messages }) => ({ id, title, messages: withoutReasoning(messages).map((message) => ({
152
- ...message, parts: message.parts.map((part) => part.type === "tool" && part.error ? {
153
- ...part, errorMessage: part.error.userMessage,
154
- result: JSON.stringify({ error: { code: part.error.code, message: part.error.userMessage } }),
155
- } : part),
156
- })) })),
201
+ sessions: state.sessions.map(({ id, title, messages }) => ({
202
+ id,
203
+ title,
204
+ messages: withoutReasoning(messages).map((message) => ({
205
+ ...message,
206
+ parts: message.parts.map((part) => part.type === "tool" && part.error
207
+ ? {
208
+ ...part,
209
+ errorMessage: part.error.userMessage,
210
+ result: JSON.stringify({
211
+ error: { code: part.error.code, message: part.error.userMessage },
212
+ }),
213
+ }
214
+ : part),
215
+ })),
216
+ })),
157
217
  });
158
218
  if (next === version.value)
159
219
  return "unchanged";
@@ -169,15 +229,31 @@ export function writeChatStorage(key, state, version) {
169
229
  }
170
230
  }
171
231
  export function conversationFromMessages(messages) {
172
- const legacy = new Set(["callAppTool", "getSnapshot", "executeCode", "loadSkill", "finish", "nxf_executeCode"]);
232
+ const legacy = new Set([
233
+ "callAppTool",
234
+ "getSnapshot",
235
+ "executeCode",
236
+ "loadSkill",
237
+ "finish",
238
+ "nxf_executeCode",
239
+ ]);
173
240
  if (messages.some((message) => message.parts.some((part) => part.type === "tool" && legacy.has(part.name))))
174
241
  throw new Error("旧版本会话无法恢复,请升级后新建会话。");
175
242
  // Restore conversation content only. Runtime catalogs, snapshots, approvals and Skills belong to the new page.
176
- return messages.filter((message) => message.role !== "assistant" || message.parts.length > 0).map((message) => {
243
+ return messages
244
+ .filter((message) => message.role !== "assistant" || message.parts.length > 0)
245
+ .map((message) => {
177
246
  if (message.role === "user") {
178
- const text = message.parts.flatMap((part) => part.type === "text" ? [part.text] : []).join("\n");
179
- return { id: message.id, role: "user", content: message.attachments?.length
180
- ? [{ type: "text", text }, ...message.attachments.flatMap(attachmentContent)] : text };
247
+ const text = message.parts
248
+ .flatMap((part) => (part.type === "text" ? [part.text] : []))
249
+ .join("\n");
250
+ return {
251
+ id: message.id,
252
+ role: "user",
253
+ content: message.attachments?.length
254
+ ? [{ type: "text", text }, ...message.attachments.flatMap(attachmentContent)]
255
+ : text,
256
+ };
181
257
  }
182
258
  const sections = [];
183
259
  let text;
@@ -192,7 +268,9 @@ export function conversationFromMessages(messages) {
192
268
  if (text !== undefined)
193
269
  sections.push(text);
194
270
  text = undefined;
195
- sections.push(part.name === "nxf_getSnapshot" || part.name === "nxf_executeAction" || part.name === "nxf_applyAction"
271
+ sections.push(part.name === "nxf_getSnapshot" ||
272
+ part.name === "nxf_executeAction" ||
273
+ part.name === "nxf_applyAction"
196
274
  ? "之前调用了页面自动化工具;页面已刷新,需要重新观察页面。"
197
275
  : `历史工具记录 ${part.name}\n输入:${part.arguments}\n结果:${part.result ?? part.errorMessage ?? interruptedMessage}`);
198
276
  }
@@ -202,4 +280,3 @@ export function conversationFromMessages(messages) {
202
280
  return { id: message.id, role: "assistant", content, toolCalls: [] };
203
281
  });
204
282
  }
205
- //# sourceMappingURL=storage.js.map
package/dist/styles.css CHANGED
@@ -2989,14 +2989,49 @@
2989
2989
  }
2990
2990
  }
2991
2991
  /* Nexface layout and business content only; general UI is compiled from the pinned official homepage Demo. */
2992
- .nexface-chat { box-sizing: border-box; position: relative; min-width: 0; isolation: isolate; border: 1px solid var(--nxf-border); border-radius: 16px; background: var(--nxf-background); }
2993
- .nexface-chat[data-layout="floating"] { position: fixed; right: 24px; bottom: 24px; z-index: 10000; }
2994
- .nexface-chat[data-layout="floating"][data-side="left"] { left: 24px; right: auto; }
2995
- .nexface-chat[data-layout="floating"]:not([data-fullscreen]) .nexface-chat__panel { width: min(546px, calc(100vw - 32px)); height: min(760px, calc(100dvh - 48px)); }
2996
- .nexface-chat[data-layout="docked"] { position: fixed; inset: 0 0 0 auto; width: min(var(--nexface-chat-panel-width), 100vw); z-index: 1000; }
2997
- .nexface-chat[data-layout="docked"][data-side="left"] { inset: 0 auto 0 0; }
2998
- .nexface-chat[data-layout="inline"] { width: 100%; height: 100%; }
2999
- .nexface-chat[data-fullscreen][data-layout][data-side] { position: fixed; inset: 0; width: 100vw; height: 100dvh; z-index: 10001; }
2992
+ .nexface-chat {
2993
+ box-sizing: border-box;
2994
+ position: relative;
2995
+ min-width: 0;
2996
+ isolation: isolate;
2997
+ border: 1px solid var(--nxf-border);
2998
+ border-radius: 16px;
2999
+ background: var(--nxf-background);
3000
+ }
3001
+ .nexface-chat[data-layout="floating"] {
3002
+ position: fixed;
3003
+ right: 24px;
3004
+ bottom: 24px;
3005
+ z-index: 10000;
3006
+ }
3007
+ .nexface-chat[data-layout="floating"][data-side="left"] {
3008
+ left: 24px;
3009
+ right: auto;
3010
+ }
3011
+ .nexface-chat[data-layout="floating"]:not([data-fullscreen]) .nexface-chat__panel {
3012
+ width: min(546px, calc(100vw - 32px));
3013
+ height: min(760px, calc(100dvh - 48px));
3014
+ }
3015
+ .nexface-chat[data-layout="docked"] {
3016
+ position: fixed;
3017
+ inset: 0 0 0 auto;
3018
+ width: min(var(--nexface-chat-panel-width), 100vw);
3019
+ z-index: 1000;
3020
+ }
3021
+ .nexface-chat[data-layout="docked"][data-side="left"] {
3022
+ inset: 0 auto 0 0;
3023
+ }
3024
+ .nexface-chat[data-layout="inline"] {
3025
+ width: 100%;
3026
+ height: 100%;
3027
+ }
3028
+ .nexface-chat[data-fullscreen][data-layout][data-side] {
3029
+ position: fixed;
3030
+ inset: 0;
3031
+ width: 100vw;
3032
+ height: 100dvh;
3033
+ z-index: 10001;
3034
+ }
3000
3035
  /* Internal token bridge shared by the Chat surface and its instance portal. */
3001
3036
  .nexface-ui {
3002
3037
  --nxf-background: var(--nexface-chat-background, #fff);
@@ -3008,16 +3043,60 @@
3008
3043
  --nxf-primary-hover: var(--nexface-chat-accent-hover, #3f3f46);
3009
3044
  --nxf-primary-foreground: var(--nexface-chat-on-accent, #fff);
3010
3045
  color: var(--nxf-foreground);
3011
- font-family: var(--nexface-chat-font-family, "Nexface Public Sans", ui-sans-serif, system-ui, sans-serif);
3012
- }
3013
- .nexface-chat-portals { position: fixed; inset: 0; z-index: 10010; pointer-events: none; }
3014
- .nexface-chat-portals > * { pointer-events: auto; }
3015
- .nexface-chat__dialogs { position: absolute; inset: 0; z-index: 80; pointer-events: none; border-radius: inherit; }
3016
- .nexface-chat__dialog-layer { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; overflow: auto; background: #00000030; pointer-events: auto; border-radius: inherit; outline: none; }
3017
- .nexface-chat__dialog-layer > div { max-height: 100%; }
3018
- .nexface-ui [data-slot="tooltip-content"] { z-index: 70; }
3019
- .nexface-ui [data-slot="button"][data-variant="default"]:hover:not(:disabled) { background-color: var(--nxf-primary-hover); }
3046
+ font-family: var(
3047
+ --nexface-chat-font-family,
3048
+ "Nexface Public Sans",
3049
+ ui-sans-serif,
3050
+ system-ui,
3051
+ sans-serif
3052
+ );
3053
+ }
3054
+ .nexface-chat-portals {
3055
+ position: fixed;
3056
+ inset: 0;
3057
+ z-index: 10010;
3058
+ pointer-events: none;
3059
+ }
3060
+ .nexface-chat-portals > * {
3061
+ pointer-events: auto;
3062
+ }
3063
+ .nexface-chat__dialogs {
3064
+ position: absolute;
3065
+ inset: 0;
3066
+ z-index: 80;
3067
+ pointer-events: none;
3068
+ border-radius: inherit;
3069
+ }
3070
+ .nexface-chat__dialog-layer {
3071
+ position: absolute;
3072
+ inset: 0;
3073
+ display: grid;
3074
+ place-items: center;
3075
+ padding: 16px;
3076
+ overflow: auto;
3077
+ background: #00000030;
3078
+ pointer-events: auto;
3079
+ border-radius: inherit;
3080
+ outline: none;
3081
+ }
3082
+ .nexface-chat__dialog-layer > div {
3083
+ max-height: 100%;
3084
+ }
3085
+ .nexface-ui [data-slot="tooltip-content"] {
3086
+ z-index: 70;
3087
+ }
3088
+ .nexface-ui [data-slot="button"][data-variant="default"]:hover:not(:disabled) {
3089
+ background-color: var(--nxf-primary-hover);
3090
+ }
3020
3091
 
3021
- .nexface-chat__session-sidebar { width: var(--nexface-session-sidebar-width, 240px); }
3022
- .nexface-chat__session-sidebar[data-layout="overlay"] { left: 0; max-width: 85%; }
3023
- .nexface-chat__session-sidebar[data-layout="outside"] { right: 100%; border-radius: 16px 0 0 16px; }
3092
+ .nexface-chat__session-sidebar {
3093
+ width: var(--nexface-session-sidebar-width, 240px);
3094
+ }
3095
+ .nexface-chat__session-sidebar[data-layout="overlay"] {
3096
+ left: 0;
3097
+ max-width: 85%;
3098
+ }
3099
+ .nexface-chat__session-sidebar[data-layout="outside"] {
3100
+ right: 100%;
3101
+ border-radius: 16px 0 0 16px;
3102
+ }
@@ -3,10 +3,14 @@ export function getToolResultError(content) {
3
3
  const error = JSON.parse(content)?.error;
4
4
  if (typeof error === "string")
5
5
  return error;
6
- if (error && typeof error === "object" && "message" in error && typeof error.message === "string")
6
+ if (error &&
7
+ typeof error === "object" &&
8
+ "message" in error &&
9
+ typeof error.message === "string")
7
10
  return error.message;
8
11
  }
9
- catch { /* Tool results may contain plain text. */ }
12
+ catch {
13
+ /* Tool results may contain plain text. */
14
+ }
10
15
  return undefined;
11
16
  }
12
- //# sourceMappingURL=tool-result.js.map
package/dist/types.js CHANGED
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=types.js.map
@@ -1,5 +1,5 @@
1
1
  import { type PropsWithChildren, type FC } from "react";
2
- export declare function AttachmentUI({ preview, children }: PropsWithChildren<{
2
+ export declare function AttachmentUI({ preview, children, }: PropsWithChildren<{
3
3
  preview?: string | undefined;
4
4
  }>): import("react").JSX.Element;
5
5
  export declare const UserMessageAttachments: FC;
@@ -1,16 +1,19 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useState, isValidElement, createContext, useContext, } from "react";
4
- import { XIcon, PlusIcon, FileText, Loader2Icon, AlertCircleIcon, } from "lucide-react";
4
+ import { XIcon, PlusIcon, FileText, Loader2Icon, AlertCircleIcon } from "lucide-react";
5
5
  import { AttachmentPrimitive, ComposerPrimitive, MessagePrimitive, useAuiState, useAui, } from "@assistant-ui/react";
6
- import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "./tooltip.js";
7
- import { Dialog, DialogTitle, DialogContent, DialogTrigger, } from "./dialog.js";
8
- import { Avatar, AvatarFallback, } from "./avatar.js";
6
+ import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./tooltip.js";
7
+ import { Dialog, DialogTitle, DialogContent, DialogTrigger } from "./dialog.js";
8
+ import { Avatar, AvatarFallback } from "./avatar.js";
9
9
  import { TooltipIconButton } from "./tooltip-icon-button.js";
10
10
  import { useAttachmentSrc } from "./use-attachment-src.js";
11
11
  import { cn } from "./utils.js";
12
12
  const PreviewContext = createContext(undefined);
13
- const usePreview = () => { const fallback = useAttachmentSrc(); return useContext(PreviewContext) ?? fallback; };
13
+ const usePreview = () => {
14
+ const fallback = useAttachmentSrc();
15
+ return useContext(PreviewContext) ?? fallback;
16
+ };
14
17
  const AttachmentPreview = ({ src }) => {
15
18
  const [isLoaded, setIsLoaded] = useState(false);
16
19
  return (_jsx("img", { src: src, alt: "\u9644\u4EF6\u9884\u89C8", className: cn("block h-auto max-h-[80vh] w-auto max-w-full rounded-sm object-contain transition-opacity duration-300 motion-reduce:transition-none", isLoaded
@@ -21,15 +24,15 @@ const AttachmentPreviewDialog = ({ children }) => {
21
24
  const src = usePreview();
22
25
  if (!src)
23
26
  return _jsx(_Fragment, { children: children });
24
- return (_jsxs(Dialog, { children: [_jsx(DialogTrigger, { className: cn("aui-attachment-preview-trigger cursor-zoom-in"), asChild: true, children: isValidElement(children) ? (children) : (_jsx("button", { type: "button", children: children })) }), _jsxs(DialogContent, { className: cn("aui-attachment-preview-dialog-content [&>button]:bg-foreground/60 [&>button]:hover:bg-foreground/80 [&_svg]:text-background p-2 sm:max-w-3xl [&>button]:rounded-full [&>button]:p-1 [&>button]:opacity-100 [&>button]:ring-0!"), children: [_jsx(DialogTitle, { className: cn("aui-sr-only sr-only"), children: "\u56FE\u7247\u9644\u4EF6\u9884\u89C8" }), _jsx("div", { className: cn("aui-attachment-preview bg-background relative mx-auto flex max-h-[80dvh] w-full items-center justify-center overflow-hidden rounded-sm"), children: _jsx(AttachmentPreview, { src: src }) })] })] }));
27
+ return (_jsxs(Dialog, { children: [_jsx(DialogTrigger, { className: cn("aui-attachment-preview-trigger cursor-zoom-in"), asChild: true, children: isValidElement(children) ? children : _jsx("button", { type: "button", children: children }) }), _jsxs(DialogContent, { className: cn("aui-attachment-preview-dialog-content [&>button]:bg-foreground/60 [&>button]:hover:bg-foreground/80 [&_svg]:text-background p-2 sm:max-w-3xl [&>button]:rounded-full [&>button]:p-1 [&>button]:opacity-100 [&>button]:ring-0!"), children: [_jsx(DialogTitle, { className: cn("aui-sr-only sr-only"), children: "\u56FE\u7247\u9644\u4EF6\u9884\u89C8" }), _jsx("div", { className: cn("aui-attachment-preview bg-background relative mx-auto flex max-h-[80dvh] w-full items-center justify-center overflow-hidden rounded-sm"), children: _jsx(AttachmentPreview, { src: src }) })] })] }));
25
28
  };
26
29
  const AttachmentThumb = () => {
27
30
  const src = usePreview();
28
31
  const name = useAuiState((s) => s.attachment.name);
29
- return _jsx(Avatar, { className: cn("aui-attachment-tile-avatar h-full w-full rounded-none"), children: src ? _jsx("img", { src: src, alt: name, className: cn("aui-attachment-tile-image h-full w-full rounded-none object-cover") }) : _jsx(AvatarFallback, { children: _jsx(FileText, { className: cn("aui-attachment-tile-fallback-icon text-muted-foreground/80 size-6 stroke-[1.5]") }) }) });
32
+ return (_jsx(Avatar, { className: cn("aui-attachment-tile-avatar h-full w-full rounded-none"), children: src ? (_jsx("img", { src: src, alt: name, className: cn("aui-attachment-tile-image h-full w-full rounded-none object-cover") })) : (_jsx(AvatarFallback, { children: _jsx(FileText, { className: cn("aui-attachment-tile-fallback-icon text-muted-foreground/80 size-6 stroke-[1.5]") }) })) }));
30
33
  };
31
- export function AttachmentUI({ preview, children }) {
32
- return _jsx(PreviewContext.Provider, { value: preview, children: _jsx(AttachmentContent, { children: children }) });
34
+ export function AttachmentUI({ preview, children, }) {
35
+ return (_jsx(PreviewContext.Provider, { value: preview, children: _jsx(AttachmentContent, { children: children }) }));
33
36
  }
34
37
  const AttachmentContent = ({ children }) => {
35
38
  const aui = useAui();
@@ -50,21 +53,15 @@ const AttachmentContent = ({ children }) => {
50
53
  });
51
54
  const uploadState = useAuiState((s) => s.attachment.status.type === "running"
52
55
  ? "uploading"
53
- : s.attachment.status.type === "incomplete" &&
54
- s.attachment.status.reason === "error"
56
+ : s.attachment.status.type === "incomplete" && s.attachment.status.reason === "error"
55
57
  ? "error"
56
58
  : undefined);
57
59
  const isUploading = uploadState === "uploading";
58
60
  const isError = uploadState === "error";
59
- const errorMessage = useAuiState((s) => s.attachment.status.type === "incomplete" &&
60
- s.attachment.status.reason === "error"
61
+ const errorMessage = useAuiState((s) => s.attachment.status.type === "incomplete" && s.attachment.status.reason === "error"
61
62
  ? (s.attachment.status.message ?? "附件处理失败")
62
63
  : undefined);
63
- return (_jsx(TooltipProvider, { children: _jsxs(Tooltip, { children: [_jsxs(AttachmentPrimitive.Root, { className: cn("aui-attachment-root relative", isComposer &&
64
- "animate-in fade-in-0 zoom-in-95 duration-200 motion-reduce:animate-none", isImage &&
65
- !isComposer &&
66
- "aui-attachment-root-message only:*:first:size-24"), children: [_jsx(AttachmentPreviewDialog, { children: _jsx(TooltipTrigger, { asChild: true, children: _jsxs("div", { className: cn("aui-attachment-tile bg-muted hover:after:bg-foreground/10 focus-visible:ring-ring/50 relative size-14 cursor-pointer overflow-hidden rounded-[calc(var(--nxf-composer-radius,1rem)-var(--nxf-composer-padding,8px))] transition-transform outline-none after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] after:ring-1 after:ring-black/10 after:transition-colors after:ring-inset focus-visible:ring-1 active:scale-[0.96] motion-reduce:transition-none dark:after:ring-white/10", isError &&
67
- "after:ring-destructive/60 dark:after:ring-destructive/60"), role: "button", tabIndex: 0, onKeyDown: (e) => {
64
+ return (_jsx(TooltipProvider, { children: _jsxs(Tooltip, { children: [_jsxs(AttachmentPrimitive.Root, { className: cn("aui-attachment-root relative", isComposer && "animate-in fade-in-0 zoom-in-95 duration-200 motion-reduce:animate-none", isImage && !isComposer && "aui-attachment-root-message only:*:first:size-24"), children: [_jsx(AttachmentPreviewDialog, { children: _jsx(TooltipTrigger, { asChild: true, children: _jsxs("div", { className: cn("aui-attachment-tile bg-muted hover:after:bg-foreground/10 focus-visible:ring-ring/50 relative size-14 cursor-pointer overflow-hidden rounded-[calc(var(--nxf-composer-radius,1rem)-var(--nxf-composer-padding,8px))] transition-transform outline-none after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] after:ring-1 after:ring-black/10 after:transition-colors after:ring-inset focus-visible:ring-1 active:scale-[0.96] motion-reduce:transition-none dark:after:ring-white/10", isError && "after:ring-destructive/60 dark:after:ring-destructive/60"), role: "button", tabIndex: 0, onKeyDown: (e) => {
68
65
  if (e.key === "Enter") {
69
66
  e.preventDefault();
70
67
  e.currentTarget.click();
@@ -75,7 +72,7 @@ const AttachmentContent = ({ children }) => {
75
72
  }, onKeyUp: (e) => {
76
73
  if (e.key === " ")
77
74
  e.currentTarget.click();
78
- }, "aria-label": `${typeLabel}附件${isError ? ",处理失败" : isUploading ? ",正在处理" : ""}`, children: [_jsx(AttachmentThumb, {}), isUploading && (_jsx("div", { "aria-hidden": "true", className: cn("aui-attachment-tile-uploading bg-background/60 animate-in fade-in-0 absolute inset-0 flex items-center justify-center backdrop-blur-[2px] motion-reduce:animate-none"), children: _jsx(Loader2Icon, { className: cn("text-muted-foreground size-4 animate-spin") }) })), isError && (_jsx("div", { "aria-hidden": "true", className: cn("aui-attachment-tile-error bg-background/70 animate-in fade-in-0 absolute inset-0 flex items-center justify-center backdrop-blur-[2px] motion-reduce:animate-none"), children: _jsx(AlertCircleIcon, { className: cn("text-destructive size-4") }) }))] }) }) }), isComposer && _jsx(AttachmentRemove, {}), children] }), _jsxs(TooltipContent, { side: "top", children: [_jsx(AttachmentPrimitive.Name, {}), errorMessage && (_jsx("p", { className: cn("aui-attachment-error-message"), children: errorMessage }))] })] }) }));
75
+ }, "aria-label": `${typeLabel}附件${isError ? ",处理失败" : isUploading ? ",正在处理" : ""}`, children: [_jsx(AttachmentThumb, {}), isUploading && (_jsx("div", { "aria-hidden": "true", className: cn("aui-attachment-tile-uploading bg-background/60 animate-in fade-in-0 absolute inset-0 flex items-center justify-center backdrop-blur-[2px] motion-reduce:animate-none"), children: _jsx(Loader2Icon, { className: cn("text-muted-foreground size-4 animate-spin") }) })), isError && (_jsx("div", { "aria-hidden": "true", className: cn("aui-attachment-tile-error bg-background/70 animate-in fade-in-0 absolute inset-0 flex items-center justify-center backdrop-blur-[2px] motion-reduce:animate-none"), children: _jsx(AlertCircleIcon, { className: cn("text-destructive size-4") }) }))] }) }) }), isComposer && _jsx(AttachmentRemove, {}), children] }), _jsxs(TooltipContent, { side: "top", children: [_jsx(AttachmentPrimitive.Name, {}), errorMessage && _jsx("p", { className: cn("aui-attachment-error-message"), children: errorMessage })] })] }) }));
79
76
  };
80
77
  const AttachmentRemove = () => {
81
78
  const name = useAuiState((s) => s.attachment.name);
@@ -90,4 +87,3 @@ export const ComposerAttachments = () => {
90
87
  export const ComposerAddAttachment = () => {
91
88
  return (_jsx(ComposerPrimitive.AddAttachment, { asChild: true, children: _jsx(TooltipIconButton, { tooltip: "\u6DFB\u52A0\u9644\u4EF6", side: "bottom", variant: "ghost", size: "icon", className: cn("aui-composer-add-attachment text-muted-foreground hover:text-foreground hover:bg-muted-foreground/15 dark:border-muted-foreground/15 dark:hover:bg-muted-foreground/30 size-7 rounded-full active:scale-[0.96] motion-reduce:transition-none"), "aria-label": "\u6DFB\u52A0\u9644\u4EF6", children: _jsx(PlusIcon, { className: cn("aui-attachment-add-icon size-4") }) }) }));
92
89
  };
93
- //# sourceMappingURL=attachment.aui.js.map
package/dist/ui/avatar.js CHANGED
@@ -12,4 +12,3 @@ function AvatarFallback({ className, ...props }) {
12
12
  return (_jsx(AvatarPrimitive.Fallback, { "data-slot": "avatar-fallback", className: cn("flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs", className), ...props }));
13
13
  }
14
14
  export { Avatar, AvatarImage, AvatarFallback };
15
- //# sourceMappingURL=avatar.js.map
package/dist/ui/button.js CHANGED
@@ -35,4 +35,3 @@ const Button = React.forwardRef(function Button({ className, variant = "default"
35
35
  return (_jsx(Comp, { ref: ref, "data-slot": "button", "data-variant": variant, "data-size": size, className: cn(buttonVariants({ variant, size, className })), ...props }));
36
36
  });
37
37
  export { Button, buttonVariants };
38
- //# sourceMappingURL=button.js.map
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { useEffect, useRef, useState, } from "react";
3
+ import { useEffect, useRef, useState } from "react";
4
4
  import { CheckIcon, CopyIcon } from "lucide-react";
5
5
  import { cn } from "./utils.js";
6
6
  function CopyButton({ getText, onCopied, className, }) {
@@ -30,7 +30,7 @@ function CopyButton({ getText, onCopied, className, }) {
30
30
  setCopied(true);
31
31
  clearTimeout(copyTimer.current);
32
32
  copyTimer.current = setTimeout(() => setCopied(false), 1500);
33
- }, className: cn("text-muted-foreground hover:text-foreground grid size-6 shrink-0 place-items-center rounded-sm transition-colors", className), children: copied ? (_jsx(CheckIcon, { className: cn("size-3.5") })) : (_jsx(CopyIcon, { className: cn("size-3.5") })) }));
33
+ }, className: cn("text-muted-foreground hover:text-foreground grid size-6 shrink-0 place-items-center rounded-sm transition-colors", className), children: copied ? _jsx(CheckIcon, { className: cn("size-3.5") }) : _jsx(CopyIcon, { className: cn("size-3.5") }) }));
34
34
  }
35
35
  /**
36
36
  * Chrome for highlighted code: a hairline field panel with an optional title
@@ -46,4 +46,3 @@ export function CodeBlock({ title, viewportClassName, copyText, onCopied, lineNu
46
46
  return (_jsxs("figure", { className: cn("not-prose not-fumadocs-codeblock border-foreground/10 bg-foreground/[0.025] dark:bg-foreground/[0.04] group/code relative my-6 flex min-w-0 flex-col overflow-hidden rounded-sm border", className), ...props, children: [title ? (_jsxs("figcaption", { className: cn("border-foreground/10 flex h-9 shrink-0 items-center justify-between gap-2 border-b py-0 ps-3.5 pe-2"), children: [_jsx("span", { className: cn("text-muted-foreground min-w-0 truncate font-mono text-[11px] font-medium tracking-wide"), children: title }), _jsx(CopyButton, { getText: getText, onCopied: onCopied })] })) : (_jsx(CopyButton, { getText: getText, onCopied: onCopied, className: cn("bg-background/80 absolute top-2 right-2 z-10 opacity-0 backdrop-blur-sm transition-opacity group-hover/code:opacity-100 focus-visible:opacity-100 [@media(pointer:coarse)]:opacity-100") })), _jsx("div", { ref: viewportRef, role: "region", "aria-label": "\u4EE3\u7801", tabIndex: 0, className: cn("focus-visible:outline-foreground/20 min-w-0 overflow-x-auto py-3.5 font-mono text-[12.5px] leading-relaxed [font-variant-ligatures:none] focus-visible:outline-1 focus-visible:-outline-offset-1", "[&_code]:bg-transparent! [&_pre]:w-max [&_pre]:min-w-full [&_pre]:bg-transparent! [&_pre]:px-3.5", "[&_.line]:inline-block [&_.line]:min-h-[1lh] [&_.line]:w-full", "[&_code_span]:[color:var(--shiki-light,inherit)]", "dark:[&_code_span]:[color:var(--shiki-dark)]!", "[&_.highlighted]:bg-blue-500/8 [&_.highlighted]:shadow-[inset_2px_0_0_#3b82f6] dark:[&_.highlighted]:bg-blue-500/15", "[&_pre[data-line-numbers]]:[counter-reset:line]", "[&_pre[data-line-numbers]_.line]:relative [&_pre[data-line-numbers]_.line]:pl-8 [&_pre[data-line-numbers]_.line]:[counter-increment:line]", "[&_pre[data-line-numbers]_.line]:before:text-muted-foreground/40 [&_pre[data-line-numbers]_.line]:before:absolute [&_pre[data-line-numbers]_.line]:before:left-0 [&_pre[data-line-numbers]_.line]:before:w-5 [&_pre[data-line-numbers]_.line]:before:text-right [&_pre[data-line-numbers]_.line]:before:tabular-nums [&_pre[data-line-numbers]_.line]:before:[content:counter(line)]", lineNumbers &&
47
47
  "[&_.line]:before:text-muted-foreground/40 [counter-reset:line] [&_.line]:relative [&_.line]:pl-8 [&_.line]:[counter-increment:line] [&_.line]:before:absolute [&_.line]:before:left-0 [&_.line]:before:w-5 [&_.line]:before:text-right [&_.line]:before:tabular-nums [&_.line]:before:[content:counter(line)]", viewportClassName), children: children })] }));
48
48
  }
49
- //# sourceMappingURL=code-block.js.map
@@ -6,10 +6,9 @@ const Collapsible = forwardRef(function Collapsible(props, ref) {
6
6
  return _jsx(CollapsiblePrimitive.Root, { "data-slot": "collapsible", ref: ref, ...props });
7
7
  });
8
8
  const CollapsibleTrigger = forwardRef(function CollapsibleTrigger(props, ref) {
9
- return (_jsx(CollapsiblePrimitive.Trigger, { "data-slot": "collapsible-trigger", ref: ref, ...props }));
9
+ return _jsx(CollapsiblePrimitive.Trigger, { "data-slot": "collapsible-trigger", ref: ref, ...props });
10
10
  });
11
11
  const CollapsibleContent = forwardRef(function CollapsibleContent(props, ref) {
12
- return (_jsx(CollapsiblePrimitive.Content, { "data-slot": "collapsible-content", ref: ref, ...props }));
12
+ return _jsx(CollapsiblePrimitive.Content, { "data-slot": "collapsible-content", ref: ref, ...props });
13
13
  });
14
14
  export { Collapsible, CollapsibleTrigger, CollapsibleContent };
15
- //# sourceMappingURL=collapsible.js.map
@@ -13,6 +13,7 @@ export function ComposerVoice({ recording }) {
13
13
  const timer = setInterval(() => setTick((value) => value + 1), 100);
14
14
  return () => clearInterval(timer);
15
15
  }, [recording]);
16
- return _jsx("div", { "data-slot": "composer-voice", "data-recording": recording || undefined, className: cn("flex h-7 min-w-0 flex-1 items-center overflow-hidden px-2"), children: _jsx("div", { className: cn("flex h-6 w-full items-center justify-between overflow-hidden"), "aria-hidden": true, children: Array.from({ length: barCount }, (_, index) => _jsx("span", { className: cn("w-0.5 shrink-0 rounded-full transition-[height,background-color] duration-150 motion-reduce:transition-none", recording ? "bg-foreground/50" : "bg-foreground/25"), style: { height: recording ? 5 + Math.abs(Math.sin(index * 1.35 + tick * 0.55)) * 13 : 3 } }, index)) }) });
16
+ return (_jsx("div", { "data-slot": "composer-voice", "data-recording": recording || undefined, className: cn("flex h-7 min-w-0 flex-1 items-center overflow-hidden px-2"), children: _jsx("div", { className: cn("flex h-6 w-full items-center justify-between overflow-hidden"), "aria-hidden": true, children: Array.from({ length: barCount }, (_, index) => (_jsx("span", { className: cn("w-0.5 shrink-0 rounded-full transition-[height,background-color] duration-150 motion-reduce:transition-none", recording ? "bg-foreground/50" : "bg-foreground/25"), style: {
17
+ height: recording ? 5 + Math.abs(Math.sin(index * 1.35 + tick * 0.55)) * 13 : 3,
18
+ } }, index))) }) }));
17
19
  }
18
- //# sourceMappingURL=composer-voice.js.map
@@ -11,4 +11,4 @@ declare function DialogFooter({ className, showCloseButton, children, ...props }
11
11
  }): React.JSX.Element;
12
12
  declare function DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>): React.JSX.Element;
13
13
  declare function DialogDescription({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Description>): React.JSX.Element;
14
- export { Dialog, DialogContent, DialogDescription, DialogFooter, DialogPortal, DialogTitle, DialogTrigger };
14
+ export { Dialog, DialogContent, DialogDescription, DialogFooter, DialogPortal, DialogTitle, DialogTrigger, };