@acorex/components 21.0.3-next.40 → 21.0.3-next.41
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/fesm2022/{acorex-components-conversation-open-composer-picker-for-files-Du8Lj9Sp.mjs → acorex-components-conversation-open-composer-picker-for-files-Duvap4M4.mjs} +2 -3
- package/fesm2022/{acorex-components-conversation-open-composer-picker-for-files-Du8Lj9Sp.mjs.map → acorex-components-conversation-open-composer-picker-for-files-Duvap4M4.mjs.map} +1 -1
- package/fesm2022/acorex-components-conversation.mjs +22456 -1
- package/fesm2022/acorex-components-conversation.mjs.map +1 -1
- package/package.json +3 -3
- package/types/acorex-components-conversation.d.ts +1228 -48
- package/fesm2022/acorex-components-conversation-acorex-components-conversation-YhVa42TC.mjs +0 -13711
- package/fesm2022/acorex-components-conversation-acorex-components-conversation-YhVa42TC.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-audio-attachment.component-CLvS3W8F.mjs +0 -119
- package/fesm2022/acorex-components-conversation-audio-attachment.component-CLvS3W8F.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-audio-composer.payload-BHQJNyXz.mjs +0 -59
- package/fesm2022/acorex-components-conversation-audio-composer.payload-BHQJNyXz.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-audio-picker.component-BD_fN2Ip.mjs +0 -432
- package/fesm2022/acorex-components-conversation-audio-picker.component-BD_fN2Ip.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-audio-renderer.component-CcxVVprx.mjs +0 -177
- package/fesm2022/acorex-components-conversation-audio-renderer.component-CcxVVprx.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-audio.payload-Bag4aTut.mjs +0 -54
- package/fesm2022/acorex-components-conversation-audio.payload-Bag4aTut.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-conversation-audio.file-type-CfGSVnMA.mjs +0 -100
- package/fesm2022/acorex-components-conversation-conversation-audio.file-type-CfGSVnMA.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-conversation-file.file-type-DB-2xhaC.mjs +0 -121
- package/fesm2022/acorex-components-conversation-conversation-file.file-type-DB-2xhaC.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-conversation-image.file-type-C02OzZZB.mjs +0 -84
- package/fesm2022/acorex-components-conversation-conversation-image.file-type-C02OzZZB.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-conversation-info-media-view.component-Mhk7JE6K.mjs +0 -238
- package/fesm2022/acorex-components-conversation-conversation-info-media-view.component-Mhk7JE6K.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-conversation-info-panel.component-CNaM5ajR.mjs +0 -1080
- package/fesm2022/acorex-components-conversation-conversation-info-panel.component-CNaM5ajR.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-conversation-video.file-type-Pescv4Vu.mjs +0 -102
- package/fesm2022/acorex-components-conversation-conversation-video.file-type-Pescv4Vu.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-conversation-voice.file-type-DDd47o4r.mjs +0 -90
- package/fesm2022/acorex-components-conversation-conversation-voice.file-type-DDd47o4r.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-fallback-renderer.component-CYh_6O6j.mjs +0 -44
- package/fesm2022/acorex-components-conversation-fallback-renderer.component-CYh_6O6j.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-file-composer.payload-Dy7aG-EH.mjs +0 -64
- package/fesm2022/acorex-components-conversation-file-composer.payload-Dy7aG-EH.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-file-picker.component-DCVgl33l.mjs +0 -468
- package/fesm2022/acorex-components-conversation-file-picker.component-DCVgl33l.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-file-renderer.component-DgCi06Mg.mjs +0 -125
- package/fesm2022/acorex-components-conversation-file-renderer.component-DgCi06Mg.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-file.payload-DyFxTQYn.mjs +0 -50
- package/fesm2022/acorex-components-conversation-file.payload-DyFxTQYn.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-CLMGxXPl.mjs +0 -77
- package/fesm2022/acorex-components-conversation-image-attachment.component-CLMGxXPl.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-image-picker.component-CS343UDa.mjs +0 -407
- package/fesm2022/acorex-components-conversation-image-picker.component-CS343UDa.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-image-renderer.component-Cy0TA6cL.mjs +0 -83
- package/fesm2022/acorex-components-conversation-image-renderer.component-Cy0TA6cL.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-index-3V2b14I0.mjs +0 -184
- package/fesm2022/acorex-components-conversation-index-3V2b14I0.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-index-MCvfr9Zd.mjs +0 -266
- package/fesm2022/acorex-components-conversation-index-MCvfr9Zd.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-location-picker.component-DcNQzuoU.mjs +0 -149
- package/fesm2022/acorex-components-conversation-location-picker.component-DcNQzuoU.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-location-renderer.component-Cw2PB0LM.mjs +0 -118
- package/fesm2022/acorex-components-conversation-location-renderer.component-Cw2PB0LM.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-DbWUl6M2.mjs +0 -140
- package/fesm2022/acorex-components-conversation-media-playback-info-bar-banner.component-DbWUl6M2.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-message-renderer-copy-host.component-oXTr_Lfq.mjs +0 -33
- package/fesm2022/acorex-components-conversation-message-renderer-copy-host.component-oXTr_Lfq.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-message-renderer-state.component-Dp-JdHWr.mjs +0 -172
- package/fesm2022/acorex-components-conversation-message-renderer-state.component-Dp-JdHWr.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-pagination-demo-data-oIT_YJmN.mjs +0 -81
- package/fesm2022/acorex-components-conversation-pagination-demo-data-oIT_YJmN.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-picker-header.component-BneIFjXq.mjs +0 -91
- package/fesm2022/acorex-components-conversation-picker-header.component-BneIFjXq.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-picker-toolbar.component-BthRvEeE.mjs +0 -537
- package/fesm2022/acorex-components-conversation-picker-toolbar.component-BthRvEeE.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-D8FFKde6.mjs +0 -68
- package/fesm2022/acorex-components-conversation-playback-banner-sync-D8FFKde6.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-B-nc6xiA.mjs +0 -187
- package/fesm2022/acorex-components-conversation-search.component-B-nc6xiA.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-send-message-media-BRklgfV7.mjs +0 -170
- package/fesm2022/acorex-components-conversation-send-message-media-BRklgfV7.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-shared-storage.seed-J9PA4l3c.mjs +0 -750
- package/fesm2022/acorex-components-conversation-shared-storage.seed-J9PA4l3c.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-sticker-renderer.component-BmBwy7Ig.mjs +0 -103
- package/fesm2022/acorex-components-conversation-sticker-renderer.component-BmBwy7Ig.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-system-renderer.component-uie3tm5N.mjs +0 -55
- package/fesm2022/acorex-components-conversation-system-renderer.component-uie3tm5N.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-text-renderer.component-DNAquHYK.mjs +0 -109
- package/fesm2022/acorex-components-conversation-text-renderer.component-DNAquHYK.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-video-attachment.component-CGaUhnSb.mjs +0 -105
- package/fesm2022/acorex-components-conversation-video-attachment.component-CGaUhnSb.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-video-composer.payload-DMqRkafr.mjs +0 -62
- package/fesm2022/acorex-components-conversation-video-composer.payload-DMqRkafr.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-video-picker.component-DPwSBnoH.mjs +0 -446
- package/fesm2022/acorex-components-conversation-video-picker.component-DPwSBnoH.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-video-renderer.component-DKa9mUe2.mjs +0 -181
- package/fesm2022/acorex-components-conversation-video-renderer.component-DKa9mUe2.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-video.payload-C8QaqxuX.mjs +0 -54
- package/fesm2022/acorex-components-conversation-video.payload-C8QaqxuX.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-D_rdANZN.mjs +0 -344
- package/fesm2022/acorex-components-conversation-voice-recorder.component-D_rdANZN.mjs.map +0 -1
- package/fesm2022/acorex-components-conversation-voice-renderer.component-BY5FJcT8.mjs +0 -270
- package/fesm2022/acorex-components-conversation-voice-renderer.component-BY5FJcT8.mjs.map +0 -1
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
import { AXFileTypeRegistryService } from '@acorex/core/file';
|
|
2
|
-
import { CommonModule } from '@angular/common';
|
|
3
|
-
import * as i0 from '@angular/core';
|
|
4
|
-
import { input, computed, ChangeDetectionStrategy, Component, inject } from '@angular/core';
|
|
5
|
-
import { normalizeFilePayload } from './acorex-components-conversation-file.payload-DyFxTQYn.mjs';
|
|
6
|
-
import { A as AXConversationMessageRendererCopyHostComponent, m as mediaCopyText } from './acorex-components-conversation-message-renderer-copy-host.component-oXTr_Lfq.mjs';
|
|
7
|
-
import { w as toUploaderReference, x as createResolvedMediaUrlSignal, y as pickDisplayMediaUrl, l as copyWithFileTypeFallback } from './acorex-components-conversation-acorex-components-conversation-YhVa42TC.mjs';
|
|
8
|
-
import { a as formatFileByteSize } from './acorex-components-conversation-format-media-DUD4vA6F.mjs';
|
|
9
|
-
import { A as AXConversationMessageRendererStateComponent } from './acorex-components-conversation-message-renderer-state.component-Dp-JdHWr.mjs';
|
|
10
|
-
import './acorex-components-conversation-renderer-shared.styles-Digah3Zn.mjs';
|
|
11
|
-
|
|
12
|
-
const AX_CONVERSATION_EXT_COLORS = {
|
|
13
|
-
pdf: 'rgb(var(--ax-sys-color-danger-500))',
|
|
14
|
-
doc: 'rgb(var(--ax-sys-color-primary-500))',
|
|
15
|
-
docx: 'rgb(var(--ax-sys-color-primary-500))',
|
|
16
|
-
xls: 'rgb(var(--ax-sys-color-success-500))',
|
|
17
|
-
xlsx: 'rgb(var(--ax-sys-color-success-500))',
|
|
18
|
-
ppt: 'rgb(var(--ax-sys-color-warning-500))',
|
|
19
|
-
pptx: 'rgb(var(--ax-sys-color-warning-500))',
|
|
20
|
-
zip: 'rgb(var(--ax-sys-color-secondary-600))',
|
|
21
|
-
};
|
|
22
|
-
class AXConversationFileAttachmentComponent {
|
|
23
|
-
constructor() {
|
|
24
|
-
this.item = input.required(...(ngDevMode ? [{ debugName: "item" }] : /* istanbul ignore next */ []));
|
|
25
|
-
this.mediaReference = computed(() => toUploaderReference(this.item()), ...(ngDevMode ? [{ debugName: "mediaReference" }] : /* istanbul ignore next */ []));
|
|
26
|
-
this.resolvedUrl = createResolvedMediaUrlSignal(this.mediaReference);
|
|
27
|
-
this.fileUrl = computed(() => pickDisplayMediaUrl(this.resolvedUrl(), this.item().url), ...(ngDevMode ? [{ debugName: "fileUrl" }] : /* istanbul ignore next */ []));
|
|
28
|
-
this.fileName = computed(() => this.item().name || 'file', ...(ngDevMode ? [{ debugName: "fileName" }] : /* istanbul ignore next */ []));
|
|
29
|
-
this.fileSize = computed(() => this.item().size ?? 0, ...(ngDevMode ? [{ debugName: "fileSize" }] : /* istanbul ignore next */ []));
|
|
30
|
-
this.fileExtension = computed(() => {
|
|
31
|
-
const name = this.fileName();
|
|
32
|
-
const parts = name.split('.');
|
|
33
|
-
return parts.length > 1 ? parts[parts.length - 1] : 'FILE';
|
|
34
|
-
}, ...(ngDevMode ? [{ debugName: "fileExtension" }] : /* istanbul ignore next */ []));
|
|
35
|
-
this.swatchColor = computed(() => {
|
|
36
|
-
const ext = this.fileExtension().toLowerCase();
|
|
37
|
-
return AX_CONVERSATION_EXT_COLORS[ext] ?? 'rgb(var(--ax-sys-color-secondary-500))';
|
|
38
|
-
}, ...(ngDevMode ? [{ debugName: "swatchColor" }] : /* istanbul ignore next */ []));
|
|
39
|
-
this.formattedSize = computed(() => formatFileByteSize(this.fileSize()), ...(ngDevMode ? [{ debugName: "formattedSize" }] : /* istanbul ignore next */ []));
|
|
40
|
-
}
|
|
41
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXConversationFileAttachmentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
42
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.9", type: AXConversationFileAttachmentComponent, isStandalone: true, selector: "ax-conversation-file-attachment", inputs: { item: { classPropertyName: "item", publicName: "item", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `
|
|
43
|
-
<a class="ax-conversation-file" [href]="fileUrl()" [download]="fileName()" target="_blank" rel="noopener noreferrer">
|
|
44
|
-
<span class="ax-conversation-file__badge" [style.background]="swatchColor()">{{ fileExtension() }}</span>
|
|
45
|
-
<span class="ax-conversation-file__body">
|
|
46
|
-
<span class="ax-conversation-file__name">{{ fileName() }}</span>
|
|
47
|
-
<span class="ax-conversation-file__meta">{{ formattedSize() }}</span>
|
|
48
|
-
</span>
|
|
49
|
-
<i class="fa-light fa-arrow-down-to-line ax-conversation-file__icon" aria-hidden="true"></i>
|
|
50
|
-
</a>
|
|
51
|
-
`, isInline: true, styles: [":host{display:block}.ax-conversation-file{display:flex;align-items:center;gap:.625rem;width:100%;min-height:2.75rem;padding:.5rem .625rem;border-radius:var(--ax-sys-border-radius, .5rem);border:1px solid rgb(var(--ax-sys-color-border-light-surface));background:rgb(var(--ax-sys-color-surface));color:rgb(var(--ax-sys-color-on-surface));text-decoration:none;touch-action:manipulation;transition:border-color .15s ease,background-color .15s ease}@media(hover:hover){.ax-conversation-file:hover{border-color:rgb(var(--ax-sys-color-primary-500));background:rgb(var(--ax-sys-color-light-surface))}}.ax-conversation-file__badge{flex-shrink:0;width:2.5rem;height:2.5rem;display:flex;align-items:center;justify-content:center;border-radius:var(--ax-sys-border-radius, .375rem);font-weight:600;font-size:.5625rem;text-transform:uppercase;color:rgb(var(--ax-sys-color-light))}.ax-conversation-file__body{flex:1;min-width:0;display:flex;flex-direction:column;gap:.125rem}.ax-conversation-file__name{font-size:.8125rem;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ax-conversation-file__meta{font-size:.6875rem;color:rgba(var(--ax-sys-color-on-surface),.65)}.ax-conversation-file__icon{flex-shrink:0;font-size:.875rem;color:rgba(var(--ax-sys-color-on-surface),.55)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
52
|
-
}
|
|
53
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXConversationFileAttachmentComponent, decorators: [{
|
|
54
|
-
type: Component,
|
|
55
|
-
args: [{ selector: 'ax-conversation-file-attachment', imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
56
|
-
<a class="ax-conversation-file" [href]="fileUrl()" [download]="fileName()" target="_blank" rel="noopener noreferrer">
|
|
57
|
-
<span class="ax-conversation-file__badge" [style.background]="swatchColor()">{{ fileExtension() }}</span>
|
|
58
|
-
<span class="ax-conversation-file__body">
|
|
59
|
-
<span class="ax-conversation-file__name">{{ fileName() }}</span>
|
|
60
|
-
<span class="ax-conversation-file__meta">{{ formattedSize() }}</span>
|
|
61
|
-
</span>
|
|
62
|
-
<i class="fa-light fa-arrow-down-to-line ax-conversation-file__icon" aria-hidden="true"></i>
|
|
63
|
-
</a>
|
|
64
|
-
`, styles: [":host{display:block}.ax-conversation-file{display:flex;align-items:center;gap:.625rem;width:100%;min-height:2.75rem;padding:.5rem .625rem;border-radius:var(--ax-sys-border-radius, .5rem);border:1px solid rgb(var(--ax-sys-color-border-light-surface));background:rgb(var(--ax-sys-color-surface));color:rgb(var(--ax-sys-color-on-surface));text-decoration:none;touch-action:manipulation;transition:border-color .15s ease,background-color .15s ease}@media(hover:hover){.ax-conversation-file:hover{border-color:rgb(var(--ax-sys-color-primary-500));background:rgb(var(--ax-sys-color-light-surface))}}.ax-conversation-file__badge{flex-shrink:0;width:2.5rem;height:2.5rem;display:flex;align-items:center;justify-content:center;border-radius:var(--ax-sys-border-radius, .375rem);font-weight:600;font-size:.5625rem;text-transform:uppercase;color:rgb(var(--ax-sys-color-light))}.ax-conversation-file__body{flex:1;min-width:0;display:flex;flex-direction:column;gap:.125rem}.ax-conversation-file__name{font-size:.8125rem;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ax-conversation-file__meta{font-size:.6875rem;color:rgba(var(--ax-sys-color-on-surface),.65)}.ax-conversation-file__icon{flex-shrink:0;font-size:.875rem;color:rgba(var(--ax-sys-color-on-surface),.55)}\n"] }]
|
|
65
|
-
}], propDecorators: { item: [{ type: i0.Input, args: [{ isSignal: true, alias: "item", required: true }] }] } });
|
|
66
|
-
|
|
67
|
-
class AXConversationFileRendererComponent extends AXConversationMessageRendererCopyHostComponent {
|
|
68
|
-
constructor() {
|
|
69
|
-
super(...arguments);
|
|
70
|
-
this.fileTypes = inject(AXFileTypeRegistryService);
|
|
71
|
-
this.message = input.required(...(ngDevMode ? [{ debugName: "message" }] : /* istanbul ignore next */ []));
|
|
72
|
-
this.rendererState = computed(() => ({
|
|
73
|
-
deliveryStatus: this.message().status,
|
|
74
|
-
contentState: 'ready',
|
|
75
|
-
}), ...(ngDevMode ? [{ debugName: "rendererState" }] : /* istanbul ignore next */ []));
|
|
76
|
-
this.payload = computed(() => normalizeFilePayload(this.message().payload), ...(ngDevMode ? [{ debugName: "payload" }] : /* istanbul ignore next */ []));
|
|
77
|
-
this.files = computed(() => this.payload().files, ...(ngDevMode ? [{ debugName: "files" }] : /* istanbul ignore next */ []));
|
|
78
|
-
this.caption = computed(() => this.payload().caption?.trim() || '', ...(ngDevMode ? [{ debugName: "caption" }] : /* istanbul ignore next */ []));
|
|
79
|
-
}
|
|
80
|
-
copy() {
|
|
81
|
-
return copyWithFileTypeFallback(this.message(), this.fileTypes, () => {
|
|
82
|
-
const p = this.payload();
|
|
83
|
-
if (p.files.length === 1) {
|
|
84
|
-
const file = p.files[0];
|
|
85
|
-
const name = file.name?.trim() || 'File';
|
|
86
|
-
const url = file.url?.trim();
|
|
87
|
-
return url ? `${name}\n${url}` : name;
|
|
88
|
-
}
|
|
89
|
-
return mediaCopyText(p.caption, 'File', 'files', p.files.length, p.files.map((file) => file.name?.trim() || file.url?.trim()));
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXConversationFileRendererComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
93
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: AXConversationFileRendererComponent, isStandalone: true, selector: "ax-conversation-file-renderer", inputs: { message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: true, transformFunction: null } }, usesInheritance: true, ngImport: i0, template: `
|
|
94
|
-
<div class="ax-conversation-msg ax-conversation-msg--wide">
|
|
95
|
-
<ax-conversation-message-renderer-state [rendererState]="rendererState()" [message]="message()" />
|
|
96
|
-
<div class="ax-conversation-msg__stack">
|
|
97
|
-
@for (file of files(); track file.mediaId ?? file.url) {
|
|
98
|
-
<ax-conversation-file-attachment [item]="file" />
|
|
99
|
-
}
|
|
100
|
-
</div>
|
|
101
|
-
@if (caption()) {
|
|
102
|
-
<p class="ax-conversation-msg__caption">{{ caption() }}</p>
|
|
103
|
-
}
|
|
104
|
-
</div>
|
|
105
|
-
`, isInline: true, styles: [":host{display:block;max-width:100%}.ax-conversation-msg,.ax-conversation-msg__stack{display:flex;flex-direction:column;gap:.375rem}.ax-conversation-msg__grid{display:grid;gap:2px;width:100%;border-radius:var(--ax-sys-border-radius, .5rem);overflow:hidden;background:rgb(var(--ax-sys-color-border-light-surface))}.ax-conversation-msg__grid--single{grid-template-columns:1fr}.ax-conversation-msg__grid--single ::ng-deep .ax-conversation-image-attachment{max-height:min(50dvh,20rem)}.ax-conversation-msg__grid--dual{grid-template-columns:repeat(2,1fr)}.ax-conversation-msg__grid--multi{grid-template-columns:repeat(3,1fr);grid-auto-rows:10rem}@container (max-width: 380px){.ax-conversation-msg__grid--multi{grid-template-columns:repeat(2,1fr);grid-auto-rows:10rem}}.ax-conversation-msg__caption{margin:0;padding:0 .125rem;font-size:.8125rem;line-height:1.4;word-break:break-word;opacity:.88}.ax-conversation-msg--flush{width:100%;max-width:100%;gap:0}.ax-conversation-msg--flush .ax-conversation-msg__caption{padding:.375rem .625rem 0}.ax-conversation-msg--flush .ax-conversation-msg__grid{border-radius:0;background:transparent}.ax-conversation-msg--flush .ax-conversation-msg__stack{gap:2px}.ax-conversation-msg--flush ::ng-deep .ax-conversation-video{border-radius:0}.ax-conversation-msg__card{border-radius:var(--ax-sys-border-radius, .5rem);border:1px solid rgb(var(--ax-sys-color-border-light-surface));background:rgb(var(--ax-sys-color-surface));overflow:hidden}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: AXConversationFileAttachmentComponent, selector: "ax-conversation-file-attachment", inputs: ["item"] }, { kind: "component", type: AXConversationMessageRendererStateComponent, selector: "ax-conversation-message-renderer-state", inputs: ["rendererState", "message", "contentErrorLabel", "deliveryFailedLabel", "showContentErrorChrome", "contentErrorStyle", "contentErrorIconClass", "placement", "contentRetryEnabled"], outputs: ["contentRetry"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
106
|
-
}
|
|
107
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXConversationFileRendererComponent, decorators: [{
|
|
108
|
-
type: Component,
|
|
109
|
-
args: [{ selector: 'ax-conversation-file-renderer', imports: [CommonModule, AXConversationFileAttachmentComponent, AXConversationMessageRendererStateComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
110
|
-
<div class="ax-conversation-msg ax-conversation-msg--wide">
|
|
111
|
-
<ax-conversation-message-renderer-state [rendererState]="rendererState()" [message]="message()" />
|
|
112
|
-
<div class="ax-conversation-msg__stack">
|
|
113
|
-
@for (file of files(); track file.mediaId ?? file.url) {
|
|
114
|
-
<ax-conversation-file-attachment [item]="file" />
|
|
115
|
-
}
|
|
116
|
-
</div>
|
|
117
|
-
@if (caption()) {
|
|
118
|
-
<p class="ax-conversation-msg__caption">{{ caption() }}</p>
|
|
119
|
-
}
|
|
120
|
-
</div>
|
|
121
|
-
`, styles: [":host{display:block;max-width:100%}.ax-conversation-msg,.ax-conversation-msg__stack{display:flex;flex-direction:column;gap:.375rem}.ax-conversation-msg__grid{display:grid;gap:2px;width:100%;border-radius:var(--ax-sys-border-radius, .5rem);overflow:hidden;background:rgb(var(--ax-sys-color-border-light-surface))}.ax-conversation-msg__grid--single{grid-template-columns:1fr}.ax-conversation-msg__grid--single ::ng-deep .ax-conversation-image-attachment{max-height:min(50dvh,20rem)}.ax-conversation-msg__grid--dual{grid-template-columns:repeat(2,1fr)}.ax-conversation-msg__grid--multi{grid-template-columns:repeat(3,1fr);grid-auto-rows:10rem}@container (max-width: 380px){.ax-conversation-msg__grid--multi{grid-template-columns:repeat(2,1fr);grid-auto-rows:10rem}}.ax-conversation-msg__caption{margin:0;padding:0 .125rem;font-size:.8125rem;line-height:1.4;word-break:break-word;opacity:.88}.ax-conversation-msg--flush{width:100%;max-width:100%;gap:0}.ax-conversation-msg--flush .ax-conversation-msg__caption{padding:.375rem .625rem 0}.ax-conversation-msg--flush .ax-conversation-msg__grid{border-radius:0;background:transparent}.ax-conversation-msg--flush .ax-conversation-msg__stack{gap:2px}.ax-conversation-msg--flush ::ng-deep .ax-conversation-video{border-radius:0}.ax-conversation-msg__card{border-radius:var(--ax-sys-border-radius, .5rem);border:1px solid rgb(var(--ax-sys-color-border-light-surface));background:rgb(var(--ax-sys-color-surface));overflow:hidden}\n"] }]
|
|
122
|
-
}], propDecorators: { message: [{ type: i0.Input, args: [{ isSignal: true, alias: "message", required: true }] }] } });
|
|
123
|
-
|
|
124
|
-
export { AXConversationFileRendererComponent };
|
|
125
|
-
//# sourceMappingURL=acorex-components-conversation-file-renderer.component-DgCi06Mg.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-components-conversation-file-renderer.component-DgCi06Mg.mjs","sources":["../../../../packages/components/conversation/src/lib/plugins/message-list/components/shared/file-attachment.component.ts","../../../../packages/components/conversation/src/lib/plugins/message-list/components/file-renderer/file-renderer.component.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';\nimport type { AXConversationFileMediaItem } from '../../../../models';\nimport { pickDisplayMediaUrl } from '../../../composer/components/shared/persisted-media-url';\nimport { toUploaderReference } from './attachment-uploader-reference';\nimport { formatFileByteSize } from './format-media';\nimport { createResolvedMediaUrlSignal } from './media-url-resolve';\n\nconst AX_CONVERSATION_EXT_COLORS: Record<string, string> = {\n pdf: 'rgb(var(--ax-sys-color-danger-500))',\n doc: 'rgb(var(--ax-sys-color-primary-500))',\n docx: 'rgb(var(--ax-sys-color-primary-500))',\n xls: 'rgb(var(--ax-sys-color-success-500))',\n xlsx: 'rgb(var(--ax-sys-color-success-500))',\n ppt: 'rgb(var(--ax-sys-color-warning-500))',\n pptx: 'rgb(var(--ax-sys-color-warning-500))',\n zip: 'rgb(var(--ax-sys-color-secondary-600))',\n};\n\n@Component({\n selector: 'ax-conversation-file-attachment',\n imports: [CommonModule],\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <a class=\"ax-conversation-file\" [href]=\"fileUrl()\" [download]=\"fileName()\" target=\"_blank\" rel=\"noopener noreferrer\">\n <span class=\"ax-conversation-file__badge\" [style.background]=\"swatchColor()\">{{ fileExtension() }}</span>\n <span class=\"ax-conversation-file__body\">\n <span class=\"ax-conversation-file__name\">{{ fileName() }}</span>\n <span class=\"ax-conversation-file__meta\">{{ formattedSize() }}</span>\n </span>\n <i class=\"fa-light fa-arrow-down-to-line ax-conversation-file__icon\" aria-hidden=\"true\"></i>\n </a>\n `,\n styles: [\n `\n :host {\n display: block;\n }\n\n .ax-conversation-file {\n display: flex;\n align-items: center;\n gap: 0.625rem;\n width: 100%;\n min-height: 2.75rem;\n padding: 0.5rem 0.625rem;\n border-radius: var(--ax-sys-border-radius, 0.5rem);\n border: 1px solid rgb(var(--ax-sys-color-border-light-surface));\n background: rgb(var(--ax-sys-color-surface));\n color: rgb(var(--ax-sys-color-on-surface));\n text-decoration: none;\n touch-action: manipulation;\n transition:\n border-color 0.15s ease,\n background-color 0.15s ease;\n }\n\n @media (hover: hover) {\n .ax-conversation-file:hover {\n border-color: rgb(var(--ax-sys-color-primary-500));\n background: rgb(var(--ax-sys-color-light-surface));\n }\n }\n\n .ax-conversation-file__badge {\n flex-shrink: 0;\n width: 2.5rem;\n height: 2.5rem;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: var(--ax-sys-border-radius, 0.375rem);\n font-weight: 600;\n font-size: 0.5625rem;\n text-transform: uppercase;\n color: rgb(var(--ax-sys-color-light));\n }\n\n .ax-conversation-file__body {\n flex: 1;\n min-width: 0;\n display: flex;\n flex-direction: column;\n gap: 0.125rem;\n }\n\n .ax-conversation-file__name {\n font-size: 0.8125rem;\n font-weight: 500;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .ax-conversation-file__meta {\n font-size: 0.6875rem;\n color: rgba(var(--ax-sys-color-on-surface), 0.65);\n }\n\n .ax-conversation-file__icon {\n flex-shrink: 0;\n font-size: 0.875rem;\n color: rgba(var(--ax-sys-color-on-surface), 0.55);\n }\n `,\n ],\n})\nexport class AXConversationFileAttachmentComponent {\n readonly item = input.required<AXConversationFileMediaItem>();\n\n private readonly mediaReference = computed(() => toUploaderReference(this.item()));\n private readonly resolvedUrl = createResolvedMediaUrlSignal(this.mediaReference);\n\n readonly fileUrl = computed(() => pickDisplayMediaUrl(this.resolvedUrl(), this.item().url));\n readonly fileName = computed(() => this.item().name || 'file');\n readonly fileSize = computed(() => this.item().size ?? 0);\n\n readonly fileExtension = computed(() => {\n const name = this.fileName();\n const parts = name.split('.');\n return parts.length > 1 ? parts[parts.length - 1]! : 'FILE';\n });\n\n readonly swatchColor = computed(() => {\n const ext = this.fileExtension().toLowerCase();\n return AX_CONVERSATION_EXT_COLORS[ext] ?? 'rgb(var(--ax-sys-color-secondary-500))';\n });\n\n readonly formattedSize = computed(() => formatFileByteSize(this.fileSize()));\n}\n","import { AXFileTypeRegistryService } from '@acorex/core/file';\nimport { CommonModule } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, computed, inject, input } from '@angular/core';\nimport type { AXConversationFilePayload, AXConversationMessage } from '../../../../models';\nimport { normalizeFilePayload } from './file.payload';\nimport {\n AXConversationMessageRendererCopyHostComponent,\n mediaCopyText,\n} from '../shared/message-renderer-copy-host.component';\nimport { copyWithFileTypeFallback } from '../../../../utils/file-type-message.resolve';\nimport { AXConversationFileAttachmentComponent } from '../shared/file-attachment.component';\nimport { AXConversationMessageRendererStateComponent } from '../shared/message-renderer-state.component';\nimport { AX_CONVERSATION_RENDERER_SHARED_STYLES } from '../shared/renderer-shared.styles';\n\n@Component({\n selector: 'ax-conversation-file-renderer',\n imports: [CommonModule, AXConversationFileAttachmentComponent, AXConversationMessageRendererStateComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <div class=\"ax-conversation-msg ax-conversation-msg--wide\">\n <ax-conversation-message-renderer-state [rendererState]=\"rendererState()\" [message]=\"message()\" />\n <div class=\"ax-conversation-msg__stack\">\n @for (file of files(); track file.mediaId ?? file.url) {\n <ax-conversation-file-attachment [item]=\"file\" />\n }\n </div>\n @if (caption()) {\n <p class=\"ax-conversation-msg__caption\">{{ caption() }}</p>\n }\n </div>\n `,\n styles: [AX_CONVERSATION_RENDERER_SHARED_STYLES],\n})\nexport class AXConversationFileRendererComponent extends AXConversationMessageRendererCopyHostComponent {\n private readonly fileTypes = inject(AXFileTypeRegistryService);\n\n readonly message = input.required<AXConversationMessage>();\n readonly rendererState = computed(() => ({\n deliveryStatus: this.message().status,\n contentState: 'ready' as const,\n }));\n\n readonly payload = computed(() => normalizeFilePayload(this.message().payload as AXConversationFilePayload));\n readonly files = computed(() => this.payload().files);\n readonly caption = computed(() => this.payload().caption?.trim() || '');\n\n copy(): Promise<string> {\n return copyWithFileTypeFallback(this.message(), this.fileTypes, () => {\n const p = this.payload();\n if (p.files.length === 1) {\n const file = p.files[0];\n const name = file.name?.trim() || 'File';\n const url = file.url?.trim();\n return url ? `${name}\\n${url}` : name;\n }\n return mediaCopyText(\n p.caption,\n 'File',\n 'files',\n p.files.length,\n p.files.map((file) => file.name?.trim() || file.url?.trim()),\n );\n });\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAQ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AAA,EAAA,WAAA,EAAA,IAAA,EAAE,qCAAqC,EAAA,QAAA,EAAA,iCAAA,EAAA,MAAA,EAAA,CAAA,MAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,2CAA2C,EAAA,QAAA,EAAA,wCAAA,EAAA,MAAA,EAAA,CAAA,eAAA,EAAA,SAAA,EAAA,mBAAA,EAAA,qBAAA,EAAA,wBAAA,EAAA,mBAAA,EAAA,uBAAA,EAAA,WAAA,EAAA,qBAAA,CAAA,EAAA,OAAA,EAAA,CAAA,cAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAiB/F,mCAAmC,EAAA,UAAA,EAAA,CAAA;kBAnB/C,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,+BAA+B,EAAA,OAAA,EAChC,CAAC,YAAY,EAAE,qCAAqC,EAAE,2CAA2C,CAAC,EAAA,eAAA,EAC1F,uBAAuB,CAAC,MAAM,EAAA,QAAA,EACrC;;;;;;;;;;;;AAYT,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,87CAAA,CAAA,EAAA;;;;;"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { s as resolvePersistableMediaUrl, c as resolvePersistedThumbnailUrl } from './acorex-components-conversation-acorex-components-conversation-YhVa42TC.mjs';
|
|
2
|
-
|
|
3
|
-
function loose(payload) {
|
|
4
|
-
return payload;
|
|
5
|
-
}
|
|
6
|
-
function str(value) {
|
|
7
|
-
return typeof value === 'string' && value.length > 0 ? value : undefined;
|
|
8
|
-
}
|
|
9
|
-
function sanitizeFileItem(item) {
|
|
10
|
-
const url = resolvePersistableMediaUrl(item.url);
|
|
11
|
-
const thumbnailUrl = resolvePersistedThumbnailUrl(item.thumbnailUrl, url);
|
|
12
|
-
if (url === item.url && thumbnailUrl === item.thumbnailUrl) {
|
|
13
|
-
return item;
|
|
14
|
-
}
|
|
15
|
-
return { ...item, url, thumbnailUrl };
|
|
16
|
-
}
|
|
17
|
-
function normalizeFilePayload(payload) {
|
|
18
|
-
const raw = loose(payload);
|
|
19
|
-
const existing = raw['files'];
|
|
20
|
-
if (Array.isArray(existing) && existing.length > 0) {
|
|
21
|
-
return {
|
|
22
|
-
type: 'file',
|
|
23
|
-
files: existing.map(sanitizeFileItem),
|
|
24
|
-
caption: payload.caption,
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
const url = resolvePersistableMediaUrl(str(raw['url']));
|
|
28
|
-
const mediaId = str(raw['mediaId']);
|
|
29
|
-
if (url || mediaId) {
|
|
30
|
-
return {
|
|
31
|
-
type: 'file',
|
|
32
|
-
caption: payload.caption,
|
|
33
|
-
files: [
|
|
34
|
-
{
|
|
35
|
-
...(url ? { url } : {}),
|
|
36
|
-
name: str(raw['name']) ?? 'file',
|
|
37
|
-
mimeType: str(raw['mimeType']) ?? 'application/octet-stream',
|
|
38
|
-
size: typeof raw['size'] === 'number' ? raw['size'] : undefined,
|
|
39
|
-
mediaId,
|
|
40
|
-
thumbnailUrl: resolvePersistedThumbnailUrl(str(raw['thumbnailUrl']), url),
|
|
41
|
-
extension: str(raw['extension']),
|
|
42
|
-
},
|
|
43
|
-
],
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
return { type: 'file', files: [], caption: payload.caption };
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export { normalizeFilePayload };
|
|
50
|
-
//# sourceMappingURL=acorex-components-conversation-file.payload-DyFxTQYn.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-components-conversation-file.payload-DyFxTQYn.mjs","sources":["../../../../packages/components/conversation/src/lib/plugins/message-list/components/file-renderer/file.payload.ts"],"sourcesContent":["import type { AXConversationFileMediaItem, AXConversationFilePayload } from '../../../../models';\nimport {\n resolvePersistableMediaUrl,\n resolvePersistedThumbnailUrl,\n} from '../../../composer/components/shared/persisted-media-url';\n\ntype AXConversationLooseRecord = Record<string, unknown>;\n\nfunction loose(payload: AXConversationFilePayload): AXConversationLooseRecord {\n return payload as unknown as AXConversationLooseRecord;\n}\n\nfunction str(value: unknown): string | undefined {\n return typeof value === 'string' && value.length > 0 ? value : undefined;\n}\n\nfunction sanitizeFileItem(item: AXConversationFileMediaItem): AXConversationFileMediaItem {\n const url = resolvePersistableMediaUrl(item.url);\n const thumbnailUrl = resolvePersistedThumbnailUrl(item.thumbnailUrl, url);\n if (url === item.url && thumbnailUrl === item.thumbnailUrl) {\n return item;\n }\n return { ...item, url, thumbnailUrl };\n}\n\nexport function normalizeFilePayload(payload: AXConversationFilePayload): AXConversationFilePayload {\n const raw = loose(payload);\n const existing = raw['files'];\n if (Array.isArray(existing) && existing.length > 0) {\n return {\n type: 'file',\n files: (existing as AXConversationFileMediaItem[]).map(sanitizeFileItem),\n caption: payload.caption,\n };\n }\n\n const url = resolvePersistableMediaUrl(str(raw['url']));\n const mediaId = str(raw['mediaId']);\n if (url || mediaId) {\n return {\n type: 'file',\n caption: payload.caption,\n files: [\n {\n ...(url ? { url } : {}),\n name: str(raw['name']) ?? 'file',\n mimeType: str(raw['mimeType']) ?? 'application/octet-stream',\n size: typeof raw['size'] === 'number' ? raw['size'] : undefined,\n mediaId,\n thumbnailUrl: resolvePersistedThumbnailUrl(str(raw['thumbnailUrl']), url),\n extension: str(raw['extension']),\n },\n ],\n };\n }\n\n return { type: 'file', files: [], caption: payload.caption };\n}\n"],"names":[],"mappings":";;AAQA,SAAS,KAAK,CAAC,OAAkC,EAAA;AAC/C,IAAA,OAAO,OAA+C;AACxD;AAEA,SAAS,GAAG,CAAC,KAAc,EAAA;AACzB,IAAA,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,GAAG,KAAK,GAAG,SAAS;AAC1E;AAEA,SAAS,gBAAgB,CAAC,IAAiC,EAAA;IACzD,MAAM,GAAG,GAAG,0BAA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,oBAAA,IAAI,EAAE,OAAO,GAAG,CAAC,MAAM,CAAC,KAAK,QAAQ,GAAG,GAAG,CAAC,MAAM,CAAC,GAAG,SAAS;oBAC/D,OAAO;AACP,oBAAA,YAAY,EAAE,4BAA4B,CAAC,GAAG,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,EAAE,GAAG,CAAC;AACzE,oBAAA,SAAS,EAAE,GAAG,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;AACjC,iBAAA;AACF,aAAA;SACF;IACH;AAEA,IAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE;AAC9D;;;;"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/** Shared formatting for message renderer UIs. */
|
|
2
|
-
function formatMediaDuration(seconds) {
|
|
3
|
-
if (!Number.isFinite(seconds)) {
|
|
4
|
-
return '0:00';
|
|
5
|
-
}
|
|
6
|
-
const m = Math.floor(seconds / 60);
|
|
7
|
-
const s = Math.floor(seconds % 60);
|
|
8
|
-
return `${m}:${s.toString().padStart(2, '0')}`;
|
|
9
|
-
}
|
|
10
|
-
function formatFileByteSize(bytes) {
|
|
11
|
-
if (bytes === 0) {
|
|
12
|
-
return '0 B';
|
|
13
|
-
}
|
|
14
|
-
const k = 1024;
|
|
15
|
-
const sizes = ['B', 'KB', 'MB', 'GB'];
|
|
16
|
-
const i = Math.min(Math.floor(Math.log(bytes) / Math.log(k)), sizes.length - 1);
|
|
17
|
-
return `${Math.round((bytes / k ** i) * 100) / 100} ${sizes[i]}`;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export { formatFileByteSize as a, formatMediaDuration as f };
|
|
21
|
-
//# sourceMappingURL=acorex-components-conversation-format-media-DUD4vA6F.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-components-conversation-format-media-DUD4vA6F.mjs","sources":["../../../../packages/components/conversation/src/lib/plugins/message-list/components/shared/format-media.ts"],"sourcesContent":["/** Shared formatting for message renderer UIs. */\n\nexport function formatMediaDuration(seconds: number): string {\n if (!Number.isFinite(seconds)) {\n return '0:00';\n }\n const m = Math.floor(seconds / 60);\n const s = Math.floor(seconds % 60);\n return `${m}:${s.toString().padStart(2, '0')}`;\n}\n\nexport function formatFileByteSize(bytes: number): string {\n if (bytes === 0) {\n return '0 B';\n }\n const k = 1024;\n const sizes = ['B', 'KB', 'MB', 'GB'] as const;\n const i = Math.min(Math.floor(Math.log(bytes) / Math.log(k)), sizes.length - 1);\n return `${Math.round((bytes / k ** i) * 100) / 100} ${sizes[i]}`;\n}\n"],"names":[],"mappings":"AAAA;AAEM,SAAU,mBAAmB,CAAC,OAAe,EAAA;IACjD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;AAC7B,QAAA,OAAO,MAAM;IACf;IACA,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC;IAClC,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC;AAClC,IAAA,OAAO,CAAA,EAAG,CAAC,CAAA,CAAA,EAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE;AAChD;AAEM,SAAU,kBAAkB,CAAC,KAAa,EAAA;AAC9C,IAAA,IAAI,KAAK,KAAK,CAAC,EAAE;AACf,QAAA,OAAO,KAAK;IACd;IACA,MAAM,CAAC,GAAG,IAAI;IACd,MAAM,KAAK,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAU;AAC9C,IAAA,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;IAC/E,OAAO,CAAA,EAAG,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,GAAG,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,GAAG,GAAG,CAAA,CAAA,EAAI,KAAK,CAAC,CAAC,CAAC,CAAA,CAAE;AAClE;;;;"}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { DOCUMENT, isPlatformBrowser } from '@angular/common';
|
|
2
|
-
import * as i0 from '@angular/core';
|
|
3
|
-
import { inject, PLATFORM_ID, input, signal, computed, effect, untracked, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
4
|
-
import { w as toUploaderReference, x as createResolvedMediaUrlSignal, y as pickDisplayMediaUrl } from './acorex-components-conversation-acorex-components-conversation-YhVa42TC.mjs';
|
|
5
|
-
|
|
6
|
-
class AXConversationImageAttachmentComponent {
|
|
7
|
-
constructor() {
|
|
8
|
-
this.platformId = inject(PLATFORM_ID);
|
|
9
|
-
this.document = inject(DOCUMENT);
|
|
10
|
-
this.item = input.required(...(ngDevMode ? [{ debugName: "item" }] : /* istanbul ignore next */ []));
|
|
11
|
-
this.alt = input('Image', ...(ngDevMode ? [{ debugName: "alt" }] : /* istanbul ignore next */ []));
|
|
12
|
-
this.ready = signal(false, ...(ngDevMode ? [{ debugName: "ready" }] : /* istanbul ignore next */ []));
|
|
13
|
-
this.mediaReference = computed(() => toUploaderReference(this.item()), ...(ngDevMode ? [{ debugName: "mediaReference" }] : /* istanbul ignore next */ []));
|
|
14
|
-
this.resolvedUrl = createResolvedMediaUrlSignal(this.mediaReference);
|
|
15
|
-
this.displayUrl = computed(() => pickDisplayMediaUrl(this.resolvedUrl(), this.item().thumbnailUrl, this.item().url), ...(ngDevMode ? [{ debugName: "displayUrl" }] : /* istanbul ignore next */ []));
|
|
16
|
-
effect(() => {
|
|
17
|
-
this.displayUrl();
|
|
18
|
-
this.item().mediaId;
|
|
19
|
-
untracked(() => this.ready.set(false));
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
onImageLoad() {
|
|
23
|
-
this.ready.set(true);
|
|
24
|
-
}
|
|
25
|
-
onImageError() {
|
|
26
|
-
this.ready.set(false);
|
|
27
|
-
}
|
|
28
|
-
toggleFullscreen(event) {
|
|
29
|
-
if (!isPlatformBrowser(this.platformId)) {
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
const img = event.currentTarget.querySelector('img');
|
|
33
|
-
if (!(img instanceof HTMLImageElement) || !img.requestFullscreen) {
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
if (this.document.fullscreenElement === img) {
|
|
37
|
-
void this.document.exitFullscreen();
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
void img.requestFullscreen();
|
|
41
|
-
}
|
|
42
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXConversationImageAttachmentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
43
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: AXConversationImageAttachmentComponent, isStandalone: true, selector: "ax-conversation-image-attachment", inputs: { item: { classPropertyName: "item", publicName: "item", isSignal: true, isRequired: true, transformFunction: null }, alt: { classPropertyName: "alt", publicName: "alt", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
44
|
-
<button
|
|
45
|
-
type="button"
|
|
46
|
-
class="ax-conversation-image-attachment"
|
|
47
|
-
[class.ax-conversation-image-attachment--ready]="ready()"
|
|
48
|
-
[class.ax-conversation-image-attachment--loading]="!displayUrl()"
|
|
49
|
-
(click)="toggleFullscreen($event)"
|
|
50
|
-
[attr.aria-label]="alt()"
|
|
51
|
-
>
|
|
52
|
-
@if (displayUrl(); as src) {
|
|
53
|
-
<img [src]="src" [alt]="alt()" loading="lazy" (load)="onImageLoad()" (error)="onImageError()" />
|
|
54
|
-
}
|
|
55
|
-
</button>
|
|
56
|
-
`, isInline: true, styles: [":host{display:block;min-width:0;min-height:0}.ax-conversation-image-attachment{display:block;width:100%;height:100%;min-height:4.5rem;padding:0;border-radius:.5rem;border:none;background:rgb(var(--ax-sys-color-light-surface));overflow:hidden}.ax-conversation-image-attachment--loading{background:rgba(var(--ax-sys-color-on-surface),.06)}.ax-conversation-image-attachment img{width:100%;height:100%;object-fit:cover;opacity:0;transition:opacity .15s ease}.ax-conversation-image-attachment img:fullscreen{width:100%;height:100%;object-fit:contain;background:#000}.ax-conversation-image-attachment--ready img{opacity:1}.ax-conversation-image-attachment:focus-visible{outline:2px solid rgb(var(--ax-sys-color-primary-500));outline-offset:2px}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
57
|
-
}
|
|
58
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXConversationImageAttachmentComponent, decorators: [{
|
|
59
|
-
type: Component,
|
|
60
|
-
args: [{ selector: 'ax-conversation-image-attachment', changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
61
|
-
<button
|
|
62
|
-
type="button"
|
|
63
|
-
class="ax-conversation-image-attachment"
|
|
64
|
-
[class.ax-conversation-image-attachment--ready]="ready()"
|
|
65
|
-
[class.ax-conversation-image-attachment--loading]="!displayUrl()"
|
|
66
|
-
(click)="toggleFullscreen($event)"
|
|
67
|
-
[attr.aria-label]="alt()"
|
|
68
|
-
>
|
|
69
|
-
@if (displayUrl(); as src) {
|
|
70
|
-
<img [src]="src" [alt]="alt()" loading="lazy" (load)="onImageLoad()" (error)="onImageError()" />
|
|
71
|
-
}
|
|
72
|
-
</button>
|
|
73
|
-
`, styles: [":host{display:block;min-width:0;min-height:0}.ax-conversation-image-attachment{display:block;width:100%;height:100%;min-height:4.5rem;padding:0;border-radius:.5rem;border:none;background:rgb(var(--ax-sys-color-light-surface));overflow:hidden}.ax-conversation-image-attachment--loading{background:rgba(var(--ax-sys-color-on-surface),.06)}.ax-conversation-image-attachment img{width:100%;height:100%;object-fit:cover;opacity:0;transition:opacity .15s ease}.ax-conversation-image-attachment img:fullscreen{width:100%;height:100%;object-fit:contain;background:#000}.ax-conversation-image-attachment--ready img{opacity:1}.ax-conversation-image-attachment:focus-visible{outline:2px solid rgb(var(--ax-sys-color-primary-500));outline-offset:2px}\n"] }]
|
|
74
|
-
}], ctorParameters: () => [], propDecorators: { item: [{ type: i0.Input, args: [{ isSignal: true, alias: "item", required: true }] }], alt: [{ type: i0.Input, args: [{ isSignal: true, alias: "alt", required: false }] }] } });
|
|
75
|
-
|
|
76
|
-
export { AXConversationImageAttachmentComponent as A };
|
|
77
|
-
//# sourceMappingURL=acorex-components-conversation-image-attachment.component-CLMGxXPl.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-components-conversation-image-attachment.component-CLMGxXPl.mjs","sources":["../../../../packages/components/conversation/src/lib/plugins/message-list/components/shared/image-attachment.component.ts"],"sourcesContent":["import { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n PLATFORM_ID,\n computed,\n effect,\n inject,\n input,\n signal,\n untracked,\n} from '@angular/core';\nimport type { AXConversationImageMediaItem } from '../../../../models';\nimport { pickDisplayMediaUrl } from '../../../composer/components/shared/persisted-media-url';\nimport { toUploaderReference } from './attachment-uploader-reference';\nimport { createResolvedMediaUrlSignal } from './media-url-resolve';\n\n@Component({\n selector: 'ax-conversation-image-attachment',\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <button\n type=\"button\"\n class=\"ax-conversation-image-attachment\"\n [class.ax-conversation-image-attachment--ready]=\"ready()\"\n [class.ax-conversation-image-attachment--loading]=\"!displayUrl()\"\n (click)=\"toggleFullscreen($event)\"\n [attr.aria-label]=\"alt()\"\n >\n @if (displayUrl(); as src) {\n <img [src]=\"src\" [alt]=\"alt()\" loading=\"lazy\" (load)=\"onImageLoad()\" (error)=\"onImageError()\" />\n }\n </button>\n `,\n styles: [\n `\n :host {\n display: block;\n min-width: 0;\n min-height: 0;\n }\n\n .ax-conversation-image-attachment {\n display: block;\n width: 100%;\n height: 100%;\n min-height: 4.5rem;\n padding: 0;\n border-radius: 0.5rem;\n border: none;\n background: rgb(var(--ax-sys-color-light-surface));\n overflow: hidden;\n }\n\n .ax-conversation-image-attachment--loading {\n background: rgba(var(--ax-sys-color-on-surface), 0.06);\n }\n\n .ax-conversation-image-attachment img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n opacity: 0;\n transition: opacity 0.15s ease;\n }\n\n .ax-conversation-image-attachment img:fullscreen {\n width: 100%;\n height: 100%;\n object-fit: contain;\n background: #000;\n }\n\n .ax-conversation-image-attachment--ready img {\n opacity: 1;\n }\n\n .ax-conversation-image-attachment:focus-visible {\n outline: 2px solid rgb(var(--ax-sys-color-primary-500));\n outline-offset: 2px;\n }\n `,\n ],\n})\nexport class AXConversationImageAttachmentComponent {\n private readonly platformId = inject(PLATFORM_ID);\n private readonly document = inject(DOCUMENT);\n\n readonly item = input.required<AXConversationImageMediaItem>();\n readonly alt = input('Image');\n\n readonly ready = signal(false);\n\n private readonly mediaReference = computed(() => toUploaderReference(this.item()));\n private readonly resolvedUrl = createResolvedMediaUrlSignal(this.mediaReference);\n\n readonly displayUrl = computed(() =>\n pickDisplayMediaUrl(this.resolvedUrl(), this.item().thumbnailUrl, this.item().url),\n );\n\n constructor() {\n effect(() => {\n this.displayUrl();\n this.item().mediaId;\n untracked(() => this.ready.set(false));\n });\n }\n\n onImageLoad(): void {\n this.ready.set(true);\n }\n\n onImageError(): void {\n this.ready.set(false);\n }\n\n toggleFullscreen(event: MouseEvent): void {\n if (!isPlatformBrowser(this.platformId)) {\n return;\n }\n const img = (event.currentTarget as HTMLElement).querySelector('img');\n if (!(img instanceof HTMLImageElement) || !img.requestFullscreen) {\n return;\n }\n if (this.document.fullscreenElement === img) {\n void this.document.exitFullscreen();\n return;\n }\n void img.requestFullscreen();\n }\n}\n"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