@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,119 +0,0 @@
|
|
|
1
|
-
import { CommonModule } from '@angular/common';
|
|
2
|
-
import * as i0 from '@angular/core';
|
|
3
|
-
import { input, output, viewChild, computed, 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
|
-
import { f as formatMediaDuration } from './acorex-components-conversation-format-media-DUD4vA6F.mjs';
|
|
6
|
-
|
|
7
|
-
class AXConversationAudioAttachmentComponent {
|
|
8
|
-
constructor() {
|
|
9
|
-
this.item = input.required(...(ngDevMode ? [{ debugName: "item" }] : /* istanbul ignore next */ []));
|
|
10
|
-
this.playingChange = output();
|
|
11
|
-
this.timeUpdate = output();
|
|
12
|
-
this.durationChange = output();
|
|
13
|
-
this.playbackEnded = output();
|
|
14
|
-
this.playbackError = output();
|
|
15
|
-
this.audioElementRef = viewChild('audioElement', ...(ngDevMode ? [{ debugName: "audioElementRef" }] : /* istanbul ignore next */ []));
|
|
16
|
-
this.mediaReference = computed(() => toUploaderReference(this.item()), ...(ngDevMode ? [{ debugName: "mediaReference" }] : /* istanbul ignore next */ []));
|
|
17
|
-
this.resolvedUrl = createResolvedMediaUrlSignal(this.mediaReference);
|
|
18
|
-
this.audioUrl = computed(() => pickDisplayMediaUrl(this.resolvedUrl(), this.item().url), ...(ngDevMode ? [{ debugName: "audioUrl" }] : /* istanbul ignore next */ []));
|
|
19
|
-
this.title = computed(() => this.item().title ?? 'Audio', ...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
20
|
-
this.duration = computed(() => this.item().duration ?? 0, ...(ngDevMode ? [{ debugName: "duration" }] : /* istanbul ignore next */ []));
|
|
21
|
-
this.durationLabel = computed(() => formatMediaDuration(this.duration()), ...(ngDevMode ? [{ debugName: "durationLabel" }] : /* istanbul ignore next */ []));
|
|
22
|
-
}
|
|
23
|
-
togglePlay() {
|
|
24
|
-
const audioEl = this.audioElementRef()?.nativeElement;
|
|
25
|
-
if (!audioEl) {
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
if (audioEl.paused) {
|
|
29
|
-
void audioEl.play();
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
audioEl.pause();
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
pause() {
|
|
36
|
-
this.audioElementRef()?.nativeElement?.pause();
|
|
37
|
-
}
|
|
38
|
-
onPlay() {
|
|
39
|
-
this.playingChange.emit(true);
|
|
40
|
-
}
|
|
41
|
-
onPause() {
|
|
42
|
-
this.playingChange.emit(false);
|
|
43
|
-
}
|
|
44
|
-
onTimeUpdate() {
|
|
45
|
-
const audioEl = this.audioElementRef()?.nativeElement;
|
|
46
|
-
if (audioEl) {
|
|
47
|
-
this.timeUpdate.emit(audioEl.currentTime);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
onLoadedMetadata() {
|
|
51
|
-
const audioEl = this.audioElementRef()?.nativeElement;
|
|
52
|
-
if (audioEl && Number.isFinite(audioEl.duration)) {
|
|
53
|
-
this.durationChange.emit(audioEl.duration);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
onEnded() {
|
|
57
|
-
this.playingChange.emit(false);
|
|
58
|
-
this.playbackEnded.emit();
|
|
59
|
-
}
|
|
60
|
-
onError() {
|
|
61
|
-
this.playingChange.emit(false);
|
|
62
|
-
this.playbackError.emit();
|
|
63
|
-
}
|
|
64
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXConversationAudioAttachmentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
65
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.9", type: AXConversationAudioAttachmentComponent, isStandalone: true, selector: "ax-conversation-audio-attachment", inputs: { item: { classPropertyName: "item", publicName: "item", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { playingChange: "playingChange", timeUpdate: "timeUpdate", durationChange: "durationChange", playbackEnded: "playbackEnded", playbackError: "playbackError" }, viewQueries: [{ propertyName: "audioElementRef", first: true, predicate: ["audioElement"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
66
|
-
<div class="ax-conversation-audio">
|
|
67
|
-
<span class="ax-conversation-audio__icon" aria-hidden="true"><i class="fa-light fa-music"></i></span>
|
|
68
|
-
<div class="ax-conversation-audio__main">
|
|
69
|
-
<span class="ax-conversation-audio__title">{{ title() }}</span>
|
|
70
|
-
<audio
|
|
71
|
-
#audioElement
|
|
72
|
-
class="ax-conversation-audio__el"
|
|
73
|
-
[src]="audioUrl() || null"
|
|
74
|
-
controls
|
|
75
|
-
preload="metadata"
|
|
76
|
-
(play)="onPlay()"
|
|
77
|
-
(pause)="onPause()"
|
|
78
|
-
(timeupdate)="onTimeUpdate()"
|
|
79
|
-
(ended)="onEnded()"
|
|
80
|
-
(loadedmetadata)="onLoadedMetadata()"
|
|
81
|
-
(error)="onError()"
|
|
82
|
-
></audio>
|
|
83
|
-
</div>
|
|
84
|
-
<!-- @if (duration() > 0) {
|
|
85
|
-
<span class="ax-conversation-audio__time">{{ durationLabel() }}</span>
|
|
86
|
-
} -->
|
|
87
|
-
</div>
|
|
88
|
-
`, isInline: true, styles: [":host{display:block}.ax-conversation-audio{display:flex;align-items:center;gap:.5rem;width:100%;min-width:22rem;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))}.ax-conversation-audio__icon{flex-shrink:0;width:2rem;height:2rem;display:flex;align-items:center;justify-content:center;border-radius:50%;background:rgba(var(--ax-sys-color-primary-500),.1);color:rgb(var(--ax-sys-color-primary-500));font-size:.875rem}.ax-conversation-audio__main{flex:1;min-width:0;display:flex;flex-direction:column;gap:.25rem}.ax-conversation-audio__title{font-size:.75rem;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:rgb(var(--ax-sys-color-on-surface))}.ax-conversation-audio__el{width:100%;height:1.75rem}.ax-conversation-audio__time{flex-shrink:0;font-size:.6875rem;font-variant-numeric:tabular-nums;color:rgba(var(--ax-sys-color-on-surface),.65)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
89
|
-
}
|
|
90
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXConversationAudioAttachmentComponent, decorators: [{
|
|
91
|
-
type: Component,
|
|
92
|
-
args: [{ selector: 'ax-conversation-audio-attachment', imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
93
|
-
<div class="ax-conversation-audio">
|
|
94
|
-
<span class="ax-conversation-audio__icon" aria-hidden="true"><i class="fa-light fa-music"></i></span>
|
|
95
|
-
<div class="ax-conversation-audio__main">
|
|
96
|
-
<span class="ax-conversation-audio__title">{{ title() }}</span>
|
|
97
|
-
<audio
|
|
98
|
-
#audioElement
|
|
99
|
-
class="ax-conversation-audio__el"
|
|
100
|
-
[src]="audioUrl() || null"
|
|
101
|
-
controls
|
|
102
|
-
preload="metadata"
|
|
103
|
-
(play)="onPlay()"
|
|
104
|
-
(pause)="onPause()"
|
|
105
|
-
(timeupdate)="onTimeUpdate()"
|
|
106
|
-
(ended)="onEnded()"
|
|
107
|
-
(loadedmetadata)="onLoadedMetadata()"
|
|
108
|
-
(error)="onError()"
|
|
109
|
-
></audio>
|
|
110
|
-
</div>
|
|
111
|
-
<!-- @if (duration() > 0) {
|
|
112
|
-
<span class="ax-conversation-audio__time">{{ durationLabel() }}</span>
|
|
113
|
-
} -->
|
|
114
|
-
</div>
|
|
115
|
-
`, styles: [":host{display:block}.ax-conversation-audio{display:flex;align-items:center;gap:.5rem;width:100%;min-width:22rem;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))}.ax-conversation-audio__icon{flex-shrink:0;width:2rem;height:2rem;display:flex;align-items:center;justify-content:center;border-radius:50%;background:rgba(var(--ax-sys-color-primary-500),.1);color:rgb(var(--ax-sys-color-primary-500));font-size:.875rem}.ax-conversation-audio__main{flex:1;min-width:0;display:flex;flex-direction:column;gap:.25rem}.ax-conversation-audio__title{font-size:.75rem;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:rgb(var(--ax-sys-color-on-surface))}.ax-conversation-audio__el{width:100%;height:1.75rem}.ax-conversation-audio__time{flex-shrink:0;font-size:.6875rem;font-variant-numeric:tabular-nums;color:rgba(var(--ax-sys-color-on-surface),.65)}\n"] }]
|
|
116
|
-
}], propDecorators: { item: [{ type: i0.Input, args: [{ isSignal: true, alias: "item", required: true }] }], playingChange: [{ type: i0.Output, args: ["playingChange"] }], timeUpdate: [{ type: i0.Output, args: ["timeUpdate"] }], durationChange: [{ type: i0.Output, args: ["durationChange"] }], playbackEnded: [{ type: i0.Output, args: ["playbackEnded"] }], playbackError: [{ type: i0.Output, args: ["playbackError"] }], audioElementRef: [{ type: i0.ViewChild, args: ['audioElement', { isSignal: true }] }] } });
|
|
117
|
-
|
|
118
|
-
export { AXConversationAudioAttachmentComponent as A };
|
|
119
|
-
//# sourceMappingURL=acorex-components-conversation-audio-attachment.component-CLvS3W8F.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-components-conversation-audio-attachment.component-CLvS3W8F.mjs","sources":["../../../../packages/components/conversation/src/lib/plugins/message-list/components/shared/audio-attachment.component.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, ElementRef, computed, input, output, viewChild } from '@angular/core';\nimport type { AXConversationAudioMediaItem } from '../../../../models';\nimport { pickDisplayMediaUrl } from '../../../composer/components/shared/persisted-media-url';\nimport { toUploaderReference } from './attachment-uploader-reference';\nimport { formatMediaDuration } from './format-media';\nimport { createResolvedMediaUrlSignal } from './media-url-resolve';\n\n@Component({\n selector: 'ax-conversation-audio-attachment',\n imports: [CommonModule],\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <div class=\"ax-conversation-audio\">\n <span class=\"ax-conversation-audio__icon\" aria-hidden=\"true\"><i class=\"fa-light fa-music\"></i></span>\n <div class=\"ax-conversation-audio__main\">\n <span class=\"ax-conversation-audio__title\">{{ title() }}</span>\n <audio\n #audioElement\n class=\"ax-conversation-audio__el\"\n [src]=\"audioUrl() || null\"\n controls\n preload=\"metadata\"\n (play)=\"onPlay()\"\n (pause)=\"onPause()\"\n (timeupdate)=\"onTimeUpdate()\"\n (ended)=\"onEnded()\"\n (loadedmetadata)=\"onLoadedMetadata()\"\n (error)=\"onError()\"\n ></audio>\n </div>\n <!-- @if (duration() > 0) {\n <span class=\"ax-conversation-audio__time\">{{ durationLabel() }}</span>\n } -->\n </div>\n `,\n styles: [\n `\n :host {\n display: block;\n }\n\n .ax-conversation-audio {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n width: 100%;\n min-width: 22rem;\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 }\n\n .ax-conversation-audio__icon {\n flex-shrink: 0;\n width: 2rem;\n height: 2rem;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 50%;\n background: rgba(var(--ax-sys-color-primary-500), 0.1);\n color: rgb(var(--ax-sys-color-primary-500));\n font-size: 0.875rem;\n }\n\n .ax-conversation-audio__main {\n flex: 1;\n min-width: 0;\n display: flex;\n flex-direction: column;\n gap: 0.25rem;\n }\n\n .ax-conversation-audio__title {\n font-size: 0.75rem;\n font-weight: 500;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: rgb(var(--ax-sys-color-on-surface));\n }\n\n .ax-conversation-audio__el {\n width: 100%;\n height: 1.75rem;\n }\n\n .ax-conversation-audio__time {\n flex-shrink: 0;\n font-size: 0.6875rem;\n font-variant-numeric: tabular-nums;\n color: rgba(var(--ax-sys-color-on-surface), 0.65);\n }\n `,\n ],\n})\nexport class AXConversationAudioAttachmentComponent {\n readonly item = input.required<AXConversationAudioMediaItem>();\n\n readonly playingChange = output<boolean>();\n readonly timeUpdate = output<number>();\n readonly durationChange = output<number>();\n readonly playbackEnded = output<void>();\n readonly playbackError = output<void>();\n\n private readonly audioElementRef = viewChild<ElementRef<HTMLAudioElement>>('audioElement');\n\n private readonly mediaReference = computed(() => toUploaderReference(this.item()));\n private readonly resolvedUrl = createResolvedMediaUrlSignal(this.mediaReference);\n\n readonly audioUrl = computed(() =>\n pickDisplayMediaUrl(this.resolvedUrl(), this.item().url),\n );\n readonly title = computed(() => this.item().title ?? 'Audio');\n readonly duration = computed(() => this.item().duration ?? 0);\n readonly durationLabel = computed(() => formatMediaDuration(this.duration()));\n\n togglePlay(): void {\n const audioEl = this.audioElementRef()?.nativeElement;\n if (!audioEl) {\n return;\n }\n if (audioEl.paused) {\n void audioEl.play();\n } else {\n audioEl.pause();\n }\n }\n\n pause(): void {\n this.audioElementRef()?.nativeElement?.pause();\n }\n\n onPlay(): void {\n this.playingChange.emit(true);\n }\n\n onPause(): void {\n this.playingChange.emit(false);\n }\n\n onTimeUpdate(): void {\n const audioEl = this.audioElementRef()?.nativeElement;\n if (audioEl) {\n this.timeUpdate.emit(audioEl.currentTime);\n }\n }\n\n onLoadedMetadata(): void {\n const audioEl = this.audioElementRef()?.nativeElement;\n if (audioEl && Number.isFinite(audioEl.duration)) {\n this.durationChange.emit(audioEl.duration);\n }\n }\n\n onEnded(): void {\n this.playingChange.emit(false);\n this.playbackEnded.emit();\n }\n\n onError(): void {\n this.playingChange.emit(false);\n this.playbackError.emit();\n }\n}\n"],"names":[],"mappings":";;;;;;MAmGa,sCAAsC,CAAA;AA3FnD,IAAA,WAAA,GAAA;AA4FW,QAAA,IAAA,CAAA,IAAI,GAAG,KAAK,CAAC,QAAQ,0EAAgC;QAErD,IAAA,CAAA,aAAa,GAAG,MAAM,EAAW;QACjC,IAAA,CAAA,UAAU,GAA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as resolvePersistableMediaUrl } from './acorex-components-conversation-acorex-components-conversation-YhVa42TC.mjs';
|
|
3
|
-
|
|
4
|
-
function audioItemFromUpload(file, result, duration) {
|
|
5
|
-
const url = resolvePersistableMediaUrl(result.url);
|
|
6
|
-
const item = {
|
|
7
|
-
mediaId: result.mediaId,
|
|
8
|
-
mimeType: result.mimeType,
|
|
9
|
-
size: result.size,
|
|
10
|
-
duration,
|
|
11
|
-
title: file.name,
|
|
12
|
-
metadata: result.metadata,
|
|
13
|
-
};
|
|
14
|
-
if (url) {
|
|
15
|
-
item.url = url;
|
|
16
|
-
}
|
|
17
|
-
return item;
|
|
18
|
-
}
|
|
19
|
-
function mergeAudioUploadResult(payload, result) {
|
|
20
|
-
const base = normalizeAudioPayload(payload);
|
|
21
|
-
const audios = [...base.audios];
|
|
22
|
-
const i = audios.findIndex((x) => !x.mediaId && !resolvePersistableMediaUrl(x.url));
|
|
23
|
-
const slot = i >= 0 ? audios[i] : undefined;
|
|
24
|
-
const url = resolvePersistableMediaUrl(result.url);
|
|
25
|
-
const next = {
|
|
26
|
-
...(slot ?? { duration: 0 }),
|
|
27
|
-
mediaId: result.mediaId,
|
|
28
|
-
mimeType: result.mimeType,
|
|
29
|
-
size: result.size,
|
|
30
|
-
metadata: result.metadata,
|
|
31
|
-
};
|
|
32
|
-
if (url) {
|
|
33
|
-
next.url = url;
|
|
34
|
-
}
|
|
35
|
-
if (i >= 0)
|
|
36
|
-
audios[i] = next;
|
|
37
|
-
else
|
|
38
|
-
audios.push(next);
|
|
39
|
-
return { ...base, type: 'audio', audios };
|
|
40
|
-
}
|
|
41
|
-
function applyAudioLocalPreview(payload, localUrl, mimeType = 'application/octet-stream') {
|
|
42
|
-
const base = normalizeAudioPayload(payload);
|
|
43
|
-
const audios = [...base.audios];
|
|
44
|
-
const slot = audios.findIndex((x) => !x.mediaId && !resolvePersistableMediaUrl(x.url));
|
|
45
|
-
const preview = { url: localUrl, duration: 0, mimeType };
|
|
46
|
-
if (slot >= 0) {
|
|
47
|
-
audios[slot] = { ...audios[slot], ...preview };
|
|
48
|
-
}
|
|
49
|
-
else if (audios.length === 0) {
|
|
50
|
-
audios.push(preview);
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
audios[0] = { ...audios[0], ...preview };
|
|
54
|
-
}
|
|
55
|
-
return { ...base, type: 'audio', audios };
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export { applyAudioLocalPreview, audioItemFromUpload, mergeAudioUploadResult };
|
|
59
|
-
//# sourceMappingURL=acorex-components-conversation-audio-composer.payload-BHQJNyXz.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-components-conversation-audio-composer.payload-BHQJNyXz.mjs","sources":["../../../../packages/components/conversation/src/lib/plugins/composer/components/audio-picker/audio-composer.payload.ts"],"sourcesContent":["import type { AXUploadResult } from '@acorex/cdk/uploader';\nimport type { AXConversationAudioMediaItem, AXConversationAudioPayload, AXConversationMessagePayload } from '../../../../models';\nimport type { AXConversationUploaderResult } from '../../../../models/conversation-upload.types';\nimport { normalizeAudioPayload } from '../../../message-list/components/audio-renderer/audio.payload';\nimport { resolvePersistableMediaUrl } from '../shared/persisted-media-url';\n\nexport function audioItemFromUpload(file: File, result: AXConversationUploaderResult, duration: number): AXConversationAudioMediaItem {\n const url = resolvePersistableMediaUrl(result.url);\n const item: AXConversationAudioMediaItem = {\n mediaId: result.mediaId,\n mimeType: result.mimeType,\n size: result.size,\n duration,\n title: file.name,\n metadata: result.metadata,\n };\n if (url) {\n item.url = url;\n }\n return item;\n}\n\nexport function mergeAudioUploadResult(\n payload: AXConversationMessagePayload,\n result: AXUploadResult,\n): AXConversationMessagePayload {\n const base = normalizeAudioPayload(payload as AXConversationAudioPayload);\n const audios = [...base.audios];\n const i = audios.findIndex((x) => !x.mediaId && !resolvePersistableMediaUrl(x.url));\n const slot = i >= 0 ? audios[i] : undefined;\n const url = resolvePersistableMediaUrl(result.url);\n const next: AXConversationAudioMediaItem = {\n ...(slot ?? { duration: 0 }),\n mediaId: result.mediaId,\n mimeType: result.mimeType,\n size: result.size,\n metadata: result.metadata,\n };\n if (url) {\n next.url = url;\n }\n if (i >= 0) audios[i] = next;\n else audios.push(next);\n return { ...base, type: 'audio', audios };\n}\n\nexport function applyAudioLocalPreview(\n payload: AXConversationMessagePayload,\n localUrl: string,\n mimeType = 'application/octet-stream',\n): AXConversationMessagePayload {\n const base = normalizeAudioPayload(payload as AXConversationAudioPayload);\n const audios = [...base.audios];\n const slot = audios.findIndex((x) => !x.mediaId && !resolvePersistableMediaUrl(x.url));\n const preview = { url: localUrl, duration: 0, mimeType };\n if (slot >= 0) {\n audios[slot] = { ...audios[slot], ...preview };\n } else if (audios.length === 0) {\n audios.push(preview);\n } else {\n audios[0] = { ...audios[0], ...preview };\n }\n return { ...base, type: 'audio', audios };\n}\n"],"names":[],"mappings":";;;SAMgB,mBAAmB,CAAC,IAAU,EAAE,MAAoC,EAAE,QAAgB,EAAA;IACpG,MAAM,GAAG,GAAG,0BAA0B,CAAC,MAAM,CAAC,GAAG,CAAC;AAClD,IAAA,MAAM,IAAI,GAAiC;QACzC,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,QAAQ;QACR,KAAK,EAAE,IAAI,CAAC,IAAI;QAChB,QAAQ,EAAE,MAAM,CAAC,QAAQ;KAC1B;IACD,IAAI,GAAG,EAAE;AACP,QAAA,IAAI,CAAC,GAAG,GAAG,GAAG;IAChB;AACA,IAAA,OAAO,IAAI;AACb;AAEM,SAAU,sBAAsB,CACpC,OAAqC,EACrC,MAAsB,EAAA;AAEtB,IAAA,MAAM,IAAI,GAAG,qBAAqB,CAAC,OAAqC,CAAC;IACzE,MAAM,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;IAC/B,MAAM,CAAC,GAAG,MAAM,CAAC,SAAS,CAAC,CA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