@acorex/components 20.9.0 → 20.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/badge/index.d.ts +2 -4
- package/conversation/index.d.ts +1213 -33
- package/fesm2022/acorex-components-badge.mjs +17 -12
- package/fesm2022/acorex-components-badge.mjs.map +1 -1
- package/fesm2022/{acorex-components-conversation-open-composer-picker-for-files-CbNyy2Ws.mjs → acorex-components-conversation-open-composer-picker-for-files-BLInQalk.mjs} +2 -3
- package/fesm2022/{acorex-components-conversation-open-composer-picker-for-files-CbNyy2Ws.mjs.map → acorex-components-conversation-open-composer-picker-for-files-BLInQalk.mjs.map} +1 -1
- package/fesm2022/acorex-components-conversation.mjs +22436 -1
- package/fesm2022/acorex-components-conversation.mjs.map +1 -1
- package/fesm2022/acorex-components-file-viewer.mjs +736 -0
- package/fesm2022/acorex-components-file-viewer.mjs.map +1 -0
- package/fesm2022/acorex-components-list.mjs +16 -3
- package/fesm2022/acorex-components-list.mjs.map +1 -1
- package/fesm2022/acorex-components-select-box.mjs +56 -9
- package/fesm2022/acorex-components-select-box.mjs.map +1 -1
- package/file-viewer/index.d.ts +178 -0
- package/list/index.d.ts +19 -9
- package/package.json +20 -15
- package/select-box/index.d.ts +6 -0
- package/fesm2022/acorex-components-conversation-acorex-components-conversation-CjVDCoJw.mjs +0 -13711
- package/fesm2022/acorex-components-conversation-acorex-components-conversation-CjVDCoJw.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-audio-attachment.component-Ri-Jx210.mjs +0 -119
- package/fesm2022/acorex-components-conversation-audio-attachment.component-Ri-Jx210.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-audio-composer.payload-DiMDlVl9.mjs +0 -59
- package/fesm2022/acorex-components-conversation-audio-composer.payload-DiMDlVl9.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-audio-picker.component-CqrKBDIF.mjs +0 -432
- package/fesm2022/acorex-components-conversation-audio-picker.component-CqrKBDIF.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-audio-renderer.component-CO8owVrA.mjs +0 -177
- package/fesm2022/acorex-components-conversation-audio-renderer.component-CO8owVrA.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-audio.payload-CLnYjmYY.mjs +0 -54
- package/fesm2022/acorex-components-conversation-audio.payload-CLnYjmYY.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-conversation-audio.file-type-D-hIBwQ2.mjs +0 -100
- package/fesm2022/acorex-components-conversation-conversation-audio.file-type-D-hIBwQ2.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-conversation-file.file-type-DQUy3C64.mjs +0 -121
- package/fesm2022/acorex-components-conversation-conversation-file.file-type-DQUy3C64.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-conversation-image.file-type-Bd_SkwR0.mjs +0 -84
- package/fesm2022/acorex-components-conversation-conversation-image.file-type-Bd_SkwR0.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-conversation-info-media-view.component-BalIIAFB.mjs +0 -238
- package/fesm2022/acorex-components-conversation-conversation-info-media-view.component-BalIIAFB.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-conversation-info-panel.component-BJMo9bDd.mjs +0 -1080
- package/fesm2022/acorex-components-conversation-conversation-info-panel.component-BJMo9bDd.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-conversation-video.file-type-DyK0bLE5.mjs +0 -102
- package/fesm2022/acorex-components-conversation-conversation-video.file-type-DyK0bLE5.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-conversation-voice.file-type-v3rFWDv6.mjs +0 -90
- package/fesm2022/acorex-components-conversation-conversation-voice.file-type-v3rFWDv6.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-fallback-renderer.component-DOQkZWwP.mjs +0 -44
- package/fesm2022/acorex-components-conversation-fallback-renderer.component-DOQkZWwP.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-file-composer.payload-azPSH99m.mjs +0 -64
- package/fesm2022/acorex-components-conversation-file-composer.payload-azPSH99m.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-file-picker.component-cmUkgSF3.mjs +0 -468
- package/fesm2022/acorex-components-conversation-file-picker.component-cmUkgSF3.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-file-renderer.component-CpUgRTR4.mjs +0 -125
- package/fesm2022/acorex-components-conversation-file-renderer.component-CpUgRTR4.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-file.payload-DXwzNWxT.mjs +0 -50
- package/fesm2022/acorex-components-conversation-file.payload-DXwzNWxT.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-format-media-DUD4vA6F.mjs +0 -21
- package/fesm2022/acorex-components-conversation-format-media-DUD4vA6F.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-image-attachment.component-BZto5LFo.mjs +0 -77
- package/fesm2022/acorex-components-conversation-image-attachment.component-BZto5LFo.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-image-picker.component-G9EEOyDg.mjs +0 -407
- package/fesm2022/acorex-components-conversation-image-picker.component-G9EEOyDg.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-image-renderer.component-Bwa6rG6C.mjs +0 -83
- package/fesm2022/acorex-components-conversation-image-renderer.component-Bwa6rG6C.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-index-BbrYsQ84.mjs +0 -180
- package/fesm2022/acorex-components-conversation-index-BbrYsQ84.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-index-DtGEWeKN.mjs +0 -266
- package/fesm2022/acorex-components-conversation-index-DtGEWeKN.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-location-picker.component-Cx993j_c.mjs +0 -149
- package/fesm2022/acorex-components-conversation-location-picker.component-Cx993j_c.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-location-renderer.component-BiynmAJw.mjs +0 -118
- package/fesm2022/acorex-components-conversation-location-renderer.component-BiynmAJw.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-media-formatters-DV3wEEno.mjs +0 -17
- package/fesm2022/acorex-components-conversation-media-formatters-DV3wEEno.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-media-playback-info-bar-banner.component-a7OSpfB1.mjs +0 -140
- package/fesm2022/acorex-components-conversation-media-playback-info-bar-banner.component-a7OSpfB1.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-message-renderer-copy-host.component-D_eAnM6v.mjs +0 -33
- package/fesm2022/acorex-components-conversation-message-renderer-copy-host.component-D_eAnM6v.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-message-renderer-state.component-DSnNoz1N.mjs +0 -172
- package/fesm2022/acorex-components-conversation-message-renderer-state.component-DSnNoz1N.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-pagination-demo-data-DRr9PXjJ.mjs +0 -81
- package/fesm2022/acorex-components-conversation-pagination-demo-data-DRr9PXjJ.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-picker-header.component-BhTzlufI.mjs +0 -91
- package/fesm2022/acorex-components-conversation-picker-header.component-BhTzlufI.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-picker-toolbar.component-CpyS0j6P.mjs +0 -537
- package/fesm2022/acorex-components-conversation-picker-toolbar.component-CpyS0j6P.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-picker-upload-C-PlKPaU.mjs +0 -163
- package/fesm2022/acorex-components-conversation-picker-upload-C-PlKPaU.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-playback-banner-sync-BMsx6Fuy.mjs +0 -68
- package/fesm2022/acorex-components-conversation-playback-banner-sync-BMsx6Fuy.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-renderer-shared.styles-Digah3Zn.mjs +0 -95
- package/fesm2022/acorex-components-conversation-renderer-shared.styles-Digah3Zn.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-search.component-96NI2ERG.mjs +0 -187
- package/fesm2022/acorex-components-conversation-search.component-96NI2ERG.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-send-message-media--Rbrne7k.mjs +0 -170
- package/fesm2022/acorex-components-conversation-send-message-media--Rbrne7k.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-shared-storage.seed-zFjNXfKF.mjs +0 -750
- package/fesm2022/acorex-components-conversation-shared-storage.seed-zFjNXfKF.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-sticker-renderer.component-BZgx_Ylk.mjs +0 -103
- package/fesm2022/acorex-components-conversation-sticker-renderer.component-BZgx_Ylk.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-system-renderer.component-D1Aj-LuF.mjs +0 -55
- package/fesm2022/acorex-components-conversation-system-renderer.component-D1Aj-LuF.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-text-renderer.component-Cxvwjr2p.mjs +0 -109
- package/fesm2022/acorex-components-conversation-text-renderer.component-Cxvwjr2p.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-video-attachment.component-DBY_4Ri2.mjs +0 -105
- package/fesm2022/acorex-components-conversation-video-attachment.component-DBY_4Ri2.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-video-composer.payload-CWGxsPg5.mjs +0 -62
- package/fesm2022/acorex-components-conversation-video-composer.payload-CWGxsPg5.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-video-picker.component-D1JYwEm_.mjs +0 -446
- package/fesm2022/acorex-components-conversation-video-picker.component-D1JYwEm_.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-video-renderer.component-iwf2bU29.mjs +0 -181
- package/fesm2022/acorex-components-conversation-video-renderer.component-iwf2bU29.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-video.payload-DfBEjqQ4.mjs +0 -54
- package/fesm2022/acorex-components-conversation-video.payload-DfBEjqQ4.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-voice-composer.payload-DLVow7ex.mjs +0 -17
- package/fesm2022/acorex-components-conversation-voice-composer.payload-DLVow7ex.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-voice-recorder.component-P8J_5OH0.mjs +0 -328
- package/fesm2022/acorex-components-conversation-voice-recorder.component-P8J_5OH0.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-voice-renderer.component-CZpEqbXL.mjs +0 -270
- package/fesm2022/acorex-components-conversation-voice-renderer.component-CZpEqbXL.mjs.map +0 -1
|
@@ -1,468 +0,0 @@
|
|
|
1
|
-
import { AXUploaderService } from '@acorex/cdk/uploader';
|
|
2
|
-
import * as i1 from '@acorex/components/progress-bar';
|
|
3
|
-
import { AXProgressBarModule } from '@acorex/components/progress-bar';
|
|
4
|
-
import { AXToastService } from '@acorex/components/toast';
|
|
5
|
-
import { AXFileService, AXFileTypeRegistryService, runFileTypeUtilityForFile, runFileTypeUtility } from '@acorex/core/file';
|
|
6
|
-
import { AXTranslationService, AXTranslationModule } from '@acorex/core/translation';
|
|
7
|
-
import { CommonModule } from '@angular/common';
|
|
8
|
-
import * as i0 from '@angular/core';
|
|
9
|
-
import { inject, PLATFORM_ID, input, computed, signal, Component } from '@angular/core';
|
|
10
|
-
import { o as AXConversationComposerService, q as AX_CONVERSATION_FILE_CATALOG } from './acorex-components-conversation-acorex-components-conversation-CjVDCoJw.mjs';
|
|
11
|
-
import { A as AXConversationPickerHeaderComponent, a as AXConversationPickerFooterComponent } from './acorex-components-conversation-picker-header.component-BhTzlufI.mjs';
|
|
12
|
-
import { A as AXConversationPickerEmptyComponent, a as AXConversationPickerToolbarComponent, b as AXConversationPickerCaptionComponent, c as AXConversationPickerShellComponent } from './acorex-components-conversation-picker-toolbar.component-CpyS0j6P.mjs';
|
|
13
|
-
import { s as seedPickerInitialFiles, l as limitFilesToCapacity, a as notifyMaxFilesCapacityExceeded, n as notifyPickerValidationErrors, i as isUploadAborted, c as cleanupPickerUploads, p as pickerItemToUploadResult, d as dismissComposerPickerHost, u as uploadPickerFile, g as getPickerCancelUploadLabel } from './acorex-components-conversation-picker-upload-C-PlKPaU.mjs';
|
|
14
|
-
import { fileItemFromUpload } from './acorex-components-conversation-file-composer.payload-azPSH99m.mjs';
|
|
15
|
-
import { AX_CONVERSATION_FILE_PRESENTATION, createConversationFileFileType } from './acorex-components-conversation-conversation-file.file-type-DQUy3C64.mjs';
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* File Picker Component
|
|
19
|
-
* General-purpose file attachment interface for the composer
|
|
20
|
-
*/
|
|
21
|
-
class AXConversationFilePickerComponent {
|
|
22
|
-
get composerService() {
|
|
23
|
-
const svc = this.service() ?? this.composerServiceFromInjector;
|
|
24
|
-
if (!svc) {
|
|
25
|
-
throw new Error('AXConversationComposerService is required for the file picker');
|
|
26
|
-
}
|
|
27
|
-
return svc;
|
|
28
|
-
}
|
|
29
|
-
constructor() {
|
|
30
|
-
this.uploadsDismissed = false;
|
|
31
|
-
this.retainUploadedOnDismiss = false;
|
|
32
|
-
this.uploader = inject(AXUploaderService);
|
|
33
|
-
this.fileService = inject(AXFileService);
|
|
34
|
-
this.fileTypeRegistry = inject(AXFileTypeRegistryService);
|
|
35
|
-
this.platformId = inject(PLATFORM_ID);
|
|
36
|
-
this.service = input(...(ngDevMode ? [undefined, { debugName: "service" }] : []));
|
|
37
|
-
this.composerServiceFromInjector = inject(AXConversationComposerService, { optional: true });
|
|
38
|
-
this.toast = inject(AXToastService);
|
|
39
|
-
this.translation = inject(AXTranslationService);
|
|
40
|
-
this.conversation = input.required(...(ngDevMode ? [{ debugName: "conversation" }] : []));
|
|
41
|
-
this.maxFiles = input(10, ...(ngDevMode ? [{ debugName: "maxFiles" }] : []));
|
|
42
|
-
this.initialFiles = input([], ...(ngDevMode ? [{ debugName: "initialFiles" }] : []));
|
|
43
|
-
this.__popup__ = input(...(ngDevMode ? [undefined, { debugName: "__popup__" }] : []));
|
|
44
|
-
this.catalogFileType = AX_CONVERSATION_FILE_CATALOG;
|
|
45
|
-
this.allowMultiple = computed(() => this.maxFiles() > 1, ...(ngDevMode ? [{ debugName: "allowMultiple" }] : []));
|
|
46
|
-
this.files = signal([], ...(ngDevMode ? [{ debugName: "files" }] : []));
|
|
47
|
-
this.isDragging = signal(false, ...(ngDevMode ? [{ debugName: "isDragging" }] : []));
|
|
48
|
-
this.isUploading = signal(false, ...(ngDevMode ? [{ debugName: "isUploading" }] : []));
|
|
49
|
-
this.emptyIconClass = computed(() => this.isDragging() ? 'fa-light fa-cloud-arrow-up' : AX_CONVERSATION_FILE_PRESENTATION.icon, ...(ngDevMode ? [{ debugName: "emptyIconClass" }] : []));
|
|
50
|
-
this.caption = '';
|
|
51
|
-
this.fileTypeRegistry.registerTypes([createConversationFileFileType()]);
|
|
52
|
-
seedPickerInitialFiles(this.initialFiles, (files) => this.handleFiles(files));
|
|
53
|
-
}
|
|
54
|
-
createUtilityContext() {
|
|
55
|
-
return {
|
|
56
|
-
readAsDataUrl: (file) => this.fileService.blobToBase64(file),
|
|
57
|
-
platformId: this.platformId,
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
async getCatalogFileTypeDef() {
|
|
61
|
-
this.catalogFileTypeDef ??= await this.fileService.getFileType(this.catalogFileType);
|
|
62
|
-
return this.catalogFileTypeDef;
|
|
63
|
-
}
|
|
64
|
-
pickerKind(catalogName) {
|
|
65
|
-
if (catalogName === 'conversation-image')
|
|
66
|
-
return 'image';
|
|
67
|
-
if (catalogName === 'conversation-video')
|
|
68
|
-
return 'video';
|
|
69
|
-
if (catalogName === 'conversation-audio')
|
|
70
|
-
return 'audio';
|
|
71
|
-
return 'file';
|
|
72
|
-
}
|
|
73
|
-
async handleFiles(fileList) {
|
|
74
|
-
const max = this.maxFiles();
|
|
75
|
-
const capacity = limitFilesToCapacity(fileList, this.files().length, max);
|
|
76
|
-
if (capacity.length < fileList.length) {
|
|
77
|
-
notifyMaxFilesCapacityExceeded(this.toast, this.translation, max);
|
|
78
|
-
}
|
|
79
|
-
if (capacity.length === 0) {
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
const { accepted, rejected } = await this.uploader.validateFiles(capacity, this.catalogFileType);
|
|
83
|
-
notifyPickerValidationErrors(this.toast, this.translation, rejected);
|
|
84
|
-
const fileType = await this.getCatalogFileTypeDef();
|
|
85
|
-
const ctx = this.createUtilityContext();
|
|
86
|
-
for (const file of accepted) {
|
|
87
|
-
try {
|
|
88
|
-
const previewResult = fileType
|
|
89
|
-
? await runFileTypeUtilityForFile(fileType, ctx, file, 'preview')
|
|
90
|
-
: undefined;
|
|
91
|
-
const rowCatalogResult = fileType
|
|
92
|
-
? await runFileTypeUtilityForFile(fileType, ctx, file, 'pickerCatalog')
|
|
93
|
-
: undefined;
|
|
94
|
-
const preview = typeof previewResult === 'string' ? previewResult : undefined;
|
|
95
|
-
const rowCatalog = typeof rowCatalogResult === 'string' ? rowCatalogResult : this.catalogFileType;
|
|
96
|
-
const rowType = await this.fileService.getFileType(rowCatalog);
|
|
97
|
-
const icon = rowType?.icon ?? fileType?.icon ?? 'fa-light fa-file';
|
|
98
|
-
const pickerKind = this.pickerKind(rowCatalog);
|
|
99
|
-
let fileIndex = -1;
|
|
100
|
-
this.files.update((files) => {
|
|
101
|
-
fileIndex = files.length;
|
|
102
|
-
return [...files, { file, preview, icon, type: pickerKind, uploadProgress: 0, uploading: true }];
|
|
103
|
-
});
|
|
104
|
-
if (fileIndex >= 0) {
|
|
105
|
-
void this.uploadFile(fileIndex, file);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
catch (error) {
|
|
109
|
-
console.error('Failed to process file:', error);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
async uploadFile(index, file) {
|
|
114
|
-
const abortController = new AbortController();
|
|
115
|
-
this.files.update((files) => {
|
|
116
|
-
const updated = [...files];
|
|
117
|
-
updated[index] = { ...updated[index], abortController };
|
|
118
|
-
return updated;
|
|
119
|
-
});
|
|
120
|
-
try {
|
|
121
|
-
const result = await this.uploadFileWithProgress(file, (progress) => {
|
|
122
|
-
this.updateFileProgress(index, progress, true);
|
|
123
|
-
}, abortController.signal);
|
|
124
|
-
this.updateFileProgress(index, 100, false, true, result.url, result.mediaId);
|
|
125
|
-
}
|
|
126
|
-
catch (error) {
|
|
127
|
-
if (this.uploadsDismissed || isUploadAborted(error, abortController.signal)) {
|
|
128
|
-
return;
|
|
129
|
-
}
|
|
130
|
-
console.error('Failed to upload file:', error);
|
|
131
|
-
this.updateFileProgress(index, 0, false, false, undefined, undefined, this.translation.translateSync('@acorex:chat.errors.upload-failed'));
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
removeFile(index) {
|
|
135
|
-
const item = this.files()[index];
|
|
136
|
-
if (item) {
|
|
137
|
-
cleanupPickerUploads(this.uploader, [item]);
|
|
138
|
-
}
|
|
139
|
-
this.files.update((files) => files.filter((_, i) => i !== index));
|
|
140
|
-
}
|
|
141
|
-
async sendFiles() {
|
|
142
|
-
const fileList = this.files();
|
|
143
|
-
if (fileList.length === 0)
|
|
144
|
-
return;
|
|
145
|
-
// Check if all files are uploaded
|
|
146
|
-
const allUploaded = fileList.every((f) => f.uploaded && !f.error);
|
|
147
|
-
if (!allUploaded) {
|
|
148
|
-
console.warn('Some files are still uploading or failed');
|
|
149
|
-
return;
|
|
150
|
-
}
|
|
151
|
-
const files = fileList.flatMap((f) => {
|
|
152
|
-
const result = pickerItemToUploadResult(f);
|
|
153
|
-
return result ? [fileItemFromUpload(f.file, result)] : [];
|
|
154
|
-
});
|
|
155
|
-
if (files.length === 0) {
|
|
156
|
-
return;
|
|
157
|
-
}
|
|
158
|
-
const command = {
|
|
159
|
-
conversationId: this.conversation().id,
|
|
160
|
-
type: 'file',
|
|
161
|
-
payload: {
|
|
162
|
-
type: 'file',
|
|
163
|
-
files,
|
|
164
|
-
caption: this.caption.trim() || undefined,
|
|
165
|
-
},
|
|
166
|
-
};
|
|
167
|
-
this.retainUploadedOnDismiss = true;
|
|
168
|
-
const popup = this.__popup__();
|
|
169
|
-
this.dismissPicker();
|
|
170
|
-
dismissComposerPickerHost(this.composerService, popup);
|
|
171
|
-
void this.composerService.sendMessage(command).catch(() => {
|
|
172
|
-
this.retainUploadedOnDismiss = false;
|
|
173
|
-
});
|
|
174
|
-
}
|
|
175
|
-
updateFileProgress(index, progress, uploading, uploaded = false, uploadedUrl, mediaId, error) {
|
|
176
|
-
if (this.uploadsDismissed) {
|
|
177
|
-
return;
|
|
178
|
-
}
|
|
179
|
-
this.files.update((files) => {
|
|
180
|
-
const updated = [...files];
|
|
181
|
-
updated[index] = {
|
|
182
|
-
...updated[index],
|
|
183
|
-
uploadProgress: progress,
|
|
184
|
-
uploading,
|
|
185
|
-
uploaded,
|
|
186
|
-
uploadedUrl,
|
|
187
|
-
mediaId,
|
|
188
|
-
error,
|
|
189
|
-
};
|
|
190
|
-
return updated;
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
async uploadFileWithProgress(file, onProgress, signal) {
|
|
194
|
-
return uploadPickerFile(this.uploader, this.conversation().id, file, onProgress, signal);
|
|
195
|
-
}
|
|
196
|
-
cancel() {
|
|
197
|
-
this.dismissPicker();
|
|
198
|
-
dismissComposerPickerHost(this.composerService, this.__popup__());
|
|
199
|
-
}
|
|
200
|
-
ngOnDestroy() {
|
|
201
|
-
this.dismissPicker();
|
|
202
|
-
}
|
|
203
|
-
dismissPicker() {
|
|
204
|
-
if (this.uploadsDismissed) {
|
|
205
|
-
return;
|
|
206
|
-
}
|
|
207
|
-
this.uploadsDismissed = true;
|
|
208
|
-
const snapshot = [...this.files()];
|
|
209
|
-
cleanupPickerUploads(this.uploader, snapshot, {
|
|
210
|
-
retainUploaded: this.retainUploadedOnDismiss,
|
|
211
|
-
});
|
|
212
|
-
this.retainUploadedOnDismiss = false;
|
|
213
|
-
this.files.set([]);
|
|
214
|
-
this.caption = '';
|
|
215
|
-
}
|
|
216
|
-
getCancelUploadLabel() {
|
|
217
|
-
return getPickerCancelUploadLabel(this.translation);
|
|
218
|
-
}
|
|
219
|
-
formatFileSize(bytes) {
|
|
220
|
-
const fileType = this.catalogFileTypeDef;
|
|
221
|
-
const result = fileType
|
|
222
|
-
? runFileTypeUtility(fileType, this.createUtilityContext(), undefined, 'formatSize', bytes)
|
|
223
|
-
: undefined;
|
|
224
|
-
return typeof result === 'string' ? result : `${bytes} B`;
|
|
225
|
-
}
|
|
226
|
-
canSend() {
|
|
227
|
-
const fileList = this.files();
|
|
228
|
-
if (fileList.length === 0)
|
|
229
|
-
return false;
|
|
230
|
-
// Can send if all files are uploaded and no errors
|
|
231
|
-
return fileList.every((f) => f.uploaded && !f.error && !f.uploading);
|
|
232
|
-
}
|
|
233
|
-
getSendButtonText() {
|
|
234
|
-
const fileList = this.files();
|
|
235
|
-
const uploadingCount = fileList.filter((f) => f.uploading).length;
|
|
236
|
-
const uploadedCount = fileList.filter((f) => f.uploaded).length;
|
|
237
|
-
if (uploadingCount > 0) {
|
|
238
|
-
return this.translation.translateSync('@acorex:chat.pickers.files.uploading-count', {
|
|
239
|
-
params: { count: uploadingCount },
|
|
240
|
-
});
|
|
241
|
-
}
|
|
242
|
-
if (uploadedCount === fileList.length) {
|
|
243
|
-
return this.translation.translateSync('@acorex:chat.pickers.files.send-count', {
|
|
244
|
-
params: { count: fileList.length },
|
|
245
|
-
});
|
|
246
|
-
}
|
|
247
|
-
return this.translation.translateSync('@acorex:chat.pickers.files.ready-count', {
|
|
248
|
-
params: { ready: uploadedCount, total: fileList.length },
|
|
249
|
-
});
|
|
250
|
-
}
|
|
251
|
-
getEmptyTitle() {
|
|
252
|
-
return this.isDragging()
|
|
253
|
-
? this.translation.translateSync('@acorex:chat.pickers.files.drop-here')
|
|
254
|
-
: this.translation.translateSync('@acorex:chat.pickers.files.select');
|
|
255
|
-
}
|
|
256
|
-
getEmptySubtitle() {
|
|
257
|
-
return this.isDragging()
|
|
258
|
-
? this.translation.translateSync('@acorex:chat.pickers.common.release-to-upload')
|
|
259
|
-
: this.translation.translateSync('@acorex:chat.pickers.common.click-to-browse');
|
|
260
|
-
}
|
|
261
|
-
getSelectedCountText() {
|
|
262
|
-
return this.translation.translateSync('@acorex:chat.pickers.files.selected-count', {
|
|
263
|
-
params: { count: this.files().length },
|
|
264
|
-
});
|
|
265
|
-
}
|
|
266
|
-
getUploadingLabel(progress) {
|
|
267
|
-
return this.translation.translateSync('@acorex:chat.pickers.files.uploading-progress', {
|
|
268
|
-
params: { progress },
|
|
269
|
-
});
|
|
270
|
-
}
|
|
271
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXConversationFilePickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
272
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.3", type: AXConversationFilePickerComponent, isStandalone: true, selector: "ax-conversation-file-picker", inputs: { service: { classPropertyName: "service", publicName: "service", isSignal: true, isRequired: false, transformFunction: null }, conversation: { classPropertyName: "conversation", publicName: "conversation", isSignal: true, isRequired: true, transformFunction: null }, maxFiles: { classPropertyName: "maxFiles", publicName: "maxFiles", isSignal: true, isRequired: false, transformFunction: null }, initialFiles: { classPropertyName: "initialFiles", publicName: "initialFiles", isSignal: true, isRequired: false, transformFunction: null }, __popup__: { classPropertyName: "__popup__", publicName: "__popup__", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
273
|
-
<ax-conversation-picker-shell
|
|
274
|
-
[fileType]="catalogFileType"
|
|
275
|
-
[multiple]="allowMultiple()"
|
|
276
|
-
(filesSelected)="handleFiles($event)"
|
|
277
|
-
(dragEnter)="isDragging.set(true)"
|
|
278
|
-
(dragLeave)="isDragging.set(false)"
|
|
279
|
-
>
|
|
280
|
-
<ax-conversation-picker-header [title]="translation.translateSync('@acorex:chat.pickers.files.title')" (onClose)="cancel()" />
|
|
281
|
-
|
|
282
|
-
<div class="ax-conversation-picker__scroll">
|
|
283
|
-
@if (files().length === 0) {
|
|
284
|
-
<ax-conversation-picker-empty
|
|
285
|
-
[title]="getEmptyTitle()"
|
|
286
|
-
[hint]="getEmptySubtitle()"
|
|
287
|
-
[iconClass]="emptyIconClass()"
|
|
288
|
-
[dragOver]="isDragging()"
|
|
289
|
-
/>
|
|
290
|
-
} @else {
|
|
291
|
-
<div class="ax-conversation-picker__body">
|
|
292
|
-
<ax-conversation-picker-toolbar
|
|
293
|
-
[countLabel]="getSelectedCountText()"
|
|
294
|
-
[addMoreLabel]="translation.translateSync('@acorex:chat.pickers.common.add-more')"
|
|
295
|
-
/>
|
|
296
|
-
|
|
297
|
-
<div class="ax-conversation-picker__list">
|
|
298
|
-
@for (file of files(); track $index) {
|
|
299
|
-
<div class="ax-conversation-picker__row">
|
|
300
|
-
<div class="ax-conversation-picker__thumb">
|
|
301
|
-
@if (file.type === 'image' && file.preview) {
|
|
302
|
-
<img [src]="file.preview" [alt]="file.file.name" />
|
|
303
|
-
} @else {
|
|
304
|
-
<i [class]="file.icon"></i>
|
|
305
|
-
}
|
|
306
|
-
</div>
|
|
307
|
-
<div class="ax-conversation-picker__details">
|
|
308
|
-
<div class="ax-conversation-picker__name">{{ file.file.name }}</div>
|
|
309
|
-
<div class="ax-conversation-picker__status">
|
|
310
|
-
@if (file.uploading) {
|
|
311
|
-
<span>{{ getUploadingLabel(file.uploadProgress ?? 0) }}</span>
|
|
312
|
-
} @else if (file.uploaded) {
|
|
313
|
-
<span class="ax-conversation-picker__status--ok"
|
|
314
|
-
><i class="fa-light fa-check"></i>
|
|
315
|
-
{{ translation.translateSync('@acorex:chat.pickers.files.uploaded') }}</span
|
|
316
|
-
>
|
|
317
|
-
} @else if (file.error) {
|
|
318
|
-
<span class="ax-conversation-picker__status--err"
|
|
319
|
-
><i class="fa-light fa-xmark"></i> {{ file.error }}</span
|
|
320
|
-
>
|
|
321
|
-
} @else {
|
|
322
|
-
<span>{{ formatFileSize(file.file.size) }}</span>
|
|
323
|
-
}
|
|
324
|
-
</div>
|
|
325
|
-
@if (file.uploading || file.uploaded) {
|
|
326
|
-
<div class="ax-conversation-picker__progress">
|
|
327
|
-
<ax-progress-bar [progress]="file.uploadProgress || 0" [mode]="'determinate'" [height]="3" />
|
|
328
|
-
</div>
|
|
329
|
-
}
|
|
330
|
-
</div>
|
|
331
|
-
<button
|
|
332
|
-
type="button"
|
|
333
|
-
class="ax-conversation-picker__remove"
|
|
334
|
-
(click)="removeFile($index)"
|
|
335
|
-
[attr.aria-label]="
|
|
336
|
-
file.uploading
|
|
337
|
-
? getCancelUploadLabel()
|
|
338
|
-
: translation.translateSync('@acorex:chat.pickers.common.remove')
|
|
339
|
-
"
|
|
340
|
-
>
|
|
341
|
-
<i class="fa-light fa-xmark"></i>
|
|
342
|
-
</button>
|
|
343
|
-
</div>
|
|
344
|
-
}
|
|
345
|
-
</div>
|
|
346
|
-
</div>
|
|
347
|
-
}
|
|
348
|
-
</div>
|
|
349
|
-
|
|
350
|
-
<ax-conversation-picker-caption [(caption)]="caption" />
|
|
351
|
-
|
|
352
|
-
@if (files().length > 0) {
|
|
353
|
-
<ax-conversation-picker-footer
|
|
354
|
-
[sendText]="getSendButtonText()"
|
|
355
|
-
[sendDisabled]="!canSend()"
|
|
356
|
-
(onCancel)="cancel()"
|
|
357
|
-
(onSend)="sendFiles()"
|
|
358
|
-
/>
|
|
359
|
-
}
|
|
360
|
-
</ax-conversation-picker-shell>
|
|
361
|
-
`, isInline: true, styles: [":host{display:block;width:100%;max-width:100%;min-height:0}.ax-conversation-picker__scroll{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}.ax-conversation-picker__empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.375rem;min-height:8.5rem;margin:.75rem;padding:1rem .75rem;border:1px dashed rgb(var(--ax-sys-color-border-surface));border-radius:var(--ax-sys-border-radius, .5rem);cursor:pointer;transition:border-color .15s ease,background-color .15s ease;text-align:center;touch-action:manipulation}.ax-conversation-picker__empty:hover,.ax-conversation-picker__empty--drag{border-color:rgb(var(--ax-sys-color-primary-500));background:rgba(var(--ax-sys-color-primary-500),.06)}.ax-conversation-picker__empty-icon{font-size:1.75rem;line-height:1;color:rgba(var(--ax-sys-color-on-surface),.55)}.ax-conversation-picker__empty-title{margin:0;font-size:.8125rem;font-weight:600;color:rgb(var(--ax-sys-color-on-surface))}.ax-conversation-picker__empty-hint{margin:0;font-size:.75rem;color:rgba(var(--ax-sys-color-on-surface),.6)}.ax-conversation-picker__body{padding:0 .75rem .75rem}.ax-conversation-picker__list{display:flex;flex-direction:column;gap:.5rem;padding-top:.5rem}.ax-conversation-picker__row{display:flex;align-items:center;gap:.625rem;padding:.5rem .625rem;border:1px solid rgb(var(--ax-sys-color-border-light-surface));border-radius:var(--ax-sys-border-radius, .375rem);background:rgb(var(--ax-sys-color-surface));transition:background-color .15s ease}@media (hover: hover){.ax-conversation-picker__row:hover{background:rgb(var(--ax-sys-color-light-surface))}}.ax-conversation-picker__thumb{position:relative;display:flex;align-items:center;justify-content:center;width:2.5rem;height:2.5rem;flex-shrink:0;border-radius:var(--ax-sys-border-radius, .375rem);background:rgba(var(--ax-sys-color-primary-500),.08);color:rgb(var(--ax-sys-color-primary-500));font-size:1.125rem;overflow:hidden}.ax-conversation-picker__thumb img,.ax-conversation-picker__thumb video{width:100%;height:100%;object-fit:cover;display:block;pointer-events:none}.ax-conversation-picker__thumb-badge{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;background:#00000052;color:rgb(var(--ax-sys-color-light));font-size:.625rem;pointer-events:none}.ax-conversation-picker__details{flex:1;min-width:0;display:flex;flex-direction:column;gap:.125rem}.ax-conversation-picker__name{font-size:.8125rem;font-weight:500;color:rgb(var(--ax-sys-color-on-surface));overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ax-conversation-picker__status{display:flex;flex-wrap:wrap;gap:.375rem;font-size:.6875rem;color:rgba(var(--ax-sys-color-on-surface),.65)}.ax-conversation-picker__status--ok{color:rgb(var(--ax-sys-color-success-600));font-weight:500}.ax-conversation-picker__status--err{color:rgb(var(--ax-sys-color-danger-600));font-weight:500}.ax-conversation-picker__progress{width:100%;margin-top:.125rem}.ax-conversation-picker__remove{display:flex;align-items:center;justify-content:center;width:2.75rem;height:2.75rem;flex-shrink:0;border:none;border-radius:var(--ax-sys-border-radius, .25rem);background:transparent;color:rgba(var(--ax-sys-color-on-surface),.55);font-size:1rem;cursor:pointer;touch-action:manipulation;transition:background-color .15s ease,color .15s ease}.ax-conversation-picker__remove:hover,.ax-conversation-picker__remove:focus-visible{background:rgba(var(--ax-sys-color-danger-500),.1);color:rgb(var(--ax-sys-color-danger-500));outline:none}.ax-conversation-picker__grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(5.25rem,1fr));gap:.5rem}.ax-conversation-picker__tile{position:relative;aspect-ratio:1;border-radius:var(--ax-sys-border-radius, .375rem);overflow:hidden;border:1px solid rgb(var(--ax-sys-color-border-light-surface));background:rgb(var(--ax-sys-color-light-surface))}.ax-conversation-picker__tile img{width:100%;height:100%;object-fit:cover;display:block}.ax-conversation-picker__tile-remove{position:absolute;top:.25rem;inset-inline-end:.25rem;z-index:2;display:flex;align-items:center;justify-content:center;width:1.75rem;height:1.75rem;border:none;border-radius:50%;background:rgb(var(--ax-sys-color-danger-500));color:rgb(var(--ax-sys-color-light));font-size:.6875rem;cursor:pointer;touch-action:manipulation;box-shadow:0 1px 3px #0003}.ax-conversation-picker__tile-overlay{position:absolute;inset-inline:0;bottom:0;padding:.25rem;background:linear-gradient(transparent,#0000008c)}.ax-conversation-picker__tile-status{font-size:.625rem;color:rgb(var(--ax-sys-color-light));line-height:1.2}.ax-conversation-picker__caption-slot{flex-shrink:0;padding:.5rem .75rem;border-top:1px solid rgb(var(--ax-sys-color-border-light-surface));background:rgb(var(--ax-sys-color-lightest-surface))}.ax-conversation-picker__input-hidden{display:none}@container picker (max-width: 480px){.ax-conversation-picker__grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:.375rem}.ax-conversation-picker__row{padding:.4375rem .5rem;gap:.5rem}.ax-conversation-picker__thumb{width:2.25rem;height:2.25rem}.ax-conversation-picker__empty{min-height:7.5rem;margin:.5rem}.ax-conversation-picker__body{padding-inline:.5rem;padding-bottom:.5rem}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXProgressBarModule }, { kind: "component", type: i1.AXProgressBarComponent, selector: "ax-progress-bar", inputs: ["color", "mode", "progress", "height"], outputs: ["ValueChange", "sizeChange"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "component", type: AXConversationPickerHeaderComponent, selector: "ax-conversation-picker-header", inputs: ["title"], outputs: ["onClose"] }, { kind: "component", type: AXConversationPickerFooterComponent, selector: "ax-conversation-picker-footer", inputs: ["sendText", "sendDisabled"], outputs: ["onCancel", "onSend"] }, { kind: "component", type: AXConversationPickerEmptyComponent, selector: "ax-conversation-picker-empty", inputs: ["title", "hint", "iconClass", "dragOver"] }, { kind: "component", type: AXConversationPickerToolbarComponent, selector: "ax-conversation-picker-toolbar", inputs: ["countLabel", "addMoreLabel"] }, { kind: "component", type: AXConversationPickerCaptionComponent, selector: "ax-conversation-picker-caption", inputs: ["caption"], outputs: ["captionChange"] }, { kind: "component", type: AXConversationPickerShellComponent, selector: "ax-conversation-picker-shell", inputs: ["fileType", "multiple"], outputs: ["filesSelected", "dragEnter", "dragLeave", "dragOver"] }] }); }
|
|
362
|
-
}
|
|
363
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXConversationFilePickerComponent, decorators: [{
|
|
364
|
-
type: Component,
|
|
365
|
-
args: [{ selector: 'ax-conversation-file-picker', imports: [
|
|
366
|
-
CommonModule,
|
|
367
|
-
AXProgressBarModule,
|
|
368
|
-
AXTranslationModule,
|
|
369
|
-
AXConversationPickerHeaderComponent,
|
|
370
|
-
AXConversationPickerFooterComponent,
|
|
371
|
-
AXConversationPickerEmptyComponent,
|
|
372
|
-
AXConversationPickerToolbarComponent,
|
|
373
|
-
AXConversationPickerCaptionComponent,
|
|
374
|
-
AXConversationPickerShellComponent,
|
|
375
|
-
], template: `
|
|
376
|
-
<ax-conversation-picker-shell
|
|
377
|
-
[fileType]="catalogFileType"
|
|
378
|
-
[multiple]="allowMultiple()"
|
|
379
|
-
(filesSelected)="handleFiles($event)"
|
|
380
|
-
(dragEnter)="isDragging.set(true)"
|
|
381
|
-
(dragLeave)="isDragging.set(false)"
|
|
382
|
-
>
|
|
383
|
-
<ax-conversation-picker-header [title]="translation.translateSync('@acorex:chat.pickers.files.title')" (onClose)="cancel()" />
|
|
384
|
-
|
|
385
|
-
<div class="ax-conversation-picker__scroll">
|
|
386
|
-
@if (files().length === 0) {
|
|
387
|
-
<ax-conversation-picker-empty
|
|
388
|
-
[title]="getEmptyTitle()"
|
|
389
|
-
[hint]="getEmptySubtitle()"
|
|
390
|
-
[iconClass]="emptyIconClass()"
|
|
391
|
-
[dragOver]="isDragging()"
|
|
392
|
-
/>
|
|
393
|
-
} @else {
|
|
394
|
-
<div class="ax-conversation-picker__body">
|
|
395
|
-
<ax-conversation-picker-toolbar
|
|
396
|
-
[countLabel]="getSelectedCountText()"
|
|
397
|
-
[addMoreLabel]="translation.translateSync('@acorex:chat.pickers.common.add-more')"
|
|
398
|
-
/>
|
|
399
|
-
|
|
400
|
-
<div class="ax-conversation-picker__list">
|
|
401
|
-
@for (file of files(); track $index) {
|
|
402
|
-
<div class="ax-conversation-picker__row">
|
|
403
|
-
<div class="ax-conversation-picker__thumb">
|
|
404
|
-
@if (file.type === 'image' && file.preview) {
|
|
405
|
-
<img [src]="file.preview" [alt]="file.file.name" />
|
|
406
|
-
} @else {
|
|
407
|
-
<i [class]="file.icon"></i>
|
|
408
|
-
}
|
|
409
|
-
</div>
|
|
410
|
-
<div class="ax-conversation-picker__details">
|
|
411
|
-
<div class="ax-conversation-picker__name">{{ file.file.name }}</div>
|
|
412
|
-
<div class="ax-conversation-picker__status">
|
|
413
|
-
@if (file.uploading) {
|
|
414
|
-
<span>{{ getUploadingLabel(file.uploadProgress ?? 0) }}</span>
|
|
415
|
-
} @else if (file.uploaded) {
|
|
416
|
-
<span class="ax-conversation-picker__status--ok"
|
|
417
|
-
><i class="fa-light fa-check"></i>
|
|
418
|
-
{{ translation.translateSync('@acorex:chat.pickers.files.uploaded') }}</span
|
|
419
|
-
>
|
|
420
|
-
} @else if (file.error) {
|
|
421
|
-
<span class="ax-conversation-picker__status--err"
|
|
422
|
-
><i class="fa-light fa-xmark"></i> {{ file.error }}</span
|
|
423
|
-
>
|
|
424
|
-
} @else {
|
|
425
|
-
<span>{{ formatFileSize(file.file.size) }}</span>
|
|
426
|
-
}
|
|
427
|
-
</div>
|
|
428
|
-
@if (file.uploading || file.uploaded) {
|
|
429
|
-
<div class="ax-conversation-picker__progress">
|
|
430
|
-
<ax-progress-bar [progress]="file.uploadProgress || 0" [mode]="'determinate'" [height]="3" />
|
|
431
|
-
</div>
|
|
432
|
-
}
|
|
433
|
-
</div>
|
|
434
|
-
<button
|
|
435
|
-
type="button"
|
|
436
|
-
class="ax-conversation-picker__remove"
|
|
437
|
-
(click)="removeFile($index)"
|
|
438
|
-
[attr.aria-label]="
|
|
439
|
-
file.uploading
|
|
440
|
-
? getCancelUploadLabel()
|
|
441
|
-
: translation.translateSync('@acorex:chat.pickers.common.remove')
|
|
442
|
-
"
|
|
443
|
-
>
|
|
444
|
-
<i class="fa-light fa-xmark"></i>
|
|
445
|
-
</button>
|
|
446
|
-
</div>
|
|
447
|
-
}
|
|
448
|
-
</div>
|
|
449
|
-
</div>
|
|
450
|
-
}
|
|
451
|
-
</div>
|
|
452
|
-
|
|
453
|
-
<ax-conversation-picker-caption [(caption)]="caption" />
|
|
454
|
-
|
|
455
|
-
@if (files().length > 0) {
|
|
456
|
-
<ax-conversation-picker-footer
|
|
457
|
-
[sendText]="getSendButtonText()"
|
|
458
|
-
[sendDisabled]="!canSend()"
|
|
459
|
-
(onCancel)="cancel()"
|
|
460
|
-
(onSend)="sendFiles()"
|
|
461
|
-
/>
|
|
462
|
-
}
|
|
463
|
-
</ax-conversation-picker-shell>
|
|
464
|
-
`, styles: [":host{display:block;width:100%;max-width:100%;min-height:0}.ax-conversation-picker__scroll{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}.ax-conversation-picker__empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.375rem;min-height:8.5rem;margin:.75rem;padding:1rem .75rem;border:1px dashed rgb(var(--ax-sys-color-border-surface));border-radius:var(--ax-sys-border-radius, .5rem);cursor:pointer;transition:border-color .15s ease,background-color .15s ease;text-align:center;touch-action:manipulation}.ax-conversation-picker__empty:hover,.ax-conversation-picker__empty--drag{border-color:rgb(var(--ax-sys-color-primary-500));background:rgba(var(--ax-sys-color-primary-500),.06)}.ax-conversation-picker__empty-icon{font-size:1.75rem;line-height:1;color:rgba(var(--ax-sys-color-on-surface),.55)}.ax-conversation-picker__empty-title{margin:0;font-size:.8125rem;font-weight:600;color:rgb(var(--ax-sys-color-on-surface))}.ax-conversation-picker__empty-hint{margin:0;font-size:.75rem;color:rgba(var(--ax-sys-color-on-surface),.6)}.ax-conversation-picker__body{padding:0 .75rem .75rem}.ax-conversation-picker__list{display:flex;flex-direction:column;gap:.5rem;padding-top:.5rem}.ax-conversation-picker__row{display:flex;align-items:center;gap:.625rem;padding:.5rem .625rem;border:1px solid rgb(var(--ax-sys-color-border-light-surface));border-radius:var(--ax-sys-border-radius, .375rem);background:rgb(var(--ax-sys-color-surface));transition:background-color .15s ease}@media (hover: hover){.ax-conversation-picker__row:hover{background:rgb(var(--ax-sys-color-light-surface))}}.ax-conversation-picker__thumb{position:relative;display:flex;align-items:center;justify-content:center;width:2.5rem;height:2.5rem;flex-shrink:0;border-radius:var(--ax-sys-border-radius, .375rem);background:rgba(var(--ax-sys-color-primary-500),.08);color:rgb(var(--ax-sys-color-primary-500));font-size:1.125rem;overflow:hidden}.ax-conversation-picker__thumb img,.ax-conversation-picker__thumb video{width:100%;height:100%;object-fit:cover;display:block;pointer-events:none}.ax-conversation-picker__thumb-badge{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;background:#00000052;color:rgb(var(--ax-sys-color-light));font-size:.625rem;pointer-events:none}.ax-conversation-picker__details{flex:1;min-width:0;display:flex;flex-direction:column;gap:.125rem}.ax-conversation-picker__name{font-size:.8125rem;font-weight:500;color:rgb(var(--ax-sys-color-on-surface));overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ax-conversation-picker__status{display:flex;flex-wrap:wrap;gap:.375rem;font-size:.6875rem;color:rgba(var(--ax-sys-color-on-surface),.65)}.ax-conversation-picker__status--ok{color:rgb(var(--ax-sys-color-success-600));font-weight:500}.ax-conversation-picker__status--err{color:rgb(var(--ax-sys-color-danger-600));font-weight:500}.ax-conversation-picker__progress{width:100%;margin-top:.125rem}.ax-conversation-picker__remove{display:flex;align-items:center;justify-content:center;width:2.75rem;height:2.75rem;flex-shrink:0;border:none;border-radius:var(--ax-sys-border-radius, .25rem);background:transparent;color:rgba(var(--ax-sys-color-on-surface),.55);font-size:1rem;cursor:pointer;touch-action:manipulation;transition:background-color .15s ease,color .15s ease}.ax-conversation-picker__remove:hover,.ax-conversation-picker__remove:focus-visible{background:rgba(var(--ax-sys-color-danger-500),.1);color:rgb(var(--ax-sys-color-danger-500));outline:none}.ax-conversation-picker__grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(5.25rem,1fr));gap:.5rem}.ax-conversation-picker__tile{position:relative;aspect-ratio:1;border-radius:var(--ax-sys-border-radius, .375rem);overflow:hidden;border:1px solid rgb(var(--ax-sys-color-border-light-surface));background:rgb(var(--ax-sys-color-light-surface))}.ax-conversation-picker__tile img{width:100%;height:100%;object-fit:cover;display:block}.ax-conversation-picker__tile-remove{position:absolute;top:.25rem;inset-inline-end:.25rem;z-index:2;display:flex;align-items:center;justify-content:center;width:1.75rem;height:1.75rem;border:none;border-radius:50%;background:rgb(var(--ax-sys-color-danger-500));color:rgb(var(--ax-sys-color-light));font-size:.6875rem;cursor:pointer;touch-action:manipulation;box-shadow:0 1px 3px #0003}.ax-conversation-picker__tile-overlay{position:absolute;inset-inline:0;bottom:0;padding:.25rem;background:linear-gradient(transparent,#0000008c)}.ax-conversation-picker__tile-status{font-size:.625rem;color:rgb(var(--ax-sys-color-light));line-height:1.2}.ax-conversation-picker__caption-slot{flex-shrink:0;padding:.5rem .75rem;border-top:1px solid rgb(var(--ax-sys-color-border-light-surface));background:rgb(var(--ax-sys-color-lightest-surface))}.ax-conversation-picker__input-hidden{display:none}@container picker (max-width: 480px){.ax-conversation-picker__grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:.375rem}.ax-conversation-picker__row{padding:.4375rem .5rem;gap:.5rem}.ax-conversation-picker__thumb{width:2.25rem;height:2.25rem}.ax-conversation-picker__empty{min-height:7.5rem;margin:.5rem}.ax-conversation-picker__body{padding-inline:.5rem;padding-bottom:.5rem}}\n"] }]
|
|
465
|
-
}], ctorParameters: () => [] });
|
|
466
|
-
|
|
467
|
-
export { AXConversationFilePickerComponent };
|
|
468
|
-
//# sourceMappingURL=acorex-components-conversation-file-picker.component-cmUkgSF3.mjs.map
|