@apptegy/nuxt-navigation 0.1.126 → 0.2.0-alpha.0

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.
@@ -5,11 +5,6 @@ export interface INotificationApiActor {
5
5
  first_name: string;
6
6
  last_name: string;
7
7
  }
8
- export interface INotificationApiRoom {
9
- id?: string;
10
- sis_id?: string;
11
- name: string;
12
- }
13
8
  export interface INotificationApiRecord {
14
9
  id: number | string;
15
10
  /**
@@ -19,15 +14,7 @@ export interface INotificationApiRecord {
19
14
  kind?: string | null;
20
15
  source_record_type: string;
21
16
  title: string;
22
- /** Post/body preview shown in the card summary row. */
23
- summary?: string | null;
24
- /**
25
- * Reaction tallies for aggregate reaction notifications (e.g. `{ CLAP: 2, LIKE: 1 }`).
26
- * When present, corresponding emojis are shown beside the summary.
27
- */
28
- reaction_counts?: Record<string, number> | null;
29
- /** Room associated with the notification; `name` is shown in the meta line. */
30
- room?: INotificationApiRoom | null;
17
+ summary?: string;
31
18
  actors?: INotificationApiActor[] | null;
32
19
  detail_link?: string | null;
33
20
  notification_state: NotificationApiState | string;
@@ -71,12 +58,7 @@ export interface INotificationItem {
71
58
  * Derived from API `last_activity_at`, falling back to `created_at`.
72
59
  */
73
60
  createdAt?: string;
74
- /** Room name shown after the relative timestamp (e.g. "Staff Lounge"). */
75
61
  contextLabel?: string;
76
- /** Post/body preview shown in the card summary row. */
77
- summary?: string;
78
- /** Emoji list derived from API `reaction_counts`, shown before the summary when present. */
79
- reactionEmojis?: string[];
80
62
  /** When false, the notification counts toward the bell badge and appears in the New tab. */
81
63
  dismissed?: boolean;
82
64
  /** Read receipt — announcement and message types only. */
@@ -0,0 +1,49 @@
1
+ export declare const APPLICATION_NAMES: {
2
+ AUTH_SERVICE: string;
3
+ MEDIA: string;
4
+ CMS: string;
5
+ TEACHER_PAGES: string;
6
+ ROOMS: string;
7
+ CONNECT: string;
8
+ USER_MANAGEMENT: string;
9
+ CMS_V2: string;
10
+ COMMUNITY_ENGAGEMENT: string;
11
+ MOBILE_THRILLSHARE: string;
12
+ MOBILE_SCHOOL_APP: string;
13
+ APP_MANAGER: string;
14
+ THEME_MANAGER: string;
15
+ ENGAGE: string;
16
+ NEWSLETTERS: string;
17
+ ALERTS_AS_SERVICE: string;
18
+ CLIENT_EXPERIENCE: string;
19
+ FILES: string;
20
+ URL_SHORTENER: string;
21
+ NAVIGATE: string;
22
+ INBOX: string;
23
+ ROBOTO: string;
24
+ LISTS_SERVICE: string;
25
+ ROOMS_USERS_ADMIN_SERVICE: string;
26
+ INFOLINK: string;
27
+ PAYMENTS: string;
28
+ ORGANIZATIONS_SERVICE: string;
29
+ INTRANET: string;
30
+ DATA_MANAGEMENT: string;
31
+ ANALYTICS: string;
32
+ TASKS: string;
33
+ ATTENDANCE_PRO: string;
34
+ SMART_MOVE: string;
35
+ CLIENT_MANAGEMENT: string;
36
+ };
37
+ export declare const APPLICATION_ICONS: {
38
+ [APPLICATION_NAMES.MEDIA]: string;
39
+ [APPLICATION_NAMES.CMS]: string;
40
+ [APPLICATION_NAMES.ROOMS]: string;
41
+ [APPLICATION_NAMES.CONNECT]: string;
42
+ [APPLICATION_NAMES.USER_MANAGEMENT]: string;
43
+ [APPLICATION_NAMES.ANALYTICS]: string;
44
+ [APPLICATION_NAMES.TASKS]: string;
45
+ [APPLICATION_NAMES.ENGAGE]: string;
46
+ [APPLICATION_NAMES.NEWSLETTERS]: string;
47
+ [APPLICATION_NAMES.INBOX]: string;
48
+ [APPLICATION_NAMES.CLIENT_MANAGEMENT]: string;
49
+ };
@@ -0,0 +1,53 @@
1
+ export const APPLICATION_NAMES = {
2
+ AUTH_SERVICE: "auth_service",
3
+ MEDIA: "media",
4
+ CMS: "cms",
5
+ TEACHER_PAGES: "teacher_pages",
6
+ ROOMS: "rooms",
7
+ // Rooms original name
8
+ CONNECT: "connect",
9
+ // Rooms renamed to Connect
10
+ USER_MANAGEMENT: "user_management",
11
+ CMS_V2: "cms_v2",
12
+ COMMUNITY_ENGAGEMENT: "community_engagement",
13
+ MOBILE_THRILLSHARE: "mobile_thrillshare",
14
+ MOBILE_SCHOOL_APP: "mobile_school_app",
15
+ APP_MANAGER: "app_manager",
16
+ THEME_MANAGER: "theme_manager",
17
+ ENGAGE: "engage",
18
+ // Engage original name
19
+ NEWSLETTERS: "newsletters",
20
+ // Engage renamed to Newsletters
21
+ ALERTS_AS_SERVICE: "alerts_as_service",
22
+ CLIENT_EXPERIENCE: "client_experience",
23
+ FILES: "files",
24
+ URL_SHORTENER: "url_shortener",
25
+ NAVIGATE: "navigate",
26
+ INBOX: "inbox",
27
+ ROBOTO: "roboto",
28
+ LISTS_SERVICE: "lists_service",
29
+ ROOMS_USERS_ADMIN_SERVICE: "rooms_users_admin_service",
30
+ INFOLINK: "infolink",
31
+ PAYMENTS: "payments",
32
+ ORGANIZATIONS_SERVICE: "organizations_service",
33
+ INTRANET: "intranet",
34
+ DATA_MANAGEMENT: "data_management",
35
+ ANALYTICS: "analytics",
36
+ TASKS: "tasks",
37
+ ATTENDANCE_PRO: "attendance_pro",
38
+ SMART_MOVE: "smart_move",
39
+ CLIENT_MANAGEMENT: "client_management"
40
+ };
41
+ export const APPLICATION_ICONS = {
42
+ [APPLICATION_NAMES.MEDIA]: "lucide:palette",
43
+ [APPLICATION_NAMES.CMS]: "lucide:network",
44
+ [APPLICATION_NAMES.ROOMS]: "lucide:message-square-text",
45
+ [APPLICATION_NAMES.CONNECT]: "lucide:message-square-text",
46
+ [APPLICATION_NAMES.USER_MANAGEMENT]: "lucide:users",
47
+ [APPLICATION_NAMES.ANALYTICS]: "lucide:chart-line",
48
+ [APPLICATION_NAMES.TASKS]: "lucide:square-check-big",
49
+ [APPLICATION_NAMES.ENGAGE]: "lucide:newspaper",
50
+ [APPLICATION_NAMES.NEWSLETTERS]: "lucide:newspaper",
51
+ [APPLICATION_NAMES.INBOX]: "lucide:inbox",
52
+ [APPLICATION_NAMES.CLIENT_MANAGEMENT]: "lucide:users"
53
+ };
@@ -1,10 +1,5 @@
1
1
  import type { INotificationApiActor, INotificationApiRecord, INotificationGroup, INotificationItem, INotificationsApiResponse, INotificationsPanelData, INotificationTab, NotificationType } from '../types/index.js';
2
2
  import { type INotificationDateLabels } from './notification-dates.js';
3
- /**
4
- * Map `reaction_counts` to unique display emojis (one per reaction type).
5
- * Count is ignored beyond requiring it to be >= 1. Unknown keys are skipped.
6
- */
7
- export declare function mapReactionCountsToEmojis(reactionCounts: Record<string, number> | null | undefined): string[];
8
3
  export declare const DEFAULT_NOTIFICATION_TABS: INotificationTab[];
9
4
  /** Normalize kind values for filter matching and `filter[kind][]` query params. */
10
5
  export declare function normalizeNotificationKind(value: string): string;
@@ -19,11 +14,6 @@ export declare function mapNotificationApiActor(actor: INotificationApiActor): {
19
14
  name: string;
20
15
  avatarUrl: string | undefined;
21
16
  };
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;
27
17
  export declare function mapNotificationApiRecord(record: INotificationApiRecord, options: {
28
18
  locale?: string;
29
19
  dateLabels: INotificationDateLabels;
@@ -15,29 +15,6 @@ const SOURCE_RECORD_TYPE_MAP = {
15
15
  "school-post": "school-post",
16
16
  system: "system"
17
17
  };
18
- const REACTION_EMOJI_MAP = {
19
- clap: "\u{1F44F}",
20
- like: "\u{1F44D}",
21
- heart: "\u2764\uFE0F",
22
- dislike: "\u{1F44E}",
23
- laugh: "\u{1F602}",
24
- wow: "\u{1F62E}"
25
- };
26
- export function mapReactionCountsToEmojis(reactionCounts) {
27
- if (!reactionCounts) {
28
- return [];
29
- }
30
- const emojis = [];
31
- for (const [key, count] of Object.entries(reactionCounts)) {
32
- const emoji = REACTION_EMOJI_MAP[key.toLowerCase()];
33
- const safeCount = Number(count);
34
- if (!emoji || !Number.isFinite(safeCount) || safeCount < 1) {
35
- continue;
36
- }
37
- emojis.push(emoji);
38
- }
39
- return emojis;
40
- }
41
18
  export const DEFAULT_NOTIFICATION_TABS = [
42
19
  { id: "new", label: "New", unreadOnly: true },
43
20
  { id: "all", label: "All" }
@@ -65,26 +42,10 @@ export function mapNotificationApiActor(actor) {
65
42
  avatarUrl: actor.avatar_url
66
43
  };
67
44
  }
68
- export const NOTIFICATION_SUMMARY_MAX_LENGTH = 200;
69
- export function formatNotificationSummary(summary, maxLength = NOTIFICATION_SUMMARY_MAX_LENGTH) {
70
- if (!summary) {
71
- return void 0;
72
- }
73
- const normalized = summary.replace(/\s+/g, " ").trim();
74
- if (!normalized) {
75
- return void 0;
76
- }
77
- if (normalized.length <= maxLength) {
78
- return normalized;
79
- }
80
- return `${normalized.slice(0, maxLength).trimEnd()}\u2026`;
81
- }
82
45
  export function mapNotificationApiRecord(record, options) {
83
46
  const state = record.notification_state;
84
47
  const type = mapSourceRecordType(record.source_record_type);
85
48
  const activityAt = resolveNotificationActivityAt(record);
86
- const summary = formatNotificationSummary(record.summary);
87
- const reactionEmojis = mapReactionCountsToEmojis(record.reaction_counts);
88
49
  return {
89
50
  id: String(record.id),
90
51
  type,
@@ -100,9 +61,7 @@ export function mapNotificationApiRecord(record, options) {
100
61
  }
101
62
  }),
102
63
  createdAt: activityAt,
103
- contextLabel: record.room?.name?.trim() || void 0,
104
- summary,
105
- reactionEmojis: reactionEmojis.length > 0 ? reactionEmojis : void 0,
64
+ contextLabel: record.summary,
106
65
  dismissed: state === "dismissed",
107
66
  read: state === "read",
108
67
  unread: state === "unread",
package/locale/en.json CHANGED
@@ -30,7 +30,6 @@
30
30
  "close": "Close notifications",
31
31
  "loading": "Loading notifications...",
32
32
  "empty": "You're all caught up.",
33
- "summaryOn": "on",
34
33
  "justNow": "just now",
35
34
  "yesterday": "Yesterday",
36
35
  "dateGroups": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apptegy/nuxt-navigation",
3
- "version": "0.1.126",
3
+ "version": "0.2.0-alpha.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -36,19 +36,20 @@
36
36
  "primevue": "^4.2.5"
37
37
  },
38
38
  "devDependencies": {
39
- "@nuxt/devtools": "catalog:",
40
- "@nuxt/eslint-config": "catalog:",
41
- "@nuxt/module-builder": "catalog:",
42
- "@nuxt/schema": "catalog:",
43
- "@nuxt/test-utils": "catalog:",
44
- "@types/node": "catalog:",
45
- "eslint": "catalog:",
46
- "nuxt": "catalog:",
39
+ "@nuxt/devtools": "^2.6.2",
40
+ "@nuxt/eslint-config": "^1.6.0",
41
+ "@nuxt/module-builder": "^1.0.1",
42
+ "@nuxt/schema": "^3.17.0",
43
+ "@nuxt/test-utils": "^3.17.0",
44
+ "@types/node": "^22.0.0",
45
+ "eslint": "^9.31.0",
46
+ "nuxt": "^3.17.0",
47
47
  "primevue": "^4.5.4",
48
- "sass": "catalog:",
49
- "typescript": "catalog:",
50
- "vitest": "catalog:",
51
- "vue": "catalog:",
52
- "vue-tsc": "catalog:"
53
- }
48
+ "sass": "^1.89.2",
49
+ "typescript": "~5.8.0",
50
+ "vitest": "^3.2.4",
51
+ "vue": "^3.5.13",
52
+ "vue-tsc": "^3.0.3"
53
+ },
54
+ "gitHead": "1dc446394ee7ca5eb722ffb48215d9b671581308"
54
55
  }