@apptegy/nuxt-navigation 0.1.122 → 0.1.124
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/dist/module.json
CHANGED
|
@@ -117,10 +117,13 @@
|
|
|
117
117
|
>{{ emoji }}</span>
|
|
118
118
|
</span>
|
|
119
119
|
<span class="notification-item__summary-on">
|
|
120
|
-
{{ $t("navigation.notificationsPanel.summaryOn") }}
|
|
120
|
+
{{ " " }}{{ $t("navigation.notificationsPanel.summaryOn") }}{{ " " }}
|
|
121
121
|
</span>
|
|
122
122
|
</template>
|
|
123
|
-
<span class="notification-item__summary-text">
|
|
123
|
+
<span class="notification-item__summary-text">
|
|
124
|
+
<template v-if="reactionEmojis.length">"{{ item.summary }}"</template>
|
|
125
|
+
<template v-else>{{ item.summary }}</template>
|
|
126
|
+
</span>
|
|
124
127
|
</div>
|
|
125
128
|
</div>
|
|
126
129
|
</template>
|
|
@@ -343,10 +346,6 @@ function handleDismiss(event) {
|
|
|
343
346
|
margin-top: 8px;
|
|
344
347
|
}
|
|
345
348
|
.notification-item__summary {
|
|
346
|
-
display: flex;
|
|
347
|
-
flex-wrap: wrap;
|
|
348
|
-
align-items: baseline;
|
|
349
|
-
gap: 6px;
|
|
350
349
|
margin-top: 12px;
|
|
351
350
|
padding-top: 12px;
|
|
352
351
|
border-top: 1px solid rgb(232, 232, 236);
|
|
@@ -361,22 +360,22 @@ function handleDismiss(event) {
|
|
|
361
360
|
border-radius: 4px;
|
|
362
361
|
}
|
|
363
362
|
.notification-item__reactions {
|
|
364
|
-
display: inline
|
|
365
|
-
|
|
366
|
-
gap: 2px;
|
|
367
|
-
flex-shrink: 0;
|
|
363
|
+
display: inline;
|
|
364
|
+
white-space: nowrap;
|
|
368
365
|
}
|
|
369
366
|
.notification-item__reaction {
|
|
370
367
|
font-size: 14px;
|
|
371
368
|
line-height: 1;
|
|
372
369
|
}
|
|
373
370
|
.notification-item__summary-on {
|
|
371
|
+
margin-inline: 0.25em;
|
|
374
372
|
color: var(--grey-50, #747474);
|
|
375
373
|
}
|
|
376
374
|
.notification-item__summary-text {
|
|
377
|
-
min-width: 0;
|
|
378
375
|
font-style: italic;
|
|
379
376
|
color: var(--grey-70, #4b5563);
|
|
377
|
+
white-space: normal;
|
|
378
|
+
overflow-wrap: anywhere;
|
|
380
379
|
}
|
|
381
380
|
.notification-item__actions {
|
|
382
381
|
display: flex;
|
|
@@ -19,6 +19,11 @@ export declare function mapNotificationApiActor(actor: INotificationApiActor): {
|
|
|
19
19
|
name: string;
|
|
20
20
|
avatarUrl: string | undefined;
|
|
21
21
|
};
|
|
22
|
+
export declare const NOTIFICATION_SUMMARY_MAX_LENGTH = 200;
|
|
23
|
+
/**
|
|
24
|
+
* Collapse whitespace/newlines into a single line and truncate for card display.
|
|
25
|
+
*/
|
|
26
|
+
export declare function formatNotificationSummary(summary: string | null | undefined, maxLength?: number): string | undefined;
|
|
22
27
|
export declare function mapNotificationApiRecord(record: INotificationApiRecord, options: {
|
|
23
28
|
locale?: string;
|
|
24
29
|
dateLabels: INotificationDateLabels;
|
|
@@ -67,11 +67,25 @@ export function mapNotificationApiActor(actor) {
|
|
|
67
67
|
avatarUrl: actor.avatar_url
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
|
+
export const NOTIFICATION_SUMMARY_MAX_LENGTH = 200;
|
|
71
|
+
export function formatNotificationSummary(summary, maxLength = NOTIFICATION_SUMMARY_MAX_LENGTH) {
|
|
72
|
+
if (!summary) {
|
|
73
|
+
return void 0;
|
|
74
|
+
}
|
|
75
|
+
const normalized = summary.replace(/\s+/g, " ").trim();
|
|
76
|
+
if (!normalized) {
|
|
77
|
+
return void 0;
|
|
78
|
+
}
|
|
79
|
+
if (normalized.length <= maxLength) {
|
|
80
|
+
return normalized;
|
|
81
|
+
}
|
|
82
|
+
return `${normalized.slice(0, maxLength).trimEnd()}\u2026`;
|
|
83
|
+
}
|
|
70
84
|
export function mapNotificationApiRecord(record, options) {
|
|
71
85
|
const state = record.notification_state;
|
|
72
86
|
const type = mapSourceRecordType(record.source_record_type);
|
|
73
87
|
const activityAt = resolveNotificationActivityAt(record);
|
|
74
|
-
const summary = record.summary
|
|
88
|
+
const summary = formatNotificationSummary(record.summary);
|
|
75
89
|
const reactionEmojis = mapReactionCountsToEmojis(record.reaction_counts);
|
|
76
90
|
return {
|
|
77
91
|
id: String(record.id),
|