@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
package/fesm2022/acorex-components-conversation-conversation-image.file-type-C02OzZZB.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-components-conversation-conversation-image.file-type-C02OzZZB.mjs","sources":["../../../../packages/components/conversation/src/lib/plugins/composer/components/image-picker/conversation-image.file-type.ts"],"sourcesContent":["import type { AXFileCopyData, AXFileType } from '@acorex/core/file';\nimport { AXFileTypeInfoProvider, createFileTypeMetadata } from '@acorex/core/file';\nimport { isPlatformBrowser } from '@angular/common';\nimport { Injectable } from '@angular/core';\nimport type { AXConversationImagePayload } from '../../../../models';\nimport { AX_CONVERSATION_IMAGE_CATALOG } from '../../../../models/message-file-type-catalog';\nimport { normalizeImagePayload } from '../../../message-list/components/image-renderer/image.payload';\nimport { formatFileSize } from '../shared/media-formatters';\n\nexport { AX_CONVERSATION_IMAGE_CATALOG };\n\nconst MB = 1024 * 1024;\n\nexport const AX_CONVERSATION_IMAGE_PRESENTATION = {\n icon: 'fa-light fa-image text-purple-500',\n title: 'Image',\n} as const;\n\ntype AXConversationFileTypeUtilityContext = {\n readAsDataUrl: (file: File | Blob) => Promise<string>;\n platformId: object;\n};\n\nconst AX_CONVERSATION_IMAGE_UTILITY = {\n preview: 'preview',\n formatSize: 'formatSize',\n createLocalPreviewUrl: 'createLocalPreviewUrl',\n} as const;\n\nfunction blobUrl(ctx: AXConversationFileTypeUtilityContext, blob: Blob): string {\n if (!isPlatformBrowser(ctx.platformId)) {\n return '';\n }\n return URL.createObjectURL(blob);\n}\n\nexport function conversationImageUtilities(): NonNullable<AXFileType['utilities']> {\n return {\n [AX_CONVERSATION_IMAGE_UTILITY.preview]: (ctx, file) =>\n (ctx as AXConversationFileTypeUtilityContext).readAsDataUrl(file as File),\n [AX_CONVERSATION_IMAGE_UTILITY.formatSize]: (_ctx, bytes) => formatFileSize(bytes as number),\n [AX_CONVERSATION_IMAGE_UTILITY.createLocalPreviewUrl]: (ctx, source) => {\n const blob = source as File | Blob;\n if (blob.type.startsWith('image/')) {\n return (ctx as AXConversationFileTypeUtilityContext).readAsDataUrl(blob);\n }\n return blobUrl(ctx as AXConversationFileTypeUtilityContext, blob);\n },\n };\n}\n\nexport function createConversationImageFileType(): AXFileType {\n const presentation = AX_CONVERSATION_IMAGE_PRESENTATION;\n return {\n name: AX_CONVERSATION_IMAGE_CATALOG,\n metadata: createFileTypeMetadata('conversation'),\n title: presentation.title,\n icon: presentation.icon,\n validations: {\n mimeTypes: ['image/*'],\n minSize: 1,\n maxSize: 100 * MB,\n },\n extensions: [\n { name: 'jpg', title: 'JPEG' },\n { name: 'jpeg', title: 'JPEG', validations: { maxSize: 5 * MB } },\n { name: 'png', title: 'PNG' },\n { name: 'gif', title: 'GIF' },\n { name: 'webp', title: 'WebP' },\n { name: 'svg', title: 'SVG', validations: { maxSize: 2 * MB } },\n ],\n utilities: conversationImageUtilities(),\n copy: (payload): AXFileCopyData => {\n const image = normalizeImagePayload(payload as AXConversationImagePayload);\n const caption = image.caption?.trim();\n const urls = image.images\n .map((item) => item.url?.trim() || item.thumbnailUrl?.trim())\n .filter((url): url is string => !!url);\n return {\n text: caption ?? '',\n meta: { kind: 'image', caption, urls, count: image.images.length },\n };\n },\n };\n}\n\n@Injectable({ providedIn: 'root' })\nexport class AXConversationImageFileTypeProvider extends AXFileTypeInfoProvider {\n items() {\n return Promise.resolve([createConversationImageFileType()]);\n }\n}\n"],"names":[],"mappings":";;;;;;;AAWA,MAAM,EAAE,GAAG,IAAI,GAAG,IAAI;AAEf,MAAM,kCAAkC,GAAG;AAChD,IAAA,IAAI,EAAE,mCAAmC;AACzC,IAAA,KAAK,EAAE,OAAO;;AAQhB,MAAM,6BAA6B,GAAG;AACpC,IAAA,OAAO,EAAE,SAAS;AAClB,IAAA,UAAU,EAAE,YAAY;AACxB,IAAA,qBAAqB,EAAE,uBAAuB;CACtC;AAEV,SAAS,OAAO,CAAC,GAAyC,EAAE,IAAU,EAAA;IACpE,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE;AACtC,QAAA,OAAO,EAAE;IACX;AACA,IAAA,OAAO,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC;AAClC;SAEgB,0BAA0B,GAAA;IACxC,OAAO;AACL,QAAA,CAAC,6BA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A,CAAA,CAAA;;2FACnB,mCAAmC,EAAA,UAAA,EAAA,CAAA;kBAD/C,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;;;"}
|
package/fesm2022/acorex-components-conversation-conversation-info-media-view.component-Mhk7JE6K.mjs
DELETED
|
@@ -1,238 +0,0 @@
|
|
|
1
|
-
import { AXDecoratorModule } from '@acorex/components/decorators';
|
|
2
|
-
import * as i3 from '@acorex/core/translation';
|
|
3
|
-
import { AXTranslationService, AXTranslationModule } from '@acorex/core/translation';
|
|
4
|
-
import * as i2 from '@angular/common';
|
|
5
|
-
import { CommonModule } from '@angular/common';
|
|
6
|
-
import * as i0 from '@angular/core';
|
|
7
|
-
import { inject, Injector, input, output, computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
8
|
-
import { A as AXConversationService, h as AXConversationRegistryComponentOutletComponent } from './acorex-components-conversation-acorex-components-conversation-YhVa42TC.mjs';
|
|
9
|
-
import { A as AXConversationAudioAttachmentComponent } from './acorex-components-conversation-audio-attachment.component-CLvS3W8F.mjs';
|
|
10
|
-
import { A as AXConversationImageAttachmentComponent } from './acorex-components-conversation-image-attachment.component-CLMGxXPl.mjs';
|
|
11
|
-
import { A as AXConversationVideoAttachmentComponent } from './acorex-components-conversation-video-attachment.component-CGaUhnSb.mjs';
|
|
12
|
-
import { f as filterMessagesByMediaCategory, i as isGridMediaCategory, a as isAttachmentListCategory, b as buildMediaGalleryTiles, g as getMessageVideoItems, c as getMessageAudioItems } from './acorex-components-conversation-conversation-info-panel.component-CNaM5ajR.mjs';
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Shared media browser inside the conversation info panel.
|
|
16
|
-
*/
|
|
17
|
-
class AXConversationInfoMediaViewComponent {
|
|
18
|
-
constructor() {
|
|
19
|
-
this.translation = inject(AXTranslationService);
|
|
20
|
-
this.parentInjector = inject(Injector);
|
|
21
|
-
this.category = input.required(...(ngDevMode ? [{ debugName: "category" }] : /* istanbul ignore next */ []));
|
|
22
|
-
this.messages = input.required(...(ngDevMode ? [{ debugName: "messages" }] : /* istanbul ignore next */ []));
|
|
23
|
-
this.conversation = input.required(...(ngDevMode ? [{ debugName: "conversation" }] : /* istanbul ignore next */ []));
|
|
24
|
-
this.conversationServiceInput = input.required({ ...(ngDevMode ? { debugName: "conversationServiceInput" } : /* istanbul ignore next */ {}), alias: 'conversationService' });
|
|
25
|
-
/** Callback for lazy outlet wiring (alternative to the `back` output). */
|
|
26
|
-
this.onBack = input(undefined, ...(ngDevMode ? [{ debugName: "onBack" }] : /* istanbul ignore next */ []));
|
|
27
|
-
this.back = output();
|
|
28
|
-
this.items = computed(() => filterMessagesByMediaCategory(this.messages(), this.category().id), ...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
29
|
-
this.isGrid = computed(() => isGridMediaCategory(this.category().id), ...(ngDevMode ? [{ debugName: "isGrid" }] : /* istanbul ignore next */ []));
|
|
30
|
-
this.isAttachmentList = computed(() => isAttachmentListCategory(this.category().id), ...(ngDevMode ? [{ debugName: "isAttachmentList" }] : /* istanbul ignore next */ []));
|
|
31
|
-
this.galleryTiles = computed(() => buildMediaGalleryTiles(this.messages(), this.category().id), ...(ngDevMode ? [{ debugName: "galleryTiles" }] : /* istanbul ignore next */ []));
|
|
32
|
-
this.rendererInjector = computed(() => Injector.create({
|
|
33
|
-
providers: [{ provide: AXConversationService, useValue: this.conversationServiceInput() }],
|
|
34
|
-
parent: this.parentInjector,
|
|
35
|
-
}), ...(ngDevMode ? [{ debugName: "rendererInjector" }] : /* istanbul ignore next */ []));
|
|
36
|
-
this.titleLabel = computed(() => this.translation.translateSync(this.category().countLabelKey, {
|
|
37
|
-
params: { count: this.category().count },
|
|
38
|
-
}), ...(ngDevMode ? [{ debugName: "titleLabel" }] : /* istanbul ignore next */ []));
|
|
39
|
-
this.getMessageVideoItems = getMessageVideoItems;
|
|
40
|
-
this.getMessageAudioItems = getMessageAudioItems;
|
|
41
|
-
}
|
|
42
|
-
getRendererComponent(message) {
|
|
43
|
-
const renderer = this.conversationServiceInput().registry.messageRenderers.getRenderer(message);
|
|
44
|
-
return renderer?.component;
|
|
45
|
-
}
|
|
46
|
-
getRendererComponentLoader(message) {
|
|
47
|
-
const renderer = this.conversationServiceInput().registry.messageRenderers.getRenderer(message);
|
|
48
|
-
if (renderer?.componentLoader) {
|
|
49
|
-
return renderer.componentLoader;
|
|
50
|
-
}
|
|
51
|
-
if (!renderer?.component) {
|
|
52
|
-
return () => import('./acorex-components-conversation-fallback-renderer.component-CYh_6O6j.mjs').then((m) => m.AXConversationFallbackRendererComponent);
|
|
53
|
-
}
|
|
54
|
-
return undefined;
|
|
55
|
-
}
|
|
56
|
-
getRendererInputs(message) {
|
|
57
|
-
return { message };
|
|
58
|
-
}
|
|
59
|
-
formatTimestamp(message) {
|
|
60
|
-
return new Intl.DateTimeFormat(undefined, {
|
|
61
|
-
dateStyle: 'medium',
|
|
62
|
-
timeStyle: 'short',
|
|
63
|
-
}).format(message.timestamp);
|
|
64
|
-
}
|
|
65
|
-
handleBack() {
|
|
66
|
-
this.onBack()?.();
|
|
67
|
-
this.back.emit();
|
|
68
|
-
}
|
|
69
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXConversationInfoMediaViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
70
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: AXConversationInfoMediaViewComponent, isStandalone: true, selector: "ax-conversation-info-media-view", inputs: { category: { classPropertyName: "category", publicName: "category", isSignal: true, isRequired: true, transformFunction: null }, messages: { classPropertyName: "messages", publicName: "messages", isSignal: true, isRequired: true, transformFunction: null }, conversation: { classPropertyName: "conversation", publicName: "conversation", isSignal: true, isRequired: true, transformFunction: null }, conversationServiceInput: { classPropertyName: "conversationServiceInput", publicName: "conversationService", isSignal: true, isRequired: true, transformFunction: null }, onBack: { classPropertyName: "onBack", publicName: "onBack", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { back: "back" }, ngImport: i0, template: `
|
|
71
|
-
<div class="tg-media-view">
|
|
72
|
-
<header class="tg-media-view__header">
|
|
73
|
-
<button type="button" class="tg-media-view__back" (click)="handleBack()" [attr.aria-label]="'Back'">
|
|
74
|
-
<i class="fa-light fa-arrow-left"></i>
|
|
75
|
-
</button>
|
|
76
|
-
<h3 class="tg-media-view__title">{{ titleLabel() }}</h3>
|
|
77
|
-
</header>
|
|
78
|
-
|
|
79
|
-
@if (items().length === 0) {
|
|
80
|
-
<div class="tg-media-view__empty">
|
|
81
|
-
{{ '@acorex:chat.info-panel.media.empty' | translate | async }}
|
|
82
|
-
</div>
|
|
83
|
-
} @else if (isGrid()) {
|
|
84
|
-
<div class="tg-media-view__grid">
|
|
85
|
-
@for (tile of galleryTiles(); track tile.key) {
|
|
86
|
-
<article
|
|
87
|
-
class="tg-media-view__grid-cell"
|
|
88
|
-
[class.tg-media-view__grid-cell--sticker]="tile.kind === 'sticker'"
|
|
89
|
-
>
|
|
90
|
-
@switch (tile.kind) {
|
|
91
|
-
@case ('image') {
|
|
92
|
-
@if (tile.image; as image) {
|
|
93
|
-
<ax-conversation-image-attachment [item]="image" [alt]="'Photo'" />
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
@case ('sticker') {
|
|
97
|
-
@if (tile.stickerUrl) {
|
|
98
|
-
<img
|
|
99
|
-
class="tg-media-view__sticker"
|
|
100
|
-
[src]="tile.stickerUrl"
|
|
101
|
-
[alt]="tile.stickerAlt ?? 'Sticker'"
|
|
102
|
-
loading="lazy"
|
|
103
|
-
/>
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
</article>
|
|
108
|
-
}
|
|
109
|
-
</div>
|
|
110
|
-
} @else if (isAttachmentList()) {
|
|
111
|
-
<div class="tg-media-view__list">
|
|
112
|
-
@for (message of items(); track message.id) {
|
|
113
|
-
<article class="tg-media-view__list-item">
|
|
114
|
-
<div class="tg-media-view__list-body">
|
|
115
|
-
@if (category().id === 'video') {
|
|
116
|
-
@for (video of getMessageVideoItems(message); track video.mediaId ?? video.url) {
|
|
117
|
-
<ax-conversation-video-attachment [item]="video" />
|
|
118
|
-
}
|
|
119
|
-
} @else {
|
|
120
|
-
@for (audio of getMessageAudioItems(message); track audio.mediaId ?? audio.url) {
|
|
121
|
-
<ax-conversation-audio-attachment [item]="audio" />
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
</div>
|
|
125
|
-
<time class="tg-media-view__list-meta">{{ formatTimestamp(message) }}</time>
|
|
126
|
-
</article>
|
|
127
|
-
}
|
|
128
|
-
</div>
|
|
129
|
-
} @else {
|
|
130
|
-
<div class="tg-media-view__list">
|
|
131
|
-
@for (message of items(); track message.id) {
|
|
132
|
-
<article class="tg-media-view__list-item">
|
|
133
|
-
<div class="tg-media-view__list-body">
|
|
134
|
-
<ax-conversation-registry-component-outlet
|
|
135
|
-
[component]="getRendererComponent(message)"
|
|
136
|
-
[componentLoader]="getRendererComponentLoader(message)"
|
|
137
|
-
[inputs]="getRendererInputs(message)"
|
|
138
|
-
/>
|
|
139
|
-
</div>
|
|
140
|
-
<time class="tg-media-view__list-meta">{{ formatTimestamp(message) }}</time>
|
|
141
|
-
</article>
|
|
142
|
-
}
|
|
143
|
-
</div>
|
|
144
|
-
}
|
|
145
|
-
</div>
|
|
146
|
-
`, isInline: true, styles: [":host{display:block;width:100%}.tg-media-view{display:flex;flex-direction:column;min-height:12rem;max-height:min(85vh,40rem)}.tg-media-view__header{display:flex;align-items:center;gap:.5rem;padding:.65rem .75rem;border-bottom:1px solid rgb(var(--ax-sys-color-border-light-surface));flex-shrink:0}.tg-media-view__back{display:inline-flex;align-items:center;justify-content:center;width:2rem;height:2rem;border:none;border-radius:999px;background:transparent;color:rgb(var(--ax-sys-color-primary-500));cursor:pointer}.tg-media-view__back:hover{background:rgb(var(--ax-sys-color-lighter-surface))}.tg-media-view__title{margin:0;font-size:1rem;font-weight:600;color:rgb(var(--ax-sys-color-on-surface))}.tg-media-view__empty{padding:2rem 1rem;text-align:center;font-size:.875rem;color:rgb(var(--ax-sys-color-on-surface));opacity:.65}.tg-media-view__grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:2px;padding:2px;overflow-y:auto;overscroll-behavior:contain;background:rgb(var(--ax-sys-color-border-light-surface))}.tg-media-view__grid-cell{position:relative;aspect-ratio:1;overflow:hidden;background:rgb(var(--ax-sys-color-lighter-surface))}.tg-media-view__grid-cell--sticker{display:flex;align-items:center;justify-content:center;padding:.35rem}.tg-media-view__grid-cell ::ng-deep ax-conversation-image-attachment,.tg-media-view__grid-cell ::ng-deep .ax-conversation-image-attachment{width:100%;height:100%;min-height:0;border-radius:0}.tg-media-view__grid-cell ::ng-deep img{width:100%;height:100%;object-fit:cover}.tg-media-view__sticker{max-width:100%;max-height:100%;object-fit:contain}.tg-media-view__list{display:flex;flex-direction:column;overflow-y:auto;overscroll-behavior:contain}.tg-media-view__list-item{display:flex;flex-direction:column;gap:.35rem;padding:.75rem 1rem;border-bottom:1px solid rgb(var(--ax-sys-color-border-light-surface))}.tg-media-view__list-item:last-child{border-bottom:none}.tg-media-view__list-body{min-width:0;display:flex;flex-direction:column;gap:.5rem}.tg-media-view__list-body ::ng-deep .ax-conversation-msg{max-width:100%}.tg-media-view__list-body ::ng-deep ax-conversation-message-renderer-state{display:none}.tg-media-view__list-body ::ng-deep .ax-conversation-video__player{max-height:min(50vh,16rem)}.tg-media-view__list-meta{font-size:.75rem;color:rgb(var(--ax-sys-color-on-surface));opacity:.55}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: AXConversationRegistryComponentOutletComponent, selector: "ax-conversation-registry-component-outlet", inputs: ["component", "componentLoader", "inputs"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "component", type: AXConversationImageAttachmentComponent, selector: "ax-conversation-image-attachment", inputs: ["item", "alt"] }, { kind: "component", type: AXConversationVideoAttachmentComponent, selector: "ax-conversation-video-attachment", inputs: ["item"], outputs: ["playingChange", "timeUpdate", "durationChange", "playbackEnded", "playbackError"] }, { kind: "component", type: AXConversationAudioAttachmentComponent, selector: "ax-conversation-audio-attachment", inputs: ["item"], outputs: ["playingChange", "timeUpdate", "durationChange", "playbackEnded", "playbackError"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }, { kind: "pipe", type: i3.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
147
|
-
}
|
|
148
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXConversationInfoMediaViewComponent, decorators: [{
|
|
149
|
-
type: Component,
|
|
150
|
-
args: [{ selector: 'ax-conversation-info-media-view', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
151
|
-
CommonModule,
|
|
152
|
-
AXConversationRegistryComponentOutletComponent,
|
|
153
|
-
AXDecoratorModule,
|
|
154
|
-
AXTranslationModule,
|
|
155
|
-
AXConversationImageAttachmentComponent,
|
|
156
|
-
AXConversationVideoAttachmentComponent,
|
|
157
|
-
AXConversationAudioAttachmentComponent,
|
|
158
|
-
], template: `
|
|
159
|
-
<div class="tg-media-view">
|
|
160
|
-
<header class="tg-media-view__header">
|
|
161
|
-
<button type="button" class="tg-media-view__back" (click)="handleBack()" [attr.aria-label]="'Back'">
|
|
162
|
-
<i class="fa-light fa-arrow-left"></i>
|
|
163
|
-
</button>
|
|
164
|
-
<h3 class="tg-media-view__title">{{ titleLabel() }}</h3>
|
|
165
|
-
</header>
|
|
166
|
-
|
|
167
|
-
@if (items().length === 0) {
|
|
168
|
-
<div class="tg-media-view__empty">
|
|
169
|
-
{{ '@acorex:chat.info-panel.media.empty' | translate | async }}
|
|
170
|
-
</div>
|
|
171
|
-
} @else if (isGrid()) {
|
|
172
|
-
<div class="tg-media-view__grid">
|
|
173
|
-
@for (tile of galleryTiles(); track tile.key) {
|
|
174
|
-
<article
|
|
175
|
-
class="tg-media-view__grid-cell"
|
|
176
|
-
[class.tg-media-view__grid-cell--sticker]="tile.kind === 'sticker'"
|
|
177
|
-
>
|
|
178
|
-
@switch (tile.kind) {
|
|
179
|
-
@case ('image') {
|
|
180
|
-
@if (tile.image; as image) {
|
|
181
|
-
<ax-conversation-image-attachment [item]="image" [alt]="'Photo'" />
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
@case ('sticker') {
|
|
185
|
-
@if (tile.stickerUrl) {
|
|
186
|
-
<img
|
|
187
|
-
class="tg-media-view__sticker"
|
|
188
|
-
[src]="tile.stickerUrl"
|
|
189
|
-
[alt]="tile.stickerAlt ?? 'Sticker'"
|
|
190
|
-
loading="lazy"
|
|
191
|
-
/>
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
</article>
|
|
196
|
-
}
|
|
197
|
-
</div>
|
|
198
|
-
} @else if (isAttachmentList()) {
|
|
199
|
-
<div class="tg-media-view__list">
|
|
200
|
-
@for (message of items(); track message.id) {
|
|
201
|
-
<article class="tg-media-view__list-item">
|
|
202
|
-
<div class="tg-media-view__list-body">
|
|
203
|
-
@if (category().id === 'video') {
|
|
204
|
-
@for (video of getMessageVideoItems(message); track video.mediaId ?? video.url) {
|
|
205
|
-
<ax-conversation-video-attachment [item]="video" />
|
|
206
|
-
}
|
|
207
|
-
} @else {
|
|
208
|
-
@for (audio of getMessageAudioItems(message); track audio.mediaId ?? audio.url) {
|
|
209
|
-
<ax-conversation-audio-attachment [item]="audio" />
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
</div>
|
|
213
|
-
<time class="tg-media-view__list-meta">{{ formatTimestamp(message) }}</time>
|
|
214
|
-
</article>
|
|
215
|
-
}
|
|
216
|
-
</div>
|
|
217
|
-
} @else {
|
|
218
|
-
<div class="tg-media-view__list">
|
|
219
|
-
@for (message of items(); track message.id) {
|
|
220
|
-
<article class="tg-media-view__list-item">
|
|
221
|
-
<div class="tg-media-view__list-body">
|
|
222
|
-
<ax-conversation-registry-component-outlet
|
|
223
|
-
[component]="getRendererComponent(message)"
|
|
224
|
-
[componentLoader]="getRendererComponentLoader(message)"
|
|
225
|
-
[inputs]="getRendererInputs(message)"
|
|
226
|
-
/>
|
|
227
|
-
</div>
|
|
228
|
-
<time class="tg-media-view__list-meta">{{ formatTimestamp(message) }}</time>
|
|
229
|
-
</article>
|
|
230
|
-
}
|
|
231
|
-
</div>
|
|
232
|
-
}
|
|
233
|
-
</div>
|
|
234
|
-
`, styles: [":host{display:block;width:100%}.tg-media-view{display:flex;flex-direction:column;min-height:12rem;max-height:min(85vh,40rem)}.tg-media-view__header{display:flex;align-items:center;gap:.5rem;padding:.65rem .75rem;border-bottom:1px solid rgb(var(--ax-sys-color-border-light-surface));flex-shrink:0}.tg-media-view__back{display:inline-flex;align-items:center;justify-content:center;width:2rem;height:2rem;border:none;border-radius:999px;background:transparent;color:rgb(var(--ax-sys-color-primary-500));cursor:pointer}.tg-media-view__back:hover{background:rgb(var(--ax-sys-color-lighter-surface))}.tg-media-view__title{margin:0;font-size:1rem;font-weight:600;color:rgb(var(--ax-sys-color-on-surface))}.tg-media-view__empty{padding:2rem 1rem;text-align:center;font-size:.875rem;color:rgb(var(--ax-sys-color-on-surface));opacity:.65}.tg-media-view__grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:2px;padding:2px;overflow-y:auto;overscroll-behavior:contain;background:rgb(var(--ax-sys-color-border-light-surface))}.tg-media-view__grid-cell{position:relative;aspect-ratio:1;overflow:hidden;background:rgb(var(--ax-sys-color-lighter-surface))}.tg-media-view__grid-cell--sticker{display:flex;align-items:center;justify-content:center;padding:.35rem}.tg-media-view__grid-cell ::ng-deep ax-conversation-image-attachment,.tg-media-view__grid-cell ::ng-deep .ax-conversation-image-attachment{width:100%;height:100%;min-height:0;border-radius:0}.tg-media-view__grid-cell ::ng-deep img{width:100%;height:100%;object-fit:cover}.tg-media-view__sticker{max-width:100%;max-height:100%;object-fit:contain}.tg-media-view__list{display:flex;flex-direction:column;overflow-y:auto;overscroll-behavior:contain}.tg-media-view__list-item{display:flex;flex-direction:column;gap:.35rem;padding:.75rem 1rem;border-bottom:1px solid rgb(var(--ax-sys-color-border-light-surface))}.tg-media-view__list-item:last-child{border-bottom:none}.tg-media-view__list-body{min-width:0;display:flex;flex-direction:column;gap:.5rem}.tg-media-view__list-body ::ng-deep .ax-conversation-msg{max-width:100%}.tg-media-view__list-body ::ng-deep ax-conversation-message-renderer-state{display:none}.tg-media-view__list-body ::ng-deep .ax-conversation-video__player{max-height:min(50vh,16rem)}.tg-media-view__list-meta{font-size:.75rem;color:rgb(var(--ax-sys-color-on-surface));opacity:.55}\n"] }]
|
|
235
|
-
}], propDecorators: { category: [{ type: i0.Input, args: [{ isSignal: true, alias: "category", required: true }] }], messages: [{ type: i0.Input, args: [{ isSignal: true, alias: "messages", required: true }] }], conversation: [{ type: i0.Input, args: [{ isSignal: true, alias: "conversation", required: true }] }], conversationServiceInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "conversationService", required: true }] }], onBack: [{ type: i0.Input, args: [{ isSignal: true, alias: "onBack", required: false }] }], back: [{ type: i0.Output, args: ["back"] }] } });
|
|
236
|
-
|
|
237
|
-
export { AXConversationInfoMediaViewComponent };
|
|
238
|
-
//# sourceMappingURL=acorex-components-conversation-conversation-info-media-view.component-Mhk7JE6K.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-components-conversation-conversation-info-media-view.component-Mhk7JE6K.mjs","sources":["../../../../packages/components/conversation/src/lib/plugins/info-bar/components/conversation-info-media-view.component.ts"],"sourcesContent":["/**\n * Shared media browser inside the conversation info panel.\n */\n\nimport { AXDecoratorModule } from '@acorex/components/decorators';\nimport { AXTranslationModule, AXTranslationService } from '@acorex/core/translation';\nimport { CommonModule } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, computed, inject, Injector, input, output } from '@angular/core';\nimport { AXConversationRegistryComponentOutletComponent } from '../../../components/shared/registry-component-outlet.component';\nimport type { AXConversation, AXConversationMessage } from '../../../models';\nimport { AXConversationService } from '../../../services';\nimport { AXConversationAudioAttachmentComponent } from '../../message-list/components/shared/audio-attachment.component';\nimport { AXConversationImageAttachmentComponent } from '../../message-list/components/shared/image-attachment.component';\nimport { AXConversationVideoAttachmentComponent } from '../../message-list/components/shared/video-attachment.component';\nimport {\n buildMediaGalleryTiles,\n filterMessagesByMediaCategory,\n getMessageAudioItems,\n getMessageVideoItems,\n isAttachmentListCategory,\n isGridMediaCategory,\n type AXConversationMediaCategory,\n} from './conversation-info-panel.utils';\n\n@Component({\n selector: 'ax-conversation-info-media-view',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n CommonModule,\n AXConversationRegistryComponentOutletComponent,\n AXDecoratorModule,\n AXTranslationModule,\n AXConversationImageAttachmentComponent,\n AXConversationVideoAttachmentComponent,\n AXConversationAudioAttachmentComponent,\n ],\n template: `\n <div class=\"tg-media-view\">\n <header class=\"tg-media-view__header\">\n <button type=\"button\" class=\"tg-media-view__back\" (click)=\"handleBack()\" [attr.aria-label]=\"'Back'\">\n <i class=\"fa-light fa-arrow-left\"></i>\n </button>\n <h3 class=\"tg-media-view__title\">{{ titleLabel() }}</h3>\n </header>\n\n @if (items().length === 0) {\n <div class=\"tg-media-view__empty\">\n {{ '@acorex:chat.info-panel.media.empty' | translate | async }}\n </div>\n } @else if (isGrid()) {\n <div class=\"tg-media-view__grid\">\n @for (tile of galleryTiles(); track tile.key) {\n <article\n class=\"tg-media-view__grid-cell\"\n [class.tg-media-view__grid-cell--sticker]=\"tile.kind === 'sticker'\"\n >\n @switch (tile.kind) {\n @case ('image') {\n @if (tile.image; as image) {\n <ax-conversation-image-attachment [item]=\"image\" [alt]=\"'Photo'\" />\n }\n }\n @case ('sticker') {\n @if (tile.stickerUrl) {\n <img\n class=\"tg-media-view__sticker\"\n [src]=\"tile.stickerUrl\"\n [alt]=\"tile.stickerAlt ?? 'Sticker'\"\n loading=\"lazy\"\n />\n }\n }\n }\n </article>\n }\n </div>\n } @else if (isAttachmentList()) {\n <div class=\"tg-media-view__list\">\n @for (message of items(); track message.id) {\n <article class=\"tg-media-view__list-item\">\n <div class=\"tg-media-view__list-body\">\n @if (category().id === 'video') {\n @for (video of getMessageVideoItems(message); track video.mediaId ?? video.url) {\n <ax-conversation-video-attachment [item]=\"video\" />\n }\n } @else {\n @for (audio of getMessageAudioItems(message); track audio.mediaId ?? audio.url) {\n <ax-conversation-audio-attachment [item]=\"audio\" />\n }\n }\n </div>\n <time class=\"tg-media-view__list-meta\">{{ formatTimestamp(message) }}</time>\n </article>\n }\n </div>\n } @else {\n <div class=\"tg-media-view__list\">\n @for (message of items(); track message.id) {\n <article class=\"tg-media-view__list-item\">\n <div class=\"tg-media-view__list-body\">\n <ax-conversation-registry-component-outlet\n [component]=\"getRendererComponent(message)\"\n [componentLoader]=\"getRendererComponentLoader(message)\"\n [inputs]=\"getRendererInputs(message)\"\n />\n </div>\n <time class=\"tg-media-view__list-meta\">{{ formatTimestamp(message) }}</time>\n </article>\n }\n </div>\n }\n </div>\n `,\n styles: [\n `\n :host {\n display: block;\n width: 100%;\n }\n\n .tg-media-view {\n display: flex;\n flex-direction: column;\n min-height: 12rem;\n max-height: min(85vh, 40rem);\n }\n\n .tg-media-view__header {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n padding: 0.65rem 0.75rem;\n border-bottom: 1px solid rgb(var(--ax-sys-color-border-light-surface));\n flex-shrink: 0;\n }\n\n .tg-media-view__back {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 2rem;\n height: 2rem;\n border: none;\n border-radius: 999px;\n background: transparent;\n color: rgb(var(--ax-sys-color-primary-500));\n cursor: pointer;\n }\n\n .tg-media-view__back:hover {\n background: rgb(var(--ax-sys-color-lighter-surface));\n }\n\n .tg-media-view__title {\n margin: 0;\n font-size: 1rem;\n font-weight: 600;\n color: rgb(var(--ax-sys-color-on-surface));\n }\n\n .tg-media-view__empty {\n padding: 2rem 1rem;\n text-align: center;\n font-size: 0.875rem;\n color: rgb(var(--ax-sys-color-on-surface));\n opacity: 0.65;\n }\n\n .tg-media-view__grid {\n display: grid;\n grid-template-columns: repeat(3, minmax(0, 1fr));\n gap: 2px;\n padding: 2px;\n overflow-y: auto;\n overscroll-behavior: contain;\n background: rgb(var(--ax-sys-color-border-light-surface));\n }\n\n .tg-media-view__grid-cell {\n position: relative;\n aspect-ratio: 1;\n overflow: hidden;\n background: rgb(var(--ax-sys-color-lighter-surface));\n }\n\n .tg-media-view__grid-cell--sticker {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0.35rem;\n }\n\n .tg-media-view__grid-cell ::ng-deep ax-conversation-image-attachment,\n .tg-media-view__grid-cell ::ng-deep .ax-conversation-image-attachment {\n width: 100%;\n height: 100%;\n min-height: 0;\n border-radius: 0;\n }\n\n .tg-media-view__grid-cell ::ng-deep img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n\n .tg-media-view__sticker {\n max-width: 100%;\n max-height: 100%;\n object-fit: contain;\n }\n\n .tg-media-view__list {\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n overscroll-behavior: contain;\n }\n\n .tg-media-view__list-item {\n display: flex;\n flex-direction: column;\n gap: 0.35rem;\n padding: 0.75rem 1rem;\n border-bottom: 1px solid rgb(var(--ax-sys-color-border-light-surface));\n }\n\n .tg-media-view__list-item:last-child {\n border-bottom: none;\n }\n\n .tg-media-view__list-body {\n min-width: 0;\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n }\n\n .tg-media-view__list-body ::ng-deep .ax-conversation-msg {\n max-width: 100%;\n }\n\n .tg-media-view__list-body ::ng-deep ax-conversation-message-renderer-state {\n display: none;\n }\n\n .tg-media-view__list-body ::ng-deep .ax-conversation-video__player {\n max-height: min(50vh, 16rem);\n }\n\n .tg-media-view__list-meta {\n font-size: 0.75rem;\n color: rgb(var(--ax-sys-color-on-surface));\n opacity: 0.55;\n }\n `,\n ],\n})\nexport class AXConversationInfoMediaViewComponent {\n private readonly translation = inject(AXTranslationService);\n private readonly parentInjector = inject(Injector);\n\n readonly category = input.required<AXConversationMediaCategory>();\n readonly messages = input.required<AXConversationMessage[]>();\n readonly conversation = input.required<AXConversation>();\n readonly conversationServiceInput = input.required<AXConversationService>({ alias: 'conversationService' });\n /** Callback for lazy outlet wiring (alternative to the `back` output). */\n readonly onBack = input<(() => void) | undefined>(undefined);\n\n readonly back = output<void>();\n\n readonly items = computed(() => filterMessagesByMediaCategory(this.messages(), this.category().id));\n readonly isGrid = computed(() => isGridMediaCategory(this.category().id));\n readonly isAttachmentList = computed(() => isAttachmentListCategory(this.category().id));\n readonly galleryTiles = computed(() => buildMediaGalleryTiles(this.messages(), this.category().id));\n\n readonly rendererInjector = computed(() =>\n Injector.create({\n providers: [{ provide: AXConversationService, useValue: this.conversationServiceInput() }],\n parent: this.parentInjector,\n }),\n );\n\n readonly titleLabel = computed(() =>\n this.translation.translateSync(this.category().countLabelKey, {\n params: { count: this.category().count },\n }),\n );\n\n readonly getMessageVideoItems = getMessageVideoItems;\n readonly getMessageAudioItems = getMessageAudioItems;\n\n getRendererComponent(message: AXConversationMessage) {\n const renderer = this.conversationServiceInput().registry.messageRenderers.getRenderer(message);\n return renderer?.component;\n }\n\n getRendererComponentLoader(message: AXConversationMessage) {\n const renderer = this.conversationServiceInput().registry.messageRenderers.getRenderer(message);\n if (renderer?.componentLoader) {\n return renderer.componentLoader;\n }\n if (!renderer?.component) {\n return () =>\n import('../../message-list/components/fallback-renderer/fallback-renderer.component').then(\n (m) => m.AXConversationFallbackRendererComponent,\n );\n }\n return undefined;\n }\n\n getRendererInputs(message: AXConversationMessage) {\n return { message };\n }\n\n formatTimestamp(message: AXConversationMessage): string {\n return new Intl.DateTimeFormat(undefined, {\n dateStyle: 'medium',\n timeStyle: 'short',\n }).format(message.timestamp);\n }\n\n handleBack(): void {\n this.onBack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