-
-
Notifications
You must be signed in to change notification settings - Fork 111
Expand file tree
/
Copy pathEnvelopeFilesList.vue
More file actions
775 lines (693 loc) · 19.8 KB
/
EnvelopeFilesList.vue
File metadata and controls
775 lines (693 loc) · 19.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
<!--
- SPDX-FileCopyrightText: 2025 LibreCode coop and LibreCode contributors
- SPDX-License-Identifier: AGPL-3.0-or-later
-->
<template>
<NcDialog v-if="open"
:name="t('libresign', 'Manage files ({count})', { count: totalFiles || files.length })"
size="normal"
@closing="emit('close')">
<NcDialog v-if="showDeleteDialog"
:name="deleteDialogConfig.title"
:buttons="deleteDialogButtons"
@closing="showDeleteDialog = false">
<p>{{ deleteDialogConfig.message }}</p>
</NcDialog>
<div class="envelope-files-dialog">
<div v-if="envelope && envelope.status === FILE_STATUS.DRAFT" class="envelope-header">
<div class="envelope-name-field">
<NcTextField v-model="editableEnvelopeName"
:label="t('libresign', 'Envelope name')"
:placeholder="t('libresign', 'Enter envelope name')"
:success="nameUpdateSuccess"
:error="nameUpdateError"
:helper-text="nameHelperText"
:minlength="ENVELOPE_NAME_MIN_LENGTH"
:maxlength="ENVELOPE_NAME_MAX_LENGTH"
@update:modelValue="onEnvelopeNameChange" />
<span v-if="isSavingName" class="saving-indicator">
<NcLoadingIcon :size="20" />
</span>
</div>
</div>
<div v-if="isUploading" class="upload-progress-wrapper">
<UploadProgress :is-uploading="isUploading"
:upload-progress="uploadProgress"
:uploaded-bytes="uploadedBytes"
:total-bytes="totalBytes"
:upload-start-time="uploadStartTime"
@cancel="cancelUpload" />
</div>
<NcEmptyContent v-if="files.length === 0 && !isLoadingFiles"
:name="t('libresign', 'No files in envelope')"
:description="t('libresign', 'Add files to get started')">
<template #icon>
<NcIconSvgWrapper :path="mdiFilePdfBox" :size="64" />
</template>
</NcEmptyContent>
<div v-else ref="scrollContainer" class="files-list" @scroll="onScroll">
<div v-if="canDelete" class="files-list__header">
<NcCheckboxRadioSwitch :modelValue="allSelected"
@update:modelValue="toggleSelectAll">
{{ selectedCount > 0 ? t('libresign', '{count} selected', { count: selectedCount }) : t('libresign', 'Select all') }}
</NcCheckboxRadioSwitch>
<NcButton v-if="selectedCount > 0"
variant="error"
:disabled="hasLoading"
@click="handleDeleteSelected">
<template #icon>
<NcIconSvgWrapper :path="mdiDelete" :size="20" />
</template>
{{ t('libresign', 'Delete') }}
</NcButton>
</div>
<NcListItem v-for="file in files"
:key="file.uuid"
:name="file.name"
:details="file.statusText">
<template #icon>
<NcCheckboxRadioSwitch v-if="canDelete"
:modelValue="isSelected(file.id)"
@update:modelValue="toggleSelect(file.id)" />
<img v-if="getPreviewUrl(file)"
:src="getPreviewUrl(file)"
alt=""
class="file-preview-icon">
<NcIconSvgWrapper v-else :path="mdiFilePdfBox" :size="20" />
</template>
<template v-if="!isTouchDevice" #actions>
<NcActionButton
:close-after-click="true"
@click="openFile(file)">
<template #icon>
<NcIconSvgWrapper :path="mdiFileEye" :size="20" />
</template>
{{ t('libresign', 'Open file') }}
</NcActionButton>
<NcActionButton v-if="canDelete"
:close-after-click="true"
@click="handleDelete(file)">
<template #icon>
<NcIconSvgWrapper :path="mdiDelete" :size="20" />
</template>
{{ t('libresign', 'Delete') }}
</NcActionButton>
</template>
<template v-if="isTouchDevice" #extra-actions>
<NcButton variant="tertiary" :aria-label="t('libresign', 'Open file')" @click="openFile(file)">
<template #icon>
<NcIconSvgWrapper :path="mdiFileEye" :size="20" />
</template>
</NcButton>
<NcButton v-if="canDelete" variant="tertiary" :aria-label="t('libresign', 'Delete')" @click="handleDelete(file)">
<template #icon>
<NcIconSvgWrapper :path="mdiDelete" :size="20" />
</template>
</NcButton>
</template>
</NcListItem>
<div v-if="isLoadingMore" class="loading-more">
<span class="icon-loading-small" />
{{ t('libresign', 'Loading more files...') }}
</div>
</div>
</div>
<template #actions>
<NcButton v-if="canAddFile"
variant="primary"
:disabled="hasLoading"
@click="addFileToEnvelope">
<template #icon>
<NcIconSvgWrapper :path="mdiFilePlus" :size="20" />
</template>
{{ t('libresign', 'Add file') }}
</NcButton>
<NcButton @click="emit('close')">
{{ t('libresign', 'Close') }}
</NcButton>
</template>
</NcDialog>
</template>
<script setup lang="ts">
import { n, t } from '@nextcloud/l10n'
import { computed, ref, watch } from 'vue'
import {
mdiDelete,
mdiFileEye,
mdiFilePdfBox,
mdiFilePlus,
} from '@mdi/js'
import axios from '@nextcloud/axios'
import { getCapabilities } from '@nextcloud/capabilities'
import { generateOcsUrl, generateUrl } from '@nextcloud/router'
import NcActionButton from '@nextcloud/vue/components/NcActionButton'
import NcButton from '@nextcloud/vue/components/NcButton'
import NcCheckboxRadioSwitch from '@nextcloud/vue/components/NcCheckboxRadioSwitch'
import NcDialog from '@nextcloud/vue/components/NcDialog'
import NcEmptyContent from '@nextcloud/vue/components/NcEmptyContent'
import NcListItem from '@nextcloud/vue/components/NcListItem'
import NcLoadingIcon from '@nextcloud/vue/components/NcLoadingIcon'
import NcTextField from '@nextcloud/vue/components/NcTextField'
import NcIconSvgWrapper from '@nextcloud/vue/components/NcIconSvgWrapper'
import UploadProgress from '../UploadProgress.vue'
import { useIsTouchDevice } from '../../composables/useIsTouchDevice.js'
import { FILE_STATUS, ENVELOPE_NAME_MIN_LENGTH, ENVELOPE_NAME_MAX_LENGTH } from '../../constants.js'
import { openDocument } from '../../utils/viewer.js'
import { useFilesStore } from '../../store/files.js'
import type { LibresignCapabilities } from '../../types/index'
type FilesStoreContract = ReturnType<typeof useFilesStore>
type Envelope = ReturnType<FilesStoreContract['getFile']>
type EnvelopeFile = {
id: number
uuid?: string
name?: string
statusText?: string
nodeId?: number
size: number
[key: string]: unknown
}
type DeleteDialogConfig = {
title: string
message: string
action: null | (() => void | Promise<void>)
}
type RemoveFilesResult = {
success: boolean
removedCount?: number
message: string
}
type AddFilesResult = {
success: boolean
message: string
files: EnvelopeFile[]
filesCount: number
}
type UploadProgressEvent = {
loaded: number
total: number
}
type FilesStore = {
getFile: FilesStoreContract['getFile']
removeFilesFromEnvelope: (fileIds: number[]) => Promise<RemoveFilesResult>
addFilesToEnvelope: (uuid: string, formData: FormData, options: { signal: AbortSignal; onUploadProgress: (event: UploadProgressEvent) => void }) => Promise<AddFilesResult>
rename: (uuid: string, newName: string) => Promise<boolean>
}
type RenameError = {
response?: {
data?: {
ocs?: {
data?: {
message?: string
}
}
}
}
}
defineOptions({
name: 'EnvelopeFilesList',
})
const props = defineProps<{
open: boolean
}>()
const emit = defineEmits<{
(e: 'close'): void
}>()
const filesStore = useFilesStore() as FilesStore
const { isTouchDevice } = useIsTouchDevice()
const hasLoading = ref(false)
const successMessage = ref('')
const errorMessage = ref('')
const selectedFiles = ref<number[]>([])
const files = ref<EnvelopeFile[]>([])
const currentPage = ref(1)
const hasMore = ref(true)
const isLoadingFiles = ref(false)
const isLoadingMore = ref(false)
const totalFiles = ref(0)
const showDeleteDialog = ref(false)
const deleteDialogConfig = ref<DeleteDialogConfig>({
title: '',
message: '',
action: null,
})
const uploadProgress = ref(0)
const isUploading = ref(false)
const uploadAbortController = ref<AbortController | null>(null)
const uploadedBytes = ref(0)
const totalBytes = ref(0)
const uploadStartTime = ref<number | null>(null)
const editableEnvelopeName = ref('')
const isSavingName = ref(false)
const nameUpdateSuccess = ref(false)
const nameUpdateError = ref(false)
const nameHelperText = ref('')
const debounceTimer = ref<ReturnType<typeof setTimeout> | null>(null)
function getLibresignConfig() {
const capabilities = getCapabilities() as LibresignCapabilities | undefined
return capabilities?.libresign?.config ?? null
}
const envelope = computed(() => filesStore.getFile())
const canDelete = computed(() => envelope.value?.status === FILE_STATUS.DRAFT && files.value.length >= 1)
const canAddFile = computed(() => {
if (!envelope.value || envelope.value.status !== FILE_STATUS.DRAFT) {
return false
}
const config = getLibresignConfig()
return config?.envelope['is-available'] === true
})
const deleteDialogButtons = computed(() => [
{
label: t('libresign', 'Cancel'),
callback: () => {
showDeleteDialog.value = false
},
},
{
label: t('libresign', 'Delete'),
variant: 'error' as const,
callback: () => {
showDeleteDialog.value = false
deleteDialogConfig.value.action?.()
},
},
])
const selectedCount = computed(() => selectedFiles.value.length)
const allSelected = computed(() => files.value.length > 0 && selectedFiles.value.length === files.value.length)
watch(() => props.open, (newVal) => {
if (newVal) {
files.value = []
currentPage.value = 1
totalFiles.value = envelope.value?.filesCount || 0
hasMore.value = totalFiles.value > 0
editableEnvelopeName.value = envelope.value?.name || ''
nameUpdateSuccess.value = false
nameUpdateError.value = false
nameHelperText.value = ''
if (totalFiles.value > 0) {
void loadFiles(1)
}
} else {
clearMessages()
selectedFiles.value = []
files.value = []
currentPage.value = 1
hasMore.value = true
}
})
async function loadFiles(page = 1) {
if (!envelope.value?.id) {
return
}
const isFirstPage = page === 1
if (isFirstPage) {
isLoadingFiles.value = true
} else {
isLoadingMore.value = true
}
const url = generateOcsUrl('/apps/libresign/api/v1/file/list')
const params = new URLSearchParams({
page: String(page),
length: '50',
parentFileId: String(envelope.value.id),
})
await axios.get(`${url}?${params.toString()}`)
.then(({ data }) => {
if (data.ocs?.data) {
const newFiles = data.ocs.data.data || []
const pagination = data.ocs.data.pagination || {}
if (isFirstPage) {
files.value = newFiles
} else {
files.value.push(...newFiles)
}
currentPage.value = page
totalFiles.value = pagination.total || totalFiles.value
hasMore.value = pagination.next !== null
}
})
.catch(() => {
showError(t('libresign', 'Failed to load files'))
})
.finally(() => {
isLoadingFiles.value = false
isLoadingMore.value = false
})
}
function onScroll(event: { target: { scrollTop: number; scrollHeight: number; clientHeight: number } }) {
if (isLoadingMore.value || !hasMore.value) {
return
}
const { scrollTop, scrollHeight, clientHeight } = event.target
const scrollPosition = scrollTop + clientHeight
const threshold = scrollHeight - 100
if (scrollPosition >= threshold) {
void loadFiles(currentPage.value + 1)
}
}
function clearMessages() {
successMessage.value = ''
errorMessage.value = ''
}
function showSuccess(message: string) {
clearMessages()
successMessage.value = message
setTimeout(() => {
successMessage.value = ''
}, 5000)
}
function showError(message: string) {
clearMessages()
errorMessage.value = message
}
function getMaxFileUploads() {
const config = getLibresignConfig()
const capabilitiesMax = config?.upload['max-file-uploads']
const max = typeof capabilitiesMax === 'number' && Number.isFinite(capabilitiesMax) ? capabilitiesMax : 20
return max > 0 ? Math.floor(max) : 20
}
function validateMaxFileUploads(filesCount: number) {
const maxFileUploads = getMaxFileUploads()
if (filesCount > maxFileUploads) {
showError(t('libresign', 'You can upload at most {max} files at once.', { max: maxFileUploads }))
return false
}
return true
}
function getPreviewUrl(file: Partial<EnvelopeFile> & { id?: number; nodeId?: number }) {
if (!file.id && !file.nodeId) return null
const previewUrl = file.id
? generateOcsUrl('/apps/libresign/api/v1/file/thumbnail/file_id/{fileId}', {
fileId: file.id,
})
: generateOcsUrl('/apps/libresign/api/v1/file/thumbnail/{nodeId}', {
nodeId: file.nodeId,
})
const url = new URL(previewUrl)
url.searchParams.set('x', '32')
url.searchParams.set('y', '32')
url.searchParams.set('mimeFallback', 'true')
url.searchParams.set('a', '1')
return url.toString()
}
function openFile(file: EnvelopeFile) {
const fileUrl = generateUrl('/apps/libresign/p/pdf/{uuid}', { uuid: file.uuid })
openDocument({
fileUrl,
filename: file.name || '',
nodeId: file.id,
})
}
function isSelected(fileId: number) {
return selectedFiles.value.includes(fileId)
}
function toggleSelect(fileId: number) {
const index = selectedFiles.value.indexOf(fileId)
if (index > -1) {
selectedFiles.value.splice(index, 1)
} else {
selectedFiles.value.push(fileId)
}
}
function toggleSelectAll() {
if (allSelected.value) {
selectedFiles.value = []
} else {
selectedFiles.value = files.value.map(file => file.id)
}
}
async function handleDeleteSelected() {
deleteDialogConfig.value = {
title: t('libresign', 'Delete'),
message: n('libresign', 'Are you sure you want to remove %n file from the envelope?', 'Are you sure you want to remove %n files from the envelope?', selectedCount.value),
action: async () => {
await confirmDeleteSelected()
},
}
showDeleteDialog.value = true
}
async function confirmDeleteSelected() {
hasLoading.value = true
const fileIds = [...selectedFiles.value]
const result = await filesStore.removeFilesFromEnvelope(fileIds)
if (result.success) {
files.value = files.value.filter(file => !fileIds.includes(file.id))
selectedFiles.value = []
totalFiles.value = Math.max(0, totalFiles.value - (result.removedCount || 0))
showSuccess(result.message)
} else {
showError(result.message)
}
hasLoading.value = false
}
function addFileToEnvelope() {
const input = document.createElement('input')
input.type = 'file'
input.accept = '.pdf'
input.multiple = true
input.onchange = async (event) => {
const target = event.target as HTMLInputElement | null
const selectedFileList = target?.files
if (!selectedFileList || selectedFileList.length === 0) return
if (!validateMaxFileUploads(selectedFileList.length)) {
return
}
hasLoading.value = true
isUploading.value = true
uploadProgress.value = 0
uploadedBytes.value = 0
totalBytes.value = 0
uploadStartTime.value = Date.now()
const formData = new FormData()
let aggregateSize = 0
for (const file of selectedFileList) {
formData.append('files[]', file)
aggregateSize += file.size
}
totalBytes.value = aggregateSize
const abortController = new AbortController()
uploadAbortController.value = abortController
const result = await filesStore.addFilesToEnvelope(envelope.value?.uuid || '', formData, {
signal: abortController.signal,
onUploadProgress: (progressEvent) => {
if (progressEvent.total) {
uploadedBytes.value = progressEvent.loaded
uploadProgress.value = Math.round((progressEvent.loaded / progressEvent.total) * 100)
}
},
})
if (result.success) {
showSuccess(result.message)
files.value.push(...result.files)
totalFiles.value = result.filesCount
} else if (result.message !== t('libresign', 'Upload cancelled')) {
showError(result.message)
}
hasLoading.value = false
isUploading.value = false
uploadAbortController.value = null
}
input.click()
}
function cancelUpload() {
uploadAbortController.value?.abort()
}
function onEnvelopeNameChange(newName: string | number) {
const normalizedName = String(newName)
if (debounceTimer.value) {
clearTimeout(debounceTimer.value)
}
nameUpdateSuccess.value = false
nameUpdateError.value = false
nameHelperText.value = ''
const trimmedName = normalizedName.trim()
if (trimmedName.length < ENVELOPE_NAME_MIN_LENGTH) {
nameUpdateError.value = true
nameHelperText.value = t('libresign', 'Name must be at least {min} characters', { min: ENVELOPE_NAME_MIN_LENGTH })
return
}
if (trimmedName === envelope.value?.name) {
return
}
debounceTimer.value = setTimeout(() => {
void saveEnvelopeNameDebounced(trimmedName)
}, 1000)
}
async function saveEnvelopeNameDebounced(newName: string) {
isSavingName.value = true
nameUpdateSuccess.value = false
nameUpdateError.value = false
nameHelperText.value = ''
try {
const success = await filesStore.rename(envelope.value?.uuid || '', newName)
if (success) {
nameUpdateSuccess.value = true
nameHelperText.value = t('libresign', 'Saved')
setTimeout(() => {
nameUpdateSuccess.value = false
nameHelperText.value = ''
}, 3000)
} else {
nameUpdateError.value = true
nameHelperText.value = t('libresign', 'Failed to update')
}
} catch (error) {
nameUpdateError.value = true
nameHelperText.value = (error as RenameError).response?.data?.ocs?.data?.message || t('libresign', 'Failed to update')
} finally {
isSavingName.value = false
}
}
function handleDelete(file: EnvelopeFile) {
deleteDialogConfig.value = {
title: t('libresign', 'Delete'),
message: t('libresign', 'Are you sure you want to remove this file from the envelope?'),
action: async () => {
await confirmDelete(file)
},
}
showDeleteDialog.value = true
}
async function confirmDelete(file: EnvelopeFile) {
hasLoading.value = true
const result = await filesStore.removeFilesFromEnvelope([file.id])
if (result.success) {
showSuccess(result.message)
files.value = files.value.filter(item => item.id !== file.id)
totalFiles.value = Math.max(0, totalFiles.value - (result.removedCount || 0))
} else {
showError(result.message)
}
hasLoading.value = false
}
defineExpose({
isTouchDevice,
filesStore,
FILE_STATUS,
ENVELOPE_NAME_MIN_LENGTH,
ENVELOPE_NAME_MAX_LENGTH,
mdiDelete,
mdiFileEye,
mdiFilePdfBox,
mdiFilePlus,
hasLoading,
successMessage,
errorMessage,
selectedFiles,
files,
currentPage,
hasMore,
isLoadingFiles,
isLoadingMore,
totalFiles,
showDeleteDialog,
deleteDialogConfig,
uploadProgress,
isUploading,
uploadAbortController,
uploadedBytes,
totalBytes,
uploadStartTime,
editableEnvelopeName,
isSavingName,
nameUpdateSuccess,
nameUpdateError,
nameHelperText,
debounceTimer,
envelope,
canDelete,
canAddFile,
deleteDialogButtons,
selectedCount,
allSelected,
loadFiles,
onScroll,
clearMessages,
showSuccess,
showError,
getMaxFileUploads,
validateMaxFileUploads,
getPreviewUrl,
openFile,
isSelected,
toggleSelect,
toggleSelectAll,
handleDeleteSelected,
confirmDeleteSelected,
addFileToEnvelope,
cancelUpload,
onEnvelopeNameChange,
saveEnvelopeNameDebounced,
handleDelete,
confirmDelete,
})
</script>
<style scoped>
.envelope-files-dialog {
padding: 16px;
min-height: 200px;
max-height: 60vh;
overflow-y: auto;
}
.upload-progress-wrapper {
display: flex;
justify-content: center;
padding: 16px 0;
margin-bottom: 16px;
border-bottom: 1px solid var(--color-border);
}
.files-list {
display: flex;
flex-direction: column;
gap: 4px;
}
.files-list__header {
display: flex;
align-items: center;
gap: 8px;
padding: 8px 0;
border-bottom: 1px solid var(--color-border);
margin-bottom: 8px;
}
.file-preview-icon {
width: 32px;
height: 32px;
object-fit: contain;
border-radius: var(--border-radius);
}
.loading-more {
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
padding: 16px;
color: var(--color-text-maxcontrast);
}
.dialog-header {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
}
.edit-envelope-btn {
margin-left: 8px;
}
.envelope-header {
display: flex;
justify-content: space-between;
align-items: flex-start;
margin-bottom: 16px;
padding-bottom: 12px;
border-bottom: 1px solid var(--color-border);
}
.envelope-name-field {
display: flex;
align-items: center;
gap: 8px;
flex: 1;
}
.saving-indicator {
display: flex;
align-items: center;
margin-top: 24px;
}
</style>