@acorex/components 21.0.3-next.39 → 21.0.3-next.40

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.
Files changed (129) hide show
  1. package/{conversation2 → conversation}/README.md +23 -23
  2. package/fesm2022/acorex-components-button.mjs +4 -4
  3. package/fesm2022/acorex-components-button.mjs.map +1 -1
  4. package/fesm2022/acorex-components-conversation-acorex-components-conversation-YhVa42TC.mjs +13711 -0
  5. package/fesm2022/acorex-components-conversation-acorex-components-conversation-YhVa42TC.mjs.map +1 -0
  6. package/fesm2022/acorex-components-conversation-audio-attachment.component-CLvS3W8F.mjs +119 -0
  7. package/fesm2022/acorex-components-conversation-audio-attachment.component-CLvS3W8F.mjs.map +1 -0
  8. package/fesm2022/acorex-components-conversation-audio-composer.payload-BHQJNyXz.mjs +59 -0
  9. package/fesm2022/acorex-components-conversation-audio-composer.payload-BHQJNyXz.mjs.map +1 -0
  10. package/fesm2022/acorex-components-conversation-audio-picker.component-BD_fN2Ip.mjs +432 -0
  11. package/fesm2022/acorex-components-conversation-audio-picker.component-BD_fN2Ip.mjs.map +1 -0
  12. package/fesm2022/acorex-components-conversation-audio-renderer.component-CcxVVprx.mjs +177 -0
  13. package/fesm2022/acorex-components-conversation-audio-renderer.component-CcxVVprx.mjs.map +1 -0
  14. package/fesm2022/acorex-components-conversation-audio.payload-Bag4aTut.mjs +54 -0
  15. package/fesm2022/acorex-components-conversation-audio.payload-Bag4aTut.mjs.map +1 -0
  16. package/fesm2022/acorex-components-conversation-composer-action-choice-dialog.component-C28hl7iD.mjs +101 -0
  17. package/fesm2022/acorex-components-conversation-composer-action-choice-dialog.component-C28hl7iD.mjs.map +1 -0
  18. package/fesm2022/acorex-components-conversation-conversation-audio.file-type-CfGSVnMA.mjs +100 -0
  19. package/fesm2022/acorex-components-conversation-conversation-audio.file-type-CfGSVnMA.mjs.map +1 -0
  20. package/fesm2022/acorex-components-conversation-conversation-file.file-type-DB-2xhaC.mjs +121 -0
  21. package/fesm2022/acorex-components-conversation-conversation-file.file-type-DB-2xhaC.mjs.map +1 -0
  22. package/fesm2022/acorex-components-conversation-conversation-image.file-type-C02OzZZB.mjs +84 -0
  23. package/fesm2022/acorex-components-conversation-conversation-image.file-type-C02OzZZB.mjs.map +1 -0
  24. package/fesm2022/acorex-components-conversation-conversation-info-media-view.component-Mhk7JE6K.mjs +238 -0
  25. package/fesm2022/acorex-components-conversation-conversation-info-media-view.component-Mhk7JE6K.mjs.map +1 -0
  26. package/fesm2022/acorex-components-conversation-conversation-info-panel.component-CNaM5ajR.mjs +1080 -0
  27. package/fesm2022/acorex-components-conversation-conversation-info-panel.component-CNaM5ajR.mjs.map +1 -0
  28. package/fesm2022/acorex-components-conversation-conversation-video.file-type-Pescv4Vu.mjs +102 -0
  29. package/fesm2022/acorex-components-conversation-conversation-video.file-type-Pescv4Vu.mjs.map +1 -0
  30. package/fesm2022/acorex-components-conversation-conversation-voice.file-type-DDd47o4r.mjs +90 -0
  31. package/fesm2022/acorex-components-conversation-conversation-voice.file-type-DDd47o4r.mjs.map +1 -0
  32. package/fesm2022/acorex-components-conversation-emoji-categories-C7Gm95V0.mjs +1840 -0
  33. package/fesm2022/acorex-components-conversation-emoji-categories-C7Gm95V0.mjs.map +1 -0
  34. package/fesm2022/acorex-components-conversation-fallback-renderer.component-CYh_6O6j.mjs +44 -0
  35. package/fesm2022/acorex-components-conversation-fallback-renderer.component-CYh_6O6j.mjs.map +1 -0
  36. package/fesm2022/acorex-components-conversation-file-composer.payload-Dy7aG-EH.mjs +64 -0
  37. package/fesm2022/acorex-components-conversation-file-composer.payload-Dy7aG-EH.mjs.map +1 -0
  38. package/fesm2022/acorex-components-conversation-file-picker.component-DCVgl33l.mjs +468 -0
  39. package/fesm2022/acorex-components-conversation-file-picker.component-DCVgl33l.mjs.map +1 -0
  40. package/fesm2022/acorex-components-conversation-file-renderer.component-DgCi06Mg.mjs +125 -0
  41. package/fesm2022/acorex-components-conversation-file-renderer.component-DgCi06Mg.mjs.map +1 -0
  42. package/fesm2022/acorex-components-conversation-file.payload-DyFxTQYn.mjs +50 -0
  43. package/fesm2022/acorex-components-conversation-file.payload-DyFxTQYn.mjs.map +1 -0
  44. package/fesm2022/acorex-components-conversation-format-media-DUD4vA6F.mjs +21 -0
  45. package/fesm2022/acorex-components-conversation-format-media-DUD4vA6F.mjs.map +1 -0
  46. package/fesm2022/acorex-components-conversation-image-attachment.component-CLMGxXPl.mjs +77 -0
  47. package/fesm2022/acorex-components-conversation-image-attachment.component-CLMGxXPl.mjs.map +1 -0
  48. package/fesm2022/acorex-components-conversation-image-picker.component-CS343UDa.mjs +407 -0
  49. package/fesm2022/acorex-components-conversation-image-picker.component-CS343UDa.mjs.map +1 -0
  50. package/fesm2022/acorex-components-conversation-image-renderer.component-Cy0TA6cL.mjs +83 -0
  51. package/fesm2022/acorex-components-conversation-image-renderer.component-Cy0TA6cL.mjs.map +1 -0
  52. package/fesm2022/acorex-components-conversation-index-3V2b14I0.mjs +184 -0
  53. package/fesm2022/acorex-components-conversation-index-3V2b14I0.mjs.map +1 -0
  54. package/fesm2022/acorex-components-conversation-index-MCvfr9Zd.mjs +266 -0
  55. package/fesm2022/acorex-components-conversation-index-MCvfr9Zd.mjs.map +1 -0
  56. package/fesm2022/acorex-components-conversation-location-picker.component-DcNQzuoU.mjs +149 -0
  57. package/fesm2022/acorex-components-conversation-location-picker.component-DcNQzuoU.mjs.map +1 -0
  58. package/fesm2022/acorex-components-conversation-location-renderer.component-Cw2PB0LM.mjs +118 -0
  59. package/fesm2022/acorex-components-conversation-location-renderer.component-Cw2PB0LM.mjs.map +1 -0
  60. package/fesm2022/acorex-components-conversation-media-formatters-DV3wEEno.mjs +17 -0
  61. package/fesm2022/acorex-components-conversation-media-formatters-DV3wEEno.mjs.map +1 -0
  62. package/fesm2022/acorex-components-conversation-media-playback-info-bar-banner.component-DbWUl6M2.mjs +140 -0
  63. package/fesm2022/acorex-components-conversation-media-playback-info-bar-banner.component-DbWUl6M2.mjs.map +1 -0
  64. package/fesm2022/acorex-components-conversation-message-renderer-copy-host.component-oXTr_Lfq.mjs +33 -0
  65. package/fesm2022/acorex-components-conversation-message-renderer-copy-host.component-oXTr_Lfq.mjs.map +1 -0
  66. package/fesm2022/acorex-components-conversation-message-renderer-state.component-Dp-JdHWr.mjs +172 -0
  67. package/fesm2022/acorex-components-conversation-message-renderer-state.component-Dp-JdHWr.mjs.map +1 -0
  68. package/fesm2022/acorex-components-conversation-open-composer-picker-for-files-Du8Lj9Sp.mjs +224 -0
  69. package/fesm2022/acorex-components-conversation-open-composer-picker-for-files-Du8Lj9Sp.mjs.map +1 -0
  70. package/fesm2022/acorex-components-conversation-pagination-demo-data-oIT_YJmN.mjs +81 -0
  71. package/fesm2022/acorex-components-conversation-pagination-demo-data-oIT_YJmN.mjs.map +1 -0
  72. package/fesm2022/acorex-components-conversation-picker-header.component-BneIFjXq.mjs +91 -0
  73. package/fesm2022/acorex-components-conversation-picker-header.component-BneIFjXq.mjs.map +1 -0
  74. package/fesm2022/acorex-components-conversation-picker-toolbar.component-BthRvEeE.mjs +537 -0
  75. package/fesm2022/acorex-components-conversation-picker-toolbar.component-BthRvEeE.mjs.map +1 -0
  76. package/fesm2022/acorex-components-conversation-picker-upload-C-PlKPaU.mjs +163 -0
  77. package/fesm2022/acorex-components-conversation-picker-upload-C-PlKPaU.mjs.map +1 -0
  78. package/fesm2022/acorex-components-conversation-playback-banner-sync-D8FFKde6.mjs +68 -0
  79. package/fesm2022/acorex-components-conversation-playback-banner-sync-D8FFKde6.mjs.map +1 -0
  80. package/fesm2022/acorex-components-conversation-renderer-shared.styles-Digah3Zn.mjs +95 -0
  81. package/fesm2022/acorex-components-conversation-renderer-shared.styles-Digah3Zn.mjs.map +1 -0
  82. package/fesm2022/acorex-components-conversation-search.component-B-nc6xiA.mjs +187 -0
  83. package/fesm2022/acorex-components-conversation-search.component-B-nc6xiA.mjs.map +1 -0
  84. package/fesm2022/acorex-components-conversation-send-message-media-BRklgfV7.mjs +170 -0
  85. package/fesm2022/acorex-components-conversation-send-message-media-BRklgfV7.mjs.map +1 -0
  86. package/fesm2022/acorex-components-conversation-shared-storage.seed-J9PA4l3c.mjs +750 -0
  87. package/fesm2022/acorex-components-conversation-shared-storage.seed-J9PA4l3c.mjs.map +1 -0
  88. package/fesm2022/acorex-components-conversation-sticker-renderer.component-BmBwy7Ig.mjs +103 -0
  89. package/fesm2022/acorex-components-conversation-sticker-renderer.component-BmBwy7Ig.mjs.map +1 -0
  90. package/fesm2022/acorex-components-conversation-system-renderer.component-uie3tm5N.mjs +55 -0
  91. package/fesm2022/acorex-components-conversation-system-renderer.component-uie3tm5N.mjs.map +1 -0
  92. package/fesm2022/acorex-components-conversation-text-renderer.component-DNAquHYK.mjs +109 -0
  93. package/fesm2022/acorex-components-conversation-text-renderer.component-DNAquHYK.mjs.map +1 -0
  94. package/fesm2022/acorex-components-conversation-video-attachment.component-CGaUhnSb.mjs +105 -0
  95. package/fesm2022/acorex-components-conversation-video-attachment.component-CGaUhnSb.mjs.map +1 -0
  96. package/fesm2022/acorex-components-conversation-video-composer.payload-DMqRkafr.mjs +62 -0
  97. package/fesm2022/acorex-components-conversation-video-composer.payload-DMqRkafr.mjs.map +1 -0
  98. package/fesm2022/acorex-components-conversation-video-picker.component-DPwSBnoH.mjs +446 -0
  99. package/fesm2022/acorex-components-conversation-video-picker.component-DPwSBnoH.mjs.map +1 -0
  100. package/fesm2022/acorex-components-conversation-video-renderer.component-DKa9mUe2.mjs +181 -0
  101. package/fesm2022/acorex-components-conversation-video-renderer.component-DKa9mUe2.mjs.map +1 -0
  102. package/fesm2022/acorex-components-conversation-video.payload-C8QaqxuX.mjs +54 -0
  103. package/fesm2022/acorex-components-conversation-video.payload-C8QaqxuX.mjs.map +1 -0
  104. package/fesm2022/acorex-components-conversation-voice-composer.payload-DLVow7ex.mjs +17 -0
  105. package/fesm2022/acorex-components-conversation-voice-composer.payload-DLVow7ex.mjs.map +1 -0
  106. package/fesm2022/acorex-components-conversation-voice-recorder.component-D_rdANZN.mjs +344 -0
  107. package/fesm2022/acorex-components-conversation-voice-recorder.component-D_rdANZN.mjs.map +1 -0
  108. package/fesm2022/acorex-components-conversation-voice-renderer.component-BY5FJcT8.mjs +270 -0
  109. package/fesm2022/acorex-components-conversation-voice-renderer.component-BY5FJcT8.mjs.map +1 -0
  110. package/fesm2022/acorex-components-conversation.mjs +2 -0
  111. package/fesm2022/acorex-components-conversation.mjs.map +1 -0
  112. package/fesm2022/acorex-components-kbd.mjs +2 -2
  113. package/fesm2022/acorex-components-kbd.mjs.map +1 -1
  114. package/fesm2022/acorex-components-scheduler-picker.mjs +22 -14
  115. package/fesm2022/acorex-components-scheduler-picker.mjs.map +1 -1
  116. package/fesm2022/acorex-components-side-menu.mjs +4 -13
  117. package/fesm2022/acorex-components-side-menu.mjs.map +1 -1
  118. package/fesm2022/acorex-components-tree-view.mjs +2 -2
  119. package/fesm2022/acorex-components-tree-view.mjs.map +1 -1
  120. package/package.json +6 -10
  121. package/types/{acorex-components-conversation2.d.ts → acorex-components-conversation.d.ts} +1127 -1928
  122. package/types/acorex-components-scheduler-picker.d.ts +2 -0
  123. package/types/acorex-components-side-menu.d.ts +1 -3
  124. package/fesm2022/acorex-components-conversation2.mjs +0 -22347
  125. package/fesm2022/acorex-components-conversation2.mjs.map +0 -1
  126. package/fesm2022/acorex-components-sidebar.mjs +0 -275
  127. package/fesm2022/acorex-components-sidebar.mjs.map +0 -1
  128. package/sidebar/README.md +0 -5
  129. package/types/acorex-components-sidebar.d.ts +0 -132
@@ -0,0 +1,181 @@
1
+ import { isPlatformBrowser, CommonModule } from '@angular/common';
2
+ import * as i0 from '@angular/core';
3
+ import { inject, PLATFORM_ID, DestroyRef, viewChildren, signal, input, computed, ChangeDetectionStrategy, Component } from '@angular/core';
4
+ import { l as copyWithFileTypeFallback, m as AXConversationInfoBarService } from './acorex-components-conversation-acorex-components-conversation-YhVa42TC.mjs';
5
+ import { AXFileTypeRegistryService } from '@acorex/core/file';
6
+ import { AXTranslationService } from '@acorex/core/translation';
7
+ import { A as AXConversationMessageRendererCopyHostComponent, m as mediaCopyText } from './acorex-components-conversation-message-renderer-copy-host.component-oXTr_Lfq.mjs';
8
+ import { normalizeVideoPayload } from './acorex-components-conversation-video.payload-C8QaqxuX.mjs';
9
+ import { A as AXConversationMessageRendererStateComponent } from './acorex-components-conversation-message-renderer-state.component-Dp-JdHWr.mjs';
10
+ import { b as bindMediaRendererContentState, r as reportMediaLoadError, s as syncPlaybackInfoBarBanner } from './acorex-components-conversation-playback-banner-sync-D8FFKde6.mjs';
11
+ import './acorex-components-conversation-renderer-shared.styles-Digah3Zn.mjs';
12
+ import { A as AXConversationVideoAttachmentComponent } from './acorex-components-conversation-video-attachment.component-CGaUhnSb.mjs';
13
+
14
+ class AXConversationVideoRendererComponent extends AXConversationMessageRendererCopyHostComponent {
15
+ copy() {
16
+ return copyWithFileTypeFallback(this.message(), this.fileTypes, () => {
17
+ const p = this.payload();
18
+ return mediaCopyText(p.caption, 'Video', 'videos', p.videos.length, p.videos.map((item) => item.url?.trim()));
19
+ });
20
+ }
21
+ constructor() {
22
+ super();
23
+ this.fileTypes = inject(AXFileTypeRegistryService);
24
+ this.translation = inject(AXTranslationService);
25
+ this.platformId = inject(PLATFORM_ID);
26
+ this.destroyRef = inject(DestroyRef);
27
+ this.infoBarService = inject(AXConversationInfoBarService, { optional: true });
28
+ this.attachments = viewChildren(AXConversationVideoAttachmentComponent, ...(ngDevMode ? [{ debugName: "attachments" }] : /* istanbul ignore next */ []));
29
+ this._contentState = signal('ready', ...(ngDevMode ? [{ debugName: "_contentState" }] : /* istanbul ignore next */ []));
30
+ this.activeVideoIndex = signal(0, ...(ngDevMode ? [{ debugName: "activeVideoIndex" }] : /* istanbul ignore next */ []));
31
+ this.message = input.required(...(ngDevMode ? [{ debugName: "message" }] : /* istanbul ignore next */ []));
32
+ this.rendererState = computed(() => ({
33
+ deliveryStatus: this.message().status,
34
+ contentState: this._contentState(),
35
+ }), ...(ngDevMode ? [{ debugName: "rendererState" }] : /* istanbul ignore next */ []));
36
+ this.isPlaying = signal(false, ...(ngDevMode ? [{ debugName: "isPlaying" }] : /* istanbul ignore next */ []));
37
+ this.currentTime = signal(0, ...(ngDevMode ? [{ debugName: "currentTime" }] : /* istanbul ignore next */ []));
38
+ this.duration = signal(0, ...(ngDevMode ? [{ debugName: "duration" }] : /* istanbul ignore next */ []));
39
+ this.payload = computed(() => normalizeVideoPayload(this.message().payload), ...(ngDevMode ? [{ debugName: "payload" }] : /* istanbul ignore next */ []));
40
+ this.videos = computed(() => this.payload().videos, ...(ngDevMode ? [{ debugName: "videos" }] : /* istanbul ignore next */ []));
41
+ this.caption = computed(() => this.payload().caption?.trim() || '', ...(ngDevMode ? [{ debugName: "caption" }] : /* istanbul ignore next */ []));
42
+ this.videoLoadErrorLabel = computed(() => this.translation.translateSync('@acorex:chat.renderer-state.could-not-load-video'), ...(ngDevMode ? [{ debugName: "videoLoadErrorLabel" }] : /* istanbul ignore next */ []));
43
+ bindMediaRendererContentState(this.message, this._contentState, () => this.videos());
44
+ this.destroyRef.onDestroy(() => {
45
+ const messageId = this.message()?.id;
46
+ if (messageId && this.infoBarService) {
47
+ this.infoBarService.hideMessageBanner(messageId);
48
+ }
49
+ });
50
+ }
51
+ onPlayingChange(index, playing) {
52
+ if (playing) {
53
+ this.activeVideoIndex.set(index);
54
+ this.pauseOtherVideos(index);
55
+ this.isPlaying.set(true);
56
+ this.syncInfoBarBanner(true);
57
+ return;
58
+ }
59
+ if (this.activeVideoIndex() === index) {
60
+ this.isPlaying.set(false);
61
+ this.syncInfoBarBanner();
62
+ }
63
+ }
64
+ onTimeUpdate(index, time) {
65
+ if (this.activeVideoIndex() !== index) {
66
+ return;
67
+ }
68
+ this.currentTime.set(time);
69
+ this.syncInfoBarBanner();
70
+ }
71
+ onDurationChange(index, duration) {
72
+ if (this.activeVideoIndex() !== index) {
73
+ return;
74
+ }
75
+ this.duration.set(duration);
76
+ this.syncInfoBarBanner();
77
+ }
78
+ onPlaybackEnded(index) {
79
+ if (this.activeVideoIndex() !== index) {
80
+ return;
81
+ }
82
+ this.isPlaying.set(false);
83
+ this.currentTime.set(0);
84
+ this.syncInfoBarBanner();
85
+ }
86
+ onPlaybackError() {
87
+ if (!reportMediaLoadError(this.message(), this._contentState)) {
88
+ return;
89
+ }
90
+ this.isPlaying.set(false);
91
+ this.infoBarService?.hideMessageBanner(this.message().id);
92
+ }
93
+ togglePlay() {
94
+ if (!isPlatformBrowser(this.platformId)) {
95
+ return;
96
+ }
97
+ this.attachments()[this.activeVideoIndex()]?.togglePlay();
98
+ }
99
+ pauseOtherVideos(activeIndex) {
100
+ this.attachments().forEach((attachment, index) => {
101
+ if (index !== activeIndex) {
102
+ attachment.pause();
103
+ }
104
+ });
105
+ }
106
+ pausePlayback() {
107
+ this.attachments()[this.activeVideoIndex()]?.pause();
108
+ this.isPlaying.set(false);
109
+ }
110
+ syncInfoBarBanner(forceOpen = false) {
111
+ if (!this.infoBarService) {
112
+ return;
113
+ }
114
+ const message = this.message();
115
+ const index = this.activeVideoIndex();
116
+ const title = this.payload().caption?.trim() || (this.videos().length > 1 ? `Video ${index + 1}` : 'Video');
117
+ syncPlaybackInfoBarBanner(this.infoBarService, message, {
118
+ title,
119
+ currentTime: this.currentTime(),
120
+ duration: this.duration() || this.videos()[index]?.duration || 0,
121
+ isPlaying: this.isPlaying(),
122
+ onTogglePlay: () => this.togglePlay(),
123
+ onClose: () => this.pausePlayback(),
124
+ }, { forceOpen });
125
+ }
126
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXConversationVideoRendererComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
127
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: AXConversationVideoRendererComponent, isStandalone: true, selector: "ax-conversation-video-renderer", inputs: { message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: true, transformFunction: null } }, viewQueries: [{ propertyName: "attachments", predicate: AXConversationVideoAttachmentComponent, descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: `
128
+ <div class="ax-conversation-msg">
129
+ <ax-conversation-message-renderer-state
130
+ [rendererState]="rendererState()"
131
+ [message]="message()"
132
+ [contentErrorLabel]="videoLoadErrorLabel()"
133
+ />
134
+ <div class="ax-conversation-msg__stack">
135
+ @for (video of videos(); track video.mediaId ?? video.url; let i = $index) {
136
+ <ax-conversation-video-attachment
137
+ [item]="video"
138
+ (playingChange)="onPlayingChange(i, $event)"
139
+ (timeUpdate)="onTimeUpdate(i, $event)"
140
+ (durationChange)="onDurationChange(i, $event)"
141
+ (playbackEnded)="onPlaybackEnded(i)"
142
+ (playbackError)="onPlaybackError()"
143
+ />
144
+ }
145
+ </div>
146
+ @if (caption()) {
147
+ <p class="ax-conversation-msg__caption">{{ caption() }}</p>
148
+ }
149
+ </div>
150
+ `, isInline: true, styles: [":host{display:block;max-width:100%}.ax-conversation-msg,.ax-conversation-msg__stack{display:flex;flex-direction:column;gap:.375rem}.ax-conversation-msg__grid{display:grid;gap:2px;width:100%;border-radius:var(--ax-sys-border-radius, .5rem);overflow:hidden;background:rgb(var(--ax-sys-color-border-light-surface))}.ax-conversation-msg__grid--single{grid-template-columns:1fr}.ax-conversation-msg__grid--single ::ng-deep .ax-conversation-image-attachment{max-height:min(50dvh,20rem)}.ax-conversation-msg__grid--dual{grid-template-columns:repeat(2,1fr)}.ax-conversation-msg__grid--multi{grid-template-columns:repeat(3,1fr);grid-auto-rows:10rem}@container (max-width: 380px){.ax-conversation-msg__grid--multi{grid-template-columns:repeat(2,1fr);grid-auto-rows:10rem}}.ax-conversation-msg__caption{margin:0;padding:0 .125rem;font-size:.8125rem;line-height:1.4;word-break:break-word;opacity:.88}.ax-conversation-msg--flush{width:100%;max-width:100%;gap:0}.ax-conversation-msg--flush .ax-conversation-msg__caption{padding:.375rem .625rem 0}.ax-conversation-msg--flush .ax-conversation-msg__grid{border-radius:0;background:transparent}.ax-conversation-msg--flush .ax-conversation-msg__stack{gap:2px}.ax-conversation-msg--flush ::ng-deep .ax-conversation-video{border-radius:0}.ax-conversation-msg__card{border-radius:var(--ax-sys-border-radius, .5rem);border:1px solid rgb(var(--ax-sys-color-border-light-surface));background:rgb(var(--ax-sys-color-surface));overflow:hidden}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: AXConversationVideoAttachmentComponent, selector: "ax-conversation-video-attachment", inputs: ["item"], outputs: ["playingChange", "timeUpdate", "durationChange", "playbackEnded", "playbackError"] }, { 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 }); }
151
+ }
152
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXConversationVideoRendererComponent, decorators: [{
153
+ type: Component,
154
+ args: [{ selector: 'ax-conversation-video-renderer', imports: [CommonModule, AXConversationVideoAttachmentComponent, AXConversationMessageRendererStateComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: `
155
+ <div class="ax-conversation-msg">
156
+ <ax-conversation-message-renderer-state
157
+ [rendererState]="rendererState()"
158
+ [message]="message()"
159
+ [contentErrorLabel]="videoLoadErrorLabel()"
160
+ />
161
+ <div class="ax-conversation-msg__stack">
162
+ @for (video of videos(); track video.mediaId ?? video.url; let i = $index) {
163
+ <ax-conversation-video-attachment
164
+ [item]="video"
165
+ (playingChange)="onPlayingChange(i, $event)"
166
+ (timeUpdate)="onTimeUpdate(i, $event)"
167
+ (durationChange)="onDurationChange(i, $event)"
168
+ (playbackEnded)="onPlaybackEnded(i)"
169
+ (playbackError)="onPlaybackError()"
170
+ />
171
+ }
172
+ </div>
173
+ @if (caption()) {
174
+ <p class="ax-conversation-msg__caption">{{ caption() }}</p>
175
+ }
176
+ </div>
177
+ `, styles: [":host{display:block;max-width:100%}.ax-conversation-msg,.ax-conversation-msg__stack{display:flex;flex-direction:column;gap:.375rem}.ax-conversation-msg__grid{display:grid;gap:2px;width:100%;border-radius:var(--ax-sys-border-radius, .5rem);overflow:hidden;background:rgb(var(--ax-sys-color-border-light-surface))}.ax-conversation-msg__grid--single{grid-template-columns:1fr}.ax-conversation-msg__grid--single ::ng-deep .ax-conversation-image-attachment{max-height:min(50dvh,20rem)}.ax-conversation-msg__grid--dual{grid-template-columns:repeat(2,1fr)}.ax-conversation-msg__grid--multi{grid-template-columns:repeat(3,1fr);grid-auto-rows:10rem}@container (max-width: 380px){.ax-conversation-msg__grid--multi{grid-template-columns:repeat(2,1fr);grid-auto-rows:10rem}}.ax-conversation-msg__caption{margin:0;padding:0 .125rem;font-size:.8125rem;line-height:1.4;word-break:break-word;opacity:.88}.ax-conversation-msg--flush{width:100%;max-width:100%;gap:0}.ax-conversation-msg--flush .ax-conversation-msg__caption{padding:.375rem .625rem 0}.ax-conversation-msg--flush .ax-conversation-msg__grid{border-radius:0;background:transparent}.ax-conversation-msg--flush .ax-conversation-msg__stack{gap:2px}.ax-conversation-msg--flush ::ng-deep .ax-conversation-video{border-radius:0}.ax-conversation-msg__card{border-radius:var(--ax-sys-border-radius, .5rem);border:1px solid rgb(var(--ax-sys-color-border-light-surface));background:rgb(var(--ax-sys-color-surface));overflow:hidden}\n"] }]
178
+ }], ctorParameters: () => [], propDecorators: { attachments: [{ type: i0.ViewChildren, args: [i0.forwardRef(() => AXConversationVideoAttachmentComponent), { isSignal: true }] }], message: [{ type: i0.Input, args: [{ isSignal: true, alias: "message", required: true }] }] } });
179
+
180
+ export { AXConversationVideoRendererComponent };
181
+ //# sourceMappingURL=acorex-components-conversation-video-renderer.component-DKa9mUe2.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-components-conversation-video-renderer.component-DKa9mUe2.mjs","sources":["../../../../packages/components/conversation/src/lib/plugins/message-list/components/video-renderer/video-renderer.component.ts"],"sourcesContent":["import { CommonModule, isPlatformBrowser } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n PLATFORM_ID,\n computed,\n inject,\n input,\n signal,\n viewChildren,\n} from '@angular/core';\nimport { AXConversationInfoBarService } from '../../../../components';\nimport type { AXConversationMessage, AXConversationVideoPayload } from '../../../../models';\nimport type { AXConversationMessageRendererContentState } from '../../../../registries/message-renderer.registry';\nimport { AXFileTypeRegistryService } from '@acorex/core/file';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport {\n AXConversationMessageRendererCopyHostComponent,\n mediaCopyText,\n} from '../shared/message-renderer-copy-host.component';\nimport { copyWithFileTypeFallback } from '../../../../utils/file-type-message.resolve';\nimport { normalizeVideoPayload } from './video.payload';\nimport { AXConversationMessageRendererStateComponent } from '../shared/message-renderer-state.component';\nimport { bindMediaRendererContentState, reportMediaLoadError } from '../shared/media-renderer-content-state';\nimport { syncPlaybackInfoBarBanner } from '../shared/playback-banner-sync';\nimport { AX_CONVERSATION_RENDERER_SHARED_STYLES } from '../shared/renderer-shared.styles';\nimport { AXConversationVideoAttachmentComponent } from '../shared/video-attachment.component';\n\n@Component({\n selector: 'ax-conversation-video-renderer',\n imports: [CommonModule, AXConversationVideoAttachmentComponent, AXConversationMessageRendererStateComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <div class=\"ax-conversation-msg\">\n <ax-conversation-message-renderer-state\n [rendererState]=\"rendererState()\"\n [message]=\"message()\"\n [contentErrorLabel]=\"videoLoadErrorLabel()\"\n />\n <div class=\"ax-conversation-msg__stack\">\n @for (video of videos(); track video.mediaId ?? video.url; let i = $index) {\n <ax-conversation-video-attachment\n [item]=\"video\"\n (playingChange)=\"onPlayingChange(i, $event)\"\n (timeUpdate)=\"onTimeUpdate(i, $event)\"\n (durationChange)=\"onDurationChange(i, $event)\"\n (playbackEnded)=\"onPlaybackEnded(i)\"\n (playbackError)=\"onPlaybackError()\"\n />\n }\n </div>\n @if (caption()) {\n <p class=\"ax-conversation-msg__caption\">{{ caption() }}</p>\n }\n </div>\n `,\n styles: [AX_CONVERSATION_RENDERER_SHARED_STYLES],\n})\nexport class AXConversationVideoRendererComponent extends AXConversationMessageRendererCopyHostComponent {\n private readonly fileTypes = inject(AXFileTypeRegistryService);\n private readonly translation = inject(AXTranslationService);\n private readonly platformId = inject(PLATFORM_ID);\n private readonly destroyRef = inject(DestroyRef);\n private readonly infoBarService = inject(AXConversationInfoBarService, { optional: true });\n private readonly attachments = viewChildren(AXConversationVideoAttachmentComponent);\n\n private readonly _contentState = signal<AXConversationMessageRendererContentState>('ready');\n private readonly activeVideoIndex = signal(0);\n\n readonly message = input.required<AXConversationMessage>();\n readonly rendererState = computed(() => ({\n deliveryStatus: this.message().status,\n contentState: this._contentState(),\n }));\n\n readonly isPlaying = signal(false);\n readonly currentTime = signal(0);\n readonly duration = signal(0);\n\n readonly payload = computed(() => normalizeVideoPayload(this.message().payload as AXConversationVideoPayload));\n readonly videos = computed(() => this.payload().videos);\n readonly caption = computed(() => this.payload().caption?.trim() || '');\n\n readonly videoLoadErrorLabel = computed(() =>\n this.translation.translateSync('@acorex:chat.renderer-state.could-not-load-video'),\n );\n\n copy(): Promise<string> {\n return copyWithFileTypeFallback(this.message(), this.fileTypes, () => {\n const p = this.payload();\n return mediaCopyText(\n p.caption,\n 'Video',\n 'videos',\n p.videos.length,\n p.videos.map((item) => item.url?.trim()),\n );\n });\n }\n\n constructor() {\n super();\n bindMediaRendererContentState(this.message, this._contentState, () => this.videos());\n\n this.destroyRef.onDestroy(() => {\n const messageId = this.message()?.id;\n if (messageId && this.infoBarService) {\n this.infoBarService.hideMessageBanner(messageId);\n }\n });\n }\n\n onPlayingChange(index: number, playing: boolean): void {\n if (playing) {\n this.activeVideoIndex.set(index);\n this.pauseOtherVideos(index);\n this.isPlaying.set(true);\n this.syncInfoBarBanner(true);\n return;\n }\n\n if (this.activeVideoIndex() === index) {\n this.isPlaying.set(false);\n this.syncInfoBarBanner();\n }\n }\n\n onTimeUpdate(index: number, time: number): void {\n if (this.activeVideoIndex() !== index) {\n return;\n }\n this.currentTime.set(time);\n this.syncInfoBarBanner();\n }\n\n onDurationChange(index: number, duration: number): void {\n if (this.activeVideoIndex() !== index) {\n return;\n }\n this.duration.set(duration);\n this.syncInfoBarBanner();\n }\n\n onPlaybackEnded(index: number): void {\n if (this.activeVideoIndex() !== index) {\n return;\n }\n this.isPlaying.set(false);\n this.currentTime.set(0);\n this.syncInfoBarBanner();\n }\n\n onPlaybackError(): void {\n if (!reportMediaLoadError(this.message(), this._contentState)) {\n return;\n }\n this.isPlaying.set(false);\n this.infoBarService?.hideMessageBanner(this.message().id);\n }\n\n togglePlay(): void {\n if (!isPlatformBrowser(this.platformId)) {\n return;\n }\n this.attachments()[this.activeVideoIndex()]?.togglePlay();\n }\n\n private pauseOtherVideos(activeIndex: number): void {\n this.attachments().forEach((attachment, index) => {\n if (index !== activeIndex) {\n attachment.pause();\n }\n });\n }\n\n private pausePlayback(): void {\n this.attachments()[this.activeVideoIndex()]?.pause();\n this.isPlaying.set(false);\n }\n\n private syncInfoBarBanner(forceOpen = false): void {\n if (!this.infoBarService) {\n return;\n }\n const message = this.message();\n const index = this.activeVideoIndex();\n const title =\n this.payload().caption?.trim() || (this.videos().length > 1 ? `Video ${index + 1}` : 'Video');\n\n syncPlaybackInfoBarBanner(\n this.infoBarService,\n message,\n {\n title,\n currentTime: this.currentTime(),\n duration: this.duration() || this.videos()[index]?.duration || 0,\n isPlaying: this.isPlaying(),\n onTogglePlay: () => this.togglePlay(),\n onClose: () => this.pausePlayback(),\n },\n { forceOpen },\n );\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;AA2DM,MAAO,oCAAqC,SAAQ,8CAA8C,CAAA;IA6BtG,IAAI,GAAA;AACF,QAAA,OAAO,wBAAwB,CAA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AA,QAAA,EAAA,wCAAA,EAAA,MAAA,EAAA,CAAA,eAAA,EAAA,SAAA,EAAA,mBAAA,EAAA,qBAAA,EAAA,wBAAA,EAAA,mBAAA,EAAA,uBAAA,EAAA,WAAA,EAAA,qBAAA,CAAA,EAAA,OAAA,EAAA,CAAA,cAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FA4BhG,oCAAoC,EAAA,UAAA,EAAA,CAAA;kBA9BhD,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,gCAAgC,EAAA,OAAA,EACjC,CAAC,YAAY,EAAE,sCAAsC,EAAE,2CAA2C,CAAC,EAAA,eAAA,EAC3F,uBAAuB,CAAC,MAAM,EAAA,QAAA,EACrC;;;;;;;;;;;;;;;;;;;;;;;AAuBT,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,87CAAA,CAAA,EAAA;0HAS2C,sCAAsC,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,OAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,SAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;;;"}
@@ -0,0 +1,54 @@
1
+ import { s as resolvePersistableMediaUrl, c as resolvePersistedThumbnailUrl } from './acorex-components-conversation-acorex-components-conversation-YhVa42TC.mjs';
2
+
3
+ function loose(payload) {
4
+ return payload;
5
+ }
6
+ function str(value) {
7
+ return typeof value === 'string' && value.length > 0 ? value : undefined;
8
+ }
9
+ function num(value, fallback = 0) {
10
+ return typeof value === 'number' && Number.isFinite(value) ? value : fallback;
11
+ }
12
+ function sanitizeVideoItem(item) {
13
+ const url = resolvePersistableMediaUrl(item.url);
14
+ const thumbnailUrl = resolvePersistedThumbnailUrl(item.thumbnailUrl, url);
15
+ if (url === item.url && thumbnailUrl === item.thumbnailUrl) {
16
+ return item;
17
+ }
18
+ return { ...item, url, thumbnailUrl };
19
+ }
20
+ function normalizeVideoPayload(payload) {
21
+ const raw = loose(payload);
22
+ const existing = raw['videos'];
23
+ if (Array.isArray(existing) && existing.length > 0) {
24
+ return {
25
+ type: 'video',
26
+ videos: existing.map(sanitizeVideoItem),
27
+ caption: payload.caption,
28
+ };
29
+ }
30
+ const url = resolvePersistableMediaUrl(str(raw['url']));
31
+ const mediaId = str(raw['mediaId']);
32
+ if (url || mediaId) {
33
+ return {
34
+ type: 'video',
35
+ caption: payload.caption,
36
+ videos: [
37
+ {
38
+ ...(url ? { url } : {}),
39
+ thumbnailUrl: resolvePersistedThumbnailUrl(str(raw['thumbnailUrl']), url),
40
+ duration: num(raw['duration']),
41
+ width: num(raw['width']),
42
+ height: num(raw['height']),
43
+ mimeType: str(raw['mimeType']),
44
+ size: typeof raw['size'] === 'number' ? raw['size'] : undefined,
45
+ mediaId,
46
+ },
47
+ ],
48
+ };
49
+ }
50
+ return { type: 'video', videos: [], caption: payload.caption };
51
+ }
52
+
53
+ export { normalizeVideoPayload };
54
+ //# sourceMappingURL=acorex-components-conversation-video.payload-C8QaqxuX.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-components-conversation-video.payload-C8QaqxuX.mjs","sources":["../../../../packages/components/conversation/src/lib/plugins/message-list/components/video-renderer/video.payload.ts"],"sourcesContent":["import type { AXConversationVideoMediaItem, AXConversationVideoPayload } from '../../../../models';\nimport {\n resolvePersistableMediaUrl,\n resolvePersistedThumbnailUrl,\n} from '../../../composer/components/shared/persisted-media-url';\n\ntype AXConversationLooseRecord = Record<string, unknown>;\n\nfunction loose(payload: AXConversationVideoPayload): AXConversationLooseRecord {\n return payload as unknown as AXConversationLooseRecord;\n}\n\nfunction str(value: unknown): string | undefined {\n return typeof value === 'string' && value.length > 0 ? value : undefined;\n}\n\nfunction num(value: unknown, fallback = 0): number {\n return typeof value === 'number' && Number.isFinite(value) ? value : fallback;\n}\n\nfunction sanitizeVideoItem(item: AXConversationVideoMediaItem): AXConversationVideoMediaItem {\n const url = resolvePersistableMediaUrl(item.url);\n const thumbnailUrl = resolvePersistedThumbnailUrl(item.thumbnailUrl, url);\n if (url === item.url && thumbnailUrl === item.thumbnailUrl) {\n return item;\n }\n return { ...item, url, thumbnailUrl };\n}\n\nexport function normalizeVideoPayload(payload: AXConversationVideoPayload): AXConversationVideoPayload {\n const raw = loose(payload);\n const existing = raw['videos'];\n if (Array.isArray(existing) && existing.length > 0) {\n return {\n type: 'video',\n videos: (existing as AXConversationVideoMediaItem[]).map(sanitizeVideoItem),\n caption: payload.caption,\n };\n }\n\n const url = resolvePersistableMediaUrl(str(raw['url']));\n const mediaId = str(raw['mediaId']);\n if (url || mediaId) {\n return {\n type: 'video',\n caption: payload.caption,\n videos: [\n {\n ...(url ? { url } : {}),\n thumbnailUrl: resolvePersistedThumbnailUrl(str(raw['thumbnailUrl']), url),\n duration: num(raw['duration']),\n width: num(raw['width']),\n height: num(raw['height']),\n mimeType: str(raw['mimeType']),\n size: typeof raw['size'] === 'number' ? raw['size'] : undefined,\n mediaId,\n },\n ],\n };\n }\n\n return { type: 'video', videos: [], caption: payload.caption };\n}\n"],"names":[],"mappings":";;AAQA,SAAS,KAAK,CAAC,OAAmC,EAAA;AAChD,IAAA,OAAO,OAA+C;AACxD;AAEA,SAAS,GAAG,CAAC,KAAc,EAAA;AACzB,IAAA,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,GAAG,KAAK,GAAG,SAAS;AAC1E;AAEA,SAAS,GAAG,CAAC,KAAc,EAAE,QAAQ,GAAG,CAAC,EAAA;AACvC,IAAA,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,KAAK,GAAG,QAAQ;AAC/E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E,GAAG,CAAC;AACzE,oBAAA,QAAQ,EAAE,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;AAC9B,oBAAA,KAAK,EAAE,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACxB,oBAAA,MAAM,EAAE,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,oBAAA,QAAQ,EAAE,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;AAC9B,oBAAA,IAAI,EAAE,OAAO,GAAG,CAAC,MAAM,CAAC,KAAK,QAAQ,GAAG,GAAG,CAAC,MAAM,CAAC,GAAG,SAAS;oBAC/D,OAAO;AACR,iBAAA;AACF,aAAA;SACF;IACH;AAEA,IAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE;AAChE;;;;"}
@@ -0,0 +1,17 @@
1
+ function mergeVoiceUploadResult(payload, result) {
2
+ return {
3
+ ...payload,
4
+ type: 'voice',
5
+ url: result.url,
6
+ mediaId: result.mediaId,
7
+ mimeType: result.mimeType,
8
+ size: result.size,
9
+ metadata: result.metadata,
10
+ };
11
+ }
12
+ function applyVoiceLocalPreview(payload, localUrl) {
13
+ return { ...payload, type: 'voice', url: localUrl };
14
+ }
15
+
16
+ export { applyVoiceLocalPreview, mergeVoiceUploadResult };
17
+ //# sourceMappingURL=acorex-components-conversation-voice-composer.payload-DLVow7ex.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-components-conversation-voice-composer.payload-DLVow7ex.mjs","sources":["../../../../packages/components/conversation/src/lib/plugins/composer/components/voice-recorder/voice-composer.payload.ts"],"sourcesContent":["import type { AXUploadResult } from '@acorex/cdk/uploader';\nimport type { AXConversationMessagePayload } from '../../../../models';\n\nexport function mergeVoiceUploadResult(\n payload: AXConversationMessagePayload,\n result: AXUploadResult,\n): AXConversationMessagePayload {\n return {\n ...(payload as Extract<AXConversationMessagePayload, { type: 'voice' }>),\n type: 'voice',\n url: result.url,\n mediaId: result.mediaId,\n mimeType: result.mimeType,\n size: result.size,\n metadata: result.metadata,\n };\n}\n\nexport function applyVoiceLocalPreview(payload: AXConversationMessagePayload, localUrl: string): AXConversationMessagePayload {\n return { ...(payload as Extract<AXConversationMessagePayload, { type: 'voice' }>), type: 'voice', url: localUrl };\n}\n"],"names":[],"mappings":"AAGM,SAAU,sBAAsB,CACpC,OAAqC,EACrC,MAAsB,EAAA;IAEtB,OAAO;AACL,QAAA,GAAI,OAAoE;AACxE,QAAA,IAAI,EAAE,OAAO;QACb,GAAG,EAAE,MAAM,CAAC,GAAG;QACf,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,QAAQ,EAAE,MAAM,CAAC,QAAQ;KAC1B;AACH;AAEM,SAAU,sBAAsB,CAAC,OAAqC,EAAE,QAAgB,EAAA;AAC5F,IAAA,OAAO,EAAE,GAAI,OAAoE,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE;AACnH;;;;"}