BusinessAssistantMobileInputShell.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659
  1. <template>
  2. <section class="chat-input-area" :class="{ 'is-desktop': isDesktop }">
  3. <div class="chat-input-box">
  4. <div v-if="uploadedFiles.length > 0" class="attachments-area">
  5. <div v-for="file in uploadedFiles" :key="file.id" class="attachment-item"
  6. :class="file.isImage ? 'is-image' : 'is-file'">
  7. <img v-if="file.isImage && file.url" :src="file.url" class="attachment-image-preview" :alt="file.name" />
  8. <div v-else class="file-icon">{{ getFileExtension(file.name) }}</div>
  9. <div class="file-info">
  10. <div class="file-name">{{ file.name }}</div>
  11. <div class="file-progress" :class="{ error: file.status === 'error' }">
  12. {{ getFileStatusText(file) }}
  13. </div>
  14. <div v-if="file.status === 'uploading'" class="file-progress-bar">
  15. <div class="file-progress-bar-fill" :style="{ width: `${file.progress}%` }"></div>
  16. </div>
  17. </div>
  18. <button type="button" class="attachment-delete-btn" aria-label="移除附件" @click="emit('removeFile', file.id)">
  19. ×
  20. </button>
  21. <div v-if="file.status === 'uploading'" class="attachment-progress-overlay">
  22. <div class="progress-spinner"></div>
  23. </div>
  24. </div>
  25. </div>
  26. <div class="textarea-wrapper">
  27. <textarea ref="textareaRef" :value="modelValue" :rows="resolvedMinRows" placeholder="说出您的需求,我来为您解答"
  28. @input="handleInput" @keydown="handleKeydown"></textarea>
  29. </div>
  30. <div class="input-actions-bar">
  31. <div class="actions-left">
  32. <!-- 上传入口:附件先传到 OSS,再随请求体的 `pictures` / `files` 字段发给后端 -->
  33. <button type="button" class="action-btn" aria-label="上传图片" @click="emit('imageUpload')"
  34. @mouseenter="showActionTip($event, '上传图片')" @mouseleave="hideActionTip">
  35. <svg width="18" height="18" viewBox="0 0 18 18" fill="none">
  36. <path
  37. d="M2 18c-.55 0-1.02-.2-1.41-.59A1.93 1.93 0 0 1 0 16V2C0 1.45.2.98.59.59A1.93 1.93 0 0 1 2 0h14c.55 0 1.02.2 1.41.59.39.39.59.86.59 1.41v14c0 .55-.2 1.02-.59 1.41-.39.39-.86.59-1.41.59H2Zm0-2h14V2H2v14Zm1-2h12v-1.41L11.25 7l-3 4-2.25-3-3 4.59V14Z"
  38. fill="currentColor" />
  39. </svg>
  40. </button>
  41. <button type="button" class="action-btn" aria-label="上传附件" @click="emit('fileUpload')"
  42. @mouseenter="showActionTip($event, '上传附件')" @mouseleave="hideActionTip">
  43. <svg width="13" height="20" viewBox="0 0 13 20" fill="none">
  44. <path
  45. d="M12.5 13.75c0 1.73-.61 3.21-1.83 4.43C9.46 19.39 7.98 20 6.25 20s-3.21-.61-4.43-1.82A6.02 6.02 0 0 1 0 13.75V4.5c0-1.25.44-2.31 1.31-3.19A4.34 4.34 0 0 1 4.5 0c1.25 0 2.31.44 3.19 1.31A4.34 4.34 0 0 1 9 4.5v8.75c0 .77-.27 1.42-.8 1.95-.53.53-1.18.8-1.95.8s-1.42-.27-1.95-.8c-.53-.53-.8-1.18-.8-1.95V4h2v9.25c0 .22.07.4.21.54.14.14.32.21.54.21s.4-.07.54-.21c.14-.14.21-.32.21-.54V4.5c-.02-.7-.26-1.29-.74-1.78A2.37 2.37 0 0 0 4.5 2c-.7 0-1.29.24-1.78.73A2.42 2.42 0 0 0 2 4.5v9.25c-.02 1.18.39 2.19 1.23 3.01.83.83 1.84 1.24 3.02 1.24 1.17 0 2.16-.41 2.98-1.24.82-.82 1.24-1.83 1.27-3.01V4h2v9.75Z"
  46. fill="currentColor" />
  47. </svg>
  48. </button>
  49. <button v-if="VOICE_INPUT_VISIBLE" type="button" class="action-btn"
  50. :class="{ 'voice-active': isVoiceInputMode }" :aria-pressed="isVoiceInputMode"
  51. :disabled="isVoiceInputStarting" aria-label="语音输入" @click="emit('voiceToggle')"
  52. @mouseenter="showActionTip($event, '语音输入')" @mouseleave="hideActionTip">
  53. <svg width="14" height="19" viewBox="0 0 14 19" fill="none">
  54. <path
  55. d="M7 12c-.83 0-1.54-.29-2.13-.88A2.9 2.9 0 0 1 4 9V3c0-.83.29-1.54.87-2.13A2.9 2.9 0 0 1 7 0c.83 0 1.54.29 2.13.87C9.71 1.46 10 2.17 10 3v6c0 .83-.29 1.54-.87 2.12A2.9 2.9 0 0 1 7 12Zm-1 7v-3.08a7.04 7.04 0 0 1-4.3-2.32A6.91 6.91 0 0 1 0 9h2c0 1.38.49 2.56 1.46 3.54A4.82 4.82 0 0 0 7 14c1.38 0 2.56-.49 3.54-1.46A4.82 4.82 0 0 0 12 9h2c0 1.75-.57 3.28-1.7 4.6A7.04 7.04 0 0 1 8 15.92V19H6Zm1-9c.28 0 .52-.1.71-.29.19-.19.29-.43.29-.71V3c0-.28-.1-.52-.29-.71A.97.97 0 0 0 7 2a.97.97 0 0 0-.71.29A.97.97 0 0 0 6 3v6c0 .28.1.52.29.71.19.19.43.29.71.29Z"
  56. fill="currentColor" />
  57. </svg>
  58. </button>
  59. </div>
  60. <div class="actions-right">
  61. <!-- <DeepseekButton v-model="deepThinkValue" /> -->
  62. <!-- 测试用 MOCK 按钮组(资料 / 问卷 / 流测 / 回放 / 打字 / Scope / 测试输入):
  63. 要恢复只需取消下一段注释(事件、处理函数与 showTestActions 开关都还在) -->
  64. <!--
  65. <div v-if="showTestActions" class="mock-stream-test-actions">
  66. <button type="button" class="mock-stream-test-action" :disabled="isGenerating"
  67. @click="emit('testRefLinks')">
  68. 资料
  69. </button>
  70. <button type="button" class="mock-stream-test-action" :disabled="isGenerating"
  71. @click="emit('testQuestionCard')">
  72. 问卷
  73. </button>
  74. <button type="button" class="mock-stream-test-action" :disabled="isGenerating"
  75. @click="emit('testMockStream')">
  76. 流测
  77. </button>
  78. <button type="button" class="mock-stream-test-action" :disabled="isGenerating" @click="emit('testReplay')">
  79. 回放
  80. </button>
  81. <button type="button" class="mock-stream-test-action" :disabled="isGenerating"
  82. @click="emit('testTypewriter')">
  83. 打字
  84. </button>
  85. <button type="button" class="mock-stream-test-action" :disabled="isGenerating"
  86. @click="emit('testScopeMerge')">
  87. Scope
  88. </button>
  89. <button type="button" class="mock-stream-test-action" :disabled="isGenerating" @click="emit('testInput')">
  90. 测试输入
  91. </button>
  92. </div>
  93. -->
  94. <button type="button" class="send-btn" :class="{
  95. active: modelValue.trim().length > 0 && !isGenerating,
  96. 'is-generating': isGenerating,
  97. }" :disabled="!modelValue.trim().length && !isGenerating"
  98. @click="isGenerating ? emit('stop') : emit('send')">
  99. <svg v-if="isGenerating" width="14" height="14" viewBox="0 0 16 16" fill="none">
  100. <rect x="3" y="3" width="10" height="10" rx="2" fill="currentColor" />
  101. </svg>
  102. <svg v-else width="19" height="16" viewBox="0 0 19 16" fill="none">
  103. <path d="M0 16V0l19 8-19 8Zm2-3 11.85-5L2 3v3.5L8 8 2 9.5V13Z" fill="currentColor" />
  104. </svg>
  105. </button>
  106. </div>
  107. </div>
  108. </div>
  109. <Teleport to="body">
  110. <div v-if="actionTip.visible" class="action-name-tip"
  111. :style="{ left: `${actionTip.x}px`, top: `${actionTip.y}px` }">{{ actionTip.text }}</div>
  112. </Teleport>
  113. </section>
  114. </template>
  115. <script setup lang="ts">
  116. import { computed, nextTick, onBeforeUnmount, onMounted, reactive, ref, watch } from 'vue';
  117. import type { BusinessAssistantUploadedFile } from './business-assistant/shared';
  118. const props = defineProps<{
  119. modelValue: string;
  120. uploadedFiles: BusinessAssistantUploadedFile[];
  121. isGenerating: boolean;
  122. isDeepThink: boolean;
  123. isVoiceInputMode: boolean;
  124. isVoiceInputStarting: boolean;
  125. isDesktop?: boolean;
  126. minRows?: number;
  127. showTestActions?: boolean;
  128. showMockStreamTestButton?: boolean;
  129. }>();
  130. const showTestActions = computed(() => props.showTestActions === true);
  131. const showMockStreamTestButton = computed(() => props.showMockStreamTestButton === true);
  132. /**
  133. * 语音输入入口是否显示。
  134. *
  135. * 2026-10-28 用户需要调试语音链路 → 恢复为按安全上下文判断:
  136. * HTTPS/localhost 显示,HTTP 隐藏(HTTP 下 getUserMedia 本来也不能用)。
  137. * 入口全仓库只有这一处;ASR 逻辑与内部实现在 src/asr/。
  138. */
  139. const VOICE_INPUT_VISIBLE = typeof window !== "undefined" && window.isSecureContext;
  140. const emit = defineEmits<{
  141. 'update:modelValue': [value: string];
  142. 'update:isDeepThink': [value: boolean];
  143. send: [];
  144. stop: [];
  145. imageUpload: [];
  146. fileUpload: [];
  147. voiceToggle: [];
  148. removeFile: [id: string];
  149. paste: [event: ClipboardEvent];
  150. testReplay: [];
  151. testTypewriter: [];
  152. testScopeMerge: [];
  153. testInput: [];
  154. testMockStream: [];
  155. testRefLinks: [];
  156. testQuestionCard: [];
  157. }>();
  158. const ACTION_TIP_DELAY = 300;
  159. const actionTip = reactive({ visible: false, text: '', x: 0, y: 0 });
  160. let actionTipTimer: number | null = null;
  161. let actionTipEl: HTMLElement | null = null;
  162. const clearActionTipTimer = () => {
  163. if (actionTipTimer !== null) {
  164. window.clearTimeout(actionTipTimer);
  165. actionTipTimer = null;
  166. }
  167. };
  168. const placeActionTip = (el: HTMLElement) => {
  169. const rect = el.getBoundingClientRect();
  170. actionTip.x = rect.left + rect.width / 2;
  171. actionTip.y = rect.top;
  172. };
  173. const showActionTip = (event: MouseEvent, text: string) => {
  174. if (!props.isDesktop) return;
  175. const el = event.currentTarget as HTMLElement | null;
  176. if (!el) return;
  177. clearActionTipTimer();
  178. actionTipEl = el;
  179. placeActionTip(el);
  180. actionTip.text = text;
  181. actionTipTimer = window.setTimeout(() => {
  182. actionTipTimer = null;
  183. if (actionTipEl) placeActionTip(actionTipEl);
  184. actionTip.visible = true;
  185. }, ACTION_TIP_DELAY);
  186. };
  187. const hideActionTip = () => {
  188. clearActionTipTimer();
  189. actionTipEl = null;
  190. actionTip.visible = false;
  191. actionTip.text = '';
  192. };
  193. onBeforeUnmount(hideActionTip);
  194. const deepThinkValue = computed({
  195. get: () => props.isDeepThink,
  196. set: (value: boolean) => emit('update:isDeepThink', value),
  197. });
  198. const textareaRef = ref<HTMLTextAreaElement | null>(null);
  199. const maxRows = 4;
  200. const resolvedMinRows = computed(() => {
  201. const minRows = Number(props.minRows ?? 1);
  202. if (!Number.isFinite(minRows)) {
  203. return 1;
  204. }
  205. return Math.max(1, Math.min(maxRows, Math.round(minRows)));
  206. });
  207. const scrollTextareaToBottom = async () => {
  208. await nextTick();
  209. const textarea = textareaRef.value;
  210. if (!textarea) {
  211. return;
  212. }
  213. textarea.scrollTop = textarea.scrollHeight;
  214. };
  215. const syncTextareaHeight = async () => {
  216. await nextTick();
  217. const textarea = textareaRef.value;
  218. if (!textarea) {
  219. return;
  220. }
  221. const styles = window.getComputedStyle(textarea);
  222. const lineHeight = Number.parseFloat(styles.lineHeight) || Number.parseFloat(styles.fontSize) * 1.6 || 24;
  223. const paddingY = (Number.parseFloat(styles.paddingTop) || 0) + (Number.parseFloat(styles.paddingBottom) || 0);
  224. const borderY = (Number.parseFloat(styles.borderTopWidth) || 0) + (Number.parseFloat(styles.borderBottomWidth) || 0);
  225. const minHeight = lineHeight * resolvedMinRows.value + paddingY + borderY;
  226. const maxHeight = lineHeight * maxRows + paddingY + borderY;
  227. textarea.style.height = "auto";
  228. const nextHeight = Math.max(minHeight, Math.min(textarea.scrollHeight, maxHeight));
  229. textarea.style.height = `${Math.ceil(nextHeight)}px`;
  230. textarea.style.overflowY = textarea.scrollHeight > maxHeight ? "auto" : "hidden";
  231. };
  232. watch(
  233. () => [props.modelValue, props.isVoiceInputMode, resolvedMinRows.value],
  234. ([, isVoiceInputMode]) => {
  235. void syncTextareaHeight();
  236. if (!isVoiceInputMode) {
  237. return;
  238. }
  239. void scrollTextareaToBottom();
  240. },
  241. { flush: 'post' },
  242. );
  243. onMounted(() => {
  244. void syncTextareaHeight();
  245. });
  246. const handleInput = (event: Event) => {
  247. emit('update:modelValue', (event.target as HTMLTextAreaElement).value);
  248. };
  249. const insertNewLineAtCursor = (textarea: HTMLTextAreaElement) => {
  250. const value = textarea.value;
  251. const start = textarea.selectionStart ?? value.length;
  252. const end = textarea.selectionEnd ?? value.length;
  253. const nextValue = `${value.slice(0, start)}\n${value.slice(end)}`;
  254. emit('update:modelValue', nextValue);
  255. void nextTick(() => {
  256. const currentTextarea = textareaRef.value;
  257. if (!currentTextarea) {
  258. return;
  259. }
  260. currentTextarea.selectionStart = currentTextarea.selectionEnd = start + 1;
  261. });
  262. };
  263. const handleKeydown = (event: KeyboardEvent) => {
  264. if (event.key !== 'Enter' || event.isComposing) {
  265. return;
  266. }
  267. if (event.ctrlKey || event.metaKey || (props.isDesktop && (event.shiftKey || event.altKey))) {
  268. event.preventDefault();
  269. const textarea = event.target as HTMLTextAreaElement;
  270. insertNewLineAtCursor(textarea);
  271. return;
  272. }
  273. event.preventDefault();
  274. if (!props.modelValue.trim() || props.isGenerating) {
  275. return;
  276. }
  277. emit('send');
  278. };
  279. const getFileExtension = (name: string) => name.split('.').pop()?.toUpperCase() || 'FILE';
  280. const getFileStatusText = (file: BusinessAssistantUploadedFile) => {
  281. if (file.status === 'uploading') {
  282. return `正在上传... ${file.progress}%`;
  283. }
  284. if (file.status === 'error') {
  285. return file.errorMsg || '上传失败';
  286. }
  287. return `${(file.size / 1024 / 1024).toFixed(2)} MB`;
  288. };
  289. </script>
  290. <style scoped>
  291. .chat-input-area {
  292. width: 100%;
  293. padding: 0 16px 16px;
  294. overflow: hidden;
  295. }
  296. .chat-input-box {
  297. width: 100%;
  298. display: flex;
  299. flex-direction: column;
  300. align-items: stretch;
  301. justify-content: flex-start;
  302. gap: 0;
  303. box-sizing: border-box;
  304. background: #ffffff;
  305. border: 1px solid #c7c4d84d;
  306. border-radius: 16px;
  307. box-shadow: 0 4px 17.5px #00000008;
  308. }
  309. .textarea-wrapper {
  310. padding: 12px 20px;
  311. display: flex;
  312. align-items: center;
  313. justify-content: center;
  314. overflow: hidden;
  315. }
  316. .textarea-wrapper textarea {
  317. width: 100%;
  318. overflow-y: auto;
  319. overscroll-behavior: contain;
  320. border: 0 !important;
  321. outline: 0 !important;
  322. resize: none;
  323. background: transparent !important;
  324. color: #141b2b;
  325. font-family: "HarmonyOS Sans SC", sans-serif;
  326. font-size: 16px;
  327. font-weight: normal;
  328. line-height: 1.6;
  329. display: block;
  330. padding: 0 0 0.59px 0 !important;
  331. box-shadow: none !important;
  332. }
  333. .textarea-wrapper textarea::placeholder {
  334. color: #777587;
  335. }
  336. .input-actions-bar {
  337. display: flex;
  338. align-items: center;
  339. justify-content: space-between;
  340. padding: 0 12px 12px;
  341. }
  342. .actions-left,
  343. .actions-right {
  344. display: flex;
  345. align-items: center;
  346. }
  347. .actions-left {
  348. gap: 4px;
  349. }
  350. .actions-right {
  351. gap: 8px;
  352. height: 40px;
  353. }
  354. .mock-stream-test-actions {
  355. display: flex;
  356. align-items: center;
  357. gap: 4px;
  358. }
  359. .mock-stream-test-action {
  360. height: 28px;
  361. border: 1px solid rgba(53, 37, 205, 0.18);
  362. border-radius: 7px;
  363. padding: 0 7px;
  364. background: rgba(53, 37, 205, 0.06);
  365. color: #3525cd;
  366. font-size: 11px;
  367. line-height: 1;
  368. cursor: pointer;
  369. white-space: nowrap;
  370. }
  371. .mock-stream-test-action:disabled {
  372. cursor: not-allowed;
  373. opacity: 0.45;
  374. }
  375. .action-btn {
  376. border: 0;
  377. border-radius: 8px;
  378. padding: 8px;
  379. background: transparent;
  380. color: #464555;
  381. display: flex;
  382. align-items: center;
  383. justify-content: center;
  384. cursor: pointer;
  385. }
  386. .chat-input-area.is-desktop .action-btn:hover {
  387. background: #e3e3e3;
  388. }
  389. .action-name-tip {
  390. position: fixed;
  391. z-index: 4000;
  392. max-width: 280px;
  393. padding: 8px 10px;
  394. border-radius: 8px;
  395. background: #141b2b;
  396. color: #ffffff;
  397. font-size: 12px;
  398. font-weight: 500;
  399. line-height: 1.5;
  400. box-shadow: 0 8px 20px rgba(20, 27, 43, 0.18);
  401. pointer-events: none;
  402. transform: translate(-50%, calc(-100% - 8px));
  403. white-space: nowrap;
  404. }
  405. .action-btn:active {
  406. background: #e3e3e3;
  407. color: #3525cd;
  408. }
  409. .action-btn:disabled {
  410. cursor: not-allowed;
  411. opacity: 0.55;
  412. }
  413. .action-btn.voice-active {
  414. background: rgba(53, 37, 205, 0.1);
  415. color: #3525cd;
  416. }
  417. :deep(.toggle-btn.zhaoshang-theme-btn) {
  418. height: 40px;
  419. padding: 0 12px;
  420. gap: 8px;
  421. border-color: #e3e1eb;
  422. }
  423. :deep(.toggle-btn.zhaoshang-theme-btn .zhaoshang-toggle-text) {
  424. display: inline-flex;
  425. min-width: 40px;
  426. margin-right: 0;
  427. color: #464555;
  428. font-size: 14px;
  429. font-weight: 500;
  430. line-height: 1.6;
  431. }
  432. :deep(.toggle-btn.zhaoshang-theme-btn .zhaoshang-switch) {
  433. width: 36px;
  434. height: 20px;
  435. }
  436. .send-btn {
  437. width: 40px;
  438. height: 40px;
  439. border: 0;
  440. border-radius: 8px;
  441. display: flex;
  442. align-items: center;
  443. justify-content: center;
  444. background: #3525cd;
  445. color: #ffffff;
  446. opacity: 0.5;
  447. cursor: pointer;
  448. transition: opacity 0.2s ease;
  449. }
  450. .send-btn.active {
  451. opacity: 1;
  452. }
  453. .send-btn.is-generating {
  454. background: #e2e8f0;
  455. color: #64748b;
  456. opacity: 1;
  457. }
  458. .send-btn:disabled {
  459. cursor: not-allowed;
  460. }
  461. .attachments-area {
  462. display: flex;
  463. gap: 10px;
  464. overflow-x: auto;
  465. padding: 12px 12px 0;
  466. }
  467. .attachment-item {
  468. position: relative;
  469. flex: 0 0 auto;
  470. min-width: 118px;
  471. max-width: 220px;
  472. min-height: 68px;
  473. display: flex;
  474. align-items: center;
  475. gap: 10px;
  476. padding: 10px;
  477. border: 1px solid rgba(199, 196, 216, 0.3);
  478. border-radius: 12px;
  479. background: #fff;
  480. }
  481. .attachment-item.is-image {
  482. min-width: 68px;
  483. width: 68px;
  484. padding: 0;
  485. overflow: hidden;
  486. }
  487. .attachment-image-preview {
  488. width: 100%;
  489. height: 68px;
  490. object-fit: cover;
  491. }
  492. .file-icon {
  493. width: 40px;
  494. height: 40px;
  495. border-radius: 8px;
  496. background: rgba(53, 37, 205, 0.1);
  497. color: #3525cd;
  498. font-size: 10px;
  499. display: flex;
  500. align-items: center;
  501. justify-content: center;
  502. flex-shrink: 0;
  503. }
  504. .file-info {
  505. min-width: 0;
  506. flex: 1;
  507. }
  508. .file-name {
  509. color: #141b2b;
  510. font-size: 13px;
  511. font-weight: 500;
  512. overflow: hidden;
  513. text-overflow: ellipsis;
  514. white-space: nowrap;
  515. }
  516. .file-progress {
  517. margin-top: 2px;
  518. color: #464555;
  519. font-size: 12px;
  520. }
  521. .file-progress.error {
  522. color: #f97c7c;
  523. }
  524. .file-progress-bar {
  525. height: 4px;
  526. margin-top: 6px;
  527. overflow: hidden;
  528. border-radius: 999px;
  529. background: rgba(53, 37, 205, 0.08);
  530. }
  531. .file-progress-bar-fill {
  532. height: 100%;
  533. border-radius: inherit;
  534. background: #3525cd;
  535. }
  536. .attachment-delete-btn {
  537. position: absolute;
  538. top: 5px;
  539. right: 5px;
  540. z-index: 2;
  541. width: 22px;
  542. height: 22px;
  543. border: 0;
  544. border-radius: 50%;
  545. background: rgba(255, 255, 255, 0.88);
  546. color: #464555;
  547. display: flex;
  548. align-items: center;
  549. justify-content: center;
  550. }
  551. .attachment-progress-overlay {
  552. position: absolute;
  553. inset: 0;
  554. z-index: 1;
  555. display: flex;
  556. align-items: center;
  557. justify-content: center;
  558. background: rgba(255, 255, 255, 0.65);
  559. }
  560. .progress-spinner {
  561. width: 22px;
  562. height: 22px;
  563. border-radius: 50%;
  564. border: 2px solid rgba(53, 37, 205, 0.2);
  565. border-top-color: #3525cd;
  566. animation: spin 1s linear infinite;
  567. }
  568. @keyframes spin {
  569. to {
  570. transform: rotate(360deg);
  571. }
  572. }
  573. </style>