@open-mercato/enterprise 0.6.8-develop.6975.1.b21e19d444 → 0.6.8-develop.6976.1.9b79145ac4
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.
|
@@ -4,7 +4,7 @@ import * as React from "react";
|
|
|
4
4
|
import { GitPullRequestArrow, Calendar } from "lucide-react";
|
|
5
5
|
import { cn } from "@open-mercato/shared/lib/utils";
|
|
6
6
|
import { formatRelativeTime } from "@open-mercato/shared/lib/time";
|
|
7
|
-
import { useT } from "@open-mercato/shared/lib/i18n/context";
|
|
7
|
+
import { useLocale, useT } from "@open-mercato/shared/lib/i18n/context";
|
|
8
8
|
function parseRows(notification) {
|
|
9
9
|
const raw = notification.bodyVariables?.changedRowsJson;
|
|
10
10
|
if (!raw || typeof raw !== "string") return [];
|
|
@@ -18,6 +18,7 @@ function parseRows(notification) {
|
|
|
18
18
|
}
|
|
19
19
|
function IncomingChangesRenderer({ notification }) {
|
|
20
20
|
const t = useT();
|
|
21
|
+
const locale = useLocale();
|
|
21
22
|
const rows = React.useMemo(() => parseRows(notification), [notification]);
|
|
22
23
|
const isUnread = notification.status === "unread";
|
|
23
24
|
return /* @__PURE__ */ jsxs(
|
|
@@ -36,7 +37,7 @@ function IncomingChangesRenderer({ notification }) {
|
|
|
36
37
|
/* @__PURE__ */ jsx("h4", { className: cn("text-sm font-medium", isUnread && "font-semibold"), children: notification.title }),
|
|
37
38
|
/* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
|
|
38
39
|
/* @__PURE__ */ jsx(Calendar, { className: "h-3 w-3" }),
|
|
39
|
-
formatRelativeTime(notification.createdAt, { translate: t }) ?? ""
|
|
40
|
+
formatRelativeTime(notification.createdAt, { locale, translate: t }) ?? ""
|
|
40
41
|
] })
|
|
41
42
|
] }),
|
|
42
43
|
/* @__PURE__ */ jsx("div", { className: "mt-2 overflow-x-auto rounded border border-border/70", children: /* @__PURE__ */ jsxs("table", { className: "w-full text-xs", children: [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/modules/record_locks/widgets/notifications/IncomingChangesRenderer.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { GitPullRequestArrow, Calendar } from 'lucide-react'\nimport { cn } from '@open-mercato/shared/lib/utils'\nimport { formatRelativeTime } from '@open-mercato/shared/lib/time'\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\nimport type { NotificationRendererProps } from '@open-mercato/shared/modules/notifications/types'\n\ntype ChangeRow = {\n field: string\n incoming: string\n current: string\n}\n\nfunction parseRows(notification: NotificationRendererProps['notification']): ChangeRow[] {\n const raw = notification.bodyVariables?.changedRowsJson\n if (!raw || typeof raw !== 'string') return []\n try {\n const parsed = JSON.parse(raw)\n if (!Array.isArray(parsed)) return []\n return parsed\n .filter((row): row is ChangeRow => (\n row\n && typeof row === 'object'\n && typeof (row as ChangeRow).field === 'string'\n && typeof (row as ChangeRow).incoming === 'string'\n && typeof (row as ChangeRow).current === 'string'\n ))\n .slice(0, 12)\n } catch {\n return []\n }\n}\n\nexport function IncomingChangesRenderer({ notification }: NotificationRendererProps) {\n const t = useT()\n const rows = React.useMemo(() => parseRows(notification), [notification])\n const isUnread = notification.status === 'unread'\n\n return (\n <div\n className={cn(\n 'group relative px-4 py-3 hover:bg-muted/50 transition-colors border-l-4 border-l-status-info-border',\n isUnread && 'bg-status-info-bg',\n )}\n >\n {isUnread ? (\n <div className=\"absolute left-1.5 top-1/2 -translate-y-1/2 h-2 w-2 rounded-full bg-primary\" />\n ) : null}\n\n <div className=\"flex gap-3\">\n <div className=\"mt-0.5 flex-shrink-0\">\n <div className=\"h-10 w-10 rounded-lg bg-status-info-bg flex items-center justify-center\">\n <GitPullRequestArrow className=\"h-5 w-5 text-status-info-icon\" />\n </div>\n </div>\n\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex items-start justify-between gap-2\">\n <h4 className={cn('text-sm font-medium', isUnread && 'font-semibold')}>\n {notification.title}\n </h4>\n <span className=\"flex items-center gap-1 text-xs text-muted-foreground\">\n <Calendar className=\"h-3 w-3\" />\n {formatRelativeTime(notification.createdAt, { translate: t }) ?? ''}\n </span>\n </div>\n\n <div className=\"mt-2 overflow-x-auto rounded border border-border/70\">\n <table className=\"w-full text-xs\">\n <thead className=\"bg-muted/50\">\n <tr>\n <th className=\"px-2 py-1.5 text-left font-medium\">{t('record_locks.conflict.field', 'Field')}</th>\n <th className=\"px-2 py-1.5 text-left font-medium\">{t('record_locks.conflict.incoming_label', 'Incoming')}</th>\n <th className=\"px-2 py-1.5 text-left font-medium\">{t('record_locks.conflict.current_label', 'Current')}</th>\n </tr>\n </thead>\n <tbody>\n {rows.length ? rows.map((row, index) => (\n <tr key={`${row.field}-${index}`} className=\"border-t border-border/70\">\n <td className=\"px-2 py-1.5 align-top text-foreground\">{row.field}</td>\n <td className=\"px-2 py-1.5 align-top text-muted-foreground\">{row.incoming}</td>\n <td className=\"px-2 py-1.5 align-top text-muted-foreground\">{row.current}</td>\n </tr>\n )) : (\n <tr>\n <td className=\"px-2 py-2 text-muted-foreground\" colSpan={3}>\n {t('record_locks.conflict.no_field_details', 'Field-level conflict details are unavailable for this record. Choose a resolution to continue.')}\n </td>\n </tr>\n )}\n </tbody>\n </table>\n </div>\n </div>\n </div>\n </div>\n )\n}\n\nexport default IncomingChangesRenderer\n"],
|
|
5
|
-
"mappings": ";
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { GitPullRequestArrow, Calendar } from 'lucide-react'\nimport { cn } from '@open-mercato/shared/lib/utils'\nimport { formatRelativeTime } from '@open-mercato/shared/lib/time'\nimport { useLocale, useT } from '@open-mercato/shared/lib/i18n/context'\nimport type { NotificationRendererProps } from '@open-mercato/shared/modules/notifications/types'\n\ntype ChangeRow = {\n field: string\n incoming: string\n current: string\n}\n\nfunction parseRows(notification: NotificationRendererProps['notification']): ChangeRow[] {\n const raw = notification.bodyVariables?.changedRowsJson\n if (!raw || typeof raw !== 'string') return []\n try {\n const parsed = JSON.parse(raw)\n if (!Array.isArray(parsed)) return []\n return parsed\n .filter((row): row is ChangeRow => (\n row\n && typeof row === 'object'\n && typeof (row as ChangeRow).field === 'string'\n && typeof (row as ChangeRow).incoming === 'string'\n && typeof (row as ChangeRow).current === 'string'\n ))\n .slice(0, 12)\n } catch {\n return []\n }\n}\n\nexport function IncomingChangesRenderer({ notification }: NotificationRendererProps) {\n const t = useT()\n const locale = useLocale()\n const rows = React.useMemo(() => parseRows(notification), [notification])\n const isUnread = notification.status === 'unread'\n\n return (\n <div\n className={cn(\n 'group relative px-4 py-3 hover:bg-muted/50 transition-colors border-l-4 border-l-status-info-border',\n isUnread && 'bg-status-info-bg',\n )}\n >\n {isUnread ? (\n <div className=\"absolute left-1.5 top-1/2 -translate-y-1/2 h-2 w-2 rounded-full bg-primary\" />\n ) : null}\n\n <div className=\"flex gap-3\">\n <div className=\"mt-0.5 flex-shrink-0\">\n <div className=\"h-10 w-10 rounded-lg bg-status-info-bg flex items-center justify-center\">\n <GitPullRequestArrow className=\"h-5 w-5 text-status-info-icon\" />\n </div>\n </div>\n\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex items-start justify-between gap-2\">\n <h4 className={cn('text-sm font-medium', isUnread && 'font-semibold')}>\n {notification.title}\n </h4>\n <span className=\"flex items-center gap-1 text-xs text-muted-foreground\">\n <Calendar className=\"h-3 w-3\" />\n {formatRelativeTime(notification.createdAt, { locale, translate: t }) ?? ''}\n </span>\n </div>\n\n <div className=\"mt-2 overflow-x-auto rounded border border-border/70\">\n <table className=\"w-full text-xs\">\n <thead className=\"bg-muted/50\">\n <tr>\n <th className=\"px-2 py-1.5 text-left font-medium\">{t('record_locks.conflict.field', 'Field')}</th>\n <th className=\"px-2 py-1.5 text-left font-medium\">{t('record_locks.conflict.incoming_label', 'Incoming')}</th>\n <th className=\"px-2 py-1.5 text-left font-medium\">{t('record_locks.conflict.current_label', 'Current')}</th>\n </tr>\n </thead>\n <tbody>\n {rows.length ? rows.map((row, index) => (\n <tr key={`${row.field}-${index}`} className=\"border-t border-border/70\">\n <td className=\"px-2 py-1.5 align-top text-foreground\">{row.field}</td>\n <td className=\"px-2 py-1.5 align-top text-muted-foreground\">{row.incoming}</td>\n <td className=\"px-2 py-1.5 align-top text-muted-foreground\">{row.current}</td>\n </tr>\n )) : (\n <tr>\n <td className=\"px-2 py-2 text-muted-foreground\" colSpan={3}>\n {t('record_locks.conflict.no_field_details', 'Field-level conflict details are unavailable for this record. Choose a resolution to continue.')}\n </td>\n </tr>\n )}\n </tbody>\n </table>\n </div>\n </div>\n </div>\n </div>\n )\n}\n\nexport default IncomingChangesRenderer\n"],
|
|
5
|
+
"mappings": ";AAiDQ,cAeI,YAfJ;AA/CR,YAAY,WAAW;AACvB,SAAS,qBAAqB,gBAAgB;AAC9C,SAAS,UAAU;AACnB,SAAS,0BAA0B;AACnC,SAAS,WAAW,YAAY;AAShC,SAAS,UAAU,cAAsE;AACvF,QAAM,MAAM,aAAa,eAAe;AACxC,MAAI,CAAC,OAAO,OAAO,QAAQ,SAAU,QAAO,CAAC;AAC7C,MAAI;AACF,UAAM,SAAS,KAAK,MAAM,GAAG;AAC7B,QAAI,CAAC,MAAM,QAAQ,MAAM,EAAG,QAAO,CAAC;AACpC,WAAO,OACJ,OAAO,CAAC,QACP,OACG,OAAO,QAAQ,YACf,OAAQ,IAAkB,UAAU,YACpC,OAAQ,IAAkB,aAAa,YACvC,OAAQ,IAAkB,YAAY,QAC1C,EACA,MAAM,GAAG,EAAE;AAAA,EAChB,QAAQ;AACN,WAAO,CAAC;AAAA,EACV;AACF;AAEO,SAAS,wBAAwB,EAAE,aAAa,GAA8B;AACnF,QAAM,IAAI,KAAK;AACf,QAAM,SAAS,UAAU;AACzB,QAAM,OAAO,MAAM,QAAQ,MAAM,UAAU,YAAY,GAAG,CAAC,YAAY,CAAC;A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CACD,IACC,oBAAC,QACC,8BAAC,QAAG,WAAU,mCAAkC,SAAS,GACtD,YAAE,0CAA0C,gGAAgG,GAC/I,GACF,GAEJ;AAAA,eACF,GACF;AAAA,aACF;AAAA,WACF;AAAA;AAAA;AAAA,EACF;AAEJ;AAEA,IAAO,kCAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-mercato/enterprise",
|
|
3
|
-
"version": "0.6.8-develop.
|
|
3
|
+
"version": "0.6.8-develop.6976.1.9b79145ac4",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -65,8 +65,8 @@
|
|
|
65
65
|
}
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
|
-
"@open-mercato/core": "0.6.8-develop.
|
|
69
|
-
"@open-mercato/ui": "0.6.8-develop.
|
|
68
|
+
"@open-mercato/core": "0.6.8-develop.6976.1.9b79145ac4",
|
|
69
|
+
"@open-mercato/ui": "0.6.8-develop.6976.1.9b79145ac4",
|
|
70
70
|
"@simplewebauthn/browser": "^13.3.0",
|
|
71
71
|
"@simplewebauthn/server": "^13.3.2",
|
|
72
72
|
"@simplewebauthn/types": "^12.0.0",
|
|
@@ -76,12 +76,12 @@
|
|
|
76
76
|
"qrcode": "^1.5.4"
|
|
77
77
|
},
|
|
78
78
|
"peerDependencies": {
|
|
79
|
-
"@open-mercato/shared": "0.6.8-develop.
|
|
79
|
+
"@open-mercato/shared": "0.6.8-develop.6976.1.9b79145ac4",
|
|
80
80
|
"react": "^19.0.0",
|
|
81
81
|
"react-dom": "^19.0.0"
|
|
82
82
|
},
|
|
83
83
|
"devDependencies": {
|
|
84
|
-
"@open-mercato/shared": "0.6.8-develop.
|
|
84
|
+
"@open-mercato/shared": "0.6.8-develop.6976.1.9b79145ac4",
|
|
85
85
|
"@types/jest": "^30.0.0",
|
|
86
86
|
"@types/react": "^19.2.17",
|
|
87
87
|
"@types/react-dom": "^19.2.3",
|
|
@@ -4,7 +4,7 @@ import * as React from 'react'
|
|
|
4
4
|
import { GitPullRequestArrow, Calendar } from 'lucide-react'
|
|
5
5
|
import { cn } from '@open-mercato/shared/lib/utils'
|
|
6
6
|
import { formatRelativeTime } from '@open-mercato/shared/lib/time'
|
|
7
|
-
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
7
|
+
import { useLocale, useT } from '@open-mercato/shared/lib/i18n/context'
|
|
8
8
|
import type { NotificationRendererProps } from '@open-mercato/shared/modules/notifications/types'
|
|
9
9
|
|
|
10
10
|
type ChangeRow = {
|
|
@@ -35,6 +35,7 @@ function parseRows(notification: NotificationRendererProps['notification']): Cha
|
|
|
35
35
|
|
|
36
36
|
export function IncomingChangesRenderer({ notification }: NotificationRendererProps) {
|
|
37
37
|
const t = useT()
|
|
38
|
+
const locale = useLocale()
|
|
38
39
|
const rows = React.useMemo(() => parseRows(notification), [notification])
|
|
39
40
|
const isUnread = notification.status === 'unread'
|
|
40
41
|
|
|
@@ -63,7 +64,7 @@ export function IncomingChangesRenderer({ notification }: NotificationRendererPr
|
|
|
63
64
|
</h4>
|
|
64
65
|
<span className="flex items-center gap-1 text-xs text-muted-foreground">
|
|
65
66
|
<Calendar className="h-3 w-3" />
|
|
66
|
-
{formatRelativeTime(notification.createdAt, { translate: t }) ?? ''}
|
|
67
|
+
{formatRelativeTime(notification.createdAt, { locale, translate: t }) ?? ''}
|
|
67
68
|
</span>
|
|
68
69
|
</div>
|
|
69
70
|
|