@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.
Files changed (78) hide show
  1. package/dist/{BlockNoteEditor-R3745ALQ.mjs → BlockNoteEditor-FZNU4YQT.mjs} +4 -4
  2. package/dist/{BlockNoteEditor-G45WMJ5V.js → BlockNoteEditor-SAU3G6H7.js} +19 -19
  3. package/dist/{BlockNoteEditor-G45WMJ5V.js.map → BlockNoteEditor-SAU3G6H7.js.map} +1 -1
  4. package/dist/{BlockNoteViewer-TNK3OMH5.mjs → BlockNoteViewer-6XDDVTN6.mjs} +2 -2
  5. package/dist/{BlockNoteViewer-5PGOVURC.js → BlockNoteViewer-7BTV7QQA.js} +3 -3
  6. package/dist/{BlockNoteViewer-5PGOVURC.js.map → BlockNoteViewer-7BTV7QQA.js.map} +1 -1
  7. package/dist/billing/index.js +492 -506
  8. package/dist/billing/index.js.map +1 -1
  9. package/dist/billing/index.mjs +5 -19
  10. package/dist/billing/index.mjs.map +1 -1
  11. package/dist/{chunk-CP7BXAFH.js → chunk-F4JB7YAP.js} +8 -8
  12. package/dist/{chunk-CP7BXAFH.js.map → chunk-F4JB7YAP.js.map} +1 -1
  13. package/dist/{chunk-KOA5PZZA.mjs → chunk-GFGKMUPZ.mjs} +2 -2
  14. package/dist/{chunk-EXG4ANC7.js → chunk-IPYXT7MH.js} +868 -868
  15. package/dist/{chunk-EXG4ANC7.js.map → chunk-IPYXT7MH.js.map} +1 -1
  16. package/dist/{chunk-RJMLAW5O.mjs → chunk-JVJS5RHB.mjs} +2 -2
  17. package/dist/{chunk-WU47MIZZ.js → chunk-MTI2UXDA.js} +4 -4
  18. package/dist/{chunk-WU47MIZZ.js.map → chunk-MTI2UXDA.js.map} +1 -1
  19. package/dist/{chunk-6KAYEYFU.mjs → chunk-RYZYKG6W.mjs} +2 -2
  20. package/dist/{chunk-3CSPHMVK.js → chunk-T3YQ47EF.js} +2 -32
  21. package/dist/chunk-T3YQ47EF.js.map +1 -0
  22. package/dist/{chunk-YG4YFAYY.js → chunk-TPZS46IM.js} +3 -3
  23. package/dist/{chunk-YG4YFAYY.js.map → chunk-TPZS46IM.js.map} +1 -1
  24. package/dist/{chunk-JCNB5KTQ.mjs → chunk-U7DR5VDT.mjs} +5 -5
  25. package/dist/{chunk-CJS5WA4E.mjs → chunk-USYZNWKS.mjs} +2 -32
  26. package/dist/chunk-USYZNWKS.mjs.map +1 -0
  27. package/dist/client/index.js +4 -4
  28. package/dist/client/index.mjs +3 -3
  29. package/dist/components/index.js +4 -4
  30. package/dist/components/index.mjs +3 -3
  31. package/dist/contexts/index.js +4 -4
  32. package/dist/contexts/index.mjs +3 -3
  33. package/dist/core/index.d.mts +0 -12
  34. package/dist/core/index.d.ts +0 -12
  35. package/dist/core/index.js +2 -2
  36. package/dist/core/index.mjs +1 -1
  37. package/dist/email-automations/index.js +92 -92
  38. package/dist/email-automations/index.mjs +3 -3
  39. package/dist/features/analytics/index.js +121 -121
  40. package/dist/features/analytics/index.mjs +4 -4
  41. package/dist/features/analytics/server.js +4 -4
  42. package/dist/features/analytics/server.mjs +2 -2
  43. package/dist/features/blog/index.js +150 -150
  44. package/dist/features/blog/index.mjs +3 -3
  45. package/dist/features/blog/server.js +16 -16
  46. package/dist/features/blog/server.mjs +1 -1
  47. package/dist/features/help/index.js +37 -37
  48. package/dist/features/help/index.mjs +3 -3
  49. package/dist/features/tokenusage/index.js +158 -125
  50. package/dist/features/tokenusage/index.js.map +1 -1
  51. package/dist/features/tokenusage/index.mjs +38 -5
  52. package/dist/features/tokenusage/index.mjs.map +1 -1
  53. package/dist/index.js +3 -3
  54. package/dist/index.mjs +2 -2
  55. package/dist/server/index.js +3 -3
  56. package/dist/server/index.mjs +2 -2
  57. package/messages/en.json +25 -1
  58. package/messages/it.json +25 -1
  59. package/package.json +1 -1
  60. package/scripts/validate-messages.mjs +4 -1
  61. package/src/features/__tests__/i18n-keys.contract.spec.ts +4 -0
  62. package/src/features/billing/components/cards/SubscriptionSummaryCard.tsx +22 -14
  63. package/src/features/billing/i18n-keys.ts +1 -0
  64. package/src/features/billing/stripe-subscription/components/details/SubscriptionDetails.tsx +1 -21
  65. package/src/features/billing/stripe-subscription/data/__tests__/stripe-subscription.spec.ts +59 -0
  66. package/src/features/billing/stripe-subscription/data/stripe-subscription.service.ts +0 -34
  67. package/src/features/billing/stripe-subscription/data/stripe-subscription.ts +1 -1
  68. package/src/features/tokenusage/components/TokenUsageRankedBar.tsx +34 -2
  69. package/src/features/tokenusage/components/__tests__/TokenUsageRankedBar.spec.tsx +22 -0
  70. package/src/features/tokenusage/lib/operation-label.ts +20 -0
  71. package/dist/chunk-3CSPHMVK.js.map +0 -1
  72. package/dist/chunk-CJS5WA4E.mjs.map +0 -1
  73. /package/dist/{BlockNoteEditor-R3745ALQ.mjs.map → BlockNoteEditor-FZNU4YQT.mjs.map} +0 -0
  74. /package/dist/{BlockNoteViewer-TNK3OMH5.mjs.map → BlockNoteViewer-6XDDVTN6.mjs.map} +0 -0
  75. /package/dist/{chunk-KOA5PZZA.mjs.map → chunk-GFGKMUPZ.mjs.map} +0 -0
  76. /package/dist/{chunk-RJMLAW5O.mjs.map → chunk-JVJS5RHB.mjs.map} +0 -0
  77. /package/dist/{chunk-6KAYEYFU.mjs.map → chunk-RYZYKG6W.mjs.map} +0 -0
  78. /package/dist/{chunk-JCNB5KTQ.mjs.map → chunk-U7DR5VDT.mjs.map} +0 -0
@@ -9,7 +9,7 @@ import {
9
9
  percentageDelta,
10
10
  seriesColor,
11
11
  useUsageFormatters
12
- } from "../../chunk-6KAYEYFU.mjs";
12
+ } from "../../chunk-RYZYKG6W.mjs";
13
13
  import {
14
14
  Button,
15
15
  Card,
@@ -36,9 +36,12 @@ import {
36
36
  TableHead,
37
37
  TableHeader,
38
38
  TableRow,
39
+ Tooltip,
40
+ TooltipContent,
41
+ TooltipTrigger,
39
42
  usePageUrlGenerator
40
- } from "../../chunk-JCNB5KTQ.mjs";
41
- import "../../chunk-RJMLAW5O.mjs";
43
+ } from "../../chunk-U7DR5VDT.mjs";
44
+ import "../../chunk-JVJS5RHB.mjs";
42
45
  import "../../chunk-PW42LRSL.mjs";
43
46
  import {
44
47
  AbstractService,
@@ -57,7 +60,7 @@ import {
57
60
  configureTokenUsage,
58
61
  getTokenUsageCurrency,
59
62
  tokenUsageModules
60
- } from "../../chunk-CJS5WA4E.mjs";
63
+ } from "../../chunk-USYZNWKS.mjs";
61
64
  import "../../chunk-V5MI7RNB.mjs";
62
65
  import "../../chunk-AUXK7QSA.mjs";
63
66
  import "../../chunk-PI56A4DG.mjs";
@@ -594,6 +597,7 @@ import { useTranslations as useTranslations5 } from "next-intl";
594
597
 
595
598
  // src/features/tokenusage/lib/operation-label.ts
596
599
  var OPERATION_LABEL_NAMESPACE = "token_usage.types";
600
+ var OPERATION_DESCRIPTION_NAMESPACE = "token_usage.type_descriptions";
597
601
  var toCamelCase = /* @__PURE__ */ __name((value) => {
598
602
  const parts = value.split(/[^a-zA-Z0-9]+/).filter(Boolean);
599
603
  if (parts.length === 0) return value;
@@ -605,6 +609,10 @@ var operationLabel = /* @__PURE__ */ __name((type, translate, has) => {
605
609
  const key = `${OPERATION_LABEL_NAMESPACE}.${toCamelCase(type)}`;
606
610
  return has(key) ? translate(key) : type;
607
611
  }, "operationLabel");
612
+ var operationDescription = /* @__PURE__ */ __name((type, translate, has) => {
613
+ const key = `${OPERATION_DESCRIPTION_NAMESPACE}.${toCamelCase(type)}`;
614
+ return has(key) ? translate(key) : void 0;
615
+ }, "operationDescription");
608
616
 
609
617
  // src/features/tokenusage/components/TokenUsageRankedBar.tsx
610
618
  import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
@@ -620,6 +628,31 @@ function TokenUsageRankedBar({ rows, metric, emptyLabel, labelsAreOperationTypes
620
628
  (key) => t.has(key)
621
629
  );
622
630
  }, "renderLabel");
631
+ const renderDescription = /* @__PURE__ */ __name((row) => {
632
+ if (row.id === "other" || !labelsAreOperationTypes) return void 0;
633
+ return operationDescription(
634
+ row.label,
635
+ (key) => t(key),
636
+ (key) => t.has(key)
637
+ );
638
+ }, "renderDescription");
639
+ const renderLabelCell = /* @__PURE__ */ __name((row) => {
640
+ const label = /* @__PURE__ */ jsx5("span", { className: "text-muted-foreground truncate text-xs", children: renderLabel(row) });
641
+ const description = renderDescription(row);
642
+ if (!description) return label;
643
+ return /* @__PURE__ */ jsxs4(Tooltip, { children: [
644
+ /* @__PURE__ */ jsx5(
645
+ TooltipTrigger,
646
+ {
647
+ "data-testid": `ranked-description-${row.id}`,
648
+ className: "min-w-0 cursor-help justify-self-start truncate",
649
+ render: /* @__PURE__ */ jsx5("div", {}),
650
+ children: label
651
+ }
652
+ ),
653
+ /* @__PURE__ */ jsx5(TooltipContent, { side: "top", className: "max-w-xs", children: /* @__PURE__ */ jsx5("p", { className: "text-xs", children: description }) })
654
+ ] });
655
+ }, "renderLabelCell");
623
656
  if (rows.length === 0) {
624
657
  return /* @__PURE__ */ jsx5("p", { className: "text-muted-foreground py-6 text-center text-sm", children: emptyLabel });
625
658
  }
@@ -634,7 +667,7 @@ function TokenUsageRankedBar({ rows, metric, emptyLabel, labelsAreOperationTypes
634
667
  const share = total > 0 ? value / total * 100 : 0;
635
668
  return /* @__PURE__ */ jsxs4("div", { className: "grid grid-cols-[minmax(0,1fr)_auto_auto] items-center gap-x-3 gap-y-0.5 py-0.5", children: [
636
669
  /* @__PURE__ */ jsxs4("div", { className: "grid min-w-0 gap-0.5", children: [
637
- /* @__PURE__ */ jsx5("span", { className: "text-muted-foreground truncate text-xs", children: renderLabel(row) }),
670
+ renderLabelCell(row),
638
671
  /* @__PURE__ */ jsx5("div", { className: "bg-muted h-2 w-full overflow-hidden rounded-r-[4px]", dir: "ltr", children: /* @__PURE__ */ jsx5(
639
672
  "div",
640
673
  {