@carlonicora/nextjs-jsonapi 6.0.0 → 6.2.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-FZNU4YQT.mjs → BlockNoteEditor-D6VMXRZH.mjs} +4 -4
- package/dist/{BlockNoteEditor-SAU3G6H7.js → BlockNoteEditor-Q757ZLCO.js} +19 -19
- package/dist/{BlockNoteEditor-SAU3G6H7.js.map → BlockNoteEditor-Q757ZLCO.js.map} +1 -1
- package/dist/{BlockNoteViewer-6XDDVTN6.mjs → BlockNoteViewer-GI5LVQHZ.mjs} +2 -2
- package/dist/{BlockNoteViewer-7BTV7QQA.js → BlockNoteViewer-KG4CIJC5.js} +3 -3
- package/dist/{BlockNoteViewer-7BTV7QQA.js.map → BlockNoteViewer-KG4CIJC5.js.map} +1 -1
- package/dist/billing/index.js +491 -491
- package/dist/billing/index.mjs +3 -3
- package/dist/{chunk-F4JB7YAP.js → chunk-3P3IYUWQ.js} +8 -8
- package/dist/{chunk-F4JB7YAP.js.map → chunk-3P3IYUWQ.js.map} +1 -1
- package/dist/{chunk-U7DR5VDT.mjs → chunk-6PW3562E.mjs} +5 -5
- package/dist/{chunk-JVJS5RHB.mjs → chunk-CUNSPLOD.mjs} +2 -2
- package/dist/{chunk-T3YQ47EF.js → chunk-GSHMGL6N.js} +2 -1
- package/dist/chunk-GSHMGL6N.js.map +1 -0
- package/dist/{chunk-GFGKMUPZ.mjs → chunk-HLW3SUMD.mjs} +2 -2
- package/dist/{chunk-RYZYKG6W.mjs → chunk-MHBE4KQR.mjs} +2 -2
- package/dist/{chunk-USYZNWKS.mjs → chunk-QKDPCZ3G.mjs} +2 -1
- package/dist/{chunk-USYZNWKS.mjs.map → chunk-QKDPCZ3G.mjs.map} +1 -1
- package/dist/{chunk-TPZS46IM.js → chunk-S332ZCIE.js} +3 -3
- package/dist/{chunk-TPZS46IM.js.map → chunk-S332ZCIE.js.map} +1 -1
- package/dist/{chunk-MTI2UXDA.js → chunk-UEWDYVLW.js} +4 -4
- package/dist/{chunk-MTI2UXDA.js.map → chunk-UEWDYVLW.js.map} +1 -1
- package/dist/{chunk-IPYXT7MH.js → chunk-XQEYBESH.js} +868 -868
- package/dist/{chunk-IPYXT7MH.js.map → chunk-XQEYBESH.js.map} +1 -1
- 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.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.d.mts +9 -1
- package/dist/features/analytics/index.d.ts +9 -1
- package/dist/features/analytics/index.js +129 -127
- package/dist/features/analytics/index.js.map +1 -1
- package/dist/features/analytics/index.mjs +12 -10
- package/dist/features/analytics/index.mjs.map +1 -1
- 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 +23 -0
- package/messages/it.json +23 -0
- package/package.json +1 -1
- package/scripts/validate-messages.mjs +4 -1
- package/src/features/analytics/components/AnalyticsTracker.tsx +22 -9
- package/src/features/analytics/components/__tests__/AnalyticsTracker.spec.tsx +67 -0
- package/src/features/analytics/data/__tests__/models.spec.ts +13 -0
- package/src/features/analytics/data/analytics-event.ts +1 -0
- package/src/features/analytics/data/analytics.types.ts +2 -0
- 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-T3YQ47EF.js.map +0 -1
- /package/dist/{BlockNoteEditor-FZNU4YQT.mjs.map → BlockNoteEditor-D6VMXRZH.mjs.map} +0 -0
- /package/dist/{BlockNoteViewer-6XDDVTN6.mjs.map → BlockNoteViewer-GI5LVQHZ.mjs.map} +0 -0
- /package/dist/{chunk-U7DR5VDT.mjs.map → chunk-6PW3562E.mjs.map} +0 -0
- /package/dist/{chunk-JVJS5RHB.mjs.map → chunk-CUNSPLOD.mjs.map} +0 -0
- /package/dist/{chunk-GFGKMUPZ.mjs.map → chunk-HLW3SUMD.mjs.map} +0 -0
- /package/dist/{chunk-RYZYKG6W.mjs.map → chunk-MHBE4KQR.mjs.map} +0 -0
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
percentageDelta,
|
|
10
10
|
seriesColor,
|
|
11
11
|
useUsageFormatters
|
|
12
|
-
} from "../../chunk-
|
|
12
|
+
} from "../../chunk-MHBE4KQR.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-
|
|
41
|
-
import "../../chunk-
|
|
43
|
+
} from "../../chunk-6PW3562E.mjs";
|
|
44
|
+
import "../../chunk-CUNSPLOD.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-
|
|
63
|
+
} from "../../chunk-QKDPCZ3G.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
|
-
|
|
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
|
{
|