@open-mercato/checkout 0.6.8-develop.6975.1.b21e19d444 → 0.6.8-develop.6977.1.5041da373e
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/dist/modules/checkout/widgets/notifications/CheckoutTransactionCompletedRenderer.js +3 -2
- package/dist/modules/checkout/widgets/notifications/CheckoutTransactionCompletedRenderer.js.map +2 -2
- package/dist/modules/checkout/widgets/notifications/CheckoutTransactionFailedRenderer.js +3 -2
- package/dist/modules/checkout/widgets/notifications/CheckoutTransactionFailedRenderer.js.map +2 -2
- package/dist/modules/checkout/widgets/notifications/CheckoutUsageLimitReachedRenderer.js +3 -2
- package/dist/modules/checkout/widgets/notifications/CheckoutUsageLimitReachedRenderer.js.map +2 -2
- package/package.json +5 -5
- package/src/modules/checkout/widgets/notifications/CheckoutTransactionCompletedRenderer.tsx +3 -2
- package/src/modules/checkout/widgets/notifications/CheckoutTransactionFailedRenderer.tsx +3 -2
- package/src/modules/checkout/widgets/notifications/CheckoutUsageLimitReachedRenderer.tsx +3 -2
|
@@ -6,7 +6,7 @@ import { useRouter } from "next/navigation";
|
|
|
6
6
|
import { Button } from "@open-mercato/ui/primitives/button";
|
|
7
7
|
import { cn } from "@open-mercato/shared/lib/utils";
|
|
8
8
|
import { formatRelativeTime } from "@open-mercato/shared/lib/time";
|
|
9
|
-
import { useT } from "@open-mercato/shared/lib/i18n/context";
|
|
9
|
+
import { useLocale, useT } from "@open-mercato/shared/lib/i18n/context";
|
|
10
10
|
function CheckoutTransactionCompletedRenderer({
|
|
11
11
|
notification,
|
|
12
12
|
onAction,
|
|
@@ -14,6 +14,7 @@ function CheckoutTransactionCompletedRenderer({
|
|
|
14
14
|
actions = []
|
|
15
15
|
}) {
|
|
16
16
|
const t = useT();
|
|
17
|
+
const locale = useLocale();
|
|
17
18
|
const router = useRouter();
|
|
18
19
|
const [executing, setExecuting] = React.useState(false);
|
|
19
20
|
const isUnread = notification.status === "unread";
|
|
@@ -57,7 +58,7 @@ function CheckoutTransactionCompletedRenderer({
|
|
|
57
58
|
/* @__PURE__ */ jsx("h4", { className: cn("text-sm font-medium", isUnread && "font-semibold"), children: notification.title }),
|
|
58
59
|
/* @__PURE__ */ jsxs("span", { className: "flex-shrink-0 text-xs text-muted-foreground flex items-center gap-1", children: [
|
|
59
60
|
/* @__PURE__ */ jsx(Calendar, { className: "h-3 w-3" }),
|
|
60
|
-
formatRelativeTime(notification.createdAt, { translate: t }) ?? ""
|
|
61
|
+
formatRelativeTime(notification.createdAt, { locale, translate: t }) ?? ""
|
|
61
62
|
] })
|
|
62
63
|
] }),
|
|
63
64
|
amount ? /* @__PURE__ */ jsx("div", { className: "mt-1 text-xs text-muted-foreground", children: /* @__PURE__ */ jsxs("span", { className: "font-medium text-foreground", children: [
|
package/dist/modules/checkout/widgets/notifications/CheckoutTransactionCompletedRenderer.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/modules/checkout/widgets/notifications/CheckoutTransactionCompletedRenderer.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { CheckCircle, ExternalLink, Calendar } from 'lucide-react'\nimport { useRouter } from 'next/navigation'\nimport { Button } from '@open-mercato/ui/primitives/button'\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\nexport function CheckoutTransactionCompletedRenderer({\n notification,\n onAction,\n onDismiss,\n actions = [],\n}: NotificationRendererProps) {\n const t = useT()\n const router = useRouter()\n const [executing, setExecuting] = React.useState(false)\n const isUnread = notification.status === 'unread'\n\n const amount = notification.bodyVariables?.amount ?? ''\n const currency = notification.bodyVariables?.currency ?? ''\n const viewAction = actions.find((action) => action.id === 'view') ?? actions[0] ?? null\n\n const handleView = async () => {\n if (!viewAction) {\n if (notification.linkHref) router.push(notification.linkHref)\n return\n }\n setExecuting(true)\n try {\n await onAction(viewAction.id)\n } finally {\n setExecuting(false)\n }\n }\n\n return (\n <div\n className={cn(\n 'group relative px-4 py-3 hover:bg-muted/50 cursor-pointer transition-colors border-l-4 border-l-status-success-border',\n isUnread && 'bg-status-success-bg',\n )}\n onClick={handleView}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n handleView()\n }\n }}\n role=\"button\"\n tabIndex={0}\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 )}\n <div className=\"flex gap-3\">\n <div className=\"flex-shrink-0 mt-0.5\">\n <div className=\"h-10 w-10 rounded-lg bg-status-success-bg flex items-center justify-center\">\n <CheckCircle className=\"h-5 w-5 text-status-success-icon\" />\n </div>\n </div>\n <div className=\"flex-1 min-w-0\">\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-shrink-0 text-xs text-muted-foreground flex items-center gap-1\">\n <Calendar className=\"h-3 w-3\" />\n {formatRelativeTime(notification.createdAt, { translate: t }) ?? ''}\n </span>\n </div>\n {amount ? (\n <div className=\"mt-1 text-xs text-muted-foreground\">\n <span className=\"font-medium text-foreground\">{amount} {currency}</span>\n </div>\n ) : null}\n <div className=\"mt-3 flex gap-2\">\n <Button\n variant=\"default\"\n size=\"sm\"\n onClick={(e) => { e.stopPropagation(); handleView() }}\n disabled={executing || (!viewAction && !notification.linkHref)}\n className=\"gap-1\"\n >\n <ExternalLink className=\"h-3 w-3\" />\n {t('checkout.notifications.renderer.viewTransaction', 'View Transaction')}\n </Button>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={(e) => { e.stopPropagation(); onDismiss() }}\n >\n {t('notifications.actions.dismiss', 'Dismiss')}\n </Button>\n </div>\n </div>\n </div>\n </div>\n )\n}\n\nexport default CheckoutTransactionCompletedRenderer\n"],
|
|
5
|
-
"mappings": ";
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { CheckCircle, ExternalLink, Calendar } from 'lucide-react'\nimport { useRouter } from 'next/navigation'\nimport { Button } from '@open-mercato/ui/primitives/button'\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\nexport function CheckoutTransactionCompletedRenderer({\n notification,\n onAction,\n onDismiss,\n actions = [],\n}: NotificationRendererProps) {\n const t = useT()\n const locale = useLocale()\n const router = useRouter()\n const [executing, setExecuting] = React.useState(false)\n const isUnread = notification.status === 'unread'\n\n const amount = notification.bodyVariables?.amount ?? ''\n const currency = notification.bodyVariables?.currency ?? ''\n const viewAction = actions.find((action) => action.id === 'view') ?? actions[0] ?? null\n\n const handleView = async () => {\n if (!viewAction) {\n if (notification.linkHref) router.push(notification.linkHref)\n return\n }\n setExecuting(true)\n try {\n await onAction(viewAction.id)\n } finally {\n setExecuting(false)\n }\n }\n\n return (\n <div\n className={cn(\n 'group relative px-4 py-3 hover:bg-muted/50 cursor-pointer transition-colors border-l-4 border-l-status-success-border',\n isUnread && 'bg-status-success-bg',\n )}\n onClick={handleView}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n handleView()\n }\n }}\n role=\"button\"\n tabIndex={0}\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 )}\n <div className=\"flex gap-3\">\n <div className=\"flex-shrink-0 mt-0.5\">\n <div className=\"h-10 w-10 rounded-lg bg-status-success-bg flex items-center justify-center\">\n <CheckCircle className=\"h-5 w-5 text-status-success-icon\" />\n </div>\n </div>\n <div className=\"flex-1 min-w-0\">\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-shrink-0 text-xs text-muted-foreground flex items-center gap-1\">\n <Calendar className=\"h-3 w-3\" />\n {formatRelativeTime(notification.createdAt, { locale, translate: t }) ?? ''}\n </span>\n </div>\n {amount ? (\n <div className=\"mt-1 text-xs text-muted-foreground\">\n <span className=\"font-medium text-foreground\">{amount} {currency}</span>\n </div>\n ) : null}\n <div className=\"mt-3 flex gap-2\">\n <Button\n variant=\"default\"\n size=\"sm\"\n onClick={(e) => { e.stopPropagation(); handleView() }}\n disabled={executing || (!viewAction && !notification.linkHref)}\n className=\"gap-1\"\n >\n <ExternalLink className=\"h-3 w-3\" />\n {t('checkout.notifications.renderer.viewTransaction', 'View Transaction')}\n </Button>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={(e) => { e.stopPropagation(); onDismiss() }}\n >\n {t('notifications.actions.dismiss', 'Dismiss')}\n </Button>\n </div>\n </div>\n </div>\n </div>\n )\n}\n\nexport default CheckoutTransactionCompletedRenderer\n"],
|
|
5
|
+
"mappings": ";AAyDQ,cAaI,YAbJ;AAvDR,YAAY,WAAW;AACvB,SAAS,aAAa,cAAc,gBAAgB;AACpD,SAAS,iBAAiB;AAC1B,SAAS,cAAc;AACvB,SAAS,UAAU;AACnB,SAAS,0BAA0B;AACnC,SAAS,WAAW,YAAY;AAGzB,SAAS,qCAAqC;AAAA,EACnD;AAAA,EACA;AAAA,EACA;AAAA,EACA,UAAU,CAAC;AACb,GAA8B;AAC5B,QAAM,IAAI,KAAK;AACf,QAAM,SAAS,UAAU;AACzB,QAAM,SAAS,UAAU;AACzB,QAAM,CAAC,WAAW,YAAY,IAAI,MAAM,SAAS,KAAK;AACtD,QAAM,WAAW,aAAa,WAAW;AAEzC,QAAM,SAAS,aAAa,eAAe,UAAU;AACrD,QAAM,WAAW,aAAa,eAAe,YAAY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BACb;AAAA;AAAA,gBAAC;AAAA;AAAA,kBACC,SAAQ;AAAA,kBACR,MAAK;AAAA,kBACL,SAAS,CAAC,MAAM;AAAE,sBAAE,gBAAgB;AAAG,+BAAW;AAAA,kBAAE;AAAA,kBACpD,UAAU,aAAc,CAAC,cAAc,CAAC,aAAa;AAAA,kBACrD,WAAU;AAAA,kBAEV;AAAA,wCAAC,gBAAa,WAAU,WAAU;AAAA,oBACjC,EAAE,mDAAmD,kBAAkB;AAAA;AAAA;AAAA,cAC1E;AAAA,cACA;AAAA,gBAAC;AAAA;AAAA,kBACC,SAAQ;AAAA,kBACR,MAAK;AAAA,kBACL,SAAS,CAAC,MAAM;AAAE,sBAAE,gBAAgB;AAAG,8BAAU;AAAA,kBAAE;AAAA,kBAElD,YAAE,iCAAiC,SAAS;AAAA;AAAA,cAC/C;AAAA,eACF;AAAA,aACF;AAAA,WACF;AAAA;AAAA;AAAA,EACF;AAEJ;AAEA,IAAO,+CAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -6,7 +6,7 @@ import { useRouter } from "next/navigation";
|
|
|
6
6
|
import { Button } from "@open-mercato/ui/primitives/button";
|
|
7
7
|
import { cn } from "@open-mercato/shared/lib/utils";
|
|
8
8
|
import { formatRelativeTime } from "@open-mercato/shared/lib/time";
|
|
9
|
-
import { useT } from "@open-mercato/shared/lib/i18n/context";
|
|
9
|
+
import { useLocale, useT } from "@open-mercato/shared/lib/i18n/context";
|
|
10
10
|
function CheckoutTransactionFailedRenderer({
|
|
11
11
|
notification,
|
|
12
12
|
onAction,
|
|
@@ -14,6 +14,7 @@ function CheckoutTransactionFailedRenderer({
|
|
|
14
14
|
actions = []
|
|
15
15
|
}) {
|
|
16
16
|
const t = useT();
|
|
17
|
+
const locale = useLocale();
|
|
17
18
|
const router = useRouter();
|
|
18
19
|
const [executing, setExecuting] = React.useState(false);
|
|
19
20
|
const isUnread = notification.status === "unread";
|
|
@@ -55,7 +56,7 @@ function CheckoutTransactionFailedRenderer({
|
|
|
55
56
|
/* @__PURE__ */ jsx("h4", { className: cn("text-sm font-medium", isUnread && "font-semibold"), children: notification.title }),
|
|
56
57
|
/* @__PURE__ */ jsxs("span", { className: "flex-shrink-0 text-xs text-muted-foreground flex items-center gap-1", children: [
|
|
57
58
|
/* @__PURE__ */ jsx(Calendar, { className: "h-3 w-3" }),
|
|
58
|
-
formatRelativeTime(notification.createdAt, { translate: t }) ?? ""
|
|
59
|
+
formatRelativeTime(notification.createdAt, { locale, translate: t }) ?? ""
|
|
59
60
|
] })
|
|
60
61
|
] }),
|
|
61
62
|
/* @__PURE__ */ jsxs("div", { className: "mt-3 flex gap-2", children: [
|
package/dist/modules/checkout/widgets/notifications/CheckoutTransactionFailedRenderer.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/modules/checkout/widgets/notifications/CheckoutTransactionFailedRenderer.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { AlertCircle, ExternalLink, Calendar } from 'lucide-react'\nimport { useRouter } from 'next/navigation'\nimport { Button } from '@open-mercato/ui/primitives/button'\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\nexport function CheckoutTransactionFailedRenderer({\n notification,\n onAction,\n onDismiss,\n actions = [],\n}: NotificationRendererProps) {\n const t = useT()\n const router = useRouter()\n const [executing, setExecuting] = React.useState(false)\n const isUnread = notification.status === 'unread'\n\n const viewAction = actions.find((action) => action.id === 'view') ?? actions[0] ?? null\n\n const handleView = async () => {\n if (!viewAction) {\n if (notification.linkHref) router.push(notification.linkHref)\n return\n }\n setExecuting(true)\n try {\n await onAction(viewAction.id)\n } finally {\n setExecuting(false)\n }\n }\n\n return (\n <div\n className={cn(\n 'group relative px-4 py-3 hover:bg-muted/50 cursor-pointer transition-colors border-l-4 border-l-status-error-border',\n isUnread && 'bg-status-error-bg',\n )}\n onClick={handleView}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n handleView()\n }\n }}\n role=\"button\"\n tabIndex={0}\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 )}\n <div className=\"flex gap-3\">\n <div className=\"flex-shrink-0 mt-0.5\">\n <div className=\"h-10 w-10 rounded-lg bg-status-error-bg flex items-center justify-center\">\n <AlertCircle className=\"h-5 w-5 text-status-error-icon\" />\n </div>\n </div>\n <div className=\"flex-1 min-w-0\">\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-shrink-0 text-xs text-muted-foreground flex items-center gap-1\">\n <Calendar className=\"h-3 w-3\" />\n {formatRelativeTime(notification.createdAt, { translate: t }) ?? ''}\n </span>\n </div>\n <div className=\"mt-3 flex gap-2\">\n <Button\n variant=\"default\"\n size=\"sm\"\n onClick={(e) => { e.stopPropagation(); handleView() }}\n disabled={executing || (!viewAction && !notification.linkHref)}\n className=\"gap-1\"\n >\n <ExternalLink className=\"h-3 w-3\" />\n {t('checkout.notifications.renderer.viewTransaction', 'View Transaction')}\n </Button>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={(e) => { e.stopPropagation(); onDismiss() }}\n >\n {t('notifications.actions.dismiss', 'Dismiss')}\n </Button>\n </div>\n </div>\n </div>\n </div>\n )\n}\n\nexport default CheckoutTransactionFailedRenderer\n"],
|
|
5
|
-
"mappings": ";
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { AlertCircle, ExternalLink, Calendar } from 'lucide-react'\nimport { useRouter } from 'next/navigation'\nimport { Button } from '@open-mercato/ui/primitives/button'\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\nexport function CheckoutTransactionFailedRenderer({\n notification,\n onAction,\n onDismiss,\n actions = [],\n}: NotificationRendererProps) {\n const t = useT()\n const locale = useLocale()\n const router = useRouter()\n const [executing, setExecuting] = React.useState(false)\n const isUnread = notification.status === 'unread'\n\n const viewAction = actions.find((action) => action.id === 'view') ?? actions[0] ?? null\n\n const handleView = async () => {\n if (!viewAction) {\n if (notification.linkHref) router.push(notification.linkHref)\n return\n }\n setExecuting(true)\n try {\n await onAction(viewAction.id)\n } finally {\n setExecuting(false)\n }\n }\n\n return (\n <div\n className={cn(\n 'group relative px-4 py-3 hover:bg-muted/50 cursor-pointer transition-colors border-l-4 border-l-status-error-border',\n isUnread && 'bg-status-error-bg',\n )}\n onClick={handleView}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n handleView()\n }\n }}\n role=\"button\"\n tabIndex={0}\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 )}\n <div className=\"flex gap-3\">\n <div className=\"flex-shrink-0 mt-0.5\">\n <div className=\"h-10 w-10 rounded-lg bg-status-error-bg flex items-center justify-center\">\n <AlertCircle className=\"h-5 w-5 text-status-error-icon\" />\n </div>\n </div>\n <div className=\"flex-1 min-w-0\">\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-shrink-0 text-xs text-muted-foreground flex items-center gap-1\">\n <Calendar className=\"h-3 w-3\" />\n {formatRelativeTime(notification.createdAt, { locale, translate: t }) ?? ''}\n </span>\n </div>\n <div className=\"mt-3 flex gap-2\">\n <Button\n variant=\"default\"\n size=\"sm\"\n onClick={(e) => { e.stopPropagation(); handleView() }}\n disabled={executing || (!viewAction && !notification.linkHref)}\n className=\"gap-1\"\n >\n <ExternalLink className=\"h-3 w-3\" />\n {t('checkout.notifications.renderer.viewTransaction', 'View Transaction')}\n </Button>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={(e) => { e.stopPropagation(); onDismiss() }}\n >\n {t('notifications.actions.dismiss', 'Dismiss')}\n </Button>\n </div>\n </div>\n </div>\n </div>\n )\n}\n\nexport default CheckoutTransactionFailedRenderer\n"],
|
|
5
|
+
"mappings": ";AAuDQ,cAaI,YAbJ;AArDR,YAAY,WAAW;AACvB,SAAS,aAAa,cAAc,gBAAgB;AACpD,SAAS,iBAAiB;AAC1B,SAAS,cAAc;AACvB,SAAS,UAAU;AACnB,SAAS,0BAA0B;AACnC,SAAS,WAAW,YAAY;AAGzB,SAAS,kCAAkC;AAAA,EAChD;AAAA,EACA;AAAA,EACA;AAAA,EACA,UAAU,CAAC;AACb,GAA8B;AAC5B,QAAM,IAAI,KAAK;AACf,QAAM,SAAS,UAAU;AACzB,QAAM,SAAS,UAAU;AACzB,QAAM,CAAC,WAAW,YAAY,IAAI,MAAM,SAAS,KAAK;AACtD,QAAM,WAAW,aAAa,WAAW;AAEzC,QAAM,aAAa,QAAQ,KAAK,CAAC,WAAW,OAAO,OAAO,MAAM,KAAK,QAAQ,CAAC,KAAK;AAEnF,QAAM,aAAa,YAAY;AAC7B,QAAI,CAAC,YAAY;AACf,UAAI,aAAa,SAAU,QAAO,KAAK,aAAa,QAAQ;AAC5D;AAAA,IACF;AACA,iBAAa,IAAI;AACjB,QAAI;AACF,YAAM,SAAS,WAAW,EAAE;AAAA,IAC9B,UAAE;AACA,mBAAa,KAAK;AAAA,IACpB;AAAA,EACF;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA,YAAY;AAAA,MACd;AAAA,MACA,SAAS;AAAA,MACT,WAAW,CAAC,MAAM;AAChB,YAAI,EA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AO,4CAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -6,7 +6,7 @@ import { useRouter } from "next/navigation";
|
|
|
6
6
|
import { Button } from "@open-mercato/ui/primitives/button";
|
|
7
7
|
import { cn } from "@open-mercato/shared/lib/utils";
|
|
8
8
|
import { formatRelativeTime } from "@open-mercato/shared/lib/time";
|
|
9
|
-
import { useT } from "@open-mercato/shared/lib/i18n/context";
|
|
9
|
+
import { useLocale, useT } from "@open-mercato/shared/lib/i18n/context";
|
|
10
10
|
function CheckoutUsageLimitReachedRenderer({
|
|
11
11
|
notification,
|
|
12
12
|
onAction,
|
|
@@ -14,6 +14,7 @@ function CheckoutUsageLimitReachedRenderer({
|
|
|
14
14
|
actions = []
|
|
15
15
|
}) {
|
|
16
16
|
const t = useT();
|
|
17
|
+
const locale = useLocale();
|
|
17
18
|
const router = useRouter();
|
|
18
19
|
const [executing, setExecuting] = React.useState(false);
|
|
19
20
|
const isUnread = notification.status === "unread";
|
|
@@ -59,7 +60,7 @@ function CheckoutUsageLimitReachedRenderer({
|
|
|
59
60
|
] }),
|
|
60
61
|
/* @__PURE__ */ jsxs("span", { className: "flex-shrink-0 text-xs text-muted-foreground flex items-center gap-1", children: [
|
|
61
62
|
/* @__PURE__ */ jsx(Calendar, { className: "h-3 w-3" }),
|
|
62
|
-
formatRelativeTime(notification.createdAt, { translate: t }) ?? ""
|
|
63
|
+
formatRelativeTime(notification.createdAt, { locale, translate: t }) ?? ""
|
|
63
64
|
] })
|
|
64
65
|
] }),
|
|
65
66
|
/* @__PURE__ */ jsxs("div", { className: "mt-3 flex gap-2", children: [
|
package/dist/modules/checkout/widgets/notifications/CheckoutUsageLimitReachedRenderer.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/modules/checkout/widgets/notifications/CheckoutUsageLimitReachedRenderer.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { AlertTriangle, ExternalLink, Calendar } from 'lucide-react'\nimport { useRouter } from 'next/navigation'\nimport { Button } from '@open-mercato/ui/primitives/button'\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\nexport function CheckoutUsageLimitReachedRenderer({\n notification,\n onAction,\n onDismiss,\n actions = [],\n}: NotificationRendererProps) {\n const t = useT()\n const router = useRouter()\n const [executing, setExecuting] = React.useState(false)\n const isUnread = notification.status === 'unread'\n\n const linkName = notification.bodyVariables?.linkName ?? ''\n const viewAction = actions.find((action) => action.id === 'view') ?? actions[0] ?? null\n\n const handleView = async () => {\n if (!viewAction) {\n if (notification.linkHref) router.push(notification.linkHref)\n return\n }\n setExecuting(true)\n try {\n await onAction(viewAction.id)\n } finally {\n setExecuting(false)\n }\n }\n\n return (\n <div\n className={cn(\n 'group relative px-4 py-3 hover:bg-muted/50 cursor-pointer transition-colors border-l-4 border-l-status-warning-border',\n isUnread && 'bg-status-warning-bg',\n )}\n onClick={handleView}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n handleView()\n }\n }}\n role=\"button\"\n tabIndex={0}\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 )}\n <div className=\"flex gap-3\">\n <div className=\"flex-shrink-0 mt-0.5\">\n <div className=\"h-10 w-10 rounded-lg bg-status-warning-bg flex items-center justify-center\">\n <AlertTriangle className=\"h-5 w-5 text-status-warning-icon\" />\n </div>\n </div>\n <div className=\"flex-1 min-w-0\">\n <div className=\"flex items-start justify-between gap-2\">\n <div>\n <h4 className={cn('text-sm font-medium', isUnread && 'font-semibold')}>\n {notification.title}\n </h4>\n {linkName ? (\n <span className=\"text-xs text-muted-foreground\">{linkName}</span>\n ) : null}\n </div>\n <span className=\"flex-shrink-0 text-xs text-muted-foreground flex items-center gap-1\">\n <Calendar className=\"h-3 w-3\" />\n {formatRelativeTime(notification.createdAt, { translate: t }) ?? ''}\n </span>\n </div>\n <div className=\"mt-3 flex gap-2\">\n <Button\n variant=\"default\"\n size=\"sm\"\n onClick={(e) => { e.stopPropagation(); handleView() }}\n disabled={executing || (!viewAction && !notification.linkHref)}\n className=\"gap-1\"\n >\n <ExternalLink className=\"h-3 w-3\" />\n {t('checkout.notifications.renderer.viewLink', 'View Pay Link')}\n </Button>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={(e) => { e.stopPropagation(); onDismiss() }}\n >\n {t('notifications.actions.dismiss', 'Dismiss')}\n </Button>\n </div>\n </div>\n </div>\n </div>\n )\n}\n\nexport default CheckoutUsageLimitReachedRenderer\n"],
|
|
5
|
-
"mappings": ";
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { AlertTriangle, ExternalLink, Calendar } from 'lucide-react'\nimport { useRouter } from 'next/navigation'\nimport { Button } from '@open-mercato/ui/primitives/button'\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\nexport function CheckoutUsageLimitReachedRenderer({\n notification,\n onAction,\n onDismiss,\n actions = [],\n}: NotificationRendererProps) {\n const t = useT()\n const locale = useLocale()\n const router = useRouter()\n const [executing, setExecuting] = React.useState(false)\n const isUnread = notification.status === 'unread'\n\n const linkName = notification.bodyVariables?.linkName ?? ''\n const viewAction = actions.find((action) => action.id === 'view') ?? actions[0] ?? null\n\n const handleView = async () => {\n if (!viewAction) {\n if (notification.linkHref) router.push(notification.linkHref)\n return\n }\n setExecuting(true)\n try {\n await onAction(viewAction.id)\n } finally {\n setExecuting(false)\n }\n }\n\n return (\n <div\n className={cn(\n 'group relative px-4 py-3 hover:bg-muted/50 cursor-pointer transition-colors border-l-4 border-l-status-warning-border',\n isUnread && 'bg-status-warning-bg',\n )}\n onClick={handleView}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n handleView()\n }\n }}\n role=\"button\"\n tabIndex={0}\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 )}\n <div className=\"flex gap-3\">\n <div className=\"flex-shrink-0 mt-0.5\">\n <div className=\"h-10 w-10 rounded-lg bg-status-warning-bg flex items-center justify-center\">\n <AlertTriangle className=\"h-5 w-5 text-status-warning-icon\" />\n </div>\n </div>\n <div className=\"flex-1 min-w-0\">\n <div className=\"flex items-start justify-between gap-2\">\n <div>\n <h4 className={cn('text-sm font-medium', isUnread && 'font-semibold')}>\n {notification.title}\n </h4>\n {linkName ? (\n <span className=\"text-xs text-muted-foreground\">{linkName}</span>\n ) : null}\n </div>\n <span className=\"flex-shrink-0 text-xs text-muted-foreground flex items-center gap-1\">\n <Calendar className=\"h-3 w-3\" />\n {formatRelativeTime(notification.createdAt, { locale, translate: t }) ?? ''}\n </span>\n </div>\n <div className=\"mt-3 flex gap-2\">\n <Button\n variant=\"default\"\n size=\"sm\"\n onClick={(e) => { e.stopPropagation(); handleView() }}\n disabled={executing || (!viewAction && !notification.linkHref)}\n className=\"gap-1\"\n >\n <ExternalLink className=\"h-3 w-3\" />\n {t('checkout.notifications.renderer.viewLink', 'View Pay Link')}\n </Button>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={(e) => { e.stopPropagation(); onDismiss() }}\n >\n {t('notifications.actions.dismiss', 'Dismiss')}\n </Button>\n </div>\n </div>\n </div>\n </div>\n )\n}\n\nexport default CheckoutUsageLimitReachedRenderer\n"],
|
|
5
|
+
"mappings": ";AAwDQ,cAUI,YAVJ;AAtDR,YAAY,WAAW;AACvB,SAAS,eAAe,cAAc,gBAAgB;AACtD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AAC,SACC;AAAA,oCAAC,QAAG,WAAW,GAAG,uBAAuB,YAAY,eAAe,GACjE,uBAAa,OAChB;AAAA,gBACC,WACC,oBAAC,UAAK,WAAU,iCAAiC,oBAAS,IACxD;AAAA,iBACN;AAAA,cACA,qBAAC,UAAK,WAAU,uEACd;AAAA,oCAAC,YAAS,WAAU,WAAU;AAAA,gBAC7B,mBAAmB,aAAa,WAAW,EAAE,QAAQ,WAAW,EAAE,CAAC,KAAK;AAAA,iBAC3E;AAAA,eACF;AAAA,YACA,qBAAC,SAAI,WAAU,mBACb;AAAA;AAAA,gBAAC;AAAA;AAAA,kBACC,SAAQ;AAAA,kBACR,MAAK;AAAA,kBACL,SAAS,CAAC,MAAM;AAAE,sBAAE,gBAAgB;AAAG,+BAAW;AAAA,kBAAE;AAAA,kBACpD,UAAU,aAAc,CAAC,cAAc,CAAC,aAAa;AAAA,kBACrD,WAAU;AAAA,kBAEV;AAAA,wCAAC,gBAAa,WAAU,WAAU;AAAA,oBACjC,EAAE,4CAA4C,eAAe;AAAA;AAAA;AAAA,cAChE;AAAA,cACA;AAAA,gBAAC;AAAA;AAAA,kBACC,SAAQ;AAAA,kBACR,MAAK;AAAA,kBACL,SAAS,CAAC,MAAM;AAAE,sBAAE,gBAAgB;AAAG,8BAAU;AAAA,kBAAE;AAAA,kBAElD,YAAE,iCAAiC,SAAS;AAAA;AAAA,cAC/C;AAAA,eACF;AAAA,aACF;AAAA,WACF;AAAA;AAAA;AAAA,EACF;AAEJ;AAEA,IAAO,4CAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-mercato/checkout",
|
|
3
|
-
"version": "0.6.8-develop.
|
|
3
|
+
"version": "0.6.8-develop.6977.1.5041da373e",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -62,18 +62,18 @@
|
|
|
62
62
|
}
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@open-mercato/core": "0.6.8-develop.
|
|
66
|
-
"@open-mercato/ui": "0.6.8-develop.
|
|
65
|
+
"@open-mercato/core": "0.6.8-develop.6977.1.5041da373e",
|
|
66
|
+
"@open-mercato/ui": "0.6.8-develop.6977.1.5041da373e",
|
|
67
67
|
"bcryptjs": "^3.0.3"
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|
|
70
70
|
"@mikro-orm/postgresql": "^7.0.14",
|
|
71
|
-
"@open-mercato/shared": "0.6.8-develop.
|
|
71
|
+
"@open-mercato/shared": "0.6.8-develop.6977.1.5041da373e",
|
|
72
72
|
"react": "^19.0.0",
|
|
73
73
|
"react-dom": "^19.0.0"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
|
-
"@open-mercato/shared": "0.6.8-develop.
|
|
76
|
+
"@open-mercato/shared": "0.6.8-develop.6977.1.5041da373e",
|
|
77
77
|
"@types/jest": "^30.0.0",
|
|
78
78
|
"@types/react": "^19.2.17",
|
|
79
79
|
"@types/react-dom": "^19.2.3",
|
|
@@ -6,7 +6,7 @@ import { useRouter } from 'next/navigation'
|
|
|
6
6
|
import { Button } from '@open-mercato/ui/primitives/button'
|
|
7
7
|
import { cn } from '@open-mercato/shared/lib/utils'
|
|
8
8
|
import { formatRelativeTime } from '@open-mercato/shared/lib/time'
|
|
9
|
-
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
9
|
+
import { useLocale, useT } from '@open-mercato/shared/lib/i18n/context'
|
|
10
10
|
import type { NotificationRendererProps } from '@open-mercato/shared/modules/notifications/types'
|
|
11
11
|
|
|
12
12
|
export function CheckoutTransactionCompletedRenderer({
|
|
@@ -16,6 +16,7 @@ export function CheckoutTransactionCompletedRenderer({
|
|
|
16
16
|
actions = [],
|
|
17
17
|
}: NotificationRendererProps) {
|
|
18
18
|
const t = useT()
|
|
19
|
+
const locale = useLocale()
|
|
19
20
|
const router = useRouter()
|
|
20
21
|
const [executing, setExecuting] = React.useState(false)
|
|
21
22
|
const isUnread = notification.status === 'unread'
|
|
@@ -69,7 +70,7 @@ export function CheckoutTransactionCompletedRenderer({
|
|
|
69
70
|
</h4>
|
|
70
71
|
<span className="flex-shrink-0 text-xs text-muted-foreground flex items-center gap-1">
|
|
71
72
|
<Calendar className="h-3 w-3" />
|
|
72
|
-
{formatRelativeTime(notification.createdAt, { translate: t }) ?? ''}
|
|
73
|
+
{formatRelativeTime(notification.createdAt, { locale, translate: t }) ?? ''}
|
|
73
74
|
</span>
|
|
74
75
|
</div>
|
|
75
76
|
{amount ? (
|
|
@@ -6,7 +6,7 @@ import { useRouter } from 'next/navigation'
|
|
|
6
6
|
import { Button } from '@open-mercato/ui/primitives/button'
|
|
7
7
|
import { cn } from '@open-mercato/shared/lib/utils'
|
|
8
8
|
import { formatRelativeTime } from '@open-mercato/shared/lib/time'
|
|
9
|
-
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
9
|
+
import { useLocale, useT } from '@open-mercato/shared/lib/i18n/context'
|
|
10
10
|
import type { NotificationRendererProps } from '@open-mercato/shared/modules/notifications/types'
|
|
11
11
|
|
|
12
12
|
export function CheckoutTransactionFailedRenderer({
|
|
@@ -16,6 +16,7 @@ export function CheckoutTransactionFailedRenderer({
|
|
|
16
16
|
actions = [],
|
|
17
17
|
}: NotificationRendererProps) {
|
|
18
18
|
const t = useT()
|
|
19
|
+
const locale = useLocale()
|
|
19
20
|
const router = useRouter()
|
|
20
21
|
const [executing, setExecuting] = React.useState(false)
|
|
21
22
|
const isUnread = notification.status === 'unread'
|
|
@@ -67,7 +68,7 @@ export function CheckoutTransactionFailedRenderer({
|
|
|
67
68
|
</h4>
|
|
68
69
|
<span className="flex-shrink-0 text-xs text-muted-foreground flex items-center gap-1">
|
|
69
70
|
<Calendar className="h-3 w-3" />
|
|
70
|
-
{formatRelativeTime(notification.createdAt, { translate: t }) ?? ''}
|
|
71
|
+
{formatRelativeTime(notification.createdAt, { locale, translate: t }) ?? ''}
|
|
71
72
|
</span>
|
|
72
73
|
</div>
|
|
73
74
|
<div className="mt-3 flex gap-2">
|
|
@@ -6,7 +6,7 @@ import { useRouter } from 'next/navigation'
|
|
|
6
6
|
import { Button } from '@open-mercato/ui/primitives/button'
|
|
7
7
|
import { cn } from '@open-mercato/shared/lib/utils'
|
|
8
8
|
import { formatRelativeTime } from '@open-mercato/shared/lib/time'
|
|
9
|
-
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
9
|
+
import { useLocale, useT } from '@open-mercato/shared/lib/i18n/context'
|
|
10
10
|
import type { NotificationRendererProps } from '@open-mercato/shared/modules/notifications/types'
|
|
11
11
|
|
|
12
12
|
export function CheckoutUsageLimitReachedRenderer({
|
|
@@ -16,6 +16,7 @@ export function CheckoutUsageLimitReachedRenderer({
|
|
|
16
16
|
actions = [],
|
|
17
17
|
}: NotificationRendererProps) {
|
|
18
18
|
const t = useT()
|
|
19
|
+
const locale = useLocale()
|
|
19
20
|
const router = useRouter()
|
|
20
21
|
const [executing, setExecuting] = React.useState(false)
|
|
21
22
|
const isUnread = notification.status === 'unread'
|
|
@@ -73,7 +74,7 @@ export function CheckoutUsageLimitReachedRenderer({
|
|
|
73
74
|
</div>
|
|
74
75
|
<span className="flex-shrink-0 text-xs text-muted-foreground flex items-center gap-1">
|
|
75
76
|
<Calendar className="h-3 w-3" />
|
|
76
|
-
{formatRelativeTime(notification.createdAt, { translate: t }) ?? ''}
|
|
77
|
+
{formatRelativeTime(notification.createdAt, { locale, translate: t }) ?? ''}
|
|
77
78
|
</span>
|
|
78
79
|
</div>
|
|
79
80
|
<div className="mt-3 flex gap-2">
|