@ai-matrx/messaging 0.11.3 → 0.11.5
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/CHANGELOG.md +21 -0
- package/dist/index.cjs +3 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -1
- package/dist/index.d.ts +13 -1
- package/dist/index.js +3 -5
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +6 -8
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +13 -1
- package/dist/react.d.ts +13 -1
- package/dist/react.js +3 -5
- package/dist/react.js.map +1 -1
- package/package.json +4 -4
package/dist/index.d.cts
CHANGED
|
@@ -1144,7 +1144,19 @@ declare function groupMessages(messages: readonly Message[], args?: {
|
|
|
1144
1144
|
/** "Ana is typing…" / "Ana and Bo are typing…" / "3 people are typing…" */
|
|
1145
1145
|
declare function formatTypists(names: readonly string[]): string | null;
|
|
1146
1146
|
declare function participantNames(participants: readonly UserSummary[], excluding: UserId): readonly string[];
|
|
1147
|
-
/**
|
|
1147
|
+
/**
|
|
1148
|
+
* "Active now" / "Active 5m ago" — presence, said honestly.
|
|
1149
|
+
*
|
|
1150
|
+
* THE CASCADE WAS A RELATIVE TIME WEARING A DURATION'S CLOTHES (2026-09-12).
|
|
1151
|
+
* Three hand-rolled tiers turned an elapsed millisecond count into `5m ago` /
|
|
1152
|
+
* `3h ago` / `2d ago`, which is exactly `formatRelativeTime`'s `short` voice —
|
|
1153
|
+
* and this package already depends on kit. A package re-deriving another
|
|
1154
|
+
* package's capability ships the duplicate to every consumer of this one.
|
|
1155
|
+
*
|
|
1156
|
+
* What stays local is the only part that is a PRODUCT decision rather than a
|
|
1157
|
+
* formatting one: the two-minute "Active now" window, which says presence is
|
|
1158
|
+
* live rather than reporting a number nobody acts on.
|
|
1159
|
+
*/
|
|
1148
1160
|
declare function formatLastSeen(lastSeenMs: number | null, now?: number): string;
|
|
1149
1161
|
|
|
1150
1162
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1144,7 +1144,19 @@ declare function groupMessages(messages: readonly Message[], args?: {
|
|
|
1144
1144
|
/** "Ana is typing…" / "Ana and Bo are typing…" / "3 people are typing…" */
|
|
1145
1145
|
declare function formatTypists(names: readonly string[]): string | null;
|
|
1146
1146
|
declare function participantNames(participants: readonly UserSummary[], excluding: UserId): readonly string[];
|
|
1147
|
-
/**
|
|
1147
|
+
/**
|
|
1148
|
+
* "Active now" / "Active 5m ago" — presence, said honestly.
|
|
1149
|
+
*
|
|
1150
|
+
* THE CASCADE WAS A RELATIVE TIME WEARING A DURATION'S CLOTHES (2026-09-12).
|
|
1151
|
+
* Three hand-rolled tiers turned an elapsed millisecond count into `5m ago` /
|
|
1152
|
+
* `3h ago` / `2d ago`, which is exactly `formatRelativeTime`'s `short` voice —
|
|
1153
|
+
* and this package already depends on kit. A package re-deriving another
|
|
1154
|
+
* package's capability ships the duplicate to every consumer of this one.
|
|
1155
|
+
*
|
|
1156
|
+
* What stays local is the only part that is a PRODUCT decision rather than a
|
|
1157
|
+
* formatting one: the two-minute "Active now" window, which says presence is
|
|
1158
|
+
* live rather than reporting a number nobody acts on.
|
|
1159
|
+
*/
|
|
1148
1160
|
declare function formatLastSeen(lastSeenMs: number | null, now?: number): string;
|
|
1149
1161
|
|
|
1150
1162
|
/**
|
package/dist/index.js
CHANGED
|
@@ -1503,6 +1503,7 @@ function messagingClientId() {
|
|
|
1503
1503
|
}
|
|
1504
1504
|
|
|
1505
1505
|
// src/core/format.ts
|
|
1506
|
+
import { formatRelativeTime } from "@ai-matrx/kit/format";
|
|
1506
1507
|
var MINUTE = 6e4;
|
|
1507
1508
|
var HOUR = 60 * MINUTE;
|
|
1508
1509
|
var DAY = 24 * HOUR;
|
|
@@ -1586,11 +1587,8 @@ function participantNames(participants, excluding) {
|
|
|
1586
1587
|
}
|
|
1587
1588
|
function formatLastSeen(lastSeenMs, now = Date.now()) {
|
|
1588
1589
|
if (lastSeenMs === null) return "";
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
if (elapsed < HOUR) return `Active ${Math.round(elapsed / MINUTE)}m ago`;
|
|
1592
|
-
if (elapsed < DAY) return `Active ${Math.round(elapsed / HOUR)}h ago`;
|
|
1593
|
-
return `Active ${Math.round(elapsed / DAY)}d ago`;
|
|
1590
|
+
if (now - lastSeenMs < 2 * MINUTE) return "Active now";
|
|
1591
|
+
return `Active ${formatRelativeTime(lastSeenMs, { style: "short", now })}`;
|
|
1594
1592
|
}
|
|
1595
1593
|
|
|
1596
1594
|
// src/core/repository.ts
|