@carlonicora/nextjs-jsonapi 5.7.2 → 6.0.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 -519
- package/dist/billing/index.js.map +1 -1
- package/dist/billing/index.mjs +5 -32
- 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 +124 -124
- package/dist/features/tokenusage/index.mjs +4 -4
- 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 +2 -3
- package/messages/it.json +2 -3
- package/package.json +1 -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 -2
- package/src/features/billing/stripe-subscription/components/details/SubscriptionDetails.tsx +1 -40
- 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/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,29 +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 handlePause = /* @__PURE__ */ __name(async () => {
|
|
1326
|
-
setIsProcessing(true);
|
|
1327
|
-
try {
|
|
1328
|
-
await StripeSubscriptionService.pauseSubscription({ subscriptionId: subscription.id });
|
|
1329
|
-
onSubscriptionChange();
|
|
1330
|
-
} catch (error) {
|
|
1331
|
-
console.error("[SubscriptionDetails] Failed to pause subscription:", error);
|
|
1332
|
-
} finally {
|
|
1333
|
-
setIsProcessing(false);
|
|
1334
|
-
}
|
|
1335
|
-
}, "handlePause");
|
|
1336
|
-
const handleResume = /* @__PURE__ */ __name(async () => {
|
|
1337
|
-
setIsProcessing(true);
|
|
1338
|
-
try {
|
|
1339
|
-
await StripeSubscriptionService.resumeSubscription({ subscriptionId: subscription.id });
|
|
1340
|
-
onSubscriptionChange();
|
|
1341
|
-
} catch (error) {
|
|
1342
|
-
console.error("[SubscriptionDetails] Failed to resume subscription:", error);
|
|
1343
|
-
} finally {
|
|
1344
|
-
setIsProcessing(false);
|
|
1345
|
-
}
|
|
1346
|
-
}, "handleResume");
|
|
1347
1324
|
const handleManageViaPortal = /* @__PURE__ */ __name(async () => {
|
|
1348
1325
|
try {
|
|
1349
1326
|
const { url } = await StripeCustomerService.createPortalSession();
|
|
@@ -1352,8 +1329,6 @@ function SubscriptionDetails({
|
|
|
1352
1329
|
console.error("[SubscriptionDetails] Failed to create portal session:", error);
|
|
1353
1330
|
}
|
|
1354
1331
|
}, "handleManageViaPortal");
|
|
1355
|
-
const canPause = subscription.status === "active" /* ACTIVE */;
|
|
1356
|
-
const canResume = subscription.status === "paused" /* PAUSED */;
|
|
1357
1332
|
const canCancel = subscription.status === "active" /* ACTIVE */ || subscription.status === "trialing" /* TRIALING */ || subscription.status === "paused" /* PAUSED */;
|
|
1358
1333
|
return /* @__PURE__ */ jsxs14(Fragment3, { children: [
|
|
1359
1334
|
/* @__PURE__ */ jsx17(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs14(DialogContent, { className: "max-w-2xl", children: [
|
|
@@ -1399,8 +1374,6 @@ function SubscriptionDetails({
|
|
|
1399
1374
|
}) }) }),
|
|
1400
1375
|
/* @__PURE__ */ jsxs14("div", { className: "flex flex-wrap gap-2 pt-4 border-t", children: [
|
|
1401
1376
|
onChangePlan && /* @__PURE__ */ jsx17(Button, { variant: "default", onClick: () => onChangePlan(subscription), children: t("billing.ui.subscription.change_plan") }),
|
|
1402
|
-
canPause && /* @__PURE__ */ jsx17(Button, { variant: "outline", onClick: handlePause, disabled: isProcessing, children: isProcessing ? t("billing.ui.subscription.pausing") : t("billing.ui.subscription.pause") }),
|
|
1403
|
-
canResume && /* @__PURE__ */ jsx17(Button, { variant: "outline", onClick: handleResume, disabled: isProcessing, children: isProcessing ? t("billing.ui.subscription.resuming") : t("billing.ui.subscription.resume") }),
|
|
1404
1377
|
canCancel && /* @__PURE__ */ jsx17(Button, { variant: "destructive", onClick: () => setShowCancel(true), children: t("ui.buttons.cancel") }),
|
|
1405
1378
|
/* @__PURE__ */ jsx17(Button, { variant: "outline", onClick: handleManageViaPortal, children: t("billing.ui.subscription.manage_portal") })
|
|
1406
1379
|
] })
|