@apptegy/nuxt-navigation 0.1.122 → 0.1.123

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
@@ -4,7 +4,7 @@
4
4
  "nuxt": ">=3.0.0"
5
5
  },
6
6
  "configKey": "@apptegy/nuxt-navigation",
7
- "version": "0.1.122",
7
+ "version": "0.1.123",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.1",
10
10
  "unbuild": "unknown"
@@ -119,6 +119,7 @@
119
119
  <span class="notification-item__summary-on">
120
120
  {{ $t("navigation.notificationsPanel.summaryOn") }}
121
121
  </span>
122
+ {{ " " }}
122
123
  </template>
123
124
  <span class="notification-item__summary-text">"{{ item.summary }}"</span>
124
125
  </div>
@@ -343,10 +344,6 @@ function handleDismiss(event) {
343
344
  margin-top: 8px;
344
345
  }
345
346
  .notification-item__summary {
346
- display: flex;
347
- flex-wrap: wrap;
348
- align-items: baseline;
349
- gap: 6px;
350
347
  margin-top: 12px;
351
348
  padding-top: 12px;
352
349
  border-top: 1px solid rgb(232, 232, 236);
@@ -361,10 +358,8 @@ function handleDismiss(event) {
361
358
  border-radius: 4px;
362
359
  }
363
360
  .notification-item__reactions {
364
- display: inline-flex;
365
- flex-wrap: wrap;
366
- gap: 2px;
367
- flex-shrink: 0;
361
+ display: inline;
362
+ white-space: nowrap;
368
363
  }
369
364
  .notification-item__reaction {
370
365
  font-size: 14px;
@@ -374,9 +369,10 @@ function handleDismiss(event) {
374
369
  color: var(--grey-50, #747474);
375
370
  }
376
371
  .notification-item__summary-text {
377
- min-width: 0;
378
372
  font-style: italic;
379
373
  color: var(--grey-70, #4b5563);
374
+ white-space: normal;
375
+ overflow-wrap: anywhere;
380
376
  }
381
377
  .notification-item__actions {
382
378
  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?.trim() || void 0;
88
+ const summary = formatNotificationSummary(record.summary);
75
89
  const reactionEmojis = mapReactionCountsToEmojis(record.reaction_counts);
76
90
  return {
77
91
  id: String(record.id),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apptegy/nuxt-navigation",
3
- "version": "0.1.122",
3
+ "version": "0.1.123",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {