@carlonicora/nextjs-jsonapi 1.34.0 → 1.36.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.
Files changed (83) hide show
  1. package/dist/{BlockNoteEditor-DFHJWZZB.mjs → BlockNoteEditor-KFUTQVUK.mjs} +3 -3
  2. package/dist/{BlockNoteEditor-TS5AN6W2.js → BlockNoteEditor-N3J42SBY.js} +13 -13
  3. package/dist/{BlockNoteEditor-TS5AN6W2.js.map → BlockNoteEditor-N3J42SBY.js.map} +1 -1
  4. package/dist/BlockNoteEditor-YOAJRPWU.css +29 -0
  5. package/dist/BlockNoteEditor-YOAJRPWU.css.map +1 -0
  6. package/dist/billing/index.css +29 -0
  7. package/dist/billing/index.css.map +1 -0
  8. package/dist/billing/index.d.mts +1 -1
  9. package/dist/billing/index.d.ts +1 -1
  10. package/dist/billing/index.js +374 -358
  11. package/dist/billing/index.js.map +1 -1
  12. package/dist/billing/index.mjs +22 -6
  13. package/dist/billing/index.mjs.map +1 -1
  14. package/dist/{chunk-GFRODCD7.mjs → chunk-DLJTN632.mjs} +1242 -981
  15. package/dist/chunk-DLJTN632.mjs.map +1 -0
  16. package/dist/{chunk-TZRAOUAR.js → chunk-NNCTRU4O.js} +29 -1
  17. package/dist/chunk-NNCTRU4O.js.map +1 -0
  18. package/dist/{chunk-UPA67DQF.js → chunk-S2RZBQP4.js} +977 -716
  19. package/dist/chunk-S2RZBQP4.js.map +1 -0
  20. package/dist/{chunk-HWQBSVBT.mjs → chunk-YZV24UWN.mjs} +29 -1
  21. package/dist/chunk-YZV24UWN.mjs.map +1 -0
  22. package/dist/client/index.css +29 -0
  23. package/dist/client/index.css.map +1 -0
  24. package/dist/client/index.js +3 -3
  25. package/dist/client/index.mjs +2 -2
  26. package/dist/components/index.css +29 -0
  27. package/dist/components/index.css.map +1 -0
  28. package/dist/components/index.d.mts +4 -1
  29. package/dist/components/index.d.ts +4 -1
  30. package/dist/components/index.js +5 -3
  31. package/dist/components/index.js.map +1 -1
  32. package/dist/components/index.mjs +4 -2
  33. package/dist/contexts/index.css +29 -0
  34. package/dist/contexts/index.css.map +1 -0
  35. package/dist/contexts/index.d.mts +9 -2
  36. package/dist/contexts/index.d.ts +9 -2
  37. package/dist/contexts/index.js +9 -3
  38. package/dist/contexts/index.js.map +1 -1
  39. package/dist/contexts/index.mjs +8 -2
  40. package/dist/core/index.d.mts +6 -4
  41. package/dist/core/index.d.ts +6 -4
  42. package/dist/core/index.js +2 -2
  43. package/dist/core/index.mjs +1 -1
  44. package/dist/index.d.mts +2 -2
  45. package/dist/index.d.ts +2 -2
  46. package/dist/index.js +2 -2
  47. package/dist/index.mjs +1 -1
  48. package/dist/onboarding.interface-Djyl9qYu.d.mts +71 -0
  49. package/dist/onboarding.interface-Djyl9qYu.d.ts +71 -0
  50. package/dist/{s3.service-DcqkGrKD.d.ts → s3.service-DXkDoMf1.d.ts} +3 -0
  51. package/dist/{s3.service-ag6M_7GO.d.mts → s3.service-hnTPVTm2.d.mts} +3 -0
  52. package/dist/server/index.d.mts +1 -1
  53. package/dist/server/index.d.ts +1 -1
  54. package/dist/server/index.js +3 -3
  55. package/dist/server/index.mjs +1 -1
  56. package/dist/{stripe-subscription.interface-_VWPY2AA.d.mts → stripe-subscription.interface-C8uhCYIZ.d.mts} +2 -0
  57. package/dist/{stripe-subscription.interface-Dm__xmvE.d.ts → stripe-subscription.interface-DK7BJaNd.d.ts} +2 -0
  58. package/package.json +3 -1
  59. package/src/components/index.ts +1 -0
  60. package/src/components/navigations/Header.tsx +2 -32
  61. package/src/contexts/index.ts +1 -0
  62. package/src/features/billing/stripe-price/components/forms/PriceEditor.tsx +22 -6
  63. package/src/features/billing/stripe-price/data/stripe-price.interface.ts +2 -0
  64. package/src/features/billing/stripe-price/data/stripe-price.ts +9 -0
  65. package/src/features/billing/stripe-subscription/components/widgets/ProductPricingList.tsx +3 -0
  66. package/src/features/company/components/forms/CompanyDeleter.tsx +157 -70
  67. package/src/features/company/contexts/CompanyContext.tsx +1 -1
  68. package/src/features/company/data/company.service.ts +23 -0
  69. package/src/features/onboarding/components/OnboardingCard.tsx +45 -0
  70. package/src/features/onboarding/components/index.ts +1 -0
  71. package/src/features/onboarding/contexts/OnboardingContext.tsx +213 -0
  72. package/src/features/onboarding/contexts/index.ts +2 -0
  73. package/src/features/onboarding/index.ts +3 -0
  74. package/src/features/onboarding/interfaces/index.ts +1 -0
  75. package/src/features/onboarding/interfaces/onboarding.interface.ts +93 -0
  76. package/src/features/onboarding/styles/onboarding.css +38 -0
  77. package/src/features/user/contexts/CurrentUserContext.tsx +35 -20
  78. package/src/shadcnui/ui/card.tsx +22 -47
  79. package/dist/chunk-GFRODCD7.mjs.map +0 -1
  80. package/dist/chunk-HWQBSVBT.mjs.map +0 -1
  81. package/dist/chunk-TZRAOUAR.js.map +0 -1
  82. package/dist/chunk-UPA67DQF.js.map +0 -1
  83. /package/dist/{BlockNoteEditor-DFHJWZZB.mjs.map → BlockNoteEditor-KFUTQVUK.mjs.map} +0 -0
@@ -47,7 +47,7 @@ import {
47
47
  TabsList,
48
48
  TabsTrigger,
49
49
  useCurrentUserContext
50
- } from "../chunk-GFRODCD7.mjs";
50
+ } from "../chunk-DLJTN632.mjs";
51
51
  import {
52
52
  getRoleId,
53
53
  getStripePublishableKey
@@ -61,7 +61,7 @@ import {
61
61
  StripeSubscriptionService,
62
62
  StripeUsageService,
63
63
  cn
64
- } from "../chunk-HWQBSVBT.mjs";
64
+ } from "../chunk-YZV24UWN.mjs";
65
65
  import "../chunk-AUXK7QSA.mjs";
66
66
  import "../chunk-C7C7VY4F.mjs";
67
67
  import "../chunk-U4MTVHOC.mjs";
@@ -1691,6 +1691,7 @@ function ProductPricingList({
1691
1691
  if (hideOneTimePrices) {
1692
1692
  pricesToFilter = pricesToFilter.filter((price) => price.priceType !== "one_time");
1693
1693
  }
1694
+ pricesToFilter = pricesToFilter.filter((price) => !price.isTrial);
1694
1695
  const filteredPrices = getFilteredPrices(pricesToFilter, selectedInterval);
1695
1696
  if (filteredPrices.length === 0) {
1696
1697
  return null;
@@ -2903,6 +2904,7 @@ function PriceEditor({ productId, price, open, onOpenChange, onSuccess }) {
2903
2904
  usageType: z2.enum(["licensed", "metered"]).optional(),
2904
2905
  nickname: z2.string().optional(),
2905
2906
  active: z2.boolean(),
2907
+ isTrial: z2.boolean(),
2906
2908
  description: z2.string().optional(),
2907
2909
  features: z2.array(z2.string()),
2908
2910
  token: z2.string(),
@@ -2922,6 +2924,7 @@ function PriceEditor({ productId, price, open, onOpenChange, onSuccess }) {
2922
2924
  usageType: price?.recurring?.usageType || "licensed",
2923
2925
  nickname: price?.nickname || "",
2924
2926
  active: price?.active ?? true,
2927
+ isTrial: price?.isTrial ?? false,
2925
2928
  description: price?.description || "",
2926
2929
  features: price?.features || [],
2927
2930
  token: price?.token?.toString() ?? "",
@@ -2942,6 +2945,7 @@ function PriceEditor({ productId, price, open, onOpenChange, onSuccess }) {
2942
2945
  usageType: price?.recurring?.usageType || "licensed",
2943
2946
  nickname: price?.nickname || "",
2944
2947
  active: price?.active ?? true,
2948
+ isTrial: price?.isTrial ?? false,
2945
2949
  description: price?.description || "",
2946
2950
  features: price?.features || [],
2947
2951
  token: price?.token?.toString() ?? "",
@@ -2962,8 +2966,8 @@ function PriceEditor({ productId, price, open, onOpenChange, onSuccess }) {
2962
2966
  description: values.description || void 0,
2963
2967
  features: values.features.filter((f) => f.trim()) || void 0,
2964
2968
  token: values.token ? parseInt(values.token, 10) : void 0,
2965
- // Only include featureIds for recurring prices (one-time prices don't support platform features)
2966
- ...price?.priceType === "recurring" ? { featureIds: values.featureIds } : {}
2969
+ // Only include isTrial and featureIds for recurring prices
2970
+ ...price?.priceType === "recurring" ? { isTrial: values.isTrial, featureIds: values.featureIds } : {}
2967
2971
  });
2968
2972
  } else {
2969
2973
  const createInput = {
@@ -2992,8 +2996,11 @@ function PriceEditor({ productId, price, open, onOpenChange, onSuccess }) {
2992
2996
  if (values.token) {
2993
2997
  createInput.token = parseInt(values.token, 10);
2994
2998
  }
2995
- if (isRecurring && values.featureIds.length > 0) {
2996
- createInput.featureIds = values.featureIds;
2999
+ if (isRecurring) {
3000
+ createInput.isTrial = values.isTrial;
3001
+ if (values.featureIds.length > 0) {
3002
+ createInput.featureIds = values.featureIds;
3003
+ }
2997
3004
  }
2998
3005
  await StripePriceService.createPrice(createInput);
2999
3006
  }
@@ -3193,6 +3200,15 @@ function PriceEditor({ productId, price, open, onOpenChange, onSuccess }) {
3193
3200
  }) })
3194
3201
  ] }),
3195
3202
  /* @__PURE__ */ jsx39(FormCheckbox, { form, id: "active", name: "Active" }),
3203
+ isRecurring && /* @__PURE__ */ jsx39(
3204
+ FormCheckbox,
3205
+ {
3206
+ form,
3207
+ id: "isTrial",
3208
+ name: "Trial Price",
3209
+ description: "Mark this as the trial subscription plan (only one price should be marked as trial)"
3210
+ }
3211
+ ),
3196
3212
  /* @__PURE__ */ jsx39(CommonEditorButtons, { isEdit: isEditMode, form, disabled: isSubmitting, setOpen: onOpenChange })
3197
3213
  ] }) })
3198
3214
  ] }) });