@acorex/components 20.8.21 → 20.8.22
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/conversation2/index.d.ts +38 -25
- package/fesm2022/acorex-components-conversation2.mjs +165 -169
- package/fesm2022/acorex-components-conversation2.mjs.map +1 -1
- package/fesm2022/acorex-components-scheduler.mjs +1 -4
- package/fesm2022/acorex-components-scheduler.mjs.map +1 -1
- package/package.json +11 -11
- package/scheduler/index.d.ts +1 -3
package/conversation2/index.d.ts
CHANGED
|
@@ -13,7 +13,8 @@ import { AXContextMenuOpeningEvent, AXContextMenuItemsClickEvent } from '@acorex
|
|
|
13
13
|
import { AXBasePageComponent } from '@acorex/components/page';
|
|
14
14
|
import { AXTranslationService } from '@acorex/core/translation';
|
|
15
15
|
import { AXMapMarker } from '@acorex/components/map';
|
|
16
|
-
import
|
|
16
|
+
import * as _acorex_core_file from '@acorex/core/file';
|
|
17
|
+
import { AXFileTypeRegistryService, AXFileTypeOpenContext, AXFileTypeInfoProvider, AXFileType, AXFileService } from '@acorex/core/file';
|
|
17
18
|
import { SafeHtml } from '@angular/platform-browser';
|
|
18
19
|
import * as i1 from '@angular/common';
|
|
19
20
|
import * as i2 from '@angular/forms';
|
|
@@ -1372,6 +1373,10 @@ declare class AXComposerService {
|
|
|
1372
1373
|
onConversationChanged(previousConversationId: string | null, currentConversationId: string | null): void;
|
|
1373
1374
|
sendTypingIndicator(conversationId: string): Promise<void>;
|
|
1374
1375
|
sendMessage(command: AXSendMessageCommand, options?: AXSendMessageOptions): Promise<void>;
|
|
1376
|
+
/**
|
|
1377
|
+
* Resets composer input immediately when a send starts so upload/API work continues in the background.
|
|
1378
|
+
*/
|
|
1379
|
+
clearComposerInput(conversationId?: string): void;
|
|
1375
1380
|
/**
|
|
1376
1381
|
* Show a component in the composer (full-width mode)
|
|
1377
1382
|
*/
|
|
@@ -1448,8 +1453,6 @@ declare class AXComposerComponent implements OnDestroy {
|
|
|
1448
1453
|
readonly composerPopupComponent: typeof AXComposerPopupComponent;
|
|
1449
1454
|
/** Input placeholder - use service */
|
|
1450
1455
|
readonly placeholder: _angular_core.Signal<string>;
|
|
1451
|
-
/** Sending message state */
|
|
1452
|
-
readonly sendingMessage: _angular_core.WritableSignal<boolean>;
|
|
1453
1456
|
/** Typing indicator subject for rate limiting */
|
|
1454
1457
|
private readonly typingSubject;
|
|
1455
1458
|
constructor();
|
|
@@ -3899,6 +3902,12 @@ declare class AXCnvMediaPlaybackInfoBarBannerComponent implements AXMessageInfoB
|
|
|
3899
3902
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<AXCnvMediaPlaybackInfoBarBannerComponent, "ax-cnv-media-playback-info-bar-banner", never, { "message": { "alias": "message"; "required": true; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "currentTime": { "alias": "currentTime"; "required": false; "isSignal": true; }; "duration": { "alias": "duration"; "required": false; "isSignal": true; }; "isPlaying": { "alias": "isPlaying"; "required": false; "isSignal": true; }; "onTogglePlay": { "alias": "onTogglePlay"; "required": false; "isSignal": true; }; "playbackSpeed": { "alias": "playbackSpeed"; "required": false; "isSignal": true; }; "onCycleSpeed": { "alias": "onCycleSpeed"; "required": false; "isSignal": true; }; "showSpeedControl": { "alias": "showSpeedControl"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
3900
3903
|
}
|
|
3901
3904
|
|
|
3905
|
+
/** Caption first, else a label with optional extra lines (URLs, names). */
|
|
3906
|
+
declare function mediaCopyText(caption: string | undefined, singleLabel: string, pluralLabel: string, count: number, lines: (string | undefined)[]): string;
|
|
3907
|
+
/** Use file-type `copy` on the message when `message.fileType` is set; otherwise fallback. */
|
|
3908
|
+
declare function copyWithFileTypeFallback(message: AXMessage, registry: AXFileTypeRegistryService, fallback: () => string): Promise<string>;
|
|
3909
|
+
/** Use file-type `open` on the message when `message.fileType` is set. */
|
|
3910
|
+
declare function openWithFileType(message: AXMessage, registry: AXFileTypeRegistryService, ctx: AXFileTypeOpenContext): Promise<boolean>;
|
|
3902
3911
|
/**
|
|
3903
3912
|
* Registers the live renderer on {@link AXMessageListService} for message actions.
|
|
3904
3913
|
*/
|
|
@@ -5365,46 +5374,31 @@ declare class AXVoiceRecorderComponent {
|
|
|
5365
5374
|
}
|
|
5366
5375
|
|
|
5367
5376
|
declare class AXConversationAudioFileTypeProvider extends AXFileTypeInfoProvider {
|
|
5368
|
-
items(): Promise<AXFileType<Record<string, (ctx:
|
|
5369
|
-
readAsDataUrl: (file: File | Blob) => Promise<string>;
|
|
5370
|
-
platformId: object;
|
|
5371
|
-
}, ...args: unknown[]) => Promise<unknown> | unknown>>[]>;
|
|
5377
|
+
items(): Promise<AXFileType<Record<string, (ctx: _acorex_core_file.AXFileTypeContext, ...args: unknown[]) => Promise<unknown> | unknown>>[]>;
|
|
5372
5378
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXConversationAudioFileTypeProvider, never>;
|
|
5373
5379
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<AXConversationAudioFileTypeProvider>;
|
|
5374
5380
|
}
|
|
5375
5381
|
|
|
5376
5382
|
declare class AXConversationFileFileTypeProvider extends AXFileTypeInfoProvider {
|
|
5377
|
-
items(): Promise<AXFileType<Record<string, (ctx:
|
|
5378
|
-
readAsDataUrl: (file: File | Blob) => Promise<string>;
|
|
5379
|
-
platformId: object;
|
|
5380
|
-
}, ...args: unknown[]) => Promise<unknown> | unknown>>[]>;
|
|
5383
|
+
items(): Promise<AXFileType<Record<string, (ctx: _acorex_core_file.AXFileTypeContext, ...args: unknown[]) => Promise<unknown> | unknown>>[]>;
|
|
5381
5384
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXConversationFileFileTypeProvider, never>;
|
|
5382
5385
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<AXConversationFileFileTypeProvider>;
|
|
5383
5386
|
}
|
|
5384
5387
|
|
|
5385
5388
|
declare class AXConversationImageFileTypeProvider extends AXFileTypeInfoProvider {
|
|
5386
|
-
items(): Promise<AXFileType<Record<string, (ctx:
|
|
5387
|
-
readAsDataUrl: (file: File | Blob) => Promise<string>;
|
|
5388
|
-
platformId: object;
|
|
5389
|
-
}, ...args: unknown[]) => Promise<unknown> | unknown>>[]>;
|
|
5389
|
+
items(): Promise<AXFileType<Record<string, (ctx: _acorex_core_file.AXFileTypeContext, ...args: unknown[]) => Promise<unknown> | unknown>>[]>;
|
|
5390
5390
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXConversationImageFileTypeProvider, never>;
|
|
5391
5391
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<AXConversationImageFileTypeProvider>;
|
|
5392
5392
|
}
|
|
5393
5393
|
|
|
5394
5394
|
declare class AXConversationVideoFileTypeProvider extends AXFileTypeInfoProvider {
|
|
5395
|
-
items(): Promise<AXFileType<Record<string, (ctx:
|
|
5396
|
-
readAsDataUrl: (file: File | Blob) => Promise<string>;
|
|
5397
|
-
platformId: object;
|
|
5398
|
-
}, ...args: unknown[]) => Promise<unknown> | unknown>>[]>;
|
|
5395
|
+
items(): Promise<AXFileType<Record<string, (ctx: _acorex_core_file.AXFileTypeContext, ...args: unknown[]) => Promise<unknown> | unknown>>[]>;
|
|
5399
5396
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXConversationVideoFileTypeProvider, never>;
|
|
5400
5397
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<AXConversationVideoFileTypeProvider>;
|
|
5401
5398
|
}
|
|
5402
5399
|
|
|
5403
5400
|
declare class AXConversationVoiceFileTypeProvider extends AXFileTypeInfoProvider {
|
|
5404
|
-
items(): Promise<AXFileType<Record<string, (ctx:
|
|
5405
|
-
readAsDataUrl: (file: File | Blob) => Promise<string>;
|
|
5406
|
-
platformId: object;
|
|
5407
|
-
}, ...args: unknown[]) => Promise<unknown> | unknown>>[]>;
|
|
5401
|
+
items(): Promise<AXFileType<Record<string, (ctx: _acorex_core_file.AXFileTypeContext, ...args: unknown[]) => Promise<unknown> | unknown>>[]>;
|
|
5408
5402
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXConversationVoiceFileTypeProvider, never>;
|
|
5409
5403
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<AXConversationVoiceFileTypeProvider>;
|
|
5410
5404
|
}
|
|
@@ -5428,7 +5422,7 @@ declare const AX_CONVERSATION_COMPOSER_LOCATION_ACTION: AXComposerAction;
|
|
|
5428
5422
|
|
|
5429
5423
|
declare function mergeUploadResult(type: AXMessageType, payload: AXMessagePayload, result: AXUploadResult): AXMessagePayload;
|
|
5430
5424
|
declare function applyLocalPreview(type: AXMessageType, payload: AXMessagePayload, localUrl: string, mimeType?: string): AXMessagePayload;
|
|
5431
|
-
declare function toUploaderReference(payload: AXMessagePayload): AXUploaderReference;
|
|
5425
|
+
declare function toUploaderReference$1(payload: AXMessagePayload): AXUploaderReference;
|
|
5432
5426
|
declare function createObjectUrl(platformId: object, blob: Blob): string;
|
|
5433
5427
|
declare function revokeObjectUrl(platformId: object, url: string): void;
|
|
5434
5428
|
declare function createLocalPreviewUrl(fileService: AXFileService, platformId: object, source: File | Blob, messageType: AXMessageType): Promise<string | undefined>;
|
|
@@ -5988,6 +5982,25 @@ declare function validateLatitude(latitude: number | undefined | null): AXValida
|
|
|
5988
5982
|
*/
|
|
5989
5983
|
declare function validateLongitude(longitude: number | undefined | null): AXValidationResult;
|
|
5990
5984
|
|
|
5985
|
+
/** First non-empty URL for img/video/audio at runtime (includes resolved blob: URLs). */
|
|
5986
|
+
declare function pickDisplayMediaUrl(...candidates: (string | null | undefined)[]): string;
|
|
5987
|
+
|
|
5988
|
+
/** Format image message payload for rendering (array shape, safe thumbnails). */
|
|
5989
|
+
declare function normalizeImagePayload(payload: AXImagePayload): AXImagePayload;
|
|
5990
|
+
/** Preferred URL for grid / lightbox (never inline base64 thumbnails). */
|
|
5991
|
+
declare function resolveImageDisplayUrl(image: AXImageMediaItem): string | undefined;
|
|
5992
|
+
|
|
5993
|
+
declare function toUploaderReference(item: AXMediaItemFields): AXUploaderReference;
|
|
5994
|
+
|
|
5995
|
+
/**
|
|
5996
|
+
* Resolves multimedia payload URLs for renderers (direct url or mediaId via uploader).
|
|
5997
|
+
*/
|
|
5998
|
+
|
|
5999
|
+
/**
|
|
6000
|
+
* Creates a signal of the resolved playback URL for a media reference.
|
|
6001
|
+
*/
|
|
6002
|
+
declare function createResolvedMediaUrlSignal(reference: Signal<AXUploaderReference | undefined>): Signal<string | null>;
|
|
6003
|
+
|
|
5991
6004
|
/**
|
|
5992
6005
|
* Error Message Constants
|
|
5993
6006
|
* Centralized error messages with i18n support structure
|
|
@@ -6380,5 +6393,5 @@ declare function getErrorMessage(code: string, params?: Record<string, string |
|
|
|
6380
6393
|
*/
|
|
6381
6394
|
type AXErrorCode = typeof MESSAGE_ERRORS[keyof typeof MESSAGE_ERRORS]['code'] | typeof FILE_ERRORS[keyof typeof FILE_ERRORS]['code'] | typeof USER_ERRORS[keyof typeof USER_ERRORS]['code'] | typeof CONVERSATION_ERRORS[keyof typeof CONVERSATION_ERRORS]['code'] | typeof CONNECTION_ERRORS[keyof typeof CONNECTION_ERRORS]['code'] | typeof LOCATION_ERRORS[keyof typeof LOCATION_ERRORS]['code'] | typeof URL_ERRORS[keyof typeof URL_ERRORS]['code'];
|
|
6382
6395
|
|
|
6383
|
-
export { AXAudioPickerComponent, AXAudioRendererComponent, AXBaseRegistry, AXCnvMediaPlaybackInfoBarBannerComponent, AXComposerActionRegistry, AXComposerComponent, AXComposerPopupComponent, AXComposerService, AXComposerTabRegistry, AXConversation2Module, AXConversationAiApiKey, AXConversationAiResponderService, AXConversationApi, AXConversationContainerComponent, AXConversationContainerDirective, AXConversationDateUtilsService, AXConversationIndexedDbConversationApi, AXConversationIndexedDbMessageAiApi, AXConversationIndexedDbMessageApi, AXConversationIndexedDbRealtimeApi, AXConversationIndexedDbStorage, AXConversationIndexedDbStores, AXConversationIndexedDbUserApi, AXConversationInfoMediaViewComponent, AXConversationInfoPanelComponent, AXConversationItemActionRegistry, AXConversationMessageRendererStateComponent, AXConversationMessageUtilsService, AXConversationService, AXConversationSharedStorage, AXConversationTabRegistry, AXEmojiTabComponent, AXErrorHandlerService, AXFallbackRendererComponent, AXFilePickerComponent, AXFileRendererComponent, AXForwardMessageDialogComponent, AXImagePickerComponent, AXImageRendererComponent, AXInfiniteScrollDirective, AXInfoBarActionRegistry, AXInfoBarComponent, AXInfoBarSearchComponent, AXInfoBarService, AXLocationPickerComponent, AXLocationRendererComponent, AXMessageActionRegistry, AXMessageApi, AXMessageListComponent, AXMessageListNoActiveDefaultComponent, AXMessageListService, AXMessageRendererRegistry, AXNewConversationDialogComponent, AXPickerFooterComponent, AXPickerHeaderComponent, AXRealtimeApi, AXRegistryService, AXSidebarComponent, AXSidebarService, AXStickerRendererComponent, AXStickerTabComponent, AXSystemRendererComponent, AXTextRendererComponent, AXUserApi, AXVideoPickerComponent, AXVideoRendererComponent, AXVoiceRecorderComponent, AXVoiceRendererComponent, AX_CONVERSATION_AUDIO_RENDERER, AX_CONVERSATION_COMPOSER_AUDIO_ACTION, AX_CONVERSATION_COMPOSER_EMOJI_ACTION, AX_CONVERSATION_COMPOSER_EMOJI_TAB, AX_CONVERSATION_COMPOSER_FILE_ACTION, AX_CONVERSATION_COMPOSER_FILE_TYPE_PROVIDERS, AX_CONVERSATION_COMPOSER_IMAGE_ACTION, AX_CONVERSATION_COMPOSER_LOCATION_ACTION, AX_CONVERSATION_COMPOSER_STICKER_TAB, AX_CONVERSATION_COMPOSER_VIDEO_ACTION, AX_CONVERSATION_COMPOSER_VOICE_RECORDING_ACTION, AX_CONVERSATION_CONVERSATION_AVATAR_COMPONENT, AX_CONVERSATION_CURSOR_PREFIX, AX_CONVERSATION_FALLBACK_RENDERER, AX_CONVERSATION_FILE_RENDERER, AX_CONVERSATION_IMAGE_RENDERER, AX_CONVERSATION_INFO_BAR_ARCHIVE_ACTION, AX_CONVERSATION_INFO_BAR_BLOCK_ACTION, AX_CONVERSATION_INFO_BAR_DELETE_ACTION, AX_CONVERSATION_INFO_BAR_DIVIDER, AX_CONVERSATION_INFO_BAR_MUTE_ACTION, AX_CONVERSATION_INFO_BAR_SEARCH_ACTION, AX_CONVERSATION_ITEM_BLOCK_ACTION, AX_CONVERSATION_ITEM_DELETE_ACTION, AX_CONVERSATION_ITEM_DIVIDER, AX_CONVERSATION_ITEM_MARK_READ_ACTION, AX_CONVERSATION_ITEM_MUTE_ACTION, AX_CONVERSATION_ITEM_PIN_ACTION, AX_CONVERSATION_LOCATION_RENDERER, AX_CONVERSATION_MESSAGE_DELETE_ACTION, AX_CONVERSATION_MESSAGE_EDIT_ACTION, AX_CONVERSATION_MESSAGE_FORWARD_ACTION, AX_CONVERSATION_MESSAGE_REPLY_ACTION, AX_CONVERSATION_STICKER_RENDERER, AX_CONVERSATION_SYSTEM_RENDERER, AX_CONVERSATION_TAB_ALL, AX_CONVERSATION_TAB_ARCHIVED, AX_CONVERSATION_TAB_BOT, AX_CONVERSATION_TAB_CHANNELS, AX_CONVERSATION_TAB_GROUPS, AX_CONVERSATION_TAB_PRIVATE, AX_CONVERSATION_TAB_UNREAD, AX_CONVERSATION_TEXT_RENDERER, AX_CONVERSATION_USER_AVATAR_COMPONENT, AX_CONVERSATION_VIDEO_RENDERER, AX_CONVERSATION_VOICE_RENDERER, AX_DEFAULT_CONVERSATION_CONFIG, AX_MESSAGE_CURSOR_PREFIX, AX_STICKER_API_KEY, CONNECTION_ERRORS, CONVERSATION_CONFIG, CONVERSATION_ERRORS, CONVERSATION_FILE_TYPES_READY, DEFAULT_COMPOSER_ACTIONS, DEFAULT_COMPOSER_TABS, DEFAULT_CONVERSATION_ITEM_ACTIONS, DEFAULT_CONVERSATION_TABS, DEFAULT_INFO_BAR_ACTIONS, DEFAULT_MESSAGE_ACTIONS, DEFAULT_MESSAGE_RENDERERS, ERROR_HANDLER_CONFIG, ERROR_MESSAGES, FILE_ERRORS, LOCATION_ERRORS, MESSAGE_ERRORS, REGISTRY_CONFIG, URL_ERRORS, USER_ERRORS, applyConversationFilters, applyLocalPreview, axConversationIndexedDbStorage, conversationSharedStorage, createLocalPreviewUrl, createObjectUrl, encodeConversationCursor, encodeMessageCursor, formatErrorMessage, getConversationLastActivity, getConversationMessagesNewestFirst, getErrorMessage, getSortedConversationsForInbox, isGenericPrivateConversationTitle, mergeUploadResult, mergeWithDefaults, normalizeAllConversationMessageIndexes, paginateChatNewestFirst, paginateChatOldestFirst, parseChatCursor, provideConversation, provideConversationComposerFileTypes, provideConversationFileCatalog, registerChatMessage, resolveConversationAvatarDisplay, resolveConversationForViewer, resolveConversationTitleForViewer, resolveParticipantProfile, resolvePrivatePeerParticipant, resolvePrivatePeerUserId, resolveUserAvatarDisplay, revokeObjectUrl, sanitizeInput, shouldUseUserAvatarForConversation, sortConversationMessageIds, toUploaderReference, unregisterChatMessage, validateConversationId, validateEmail, validateLatitude, validateLongitude, validateMessagePayload, validateMessageText, validateMessageType, validateUrl, validateUserId, validateUserIds };
|
|
6396
|
+
export { AXAudioPickerComponent, AXAudioRendererComponent, AXBaseRegistry, AXCnvMediaPlaybackInfoBarBannerComponent, AXComposerActionRegistry, AXComposerComponent, AXComposerPopupComponent, AXComposerService, AXComposerTabRegistry, AXConversation2Module, AXConversationAiApiKey, AXConversationAiResponderService, AXConversationApi, AXConversationContainerComponent, AXConversationContainerDirective, AXConversationDateUtilsService, AXConversationIndexedDbConversationApi, AXConversationIndexedDbMessageAiApi, AXConversationIndexedDbMessageApi, AXConversationIndexedDbRealtimeApi, AXConversationIndexedDbStorage, AXConversationIndexedDbStores, AXConversationIndexedDbUserApi, AXConversationInfoMediaViewComponent, AXConversationInfoPanelComponent, AXConversationItemActionRegistry, AXConversationMessageRendererStateComponent, AXConversationMessageUtilsService, AXConversationService, AXConversationSharedStorage, AXConversationTabRegistry, AXEmojiTabComponent, AXErrorHandlerService, AXFallbackRendererComponent, AXFilePickerComponent, AXFileRendererComponent, AXForwardMessageDialogComponent, AXImagePickerComponent, AXImageRendererComponent, AXInfiniteScrollDirective, AXInfoBarActionRegistry, AXInfoBarComponent, AXInfoBarSearchComponent, AXInfoBarService, AXLocationPickerComponent, AXLocationRendererComponent, AXMessageActionRegistry, AXMessageApi, AXMessageListComponent, AXMessageListNoActiveDefaultComponent, AXMessageListService, AXMessageRendererCopyHostComponent, AXMessageRendererRegistry, AXNewConversationDialogComponent, AXPickerFooterComponent, AXPickerHeaderComponent, AXRealtimeApi, AXRegistryService, AXSidebarComponent, AXSidebarService, AXStickerRendererComponent, AXStickerTabComponent, AXSystemRendererComponent, AXTextRendererComponent, AXUserApi, AXVideoPickerComponent, AXVideoRendererComponent, AXVoiceRecorderComponent, AXVoiceRendererComponent, AX_CONVERSATION_AUDIO_RENDERER, AX_CONVERSATION_COMPOSER_AUDIO_ACTION, AX_CONVERSATION_COMPOSER_EMOJI_ACTION, AX_CONVERSATION_COMPOSER_EMOJI_TAB, AX_CONVERSATION_COMPOSER_FILE_ACTION, AX_CONVERSATION_COMPOSER_FILE_TYPE_PROVIDERS, AX_CONVERSATION_COMPOSER_IMAGE_ACTION, AX_CONVERSATION_COMPOSER_LOCATION_ACTION, AX_CONVERSATION_COMPOSER_STICKER_TAB, AX_CONVERSATION_COMPOSER_VIDEO_ACTION, AX_CONVERSATION_COMPOSER_VOICE_RECORDING_ACTION, AX_CONVERSATION_CONVERSATION_AVATAR_COMPONENT, AX_CONVERSATION_CURSOR_PREFIX, AX_CONVERSATION_FALLBACK_RENDERER, AX_CONVERSATION_FILE_RENDERER, AX_CONVERSATION_IMAGE_RENDERER, AX_CONVERSATION_INFO_BAR_ARCHIVE_ACTION, AX_CONVERSATION_INFO_BAR_BLOCK_ACTION, AX_CONVERSATION_INFO_BAR_DELETE_ACTION, AX_CONVERSATION_INFO_BAR_DIVIDER, AX_CONVERSATION_INFO_BAR_MUTE_ACTION, AX_CONVERSATION_INFO_BAR_SEARCH_ACTION, AX_CONVERSATION_ITEM_BLOCK_ACTION, AX_CONVERSATION_ITEM_DELETE_ACTION, AX_CONVERSATION_ITEM_DIVIDER, AX_CONVERSATION_ITEM_MARK_READ_ACTION, AX_CONVERSATION_ITEM_MUTE_ACTION, AX_CONVERSATION_ITEM_PIN_ACTION, AX_CONVERSATION_LOCATION_RENDERER, AX_CONVERSATION_MESSAGE_DELETE_ACTION, AX_CONVERSATION_MESSAGE_EDIT_ACTION, AX_CONVERSATION_MESSAGE_FORWARD_ACTION, AX_CONVERSATION_MESSAGE_REPLY_ACTION, AX_CONVERSATION_STICKER_RENDERER, AX_CONVERSATION_SYSTEM_RENDERER, AX_CONVERSATION_TAB_ALL, AX_CONVERSATION_TAB_ARCHIVED, AX_CONVERSATION_TAB_BOT, AX_CONVERSATION_TAB_CHANNELS, AX_CONVERSATION_TAB_GROUPS, AX_CONVERSATION_TAB_PRIVATE, AX_CONVERSATION_TAB_UNREAD, AX_CONVERSATION_TEXT_RENDERER, AX_CONVERSATION_USER_AVATAR_COMPONENT, AX_CONVERSATION_VIDEO_RENDERER, AX_CONVERSATION_VOICE_RENDERER, AX_DEFAULT_CONVERSATION_CONFIG, AX_MESSAGE_CURSOR_PREFIX, AX_STICKER_API_KEY, CONNECTION_ERRORS, CONVERSATION_CONFIG, CONVERSATION_ERRORS, CONVERSATION_FILE_TYPES_READY, DEFAULT_COMPOSER_ACTIONS, DEFAULT_COMPOSER_TABS, DEFAULT_CONVERSATION_ITEM_ACTIONS, DEFAULT_CONVERSATION_TABS, DEFAULT_INFO_BAR_ACTIONS, DEFAULT_MESSAGE_ACTIONS, DEFAULT_MESSAGE_RENDERERS, ERROR_HANDLER_CONFIG, ERROR_MESSAGES, FILE_ERRORS, LOCATION_ERRORS, MESSAGE_ERRORS, REGISTRY_CONFIG, URL_ERRORS, USER_ERRORS, applyConversationFilters, applyLocalPreview, axConversationIndexedDbStorage, conversationSharedStorage, copyWithFileTypeFallback, createLocalPreviewUrl, createObjectUrl, createResolvedMediaUrlSignal, encodeConversationCursor, encodeMessageCursor, formatErrorMessage, getConversationLastActivity, getConversationMessagesNewestFirst, getErrorMessage, getSortedConversationsForInbox, isGenericPrivateConversationTitle, mediaCopyText, mergeUploadResult, mergeWithDefaults, normalizeAllConversationMessageIndexes, normalizeImagePayload, openWithFileType, paginateChatNewestFirst, paginateChatOldestFirst, parseChatCursor, pickDisplayMediaUrl, provideConversation, provideConversationComposerFileTypes, provideConversationFileCatalog, registerChatMessage, resolveConversationAvatarDisplay, resolveConversationForViewer, resolveConversationTitleForViewer, resolveImageDisplayUrl, resolveParticipantProfile, resolvePrivatePeerParticipant, resolvePrivatePeerUserId, resolveUserAvatarDisplay, revokeObjectUrl, sanitizeInput, shouldUseUserAvatarForConversation, sortConversationMessageIds, toUploaderReference as toMediaItemUploaderReference, toUploaderReference$1 as toUploaderReference, unregisterChatMessage, validateConversationId, validateEmail, validateLatitude, validateLongitude, validateMessagePayload, validateMessageText, validateMessageType, validateUrl, validateUserId, validateUserIds };
|
|
6384
6397
|
export type { AXApiError, AXAudioMediaItem, AXAudioPayload, AXBlockReportReason, AXCallEvent, AXChatCursorKind, AXComposerAction, AXComposerActionComponent, AXComposerActionContext, AXComposerActiveComponent, AXComposerTab, AXConnectionEvent, AXConnectionOptions, AXConnectionStatus, AXConversation, AXConversationAiResponderConfig, AXConversationAvatarComponents, AXConversationAvatarDisplay, AXConversationAvatarKind, AXConversationConfig, AXConversationConversationAvatarComponent, AXConversationCreateData, AXConversationError, AXConversationFilter, AXConversationFilters, AXConversationIndexedDbMediaRecord, AXConversationItemAction, AXConversationItemActionContext, AXConversationMetadata, AXConversationOptions, AXConversationSettings, AXConversationSettingsUpdate, AXConversationSort, AXConversationStatus, AXConversationTab, AXConversationType, AXConversationUpdateData, AXConversationUploadOptions, AXConversationUserAvatarComponent, AXDeleteMessageCommand, AXEditMessageCommand, AXErrorCode, AXErrorHandlerConfig, AXErrorMessage, AXErrorSeverity, AXFileMediaItem, AXFilePayload, AXGroupedReaction, AXImageMediaItem, AXImagePayload, AXInfoBarAction, AXInfoBarActionComponent, AXInfoBarActionContext, AXInfoBarActiveBanner, AXInfoBarActiveComponent, AXLink, AXLinkPreview, AXLoadMessagesResult, AXLocationPayload, AXMediaItemFields, AXMention, AXMessage, AXMessageAction, AXMessageActionContext, AXMessageForwardData, AXMessageInfoBarBannerComponent, AXMessageListEmptyComponent, AXMessagePayload, AXMessageRenderer, AXMessageRendererCapabilities, AXMessageRendererComponent, AXMessageRendererContentState, AXMessageRendererState, AXMessageSearchFilters, AXMessageStatus, AXMessageType, AXNotificationEvent, AXPaginatedResult, AXPagination, AXPaginationState, AXParsedChatCursor, AXParticipant, AXParticipantRole, AXParticipantStatus, AXParticipantUpdate, AXPinnedMessage, AXPlaybackBannerInputs, AXPollOption, AXPollPayload, AXPresenceStatus, AXPresenceUpdate, AXReaction, AXReadReceipt, AXRegistryConfiguration, AXRegistryItem, AXSendMessageCommand, AXSendMessageOptions, AXSendMessageUploadSource, AXStickerPayload, AXSystemPayload, AXTextFormat, AXTextPayload, AXTypingIndicator, AXUploaderReference, AXUploaderResult, AXUserProfile, AXUserProfileUpdate, AXUserRole, AXUserSearchFilters, AXValidationResult, AXVideoMediaItem, AXVideoPayload, AXVoicePayload, DropdownMenuItem, UploaderFilePreview };
|
|
@@ -10,7 +10,7 @@ import * as i3 from '@acorex/core/translation';
|
|
|
10
10
|
import { translateSync, AXTranslationService, AXTranslationModule } from '@acorex/core/translation';
|
|
11
11
|
import { Subject, BehaviorSubject, Observable, filter, firstValueFrom, takeUntil, catchError, EMPTY } from 'rxjs';
|
|
12
12
|
import { AXUploaderBrowseDirective, AXUploaderZoneDirective, AXUploaderService } from '@acorex/cdk/uploader';
|
|
13
|
-
import { createFileTypeMetadata, AXFileTypeInfoProvider, formatFileSizeBytes, AXFileService, AXFileTypeRegistryService, provideFileValidationRules, provideFileTypeInfoProvider, resolveFileCopyText } from '@acorex/core/file';
|
|
13
|
+
import { createFileTypeMetadata, AXFileTypeInfoProvider, formatFileSizeBytes, AXFileService, AXFileTypeRegistryService, provideFileValidationRules, provideFileTypeInfoProvider, resolveFileCopyText, runFileTypeOpen } from '@acorex/core/file';
|
|
14
14
|
import * as i1$2 from '@acorex/components/progress-bar';
|
|
15
15
|
import { AXProgressBarModule } from '@acorex/components/progress-bar';
|
|
16
16
|
import { AXToastService } from '@acorex/components/toast';
|
|
@@ -2958,9 +2958,22 @@ class AXComposerService {
|
|
|
2958
2958
|
await this.conversationService.sendTypingIndicator(conversationId);
|
|
2959
2959
|
}
|
|
2960
2960
|
async sendMessage(command, options) {
|
|
2961
|
+
this.clearComposerInput(command.conversationId);
|
|
2961
2962
|
await this.conversationService.sendMessage(command, options);
|
|
2963
|
+
}
|
|
2964
|
+
/**
|
|
2965
|
+
* Resets composer input immediately when a send starts so upload/API work continues in the background.
|
|
2966
|
+
*/
|
|
2967
|
+
clearComposerInput(conversationId) {
|
|
2968
|
+
this.draftText.set('');
|
|
2969
|
+
this.attachments.set([]);
|
|
2962
2970
|
this.hideComponent();
|
|
2963
|
-
this.
|
|
2971
|
+
this._replyMessage.set(null);
|
|
2972
|
+
this._editMessage.set(null);
|
|
2973
|
+
if (conversationId) {
|
|
2974
|
+
this.clearDraft(conversationId);
|
|
2975
|
+
}
|
|
2976
|
+
this.focusComposer();
|
|
2964
2977
|
}
|
|
2965
2978
|
/**
|
|
2966
2979
|
* Show a component in the composer (full-width mode)
|
|
@@ -3964,17 +3977,12 @@ class AXAudioPickerComponent {
|
|
|
3964
3977
|
},
|
|
3965
3978
|
};
|
|
3966
3979
|
this.retainUploadedOnDismiss = true;
|
|
3967
|
-
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
this.dismissPicker();
|
|
3972
|
-
dismissComposerPickerHost(this.composerService, popup);
|
|
3973
|
-
}
|
|
3974
|
-
}
|
|
3975
|
-
catch {
|
|
3980
|
+
const popup = this.__popup__();
|
|
3981
|
+
this.dismissPicker();
|
|
3982
|
+
dismissComposerPickerHost(this.composerService, popup);
|
|
3983
|
+
void this.composerService.sendMessage(command).catch(() => {
|
|
3976
3984
|
this.retainUploadedOnDismiss = false;
|
|
3977
|
-
}
|
|
3985
|
+
});
|
|
3978
3986
|
}
|
|
3979
3987
|
canSend() {
|
|
3980
3988
|
const list = this.audioFiles();
|
|
@@ -4383,17 +4391,12 @@ class AXFilePickerComponent {
|
|
|
4383
4391
|
},
|
|
4384
4392
|
};
|
|
4385
4393
|
this.retainUploadedOnDismiss = true;
|
|
4386
|
-
|
|
4387
|
-
|
|
4388
|
-
|
|
4389
|
-
|
|
4390
|
-
this.dismissPicker();
|
|
4391
|
-
dismissComposerPickerHost(this.composerService, popup);
|
|
4392
|
-
}
|
|
4393
|
-
}
|
|
4394
|
-
catch {
|
|
4394
|
+
const popup = this.__popup__();
|
|
4395
|
+
this.dismissPicker();
|
|
4396
|
+
dismissComposerPickerHost(this.composerService, popup);
|
|
4397
|
+
void this.composerService.sendMessage(command).catch(() => {
|
|
4395
4398
|
this.retainUploadedOnDismiss = false;
|
|
4396
|
-
}
|
|
4399
|
+
});
|
|
4397
4400
|
}
|
|
4398
4401
|
updateFileProgress(index, progress, uploading, uploaded = false, uploadedUrl, mediaId, error) {
|
|
4399
4402
|
if (this.uploadsDismissed) {
|
|
@@ -4845,17 +4848,12 @@ class AXImagePickerComponent {
|
|
|
4845
4848
|
},
|
|
4846
4849
|
};
|
|
4847
4850
|
this.retainUploadedOnDismiss = true;
|
|
4848
|
-
|
|
4849
|
-
|
|
4850
|
-
|
|
4851
|
-
|
|
4852
|
-
this.dismissPicker();
|
|
4853
|
-
dismissComposerPickerHost(this.composerService, popup);
|
|
4854
|
-
}
|
|
4855
|
-
}
|
|
4856
|
-
catch {
|
|
4851
|
+
const popup = this.__popup__();
|
|
4852
|
+
this.dismissPicker();
|
|
4853
|
+
dismissComposerPickerHost(this.composerService, popup);
|
|
4854
|
+
void this.composerService.sendMessage(command).catch(() => {
|
|
4857
4855
|
this.retainUploadedOnDismiss = false;
|
|
4858
|
-
}
|
|
4856
|
+
});
|
|
4859
4857
|
}
|
|
4860
4858
|
canSend() {
|
|
4861
4859
|
const list = this.images();
|
|
@@ -5111,8 +5109,10 @@ class AXLocationPickerComponent {
|
|
|
5111
5109
|
type: 'location',
|
|
5112
5110
|
payload: location,
|
|
5113
5111
|
};
|
|
5114
|
-
await this.composerService.sendMessage(command);
|
|
5115
5112
|
this.cancel();
|
|
5113
|
+
void this.composerService.sendMessage(command).catch((error) => {
|
|
5114
|
+
console.error('Failed to send location:', error);
|
|
5115
|
+
});
|
|
5116
5116
|
}
|
|
5117
5117
|
cancel() {
|
|
5118
5118
|
// Reset to default location
|
|
@@ -5361,17 +5361,12 @@ class AXVideoPickerComponent {
|
|
|
5361
5361
|
},
|
|
5362
5362
|
};
|
|
5363
5363
|
this.retainUploadedOnDismiss = true;
|
|
5364
|
-
|
|
5365
|
-
|
|
5366
|
-
|
|
5367
|
-
|
|
5368
|
-
this.dismissPicker();
|
|
5369
|
-
dismissComposerPickerHost(this.composerService, popup);
|
|
5370
|
-
}
|
|
5371
|
-
}
|
|
5372
|
-
catch {
|
|
5364
|
+
const popup = this.__popup__();
|
|
5365
|
+
this.dismissPicker();
|
|
5366
|
+
dismissComposerPickerHost(this.composerService, popup);
|
|
5367
|
+
void this.composerService.sendMessage(command).catch(() => {
|
|
5373
5368
|
this.retainUploadedOnDismiss = false;
|
|
5374
|
-
}
|
|
5369
|
+
});
|
|
5375
5370
|
}
|
|
5376
5371
|
canSend() {
|
|
5377
5372
|
const list = this.videos();
|
|
@@ -5778,44 +5773,44 @@ class AXVoiceRecorderComponent {
|
|
|
5778
5773
|
const uploadSignal = this.uploadAbortController.signal;
|
|
5779
5774
|
this.isUploading.set(true);
|
|
5780
5775
|
this.uploadProgress.set(0);
|
|
5781
|
-
|
|
5782
|
-
|
|
5783
|
-
|
|
5776
|
+
const command = {
|
|
5777
|
+
conversationId: conversation.id,
|
|
5778
|
+
type: 'voice',
|
|
5779
|
+
payload: {
|
|
5784
5780
|
type: 'voice',
|
|
5785
|
-
|
|
5786
|
-
|
|
5787
|
-
|
|
5788
|
-
|
|
5789
|
-
|
|
5790
|
-
|
|
5791
|
-
|
|
5792
|
-
|
|
5793
|
-
|
|
5794
|
-
|
|
5795
|
-
|
|
5796
|
-
|
|
5797
|
-
|
|
5798
|
-
|
|
5799
|
-
|
|
5800
|
-
|
|
5801
|
-
|
|
5802
|
-
},
|
|
5803
|
-
signal: uploadSignal,
|
|
5781
|
+
url: '',
|
|
5782
|
+
duration: this.recordingDuration(),
|
|
5783
|
+
size: audioBlob.size,
|
|
5784
|
+
mimeType: 'audio/webm',
|
|
5785
|
+
},
|
|
5786
|
+
};
|
|
5787
|
+
this.composerService.hideComponent();
|
|
5788
|
+
void this.composerService
|
|
5789
|
+
.sendMessage(command, {
|
|
5790
|
+
media: {
|
|
5791
|
+
source: audioBlob,
|
|
5792
|
+
fileName: `voice-${Date.now()}.webm`,
|
|
5793
|
+
mimeType: 'audio/webm',
|
|
5794
|
+
onProgress: (percent) => {
|
|
5795
|
+
if (!uploadSignal.aborted) {
|
|
5796
|
+
this.uploadProgress.set(percent);
|
|
5797
|
+
}
|
|
5804
5798
|
},
|
|
5805
|
-
|
|
5806
|
-
|
|
5807
|
-
|
|
5799
|
+
signal: uploadSignal,
|
|
5800
|
+
},
|
|
5801
|
+
})
|
|
5802
|
+
.catch((error) => {
|
|
5808
5803
|
if (!isUploadAborted(error, uploadSignal)) {
|
|
5809
5804
|
console.error('Failed to send voice message:', error);
|
|
5810
5805
|
}
|
|
5811
|
-
}
|
|
5812
|
-
|
|
5806
|
+
})
|
|
5807
|
+
.finally(() => {
|
|
5813
5808
|
this.uploadAbortController = undefined;
|
|
5814
5809
|
if (!uploadSignal.aborted) {
|
|
5815
5810
|
this.isUploading.set(false);
|
|
5816
5811
|
this.uploadProgress.set(0);
|
|
5817
5812
|
}
|
|
5818
|
-
}
|
|
5813
|
+
});
|
|
5819
5814
|
}
|
|
5820
5815
|
stopAndCleanup() {
|
|
5821
5816
|
this.abortInProgressUploads();
|
|
@@ -10741,6 +10736,58 @@ class AXConversationDateUtilsService {
|
|
|
10741
10736
|
}
|
|
10742
10737
|
}
|
|
10743
10738
|
|
|
10739
|
+
function toUploaderReference(item) {
|
|
10740
|
+
return {
|
|
10741
|
+
url: item.url,
|
|
10742
|
+
mediaId: item.mediaId,
|
|
10743
|
+
mimeType: item.mimeType,
|
|
10744
|
+
size: item.size,
|
|
10745
|
+
};
|
|
10746
|
+
}
|
|
10747
|
+
|
|
10748
|
+
/**
|
|
10749
|
+
* Resolves multimedia payload URLs for renderers (direct url or mediaId via uploader).
|
|
10750
|
+
*/
|
|
10751
|
+
/**
|
|
10752
|
+
* Creates a signal of the resolved playback URL for a media reference.
|
|
10753
|
+
*/
|
|
10754
|
+
function createResolvedMediaUrlSignal(reference) {
|
|
10755
|
+
const uploader = inject(AXUploaderService);
|
|
10756
|
+
const destroyRef = inject(DestroyRef);
|
|
10757
|
+
const resolvedUrl = signal(null, ...(ngDevMode ? [{ debugName: "resolvedUrl" }] : []));
|
|
10758
|
+
let abortController = null;
|
|
10759
|
+
effect(() => {
|
|
10760
|
+
const ref = reference();
|
|
10761
|
+
abortController?.abort();
|
|
10762
|
+
abortController = new AbortController();
|
|
10763
|
+
const trimmedUrl = ref?.url?.trim();
|
|
10764
|
+
if (!trimmedUrl && !ref?.mediaId) {
|
|
10765
|
+
resolvedUrl.set(null);
|
|
10766
|
+
return;
|
|
10767
|
+
}
|
|
10768
|
+
const directUrl = trimmedUrl && !isNonPersistableMediaUrl(trimmedUrl) ? trimmedUrl : undefined;
|
|
10769
|
+
if (!ref?.mediaId) {
|
|
10770
|
+
resolvedUrl.set(directUrl ?? null);
|
|
10771
|
+
return;
|
|
10772
|
+
}
|
|
10773
|
+
resolvedUrl.set(directUrl ?? null);
|
|
10774
|
+
void uploader
|
|
10775
|
+
.resolvePlaybackUrl(ref, abortController.signal)
|
|
10776
|
+
.then((url) => {
|
|
10777
|
+
if (!abortController?.signal.aborted) {
|
|
10778
|
+
resolvedUrl.set(url);
|
|
10779
|
+
}
|
|
10780
|
+
})
|
|
10781
|
+
.catch(() => {
|
|
10782
|
+
if (!abortController?.signal.aborted && directUrl) {
|
|
10783
|
+
resolvedUrl.set(directUrl);
|
|
10784
|
+
}
|
|
10785
|
+
});
|
|
10786
|
+
});
|
|
10787
|
+
destroyRef.onDestroy(() => abortController?.abort());
|
|
10788
|
+
return resolvedUrl.asReadonly();
|
|
10789
|
+
}
|
|
10790
|
+
|
|
10744
10791
|
function isMessageDeliveryPending(status) {
|
|
10745
10792
|
return status === 'sending';
|
|
10746
10793
|
}
|
|
@@ -10939,15 +10986,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
|
|
|
10939
10986
|
`, styles: [":host{display:block}.ax-cnv-fallback{display:flex;flex-direction:column;gap:.375rem;max-width:min(100%,18rem)}.ax-cnv-renderer-state__row{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem;padding:.375rem .5rem;border-radius:var(--ax-sys-border-radius);font-size:.8125rem;line-height:1.35}.ax-cnv-renderer-state__row--warn{background:rgb(var(--ax-sys-color-warning-lightest-surface));color:rgb(var(--ax-sys-color-warning-800))}.ax-cnv-renderer-state__msg{flex:1;min-width:0}\n"] }]
|
|
10940
10987
|
}] });
|
|
10941
10988
|
|
|
10942
|
-
function toUploaderReference(item) {
|
|
10943
|
-
return {
|
|
10944
|
-
url: item.url,
|
|
10945
|
-
mediaId: item.mediaId,
|
|
10946
|
-
mimeType: item.mimeType,
|
|
10947
|
-
size: item.size,
|
|
10948
|
-
};
|
|
10949
|
-
}
|
|
10950
|
-
|
|
10951
10989
|
/** Shared formatting for message renderer UIs. */
|
|
10952
10990
|
function formatMediaDuration(seconds) {
|
|
10953
10991
|
if (!Number.isFinite(seconds)) {
|
|
@@ -10967,49 +11005,6 @@ function formatFileByteSize(bytes) {
|
|
|
10967
11005
|
return `${Math.round((bytes / k ** i) * 100) / 100} ${sizes[i]}`;
|
|
10968
11006
|
}
|
|
10969
11007
|
|
|
10970
|
-
/**
|
|
10971
|
-
* Resolves multimedia payload URLs for renderers (direct url or mediaId via uploader).
|
|
10972
|
-
*/
|
|
10973
|
-
/**
|
|
10974
|
-
* Creates a signal of the resolved playback URL for a media reference.
|
|
10975
|
-
*/
|
|
10976
|
-
function createResolvedMediaUrlSignal(reference) {
|
|
10977
|
-
const uploader = inject(AXUploaderService);
|
|
10978
|
-
const destroyRef = inject(DestroyRef);
|
|
10979
|
-
const resolvedUrl = signal(null, ...(ngDevMode ? [{ debugName: "resolvedUrl" }] : []));
|
|
10980
|
-
let abortController = null;
|
|
10981
|
-
effect(() => {
|
|
10982
|
-
const ref = reference();
|
|
10983
|
-
abortController?.abort();
|
|
10984
|
-
abortController = new AbortController();
|
|
10985
|
-
const trimmedUrl = ref?.url?.trim();
|
|
10986
|
-
if (!trimmedUrl && !ref?.mediaId) {
|
|
10987
|
-
resolvedUrl.set(null);
|
|
10988
|
-
return;
|
|
10989
|
-
}
|
|
10990
|
-
const directUrl = trimmedUrl && !isNonPersistableMediaUrl(trimmedUrl) ? trimmedUrl : undefined;
|
|
10991
|
-
if (!ref?.mediaId) {
|
|
10992
|
-
resolvedUrl.set(directUrl ?? null);
|
|
10993
|
-
return;
|
|
10994
|
-
}
|
|
10995
|
-
resolvedUrl.set(directUrl ?? null);
|
|
10996
|
-
void uploader
|
|
10997
|
-
.resolvePlaybackUrl(ref, abortController.signal)
|
|
10998
|
-
.then((url) => {
|
|
10999
|
-
if (!abortController?.signal.aborted) {
|
|
11000
|
-
resolvedUrl.set(url);
|
|
11001
|
-
}
|
|
11002
|
-
})
|
|
11003
|
-
.catch(() => {
|
|
11004
|
-
if (!abortController?.signal.aborted && directUrl) {
|
|
11005
|
-
resolvedUrl.set(directUrl);
|
|
11006
|
-
}
|
|
11007
|
-
});
|
|
11008
|
-
});
|
|
11009
|
-
destroyRef.onDestroy(() => abortController?.abort());
|
|
11010
|
-
return resolvedUrl.asReadonly();
|
|
11011
|
-
}
|
|
11012
|
-
|
|
11013
11008
|
class AXAudioAttachmentComponent {
|
|
11014
11009
|
constructor() {
|
|
11015
11010
|
this.item = input.required(...(ngDevMode ? [{ debugName: "item" }] : []));
|
|
@@ -13084,6 +13079,18 @@ async function copyWithFileTypeFallback(message, registry, fallback) {
|
|
|
13084
13079
|
const result = await fileType.copy(message.payload);
|
|
13085
13080
|
return resolveFileCopyText(result)?.trim() || fallback();
|
|
13086
13081
|
}
|
|
13082
|
+
/** Use file-type `open` on the message when `message.fileType` is set. */
|
|
13083
|
+
async function openWithFileType(message, registry, ctx) {
|
|
13084
|
+
if (!message.fileType) {
|
|
13085
|
+
return false;
|
|
13086
|
+
}
|
|
13087
|
+
const fileType = await registry.get(message.fileType);
|
|
13088
|
+
if (!fileType?.open) {
|
|
13089
|
+
return false;
|
|
13090
|
+
}
|
|
13091
|
+
const result = await runFileTypeOpen(fileType, ctx, message.payload);
|
|
13092
|
+
return result !== false;
|
|
13093
|
+
}
|
|
13087
13094
|
/**
|
|
13088
13095
|
* Registers the live renderer on {@link AXMessageListService} for message actions.
|
|
13089
13096
|
*/
|
|
@@ -16529,8 +16536,6 @@ class AXComposerComponent {
|
|
|
16529
16536
|
this.composerPopupComponent = AXComposerPopupComponent;
|
|
16530
16537
|
/** Input placeholder - use service */
|
|
16531
16538
|
this.placeholder = this.composerService.placeholder;
|
|
16532
|
-
/** Sending message state */
|
|
16533
|
-
this.sendingMessage = signal(false, ...(ngDevMode ? [{ debugName: "sendingMessage" }] : []));
|
|
16534
16539
|
/** Typing indicator subject for rate limiting */
|
|
16535
16540
|
this.typingSubject = new Subject();
|
|
16536
16541
|
// Focus text area when requested via AXComposerService.focusComposer()
|
|
@@ -16657,51 +16662,44 @@ class AXComposerComponent {
|
|
|
16657
16662
|
}
|
|
16658
16663
|
/** Handle send click */
|
|
16659
16664
|
async onSendClick() {
|
|
16660
|
-
if (!this.canSend()
|
|
16665
|
+
if (!this.canSend())
|
|
16661
16666
|
return;
|
|
16662
16667
|
const conversation = this.activeConversation();
|
|
16663
16668
|
if (!conversation)
|
|
16664
16669
|
return;
|
|
16665
16670
|
const text = this.draftText().trim();
|
|
16666
16671
|
const editingMsg = this.editingMessage();
|
|
16667
|
-
|
|
16668
|
-
|
|
16669
|
-
// Check if we're editing a message
|
|
16670
|
-
if (editingMsg) {
|
|
16671
|
-
// Edit existing message
|
|
16672
|
+
if (editingMsg) {
|
|
16673
|
+
try {
|
|
16672
16674
|
await this.conversationService.editMessage(editingMsg.id, { type: 'text', text });
|
|
16673
|
-
|
|
16674
|
-
|
|
16675
|
-
|
|
16676
|
-
const command = {
|
|
16677
|
-
conversationId: conversation.id,
|
|
16678
|
-
type: 'text',
|
|
16679
|
-
payload: { type: 'text', text },
|
|
16680
|
-
replyToId: this.replyingToMessage()?.id,
|
|
16681
|
-
};
|
|
16682
|
-
// Send new message
|
|
16683
|
-
await this.composerService.sendMessage(command);
|
|
16684
|
-
this.messageSent.emit(command);
|
|
16685
|
-
// Request message list to scroll to bottom after sending
|
|
16686
|
-
this.messageListService.requestScrollToBottom();
|
|
16687
|
-
}
|
|
16688
|
-
// Clear input and draft
|
|
16689
|
-
this.draftText.set('');
|
|
16690
|
-
this.attachments.set([]);
|
|
16691
|
-
this.cancelEditReply();
|
|
16692
|
-
this.composerService.clear();
|
|
16693
|
-
// Clear saved draft after successful send
|
|
16694
|
-
if (conversation.id) {
|
|
16675
|
+
this.draftText.set('');
|
|
16676
|
+
this.attachments.set([]);
|
|
16677
|
+
this.cancelEditReply();
|
|
16695
16678
|
this.composerService.clearDraft(conversation.id);
|
|
16679
|
+
this.composerService.focusComposer();
|
|
16696
16680
|
}
|
|
16697
|
-
|
|
16698
|
-
|
|
16699
|
-
|
|
16700
|
-
|
|
16701
|
-
}
|
|
16702
|
-
finally {
|
|
16703
|
-
this.sendingMessage.set(false);
|
|
16681
|
+
catch (error) {
|
|
16682
|
+
console.error('Failed to edit message:', error);
|
|
16683
|
+
}
|
|
16684
|
+
return;
|
|
16704
16685
|
}
|
|
16686
|
+
const command = {
|
|
16687
|
+
conversationId: conversation.id,
|
|
16688
|
+
type: 'text',
|
|
16689
|
+
payload: { type: 'text', text },
|
|
16690
|
+
replyToId: this.replyingToMessage()?.id,
|
|
16691
|
+
};
|
|
16692
|
+
this.editingMessage.set(null);
|
|
16693
|
+
this.replyingToMessage.set(null);
|
|
16694
|
+
void this.composerService
|
|
16695
|
+
.sendMessage(command)
|
|
16696
|
+
.then(() => {
|
|
16697
|
+
this.messageSent.emit(command);
|
|
16698
|
+
this.messageListService.requestScrollToBottom();
|
|
16699
|
+
})
|
|
16700
|
+
.catch((error) => {
|
|
16701
|
+
console.error('Failed to send message:', error);
|
|
16702
|
+
});
|
|
16705
16703
|
}
|
|
16706
16704
|
/** Handle emoji click */
|
|
16707
16705
|
async onEmojiClick(event) {
|
|
@@ -16755,16 +16753,14 @@ class AXComposerComponent {
|
|
|
16755
16753
|
},
|
|
16756
16754
|
replyToId: this.replyingToMessage()?.id,
|
|
16757
16755
|
};
|
|
16758
|
-
|
|
16759
|
-
|
|
16760
|
-
|
|
16761
|
-
this.cancelEditReply();
|
|
16762
|
-
// Request message list to scroll to bottom after sending sticker
|
|
16756
|
+
void this.composerService
|
|
16757
|
+
.sendMessage(command)
|
|
16758
|
+
.then(() => {
|
|
16763
16759
|
this.messageListService.requestScrollToBottom();
|
|
16764
|
-
}
|
|
16765
|
-
|
|
16760
|
+
})
|
|
16761
|
+
.catch((error) => {
|
|
16766
16762
|
console.error('Failed to send sticker:', error);
|
|
16767
|
-
}
|
|
16763
|
+
});
|
|
16768
16764
|
}
|
|
16769
16765
|
/** Get inputs for emoji popup component */
|
|
16770
16766
|
getEmojiPopupInputs() {
|
|
@@ -22266,5 +22262,5 @@ function getErrorMessage(code, params) {
|
|
|
22266
22262
|
* Generated bundle index. Do not edit.
|
|
22267
22263
|
*/
|
|
22268
22264
|
|
|
22269
|
-
export { AXAudioPickerComponent, AXAudioRendererComponent, AXBaseRegistry, AXCnvMediaPlaybackInfoBarBannerComponent, AXComposerActionRegistry, AXComposerComponent, AXComposerPopupComponent, AXComposerService, AXComposerTabRegistry, AXConversation2Module, AXConversationAiApiKey, AXConversationAiResponderService, AXConversationApi, AXConversationContainerComponent, AXConversationContainerDirective, AXConversationDateUtilsService, AXConversationIndexedDbConversationApi, AXConversationIndexedDbMessageAiApi, AXConversationIndexedDbMessageApi, AXConversationIndexedDbRealtimeApi, AXConversationIndexedDbStorage, AXConversationIndexedDbStores, AXConversationIndexedDbUserApi, AXConversationInfoMediaViewComponent, AXConversationInfoPanelComponent, AXConversationItemActionRegistry, AXConversationMessageRendererStateComponent, AXConversationMessageUtilsService, AXConversationService, AXConversationSharedStorage, AXConversationTabRegistry, AXEmojiTabComponent, AXErrorHandlerService, AXFallbackRendererComponent, AXFilePickerComponent, AXFileRendererComponent, AXForwardMessageDialogComponent, AXImagePickerComponent, AXImageRendererComponent, AXInfiniteScrollDirective, AXInfoBarActionRegistry, AXInfoBarComponent, AXInfoBarSearchComponent, AXInfoBarService, AXLocationPickerComponent, AXLocationRendererComponent, AXMessageActionRegistry, AXMessageApi, AXMessageListComponent, AXMessageListNoActiveDefaultComponent, AXMessageListService, AXMessageRendererRegistry, AXNewConversationDialogComponent, AXPickerFooterComponent, AXPickerHeaderComponent, AXRealtimeApi, AXRegistryService, AXSidebarComponent, AXSidebarService, AXStickerRendererComponent, AXStickerTabComponent, AXSystemRendererComponent, AXTextRendererComponent, AXUserApi, AXVideoPickerComponent, AXVideoRendererComponent, AXVoiceRecorderComponent, AXVoiceRendererComponent, AX_CONVERSATION_AUDIO_RENDERER, AX_CONVERSATION_COMPOSER_AUDIO_ACTION, AX_CONVERSATION_COMPOSER_EMOJI_ACTION, AX_CONVERSATION_COMPOSER_EMOJI_TAB, AX_CONVERSATION_COMPOSER_FILE_ACTION, AX_CONVERSATION_COMPOSER_FILE_TYPE_PROVIDERS, AX_CONVERSATION_COMPOSER_IMAGE_ACTION, AX_CONVERSATION_COMPOSER_LOCATION_ACTION, AX_CONVERSATION_COMPOSER_STICKER_TAB, AX_CONVERSATION_COMPOSER_VIDEO_ACTION, AX_CONVERSATION_COMPOSER_VOICE_RECORDING_ACTION, AX_CONVERSATION_CONVERSATION_AVATAR_COMPONENT, AX_CONVERSATION_CURSOR_PREFIX, AX_CONVERSATION_FALLBACK_RENDERER, AX_CONVERSATION_FILE_RENDERER, AX_CONVERSATION_IMAGE_RENDERER, AX_CONVERSATION_INFO_BAR_ARCHIVE_ACTION, AX_CONVERSATION_INFO_BAR_BLOCK_ACTION, AX_CONVERSATION_INFO_BAR_DELETE_ACTION, AX_CONVERSATION_INFO_BAR_DIVIDER, AX_CONVERSATION_INFO_BAR_MUTE_ACTION, AX_CONVERSATION_INFO_BAR_SEARCH_ACTION, AX_CONVERSATION_ITEM_BLOCK_ACTION, AX_CONVERSATION_ITEM_DELETE_ACTION, AX_CONVERSATION_ITEM_DIVIDER, AX_CONVERSATION_ITEM_MARK_READ_ACTION, AX_CONVERSATION_ITEM_MUTE_ACTION, AX_CONVERSATION_ITEM_PIN_ACTION, AX_CONVERSATION_LOCATION_RENDERER, AX_CONVERSATION_MESSAGE_DELETE_ACTION, AX_CONVERSATION_MESSAGE_EDIT_ACTION, AX_CONVERSATION_MESSAGE_FORWARD_ACTION, AX_CONVERSATION_MESSAGE_REPLY_ACTION, AX_CONVERSATION_STICKER_RENDERER, AX_CONVERSATION_SYSTEM_RENDERER, AX_CONVERSATION_TAB_ALL, AX_CONVERSATION_TAB_ARCHIVED, AX_CONVERSATION_TAB_BOT, AX_CONVERSATION_TAB_CHANNELS, AX_CONVERSATION_TAB_GROUPS, AX_CONVERSATION_TAB_PRIVATE, AX_CONVERSATION_TAB_UNREAD, AX_CONVERSATION_TEXT_RENDERER, AX_CONVERSATION_USER_AVATAR_COMPONENT, AX_CONVERSATION_VIDEO_RENDERER, AX_CONVERSATION_VOICE_RENDERER, AX_DEFAULT_CONVERSATION_CONFIG, AX_MESSAGE_CURSOR_PREFIX, AX_STICKER_API_KEY, CONNECTION_ERRORS, CONVERSATION_CONFIG, CONVERSATION_ERRORS, CONVERSATION_FILE_TYPES_READY, DEFAULT_COMPOSER_ACTIONS, DEFAULT_COMPOSER_TABS, DEFAULT_CONVERSATION_ITEM_ACTIONS, DEFAULT_CONVERSATION_TABS, DEFAULT_INFO_BAR_ACTIONS, DEFAULT_MESSAGE_ACTIONS, DEFAULT_MESSAGE_RENDERERS, ERROR_HANDLER_CONFIG, ERROR_MESSAGES, FILE_ERRORS, LOCATION_ERRORS, MESSAGE_ERRORS, REGISTRY_CONFIG, URL_ERRORS, USER_ERRORS, applyConversationFilters, applyLocalPreview, axConversationIndexedDbStorage, conversationSharedStorage, createLocalPreviewUrl, createObjectUrl, encodeConversationCursor, encodeMessageCursor, formatErrorMessage, getConversationLastActivity, getConversationMessagesNewestFirst, getErrorMessage, getSortedConversationsForInbox, isGenericPrivateConversationTitle, mergeUploadResult, mergeWithDefaults, normalizeAllConversationMessageIndexes, paginateChatNewestFirst, paginateChatOldestFirst, parseChatCursor, provideConversation, provideConversationComposerFileTypes, provideConversationFileCatalog, registerChatMessage, resolveConversationAvatarDisplay, resolveConversationForViewer, resolveConversationTitleForViewer, resolveParticipantProfile, resolvePrivatePeerParticipant, resolvePrivatePeerUserId, resolveUserAvatarDisplay, revokeObjectUrl, sanitizeInput, shouldUseUserAvatarForConversation, sortConversationMessageIds, toUploaderReference$1 as toUploaderReference, unregisterChatMessage, validateConversationId, validateEmail, validateLatitude, validateLongitude, validateMessagePayload, validateMessageText, validateMessageType, validateUrl, validateUserId, validateUserIds };
|
|
22265
|
+
export { AXAudioPickerComponent, AXAudioRendererComponent, AXBaseRegistry, AXCnvMediaPlaybackInfoBarBannerComponent, AXComposerActionRegistry, AXComposerComponent, AXComposerPopupComponent, AXComposerService, AXComposerTabRegistry, AXConversation2Module, AXConversationAiApiKey, AXConversationAiResponderService, AXConversationApi, AXConversationContainerComponent, AXConversationContainerDirective, AXConversationDateUtilsService, AXConversationIndexedDbConversationApi, AXConversationIndexedDbMessageAiApi, AXConversationIndexedDbMessageApi, AXConversationIndexedDbRealtimeApi, AXConversationIndexedDbStorage, AXConversationIndexedDbStores, AXConversationIndexedDbUserApi, AXConversationInfoMediaViewComponent, AXConversationInfoPanelComponent, AXConversationItemActionRegistry, AXConversationMessageRendererStateComponent, AXConversationMessageUtilsService, AXConversationService, AXConversationSharedStorage, AXConversationTabRegistry, AXEmojiTabComponent, AXErrorHandlerService, AXFallbackRendererComponent, AXFilePickerComponent, AXFileRendererComponent, AXForwardMessageDialogComponent, AXImagePickerComponent, AXImageRendererComponent, AXInfiniteScrollDirective, AXInfoBarActionRegistry, AXInfoBarComponent, AXInfoBarSearchComponent, AXInfoBarService, AXLocationPickerComponent, AXLocationRendererComponent, AXMessageActionRegistry, AXMessageApi, AXMessageListComponent, AXMessageListNoActiveDefaultComponent, AXMessageListService, AXMessageRendererCopyHostComponent, AXMessageRendererRegistry, AXNewConversationDialogComponent, AXPickerFooterComponent, AXPickerHeaderComponent, AXRealtimeApi, AXRegistryService, AXSidebarComponent, AXSidebarService, AXStickerRendererComponent, AXStickerTabComponent, AXSystemRendererComponent, AXTextRendererComponent, AXUserApi, AXVideoPickerComponent, AXVideoRendererComponent, AXVoiceRecorderComponent, AXVoiceRendererComponent, AX_CONVERSATION_AUDIO_RENDERER, AX_CONVERSATION_COMPOSER_AUDIO_ACTION, AX_CONVERSATION_COMPOSER_EMOJI_ACTION, AX_CONVERSATION_COMPOSER_EMOJI_TAB, AX_CONVERSATION_COMPOSER_FILE_ACTION, AX_CONVERSATION_COMPOSER_FILE_TYPE_PROVIDERS, AX_CONVERSATION_COMPOSER_IMAGE_ACTION, AX_CONVERSATION_COMPOSER_LOCATION_ACTION, AX_CONVERSATION_COMPOSER_STICKER_TAB, AX_CONVERSATION_COMPOSER_VIDEO_ACTION, AX_CONVERSATION_COMPOSER_VOICE_RECORDING_ACTION, AX_CONVERSATION_CONVERSATION_AVATAR_COMPONENT, AX_CONVERSATION_CURSOR_PREFIX, AX_CONVERSATION_FALLBACK_RENDERER, AX_CONVERSATION_FILE_RENDERER, AX_CONVERSATION_IMAGE_RENDERER, AX_CONVERSATION_INFO_BAR_ARCHIVE_ACTION, AX_CONVERSATION_INFO_BAR_BLOCK_ACTION, AX_CONVERSATION_INFO_BAR_DELETE_ACTION, AX_CONVERSATION_INFO_BAR_DIVIDER, AX_CONVERSATION_INFO_BAR_MUTE_ACTION, AX_CONVERSATION_INFO_BAR_SEARCH_ACTION, AX_CONVERSATION_ITEM_BLOCK_ACTION, AX_CONVERSATION_ITEM_DELETE_ACTION, AX_CONVERSATION_ITEM_DIVIDER, AX_CONVERSATION_ITEM_MARK_READ_ACTION, AX_CONVERSATION_ITEM_MUTE_ACTION, AX_CONVERSATION_ITEM_PIN_ACTION, AX_CONVERSATION_LOCATION_RENDERER, AX_CONVERSATION_MESSAGE_DELETE_ACTION, AX_CONVERSATION_MESSAGE_EDIT_ACTION, AX_CONVERSATION_MESSAGE_FORWARD_ACTION, AX_CONVERSATION_MESSAGE_REPLY_ACTION, AX_CONVERSATION_STICKER_RENDERER, AX_CONVERSATION_SYSTEM_RENDERER, AX_CONVERSATION_TAB_ALL, AX_CONVERSATION_TAB_ARCHIVED, AX_CONVERSATION_TAB_BOT, AX_CONVERSATION_TAB_CHANNELS, AX_CONVERSATION_TAB_GROUPS, AX_CONVERSATION_TAB_PRIVATE, AX_CONVERSATION_TAB_UNREAD, AX_CONVERSATION_TEXT_RENDERER, AX_CONVERSATION_USER_AVATAR_COMPONENT, AX_CONVERSATION_VIDEO_RENDERER, AX_CONVERSATION_VOICE_RENDERER, AX_DEFAULT_CONVERSATION_CONFIG, AX_MESSAGE_CURSOR_PREFIX, AX_STICKER_API_KEY, CONNECTION_ERRORS, CONVERSATION_CONFIG, CONVERSATION_ERRORS, CONVERSATION_FILE_TYPES_READY, DEFAULT_COMPOSER_ACTIONS, DEFAULT_COMPOSER_TABS, DEFAULT_CONVERSATION_ITEM_ACTIONS, DEFAULT_CONVERSATION_TABS, DEFAULT_INFO_BAR_ACTIONS, DEFAULT_MESSAGE_ACTIONS, DEFAULT_MESSAGE_RENDERERS, ERROR_HANDLER_CONFIG, ERROR_MESSAGES, FILE_ERRORS, LOCATION_ERRORS, MESSAGE_ERRORS, REGISTRY_CONFIG, URL_ERRORS, USER_ERRORS, applyConversationFilters, applyLocalPreview, axConversationIndexedDbStorage, conversationSharedStorage, copyWithFileTypeFallback, createLocalPreviewUrl, createObjectUrl, createResolvedMediaUrlSignal, encodeConversationCursor, encodeMessageCursor, formatErrorMessage, getConversationLastActivity, getConversationMessagesNewestFirst, getErrorMessage, getSortedConversationsForInbox, isGenericPrivateConversationTitle, mediaCopyText, mergeUploadResult, mergeWithDefaults, normalizeAllConversationMessageIndexes, normalizeImagePayload, openWithFileType, paginateChatNewestFirst, paginateChatOldestFirst, parseChatCursor, pickDisplayMediaUrl, provideConversation, provideConversationComposerFileTypes, provideConversationFileCatalog, registerChatMessage, resolveConversationAvatarDisplay, resolveConversationForViewer, resolveConversationTitleForViewer, resolveImageDisplayUrl, resolveParticipantProfile, resolvePrivatePeerParticipant, resolvePrivatePeerUserId, resolveUserAvatarDisplay, revokeObjectUrl, sanitizeInput, shouldUseUserAvatarForConversation, sortConversationMessageIds, toUploaderReference as toMediaItemUploaderReference, toUploaderReference$1 as toUploaderReference, unregisterChatMessage, validateConversationId, validateEmail, validateLatitude, validateLongitude, validateMessagePayload, validateMessageText, validateMessageType, validateUrl, validateUserId, validateUserIds };
|
|
22270
22266
|
//# sourceMappingURL=acorex-components-conversation2.mjs.map
|