@acorex-platform/module-communication-management-client 0.0.30 → 0.0.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/{acorex-platform-module-communication-management-client-acorex-platform-module-communication-management-client-09UhY2Rc.mjs → acorex-platform-module-communication-management-client-acorex-platform-module-communication-management-client-G4wzzccx.mjs} +357 -121
- package/fesm2022/acorex-platform-module-communication-management-client-acorex-platform-module-communication-management-client-G4wzzccx.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-communication-management-client-communication-email-send.command-wuqLiY8s.mjs → acorex-platform-module-communication-management-client-communication-email-send.command-De8K6vIB.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-communication-management-client-communication-email-send.command-wuqLiY8s.mjs.map → acorex-platform-module-communication-management-client-communication-email-send.command-De8K6vIB.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-communication-management-client-communication-email-show-dialog.command-CP0zAEe4.mjs → acorex-platform-module-communication-management-client-communication-email-show-dialog.command-NuJLiYs_.mjs} +5 -9
- package/fesm2022/acorex-platform-module-communication-management-client-communication-email-show-dialog.command-NuJLiYs_.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-communication-management-client-communication-in-app-inbox-page.component-b7ZqkMTt.mjs → acorex-platform-module-communication-management-client-communication-in-app-inbox-page.component-BjJjqWja.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-communication-management-client-communication-in-app-inbox-page.component-b7ZqkMTt.mjs.map → acorex-platform-module-communication-management-client-communication-in-app-inbox-page.component-BjJjqWja.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-communication-management-client-communication-send.command-D7_MmGQe.mjs → acorex-platform-module-communication-management-client-communication-send.command-NEXrsogP.mjs} +3 -2
- package/fesm2022/acorex-platform-module-communication-management-client-communication-send.command-NEXrsogP.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-communication-management-client-communication-show-sent-message.command-D8125Jxi.mjs → acorex-platform-module-communication-management-client-communication-show-sent-message.command-D9KRxkdp.mjs} +21 -13
- package/fesm2022/acorex-platform-module-communication-management-client-communication-show-sent-message.command-D9KRxkdp.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-communication-management-client-communication-test-smtp.command-BySmN1Lz.mjs → acorex-platform-module-communication-management-client-communication-test-smtp.command-Cp5fHOh4.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-communication-management-client-communication-test-smtp.command-BySmN1Lz.mjs.map → acorex-platform-module-communication-management-client-communication-test-smtp.command-Cp5fHOh4.mjs.map} +1 -1
- package/fesm2022/acorex-platform-module-communication-management-client-contracts-entities-communication-delivery.mjs +235 -0
- package/fesm2022/acorex-platform-module-communication-management-client-contracts-entities-communication-delivery.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-communication-management-client-contracts-entities-communication.mjs +254 -0
- package/fesm2022/acorex-platform-module-communication-management-client-contracts-entities-communication.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-communication-management-client-contracts-entity-catalog-acorex-platform-module-communication-management-client-contracts-entity-catalog-BvLoGDK5.mjs +60 -0
- package/fesm2022/acorex-platform-module-communication-management-client-contracts-entity-catalog-acorex-platform-module-communication-management-client-contracts-entity-catalog-BvLoGDK5.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-communication-management-client-contracts-entity-catalog-communication-delivery.entity-DPCU8P32.mjs +183 -0
- package/fesm2022/acorex-platform-module-communication-management-client-contracts-entity-catalog-communication-delivery.entity-DPCU8P32.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-communication-management-client-contracts-entity-catalog-communication.entity-DGj9OD3Z.mjs +202 -0
- package/fesm2022/acorex-platform-module-communication-management-client-contracts-entity-catalog-communication.entity-DGj9OD3Z.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-communication-management-client-contracts-entity-catalog-status.keys-JESc4HlO.mjs +15 -0
- package/fesm2022/acorex-platform-module-communication-management-client-contracts-entity-catalog-status.keys-JESc4HlO.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-communication-management-client-contracts-entity-catalog.mjs +2 -0
- package/fesm2022/acorex-platform-module-communication-management-client-contracts-entity-catalog.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-communication-management-client-contracts.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-communication-management-client-local-entities.mjs +30 -0
- package/fesm2022/acorex-platform-module-communication-management-client-local-entities.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-communication-management-client.mjs +1 -1
- package/package.json +19 -3
- package/types/acorex-platform-module-communication-management-client-contracts-entities-communication-delivery.d.ts +5 -0
- package/types/acorex-platform-module-communication-management-client-contracts-entities-communication.d.ts +5 -0
- package/types/acorex-platform-module-communication-management-client-contracts-entity-catalog.d.ts +10 -0
- package/types/acorex-platform-module-communication-management-client-contracts.d.ts +6 -1
- package/types/acorex-platform-module-communication-management-client-local-entities.d.ts +12 -0
- package/types/acorex-platform-module-communication-management-client.d.ts +102 -1
- package/fesm2022/acorex-platform-module-communication-management-client-acorex-platform-module-communication-management-client-09UhY2Rc.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-communication-management-client-communication-email-show-dialog.command-CP0zAEe4.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-communication-management-client-communication-send.command-D7_MmGQe.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-communication-management-client-communication-show-sent-message.command-D8125Jxi.mjs.map +0 -1
|
@@ -10,8 +10,8 @@ import { Injectable, InjectionToken, inject, DestroyRef, signal, computed, input
|
|
|
10
10
|
import { Router, ROUTES } from '@angular/router';
|
|
11
11
|
import { AXP_COMMUNICATION_DELIVERY_STATUS_DEFINITION_KEY, AXP_COMMUNICATION_DELIVERY_STATUS_PENDING, AXP_COMMUNICATION_STATUS_DEFINITION_KEY, AXP_COMMUNICATION_STATUS_PENDING, RootConfig, resolveCommunicationMessage, AXPCollaborationPermissionKeys, AXMCommunicationManagementMenuKeys, AXMCommunicationManagementCommandKeys as AXMCommunicationManagementCommandKeys$1 } from '@acorex-platform/module-communication-management-client/contracts';
|
|
12
12
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
13
|
-
import { Subject, distinctUntilChanged, debounceTime, timer, switchMap, EMPTY } from 'rxjs';
|
|
14
|
-
import { AXP_QUERY_QUICK_SEARCH_FIELD, AXPStatusProvider, AXPWidgetsList, AXPWidgetsCatalog } from '@acorex-platform/framework-shared/core';
|
|
13
|
+
import { Subject, distinctUntilChanged, filter, debounceTime, merge, timer, switchMap, EMPTY } from 'rxjs';
|
|
14
|
+
import { AXP_QUERY_QUICK_SEARCH_FIELD, AXPStatusProvider, containsHtmlMarkup, AXPWidgetsList, AXPWidgetsCatalog } from '@acorex-platform/framework-shared/core';
|
|
15
15
|
import { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';
|
|
16
16
|
import { AXPRealtimeDispatcherService, AXP_REALTIME_TOPIC_INBOX_REFRESH, AXPRealtimeConnectionService } from '@acorex-platform/framework-client/realtime';
|
|
17
17
|
import * as i4$1 from '@acorex/components/badge';
|
|
@@ -20,6 +20,7 @@ import * as i3 from '@acorex/components/decorators';
|
|
|
20
20
|
import { AXDecoratorModule } from '@acorex/components/decorators';
|
|
21
21
|
import * as i3$1 from '@acorex/core/format';
|
|
22
22
|
import { AXFormatModule } from '@acorex/core/format';
|
|
23
|
+
import { AXSafePipe } from '@acorex/core/pipes';
|
|
23
24
|
import * as i4 from '@acorex/core/translation';
|
|
24
25
|
import { AXTranslationModule } from '@acorex/core/translation';
|
|
25
26
|
import * as i1 from '@angular/common';
|
|
@@ -31,6 +32,7 @@ import { AXTabsModule } from '@acorex/components/tabs';
|
|
|
31
32
|
import { AXToastService } from '@acorex/components/toast';
|
|
32
33
|
import * as i4$2 from '@acorex/components/popover';
|
|
33
34
|
import { AXPopoverComponent, AXPopoverModule } from '@acorex/components/popover';
|
|
35
|
+
import { AXPLayoutThemeService } from '@acorex-platform/framework-client/themes/shared';
|
|
34
36
|
import { AXP_COMMUNICATION_USER_NOTIFICATIONS_SETTINGS_GROUP, RootConfig as RootConfig$1, AXP_COMMUNICATION_DELIVERY_CHANNELS_SETTINGS_SECTION, AXP_COMMUNICATION_USER_NOTIFICATION_DEFAULTS, AXPCommunicationManagementSettingKeys, AXP_COMMUNICATION_SMTP_SETTING_DEFAULTS, AXMCommunicationManagementCommandKeys } from '@acorex-platform/module-communication-management-client/contracts';
|
|
35
37
|
import { AXPCommonMenuKeys, AXPCommonPermissionGroupKeys } from '@acorex-platform/module-common-client/contracts';
|
|
36
38
|
import { AXP_PLATFORM_DEV_TOOLS_SETTINGS_GROUP, AXP_PLATFORM_DEV_TOOLS_COMMUNICATION_DEBUG_REDIRECT_SECTION } from '@acorex-platform/module-platform-dev-tools-client/contracts';
|
|
@@ -49,6 +51,120 @@ const AXP_IN_APP_INBOX_LOCAL_MAX_ITEMS = 100;
|
|
|
49
51
|
const AXP_IN_APP_INBOX_LEGACY_DB_NAME = 'ACoreXInAppInbox';
|
|
50
52
|
//#endregion
|
|
51
53
|
|
|
54
|
+
//#region ---- Conversation in-app inbox mapping ----
|
|
55
|
+
const IN_APP_CONVERSATION_CHAT_DEFINITION_KEY = 'conversation-chat-message';
|
|
56
|
+
const IN_APP_CONVERSATION_OPEN_CHAT_COMMAND = 'Conversation:OpenChat';
|
|
57
|
+
function parseConversationInAppCorrelationId(correlationId) {
|
|
58
|
+
const scoped = correlationId?.trim();
|
|
59
|
+
if (!scoped?.startsWith('conversation:')) {
|
|
60
|
+
return undefined;
|
|
61
|
+
}
|
|
62
|
+
const segments = scoped.split(':');
|
|
63
|
+
if (segments.length < 3) {
|
|
64
|
+
return undefined;
|
|
65
|
+
}
|
|
66
|
+
const conversationId = segments[1]?.trim();
|
|
67
|
+
const messageId = segments[2]?.trim();
|
|
68
|
+
if (!conversationId || !messageId) {
|
|
69
|
+
return undefined;
|
|
70
|
+
}
|
|
71
|
+
const senderUserId = segments[3]?.trim() || undefined;
|
|
72
|
+
return { conversationId, messageId, senderUserId };
|
|
73
|
+
}
|
|
74
|
+
/** One inbox row per conversation — used to collapse legacy duplicate chat notifications. */
|
|
75
|
+
function resolveConversationInAppDedupeKey(correlationId) {
|
|
76
|
+
const parsed = parseConversationInAppCorrelationId(correlationId);
|
|
77
|
+
return parsed?.conversationId ? `conversation:${parsed.conversationId}` : undefined;
|
|
78
|
+
}
|
|
79
|
+
/** Parses `conversation:{conversationId}:` dismiss prefixes from chat open/sync. */
|
|
80
|
+
function parseConversationIdFromDismissPrefix(prefix) {
|
|
81
|
+
const normalized = prefix.trim();
|
|
82
|
+
if (!normalized.startsWith('conversation:') || !normalized.endsWith(':')) {
|
|
83
|
+
return undefined;
|
|
84
|
+
}
|
|
85
|
+
const conversationId = normalized.slice('conversation:'.length, -1).trim();
|
|
86
|
+
return conversationId || undefined;
|
|
87
|
+
}
|
|
88
|
+
/** Whether a local inbox row belongs to the conversation being dismissed. */
|
|
89
|
+
function matchesConversationInAppDismiss(item, conversationId) {
|
|
90
|
+
const scopedConversationId = conversationId.trim();
|
|
91
|
+
if (!scopedConversationId || item.definitionKey !== IN_APP_CONVERSATION_CHAT_DEFINITION_KEY) {
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
const correlation = item.correlationId?.trim();
|
|
95
|
+
if (correlation?.startsWith(`conversation:${scopedConversationId}:`)) {
|
|
96
|
+
return true;
|
|
97
|
+
}
|
|
98
|
+
const parsed = parseConversationInAppCorrelationId(correlation);
|
|
99
|
+
if (parsed?.conversationId === scopedConversationId) {
|
|
100
|
+
return true;
|
|
101
|
+
}
|
|
102
|
+
const options = item.actions?.[0]?.command?.options;
|
|
103
|
+
if (options && typeof options === 'object') {
|
|
104
|
+
const actionConversationId = options['conversationId'];
|
|
105
|
+
if (typeof actionConversationId === 'string' && actionConversationId.trim() === scopedConversationId) {
|
|
106
|
+
return true;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return false;
|
|
110
|
+
}
|
|
111
|
+
function readSenderUserIdFromActions(actions) {
|
|
112
|
+
const options = actions?.[0]?.command?.options;
|
|
113
|
+
if (!options || typeof options !== 'object') {
|
|
114
|
+
return undefined;
|
|
115
|
+
}
|
|
116
|
+
const senderUserId = options['senderUserId'];
|
|
117
|
+
return typeof senderUserId === 'string' && senderUserId.trim() ? senderUserId.trim() : undefined;
|
|
118
|
+
}
|
|
119
|
+
function resolveConversationSenderName(title, body) {
|
|
120
|
+
const bodyText = body?.trim();
|
|
121
|
+
if (bodyText?.includes(':')) {
|
|
122
|
+
const prefix = bodyText.slice(0, bodyText.indexOf(':')).trim();
|
|
123
|
+
if (prefix) {
|
|
124
|
+
return prefix;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
const titleText = title?.trim();
|
|
128
|
+
return titleText || undefined;
|
|
129
|
+
}
|
|
130
|
+
function resolveConversationInAppInboxSender(input) {
|
|
131
|
+
if (input.definitionKey !== IN_APP_CONVERSATION_CHAT_DEFINITION_KEY) {
|
|
132
|
+
return undefined;
|
|
133
|
+
}
|
|
134
|
+
const parsed = parseConversationInAppCorrelationId(input.correlationId);
|
|
135
|
+
const senderUserId = parsed?.senderUserId ?? readSenderUserIdFromActions(input.actions);
|
|
136
|
+
const senderName = resolveConversationSenderName(input.title, input.body);
|
|
137
|
+
if (!senderUserId || !senderName || senderUserId === 'system') {
|
|
138
|
+
return undefined;
|
|
139
|
+
}
|
|
140
|
+
return { id: senderUserId, fullName: senderName };
|
|
141
|
+
}
|
|
142
|
+
function resolveConversationInAppInboxActions(input) {
|
|
143
|
+
if (input.definitionKey !== IN_APP_CONVERSATION_CHAT_DEFINITION_KEY) {
|
|
144
|
+
return input.actions;
|
|
145
|
+
}
|
|
146
|
+
if (input.actions?.some((action) => action.command?.name?.trim())) {
|
|
147
|
+
return input.actions;
|
|
148
|
+
}
|
|
149
|
+
const parsed = parseConversationInAppCorrelationId(input.correlationId);
|
|
150
|
+
if (!parsed?.conversationId) {
|
|
151
|
+
return input.actions;
|
|
152
|
+
}
|
|
153
|
+
return [
|
|
154
|
+
{
|
|
155
|
+
title: '@conversation:in-app.actions.open-chat',
|
|
156
|
+
command: {
|
|
157
|
+
name: IN_APP_CONVERSATION_OPEN_CHAT_COMMAND,
|
|
158
|
+
options: {
|
|
159
|
+
conversationId: parsed.conversationId,
|
|
160
|
+
...(parsed.senderUserId ? { senderUserId: parsed.senderUserId } : {}),
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
];
|
|
165
|
+
}
|
|
166
|
+
//#endregion
|
|
167
|
+
|
|
52
168
|
//#region ---- In-app inbox leading icon ----
|
|
53
169
|
const REPORT_GENERATION_DEFINITION_KEY = 'ReportManagement:ReportGeneration';
|
|
54
170
|
function isInAppInboxRealUserSender(sender) {
|
|
@@ -91,7 +207,7 @@ function getInAppInboxPriorityClass(priority) {
|
|
|
91
207
|
return priority ?? 'Notice';
|
|
92
208
|
}
|
|
93
209
|
function sortInAppInboxItems(items) {
|
|
94
|
-
return [...items].sort((left, right) => {
|
|
210
|
+
return dedupeInAppInboxItems([...items]).sort((left, right) => {
|
|
95
211
|
const pinDelta = Number(Boolean(right.isPinned)) - Number(Boolean(left.isPinned));
|
|
96
212
|
if (pinDelta !== 0) {
|
|
97
213
|
return pinDelta;
|
|
@@ -99,6 +215,42 @@ function sortInAppInboxItems(items) {
|
|
|
99
215
|
return right.createdAt.getTime() - left.createdAt.getTime();
|
|
100
216
|
});
|
|
101
217
|
}
|
|
218
|
+
/** Collapse duplicate chat-message rows that share the same correlation id. */
|
|
219
|
+
function dedupeInAppInboxItems(items) {
|
|
220
|
+
const byCorrelation = new Map();
|
|
221
|
+
for (const item of items) {
|
|
222
|
+
const dedupeKey = item.definitionKey === 'conversation-chat-message'
|
|
223
|
+
? resolveConversationInAppDedupeKey(item.correlationId)
|
|
224
|
+
: undefined;
|
|
225
|
+
if (!dedupeKey) {
|
|
226
|
+
continue;
|
|
227
|
+
}
|
|
228
|
+
const existing = byCorrelation.get(dedupeKey);
|
|
229
|
+
if (!existing || item.createdAt.getTime() >= existing.createdAt.getTime()) {
|
|
230
|
+
byCorrelation.set(dedupeKey, item);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
if (byCorrelation.size === 0) {
|
|
234
|
+
return items;
|
|
235
|
+
}
|
|
236
|
+
const consumed = new Set();
|
|
237
|
+
const result = [];
|
|
238
|
+
for (const item of items) {
|
|
239
|
+
const dedupeKey = item.definitionKey === 'conversation-chat-message'
|
|
240
|
+
? resolveConversationInAppDedupeKey(item.correlationId)
|
|
241
|
+
: undefined;
|
|
242
|
+
if (!dedupeKey) {
|
|
243
|
+
result.push(item);
|
|
244
|
+
continue;
|
|
245
|
+
}
|
|
246
|
+
if (consumed.has(dedupeKey)) {
|
|
247
|
+
continue;
|
|
248
|
+
}
|
|
249
|
+
consumed.add(dedupeKey);
|
|
250
|
+
result.push(byCorrelation.get(dedupeKey) ?? item);
|
|
251
|
+
}
|
|
252
|
+
return result;
|
|
253
|
+
}
|
|
102
254
|
function normalizeInAppInboxItem(item) {
|
|
103
255
|
return {
|
|
104
256
|
id: String(item.id),
|
|
@@ -114,6 +266,8 @@ function normalizeInAppInboxItem(item) {
|
|
|
114
266
|
isPinned: item.isPinned ?? false,
|
|
115
267
|
category: item.category,
|
|
116
268
|
definitionKey: item.definitionKey,
|
|
269
|
+
correlationId: item.correlationId,
|
|
270
|
+
recipientUserId: item.recipientUserId,
|
|
117
271
|
archivedAt: item.archivedAt ? new Date(item.archivedAt) : item.archivedAt ?? null,
|
|
118
272
|
actions: Array.isArray(item.actions) ? item.actions : undefined,
|
|
119
273
|
};
|
|
@@ -283,7 +437,11 @@ class AXPInAppInboxConnectorService {
|
|
|
283
437
|
}
|
|
284
438
|
void this.clearInboxState();
|
|
285
439
|
});
|
|
286
|
-
this.realtime.changed$.pipe(
|
|
440
|
+
const immediateRealtime$ = this.realtime.changed$.pipe(filter((event) => event.type === 'deleted' || event.type === 'archived'));
|
|
441
|
+
const debouncedRealtime$ = this.realtime.changed$.pipe(filter((event) => event.type !== 'deleted' && event.type !== 'archived'), debounceTime(100));
|
|
442
|
+
merge(immediateRealtime$, debouncedRealtime$)
|
|
443
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
444
|
+
.subscribe((event) => {
|
|
287
445
|
void this.handleRealtimeEvent(event);
|
|
288
446
|
});
|
|
289
447
|
}
|
|
@@ -434,14 +592,89 @@ class AXPInAppInboxConnectorService {
|
|
|
434
592
|
await this.port.deleteDeliveries([id]);
|
|
435
593
|
}
|
|
436
594
|
catch (err) {
|
|
595
|
+
if (this.isBenignDeliveryDeleteError(err)) {
|
|
596
|
+
this.realtime.notifyChanged({ type: 'deleted', ids: [id] });
|
|
597
|
+
return;
|
|
598
|
+
}
|
|
437
599
|
this.error.set(err instanceof Error ? err.message : 'Failed to delete inbox item');
|
|
438
600
|
await this.syncActiveFromServer();
|
|
601
|
+
return;
|
|
439
602
|
}
|
|
603
|
+
this.realtime.notifyChanged({ type: 'deleted', ids: [id] });
|
|
440
604
|
const query = this.pageQuery();
|
|
441
605
|
if (query?.mode === 'archive') {
|
|
442
606
|
await this.loadArchivePage(query.filters, query.skip, query.take);
|
|
443
607
|
}
|
|
444
608
|
}
|
|
609
|
+
/** Removes in-app deliveries whose communication correlation id matches (best-effort). */
|
|
610
|
+
async dismissByCorrelationId(correlationId) {
|
|
611
|
+
const normalized = correlationId.trim();
|
|
612
|
+
if (!normalized || !this.port.deleteDeliveries || !this.canLoadInbox()) {
|
|
613
|
+
return;
|
|
614
|
+
}
|
|
615
|
+
await this.ensureReady();
|
|
616
|
+
const ids = this.readLocalItems()
|
|
617
|
+
.filter((item) => item.correlationId?.trim() === normalized)
|
|
618
|
+
.map((item) => item.id);
|
|
619
|
+
for (const id of ids) {
|
|
620
|
+
await this.deleteOne(id);
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
/** Removes in-app deliveries whose correlation id starts with the prefix (e.g. chat thread). */
|
|
624
|
+
async dismissByCorrelationIdPrefix(correlationIdPrefix) {
|
|
625
|
+
const normalized = correlationIdPrefix.trim();
|
|
626
|
+
if (!normalized || !this.port.deleteDeliveries || !this.canLoadInbox()) {
|
|
627
|
+
return;
|
|
628
|
+
}
|
|
629
|
+
await this.ensureReady();
|
|
630
|
+
const ids = this.resolveDeliveryIdsForCorrelationPrefix(normalized);
|
|
631
|
+
for (const id of ids) {
|
|
632
|
+
await this.deleteOne(id);
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
/**
|
|
636
|
+
* Upserts rows into the local hot inbox without a server round-trip.
|
|
637
|
+
* Used for optimistic chat previews while Communication:Send persists the delivery.
|
|
638
|
+
*/
|
|
639
|
+
async upsertLocalItems(items) {
|
|
640
|
+
if (!items.length || !this.canLoadInbox()) {
|
|
641
|
+
return;
|
|
642
|
+
}
|
|
643
|
+
await this.ensureReady();
|
|
644
|
+
await this.engine.upsertMany(this.entityKey, items.map((item) => this.toPayload(normalizeInAppInboxItem(item))));
|
|
645
|
+
}
|
|
646
|
+
/** Drops local-only rows (e.g. optimistic chat placeholders) without calling the API. */
|
|
647
|
+
async removeLocalIds(ids) {
|
|
648
|
+
const normalized = [...new Set(ids.map((id) => id?.trim()).filter(Boolean))];
|
|
649
|
+
if (!normalized.length || !this.canLoadInbox()) {
|
|
650
|
+
return;
|
|
651
|
+
}
|
|
652
|
+
await this.ensureReady();
|
|
653
|
+
await this.engine.removeMany(this.entityKey, normalized);
|
|
654
|
+
}
|
|
655
|
+
/**
|
|
656
|
+
* After Communication:Send, swap the optimistic chat row for the real delivery when
|
|
657
|
+
* the recipient can read it. If the delivery is not visible yet, keep the local preview.
|
|
658
|
+
*/
|
|
659
|
+
async replacePendingChatWithDelivery(pendingId, deliveryId) {
|
|
660
|
+
const pending = pendingId.trim();
|
|
661
|
+
const delivery = deliveryId.trim();
|
|
662
|
+
if (!pending || !delivery || !this.canLoadInbox()) {
|
|
663
|
+
return;
|
|
664
|
+
}
|
|
665
|
+
await this.ensureReady();
|
|
666
|
+
if (!this.port.loadByIds) {
|
|
667
|
+
return;
|
|
668
|
+
}
|
|
669
|
+
const loaded = await this.fetchActiveByIds([delivery]);
|
|
670
|
+
if (loaded.length === 0) {
|
|
671
|
+
return;
|
|
672
|
+
}
|
|
673
|
+
await this.engine.upsertMany(this.entityKey, loaded);
|
|
674
|
+
if (pending !== delivery) {
|
|
675
|
+
await this.engine.removeMany(this.entityKey, [pending]);
|
|
676
|
+
}
|
|
677
|
+
}
|
|
445
678
|
//#region ----- Bootstrap & sync -----
|
|
446
679
|
async bootstrap() {
|
|
447
680
|
if (!this.canLoadInbox()) {
|
|
@@ -519,10 +752,18 @@ class AXPInAppInboxConnectorService {
|
|
|
519
752
|
if (!this.canLoadInbox() || !this.port.loadByIds) {
|
|
520
753
|
return [];
|
|
521
754
|
}
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
755
|
+
try {
|
|
756
|
+
const result = await this.port.loadByIds(ids);
|
|
757
|
+
return result.items
|
|
758
|
+
.filter((item) => item.archivedAt == null)
|
|
759
|
+
.map((item) => this.toPayload(normalizeInAppInboxItem(item)));
|
|
760
|
+
}
|
|
761
|
+
catch (error) {
|
|
762
|
+
if (this.isBenignDeliveryDeleteError(error)) {
|
|
763
|
+
return [];
|
|
764
|
+
}
|
|
765
|
+
throw error;
|
|
766
|
+
}
|
|
526
767
|
}
|
|
527
768
|
//#endregion
|
|
528
769
|
//#region ----- Page views -----
|
|
@@ -612,7 +853,26 @@ class AXPInAppInboxConnectorService {
|
|
|
612
853
|
await this.engine.clear(this.entityKey);
|
|
613
854
|
}
|
|
614
855
|
readLocalItems() {
|
|
615
|
-
|
|
856
|
+
const userId = this.sessionService.user?.id?.trim();
|
|
857
|
+
const items = sortInAppInboxItems(this.localItems().map((row) => normalizeInAppInboxItem(row)));
|
|
858
|
+
if (!userId) {
|
|
859
|
+
return [];
|
|
860
|
+
}
|
|
861
|
+
return items.filter((item) => {
|
|
862
|
+
const recipientUserId = item.recipientUserId?.trim();
|
|
863
|
+
return !recipientUserId || recipientUserId === userId;
|
|
864
|
+
});
|
|
865
|
+
}
|
|
866
|
+
resolveDeliveryIdsForCorrelationPrefix(prefix) {
|
|
867
|
+
const conversationId = parseConversationIdFromDismissPrefix(prefix);
|
|
868
|
+
return this.readLocalItems()
|
|
869
|
+
.filter((item) => {
|
|
870
|
+
if (item.correlationId?.trim().startsWith(prefix)) {
|
|
871
|
+
return true;
|
|
872
|
+
}
|
|
873
|
+
return conversationId != null && matchesConversationInAppDismiss(item, conversationId);
|
|
874
|
+
})
|
|
875
|
+
.map((item) => item.id);
|
|
616
876
|
}
|
|
617
877
|
toPayload(item) {
|
|
618
878
|
return {
|
|
@@ -629,6 +889,8 @@ class AXPInAppInboxConnectorService {
|
|
|
629
889
|
isPinned: Boolean(item.isPinned),
|
|
630
890
|
category: item.category,
|
|
631
891
|
definitionKey: item.definitionKey,
|
|
892
|
+
correlationId: item.correlationId,
|
|
893
|
+
recipientUserId: item.recipientUserId,
|
|
632
894
|
archivedAt: item.archivedAt ? item.archivedAt.toISOString() : null,
|
|
633
895
|
actions: item.actions,
|
|
634
896
|
};
|
|
@@ -645,6 +907,10 @@ class AXPInAppInboxConnectorService {
|
|
|
645
907
|
// Best-effort cleanup of the pre-engine inbox DB.
|
|
646
908
|
}
|
|
647
909
|
}
|
|
910
|
+
isBenignDeliveryDeleteError(error) {
|
|
911
|
+
const message = collectErrorText(error);
|
|
912
|
+
return /not found|Entity not found/i.test(message);
|
|
913
|
+
}
|
|
648
914
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPInAppInboxConnectorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
649
915
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPInAppInboxConnectorService, providedIn: 'root' }); }
|
|
650
916
|
}
|
|
@@ -654,6 +920,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
654
920
|
providedIn: 'root',
|
|
655
921
|
}]
|
|
656
922
|
}], ctorParameters: () => [] });
|
|
923
|
+
function collectErrorText(error) {
|
|
924
|
+
if (error == null) {
|
|
925
|
+
return '';
|
|
926
|
+
}
|
|
927
|
+
if (typeof error === 'string') {
|
|
928
|
+
return error;
|
|
929
|
+
}
|
|
930
|
+
if (error instanceof Error) {
|
|
931
|
+
const extra = error.error;
|
|
932
|
+
if (extra && typeof extra === 'object') {
|
|
933
|
+
const nested = extra;
|
|
934
|
+
return `${error.message} ${String(nested.message ?? '')} ${String(nested.error ?? '')}`;
|
|
935
|
+
}
|
|
936
|
+
return extra ? `${error.message} ${String(extra)}` : error.message;
|
|
937
|
+
}
|
|
938
|
+
if (typeof error === 'object' && 'message' in error) {
|
|
939
|
+
return String(error.message ?? error);
|
|
940
|
+
}
|
|
941
|
+
return String(error);
|
|
942
|
+
}
|
|
657
943
|
|
|
658
944
|
//#region ---- Communication in-app inbox badge ----
|
|
659
945
|
class AXMCommunicationInboxBadgeProvider {
|
|
@@ -820,83 +1106,6 @@ function resolveCommunicationInboxCommunicationFilters(filters) {
|
|
|
820
1106
|
};
|
|
821
1107
|
}
|
|
822
1108
|
|
|
823
|
-
//#region ---- Conversation in-app inbox mapping ----
|
|
824
|
-
const IN_APP_CONVERSATION_CHAT_DEFINITION_KEY = 'conversation-chat-message';
|
|
825
|
-
const IN_APP_CONVERSATION_OPEN_CHAT_COMMAND = 'Conversation:OpenChat';
|
|
826
|
-
function parseConversationInAppCorrelationId(correlationId) {
|
|
827
|
-
const scoped = correlationId?.trim();
|
|
828
|
-
if (!scoped?.startsWith('conversation:')) {
|
|
829
|
-
return undefined;
|
|
830
|
-
}
|
|
831
|
-
const segments = scoped.split(':');
|
|
832
|
-
if (segments.length < 3) {
|
|
833
|
-
return undefined;
|
|
834
|
-
}
|
|
835
|
-
const conversationId = segments[1]?.trim();
|
|
836
|
-
const messageId = segments[2]?.trim();
|
|
837
|
-
if (!conversationId || !messageId) {
|
|
838
|
-
return undefined;
|
|
839
|
-
}
|
|
840
|
-
const senderUserId = segments[3]?.trim() || undefined;
|
|
841
|
-
return { conversationId, messageId, senderUserId };
|
|
842
|
-
}
|
|
843
|
-
function readSenderUserIdFromActions(actions) {
|
|
844
|
-
const options = actions?.[0]?.command?.options;
|
|
845
|
-
if (!options || typeof options !== 'object') {
|
|
846
|
-
return undefined;
|
|
847
|
-
}
|
|
848
|
-
const senderUserId = options['senderUserId'];
|
|
849
|
-
return typeof senderUserId === 'string' && senderUserId.trim() ? senderUserId.trim() : undefined;
|
|
850
|
-
}
|
|
851
|
-
function resolveConversationSenderName(title, body) {
|
|
852
|
-
const bodyText = body?.trim();
|
|
853
|
-
if (bodyText?.includes(':')) {
|
|
854
|
-
const prefix = bodyText.slice(0, bodyText.indexOf(':')).trim();
|
|
855
|
-
if (prefix) {
|
|
856
|
-
return prefix;
|
|
857
|
-
}
|
|
858
|
-
}
|
|
859
|
-
const titleText = title?.trim();
|
|
860
|
-
return titleText || undefined;
|
|
861
|
-
}
|
|
862
|
-
function resolveConversationInAppInboxSender(input) {
|
|
863
|
-
if (input.definitionKey !== IN_APP_CONVERSATION_CHAT_DEFINITION_KEY) {
|
|
864
|
-
return undefined;
|
|
865
|
-
}
|
|
866
|
-
const parsed = parseConversationInAppCorrelationId(input.correlationId);
|
|
867
|
-
const senderUserId = parsed?.senderUserId ?? readSenderUserIdFromActions(input.actions);
|
|
868
|
-
const senderName = resolveConversationSenderName(input.title, input.body);
|
|
869
|
-
if (!senderUserId || !senderName || senderUserId === 'system') {
|
|
870
|
-
return undefined;
|
|
871
|
-
}
|
|
872
|
-
return { id: senderUserId, fullName: senderName };
|
|
873
|
-
}
|
|
874
|
-
function resolveConversationInAppInboxActions(input) {
|
|
875
|
-
if (input.definitionKey !== IN_APP_CONVERSATION_CHAT_DEFINITION_KEY) {
|
|
876
|
-
return input.actions;
|
|
877
|
-
}
|
|
878
|
-
if (input.actions?.some((action) => action.command?.name?.trim())) {
|
|
879
|
-
return input.actions;
|
|
880
|
-
}
|
|
881
|
-
const parsed = parseConversationInAppCorrelationId(input.correlationId);
|
|
882
|
-
if (!parsed?.conversationId) {
|
|
883
|
-
return input.actions;
|
|
884
|
-
}
|
|
885
|
-
return [
|
|
886
|
-
{
|
|
887
|
-
title: '@conversation:in-app.actions.open-chat',
|
|
888
|
-
command: {
|
|
889
|
-
name: IN_APP_CONVERSATION_OPEN_CHAT_COMMAND,
|
|
890
|
-
options: {
|
|
891
|
-
conversationId: parsed.conversationId,
|
|
892
|
-
...(parsed.senderUserId ? { senderUserId: parsed.senderUserId } : {}),
|
|
893
|
-
},
|
|
894
|
-
},
|
|
895
|
-
},
|
|
896
|
-
];
|
|
897
|
-
}
|
|
898
|
-
//#endregion
|
|
899
|
-
|
|
900
1109
|
const IN_APP_CHANNEL = 'in-app';
|
|
901
1110
|
//#region ---- Communication delivery inbox port ----
|
|
902
1111
|
class AXMCommunicationInAppInboxPort {
|
|
@@ -951,8 +1160,8 @@ class AXMCommunicationInAppInboxPort {
|
|
|
951
1160
|
filter: { logic: 'and', filters: baseFilters },
|
|
952
1161
|
});
|
|
953
1162
|
const deliveries = result.items;
|
|
954
|
-
const items = await this.mapDeliveriesToInboxItems(deliveries);
|
|
955
|
-
return { total:
|
|
1163
|
+
const items = (await this.mapDeliveriesToInboxItems(deliveries)).filter((item) => item.recipientUserId?.trim() === userId);
|
|
1164
|
+
return { total: items.length, items };
|
|
956
1165
|
}
|
|
957
1166
|
async loadByIds(ids) {
|
|
958
1167
|
if (!this.sessionService.isReadyForAppScopedApi) {
|
|
@@ -962,7 +1171,10 @@ class AXMCommunicationInAppInboxPort {
|
|
|
962
1171
|
if (deliveryIds.length === 0) {
|
|
963
1172
|
return { total: 0, items: [] };
|
|
964
1173
|
}
|
|
965
|
-
const userId = this.sessionService.user?.id;
|
|
1174
|
+
const userId = this.sessionService.user?.id?.trim();
|
|
1175
|
+
if (!userId) {
|
|
1176
|
+
return { total: 0, items: [] };
|
|
1177
|
+
}
|
|
966
1178
|
const filters = [
|
|
967
1179
|
{ field: 'channel', operator: { type: 'equal' }, value: IN_APP_CHANNEL },
|
|
968
1180
|
{
|
|
@@ -974,20 +1186,18 @@ class AXMCommunicationInAppInboxPort {
|
|
|
974
1186
|
})),
|
|
975
1187
|
},
|
|
976
1188
|
];
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
});
|
|
983
|
-
}
|
|
1189
|
+
filters.push({
|
|
1190
|
+
field: 'recipientUserId',
|
|
1191
|
+
operator: { type: 'equal' },
|
|
1192
|
+
value: userId,
|
|
1193
|
+
});
|
|
984
1194
|
const result = await this.deliveryData.query({
|
|
985
1195
|
skip: 0,
|
|
986
1196
|
take: deliveryIds.length,
|
|
987
1197
|
filter: { logic: 'and', filters: filters },
|
|
988
1198
|
});
|
|
989
1199
|
const deliveries = result.items;
|
|
990
|
-
const items = await this.mapDeliveriesToInboxItems(deliveries);
|
|
1200
|
+
const items = (await this.mapDeliveriesToInboxItems(deliveries)).filter((item) => item.recipientUserId?.trim() === userId);
|
|
991
1201
|
return { total: items.length, items };
|
|
992
1202
|
}
|
|
993
1203
|
async markSeen(ids) {
|
|
@@ -1123,6 +1333,8 @@ class AXMCommunicationInAppInboxPort {
|
|
|
1123
1333
|
priority,
|
|
1124
1334
|
isPinned: Boolean(delivery.isPinned),
|
|
1125
1335
|
definitionKey,
|
|
1336
|
+
correlationId: communication?.correlationId ?? undefined,
|
|
1337
|
+
recipientUserId: delivery.recipientUserId?.trim() || undefined,
|
|
1126
1338
|
archivedAt: delivery.archivedAt ? new Date(delivery.archivedAt) : delivery.archivedAt ?? null,
|
|
1127
1339
|
actions,
|
|
1128
1340
|
};
|
|
@@ -1171,8 +1383,8 @@ function resolveInboxChangeType(op) {
|
|
|
1171
1383
|
if (op === 'archived') {
|
|
1172
1384
|
return 'archived';
|
|
1173
1385
|
}
|
|
1174
|
-
if (op === 'created') {
|
|
1175
|
-
return '
|
|
1386
|
+
if (op === 'created' || op === 'updated') {
|
|
1387
|
+
return 'refresh';
|
|
1176
1388
|
}
|
|
1177
1389
|
return 'refresh';
|
|
1178
1390
|
}
|
|
@@ -1358,6 +1570,14 @@ class AXPInAppInboxItemComponent {
|
|
|
1358
1570
|
return isInAppInboxRealUserSender(this.data().sender);
|
|
1359
1571
|
}, /* @ts-ignore */
|
|
1360
1572
|
...(ngDevMode ? [{ debugName: "showItemAvatar" }] : /* istanbul ignore next */ []));
|
|
1573
|
+
this.showDismiss = computed(() => this.isUnread() && this.showDismissUnread(), /* @ts-ignore */
|
|
1574
|
+
...(ngDevMode ? [{ debugName: "showDismiss" }] : /* istanbul ignore next */ []));
|
|
1575
|
+
this.showMeta = computed(() => this.showDate() || this.showDismiss(), /* @ts-ignore */
|
|
1576
|
+
...(ngDevMode ? [{ debugName: "showMeta" }] : /* istanbul ignore next */ []));
|
|
1577
|
+
this.bodyIsHtml = computed(() => !this.isI18nKey(this.data().body) && containsHtmlMarkup(this.data().body), /* @ts-ignore */
|
|
1578
|
+
...(ngDevMode ? [{ debugName: "bodyIsHtml" }] : /* istanbul ignore next */ []));
|
|
1579
|
+
this.bodyHtml = computed(() => stripInboxHeadingMarkup(this.data().body), /* @ts-ignore */
|
|
1580
|
+
...(ngDevMode ? [{ debugName: "bodyHtml" }] : /* istanbul ignore next */ []));
|
|
1361
1581
|
this.itemPress = output();
|
|
1362
1582
|
this.markAsRead = output();
|
|
1363
1583
|
this.togglePin = output();
|
|
@@ -1384,7 +1604,7 @@ class AXPInAppInboxItemComponent {
|
|
|
1384
1604
|
this.markAsRead.emit(this.data().id);
|
|
1385
1605
|
}
|
|
1386
1606
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPInAppInboxItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1387
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: AXPInAppInboxItemComponent, isStandalone: true, selector: "axp-in-app-inbox-item", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, showAvatar: { classPropertyName: "showAvatar", publicName: "showAvatar", isSignal: true, isRequired: false, transformFunction: null }, showDate: { classPropertyName: "showDate", publicName: "showDate", isSignal: true, isRequired: false, transformFunction: null }, showPin: { classPropertyName: "showPin", publicName: "showPin", isSignal: true, isRequired: false, transformFunction: null }, pinLabelKey: { classPropertyName: "pinLabelKey", publicName: "pinLabelKey", isSignal: true, isRequired: false, transformFunction: null }, unpinLabelKey: { classPropertyName: "unpinLabelKey", publicName: "unpinLabelKey", isSignal: true, isRequired: false, transformFunction: null }, highlightUnreadBackground: { classPropertyName: "highlightUnreadBackground", publicName: "highlightUnreadBackground", isSignal: true, isRequired: false, transformFunction: null }, showDismissUnread: { classPropertyName: "showDismissUnread", publicName: "showDismissUnread", isSignal: true, isRequired: false, transformFunction: null }, markAsReadLabelKey: { classPropertyName: "markAsReadLabelKey", publicName: "markAsReadLabelKey", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemPress: "itemPress", markAsRead: "markAsRead", togglePin: "togglePin", closePopover: "closePopover" }, ngImport: i0, template: "<div\n class=\"axp-in-app-inbox-item\"\n [id]=\"data().id\"\n (click)=\"onPress(data().id)\"\n [class]=\"[\n priorityClass(),\n isUnread() ? 'unread' : 'read',\n isUnread() && highlightUnreadBackground() ? 'unread-highlight' : '',\n ]\"\n>\n @if (showItemIcon()) {\n <div class=\"axp-in-app-inbox-item__icon\" [class]=\"priorityClass()\">\n <i [class]=\"itemIconClass()\" aria-hidden=\"true\"></i>\n </div>\n } @else if (showItemAvatar()) {\n <div class=\"axp-in-app-inbox-item__avatar\">\n <axp-user-avatar\n [size]=\"48\"\n [userId]=\"data().sender!.id\"\n [axpUserCard]=\"data().sender!.id\"\n ></axp-user-avatar>\n @if (isUnread()) {\n <div class=\"axp-in-app-inbox-item__unread-badge\"></div>\n }\n </div>\n }\n\n <div class=\"axp-in-app-inbox-item__content\">\n <div class=\"axp-in-app-inbox-item__title\" [class.--unread]=\"isUnread()\">\n @if (isI18nKey(headline())) {\n {{ headline() | translate | async }}\n } @else {\n {{ headline() }}\n }\n </div>\n\n <div class=\"axp-in-app-inbox-item__subline\">\n @if (showDate()) {\n <span class=\"axp-in-app-inbox-item__time\">{{ data().createdAt | format: 'timeleft' | async }}</span>\n }\n @if (data().category) {\n <span class=\"axp-in-app-inbox-item__subline-separator\" aria-hidden=\"true\">\u2022</span>\n <span class=\"axp-in-app-inbox-item__category\">{{ data().category }}</span>\n }\n @if (showPin()) {\n @if (data().isPinned) {\n <button\n type=\"button\"\n class=\"axp-in-app-inbox-item__pin axp-in-app-inbox-item__pin--inline\"\n [attr.aria-label]=\"unpinLabelKey() | translate | async\"\n (click)=\"onTogglePin($event)\"\n >\n <ax-icon><i class=\"fa-solid fa-thumbtack\"></i></ax-icon>\n </button>\n } @else {\n <button\n type=\"button\"\n class=\"axp-in-app-inbox-item__pin axp-in-app-inbox-item__pin--inline axp-in-app-inbox-item__pin--muted\"\n [attr.aria-label]=\"pinLabelKey() | translate | async\"\n (click)=\"onTogglePin($event)\"\n >\n <ax-icon><i class=\"fa-regular fa-thumbtack\"></i></ax-icon>\n </button>\n }\n }\n </div>\n\n <div class=\"axp-in-app-inbox-item__body\">\n @if (isI18nKey(data().body)) {\n {{ data().body | translate | async }}\n } @else {\n {{ data().body }}\n }\n </div>\n </div>\n\n @if ((isUnread() && showDismissUnread()) || hasDefaultAction()) {\n <div\n class=\"axp-in-app-inbox-item__actions\"\n [class.--dismiss-only]=\"isUnread() && showDismissUnread() && !hasDefaultAction()\"\n >\n @if (isUnread() && showDismissUnread()) {\n <button\n type=\"button\"\n class=\"axp-in-app-inbox-item__dismiss\"\n [attr.aria-label]=\"markAsReadLabelKey() | translate | async\"\n (click)=\"onDismissMarkAsRead($event)\"\n >\n <ax-icon><i class=\"fa-light fa-xmark\" aria-hidden=\"true\"></i></ax-icon>\n </button>\n }\n @if (hasDefaultAction()) {\n <div class=\"axp-in-app-inbox-item__chevron\" aria-hidden=\"true\">\n <ax-icon><i class=\"fa-light fa-chevron-right axp-in-app-inbox-item__chevron-icon\"></i></ax-icon>\n </div>\n }\n </div>\n }\n</div>\n", styles: ["@reference \"@acorex/styles/themes/default.css\";:host{@apply block text-start border-b;border-color:rgb(var(--ax-sys-color-border-lightest-surface))}:host(:last-child){@apply border-b-0;}.axp-in-app-inbox-item{@apply flex items-start gap-3 px-4 py-3 relative cursor-pointer transition-colors duration-150;}.axp-in-app-inbox-item.read,.axp-in-app-inbox-item.unread{background:transparent}.axp-in-app-inbox-item.unread-highlight{background:rgb(var(--ax-sys-color-warning-50))}@media(hover:hover){.axp-in-app-inbox-item:hover{background:rgb(var(--ax-sys-color-lightest-surface))}.axp-in-app-inbox-item:hover.unread-highlight{background:rgb(var(--ax-sys-color-warning-100))}.axp-in-app-inbox-item:hover .axp-in-app-inbox-item__pin--muted,.axp-in-app-inbox-item:hover .axp-in-app-inbox-item__dismiss{visibility:visible;pointer-events:auto}.axp-in-app-inbox-item:hover .axp-in-app-inbox-item__chevron{color:rgb(var(--ax-sys-color-on-surface))}}.axp-in-app-inbox-item__actions{@apply relative flex shrink-0 items-center self-center ps-1;}.axp-in-app-inbox-item__dismiss{@apply absolute bottom-full mb-0.5 start-1/2 inline-flex size-6 -translate-x-1/2 items-center justify-center rounded-full border-0 bg-transparent p-0;color:rgb(var(--ax-sys-color-on-surface-variant))}@media(hover:hover){.axp-in-app-inbox-item__dismiss{visibility:hidden;pointer-events:none}}.axp-in-app-inbox-item__dismiss i{@apply text-xs leading-none;}.axp-in-app-inbox-item__dismiss:focus-visible{visibility:visible;pointer-events:auto;color:rgb(var(--ax-sys-color-on-surface))}.axp-in-app-inbox-item__dismiss:hover{color:rgb(var(--ax-sys-color-on-surface))}.axp-in-app-inbox-item__actions.--dismiss-only .axp-in-app-inbox-item__dismiss{@apply static mb-0 translate-x-0;}.axp-in-app-inbox-item__avatar{@apply relative h-12 shrink-0;}.axp-in-app-inbox-item__icon{@apply flex size-12 shrink-0 items-center justify-center rounded-full border text-base leading-none;}.axp-in-app-inbox-item__icon i{@apply block text-base leading-none;}.axp-in-app-inbox-item__icon.Notice{@apply border;background-color:rgb(var(--ax-sys-color-success-lightest-surface));border-color:rgb(var(--ax-sys-color-border-success-light-surface))}.axp-in-app-inbox-item__icon.Notice i{color:rgb(var(--ax-sys-color-on-success-lightest-surface))}.axp-in-app-inbox-item__icon.Danger{@apply border;background-color:rgb(var(--ax-sys-color-danger-lightest-surface));border-color:rgb(var(--ax-sys-color-border-danger-light-surface))}.axp-in-app-inbox-item__icon.Danger i{color:rgb(var(--ax-sys-color-on-danger-lightest-surface))}.axp-in-app-inbox-item__icon.Warning{@apply border;background-color:rgb(var(--ax-sys-color-warning-lightest-surface));border-color:rgb(var(--ax-sys-color-border-warning-light-surface))}.axp-in-app-inbox-item__icon.Warning i{color:rgb(var(--ax-sys-color-on-warning-lightest-surface))}.axp-in-app-inbox-item__unread-badge{@apply absolute bottom-0 end-0;width:10px;height:10px;background:rgb(var(--ax-sys-color-primary-500));border:2px solid rgb(var(--ax-sys-color-surface));border-radius:50%}.axp-in-app-inbox-item__content{@apply flex min-w-0 flex-1 flex-col text-start;}.axp-in-app-inbox-item__title{@apply text-sm font-medium truncate;color:rgb(var(--ax-sys-color-on-surface))}.axp-in-app-inbox-item__title.--unread{@apply font-semibold;}.axp-in-app-inbox-item__subline{@apply mt-0.5 flex min-w-0 flex-wrap items-center gap-x-1.5 gap-y-0.5;}.axp-in-app-inbox-item__time,.axp-in-app-inbox-item__category,.axp-in-app-inbox-item__subline-separator{@apply text-xs;color:rgb(var(--ax-sys-color-on-surface-variant))}.axp-in-app-inbox-item__body{@apply mt-1 line-clamp-2 text-start text-sm;color:rgb(var(--ax-sys-color-on-surface-variant))}.axp-in-app-inbox-item__pin{@apply inline-flex items-center justify-center rounded-full border-0 bg-transparent p-0.5;color:rgb(var(--ax-sys-color-primary))}.axp-in-app-inbox-item__pin i{@apply rotate-45 text-xs;}.axp-in-app-inbox-item__pin--inline{@apply ms-auto;}.axp-in-app-inbox-item__pin--muted{color:rgb(var(--ax-sys-color-on-surface-variant))}@media(hover:hover){.axp-in-app-inbox-item__pin--muted{visibility:hidden;pointer-events:none}}.axp-in-app-inbox-item__pin--muted:focus-visible{visibility:visible;pointer-events:auto}.axp-in-app-inbox-item__pin--muted:hover{color:rgb(var(--ax-sys-color-primary))}.axp-in-app-inbox-item__chevron{@apply text-sm transition-colors;color:rgb(var(--ax-sys-color-on-surface-variant))}:host-context([dir=\"rtl\"]) .axp-in-app-inbox-item__chevron-icon{transform:scaleX(-1)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i3.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: AXPUserAvatarComponent, selector: "axp-user-avatar", inputs: ["size", "userId", "showPresence", "displayName", "displayAvatar"] }, { kind: "directive", type: AXPUserCardDirective, selector: "[axpUserCard]", inputs: ["axpUserCard", "axpUserCardDisabled"] }, { kind: "ngmodule", type: AXBadgeModule }, { kind: "ngmodule", type: AXFormatModule }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i3$1.AXFormatPipe, name: "format" }, { kind: "pipe", type: i4.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1607
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: AXPInAppInboxItemComponent, isStandalone: true, selector: "axp-in-app-inbox-item", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, showAvatar: { classPropertyName: "showAvatar", publicName: "showAvatar", isSignal: true, isRequired: false, transformFunction: null }, showDate: { classPropertyName: "showDate", publicName: "showDate", isSignal: true, isRequired: false, transformFunction: null }, showPin: { classPropertyName: "showPin", publicName: "showPin", isSignal: true, isRequired: false, transformFunction: null }, pinLabelKey: { classPropertyName: "pinLabelKey", publicName: "pinLabelKey", isSignal: true, isRequired: false, transformFunction: null }, unpinLabelKey: { classPropertyName: "unpinLabelKey", publicName: "unpinLabelKey", isSignal: true, isRequired: false, transformFunction: null }, highlightUnreadBackground: { classPropertyName: "highlightUnreadBackground", publicName: "highlightUnreadBackground", isSignal: true, isRequired: false, transformFunction: null }, showDismissUnread: { classPropertyName: "showDismissUnread", publicName: "showDismissUnread", isSignal: true, isRequired: false, transformFunction: null }, markAsReadLabelKey: { classPropertyName: "markAsReadLabelKey", publicName: "markAsReadLabelKey", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemPress: "itemPress", markAsRead: "markAsRead", togglePin: "togglePin", closePopover: "closePopover" }, ngImport: i0, template: "<div\n class=\"axp-in-app-inbox-item\"\n [id]=\"data().id\"\n (click)=\"onPress(data().id)\"\n [class]=\"[\n priorityClass(),\n isUnread() ? 'unread' : 'read',\n isUnread() && highlightUnreadBackground() ? 'unread-highlight' : '',\n bodyIsHtml() ? 'axp-in-app-inbox-item--rich' : '',\n ]\"\n>\n @if (showItemIcon()) {\n <!-- ----- Priority icon when the item has no real sender avatar ----- -->\n <div class=\"axp-in-app-inbox-item__icon\" [class]=\"priorityClass()\">\n <i [class]=\"itemIconClass()\" aria-hidden=\"true\"></i>\n </div>\n } @else if (showItemAvatar()) {\n <!-- ----- Sender avatar for conversation-style inbox rows ----- -->\n <div class=\"axp-in-app-inbox-item__avatar\">\n <axp-user-avatar\n [size]=\"48\"\n [userId]=\"data().sender!.id\"\n [axpUserCard]=\"data().sender!.id\"\n ></axp-user-avatar>\n @if (isUnread()) {\n <!-- ----- Unread status dot on the avatar ----- -->\n <div class=\"axp-in-app-inbox-item__unread-badge\"></div>\n }\n </div>\n }\n\n <div class=\"axp-in-app-inbox-item__content\">\n <div class=\"axp-in-app-inbox-item__headline\">\n <div class=\"axp-in-app-inbox-item__title\" [class.--unread]=\"isUnread()\">\n @if (isI18nKey(headline())) {\n <!-- ----- Localized headline ----- -->\n {{ headline() | translate | async }}\n } @else {\n <!-- ----- Plain-text sender name or title ----- -->\n {{ headline() }}\n }\n </div>\n @if (showPin()) {\n @if (data().isPinned) {\n <!-- ----- Pinned state next to the title ----- -->\n <button\n type=\"button\"\n class=\"axp-in-app-inbox-item__pin\"\n [attr.aria-label]=\"unpinLabelKey() | translate | async\"\n (click)=\"onTogglePin($event)\"\n >\n <ax-icon><i class=\"fa-solid fa-thumbtack\"></i></ax-icon>\n </button>\n } @else {\n <!-- ----- Unpinned control shown on hover ----- -->\n <button\n type=\"button\"\n class=\"axp-in-app-inbox-item__pin axp-in-app-inbox-item__pin--muted\"\n [attr.aria-label]=\"pinLabelKey() | translate | async\"\n (click)=\"onTogglePin($event)\"\n >\n <ax-icon><i class=\"fa-regular fa-thumbtack\"></i></ax-icon>\n </button>\n }\n }\n </div>\n\n @if (data().category) {\n <!-- ----- Optional category under the headline ----- -->\n <div class=\"axp-in-app-inbox-item__subline\">\n <span class=\"axp-in-app-inbox-item__category\">{{ data().category }}</span>\n </div>\n }\n\n <div class=\"axp-in-app-inbox-item__body\" [class.axp-in-app-inbox-item__body--html]=\"bodyIsHtml()\">\n @if (isI18nKey(data().body)) {\n <!-- ----- Localized body preview ----- -->\n {{ data().body | translate | async }}\n }\n <!-- ----- Light HTML body (lists, status badges) ----- -->\n @else if (bodyIsHtml()) {\n <div [innerHTML]=\"bodyHtml() | safe: 'html'\"></div>\n }\n <!-- ----- Plain-text body preview ----- -->\n @else {\n {{ data().body }}\n }\n </div>\n </div>\n\n @if (showMeta()) {\n <!-- ----- Time at top-end; close replaces it on hover ----- -->\n <div class=\"axp-in-app-inbox-item__meta\" [class.--has-dismiss]=\"showDismiss()\">\n @if (showDate()) {\n <span class=\"axp-in-app-inbox-item__time\">{{ data().createdAt | format: 'timeleft' | async }}</span>\n }\n @if (showDismiss()) {\n <button\n type=\"button\"\n class=\"axp-in-app-inbox-item__dismiss\"\n [attr.aria-label]=\"markAsReadLabelKey() | translate | async\"\n (click)=\"onDismissMarkAsRead($event)\"\n >\n <ax-icon><i class=\"fa-light fa-xmark\" aria-hidden=\"true\"></i></ax-icon>\n </button>\n }\n </div>\n }\n\n @if (showDate() || hasDefaultAction()) {\n <!-- ----- Chevron always vertically centered in the row ----- -->\n <div class=\"axp-in-app-inbox-item__actions\">\n @if (showDate()) {\n <span class=\"axp-in-app-inbox-item__time-sizer\" aria-hidden=\"true\">\n {{ data().createdAt | format: 'timeleft' | async }}\n </span>\n }\n @if (hasDefaultAction()) {\n <div class=\"axp-in-app-inbox-item__chevron\" aria-hidden=\"true\">\n <ax-icon><i class=\"fa-light fa-chevron-right axp-in-app-inbox-item__chevron-icon\"></i></ax-icon>\n </div>\n }\n </div>\n }\n</div>\n", styles: ["@reference \"@acorex/styles/themes/default.css\";:host{@apply block text-start border-b;border-color:rgb(var(--ax-sys-color-border-lightest-surface))}:host(:last-child){@apply border-b-0;}.axp-in-app-inbox-item{@apply relative flex items-center gap-3 px-4 py-3 cursor-pointer transition-colors duration-150;}.axp-in-app-inbox-item.read,.axp-in-app-inbox-item.unread{background:transparent}.axp-in-app-inbox-item.unread-highlight{background:rgb(var(--ax-sys-color-warning-50))}@media(hover:hover){.axp-in-app-inbox-item:hover{background:rgb(var(--ax-sys-color-lightest-surface))}.axp-in-app-inbox-item:hover.unread-highlight{background:rgb(var(--ax-sys-color-warning-100))}.axp-in-app-inbox-item:hover .axp-in-app-inbox-item__pin--muted{visibility:visible;pointer-events:auto}}.axp-in-app-inbox-item__actions{@apply flex shrink-0 items-center justify-end;}.axp-in-app-inbox-item__meta{@apply absolute top-0 end-4 grid items-center justify-items-end pt-1;}.axp-in-app-inbox-item__time-sizer{@apply invisible block h-0 w-max shrink-0 overflow-hidden whitespace-nowrap;}.axp-in-app-inbox-item__time,.axp-in-app-inbox-item__dismiss{grid-area:1 / 1}.axp-in-app-inbox-item__dismiss{@apply inline-flex size-6 items-center justify-center rounded-full border-0 bg-transparent p-0;color:rgb(var(--ax-sys-color-on-surface-variant))}.axp-in-app-inbox-item__dismiss i{@apply text-xs leading-none;}.axp-in-app-inbox-item__dismiss:hover{color:rgb(var(--ax-sys-color-on-surface))}.axp-in-app-inbox-item__chevron{@apply inline-flex size-6 items-center justify-center text-sm;color:rgb(var(--ax-sys-color-on-surface-variant))}.axp-in-app-inbox-item__avatar{@apply relative h-12 shrink-0;}.axp-in-app-inbox-item__icon{@apply flex size-12 shrink-0 items-center justify-center rounded-full border text-base leading-none;}.axp-in-app-inbox-item__icon i{@apply block text-base leading-none;}.axp-in-app-inbox-item__icon.Notice{@apply border;background-color:rgb(var(--ax-sys-color-success-lightest-surface));border-color:rgb(var(--ax-sys-color-border-success-light-surface))}.axp-in-app-inbox-item__icon.Notice i{color:rgb(var(--ax-sys-color-on-success-lightest-surface))}.axp-in-app-inbox-item__icon.Danger{@apply border;background-color:rgb(var(--ax-sys-color-danger-lightest-surface));border-color:rgb(var(--ax-sys-color-border-danger-light-surface))}.axp-in-app-inbox-item__icon.Danger i{color:rgb(var(--ax-sys-color-on-danger-lightest-surface))}.axp-in-app-inbox-item__icon.Warning{@apply border;background-color:rgb(var(--ax-sys-color-warning-lightest-surface));border-color:rgb(var(--ax-sys-color-border-warning-light-surface))}.axp-in-app-inbox-item__icon.Warning i{color:rgb(var(--ax-sys-color-on-warning-lightest-surface))}.axp-in-app-inbox-item__unread-badge{@apply absolute bottom-0 end-0;width:10px;height:10px;background:rgb(var(--ax-sys-color-primary-500));border:2px solid rgb(var(--ax-sys-color-surface));border-radius:50%}.axp-in-app-inbox-item__content{@apply flex min-w-0 flex-1 flex-col text-start;}.axp-in-app-inbox-item__headline{@apply flex min-w-0 items-center gap-1;}.axp-in-app-inbox-item__title{@apply min-w-0 text-sm font-medium truncate;color:rgb(var(--ax-sys-color-on-surface))}.axp-in-app-inbox-item__title.--unread{@apply font-semibold;}.axp-in-app-inbox-item__subline{@apply mt-0.5 flex min-w-0 flex-wrap items-center gap-x-1.5 gap-y-0.5;}.axp-in-app-inbox-item__time,.axp-in-app-inbox-item__category{@apply text-xs whitespace-nowrap;color:rgb(var(--ax-sys-color-on-surface-variant))}.axp-in-app-inbox-item--rich{@apply items-start;}.axp-in-app-inbox-item__body{@apply mt-1 line-clamp-2 text-start text-sm;color:rgb(var(--ax-sys-color-on-surface-variant))}.axp-in-app-inbox-item__body--html{display:block;overflow:visible;-webkit-line-clamp:unset;line-clamp:unset;margin-top:.125rem;font-size:12px;line-height:1.35}:host ::ng-deep .axp-in-app-inbox-item__body--html :where(h1,h2,h3,h4,p,ul,li,div,span):not(.axp-status-badge){font-size:inherit!important;line-height:inherit!important;font-family:inherit!important;margin:0!important}:host ::ng-deep .axp-in-app-inbox-item__body--html :where(h1,h2,h3,h4){display:none!important}:host ::ng-deep .axp-in-app-inbox-item__body--html ul{padding:0!important;list-style:none!important}:host ::ng-deep .axp-in-app-inbox-item__body--html li{margin:0 0 2px!important}:host ::ng-deep .axp-in-app-inbox-item__body--html .axp-in-app-digest-meta{@apply mb-0.5 text-xs;}:host ::ng-deep .axp-in-app-inbox-item__body--html .axp-in-app-digest-row{@apply block truncate;}:host ::ng-deep .axp-in-app-inbox-item__body--html .axp-status-badge{display:inline-block!important;position:relative;top:-1px;padding:1px 6px!important;border-radius:999px!important;font-size:10px!important;line-height:1.3!important;font-weight:600!important;white-space:nowrap!important;vertical-align:middle}:host ::ng-deep .axp-in-app-inbox-item__body--html .axp-status-badge--danger,:host ::ng-deep .axp-in-app-inbox-item__body--html .axp-status-badge--expired{background-color:#fee2e2!important;color:#b91c1c!important;border:1px solid #fecaca!important}:host ::ng-deep .axp-in-app-inbox-item__body--html .axp-status-badge--warning,:host ::ng-deep .axp-in-app-inbox-item__body--html .axp-status-badge--near{background-color:#ffedd5!important;color:#b45309!important;border:1px solid #fed7aa!important}.axp-in-app-inbox-item__pin{@apply inline-flex shrink-0 items-center justify-center rounded-full border-0 bg-transparent p-0.5;color:rgb(var(--ax-sys-color-primary))}.axp-in-app-inbox-item__pin i{@apply rotate-45 text-xs;}.axp-in-app-inbox-item__pin--muted{color:rgb(var(--ax-sys-color-on-surface-variant))}@media(hover:hover){.axp-in-app-inbox-item__pin--muted{visibility:hidden;pointer-events:none}}.axp-in-app-inbox-item__pin--muted:focus-visible{visibility:visible;pointer-events:auto}.axp-in-app-inbox-item__pin--muted:hover{color:rgb(var(--ax-sys-color-primary))}@media(hover:hover){.axp-in-app-inbox-item__dismiss{opacity:0;pointer-events:none}:host(:hover) .axp-in-app-inbox-item__meta.--has-dismiss .axp-in-app-inbox-item__time{opacity:0}:host(:hover) .axp-in-app-inbox-item__dismiss{opacity:1;pointer-events:auto}:host(:hover) .axp-in-app-inbox-item__chevron{color:rgb(var(--ax-sys-color-on-surface))}}@media(hover:none){.axp-in-app-inbox-item__meta.--has-dismiss .axp-in-app-inbox-item__time{opacity:0}}.axp-in-app-inbox-item__meta.--has-dismiss:focus-within .axp-in-app-inbox-item__time{opacity:0}.axp-in-app-inbox-item__dismiss:focus-visible{opacity:1;pointer-events:auto;color:rgb(var(--ax-sys-color-on-surface))}:host-context([dir=\"rtl\"]) .axp-in-app-inbox-item__chevron-icon{transform:scaleX(-1)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i3.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: AXPUserAvatarComponent, selector: "axp-user-avatar", inputs: ["size", "userId", "showPresence", "displayName", "displayAvatar"] }, { kind: "directive", type: AXPUserCardDirective, selector: "[axpUserCard]", inputs: ["axpUserCard", "axpUserCardDisabled", "axpUserCardTrigger"] }, { kind: "ngmodule", type: AXBadgeModule }, { kind: "ngmodule", type: AXFormatModule }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i3$1.AXFormatPipe, name: "format" }, { kind: "pipe", type: AXSafePipe, name: "safe" }, { kind: "pipe", type: i4.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1388
1608
|
}
|
|
1389
1609
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPInAppInboxItemComponent, decorators: [{
|
|
1390
1610
|
type: Component,
|
|
@@ -1395,9 +1615,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
1395
1615
|
AXPUserCardDirective,
|
|
1396
1616
|
AXBadgeModule,
|
|
1397
1617
|
AXFormatModule,
|
|
1618
|
+
AXSafePipe,
|
|
1398
1619
|
AXTranslationModule,
|
|
1399
|
-
], template: "<div\n class=\"axp-in-app-inbox-item\"\n [id]=\"data().id\"\n (click)=\"onPress(data().id)\"\n [class]=\"[\n priorityClass(),\n isUnread() ? 'unread' : 'read',\n isUnread() && highlightUnreadBackground() ? 'unread-highlight' : '',\n ]\"\n>\n @if (showItemIcon()) {\n <div class=\"axp-in-app-inbox-item__icon\" [class]=\"priorityClass()\">\n <i [class]=\"itemIconClass()\" aria-hidden=\"true\"></i>\n </div>\n } @else if (showItemAvatar()) {\n <div class=\"axp-in-app-inbox-item__avatar\">\n <axp-user-avatar\n [size]=\"48\"\n [userId]=\"data().sender!.id\"\n [axpUserCard]=\"data().sender!.id\"\n ></axp-user-avatar>\n @if (isUnread()) {\n <div class=\"axp-in-app-inbox-item__unread-badge\"></div>\n }\n </div>\n }\n\n <div class=\"axp-in-app-inbox-item__content\">\n <div class=\"axp-in-app-inbox-item__title\" [class.--unread]=\"isUnread()\">\n @if (isI18nKey(headline())) {\n {{ headline() | translate | async }}\n } @else {\n {{ headline() }}\n }\n </div>\n\n <div class=\"axp-in-app-inbox-item__subline\">\n @if (showDate()) {\n <span class=\"axp-in-app-inbox-item__time\">{{ data().createdAt | format: 'timeleft' | async }}</span>\n }\n @if (data().category) {\n <span class=\"axp-in-app-inbox-item__subline-separator\" aria-hidden=\"true\">\u2022</span>\n <span class=\"axp-in-app-inbox-item__category\">{{ data().category }}</span>\n }\n @if (showPin()) {\n @if (data().isPinned) {\n <button\n type=\"button\"\n class=\"axp-in-app-inbox-item__pin axp-in-app-inbox-item__pin--inline\"\n [attr.aria-label]=\"unpinLabelKey() | translate | async\"\n (click)=\"onTogglePin($event)\"\n >\n <ax-icon><i class=\"fa-solid fa-thumbtack\"></i></ax-icon>\n </button>\n } @else {\n <button\n type=\"button\"\n class=\"axp-in-app-inbox-item__pin axp-in-app-inbox-item__pin--inline axp-in-app-inbox-item__pin--muted\"\n [attr.aria-label]=\"pinLabelKey() | translate | async\"\n (click)=\"onTogglePin($event)\"\n >\n <ax-icon><i class=\"fa-regular fa-thumbtack\"></i></ax-icon>\n </button>\n }\n }\n </div>\n\n <div class=\"axp-in-app-inbox-item__body\">\n @if (isI18nKey(data().body)) {\n {{ data().body | translate | async }}\n } @else {\n {{ data().body }}\n }\n </div>\n </div>\n\n @if ((isUnread() && showDismissUnread()) || hasDefaultAction()) {\n <div\n class=\"axp-in-app-inbox-item__actions\"\n [class.--dismiss-only]=\"isUnread() && showDismissUnread() && !hasDefaultAction()\"\n >\n @if (isUnread() && showDismissUnread()) {\n <button\n type=\"button\"\n class=\"axp-in-app-inbox-item__dismiss\"\n [attr.aria-label]=\"markAsReadLabelKey() | translate | async\"\n (click)=\"onDismissMarkAsRead($event)\"\n >\n <ax-icon><i class=\"fa-light fa-xmark\" aria-hidden=\"true\"></i></ax-icon>\n </button>\n }\n @if (hasDefaultAction()) {\n <div class=\"axp-in-app-inbox-item__chevron\" aria-hidden=\"true\">\n <ax-icon><i class=\"fa-light fa-chevron-right axp-in-app-inbox-item__chevron-icon\"></i></ax-icon>\n </div>\n }\n </div>\n }\n</div>\n", styles: ["@reference \"@acorex/styles/themes/default.css\";:host{@apply block text-start border-b;border-color:rgb(var(--ax-sys-color-border-lightest-surface))}:host(:last-child){@apply border-b-0;}.axp-in-app-inbox-item{@apply flex items-start gap-3 px-4 py-3 relative cursor-pointer transition-colors duration-150;}.axp-in-app-inbox-item.read,.axp-in-app-inbox-item.unread{background:transparent}.axp-in-app-inbox-item.unread-highlight{background:rgb(var(--ax-sys-color-warning-50))}@media(hover:hover){.axp-in-app-inbox-item:hover{background:rgb(var(--ax-sys-color-lightest-surface))}.axp-in-app-inbox-item:hover.unread-highlight{background:rgb(var(--ax-sys-color-warning-100))}.axp-in-app-inbox-item:hover .axp-in-app-inbox-item__pin--muted,.axp-in-app-inbox-item:hover .axp-in-app-inbox-item__dismiss{visibility:visible;pointer-events:auto}.axp-in-app-inbox-item:hover .axp-in-app-inbox-item__chevron{color:rgb(var(--ax-sys-color-on-surface))}}.axp-in-app-inbox-item__actions{@apply relative flex shrink-0 items-center self-center ps-1;}.axp-in-app-inbox-item__dismiss{@apply absolute bottom-full mb-0.5 start-1/2 inline-flex size-6 -translate-x-1/2 items-center justify-center rounded-full border-0 bg-transparent p-0;color:rgb(var(--ax-sys-color-on-surface-variant))}@media(hover:hover){.axp-in-app-inbox-item__dismiss{visibility:hidden;pointer-events:none}}.axp-in-app-inbox-item__dismiss i{@apply text-xs leading-none;}.axp-in-app-inbox-item__dismiss:focus-visible{visibility:visible;pointer-events:auto;color:rgb(var(--ax-sys-color-on-surface))}.axp-in-app-inbox-item__dismiss:hover{color:rgb(var(--ax-sys-color-on-surface))}.axp-in-app-inbox-item__actions.--dismiss-only .axp-in-app-inbox-item__dismiss{@apply static mb-0 translate-x-0;}.axp-in-app-inbox-item__avatar{@apply relative h-12 shrink-0;}.axp-in-app-inbox-item__icon{@apply flex size-12 shrink-0 items-center justify-center rounded-full border text-base leading-none;}.axp-in-app-inbox-item__icon i{@apply block text-base leading-none;}.axp-in-app-inbox-item__icon.Notice{@apply border;background-color:rgb(var(--ax-sys-color-success-lightest-surface));border-color:rgb(var(--ax-sys-color-border-success-light-surface))}.axp-in-app-inbox-item__icon.Notice i{color:rgb(var(--ax-sys-color-on-success-lightest-surface))}.axp-in-app-inbox-item__icon.Danger{@apply border;background-color:rgb(var(--ax-sys-color-danger-lightest-surface));border-color:rgb(var(--ax-sys-color-border-danger-light-surface))}.axp-in-app-inbox-item__icon.Danger i{color:rgb(var(--ax-sys-color-on-danger-lightest-surface))}.axp-in-app-inbox-item__icon.Warning{@apply border;background-color:rgb(var(--ax-sys-color-warning-lightest-surface));border-color:rgb(var(--ax-sys-color-border-warning-light-surface))}.axp-in-app-inbox-item__icon.Warning i{color:rgb(var(--ax-sys-color-on-warning-lightest-surface))}.axp-in-app-inbox-item__unread-badge{@apply absolute bottom-0 end-0;width:10px;height:10px;background:rgb(var(--ax-sys-color-primary-500));border:2px solid rgb(var(--ax-sys-color-surface));border-radius:50%}.axp-in-app-inbox-item__content{@apply flex min-w-0 flex-1 flex-col text-start;}.axp-in-app-inbox-item__title{@apply text-sm font-medium truncate;color:rgb(var(--ax-sys-color-on-surface))}.axp-in-app-inbox-item__title.--unread{@apply font-semibold;}.axp-in-app-inbox-item__subline{@apply mt-0.5 flex min-w-0 flex-wrap items-center gap-x-1.5 gap-y-0.5;}.axp-in-app-inbox-item__time,.axp-in-app-inbox-item__category,.axp-in-app-inbox-item__subline-separator{@apply text-xs;color:rgb(var(--ax-sys-color-on-surface-variant))}.axp-in-app-inbox-item__body{@apply mt-1 line-clamp-2 text-start text-sm;color:rgb(var(--ax-sys-color-on-surface-variant))}.axp-in-app-inbox-item__pin{@apply inline-flex items-center justify-center rounded-full border-0 bg-transparent p-0.5;color:rgb(var(--ax-sys-color-primary))}.axp-in-app-inbox-item__pin i{@apply rotate-45 text-xs;}.axp-in-app-inbox-item__pin--inline{@apply ms-auto;}.axp-in-app-inbox-item__pin--muted{color:rgb(var(--ax-sys-color-on-surface-variant))}@media(hover:hover){.axp-in-app-inbox-item__pin--muted{visibility:hidden;pointer-events:none}}.axp-in-app-inbox-item__pin--muted:focus-visible{visibility:visible;pointer-events:auto}.axp-in-app-inbox-item__pin--muted:hover{color:rgb(var(--ax-sys-color-primary))}.axp-in-app-inbox-item__chevron{@apply text-sm transition-colors;color:rgb(var(--ax-sys-color-on-surface-variant))}:host-context([dir=\"rtl\"]) .axp-in-app-inbox-item__chevron-icon{transform:scaleX(-1)}\n"] }]
|
|
1620
|
+
], template: "<div\n class=\"axp-in-app-inbox-item\"\n [id]=\"data().id\"\n (click)=\"onPress(data().id)\"\n [class]=\"[\n priorityClass(),\n isUnread() ? 'unread' : 'read',\n isUnread() && highlightUnreadBackground() ? 'unread-highlight' : '',\n bodyIsHtml() ? 'axp-in-app-inbox-item--rich' : '',\n ]\"\n>\n @if (showItemIcon()) {\n <!-- ----- Priority icon when the item has no real sender avatar ----- -->\n <div class=\"axp-in-app-inbox-item__icon\" [class]=\"priorityClass()\">\n <i [class]=\"itemIconClass()\" aria-hidden=\"true\"></i>\n </div>\n } @else if (showItemAvatar()) {\n <!-- ----- Sender avatar for conversation-style inbox rows ----- -->\n <div class=\"axp-in-app-inbox-item__avatar\">\n <axp-user-avatar\n [size]=\"48\"\n [userId]=\"data().sender!.id\"\n [axpUserCard]=\"data().sender!.id\"\n ></axp-user-avatar>\n @if (isUnread()) {\n <!-- ----- Unread status dot on the avatar ----- -->\n <div class=\"axp-in-app-inbox-item__unread-badge\"></div>\n }\n </div>\n }\n\n <div class=\"axp-in-app-inbox-item__content\">\n <div class=\"axp-in-app-inbox-item__headline\">\n <div class=\"axp-in-app-inbox-item__title\" [class.--unread]=\"isUnread()\">\n @if (isI18nKey(headline())) {\n <!-- ----- Localized headline ----- -->\n {{ headline() | translate | async }}\n } @else {\n <!-- ----- Plain-text sender name or title ----- -->\n {{ headline() }}\n }\n </div>\n @if (showPin()) {\n @if (data().isPinned) {\n <!-- ----- Pinned state next to the title ----- -->\n <button\n type=\"button\"\n class=\"axp-in-app-inbox-item__pin\"\n [attr.aria-label]=\"unpinLabelKey() | translate | async\"\n (click)=\"onTogglePin($event)\"\n >\n <ax-icon><i class=\"fa-solid fa-thumbtack\"></i></ax-icon>\n </button>\n } @else {\n <!-- ----- Unpinned control shown on hover ----- -->\n <button\n type=\"button\"\n class=\"axp-in-app-inbox-item__pin axp-in-app-inbox-item__pin--muted\"\n [attr.aria-label]=\"pinLabelKey() | translate | async\"\n (click)=\"onTogglePin($event)\"\n >\n <ax-icon><i class=\"fa-regular fa-thumbtack\"></i></ax-icon>\n </button>\n }\n }\n </div>\n\n @if (data().category) {\n <!-- ----- Optional category under the headline ----- -->\n <div class=\"axp-in-app-inbox-item__subline\">\n <span class=\"axp-in-app-inbox-item__category\">{{ data().category }}</span>\n </div>\n }\n\n <div class=\"axp-in-app-inbox-item__body\" [class.axp-in-app-inbox-item__body--html]=\"bodyIsHtml()\">\n @if (isI18nKey(data().body)) {\n <!-- ----- Localized body preview ----- -->\n {{ data().body | translate | async }}\n }\n <!-- ----- Light HTML body (lists, status badges) ----- -->\n @else if (bodyIsHtml()) {\n <div [innerHTML]=\"bodyHtml() | safe: 'html'\"></div>\n }\n <!-- ----- Plain-text body preview ----- -->\n @else {\n {{ data().body }}\n }\n </div>\n </div>\n\n @if (showMeta()) {\n <!-- ----- Time at top-end; close replaces it on hover ----- -->\n <div class=\"axp-in-app-inbox-item__meta\" [class.--has-dismiss]=\"showDismiss()\">\n @if (showDate()) {\n <span class=\"axp-in-app-inbox-item__time\">{{ data().createdAt | format: 'timeleft' | async }}</span>\n }\n @if (showDismiss()) {\n <button\n type=\"button\"\n class=\"axp-in-app-inbox-item__dismiss\"\n [attr.aria-label]=\"markAsReadLabelKey() | translate | async\"\n (click)=\"onDismissMarkAsRead($event)\"\n >\n <ax-icon><i class=\"fa-light fa-xmark\" aria-hidden=\"true\"></i></ax-icon>\n </button>\n }\n </div>\n }\n\n @if (showDate() || hasDefaultAction()) {\n <!-- ----- Chevron always vertically centered in the row ----- -->\n <div class=\"axp-in-app-inbox-item__actions\">\n @if (showDate()) {\n <span class=\"axp-in-app-inbox-item__time-sizer\" aria-hidden=\"true\">\n {{ data().createdAt | format: 'timeleft' | async }}\n </span>\n }\n @if (hasDefaultAction()) {\n <div class=\"axp-in-app-inbox-item__chevron\" aria-hidden=\"true\">\n <ax-icon><i class=\"fa-light fa-chevron-right axp-in-app-inbox-item__chevron-icon\"></i></ax-icon>\n </div>\n }\n </div>\n }\n</div>\n", styles: ["@reference \"@acorex/styles/themes/default.css\";:host{@apply block text-start border-b;border-color:rgb(var(--ax-sys-color-border-lightest-surface))}:host(:last-child){@apply border-b-0;}.axp-in-app-inbox-item{@apply relative flex items-center gap-3 px-4 py-3 cursor-pointer transition-colors duration-150;}.axp-in-app-inbox-item.read,.axp-in-app-inbox-item.unread{background:transparent}.axp-in-app-inbox-item.unread-highlight{background:rgb(var(--ax-sys-color-warning-50))}@media(hover:hover){.axp-in-app-inbox-item:hover{background:rgb(var(--ax-sys-color-lightest-surface))}.axp-in-app-inbox-item:hover.unread-highlight{background:rgb(var(--ax-sys-color-warning-100))}.axp-in-app-inbox-item:hover .axp-in-app-inbox-item__pin--muted{visibility:visible;pointer-events:auto}}.axp-in-app-inbox-item__actions{@apply flex shrink-0 items-center justify-end;}.axp-in-app-inbox-item__meta{@apply absolute top-0 end-4 grid items-center justify-items-end pt-1;}.axp-in-app-inbox-item__time-sizer{@apply invisible block h-0 w-max shrink-0 overflow-hidden whitespace-nowrap;}.axp-in-app-inbox-item__time,.axp-in-app-inbox-item__dismiss{grid-area:1 / 1}.axp-in-app-inbox-item__dismiss{@apply inline-flex size-6 items-center justify-center rounded-full border-0 bg-transparent p-0;color:rgb(var(--ax-sys-color-on-surface-variant))}.axp-in-app-inbox-item__dismiss i{@apply text-xs leading-none;}.axp-in-app-inbox-item__dismiss:hover{color:rgb(var(--ax-sys-color-on-surface))}.axp-in-app-inbox-item__chevron{@apply inline-flex size-6 items-center justify-center text-sm;color:rgb(var(--ax-sys-color-on-surface-variant))}.axp-in-app-inbox-item__avatar{@apply relative h-12 shrink-0;}.axp-in-app-inbox-item__icon{@apply flex size-12 shrink-0 items-center justify-center rounded-full border text-base leading-none;}.axp-in-app-inbox-item__icon i{@apply block text-base leading-none;}.axp-in-app-inbox-item__icon.Notice{@apply border;background-color:rgb(var(--ax-sys-color-success-lightest-surface));border-color:rgb(var(--ax-sys-color-border-success-light-surface))}.axp-in-app-inbox-item__icon.Notice i{color:rgb(var(--ax-sys-color-on-success-lightest-surface))}.axp-in-app-inbox-item__icon.Danger{@apply border;background-color:rgb(var(--ax-sys-color-danger-lightest-surface));border-color:rgb(var(--ax-sys-color-border-danger-light-surface))}.axp-in-app-inbox-item__icon.Danger i{color:rgb(var(--ax-sys-color-on-danger-lightest-surface))}.axp-in-app-inbox-item__icon.Warning{@apply border;background-color:rgb(var(--ax-sys-color-warning-lightest-surface));border-color:rgb(var(--ax-sys-color-border-warning-light-surface))}.axp-in-app-inbox-item__icon.Warning i{color:rgb(var(--ax-sys-color-on-warning-lightest-surface))}.axp-in-app-inbox-item__unread-badge{@apply absolute bottom-0 end-0;width:10px;height:10px;background:rgb(var(--ax-sys-color-primary-500));border:2px solid rgb(var(--ax-sys-color-surface));border-radius:50%}.axp-in-app-inbox-item__content{@apply flex min-w-0 flex-1 flex-col text-start;}.axp-in-app-inbox-item__headline{@apply flex min-w-0 items-center gap-1;}.axp-in-app-inbox-item__title{@apply min-w-0 text-sm font-medium truncate;color:rgb(var(--ax-sys-color-on-surface))}.axp-in-app-inbox-item__title.--unread{@apply font-semibold;}.axp-in-app-inbox-item__subline{@apply mt-0.5 flex min-w-0 flex-wrap items-center gap-x-1.5 gap-y-0.5;}.axp-in-app-inbox-item__time,.axp-in-app-inbox-item__category{@apply text-xs whitespace-nowrap;color:rgb(var(--ax-sys-color-on-surface-variant))}.axp-in-app-inbox-item--rich{@apply items-start;}.axp-in-app-inbox-item__body{@apply mt-1 line-clamp-2 text-start text-sm;color:rgb(var(--ax-sys-color-on-surface-variant))}.axp-in-app-inbox-item__body--html{display:block;overflow:visible;-webkit-line-clamp:unset;line-clamp:unset;margin-top:.125rem;font-size:12px;line-height:1.35}:host ::ng-deep .axp-in-app-inbox-item__body--html :where(h1,h2,h3,h4,p,ul,li,div,span):not(.axp-status-badge){font-size:inherit!important;line-height:inherit!important;font-family:inherit!important;margin:0!important}:host ::ng-deep .axp-in-app-inbox-item__body--html :where(h1,h2,h3,h4){display:none!important}:host ::ng-deep .axp-in-app-inbox-item__body--html ul{padding:0!important;list-style:none!important}:host ::ng-deep .axp-in-app-inbox-item__body--html li{margin:0 0 2px!important}:host ::ng-deep .axp-in-app-inbox-item__body--html .axp-in-app-digest-meta{@apply mb-0.5 text-xs;}:host ::ng-deep .axp-in-app-inbox-item__body--html .axp-in-app-digest-row{@apply block truncate;}:host ::ng-deep .axp-in-app-inbox-item__body--html .axp-status-badge{display:inline-block!important;position:relative;top:-1px;padding:1px 6px!important;border-radius:999px!important;font-size:10px!important;line-height:1.3!important;font-weight:600!important;white-space:nowrap!important;vertical-align:middle}:host ::ng-deep .axp-in-app-inbox-item__body--html .axp-status-badge--danger,:host ::ng-deep .axp-in-app-inbox-item__body--html .axp-status-badge--expired{background-color:#fee2e2!important;color:#b91c1c!important;border:1px solid #fecaca!important}:host ::ng-deep .axp-in-app-inbox-item__body--html .axp-status-badge--warning,:host ::ng-deep .axp-in-app-inbox-item__body--html .axp-status-badge--near{background-color:#ffedd5!important;color:#b45309!important;border:1px solid #fed7aa!important}.axp-in-app-inbox-item__pin{@apply inline-flex shrink-0 items-center justify-center rounded-full border-0 bg-transparent p-0.5;color:rgb(var(--ax-sys-color-primary))}.axp-in-app-inbox-item__pin i{@apply rotate-45 text-xs;}.axp-in-app-inbox-item__pin--muted{color:rgb(var(--ax-sys-color-on-surface-variant))}@media(hover:hover){.axp-in-app-inbox-item__pin--muted{visibility:hidden;pointer-events:none}}.axp-in-app-inbox-item__pin--muted:focus-visible{visibility:visible;pointer-events:auto}.axp-in-app-inbox-item__pin--muted:hover{color:rgb(var(--ax-sys-color-primary))}@media(hover:hover){.axp-in-app-inbox-item__dismiss{opacity:0;pointer-events:none}:host(:hover) .axp-in-app-inbox-item__meta.--has-dismiss .axp-in-app-inbox-item__time{opacity:0}:host(:hover) .axp-in-app-inbox-item__dismiss{opacity:1;pointer-events:auto}:host(:hover) .axp-in-app-inbox-item__chevron{color:rgb(var(--ax-sys-color-on-surface))}}@media(hover:none){.axp-in-app-inbox-item__meta.--has-dismiss .axp-in-app-inbox-item__time{opacity:0}}.axp-in-app-inbox-item__meta.--has-dismiss:focus-within .axp-in-app-inbox-item__time{opacity:0}.axp-in-app-inbox-item__dismiss:focus-visible{opacity:1;pointer-events:auto;color:rgb(var(--ax-sys-color-on-surface))}:host-context([dir=\"rtl\"]) .axp-in-app-inbox-item__chevron-icon{transform:scaleX(-1)}\n"] }]
|
|
1400
1621
|
}], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }], showAvatar: [{ type: i0.Input, args: [{ isSignal: true, alias: "showAvatar", required: false }] }], showDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "showDate", required: false }] }], showPin: [{ type: i0.Input, args: [{ isSignal: true, alias: "showPin", required: false }] }], pinLabelKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "pinLabelKey", required: false }] }], unpinLabelKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "unpinLabelKey", required: false }] }], highlightUnreadBackground: [{ type: i0.Input, args: [{ isSignal: true, alias: "highlightUnreadBackground", required: false }] }], showDismissUnread: [{ type: i0.Input, args: [{ isSignal: true, alias: "showDismissUnread", required: false }] }], markAsReadLabelKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "markAsReadLabelKey", required: false }] }], itemPress: [{ type: i0.Output, args: ["itemPress"] }], markAsRead: [{ type: i0.Output, args: ["markAsRead"] }], togglePin: [{ type: i0.Output, args: ["togglePin"] }], closePopover: [{ type: i0.Output, args: ["closePopover"] }] } });
|
|
1622
|
+
function stripInboxHeadingMarkup(html) {
|
|
1623
|
+
return html
|
|
1624
|
+
.replace(/<h[1-6]\b[^>]*>[\s\S]*?<\/h[1-6]>/gi, '')
|
|
1625
|
+
.replace(/(?:<p\b[^>]*>)?\s*(?:—|—|—)\s*[^<\n]+(?:<\/p>)?\s*$/i, '')
|
|
1626
|
+
.trim();
|
|
1627
|
+
}
|
|
1401
1628
|
|
|
1402
1629
|
//#region ----- Imports -----
|
|
1403
1630
|
//#endregion
|
|
@@ -1409,13 +1636,21 @@ class AXPInAppInboxActionService {
|
|
|
1409
1636
|
}
|
|
1410
1637
|
async openItem(id) {
|
|
1411
1638
|
const item = this.findItem(id);
|
|
1412
|
-
|
|
1639
|
+
if (this.shouldDeleteOnOpen(item)) {
|
|
1640
|
+
await this.connector.deleteOne(id);
|
|
1641
|
+
}
|
|
1642
|
+
else {
|
|
1643
|
+
await this.connector.markAsRead([id]);
|
|
1644
|
+
}
|
|
1413
1645
|
const action = item?.actions?.[0];
|
|
1414
1646
|
if (!action?.command?.name) {
|
|
1415
1647
|
return;
|
|
1416
1648
|
}
|
|
1417
1649
|
await this.commands.execute(action.command.name, action.command.options ?? {});
|
|
1418
1650
|
}
|
|
1651
|
+
shouldDeleteOnOpen(item) {
|
|
1652
|
+
return item?.definitionKey === REPORT_GENERATION_DEFINITION_KEY;
|
|
1653
|
+
}
|
|
1419
1654
|
findItem(id) {
|
|
1420
1655
|
return (this.connector.inboxList().find((item) => item.id === id) ??
|
|
1421
1656
|
this.connector.pagedInboxList().find((item) => item.id === id));
|
|
@@ -1535,6 +1770,7 @@ class AXPInAppInboxSlotComponent {
|
|
|
1535
1770
|
constructor() {
|
|
1536
1771
|
this.config = inject(AXP_IN_APP_INBOX_CONFIG);
|
|
1537
1772
|
this.i18n = inject(AXP_IN_APP_INBOX_I18N);
|
|
1773
|
+
this.themeStore = inject(AXPLayoutThemeService);
|
|
1538
1774
|
this.connector = inject(AXPInAppInboxConnectorService);
|
|
1539
1775
|
this.syncStatus = inject(AXP_IN_APP_INBOX_SYNC_STATUS, { optional: true });
|
|
1540
1776
|
this.liveUpdatesOffline = computed(() => this.syncStatus != null && !this.syncStatus.liveUpdatesConnected(), /* @ts-ignore */
|
|
@@ -1554,7 +1790,7 @@ class AXPInAppInboxSlotComponent {
|
|
|
1554
1790
|
this.popover()?.close();
|
|
1555
1791
|
}
|
|
1556
1792
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPInAppInboxSlotComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1557
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: AXPInAppInboxSlotComponent, isStandalone: true, selector: "axp-in-app-inbox-slot", viewQueries: [{ propertyName: "popover", first: true, predicate: AXPopoverComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<ax-button\n [iconOnly]=\"true\"\n class=\"relative axp-in-app-inbox-slot__button\"\n color=\"
|
|
1793
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: AXPInAppInboxSlotComponent, isStandalone: true, selector: "axp-in-app-inbox-slot", viewQueries: [{ propertyName: "popover", first: true, predicate: AXPopoverComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<ax-button\n [iconOnly]=\"true\"\n class=\"relative axp-in-app-inbox-slot__button\"\n [color]=\"themeStore.headerButtonColor()\"\n [look]=\"themeStore.headerButtonLook()\"\n #inboxTrigger\n [title]=\"liveUpdatesOffline() ? ((i18n.liveUpdatesOffline | translate | async) ?? '') : ''\"\n>\n <ax-icon>\n <i [class]=\"config.headerIconClass\"></i>\n </ax-icon>\n</ax-button>\n\n<div\n class=\"axp-in-app-inbox-slot__badge\"\n [class.--xs]=\"badgeDisplay().length > 2\"\n>\n @if (badgeDisplay()) {\n <ax-badge color=\"danger\" [text]=\"badgeDisplay()\"></ax-badge>\n }\n</div>\n<ax-popover\n [target]=\"inboxTrigger\"\n [openOn]=\"'toggle'\"\n [closeOn]=\"'clickOut'\"\n [adaptivityEnabled]=\"true\"\n>\n <div class=\"bg-lightest rounded-md w-full\">\n <axp-in-app-inbox-panel (closePopover)=\"closePopover()\" />\n </div>\n</ax-popover>\n", styles: ["@reference \"@acorex/styles/themes/default.css\";axp-in-app-inbox-slot{@apply relative;}axp-in-app-inbox-slot .axp-in-app-inbox-slot__badge{@apply absolute top-[-.25rem] end-[-.25rem];pointer-events:none}\n"], dependencies: [{ kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i1$1.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i3.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "ngmodule", type: AXBadgeModule }, { kind: "component", type: i4$1.AXBadgeComponent, selector: "ax-badge", inputs: ["color", "look", "text"] }, { kind: "ngmodule", type: AXPopoverModule }, { kind: "component", type: i4$2.AXPopoverComponent, selector: "ax-popover", inputs: ["width", "disablePanelClass", "visualContextScope", "disabled", "offsetX", "offsetY", "target", "placement", "content", "openOn", "closeOn", "hasBackdrop", "openAfter", "closeAfter", "closeOnScroll", "backdropClass", "panelClass", "adaptivityEnabled"], outputs: ["onOpened", "onClosed"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "component", type: AXPInAppInboxPanelComponent, selector: "axp-in-app-inbox-panel", outputs: ["unreadCountChange", "closePopover"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: i4.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
1558
1794
|
}
|
|
1559
1795
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPInAppInboxSlotComponent, decorators: [{
|
|
1560
1796
|
type: Component,
|
|
@@ -1566,7 +1802,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
1566
1802
|
AXPopoverModule,
|
|
1567
1803
|
AXTranslationModule,
|
|
1568
1804
|
AXPInAppInboxPanelComponent,
|
|
1569
|
-
], template: "<ax-button\n [iconOnly]=\"true\"\n class=\"relative axp-in-app-inbox-slot__button\"\n color=\"
|
|
1805
|
+
], template: "<ax-button\n [iconOnly]=\"true\"\n class=\"relative axp-in-app-inbox-slot__button\"\n [color]=\"themeStore.headerButtonColor()\"\n [look]=\"themeStore.headerButtonLook()\"\n #inboxTrigger\n [title]=\"liveUpdatesOffline() ? ((i18n.liveUpdatesOffline | translate | async) ?? '') : ''\"\n>\n <ax-icon>\n <i [class]=\"config.headerIconClass\"></i>\n </ax-icon>\n</ax-button>\n\n<div\n class=\"axp-in-app-inbox-slot__badge\"\n [class.--xs]=\"badgeDisplay().length > 2\"\n>\n @if (badgeDisplay()) {\n <ax-badge color=\"danger\" [text]=\"badgeDisplay()\"></ax-badge>\n }\n</div>\n<ax-popover\n [target]=\"inboxTrigger\"\n [openOn]=\"'toggle'\"\n [closeOn]=\"'clickOut'\"\n [adaptivityEnabled]=\"true\"\n>\n <div class=\"bg-lightest rounded-md w-full\">\n <axp-in-app-inbox-panel (closePopover)=\"closePopover()\" />\n </div>\n</ax-popover>\n", styles: ["@reference \"@acorex/styles/themes/default.css\";axp-in-app-inbox-slot{@apply relative;}axp-in-app-inbox-slot .axp-in-app-inbox-slot__badge{@apply absolute top-[-.25rem] end-[-.25rem];pointer-events:none}\n"] }]
|
|
1570
1806
|
}], propDecorators: { popover: [{ type: i0.ViewChild, args: [i0.forwardRef(() => AXPopoverComponent), { isSignal: true }] }] } });
|
|
1571
1807
|
|
|
1572
1808
|
const I18N$2 = '@communication-management:settings.user-notifications';
|
|
@@ -2085,7 +2321,7 @@ function routesFactory() {
|
|
|
2085
2321
|
children: [
|
|
2086
2322
|
{
|
|
2087
2323
|
path: '',
|
|
2088
|
-
loadComponent: () => import('./acorex-platform-module-communication-management-client-communication-in-app-inbox-page.component-
|
|
2324
|
+
loadComponent: () => import('./acorex-platform-module-communication-management-client-communication-in-app-inbox-page.component-BjJjqWja.mjs').then((m) => m.AXMCommunicationInAppInboxPageComponent),
|
|
2089
2325
|
data: { reuse: true },
|
|
2090
2326
|
},
|
|
2091
2327
|
],
|
|
@@ -2099,31 +2335,31 @@ class AXMCommunicationManagementModule {
|
|
|
2099
2335
|
provideCommandSetups([
|
|
2100
2336
|
{
|
|
2101
2337
|
key: AXMCommunicationManagementCommandKeys$1.Send,
|
|
2102
|
-
command: () => import('./acorex-platform-module-communication-management-client-communication-send.command-
|
|
2338
|
+
command: () => import('./acorex-platform-module-communication-management-client-communication-send.command-NEXrsogP.mjs').then((m) => m.CommunicationSendCommand),
|
|
2103
2339
|
},
|
|
2104
2340
|
{
|
|
2105
2341
|
key: AXMCommunicationManagementCommandKeys$1.TestSmtp,
|
|
2106
|
-
command: () => import('./acorex-platform-module-communication-management-client-communication-test-smtp.command-
|
|
2342
|
+
command: () => import('./acorex-platform-module-communication-management-client-communication-test-smtp.command-Cp5fHOh4.mjs').then((m) => m.CommunicationTestSmtpCommand),
|
|
2107
2343
|
},
|
|
2108
2344
|
{
|
|
2109
2345
|
key: AXMCommunicationManagementCommandKeys$1.EmailShowDialog,
|
|
2110
|
-
command: () => import('./acorex-platform-module-communication-management-client-communication-email-show-dialog.command-
|
|
2346
|
+
command: () => import('./acorex-platform-module-communication-management-client-communication-email-show-dialog.command-NuJLiYs_.mjs').then((m) => m.CommunicationManagementEmailShowDialogCommand),
|
|
2111
2347
|
},
|
|
2112
2348
|
{
|
|
2113
2349
|
key: AXMCommunicationManagementCommandKeys$1.EmailSend,
|
|
2114
|
-
command: () => import('./acorex-platform-module-communication-management-client-communication-email-send.command-
|
|
2350
|
+
command: () => import('./acorex-platform-module-communication-management-client-communication-email-send.command-De8K6vIB.mjs').then((m) => m.CommunicationManagementEmailSendCommand),
|
|
2115
2351
|
},
|
|
2116
2352
|
{
|
|
2117
2353
|
key: AXMCommunicationManagementCommandKeys$1.ShowSentMessage,
|
|
2118
|
-
command: () => import('./acorex-platform-module-communication-management-client-communication-show-sent-message.command-
|
|
2354
|
+
command: () => import('./acorex-platform-module-communication-management-client-communication-show-sent-message.command-D9KRxkdp.mjs').then((m) => m.CommunicationShowSentMessageCommand),
|
|
2119
2355
|
},
|
|
2120
2356
|
{
|
|
2121
2357
|
key: LEGACY_NOTIFICATION_EMAIL_SHOW_DIALOG_COMMAND_KEY,
|
|
2122
|
-
command: () => import('./acorex-platform-module-communication-management-client-communication-email-show-dialog.command-
|
|
2358
|
+
command: () => import('./acorex-platform-module-communication-management-client-communication-email-show-dialog.command-NuJLiYs_.mjs').then((m) => m.CommunicationManagementEmailShowDialogCommand),
|
|
2123
2359
|
},
|
|
2124
2360
|
{
|
|
2125
2361
|
key: LEGACY_NOTIFICATION_EMAIL_SEND_COMMAND_KEY,
|
|
2126
|
-
command: () => import('./acorex-platform-module-communication-management-client-communication-email-send.command-
|
|
2362
|
+
command: () => import('./acorex-platform-module-communication-management-client-communication-email-send.command-De8K6vIB.mjs').then((m) => m.CommunicationManagementEmailSendCommand),
|
|
2127
2363
|
},
|
|
2128
2364
|
]),
|
|
2129
2365
|
{
|
|
@@ -2227,31 +2463,31 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
2227
2463
|
provideCommandSetups([
|
|
2228
2464
|
{
|
|
2229
2465
|
key: AXMCommunicationManagementCommandKeys$1.Send,
|
|
2230
|
-
command: () => import('./acorex-platform-module-communication-management-client-communication-send.command-
|
|
2466
|
+
command: () => import('./acorex-platform-module-communication-management-client-communication-send.command-NEXrsogP.mjs').then((m) => m.CommunicationSendCommand),
|
|
2231
2467
|
},
|
|
2232
2468
|
{
|
|
2233
2469
|
key: AXMCommunicationManagementCommandKeys$1.TestSmtp,
|
|
2234
|
-
command: () => import('./acorex-platform-module-communication-management-client-communication-test-smtp.command-
|
|
2470
|
+
command: () => import('./acorex-platform-module-communication-management-client-communication-test-smtp.command-Cp5fHOh4.mjs').then((m) => m.CommunicationTestSmtpCommand),
|
|
2235
2471
|
},
|
|
2236
2472
|
{
|
|
2237
2473
|
key: AXMCommunicationManagementCommandKeys$1.EmailShowDialog,
|
|
2238
|
-
command: () => import('./acorex-platform-module-communication-management-client-communication-email-show-dialog.command-
|
|
2474
|
+
command: () => import('./acorex-platform-module-communication-management-client-communication-email-show-dialog.command-NuJLiYs_.mjs').then((m) => m.CommunicationManagementEmailShowDialogCommand),
|
|
2239
2475
|
},
|
|
2240
2476
|
{
|
|
2241
2477
|
key: AXMCommunicationManagementCommandKeys$1.EmailSend,
|
|
2242
|
-
command: () => import('./acorex-platform-module-communication-management-client-communication-email-send.command-
|
|
2478
|
+
command: () => import('./acorex-platform-module-communication-management-client-communication-email-send.command-De8K6vIB.mjs').then((m) => m.CommunicationManagementEmailSendCommand),
|
|
2243
2479
|
},
|
|
2244
2480
|
{
|
|
2245
2481
|
key: AXMCommunicationManagementCommandKeys$1.ShowSentMessage,
|
|
2246
|
-
command: () => import('./acorex-platform-module-communication-management-client-communication-show-sent-message.command-
|
|
2482
|
+
command: () => import('./acorex-platform-module-communication-management-client-communication-show-sent-message.command-D9KRxkdp.mjs').then((m) => m.CommunicationShowSentMessageCommand),
|
|
2247
2483
|
},
|
|
2248
2484
|
{
|
|
2249
2485
|
key: LEGACY_NOTIFICATION_EMAIL_SHOW_DIALOG_COMMAND_KEY,
|
|
2250
|
-
command: () => import('./acorex-platform-module-communication-management-client-communication-email-show-dialog.command-
|
|
2486
|
+
command: () => import('./acorex-platform-module-communication-management-client-communication-email-show-dialog.command-NuJLiYs_.mjs').then((m) => m.CommunicationManagementEmailShowDialogCommand),
|
|
2251
2487
|
},
|
|
2252
2488
|
{
|
|
2253
2489
|
key: LEGACY_NOTIFICATION_EMAIL_SEND_COMMAND_KEY,
|
|
2254
|
-
command: () => import('./acorex-platform-module-communication-management-client-communication-email-send.command-
|
|
2490
|
+
command: () => import('./acorex-platform-module-communication-management-client-communication-email-send.command-De8K6vIB.mjs').then((m) => m.CommunicationManagementEmailSendCommand),
|
|
2255
2491
|
},
|
|
2256
2492
|
]),
|
|
2257
2493
|
{
|
|
@@ -2371,5 +2607,5 @@ function resolveCommunicationDeliveryChannelsSettingsSection(context) {
|
|
|
2371
2607
|
* Generated bundle index. Do not edit.
|
|
2372
2608
|
*/
|
|
2373
2609
|
|
|
2374
|
-
export { AXPInAppInboxConnectorService as A,
|
|
2375
|
-
//# sourceMappingURL=acorex-platform-module-communication-management-client-acorex-platform-module-communication-management-client-
|
|
2610
|
+
export { AXPInAppInboxConnectorService as A, isInAppInboxUnseen as B, normalizeInAppInboxItem as C, resolveCommunicationDeliveryChannelsSettingsSection as D, sortInAppInboxItems as E, AXPInAppInboxActionService as a, AXP_IN_APP_INBOX_I18N as b, AXPInAppInboxItemComponent as c, AXPCommunicationManagementClient as d, AXPInAppInboxRealtimeService as e, AXMCommunicationManagementMenuProvider as f, AXMCommunicationManagementModule as g, AXMCommunicationManagementPermissionDefinitionProvider as h, AXMCommunicationManagementSearchCommandProvider as i, AXPCommunicationInAppInboxWidgetViewComponent as j, AXPInAppInboxPanelComponent as k, AXPInAppInboxSlotComponent as l, AXPMyInAppInboxDashboardWidget as m, AXP_IN_APP_INBOX_CONFIG as n, AXP_IN_APP_INBOX_LEGACY_DB_NAME as o, AXP_IN_APP_INBOX_LOCAL_ENTITY_KEY as p, AXP_IN_APP_INBOX_LOCAL_MAX_ITEMS as q, AXP_IN_APP_INBOX_PORT as r, AXP_IN_APP_INBOX_SYNC_STATUS as s, AXP_MY_IN_APP_INBOX_DASHBOARD_DIMENSIONS as t, buildMyInAppInboxDashboardWidget as u, dedupeInAppInboxItems as v, filterInAppInboxItemsLocally as w, getInAppInboxPriorityClass as x, isArchiveCategoryFilter as y, isInAppInboxUnread as z };
|
|
2611
|
+
//# sourceMappingURL=acorex-platform-module-communication-management-client-acorex-platform-module-communication-management-client-G4wzzccx.mjs.map
|