@ai-matrx/associations 0.7.6 → 0.8.1
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 +44 -0
- package/dist/{CommentThread-HW4hLdsd.d.cts → CommentThread-BhLkEi_A.d.cts} +1 -1
- package/dist/{CommentThread-HW4hLdsd.d.ts → CommentThread-BhLkEi_A.d.ts} +1 -1
- package/dist/core/index.cjs +17 -7
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +1 -3
- package/dist/core/index.d.ts +1 -3
- package/dist/core/index.js +17 -7
- package/dist/core/index.js.map +1 -1
- package/dist/index.cjs +12 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +99 -3
- package/dist/index.d.ts +99 -3
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -1
- package/dist/react/index.cjs +11 -28
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +3 -10
- package/dist/react/index.d.ts +3 -10
- package/dist/react/index.js +11 -28
- package/dist/react/index.js.map +1 -1
- package/dist/react/lazy/index.d.cts +1 -1
- package/dist/react/lazy/index.d.ts +1 -1
- package/package.json +5 -4
package/dist/react/index.cjs
CHANGED
|
@@ -46,7 +46,6 @@ __export(react_exports, {
|
|
|
46
46
|
UnresolvedRef: () => UnresolvedRef,
|
|
47
47
|
attachedKey: () => attachedKey,
|
|
48
48
|
buildCommentTree: () => buildCommentTree,
|
|
49
|
-
formatRelativeTime: () => formatRelativeTime,
|
|
50
49
|
getContentRoleMeta: () => getContentRoleMeta,
|
|
51
50
|
lazyPickerOverride: () => lazyPickerOverride,
|
|
52
51
|
lazyWindowShell: () => lazyWindowShell,
|
|
@@ -733,6 +732,12 @@ var ENTITY_TYPE_TOKENS = [
|
|
|
733
732
|
"marketing_initiative",
|
|
734
733
|
"masterwork_corpus_item",
|
|
735
734
|
"masterwork_run",
|
|
735
|
+
"meet_call_invite",
|
|
736
|
+
"meet_meeting",
|
|
737
|
+
"meet_note",
|
|
738
|
+
"meet_participant",
|
|
739
|
+
"meet_recording",
|
|
740
|
+
"meet_transcript_segment",
|
|
736
741
|
"membership",
|
|
737
742
|
"message",
|
|
738
743
|
"message_template",
|
|
@@ -4753,32 +4758,7 @@ function CategoryTagPicker({
|
|
|
4753
4758
|
// src/react/components/CommentThread.tsx
|
|
4754
4759
|
var import_react24 = require("react");
|
|
4755
4760
|
var import_design_system13 = require("@ai-matrx/design-system");
|
|
4756
|
-
|
|
4757
|
-
// src/react/relativeTime.ts
|
|
4758
|
-
var UNITS = [
|
|
4759
|
-
{ unit: "year", ms: 365 * 24 * 60 * 60 * 1e3 },
|
|
4760
|
-
{ unit: "month", ms: 30 * 24 * 60 * 60 * 1e3 },
|
|
4761
|
-
{ unit: "week", ms: 7 * 24 * 60 * 60 * 1e3 },
|
|
4762
|
-
{ unit: "day", ms: 24 * 60 * 60 * 1e3 },
|
|
4763
|
-
{ unit: "hour", ms: 60 * 60 * 1e3 },
|
|
4764
|
-
{ unit: "minute", ms: 60 * 1e3 }
|
|
4765
|
-
];
|
|
4766
|
-
function formatRelativeTime(iso, now = Date.now()) {
|
|
4767
|
-
const t = Date.parse(iso);
|
|
4768
|
-
if (Number.isNaN(t)) return iso;
|
|
4769
|
-
const delta = t - now;
|
|
4770
|
-
const magnitude = Math.abs(delta);
|
|
4771
|
-
if (magnitude < 60 * 1e3) return "just now";
|
|
4772
|
-
const rtf = new Intl.RelativeTimeFormat(void 0, { numeric: "auto" });
|
|
4773
|
-
for (const { unit, ms } of UNITS) {
|
|
4774
|
-
if (magnitude >= ms) {
|
|
4775
|
-
return rtf.format(Math.trunc(delta / ms), unit);
|
|
4776
|
-
}
|
|
4777
|
-
}
|
|
4778
|
-
return "just now";
|
|
4779
|
-
}
|
|
4780
|
-
|
|
4781
|
-
// src/react/components/CommentThread.tsx
|
|
4761
|
+
var import_format = require("@ai-matrx/kit/format");
|
|
4782
4762
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
4783
4763
|
var AUTHOR_DOOR_TOKEN = "user";
|
|
4784
4764
|
function resolveAuthor(comment, authorDisplay) {
|
|
@@ -4932,7 +4912,10 @@ function CommentItem({
|
|
|
4932
4912
|
{
|
|
4933
4913
|
className: "text-xs text-muted-foreground",
|
|
4934
4914
|
title: comment.createdAt,
|
|
4935
|
-
children: formatRelativeTime(comment.createdAt
|
|
4915
|
+
children: (0, import_format.formatRelativeTime)(comment.createdAt, {
|
|
4916
|
+
style: "intl",
|
|
4917
|
+
fallbackToInput: true
|
|
4918
|
+
})
|
|
4936
4919
|
}
|
|
4937
4920
|
),
|
|
4938
4921
|
edited && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|