@carlonicora/nextjs-jsonapi 5.7.3 → 6.1.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.
- package/dist/{BlockNoteEditor-R3745ALQ.mjs → BlockNoteEditor-FZNU4YQT.mjs} +4 -4
- package/dist/{BlockNoteEditor-G45WMJ5V.js → BlockNoteEditor-SAU3G6H7.js} +19 -19
- package/dist/{BlockNoteEditor-G45WMJ5V.js.map → BlockNoteEditor-SAU3G6H7.js.map} +1 -1
- package/dist/{BlockNoteViewer-TNK3OMH5.mjs → BlockNoteViewer-6XDDVTN6.mjs} +2 -2
- package/dist/{BlockNoteViewer-5PGOVURC.js → BlockNoteViewer-7BTV7QQA.js} +3 -3
- package/dist/{BlockNoteViewer-5PGOVURC.js.map → BlockNoteViewer-7BTV7QQA.js.map} +1 -1
- package/dist/billing/index.js +492 -506
- package/dist/billing/index.js.map +1 -1
- package/dist/billing/index.mjs +5 -19
- package/dist/billing/index.mjs.map +1 -1
- package/dist/{chunk-CP7BXAFH.js → chunk-F4JB7YAP.js} +8 -8
- package/dist/{chunk-CP7BXAFH.js.map → chunk-F4JB7YAP.js.map} +1 -1
- package/dist/{chunk-KOA5PZZA.mjs → chunk-GFGKMUPZ.mjs} +2 -2
- package/dist/{chunk-EXG4ANC7.js → chunk-IPYXT7MH.js} +868 -868
- package/dist/{chunk-EXG4ANC7.js.map → chunk-IPYXT7MH.js.map} +1 -1
- package/dist/{chunk-RJMLAW5O.mjs → chunk-JVJS5RHB.mjs} +2 -2
- package/dist/{chunk-WU47MIZZ.js → chunk-MTI2UXDA.js} +4 -4
- package/dist/{chunk-WU47MIZZ.js.map → chunk-MTI2UXDA.js.map} +1 -1
- package/dist/{chunk-6KAYEYFU.mjs → chunk-RYZYKG6W.mjs} +2 -2
- package/dist/{chunk-3CSPHMVK.js → chunk-T3YQ47EF.js} +2 -32
- package/dist/chunk-T3YQ47EF.js.map +1 -0
- package/dist/{chunk-YG4YFAYY.js → chunk-TPZS46IM.js} +3 -3
- package/dist/{chunk-YG4YFAYY.js.map → chunk-TPZS46IM.js.map} +1 -1
- package/dist/{chunk-JCNB5KTQ.mjs → chunk-U7DR5VDT.mjs} +5 -5
- package/dist/{chunk-CJS5WA4E.mjs → chunk-USYZNWKS.mjs} +2 -32
- package/dist/chunk-USYZNWKS.mjs.map +1 -0
- package/dist/client/index.js +4 -4
- package/dist/client/index.mjs +3 -3
- package/dist/components/index.js +4 -4
- package/dist/components/index.mjs +3 -3
- package/dist/contexts/index.js +4 -4
- package/dist/contexts/index.mjs +3 -3
- package/dist/core/index.d.mts +0 -12
- package/dist/core/index.d.ts +0 -12
- package/dist/core/index.js +2 -2
- package/dist/core/index.mjs +1 -1
- package/dist/email-automations/index.js +92 -92
- package/dist/email-automations/index.mjs +3 -3
- package/dist/features/analytics/index.js +121 -121
- package/dist/features/analytics/index.mjs +4 -4
- package/dist/features/analytics/server.js +4 -4
- package/dist/features/analytics/server.mjs +2 -2
- package/dist/features/blog/index.js +150 -150
- package/dist/features/blog/index.mjs +3 -3
- package/dist/features/blog/server.js +16 -16
- package/dist/features/blog/server.mjs +1 -1
- package/dist/features/help/index.js +37 -37
- package/dist/features/help/index.mjs +3 -3
- package/dist/features/tokenusage/index.js +158 -125
- package/dist/features/tokenusage/index.js.map +1 -1
- package/dist/features/tokenusage/index.mjs +38 -5
- package/dist/features/tokenusage/index.mjs.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.mjs +2 -2
- package/dist/server/index.js +3 -3
- package/dist/server/index.mjs +2 -2
- package/messages/en.json +25 -1
- package/messages/it.json +25 -1
- package/package.json +1 -1
- package/scripts/validate-messages.mjs +4 -1
- package/src/features/__tests__/i18n-keys.contract.spec.ts +4 -0
- package/src/features/billing/components/cards/SubscriptionSummaryCard.tsx +22 -14
- package/src/features/billing/i18n-keys.ts +1 -0
- package/src/features/billing/stripe-subscription/components/details/SubscriptionDetails.tsx +1 -21
- package/src/features/billing/stripe-subscription/data/__tests__/stripe-subscription.spec.ts +59 -0
- package/src/features/billing/stripe-subscription/data/stripe-subscription.service.ts +0 -34
- package/src/features/billing/stripe-subscription/data/stripe-subscription.ts +1 -1
- package/src/features/tokenusage/components/TokenUsageRankedBar.tsx +34 -2
- package/src/features/tokenusage/components/__tests__/TokenUsageRankedBar.spec.tsx +22 -0
- package/src/features/tokenusage/lib/operation-label.ts +20 -0
- package/dist/chunk-3CSPHMVK.js.map +0 -1
- package/dist/chunk-CJS5WA4E.mjs.map +0 -1
- /package/dist/{BlockNoteEditor-R3745ALQ.mjs.map → BlockNoteEditor-FZNU4YQT.mjs.map} +0 -0
- /package/dist/{BlockNoteViewer-TNK3OMH5.mjs.map → BlockNoteViewer-6XDDVTN6.mjs.map} +0 -0
- /package/dist/{chunk-KOA5PZZA.mjs.map → chunk-GFGKMUPZ.mjs.map} +0 -0
- /package/dist/{chunk-RJMLAW5O.mjs.map → chunk-JVJS5RHB.mjs.map} +0 -0
- /package/dist/{chunk-6KAYEYFU.mjs.map → chunk-RYZYKG6W.mjs.map} +0 -0
- /package/dist/{chunk-JCNB5KTQ.mjs.map → chunk-U7DR5VDT.mjs.map} +0 -0
package/dist/billing/index.mjs
CHANGED
|
@@ -81,10 +81,10 @@ import {
|
|
|
81
81
|
useCurrentUserContext,
|
|
82
82
|
useDataListRetriever,
|
|
83
83
|
usePageUrlGenerator
|
|
84
|
-
} from "../chunk-
|
|
84
|
+
} from "../chunk-U7DR5VDT.mjs";
|
|
85
85
|
import {
|
|
86
86
|
getStripePublishableKey
|
|
87
|
-
} from "../chunk-
|
|
87
|
+
} from "../chunk-JVJS5RHB.mjs";
|
|
88
88
|
import {
|
|
89
89
|
getRoleId
|
|
90
90
|
} from "../chunk-PW42LRSL.mjs";
|
|
@@ -113,7 +113,7 @@ import {
|
|
|
113
113
|
toPromotionCodeResult,
|
|
114
114
|
useI18nLocale,
|
|
115
115
|
useI18nRouter
|
|
116
|
-
} from "../chunk-
|
|
116
|
+
} from "../chunk-USYZNWKS.mjs";
|
|
117
117
|
import "../chunk-V5MI7RNB.mjs";
|
|
118
118
|
import "../chunk-AUXK7QSA.mjs";
|
|
119
119
|
import "../chunk-PI56A4DG.mjs";
|
|
@@ -182,7 +182,7 @@ function SubscriptionSummaryCard({
|
|
|
182
182
|
] });
|
|
183
183
|
}
|
|
184
184
|
const activeSubscriptions = subscriptions.filter(
|
|
185
|
-
(sub) => sub.status === "active" /* ACTIVE */ || sub.status === "trialing" /* TRIALING */
|
|
185
|
+
(sub) => sub.status === "active" /* ACTIVE */ || sub.status === "trialing" /* TRIALING */ || sub.status === "past_due" /* PAST_DUE */
|
|
186
186
|
);
|
|
187
187
|
const primarySubscription = activeSubscriptions[0];
|
|
188
188
|
return /* @__PURE__ */ jsxs(Card, { className: "cursor-pointer hover:bg-accent/50 transition-colors", onClick: onManageClick, children: [
|
|
@@ -212,7 +212,7 @@ function SubscriptionSummaryCard({
|
|
|
212
212
|
] }) : /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
213
213
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
214
214
|
/* @__PURE__ */ jsx("p", { className: "text-xl font-bold", children: formatPlanName(primarySubscription, t("billing.ui.cards.subscriptions.fallback_name")) }),
|
|
215
|
-
/* @__PURE__ */ jsx(
|
|
215
|
+
primarySubscription.status === "past_due" /* PAST_DUE */ ? /* @__PURE__ */ jsx(Badge, { variant: "softRed", children: t("billing.ui.cards.subscriptions.payment_failing") }) : /* @__PURE__ */ jsx(
|
|
216
216
|
Badge,
|
|
217
217
|
{
|
|
218
218
|
variant: primarySubscription.cancelAtPeriodEnd ? "secondary" : getStatusBadgeVariant(primarySubscription.status),
|
|
@@ -1321,18 +1321,6 @@ function SubscriptionDetails({
|
|
|
1321
1321
|
const t = useTranslations16();
|
|
1322
1322
|
const fmt = useBillingFormatOptions();
|
|
1323
1323
|
const [showCancel, setShowCancel] = useState8(false);
|
|
1324
|
-
const [isProcessing, setIsProcessing] = useState8(false);
|
|
1325
|
-
const handleResume = /* @__PURE__ */ __name(async () => {
|
|
1326
|
-
setIsProcessing(true);
|
|
1327
|
-
try {
|
|
1328
|
-
await StripeSubscriptionService.resumeSubscription({ subscriptionId: subscription.id });
|
|
1329
|
-
onSubscriptionChange();
|
|
1330
|
-
} catch (error) {
|
|
1331
|
-
console.error("[SubscriptionDetails] Failed to resume subscription:", error);
|
|
1332
|
-
} finally {
|
|
1333
|
-
setIsProcessing(false);
|
|
1334
|
-
}
|
|
1335
|
-
}, "handleResume");
|
|
1336
1324
|
const handleManageViaPortal = /* @__PURE__ */ __name(async () => {
|
|
1337
1325
|
try {
|
|
1338
1326
|
const { url } = await StripeCustomerService.createPortalSession();
|
|
@@ -1341,7 +1329,6 @@ function SubscriptionDetails({
|
|
|
1341
1329
|
console.error("[SubscriptionDetails] Failed to create portal session:", error);
|
|
1342
1330
|
}
|
|
1343
1331
|
}, "handleManageViaPortal");
|
|
1344
|
-
const canResume = subscription.status === "paused" /* PAUSED */;
|
|
1345
1332
|
const canCancel = subscription.status === "active" /* ACTIVE */ || subscription.status === "trialing" /* TRIALING */ || subscription.status === "paused" /* PAUSED */;
|
|
1346
1333
|
return /* @__PURE__ */ jsxs14(Fragment3, { children: [
|
|
1347
1334
|
/* @__PURE__ */ jsx17(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs14(DialogContent, { className: "max-w-2xl", children: [
|
|
@@ -1387,7 +1374,6 @@ function SubscriptionDetails({
|
|
|
1387
1374
|
}) }) }),
|
|
1388
1375
|
/* @__PURE__ */ jsxs14("div", { className: "flex flex-wrap gap-2 pt-4 border-t", children: [
|
|
1389
1376
|
onChangePlan && /* @__PURE__ */ jsx17(Button, { variant: "default", onClick: () => onChangePlan(subscription), children: t("billing.ui.subscription.change_plan") }),
|
|
1390
|
-
canResume && /* @__PURE__ */ jsx17(Button, { variant: "outline", onClick: handleResume, disabled: isProcessing, children: isProcessing ? t("billing.ui.subscription.resuming") : t("billing.ui.subscription.resume") }),
|
|
1391
1377
|
canCancel && /* @__PURE__ */ jsx17(Button, { variant: "destructive", onClick: () => setShowCancel(true), children: t("ui.buttons.cancel") }),
|
|
1392
1378
|
/* @__PURE__ */ jsx17(Button, { variant: "outline", onClick: handleManageViaPortal, children: t("billing.ui.subscription.manage_portal") })
|
|
1393
1379
|
] })
|