@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,149 +0,0 @@
|
|
|
1
|
-
import * as i1 from '@acorex/components/map';
|
|
2
|
-
import { AXMapModule } from '@acorex/components/map';
|
|
3
|
-
import * as i3 from '@acorex/core/translation';
|
|
4
|
-
import { AXTranslationService, AXTranslationModule } from '@acorex/core/translation';
|
|
5
|
-
import * as i2 from '@angular/common';
|
|
6
|
-
import { CommonModule } from '@angular/common';
|
|
7
|
-
import * as i0 from '@angular/core';
|
|
8
|
-
import { inject, input, signal, Component } from '@angular/core';
|
|
9
|
-
import { o as AXConversationComposerService, A as AXConversationService } from './acorex-components-conversation-acorex-components-conversation-YhVa42TC.mjs';
|
|
10
|
-
import { A as AXConversationPickerHeaderComponent, a as AXConversationPickerFooterComponent } from './acorex-components-conversation-picker-header.component-BneIFjXq.mjs';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Location Picker Component
|
|
14
|
-
* Full-width location selection interface for the composer
|
|
15
|
-
*/
|
|
16
|
-
class AXConversationLocationPickerComponent {
|
|
17
|
-
constructor() {
|
|
18
|
-
this.composerService = inject(AXConversationComposerService);
|
|
19
|
-
this.conversationService = inject(AXConversationService);
|
|
20
|
-
this.translation = inject(AXTranslationService);
|
|
21
|
-
this.conversation = input.required(...(ngDevMode ? [{ debugName: "conversation" }] : /* istanbul ignore next */ []));
|
|
22
|
-
// Default location
|
|
23
|
-
this.currentLocation = signal({
|
|
24
|
-
type: 'location',
|
|
25
|
-
latitude: 30,
|
|
26
|
-
longitude: 50,
|
|
27
|
-
}, ...(ngDevMode ? [{ debugName: "currentLocation" }] : /* istanbul ignore next */ []));
|
|
28
|
-
}
|
|
29
|
-
onMarkerAdded(event) {
|
|
30
|
-
// Event from ax-map markerAdded
|
|
31
|
-
this.currentLocation.set({
|
|
32
|
-
type: 'location',
|
|
33
|
-
latitude: event.latitude,
|
|
34
|
-
longitude: event.longitude,
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
async sendLocation() {
|
|
38
|
-
const location = this.currentLocation();
|
|
39
|
-
const command = {
|
|
40
|
-
conversationId: this.conversation().id,
|
|
41
|
-
type: 'location',
|
|
42
|
-
payload: location,
|
|
43
|
-
};
|
|
44
|
-
this.cancel();
|
|
45
|
-
void this.composerService.sendMessage(command).catch((error) => {
|
|
46
|
-
console.error('Failed to send location:', error);
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
cancel() {
|
|
50
|
-
// Reset to default location
|
|
51
|
-
this.currentLocation.set({
|
|
52
|
-
type: 'location',
|
|
53
|
-
latitude: 0,
|
|
54
|
-
longitude: 0,
|
|
55
|
-
});
|
|
56
|
-
this.composerService.hideComponent();
|
|
57
|
-
}
|
|
58
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXConversationLocationPickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
59
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.9", type: AXConversationLocationPickerComponent, isStandalone: true, selector: "ax-conversation-location-picker", inputs: { conversation: { classPropertyName: "conversation", publicName: "conversation", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `
|
|
60
|
-
<div class="ax-conversation-picker ax-conversation-picker--location">
|
|
61
|
-
<ax-conversation-picker-header
|
|
62
|
-
[title]="translation.translateSync('@acorex:chat.pickers.location.title')"
|
|
63
|
-
(onClose)="cancel()"
|
|
64
|
-
/>
|
|
65
|
-
|
|
66
|
-
<div class="ax-conversation-picker__scroll">
|
|
67
|
-
<!-- Map with Single Marker -->
|
|
68
|
-
<div class="map-container">
|
|
69
|
-
<ax-map
|
|
70
|
-
[latitude]="currentLocation().latitude"
|
|
71
|
-
[longitude]="currentLocation().longitude"
|
|
72
|
-
[maxMarker]="1"
|
|
73
|
-
[addMarkerOnTap]="true"
|
|
74
|
-
[hasLocator]="true"
|
|
75
|
-
(onMarkerAdded)="onMarkerAdded($event)"
|
|
76
|
-
/>
|
|
77
|
-
</div>
|
|
78
|
-
|
|
79
|
-
<!-- Location Info -->
|
|
80
|
-
<div class="location-info">
|
|
81
|
-
<div class="info-row">
|
|
82
|
-
<i class="fa-light fa-location-dot"></i>
|
|
83
|
-
<div class="info-text">
|
|
84
|
-
<div class="info-label">{{ '@acorex:chat.pickers.location.coordinates' | translate | async }}</div>
|
|
85
|
-
<div class="info-value">
|
|
86
|
-
{{ currentLocation().latitude.toFixed(6) }}, {{ currentLocation().longitude.toFixed(6) }}
|
|
87
|
-
</div>
|
|
88
|
-
</div>
|
|
89
|
-
</div>
|
|
90
|
-
</div>
|
|
91
|
-
</div>
|
|
92
|
-
|
|
93
|
-
<ax-conversation-picker-footer
|
|
94
|
-
[sendText]="translation.translateSync('@acorex:chat.pickers.location.send')"
|
|
95
|
-
[sendDisabled]="false"
|
|
96
|
-
(onCancel)="cancel()"
|
|
97
|
-
(onSend)="sendLocation()"
|
|
98
|
-
/>
|
|
99
|
-
</div>
|
|
100
|
-
`, isInline: true, styles: [":host{display:block;width:100%;container-type:inline-size;container-name:picker}.ax-conversation-picker--location{max-height:min(70dvh,28rem)}@container picker (max-width: 480px){.ax-conversation-picker--location{max-height:85dvh}}.map-container{height:10rem;overflow:hidden}.location-info{padding:.75rem 1rem;background:rgb(var(--ax-sys-color-surface));border-top:1px solid rgb(var(--ax-sys-color-border))}.info-row{display:flex;align-items:center;gap:.75rem}.info-row i{font-size:1.25rem;color:rgb(var(--ax-sys-color-primary))}.info-text{flex:1}.info-label{font-size:.75rem;color:rgb(var(--ax-sys-color-on-surface-variant));margin-bottom:.25rem}.info-value{font-size:.875rem;font-weight:500;color:rgb(var(--ax-sys-color-on-surface));font-family:monospace}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXMapModule }, { kind: "component", type: i1.AXMapComponent, selector: "ax-map", inputs: ["zoomLevel", "latitude", "longitude", "maxMarker", "maxPolygon", "hasDraw", "hasLocator", "fitToDraw", "limitDraw", "addPoiToFitDraw", "addMarkerOnTap", "readonly", "disabled", "markerPlace", "locatePlace", "poiMinZoom", "markers", "polygons", "pois"], outputs: ["zoomLevelChange", "latitudeChange", "longitudeChange", "onMarkerAdded", "onMarkerClick", "onMarkerChanged", "onPolygonAdded", "onPolygonClick", "onPolygonChanged", "onLocationFound", "onPoiChanged", "onPoiAdded", "onMapReady", "onLoadError"] }, { 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: "pipe", type: i2.AsyncPipe, name: "async" }, { kind: "pipe", type: i3.AXTranslatorPipe, name: "translate" }] }); }
|
|
101
|
-
}
|
|
102
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXConversationLocationPickerComponent, decorators: [{
|
|
103
|
-
type: Component,
|
|
104
|
-
args: [{ selector: 'ax-conversation-location-picker', imports: [CommonModule, AXMapModule, AXTranslationModule, AXConversationPickerHeaderComponent, AXConversationPickerFooterComponent], template: `
|
|
105
|
-
<div class="ax-conversation-picker ax-conversation-picker--location">
|
|
106
|
-
<ax-conversation-picker-header
|
|
107
|
-
[title]="translation.translateSync('@acorex:chat.pickers.location.title')"
|
|
108
|
-
(onClose)="cancel()"
|
|
109
|
-
/>
|
|
110
|
-
|
|
111
|
-
<div class="ax-conversation-picker__scroll">
|
|
112
|
-
<!-- Map with Single Marker -->
|
|
113
|
-
<div class="map-container">
|
|
114
|
-
<ax-map
|
|
115
|
-
[latitude]="currentLocation().latitude"
|
|
116
|
-
[longitude]="currentLocation().longitude"
|
|
117
|
-
[maxMarker]="1"
|
|
118
|
-
[addMarkerOnTap]="true"
|
|
119
|
-
[hasLocator]="true"
|
|
120
|
-
(onMarkerAdded)="onMarkerAdded($event)"
|
|
121
|
-
/>
|
|
122
|
-
</div>
|
|
123
|
-
|
|
124
|
-
<!-- Location Info -->
|
|
125
|
-
<div class="location-info">
|
|
126
|
-
<div class="info-row">
|
|
127
|
-
<i class="fa-light fa-location-dot"></i>
|
|
128
|
-
<div class="info-text">
|
|
129
|
-
<div class="info-label">{{ '@acorex:chat.pickers.location.coordinates' | translate | async }}</div>
|
|
130
|
-
<div class="info-value">
|
|
131
|
-
{{ currentLocation().latitude.toFixed(6) }}, {{ currentLocation().longitude.toFixed(6) }}
|
|
132
|
-
</div>
|
|
133
|
-
</div>
|
|
134
|
-
</div>
|
|
135
|
-
</div>
|
|
136
|
-
</div>
|
|
137
|
-
|
|
138
|
-
<ax-conversation-picker-footer
|
|
139
|
-
[sendText]="translation.translateSync('@acorex:chat.pickers.location.send')"
|
|
140
|
-
[sendDisabled]="false"
|
|
141
|
-
(onCancel)="cancel()"
|
|
142
|
-
(onSend)="sendLocation()"
|
|
143
|
-
/>
|
|
144
|
-
</div>
|
|
145
|
-
`, styles: [":host{display:block;width:100%;container-type:inline-size;container-name:picker}.ax-conversation-picker--location{max-height:min(70dvh,28rem)}@container picker (max-width: 480px){.ax-conversation-picker--location{max-height:85dvh}}.map-container{height:10rem;overflow:hidden}.location-info{padding:.75rem 1rem;background:rgb(var(--ax-sys-color-surface));border-top:1px solid rgb(var(--ax-sys-color-border))}.info-row{display:flex;align-items:center;gap:.75rem}.info-row i{font-size:1.25rem;color:rgb(var(--ax-sys-color-primary))}.info-text{flex:1}.info-label{font-size:.75rem;color:rgb(var(--ax-sys-color-on-surface-variant));margin-bottom:.25rem}.info-value{font-size:.875rem;font-weight:500;color:rgb(var(--ax-sys-color-on-surface));font-family:monospace}\n"] }]
|
|
146
|
-
}], propDecorators: { conversation: [{ type: i0.Input, args: [{ isSignal: true, alias: "conversation", required: true }] }] } });
|
|
147
|
-
|
|
148
|
-
export { AXConversationLocationPickerComponent };
|
|
149
|
-
//# sourceMappingURL=acorex-components-conversation-location-picker.component-DcNQzuoU.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-components-conversation-location-picker.component-DcNQzuoU.mjs","sources":["../../../../packages/components/conversation/src/lib/plugins/composer/components/location-picker/location-picker.component.ts"],"sourcesContent":["/**\n * Location Picker Component\n * Full-width location selection interface for the composer\n */\n\nimport { AXMapMarker, AXMapModule } from '@acorex/components/map';\nimport { AXTranslationModule, AXTranslationService } from '@acorex/core/translation';\nimport { CommonModule } from '@angular/common';\nimport { Component, inject, input, signal } from '@angular/core';\nimport { AXConversationComposerService } from '../../../../components/composer/composer.service';\nimport { AXConversation, AXConversationLocationPayload, AXConversationSendMessageCommand } from '../../../../models';\nimport { AXConversationService } from '../../../../services';\nimport { AXConversationPickerFooterComponent } from '../picker-footer/picker-footer.component';\nimport { AXConversationPickerHeaderComponent } from '../picker-header/picker-header.component';\n\n@Component({\n selector: 'ax-conversation-location-picker',\n imports: [CommonModule, AXMapModule, AXTranslationModule, AXConversationPickerHeaderComponent, AXConversationPickerFooterComponent],\n template: `\n <div class=\"ax-conversation-picker ax-conversation-picker--location\">\n <ax-conversation-picker-header\n [title]=\"translation.translateSync('@acorex:chat.pickers.location.title')\"\n (onClose)=\"cancel()\"\n />\n\n <div class=\"ax-conversation-picker__scroll\">\n <!-- Map with Single Marker -->\n <div class=\"map-container\">\n <ax-map\n [latitude]=\"currentLocation().latitude\"\n [longitude]=\"currentLocation().longitude\"\n [maxMarker]=\"1\"\n [addMarkerOnTap]=\"true\"\n [hasLocator]=\"true\"\n (onMarkerAdded)=\"onMarkerAdded($event)\"\n />\n </div>\n\n <!-- Location Info -->\n <div class=\"location-info\">\n <div class=\"info-row\">\n <i class=\"fa-light fa-location-dot\"></i>\n <div class=\"info-text\">\n <div class=\"info-label\">{{ '@acorex:chat.pickers.location.coordinates' | translate | async }}</div>\n <div class=\"info-value\">\n {{ currentLocation().latitude.toFixed(6) }}, {{ currentLocation().longitude.toFixed(6) }}\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <ax-conversation-picker-footer\n [sendText]=\"translation.translateSync('@acorex:chat.pickers.location.send')\"\n [sendDisabled]=\"false\"\n (onCancel)=\"cancel()\"\n (onSend)=\"sendLocation()\"\n />\n </div>\n `,\n styles: [\n `\n :host {\n display: block;\n width: 100%;\n container-type: inline-size;\n container-name: picker;\n }\n\n .ax-conversation-picker--location {\n max-height: min(70dvh, 28rem);\n }\n\n @container picker (max-width: 480px) {\n .ax-conversation-picker--location {\n max-height: 85dvh;\n }\n }\n\n .map-container {\n height: 10rem;\n overflow: hidden;\n }\n\n .location-info {\n padding: 0.75rem 1rem;\n background: rgb(var(--ax-sys-color-surface));\n border-top: 1px solid rgb(var(--ax-sys-color-border));\n }\n\n .info-row {\n display: flex;\n align-items: center;\n gap: 0.75rem;\n }\n\n .info-row i {\n font-size: 1.25rem;\n color: rgb(var(--ax-sys-color-primary));\n }\n\n .info-text {\n flex: 1;\n }\n\n .info-label {\n font-size: 0.75rem;\n color: rgb(var(--ax-sys-color-on-surface-variant));\n margin-bottom: 0.25rem;\n }\n\n .info-value {\n font-size: 0.875rem;\n font-weight: 500;\n color: rgb(var(--ax-sys-color-on-surface));\n font-family: monospace;\n }\n `,\n ],\n})\nexport class AXConversationLocationPickerComponent {\n private readonly composerService = inject(AXConversationComposerService);\n private readonly conversationService = inject(AXConversationService);\n readonly translation = inject(AXTranslationService);\n\n readonly conversation = input.required<AXConversation>();\n // Default location\n readonly currentLocation = signal<AXConversationLocationPayload>({\n type: 'location',\n latitude: 30,\n longitude: 50,\n });\n\n onMarkerAdded(event: AXMapMarker): void {\n // Event from ax-map markerAdded\n this.currentLocation.set({\n type: 'location',\n\n latitude: event.latitude,\n longitude: event.longitude,\n });\n }\n\n async sendLocation(): Promise<void> {\n const location = this.currentLocation();\n\n const command: AXConversationSendMessageCommand = {\n conversationId: this.conversation().id,\n type: 'location',\n payload: location,\n };\n\n this.cancel();\n\n void this.composerService.sendMessage(command).catch((error) => {\n console.error('Failed to send location:', error);\n });\n }\n\n cancel(): void {\n // Reset to default location\n this.currentLocation.set({\n type: 'location',\n latitude: 0,\n longitude: 0,\n });\n this.composerService.hideComponent();\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAAA;;;AAGG;MAqHU,qCAAqC,CAAA;A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
|
-
import * as i0 from '@angular/core';
|
|
5
|
-
import { signal, input, computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
6
|
-
import { A as AXConversationMessageRendererCopyHostComponent } from './acorex-components-conversation-message-renderer-copy-host.component-oXTr_Lfq.mjs';
|
|
7
|
-
import { A as AXConversationMessageRendererStateComponent } from './acorex-components-conversation-message-renderer-state.component-Dp-JdHWr.mjs';
|
|
8
|
-
|
|
9
|
-
class AXConversationLocationRendererComponent extends AXConversationMessageRendererCopyHostComponent {
|
|
10
|
-
constructor() {
|
|
11
|
-
super(...arguments);
|
|
12
|
-
this._contentState = signal('none', ...(ngDevMode ? [{ debugName: "_contentState" }] : /* istanbul ignore next */ []));
|
|
13
|
-
this.message = input.required(...(ngDevMode ? [{ debugName: "message" }] : /* istanbul ignore next */ []));
|
|
14
|
-
this.rendererState = computed(() => ({
|
|
15
|
-
deliveryStatus: this.message().status,
|
|
16
|
-
contentState: this._contentState(),
|
|
17
|
-
}), ...(ngDevMode ? [{ debugName: "rendererState" }] : /* istanbul ignore next */ []));
|
|
18
|
-
this.payload = computed(() => this.message().payload, ...(ngDevMode ? [{ debugName: "payload" }] : /* istanbul ignore next */ []));
|
|
19
|
-
this.latitude = computed(() => this.payload().latitude, ...(ngDevMode ? [{ debugName: "latitude" }] : /* istanbul ignore next */ []));
|
|
20
|
-
this.longitude = computed(() => this.payload().longitude, ...(ngDevMode ? [{ debugName: "longitude" }] : /* istanbul ignore next */ []));
|
|
21
|
-
this.locationName = computed(() => this.payload().name || 'Location', ...(ngDevMode ? [{ debugName: "locationName" }] : /* istanbul ignore next */ []));
|
|
22
|
-
this.address = computed(() => this.payload().address, ...(ngDevMode ? [{ debugName: "address" }] : /* istanbul ignore next */ []));
|
|
23
|
-
this.coordinatesText = computed(() => {
|
|
24
|
-
const lat = this.latitude().toFixed(5);
|
|
25
|
-
const lng = this.longitude().toFixed(5);
|
|
26
|
-
return `${lat}, ${lng}`;
|
|
27
|
-
}, ...(ngDevMode ? [{ debugName: "coordinatesText" }] : /* istanbul ignore next */ []));
|
|
28
|
-
this.mapsUrl = computed(() => {
|
|
29
|
-
const lat = this.latitude();
|
|
30
|
-
const lng = this.longitude();
|
|
31
|
-
return `https://www.google.com/maps?q=${lat},${lng}`;
|
|
32
|
-
}, ...(ngDevMode ? [{ debugName: "mapsUrl" }] : /* istanbul ignore next */ []));
|
|
33
|
-
this.markers = computed(() => [
|
|
34
|
-
{
|
|
35
|
-
latitude: this.latitude(),
|
|
36
|
-
longitude: this.longitude(),
|
|
37
|
-
popup: this.locationName(),
|
|
38
|
-
popupOpen: false,
|
|
39
|
-
popupCloseButton: true,
|
|
40
|
-
},
|
|
41
|
-
], ...(ngDevMode ? [{ debugName: "markers" }] : /* istanbul ignore next */ []));
|
|
42
|
-
}
|
|
43
|
-
copy() {
|
|
44
|
-
const name = this.locationName();
|
|
45
|
-
const addr = this.address()?.trim();
|
|
46
|
-
const coords = this.coordinatesText();
|
|
47
|
-
const maps = this.mapsUrl();
|
|
48
|
-
const lines = [addr, coords, maps].filter(Boolean);
|
|
49
|
-
return lines.length ? `${name}\n${lines.join('\n')}` : name;
|
|
50
|
-
}
|
|
51
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXConversationLocationRendererComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
52
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: AXConversationLocationRendererComponent, isStandalone: true, selector: "ax-conversation-location-renderer", inputs: { message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: true, transformFunction: null } }, usesInheritance: true, ngImport: i0, template: `
|
|
53
|
-
<div class="ax-conversation-loc">
|
|
54
|
-
<ax-conversation-message-renderer-state [rendererState]="rendererState()" [message]="message()" />
|
|
55
|
-
<div class="ax-conversation-loc__map">
|
|
56
|
-
<ax-map
|
|
57
|
-
[latitude]="latitude()"
|
|
58
|
-
[longitude]="longitude()"
|
|
59
|
-
[zoomLevel]="15"
|
|
60
|
-
[markers]="markers()"
|
|
61
|
-
[hasLocator]="false"
|
|
62
|
-
[hasDraw]="false"
|
|
63
|
-
></ax-map>
|
|
64
|
-
</div>
|
|
65
|
-
<div class="ax-conversation-loc__body">
|
|
66
|
-
<div class="ax-conversation-loc__title">
|
|
67
|
-
<span class="ax-conversation-loc__title-text">{{ locationName() }}</span>
|
|
68
|
-
</div>
|
|
69
|
-
@if (address()) {
|
|
70
|
-
<div class="ax-conversation-loc__addr">{{ address() }}</div>
|
|
71
|
-
}
|
|
72
|
-
<div class="ax-conversation-loc__meta">
|
|
73
|
-
<span class="ax-conversation-loc__coords">{{ coordinatesText() }}</span>
|
|
74
|
-
</div>
|
|
75
|
-
</div>
|
|
76
|
-
<a class="ax-conversation-loc__action" [href]="mapsUrl()" target="_blank" rel="noopener noreferrer">
|
|
77
|
-
<span>Open in Maps</span>
|
|
78
|
-
<i class="fa-light fa-arrow-up-right-from-square" aria-hidden="true"></i>
|
|
79
|
-
</a>
|
|
80
|
-
</div>
|
|
81
|
-
`, isInline: true, styles: [":host{display:block}:host{max-width:100%}.ax-conversation-loc{display:flex;flex-direction:column;width:100%;max-width:min(100%,20rem);border-radius:var(--ax-sys-border-radius, .5rem);border:1px solid rgb(var(--ax-sys-color-border-light-surface));overflow:hidden;background:rgb(var(--ax-sys-color-surface));color:rgb(var(--ax-sys-color-on-surface))}.ax-conversation-loc__map{position:relative;height:min(28dvh,10rem);width:100%;overflow:hidden}@container conversation (min-width: 480px){.ax-conversation-loc__map{height:10.5rem}}.ax-conversation-loc__map ::ng-deep ax-map{display:block;height:100%;width:100%}.ax-conversation-loc__body{padding:.625rem .75rem .5rem;display:flex;flex-direction:column;gap:.25rem}.ax-conversation-loc__title{display:flex;align-items:center;font-size:.875rem;font-weight:600;line-height:1.2}.ax-conversation-loc__title-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ax-conversation-loc__addr{font-size:.75rem;opacity:.78;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ax-conversation-loc__meta{display:flex;align-items:center;gap:.5rem}.ax-conversation-loc__coords{font-size:.6875rem;opacity:.62;font-variant-numeric:tabular-nums;font-family:ui-monospace,monospace}.ax-conversation-loc__action{display:flex;align-items:center;justify-content:space-between;gap:.5rem;min-height:2.75rem;padding:.5rem .75rem;border-top:1px solid rgb(var(--ax-sys-color-border-light-surface));background:rgb(var(--ax-sys-color-light-surface));font-size:.8125rem;font-weight:500;color:rgb(var(--ax-sys-color-primary-600));text-decoration:none;touch-action:manipulation;transition:background .15s ease,color .15s ease}@media(hover:hover){.ax-conversation-loc__action:hover{background:rgb(var(--ax-sys-color-primary-lightest-surface));color:rgb(var(--ax-sys-color-primary-700))}}.ax-conversation-loc__action i{font-size:.75rem;opacity:.85}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXMapModule }, { kind: "component", type: i1.AXMapComponent, selector: "ax-map", inputs: ["zoomLevel", "latitude", "longitude", "maxMarker", "maxPolygon", "hasDraw", "hasLocator", "fitToDraw", "limitDraw", "addPoiToFitDraw", "addMarkerOnTap", "readonly", "disabled", "markerPlace", "locatePlace", "poiMinZoom", "markers", "polygons", "pois"], outputs: ["zoomLevelChange", "latitudeChange", "longitudeChange", "onMarkerAdded", "onMarkerClick", "onMarkerChanged", "onPolygonAdded", "onPolygonClick", "onPolygonChanged", "onLocationFound", "onPoiChanged", "onPoiAdded", "onMapReady", "onLoadError"] }, { 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 }); }
|
|
82
|
-
}
|
|
83
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXConversationLocationRendererComponent, decorators: [{
|
|
84
|
-
type: Component,
|
|
85
|
-
args: [{ selector: 'ax-conversation-location-renderer', imports: [CommonModule, AXMapModule, AXConversationMessageRendererStateComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
86
|
-
<div class="ax-conversation-loc">
|
|
87
|
-
<ax-conversation-message-renderer-state [rendererState]="rendererState()" [message]="message()" />
|
|
88
|
-
<div class="ax-conversation-loc__map">
|
|
89
|
-
<ax-map
|
|
90
|
-
[latitude]="latitude()"
|
|
91
|
-
[longitude]="longitude()"
|
|
92
|
-
[zoomLevel]="15"
|
|
93
|
-
[markers]="markers()"
|
|
94
|
-
[hasLocator]="false"
|
|
95
|
-
[hasDraw]="false"
|
|
96
|
-
></ax-map>
|
|
97
|
-
</div>
|
|
98
|
-
<div class="ax-conversation-loc__body">
|
|
99
|
-
<div class="ax-conversation-loc__title">
|
|
100
|
-
<span class="ax-conversation-loc__title-text">{{ locationName() }}</span>
|
|
101
|
-
</div>
|
|
102
|
-
@if (address()) {
|
|
103
|
-
<div class="ax-conversation-loc__addr">{{ address() }}</div>
|
|
104
|
-
}
|
|
105
|
-
<div class="ax-conversation-loc__meta">
|
|
106
|
-
<span class="ax-conversation-loc__coords">{{ coordinatesText() }}</span>
|
|
107
|
-
</div>
|
|
108
|
-
</div>
|
|
109
|
-
<a class="ax-conversation-loc__action" [href]="mapsUrl()" target="_blank" rel="noopener noreferrer">
|
|
110
|
-
<span>Open in Maps</span>
|
|
111
|
-
<i class="fa-light fa-arrow-up-right-from-square" aria-hidden="true"></i>
|
|
112
|
-
</a>
|
|
113
|
-
</div>
|
|
114
|
-
`, styles: [":host{display:block}:host{max-width:100%}.ax-conversation-loc{display:flex;flex-direction:column;width:100%;max-width:min(100%,20rem);border-radius:var(--ax-sys-border-radius, .5rem);border:1px solid rgb(var(--ax-sys-color-border-light-surface));overflow:hidden;background:rgb(var(--ax-sys-color-surface));color:rgb(var(--ax-sys-color-on-surface))}.ax-conversation-loc__map{position:relative;height:min(28dvh,10rem);width:100%;overflow:hidden}@container conversation (min-width: 480px){.ax-conversation-loc__map{height:10.5rem}}.ax-conversation-loc__map ::ng-deep ax-map{display:block;height:100%;width:100%}.ax-conversation-loc__body{padding:.625rem .75rem .5rem;display:flex;flex-direction:column;gap:.25rem}.ax-conversation-loc__title{display:flex;align-items:center;font-size:.875rem;font-weight:600;line-height:1.2}.ax-conversation-loc__title-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ax-conversation-loc__addr{font-size:.75rem;opacity:.78;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ax-conversation-loc__meta{display:flex;align-items:center;gap:.5rem}.ax-conversation-loc__coords{font-size:.6875rem;opacity:.62;font-variant-numeric:tabular-nums;font-family:ui-monospace,monospace}.ax-conversation-loc__action{display:flex;align-items:center;justify-content:space-between;gap:.5rem;min-height:2.75rem;padding:.5rem .75rem;border-top:1px solid rgb(var(--ax-sys-color-border-light-surface));background:rgb(var(--ax-sys-color-light-surface));font-size:.8125rem;font-weight:500;color:rgb(var(--ax-sys-color-primary-600));text-decoration:none;touch-action:manipulation;transition:background .15s ease,color .15s ease}@media(hover:hover){.ax-conversation-loc__action:hover{background:rgb(var(--ax-sys-color-primary-lightest-surface));color:rgb(var(--ax-sys-color-primary-700))}}.ax-conversation-loc__action i{font-size:.75rem;opacity:.85}\n"] }]
|
|
115
|
-
}], propDecorators: { message: [{ type: i0.Input, args: [{ isSignal: true, alias: "message", required: true }] }] } });
|
|
116
|
-
|
|
117
|
-
export { AXConversationLocationRendererComponent };
|
|
118
|
-
//# sourceMappingURL=acorex-components-conversation-location-renderer.component-Cw2PB0LM.mjs.map
|
package/fesm2022/acorex-components-conversation-location-renderer.component-Cw2PB0LM.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-components-conversation-location-renderer.component-Cw2PB0LM.mjs","sources":["../../../../packages/components/conversation/src/lib/plugins/message-list/components/location-renderer/location-renderer.component.ts"],"sourcesContent":["import { AXMapModule } from '@acorex/components/map';\nimport { CommonModule } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, computed, input, signal } from '@angular/core';\nimport type { AXConversationLocationPayload, AXConversationMessage } from '../../../../models';\nimport type { AXConversationMessageRendererContentState } from '../../../../registries/message-renderer.registry';\nimport { AXConversationMessageRendererCopyHostComponent } from '../shared/message-renderer-copy-host.component';\nimport { AXConversationMessageRendererStateComponent } from '../shared/message-renderer-state.component';\n\n@Component({\n selector: 'ax-conversation-location-renderer',\n imports: [CommonModule, AXMapModule, AXConversationMessageRendererStateComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <div class=\"ax-conversation-loc\">\n <ax-conversation-message-renderer-state [rendererState]=\"rendererState()\" [message]=\"message()\" />\n <div class=\"ax-conversation-loc__map\">\n <ax-map\n [latitude]=\"latitude()\"\n [longitude]=\"longitude()\"\n [zoomLevel]=\"15\"\n [markers]=\"markers()\"\n [hasLocator]=\"false\"\n [hasDraw]=\"false\"\n ></ax-map>\n </div>\n <div class=\"ax-conversation-loc__body\">\n <div class=\"ax-conversation-loc__title\">\n <span class=\"ax-conversation-loc__title-text\">{{ locationName() }}</span>\n </div>\n @if (address()) {\n <div class=\"ax-conversation-loc__addr\">{{ address() }}</div>\n }\n <div class=\"ax-conversation-loc__meta\">\n <span class=\"ax-conversation-loc__coords\">{{ coordinatesText() }}</span>\n </div>\n </div>\n <a class=\"ax-conversation-loc__action\" [href]=\"mapsUrl()\" target=\"_blank\" rel=\"noopener noreferrer\">\n <span>Open in Maps</span>\n <i class=\"fa-light fa-arrow-up-right-from-square\" aria-hidden=\"true\"></i>\n </a>\n </div>\n `,\n styles: [\n `\n :host {\n display: block;\n }\n\n :host {\n max-width: 100%;\n }\n\n .ax-conversation-loc {\n display: flex;\n flex-direction: column;\n width: 100%;\n max-width: min(100%, 20rem);\n border-radius: var(--ax-sys-border-radius, 0.5rem);\n border: 1px solid rgb(var(--ax-sys-color-border-light-surface));\n overflow: hidden;\n background: rgb(var(--ax-sys-color-surface));\n color: rgb(var(--ax-sys-color-on-surface));\n }\n\n .ax-conversation-loc__map {\n position: relative;\n height: min(28dvh, 10rem);\n width: 100%;\n overflow: hidden;\n }\n\n @container conversation (min-width: 480px) {\n .ax-conversation-loc__map {\n height: 10.5rem;\n }\n }\n\n .ax-conversation-loc__map ::ng-deep ax-map {\n display: block;\n height: 100%;\n width: 100%;\n }\n .ax-conversation-loc__body {\n padding: 0.625rem 0.75rem 0.5rem;\n display: flex;\n flex-direction: column;\n gap: 0.25rem;\n }\n\n .ax-conversation-loc__title {\n display: flex;\n align-items: center;\n font-size: 0.875rem;\n font-weight: 600;\n line-height: 1.2;\n }\n\n .ax-conversation-loc__title-text {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .ax-conversation-loc__addr {\n font-size: 0.75rem;\n opacity: 0.78;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .ax-conversation-loc__meta {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n }\n\n .ax-conversation-loc__coords {\n font-size: 0.6875rem;\n opacity: 0.62;\n font-variant-numeric: tabular-nums;\n font-family: ui-monospace, monospace;\n }\n\n .ax-conversation-loc__action {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 0.5rem;\n min-height: 2.75rem;\n padding: 0.5rem 0.75rem;\n border-top: 1px solid rgb(var(--ax-sys-color-border-light-surface));\n background: rgb(var(--ax-sys-color-light-surface));\n font-size: 0.8125rem;\n font-weight: 500;\n color: rgb(var(--ax-sys-color-primary-600));\n text-decoration: none;\n touch-action: manipulation;\n transition:\n background 0.15s ease,\n color 0.15s ease;\n }\n\n @media (hover: hover) {\n .ax-conversation-loc__action:hover {\n background: rgb(var(--ax-sys-color-primary-lightest-surface));\n color: rgb(var(--ax-sys-color-primary-700));\n }\n }\n\n .ax-conversation-loc__action i {\n font-size: 0.75rem;\n opacity: 0.85;\n }\n `,\n ],\n})\nexport class AXConversationLocationRendererComponent extends AXConversationMessageRendererCopyHostComponent {\n private readonly _contentState = signal<AXConversationMessageRendererContentState>('none');\n\n readonly message = input.required<AXConversationMessage>();\n readonly rendererState = computed(() => ({\n deliveryStatus: this.message().status,\n contentState: this._contentState(),\n }));\n readonly payload = computed(() => this.message().payload as AXConversationLocationPayload);\n\n readonly latitude = computed(() => this.payload().latitude);\n readonly longitude = computed(() => this.payload().longitude);\n readonly locationName = computed(() => this.payload().name || 'Location');\n readonly address = computed(() => this.payload().address);\n\n readonly coordinatesText = computed(() => {\n const lat = this.latitude().toFixed(5);\n const lng = this.longitude().toFixed(5);\n return `${lat}, ${lng}`;\n });\n\n readonly mapsUrl = computed(() => {\n const lat = this.latitude();\n const lng = this.longitude();\n return `https://www.google.com/maps?q=${lat},${lng}`;\n });\n\n copy(): string {\n const name = this.locationName();\n const addr = this.address()?.trim();\n const coords = this.coordinatesText();\n const maps = this.mapsUrl();\n const lines = [addr, coords, maps].filter(Boolean);\n return lines.length ? `${name}\\n${lines.join('\\n')}` : name;\n }\n\n readonly markers = computed(() => [\n {\n latitude: this.latitude(),\n longitude: this.longitude(),\n popup: this.locationName(),\n popupOpen: false,\n popupCloseButton: true,\n },\n ]);\n}\n"],"names":[],"mappings":";;;;;;;;AA6JM,MAAO,uCAAwC,SAAQ,8CAA8C,CAAA;AArJ3G,IAAA,WAAA,GAAA;;AAsJmB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAA4C,MAAM,oFAAC;AAEjF,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAC,QAAQ,6EAAyB;AACjD,QAAA,IAAA,CAAA,aAAa,GAAG,QAAQ,CAAC,OAAO;AACvC,YAAA,cAAc,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,MAAM;AACrC,YAAA,YAAY,EAAE,IAAI,CAAC,aAAa,EAAE;AACnC,SAAA,CAAC,oFAAC;AACM,QAAA,IAAA,CAAA,OAAO,GAAG,QAAQ,CAAC,MAAM,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A,EAAA,QAAA,EAAA,mCAAmC,EAAA,OAAA,EACpC,CAAC,YAAY,EAAE,WAAW,EAAE,2CAA2C,CAAC,EAAA,eAAA,EAChE,uBAAuB,CAAC,MAAM,EAAA,QAAA,EACrC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BT,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,s1DAAA,CAAA,EAAA;;;;;"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
function formatFileSize(bytes) {
|
|
2
|
-
if (bytes < 1024)
|
|
3
|
-
return `${bytes} B`;
|
|
4
|
-
if (bytes < 1024 * 1024)
|
|
5
|
-
return `${(bytes / 1024).toFixed(1)} KB`;
|
|
6
|
-
if (bytes < 1024 * 1024 * 1024)
|
|
7
|
-
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
8
|
-
return `${(bytes / (1024 * 1024 * 1024)).toFixed(1)} GB`;
|
|
9
|
-
}
|
|
10
|
-
function formatDuration(seconds) {
|
|
11
|
-
const mins = Math.floor(seconds / 60);
|
|
12
|
-
const secs = Math.floor(seconds % 60);
|
|
13
|
-
return `${mins}:${secs.toString().padStart(2, '0')}`;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export { formatFileSize as a, formatDuration as f };
|
|
17
|
-
//# sourceMappingURL=acorex-components-conversation-media-formatters-DV3wEEno.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-components-conversation-media-formatters-DV3wEEno.mjs","sources":["../../../../packages/components/conversation/src/lib/plugins/composer/components/shared/media-formatters.ts"],"sourcesContent":["export function formatFileSize(bytes: number): string {\n if (bytes < 1024) return `${bytes} B`;\n if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;\n if (bytes < 1024 * 1024 * 1024) return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;\n return `${(bytes / (1024 * 1024 * 1024)).toFixed(1)} GB`;\n}\n\nexport function formatDuration(seconds: number): string {\n const mins = Math.floor(seconds / 60);\n const secs = Math.floor(seconds % 60);\n return `${mins}:${secs.toString().padStart(2, '0')}`;\n}\n"],"names":[],"mappings":"AAAM,SAAU,cAAc,CAAC,KAAa,EAAA;IAC1C,IAAI,KAAK,GAAG,IAAI;QAAE,OAAO,CAAA,EAAG,KAAK,CAAA,EAAA,CAAI;AACrC,IAAA,IAAI,KAAK,GAAG,IAAI,GAAG,IAAI;AAAE,QAAA,OAAO,CAAA,EAAG,CAAC,KAAK,GAAG,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,CAAA,GAAA,CAAK;AACjE,IAAA,IAAI,KAAK,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI;AAAE,QAAA,OAAO,GAAG,CAAC,KAAK,IAAI,IAAI,GAAG,IAAI,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,KAAK;AACjF,IAAA,OAAO,GAAG,CAAC,KAAK,IAAI,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,KAAK;AAC1D;AAEM,SAAU,cAAc,CAAC,OAAe,EAAA;IAC5C,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC;IACrC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC;AACrC,IAAA,OAAO,CAAA,EAAG,IAAI,CAAA,CAAA,EAAI,IAAI,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE;AACtD;;;;"}
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
import { CommonModule } from '@angular/common';
|
|
2
|
-
import * as i0 from '@angular/core';
|
|
3
|
-
import { input, computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
4
|
-
import { f as formatMediaDuration } from './acorex-components-conversation-format-media-DUD4vA6F.mjs';
|
|
5
|
-
|
|
6
|
-
const AX_CONVERSATION_ICON_BY_TYPE = {
|
|
7
|
-
video: 'fa-light fa-video',
|
|
8
|
-
audio: 'fa-light fa-music',
|
|
9
|
-
voice: 'fa-light fa-microphone',
|
|
10
|
-
};
|
|
11
|
-
class AXConversationMediaPlaybackInfoBarBannerComponent {
|
|
12
|
-
constructor() {
|
|
13
|
-
this.message = input.required(...(ngDevMode ? [{ debugName: "message" }] : /* istanbul ignore next */ []));
|
|
14
|
-
this.title = input('', ...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
15
|
-
this.currentTime = input(0, ...(ngDevMode ? [{ debugName: "currentTime" }] : /* istanbul ignore next */ []));
|
|
16
|
-
this.duration = input(0, ...(ngDevMode ? [{ debugName: "duration" }] : /* istanbul ignore next */ []));
|
|
17
|
-
this.isPlaying = input(false, ...(ngDevMode ? [{ debugName: "isPlaying" }] : /* istanbul ignore next */ []));
|
|
18
|
-
this.onTogglePlay = input(undefined, ...(ngDevMode ? [{ debugName: "onTogglePlay" }] : /* istanbul ignore next */ []));
|
|
19
|
-
this.playbackSpeed = input(1, ...(ngDevMode ? [{ debugName: "playbackSpeed" }] : /* istanbul ignore next */ []));
|
|
20
|
-
this.onCycleSpeed = input(undefined, ...(ngDevMode ? [{ debugName: "onCycleSpeed" }] : /* istanbul ignore next */ []));
|
|
21
|
-
this.showSpeedControl = input(false, ...(ngDevMode ? [{ debugName: "showSpeedControl" }] : /* istanbul ignore next */ []));
|
|
22
|
-
this.iconClass = computed(() => AX_CONVERSATION_ICON_BY_TYPE[this.message().type] ?? 'fa-light fa-circle-play', ...(ngDevMode ? [{ debugName: "iconClass" }] : /* istanbul ignore next */ []));
|
|
23
|
-
this.resolvedTitle = computed(() => this.title()?.trim() || 'Media', ...(ngDevMode ? [{ debugName: "resolvedTitle" }] : /* istanbul ignore next */ []));
|
|
24
|
-
this.progressPercent = computed(() => {
|
|
25
|
-
const dur = this.duration();
|
|
26
|
-
if (dur <= 0) {
|
|
27
|
-
return 0;
|
|
28
|
-
}
|
|
29
|
-
return Math.min((Math.max(0, this.currentTime()) / dur) * 100, 100);
|
|
30
|
-
}, ...(ngDevMode ? [{ debugName: "progressPercent" }] : /* istanbul ignore next */ []));
|
|
31
|
-
this.timeLabel = computed(() => {
|
|
32
|
-
const current = this.currentTime() || 0;
|
|
33
|
-
const dur = this.duration() || 0;
|
|
34
|
-
return `${formatMediaDuration(current)} / ${formatMediaDuration(dur)}`;
|
|
35
|
-
}, ...(ngDevMode ? [{ debugName: "timeLabel" }] : /* istanbul ignore next */ []));
|
|
36
|
-
}
|
|
37
|
-
onTogglePlayClick() {
|
|
38
|
-
this.onTogglePlay()?.();
|
|
39
|
-
}
|
|
40
|
-
onCycleSpeedClick() {
|
|
41
|
-
this.onCycleSpeed()?.();
|
|
42
|
-
}
|
|
43
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXConversationMediaPlaybackInfoBarBannerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
44
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: AXConversationMediaPlaybackInfoBarBannerComponent, isStandalone: true, selector: "ax-conversation-media-playback-info-bar-banner", inputs: { message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: true, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, currentTime: { classPropertyName: "currentTime", publicName: "currentTime", isSignal: true, isRequired: false, transformFunction: null }, duration: { classPropertyName: "duration", publicName: "duration", isSignal: true, isRequired: false, transformFunction: null }, isPlaying: { classPropertyName: "isPlaying", publicName: "isPlaying", isSignal: true, isRequired: false, transformFunction: null }, onTogglePlay: { classPropertyName: "onTogglePlay", publicName: "onTogglePlay", isSignal: true, isRequired: false, transformFunction: null }, playbackSpeed: { classPropertyName: "playbackSpeed", publicName: "playbackSpeed", isSignal: true, isRequired: false, transformFunction: null }, onCycleSpeed: { classPropertyName: "onCycleSpeed", publicName: "onCycleSpeed", isSignal: true, isRequired: false, transformFunction: null }, showSpeedControl: { classPropertyName: "showSpeedControl", publicName: "showSpeedControl", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
45
|
-
<div class="ax-conversation-playback-banner">
|
|
46
|
-
<div class="ax-conversation-playback-banner__row">
|
|
47
|
-
<button
|
|
48
|
-
type="button"
|
|
49
|
-
class="ax-conversation-playback-banner__play"
|
|
50
|
-
(click)="onTogglePlayClick()"
|
|
51
|
-
[attr.aria-label]="isPlaying() ? 'Pause' : 'Play'"
|
|
52
|
-
>
|
|
53
|
-
<i class="fa-solid" [class.fa-pause]="isPlaying()" [class.fa-play]="!isPlaying()"></i>
|
|
54
|
-
</button>
|
|
55
|
-
|
|
56
|
-
<div class="ax-conversation-playback-banner__main">
|
|
57
|
-
<div class="ax-conversation-playback-banner__meta-row">
|
|
58
|
-
<span class="ax-conversation-playback-banner__type-icon" aria-hidden="true">
|
|
59
|
-
<i [class]="iconClass()"></i>
|
|
60
|
-
</span>
|
|
61
|
-
<span class="ax-conversation-playback-banner__title">{{ resolvedTitle() }}</span>
|
|
62
|
-
<span class="ax-conversation-playback-banner__time">{{ timeLabel() }}</span>
|
|
63
|
-
</div>
|
|
64
|
-
<div
|
|
65
|
-
class="ax-conversation-playback-banner__track"
|
|
66
|
-
role="progressbar"
|
|
67
|
-
[attr.aria-valuenow]="progressPercent()"
|
|
68
|
-
aria-valuemin="0"
|
|
69
|
-
aria-valuemax="100"
|
|
70
|
-
[attr.aria-label]="timeLabel()"
|
|
71
|
-
>
|
|
72
|
-
<span class="ax-conversation-playback-banner__fill" [style.width.%]="progressPercent()"></span>
|
|
73
|
-
</div>
|
|
74
|
-
</div>
|
|
75
|
-
|
|
76
|
-
@if (showSpeedControl()) {
|
|
77
|
-
<button
|
|
78
|
-
type="button"
|
|
79
|
-
class="ax-conversation-playback-banner__speed"
|
|
80
|
-
(click)="onCycleSpeedClick()"
|
|
81
|
-
[attr.aria-label]="'Playback speed ' + playbackSpeed() + 'x'"
|
|
82
|
-
>
|
|
83
|
-
{{ playbackSpeed() }}x
|
|
84
|
-
</button>
|
|
85
|
-
}
|
|
86
|
-
</div>
|
|
87
|
-
</div>
|
|
88
|
-
`, isInline: true, styles: [":host{display:block;width:100%;color:rgb(var(--ax-sys-color-on-primary-lightest-surface))}.ax-conversation-playback-banner{width:100%;min-width:0}.ax-conversation-playback-banner__row{display:flex;align-items:center;gap:.625rem;min-width:0}.ax-conversation-playback-banner__play{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:2.25rem;height:2.25rem;padding:0;padding-inline-start:.1rem;border:none;border-radius:50%;background:rgb(var(--ax-sys-color-primary-500));color:rgb(var(--ax-sys-color-on-primary-surface));font-size:.75rem;cursor:pointer;touch-action:manipulation;transition:background-color .15s ease}@media(hover:hover){.ax-conversation-playback-banner__play:hover{background:rgb(var(--ax-sys-color-primary-600))}}.ax-conversation-playback-banner__play:focus-visible{outline:2px solid rgb(var(--ax-sys-color-primary-700));outline-offset:2px}.ax-conversation-playback-banner__main{flex:1;min-width:0;display:flex;flex-direction:column;gap:.375rem}.ax-conversation-playback-banner__meta-row{display:flex;align-items:center;gap:.375rem;min-width:0}.ax-conversation-playback-banner__type-icon{flex-shrink:0;font-size:.8125rem;opacity:.75}.ax-conversation-playback-banner__title{flex:1;min-width:0;font-size:.8125rem;font-weight:600;line-height:1.25;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ax-conversation-playback-banner__time{flex-shrink:0;font-size:.6875rem;font-variant-numeric:tabular-nums;opacity:.8}.ax-conversation-playback-banner__track{position:relative;width:100%;height:3px;border-radius:999px;overflow:hidden;background:rgba(var(--ax-sys-color-primary-500),.2)}.ax-conversation-playback-banner__fill{position:absolute;inset-block:0;inset-inline-start:0;width:0;border-radius:inherit;background:rgb(var(--ax-sys-color-primary-600));transition:width .12s linear}.ax-conversation-playback-banner__speed{flex-shrink:0;min-width:2.5rem;height:1.75rem;padding:0 .375rem;border:1px solid rgba(var(--ax-sys-color-primary-600),.45);border-radius:999px;background:transparent;color:rgb(var(--ax-sys-color-primary-700));font-size:.6875rem;font-weight:600;font-variant-numeric:tabular-nums;cursor:pointer;touch-action:manipulation;transition:background-color .15s ease,border-color .15s ease}@media(hover:hover){.ax-conversation-playback-banner__speed:hover{background:rgba(var(--ax-sys-color-primary-500),.12)}}.ax-conversation-playback-banner__speed:focus-visible{outline:2px solid rgb(var(--ax-sys-color-primary-500));outline-offset:2px}\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: AXConversationMediaPlaybackInfoBarBannerComponent, decorators: [{
|
|
91
|
-
type: Component,
|
|
92
|
-
args: [{ selector: 'ax-conversation-media-playback-info-bar-banner', imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
93
|
-
<div class="ax-conversation-playback-banner">
|
|
94
|
-
<div class="ax-conversation-playback-banner__row">
|
|
95
|
-
<button
|
|
96
|
-
type="button"
|
|
97
|
-
class="ax-conversation-playback-banner__play"
|
|
98
|
-
(click)="onTogglePlayClick()"
|
|
99
|
-
[attr.aria-label]="isPlaying() ? 'Pause' : 'Play'"
|
|
100
|
-
>
|
|
101
|
-
<i class="fa-solid" [class.fa-pause]="isPlaying()" [class.fa-play]="!isPlaying()"></i>
|
|
102
|
-
</button>
|
|
103
|
-
|
|
104
|
-
<div class="ax-conversation-playback-banner__main">
|
|
105
|
-
<div class="ax-conversation-playback-banner__meta-row">
|
|
106
|
-
<span class="ax-conversation-playback-banner__type-icon" aria-hidden="true">
|
|
107
|
-
<i [class]="iconClass()"></i>
|
|
108
|
-
</span>
|
|
109
|
-
<span class="ax-conversation-playback-banner__title">{{ resolvedTitle() }}</span>
|
|
110
|
-
<span class="ax-conversation-playback-banner__time">{{ timeLabel() }}</span>
|
|
111
|
-
</div>
|
|
112
|
-
<div
|
|
113
|
-
class="ax-conversation-playback-banner__track"
|
|
114
|
-
role="progressbar"
|
|
115
|
-
[attr.aria-valuenow]="progressPercent()"
|
|
116
|
-
aria-valuemin="0"
|
|
117
|
-
aria-valuemax="100"
|
|
118
|
-
[attr.aria-label]="timeLabel()"
|
|
119
|
-
>
|
|
120
|
-
<span class="ax-conversation-playback-banner__fill" [style.width.%]="progressPercent()"></span>
|
|
121
|
-
</div>
|
|
122
|
-
</div>
|
|
123
|
-
|
|
124
|
-
@if (showSpeedControl()) {
|
|
125
|
-
<button
|
|
126
|
-
type="button"
|
|
127
|
-
class="ax-conversation-playback-banner__speed"
|
|
128
|
-
(click)="onCycleSpeedClick()"
|
|
129
|
-
[attr.aria-label]="'Playback speed ' + playbackSpeed() + 'x'"
|
|
130
|
-
>
|
|
131
|
-
{{ playbackSpeed() }}x
|
|
132
|
-
</button>
|
|
133
|
-
}
|
|
134
|
-
</div>
|
|
135
|
-
</div>
|
|
136
|
-
`, styles: [":host{display:block;width:100%;color:rgb(var(--ax-sys-color-on-primary-lightest-surface))}.ax-conversation-playback-banner{width:100%;min-width:0}.ax-conversation-playback-banner__row{display:flex;align-items:center;gap:.625rem;min-width:0}.ax-conversation-playback-banner__play{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:2.25rem;height:2.25rem;padding:0;padding-inline-start:.1rem;border:none;border-radius:50%;background:rgb(var(--ax-sys-color-primary-500));color:rgb(var(--ax-sys-color-on-primary-surface));font-size:.75rem;cursor:pointer;touch-action:manipulation;transition:background-color .15s ease}@media(hover:hover){.ax-conversation-playback-banner__play:hover{background:rgb(var(--ax-sys-color-primary-600))}}.ax-conversation-playback-banner__play:focus-visible{outline:2px solid rgb(var(--ax-sys-color-primary-700));outline-offset:2px}.ax-conversation-playback-banner__main{flex:1;min-width:0;display:flex;flex-direction:column;gap:.375rem}.ax-conversation-playback-banner__meta-row{display:flex;align-items:center;gap:.375rem;min-width:0}.ax-conversation-playback-banner__type-icon{flex-shrink:0;font-size:.8125rem;opacity:.75}.ax-conversation-playback-banner__title{flex:1;min-width:0;font-size:.8125rem;font-weight:600;line-height:1.25;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ax-conversation-playback-banner__time{flex-shrink:0;font-size:.6875rem;font-variant-numeric:tabular-nums;opacity:.8}.ax-conversation-playback-banner__track{position:relative;width:100%;height:3px;border-radius:999px;overflow:hidden;background:rgba(var(--ax-sys-color-primary-500),.2)}.ax-conversation-playback-banner__fill{position:absolute;inset-block:0;inset-inline-start:0;width:0;border-radius:inherit;background:rgb(var(--ax-sys-color-primary-600));transition:width .12s linear}.ax-conversation-playback-banner__speed{flex-shrink:0;min-width:2.5rem;height:1.75rem;padding:0 .375rem;border:1px solid rgba(var(--ax-sys-color-primary-600),.45);border-radius:999px;background:transparent;color:rgb(var(--ax-sys-color-primary-700));font-size:.6875rem;font-weight:600;font-variant-numeric:tabular-nums;cursor:pointer;touch-action:manipulation;transition:background-color .15s ease,border-color .15s ease}@media(hover:hover){.ax-conversation-playback-banner__speed:hover{background:rgba(var(--ax-sys-color-primary-500),.12)}}.ax-conversation-playback-banner__speed:focus-visible{outline:2px solid rgb(var(--ax-sys-color-primary-500));outline-offset:2px}\n"] }]
|
|
137
|
-
}], propDecorators: { message: [{ type: i0.Input, args: [{ isSignal: true, alias: "message", required: true }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], currentTime: [{ type: i0.Input, args: [{ isSignal: true, alias: "currentTime", required: false }] }], duration: [{ type: i0.Input, args: [{ isSignal: true, alias: "duration", required: false }] }], isPlaying: [{ type: i0.Input, args: [{ isSignal: true, alias: "isPlaying", required: false }] }], onTogglePlay: [{ type: i0.Input, args: [{ isSignal: true, alias: "onTogglePlay", required: false }] }], playbackSpeed: [{ type: i0.Input, args: [{ isSignal: true, alias: "playbackSpeed", required: false }] }], onCycleSpeed: [{ type: i0.Input, args: [{ isSignal: true, alias: "onCycleSpeed", required: false }] }], showSpeedControl: [{ type: i0.Input, args: [{ isSignal: true, alias: "showSpeedControl", required: false }] }] } });
|
|
138
|
-
|
|
139
|
-
export { AXConversationMediaPlaybackInfoBarBannerComponent };
|
|
140
|
-
//# sourceMappingURL=acorex-components-conversation-media-playback-info-bar-banner.component-DbWUl6M2.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-components-conversation-media-playback-info-bar-banner.component-DbWUl6M2.mjs","sources":["../../../../packages/components/conversation/src/lib/plugins/message-list/components/shared/media-playback-info-bar-banner.component.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';\nimport type { AXConversationMessage } from '../../../../models';\nimport type { AXConversationMessageInfoBarBannerComponent } from '../../../../registries/message-renderer.registry';\nimport { formatMediaDuration } from './format-media';\n\nexport interface AXConversationPlaybackBannerInputs {\n title?: string;\n currentTime?: number;\n duration?: number;\n isPlaying?: boolean;\n onTogglePlay?: () => void;\n onClose?: () => void;\n playbackSpeed?: number;\n onCycleSpeed?: () => void;\n showSpeedControl?: boolean;\n}\n\nconst AX_CONVERSATION_ICON_BY_TYPE: Record<string, string> = {\n video: 'fa-light fa-video',\n audio: 'fa-light fa-music',\n voice: 'fa-light fa-microphone',\n};\n\n@Component({\n selector: 'ax-conversation-media-playback-info-bar-banner',\n imports: [CommonModule],\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <div class=\"ax-conversation-playback-banner\">\n <div class=\"ax-conversation-playback-banner__row\">\n <button\n type=\"button\"\n class=\"ax-conversation-playback-banner__play\"\n (click)=\"onTogglePlayClick()\"\n [attr.aria-label]=\"isPlaying() ? 'Pause' : 'Play'\"\n >\n <i class=\"fa-solid\" [class.fa-pause]=\"isPlaying()\" [class.fa-play]=\"!isPlaying()\"></i>\n </button>\n\n <div class=\"ax-conversation-playback-banner__main\">\n <div class=\"ax-conversation-playback-banner__meta-row\">\n <span class=\"ax-conversation-playback-banner__type-icon\" aria-hidden=\"true\">\n <i [class]=\"iconClass()\"></i>\n </span>\n <span class=\"ax-conversation-playback-banner__title\">{{ resolvedTitle() }}</span>\n <span class=\"ax-conversation-playback-banner__time\">{{ timeLabel() }}</span>\n </div>\n <div\n class=\"ax-conversation-playback-banner__track\"\n role=\"progressbar\"\n [attr.aria-valuenow]=\"progressPercent()\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n [attr.aria-label]=\"timeLabel()\"\n >\n <span class=\"ax-conversation-playback-banner__fill\" [style.width.%]=\"progressPercent()\"></span>\n </div>\n </div>\n\n @if (showSpeedControl()) {\n <button\n type=\"button\"\n class=\"ax-conversation-playback-banner__speed\"\n (click)=\"onCycleSpeedClick()\"\n [attr.aria-label]=\"'Playback speed ' + playbackSpeed() + 'x'\"\n >\n {{ playbackSpeed() }}x\n </button>\n }\n </div>\n </div>\n `,\n styles: [\n `\n :host {\n display: block;\n width: 100%;\n color: rgb(var(--ax-sys-color-on-primary-lightest-surface));\n }\n\n .ax-conversation-playback-banner {\n width: 100%;\n min-width: 0;\n }\n\n .ax-conversation-playback-banner__row {\n display: flex;\n align-items: center;\n gap: 0.625rem;\n min-width: 0;\n }\n\n .ax-conversation-playback-banner__play {\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 2.25rem;\n height: 2.25rem;\n padding: 0;\n padding-inline-start: 0.1rem;\n border: none;\n border-radius: 50%;\n background: rgb(var(--ax-sys-color-primary-500));\n color: rgb(var(--ax-sys-color-on-primary-surface));\n font-size: 0.75rem;\n cursor: pointer;\n touch-action: manipulation;\n transition: background-color 0.15s ease;\n }\n\n @media (hover: hover) {\n .ax-conversation-playback-banner__play:hover {\n background: rgb(var(--ax-sys-color-primary-600));\n }\n }\n\n .ax-conversation-playback-banner__play:focus-visible {\n outline: 2px solid rgb(var(--ax-sys-color-primary-700));\n outline-offset: 2px;\n }\n\n .ax-conversation-playback-banner__main {\n flex: 1;\n min-width: 0;\n display: flex;\n flex-direction: column;\n gap: 0.375rem;\n }\n\n .ax-conversation-playback-banner__meta-row {\n display: flex;\n align-items: center;\n gap: 0.375rem;\n min-width: 0;\n }\n\n .ax-conversation-playback-banner__type-icon {\n flex-shrink: 0;\n font-size: 0.8125rem;\n opacity: 0.75;\n }\n\n .ax-conversation-playback-banner__title {\n flex: 1;\n min-width: 0;\n font-size: 0.8125rem;\n font-weight: 600;\n line-height: 1.25;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .ax-conversation-playback-banner__time {\n flex-shrink: 0;\n font-size: 0.6875rem;\n font-variant-numeric: tabular-nums;\n opacity: 0.8;\n }\n\n .ax-conversation-playback-banner__track {\n position: relative;\n width: 100%;\n height: 3px;\n border-radius: 999px;\n overflow: hidden;\n background: rgba(var(--ax-sys-color-primary-500), 0.2);\n }\n\n .ax-conversation-playback-banner__fill {\n position: absolute;\n inset-block: 0;\n inset-inline-start: 0;\n width: 0;\n border-radius: inherit;\n background: rgb(var(--ax-sys-color-primary-600));\n transition: width 0.12s linear;\n }\n\n .ax-conversation-playback-banner__speed {\n flex-shrink: 0;\n min-width: 2.5rem;\n height: 1.75rem;\n padding: 0 0.375rem;\n border: 1px solid rgba(var(--ax-sys-color-primary-600), 0.45);\n border-radius: 999px;\n background: transparent;\n color: rgb(var(--ax-sys-color-primary-700));\n font-size: 0.6875rem;\n font-weight: 600;\n font-variant-numeric: tabular-nums;\n cursor: pointer;\n touch-action: manipulation;\n transition:\n background-color 0.15s ease,\n border-color 0.15s ease;\n }\n\n @media (hover: hover) {\n .ax-conversation-playback-banner__speed:hover {\n background: rgba(var(--ax-sys-color-primary-500), 0.12);\n }\n }\n\n .ax-conversation-playback-banner__speed:focus-visible {\n outline: 2px solid rgb(var(--ax-sys-color-primary-500));\n outline-offset: 2px;\n }\n `,\n ],\n})\nexport class AXConversationMediaPlaybackInfoBarBannerComponent implements AXConversationMessageInfoBarBannerComponent {\n readonly message = input.required<AXConversationMessage>();\n readonly title = input<string>('');\n readonly currentTime = input<number>(0);\n readonly duration = input<number>(0);\n readonly isPlaying = input<boolean>(false);\n readonly onTogglePlay = input<(() => void) | undefined>(undefined);\n readonly playbackSpeed = input<number>(1);\n readonly onCycleSpeed = input<(() => void) | undefined>(undefined);\n readonly showSpeedControl = input<boolean>(false);\n\n readonly iconClass = computed(() => AX_CONVERSATION_ICON_BY_TYPE[this.message().type] ?? 'fa-light fa-circle-play');\n\n readonly resolvedTitle = computed(() => this.title()?.trim() || 'Media');\n\n readonly progressPercent = computed(() => {\n const dur = this.duration();\n if (dur <= 0) {\n return 0;\n }\n return Math.min((Math.max(0, this.currentTime()) / dur) * 100, 100);\n });\n\n readonly timeLabel = computed(() => {\n const current = this.currentTime() || 0;\n const dur = this.duration() || 0;\n return `${formatMediaDuration(current)} / ${formatMediaDuration(dur)}`;\n });\n\n onTogglePlayClick(): void {\n this.onTogglePlay()?.();\n }\n\n onCycleSpeedClick(): void {\n this.onCycleSpeed()?.();\n }\n}\n"],"names":[],"mappings":";;;;;AAkBA,MAAM,4BAA4B,GAA2B;AAC3D,IAAA,KAAK,EAAE,mBAAmB;AAC1B,IAAA,KAAK,EAAE,mBAAmB;AAC1B,IAAA,KAAK,EAAE,wBAAwB;CAChC;MA+LY,iDAAiD,CAAA;AA7L9D,IAAA,WAAA,GAAA;AA8LW,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAC,QAAQ,6EAAyB;AACjD,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,CAAS,EAAE,4EAAC;AACzB,QAAA,IAAA,CAAA,WAAW,GAAG,KAAK,CAAS,CAAC,kFAAC;AAC9B,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAS,CAAC,+EAAC;AAC3B,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK,CAAU,KAAK,gFAAC;AACjC,QAAA,IAAA,CAAA,YAAY,GAAG,KAAK,CAA2B,SAAS,mFAAC;AACzD,QAAA,IAAA,CAAA,aAAa,GAAG,KAAK,CAAS,CAAC,oF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AAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,YAAA,EAAA,EAAA,iBAAA,EAAA,cAAA,EAAA,UAAA,EAAA,cAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,gBAAA,EAAA,EAAA,iBAAA,EAAA,kBAAA,EAAA,UAAA,EAAA,kBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAzLlD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,i8EAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EA9CS,YAAY,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FA2LX,iDAAiD,EAAA,UAAA,EAAA,CAAA;kBA7L7D,SAAS;+BACE,gDAAgD,EAAA,OAAA,EACjD,CAAC,YAAY,CAAC,mBACN,uBAAuB,CAAC,MAAM,EAAA,QAAA,EACrC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CT,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,i8EAAA,CAAA,EAAA;;;;;"}
|
package/fesm2022/acorex-components-conversation-message-renderer-copy-host.component-oXTr_Lfq.mjs
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { inject, effect } from '@angular/core';
|
|
2
|
-
import { z as AXConversationMessageListService } from './acorex-components-conversation-acorex-components-conversation-YhVa42TC.mjs';
|
|
3
|
-
|
|
4
|
-
/** Caption first, else a label with optional extra lines (URLs, names). */
|
|
5
|
-
function mediaCopyText(caption, singleLabel, pluralLabel, count, lines) {
|
|
6
|
-
const trimmedCaption = caption?.trim();
|
|
7
|
-
if (trimmedCaption) {
|
|
8
|
-
return trimmedCaption;
|
|
9
|
-
}
|
|
10
|
-
const header = count > 1 ? `${count} ${pluralLabel}` : singleLabel;
|
|
11
|
-
const extras = lines.map((line) => line?.trim()).filter((line) => !!line);
|
|
12
|
-
return extras.length ? `${header}\n${extras.join('\n')}` : header;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Registers the live renderer on {@link AXConversationMessageListService} for message actions.
|
|
16
|
-
*/
|
|
17
|
-
class AXConversationMessageRendererCopyHostComponent {
|
|
18
|
-
constructor() {
|
|
19
|
-
this.messageList = inject(AXConversationMessageListService, { optional: true });
|
|
20
|
-
effect((onCleanup) => {
|
|
21
|
-
const list = this.messageList;
|
|
22
|
-
if (!list) {
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
const id = this.message().id;
|
|
26
|
-
list.registerRendererInstance(id, this);
|
|
27
|
-
onCleanup(() => list.unregisterRendererInstance(id));
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export { AXConversationMessageRendererCopyHostComponent as A, mediaCopyText as m };
|
|
33
|
-
//# sourceMappingURL=acorex-components-conversation-message-renderer-copy-host.component-oXTr_Lfq.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-components-conversation-message-renderer-copy-host.component-oXTr_Lfq.mjs","sources":["../../../../packages/components/conversation/src/lib/plugins/message-list/components/shared/message-renderer-copy-host.component.ts"],"sourcesContent":["import { effect, inject, type InputSignal, type Signal } from '@angular/core';\nimport { AXConversationMessageListService } from '../../../../components/message-list/message-list.service';\nimport type { AXConversationMessage } from '../../../../models';\nimport type {\n AXConversationMessageRendererComponent,\n AXConversationMessageRendererState,\n} from '../../../../registries/message-renderer.registry';\n\n/** Caption first, else a label with optional extra lines (URLs, names). */\nexport function mediaCopyText(\n caption: string | undefined,\n singleLabel: string,\n pluralLabel: string,\n count: number,\n lines: (string | undefined)[],\n): string {\n const trimmedCaption = caption?.trim();\n if (trimmedCaption) {\n return trimmedCaption;\n }\n const header = count > 1 ? `${count} ${pluralLabel}` : singleLabel;\n const extras = lines.map((line) => line?.trim()).filter((line): line is string => !!line);\n return extras.length ? `${header}\\n${extras.join('\\n')}` : header;\n}\n\n/**\n * Registers the live renderer on {@link AXConversationMessageListService} for message actions.\n */\nexport abstract class AXConversationMessageRendererCopyHostComponent implements AXConversationMessageRendererComponent {\n abstract readonly message: InputSignal<AXConversationMessage>;\n abstract readonly rendererState: Signal<AXConversationMessageRendererState>;\n abstract copy(): string | Promise<string>;\n\n private readonly messageList = inject(AXConversationMessageListService, { optional: true });\n\n constructor() {\n effect((onCleanup) => {\n const list = this.messageList;\n if (!list) {\n return;\n }\n const id = this.message().id;\n list.registerRendererInstance(id, this);\n onCleanup(() => list.unregisterRendererInstance(id));\n });\n }\n}\n"],"names":[],"mappings":";;;AAQA;AACM,SAAU,aAAa,CAC3B,OAA2B,EAC3B,WAAmB,EACnB,WAAmB,EACnB,KAAa,EACb,KAA6B,EAAA;AAE7B,IAAA,MAAM,cAAc,GAAG,OAAO,EAAE,IAAI,EAAE;IACtC,IAAI,cAAc,EAAE;AAClB,QAAA,OAAO,cAAc;IACvB;AACA,IAAA,MAAM,MAAM,GAAG,KAAK,GAAG,CAAC,GAAG,CAAA,EAAG,KAAK,IAAI,WAAW,CAAA,CAAE,GAAG,WAAW;AAClE,IAAA,MAAM,MAAM,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,KAAqB,CAAC,CAAC,IAAI,CAAC;IACzF,OAAO,MAAM,CAAC,MAAM,GAAG,CAAA,EAAG,MAAM,CAAA,EAAA,EAAK,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA,CAAE,GAAG,MAAM;AACnE;AAEA;;AAEG;MACmB,8CAA8C,CAAA;AAOlE,IAAA,WAAA,GAAA;QAFiB,IAAA,CAAA,WAAW,GAAG,MAAM,CAAC,gCAAgC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAGzF,QAAA,MAAM,CAAC,CAAC,SAAS,KAAI;AACnB,YAAA,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW;YAC7B,IAAI,CAAC,IAAI,EAAE;gBACT;YACF;YACA,MAAM,EAAE,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC,EAAE;AAC5B,YAAA,IAAI,CAAC,wBAAwB,CAAC,EAAE,EAAE,IAAI,CAAC;YACvC,SAAS,CAAC,MAAM,IAAI,CAAC,0BAA0B,CAAC,EAAE,CAAC,CAAC;AACtD,QAAA,CAAC,CAAC;IACJ;AACD;;;;"}
|