@opencxh/domain 1.187.0 → 1.188.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.
@@ -40,6 +40,12 @@ export interface NotificationKindDef {
40
40
  };
41
41
  /** `true` = the user may not switch it off (an incoming call). Absent = they may. */
42
42
  mandatory?: boolean;
43
+ /**
44
+ * Lucide icon name for the toast tile (`"at-sign"`, `"user-check"`). Declared with the kind
45
+ * because the icon is part of what the kind *is* — the reader tells a mention from an
46
+ * assignment by its shape before reading a word. Absent falls back to the toast type icon.
47
+ */
48
+ icon?: string;
43
49
  /** Sort hint within an app. Ties break on id, so the settings screen stays stable. */
44
50
  order?: number;
45
51
  }
@@ -61,6 +67,18 @@ export interface NotificationLink {
61
67
  app: string;
62
68
  path: string;
63
69
  }
70
+ /**
71
+ * The person (or assistant) whose action caused this.
72
+ *
73
+ * Carried as a plain name and not a userId: a notification is read long after it was written, and
74
+ * a lookup per row means the panel cannot render until every actor resolves. Initials and the
75
+ * avatar colour are derived from the name by `Avatar` with `tone="identity"`, so the same person
76
+ * keeps one colour on every surface without this ever storing one.
77
+ */
78
+ export interface NotificationActor {
79
+ name: string;
80
+ avatarUrl?: string;
81
+ }
64
82
  export interface Notification {
65
83
  id: string;
66
84
  organizationId: string;
@@ -69,8 +87,13 @@ export interface Notification {
69
87
  source: string;
70
88
  /** Namespaced: `"communication:mentioned"`. */
71
89
  kind: string;
90
+ /** What happened, without the actor's name in it — the panel renders the name in front. */
72
91
  title: NotificationText;
92
+ /** The quoted line: the comment text, the task name. */
73
93
  body?: NotificationText;
94
+ /** Where it happened ("RE: EYLO / Leufgens"), shown with the timestamp on the third line. */
95
+ context?: NotificationText;
96
+ actor?: NotificationActor;
74
97
  link?: NotificationLink;
75
98
  /** Free-form; travels untouched into the push payload. */
76
99
  data?: Record<string, unknown>;
@@ -88,6 +111,8 @@ export interface NotifyRequest {
88
111
  kind: string;
89
112
  title: NotificationText;
90
113
  body?: NotificationText;
114
+ context?: NotificationText;
115
+ actor?: NotificationActor;
91
116
  link?: NotificationLink;
92
117
  data?: Record<string, unknown>;
93
118
  /**
@@ -113,6 +113,13 @@ export interface ToastConfig {
113
113
  * combine with `persistent: true` so it can't be auto- or hand-dismissed.
114
114
  */
115
115
  closable?: boolean;
116
+ /**
117
+ * Lucide icon name for the leading tile, overriding the one implied by `type`.
118
+ *
119
+ * A notification says what kind of attention it wants (a mention, an assignment) and `type` only
120
+ * says how loud it is, so the two cannot be the same field.
121
+ */
122
+ icon?: string;
116
123
  actions?: {
117
124
  label: string;
118
125
  onClick: () => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencxh/domain",
3
- "version": "1.187.0",
3
+ "version": "1.188.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",