@carlonicora/nextjs-jsonapi 6.24.0 → 6.25.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-MONT74RQ.js → BlockNoteEditor-TNX77GCD.js} +28 -25
- package/dist/BlockNoteEditor-TNX77GCD.js.map +1 -0
- package/dist/{BlockNoteEditor-ENDOVTAW.mjs → BlockNoteEditor-Z5LDF47Z.mjs} +13 -10
- package/dist/{BlockNoteEditor-ENDOVTAW.mjs.map → BlockNoteEditor-Z5LDF47Z.mjs.map} +1 -1
- package/dist/{BlockNoteViewer-K2HBF3IP.js → BlockNoteViewer-6KQJODNF.js} +9 -7
- package/dist/BlockNoteViewer-6KQJODNF.js.map +1 -0
- package/dist/{BlockNoteViewer-2TJZ6JET.mjs → BlockNoteViewer-TQ452ZYW.mjs} +8 -6
- package/dist/{BlockNoteViewer-2TJZ6JET.mjs.map → BlockNoteViewer-TQ452ZYW.mjs.map} +1 -1
- package/dist/JsonApiRequest-OKNQZLS6.js +26 -0
- package/dist/{JsonApiRequest-KC6DOHKT.js.map → JsonApiRequest-OKNQZLS6.js.map} +1 -1
- package/dist/{JsonApiRequest-ADLBJ5RX.mjs → JsonApiRequest-WNPDS356.mjs} +2 -2
- package/dist/billing/index.js +504 -517
- package/dist/billing/index.js.map +1 -1
- package/dist/billing/index.mjs +20 -33
- package/dist/billing/index.mjs.map +1 -1
- package/dist/{chunk-VNUT2D27.mjs → chunk-2PWYG2WJ.mjs} +2 -2
- package/dist/{chunk-W4ML6D2X.mjs → chunk-3U7YJ73T.mjs} +7 -7
- package/dist/{chunk-BQ2WAG4K.js → chunk-3VNDFKT7.js} +19 -19
- package/dist/{chunk-BQ2WAG4K.js.map → chunk-3VNDFKT7.js.map} +1 -1
- package/dist/{chunk-BE6UMM5X.mjs → chunk-47HNJQ7U.mjs} +3 -3
- package/dist/chunk-5T2AQMQ2.mjs +90 -0
- package/dist/chunk-5T2AQMQ2.mjs.map +1 -0
- package/dist/{chunk-A5M3MORY.js → chunk-5WM72MLE.js} +3 -3
- package/dist/{chunk-A5M3MORY.js.map → chunk-5WM72MLE.js.map} +1 -1
- package/dist/{chunk-S7SPAC6X.mjs → chunk-73NKUBMP.mjs} +3 -3
- package/dist/chunk-743M4TIB.mjs +76 -0
- package/dist/chunk-743M4TIB.mjs.map +1 -0
- package/dist/{chunk-HN7L6RRW.js → chunk-CSBQAPHD.js} +903 -955
- package/dist/chunk-CSBQAPHD.js.map +1 -0
- package/dist/{chunk-YTDGYI62.mjs → chunk-DWPHHUMV.mjs} +3 -3
- package/dist/{chunk-53SD4YRF.js → chunk-FBHUUPRV.js} +5 -5
- package/dist/{chunk-53SD4YRF.js.map → chunk-FBHUUPRV.js.map} +1 -1
- package/dist/{chunk-T6G2F2BK.mjs → chunk-HJT7TXGG.mjs} +16 -68
- package/dist/chunk-HJT7TXGG.mjs.map +1 -0
- package/dist/chunk-HROKKUBQ.js +156 -0
- package/dist/chunk-HROKKUBQ.js.map +1 -0
- package/dist/{chunk-TMV7TL7O.mjs → chunk-JELEQV5T.mjs} +8 -6
- package/dist/{chunk-TMV7TL7O.mjs.map → chunk-JELEQV5T.mjs.map} +1 -1
- package/dist/{chunk-TNTCLVUR.js → chunk-JGL4P3DS.js} +17 -15
- package/dist/chunk-JGL4P3DS.js.map +1 -0
- package/dist/{chunk-7OIWOPM5.mjs → chunk-K7KLUYS7.mjs} +4 -3
- package/dist/chunk-K7KLUYS7.mjs.map +1 -0
- package/dist/{chunk-OZADFYE7.mjs → chunk-KVYYPKRO.mjs} +308 -241
- package/dist/chunk-KVYYPKRO.mjs.map +1 -0
- package/dist/{chunk-RCOKQ3R4.js → chunk-LNO2JLU3.js} +2 -2
- package/dist/{chunk-RCOKQ3R4.js.map → chunk-LNO2JLU3.js.map} +1 -1
- package/dist/{chunk-BDWV4KYR.js → chunk-M6SNTMK6.js} +1386 -1319
- package/dist/chunk-M6SNTMK6.js.map +1 -0
- package/dist/{chunk-GMMDXINC.js → chunk-N3NQS7X6.js} +12 -12
- package/dist/{chunk-GMMDXINC.js.map → chunk-N3NQS7X6.js.map} +1 -1
- package/dist/chunk-NP3AFULU.js +76 -0
- package/dist/chunk-NP3AFULU.js.map +1 -0
- package/dist/{chunk-SO3YUCL6.js → chunk-OOM54Z5Z.js} +6 -5
- package/dist/chunk-OOM54Z5Z.js.map +1 -0
- package/dist/{chunk-YSE2Z4RB.js → chunk-PQQFOONG.js} +12 -12
- package/dist/{chunk-YSE2Z4RB.js.map → chunk-PQQFOONG.js.map} +1 -1
- package/dist/chunk-RW6XZGZG.mjs +156 -0
- package/dist/chunk-RW6XZGZG.mjs.map +1 -0
- package/dist/chunk-SYMI4IDW.js +90 -0
- package/dist/chunk-SYMI4IDW.js.map +1 -0
- package/dist/{chunk-N2BFT7KI.mjs → chunk-W7U6O3OE.mjs} +2 -71
- package/dist/chunk-W7U6O3OE.mjs.map +1 -0
- package/dist/{chunk-YMCL3JXZ.mjs → chunk-YPBIPE2B.mjs} +2 -2
- package/dist/{chunk-P7L6OFX5.js → chunk-Z6T2575A.js} +12 -81
- package/dist/chunk-Z6T2575A.js.map +1 -0
- package/dist/client/index.js +13 -10
- package/dist/client/index.js.map +1 -1
- package/dist/client/index.mjs +17 -14
- package/dist/components/forms/DatePickerPopover.d.ts.map +1 -1
- package/dist/components/forms/DateRangeSelector.d.ts.map +1 -1
- package/dist/components/forms/FormDate.d.ts.map +1 -1
- package/dist/components/forms/FormDateTime.d.ts.map +1 -1
- package/dist/components/forms/time-cycle.d.ts +14 -0
- package/dist/components/forms/time-cycle.d.ts.map +1 -0
- package/dist/components/index.js +11 -8
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +10 -7
- package/dist/components/tables/cells/cell.date.d.ts.map +1 -1
- package/dist/components/tables/cells/cell.dateTime.d.ts.map +1 -1
- package/dist/contexts/DateLocaleContext.d.ts +56 -0
- package/dist/contexts/DateLocaleContext.d.ts.map +1 -0
- package/dist/contexts/index.d.ts +1 -0
- package/dist/contexts/index.d.ts.map +1 -1
- package/dist/contexts/index.js +24 -8
- package/dist/contexts/index.js.map +1 -1
- package/dist/contexts/index.mjs +23 -7
- package/dist/core/index.js +17 -6
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +19 -8
- package/dist/date-locale/index.d.ts +2 -0
- package/dist/date-locale/index.d.ts.map +1 -0
- package/dist/date-locale/index.js +21 -0
- package/dist/date-locale/index.js.map +1 -0
- package/dist/date-locale/index.mjs +21 -0
- package/dist/email-automations/index.js +131 -123
- package/dist/email-automations/index.js.map +1 -1
- package/dist/email-automations/index.mjs +23 -15
- package/dist/email-automations/index.mjs.map +1 -1
- package/dist/features/account-deletion/components/AccountDeletionAdminTrigger.d.ts.map +1 -1
- package/dist/features/analytics/components/AnalyticsJourneyContainer.d.ts.map +1 -1
- package/dist/features/analytics/components/AnalyticsSessionsTable.d.ts.map +1 -1
- package/dist/features/analytics/index.js +154 -147
- package/dist/features/analytics/index.js.map +1 -1
- package/dist/features/analytics/index.mjs +32 -25
- package/dist/features/analytics/index.mjs.map +1 -1
- package/dist/features/analytics/server.js +11 -9
- package/dist/features/analytics/server.js.map +1 -1
- package/dist/features/analytics/server.mjs +9 -7
- package/dist/features/analytics/server.mjs.map +1 -1
- package/dist/features/billing/components/utils/date.d.ts +3 -3
- package/dist/features/billing/components/utils/format-options.d.ts +6 -4
- package/dist/features/billing/components/utils/format-options.d.ts.map +1 -1
- package/dist/features/billing/components/utils/useBillingFormatOptions.d.ts +5 -1
- package/dist/features/billing/components/utils/useBillingFormatOptions.d.ts.map +1 -1
- package/dist/features/billing/stripe-usage/components/details/UsageSummaryCard.d.ts.map +1 -1
- package/dist/features/billing/stripe-usage/components/lists/UsageHistoryTable.d.ts.map +1 -1
- package/dist/features/blog/components/admin/BlogTranslationStatus.d.ts.map +1 -1
- package/dist/features/blog/components/public/BlogPostMeta.d.ts.map +1 -1
- package/dist/features/blog/hooks/useBlogPostTableStructure.d.ts.map +1 -1
- package/dist/features/blog/index.js +168 -162
- package/dist/features/blog/index.js.map +1 -1
- package/dist/features/blog/index.mjs +25 -19
- package/dist/features/blog/index.mjs.map +1 -1
- package/dist/features/blog/server.js +29 -27
- package/dist/features/blog/server.js.map +1 -1
- package/dist/features/blog/server.mjs +8 -6
- package/dist/features/blog/server.mjs.map +1 -1
- package/dist/features/email-automation/hooks/useEmailAutomationEnrollmentTableStructure.d.ts.map +1 -1
- package/dist/features/handbook/components/parts/HandbookIndexStatus.d.ts.map +1 -1
- package/dist/features/help/components/HelpArticleBody.d.ts.map +1 -1
- package/dist/features/help/index.js +48 -43
- package/dist/features/help/index.js.map +1 -1
- package/dist/features/help/index.mjs +15 -10
- package/dist/features/help/index.mjs.map +1 -1
- package/dist/features/notification/components/notifications/Notification.d.ts +2 -1
- package/dist/features/notification/components/notifications/Notification.d.ts.map +1 -1
- package/dist/features/notification/contexts/NotificationContext.d.ts.map +1 -1
- package/dist/features/notification/hooks/useNotificationTableStructure.d.ts.map +1 -1
- package/dist/features/oauth/components/OAuthClientCard.d.ts.map +1 -1
- package/dist/features/oauth/components/OAuthClientDetail.d.ts.map +1 -1
- package/dist/features/tokenusage/index.js +133 -130
- package/dist/features/tokenusage/index.js.map +1 -1
- package/dist/features/tokenusage/index.mjs +10 -7
- package/dist/features/tokenusage/index.mjs.map +1 -1
- package/dist/features/tokenusage/lib/formatters.d.ts +6 -3
- package/dist/features/tokenusage/lib/formatters.d.ts.map +1 -1
- package/dist/index.js +19 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +23 -11
- package/dist/local-transport-AT4TE264.js +15 -0
- package/dist/{local-transport-MJPOKPTU.js.map → local-transport-AT4TE264.js.map} +1 -1
- package/dist/{local-transport-RVD4FZGA.mjs → local-transport-KWEUZ4GX.mjs} +5 -5
- package/dist/offline/index.js +56 -54
- package/dist/offline/index.js.map +1 -1
- package/dist/offline/index.mjs +23 -21
- package/dist/offline/index.mjs.map +1 -1
- package/dist/{request-4AWGPIGH.mjs → request-6GAIWWTG.mjs} +2 -2
- package/dist/{request-H5FZBZA2.js → request-BWO4Y434.js} +3 -3
- package/dist/{request-H5FZBZA2.js.map → request-BWO4Y434.js.map} +1 -1
- package/dist/server/ServerSession.d.ts +2 -0
- package/dist/server/ServerSession.d.ts.map +1 -1
- package/dist/server/index.js +10 -8
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +9 -7
- package/dist/utils/date-formatter.d.ts +45 -4
- package/dist/utils/date-formatter.d.ts.map +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/write-through-KNRI5L4V.mjs +15 -0
- package/dist/write-through-KNRI5L4V.mjs.map +1 -0
- package/dist/write-through-MYHQ6GJU.js +15 -0
- package/dist/{write-through-HE2QSOVI.js.map → write-through-MYHQ6GJU.js.map} +1 -1
- package/messages/en.json +1 -0
- package/messages/it.json +1 -0
- package/package.json +6 -1
- package/src/components/forms/DatePickerPopover.tsx +5 -3
- package/src/components/forms/DateRangeSelector.tsx +9 -7
- package/src/components/forms/FormDate.tsx +5 -3
- package/src/components/forms/FormDateTime.tsx +75 -39
- package/src/components/forms/__tests__/time-cycle.spec.ts +37 -0
- package/src/components/forms/time-cycle.ts +27 -0
- package/src/components/tables/cells/cell.date.tsx +3 -5
- package/src/components/tables/cells/cell.dateTime.tsx +3 -7
- package/src/contexts/DateLocaleContext.tsx +106 -0
- package/src/contexts/__tests__/DateLocaleContext.spec.tsx +175 -0
- package/src/contexts/index.ts +1 -0
- package/src/date-locale/index.ts +12 -0
- package/src/features/account-deletion/components/AccountDeletionAdminTrigger.tsx +3 -4
- package/src/features/analytics/components/AnalyticsJourneyContainer.tsx +8 -8
- package/src/features/analytics/components/AnalyticsSessionsTable.tsx +4 -6
- package/src/features/auth/components/two-factor/PasskeyList.tsx +3 -3
- package/src/features/auth/components/two-factor/TotpAuthenticatorList.tsx +3 -3
- package/src/features/billing/components/utils/__tests__/billing-formatters.spec.ts +14 -6
- package/src/features/billing/components/utils/date.ts +5 -5
- package/src/features/billing/components/utils/format-options.ts +6 -4
- package/src/features/billing/components/utils/useBillingFormatOptions.ts +8 -2
- package/src/features/billing/stripe-usage/components/details/UsageSummaryCard.tsx +4 -12
- package/src/features/billing/stripe-usage/components/lists/UsageHistoryTable.tsx +4 -17
- package/src/features/blog/components/admin/BlogTranslationStatus.tsx +3 -2
- package/src/features/blog/components/public/BlogPostMeta.tsx +5 -4
- package/src/features/blog/components/public/__tests__/BlogList.spec.tsx +1 -2
- package/src/features/blog/components/public/__tests__/BlogPostView.spec.tsx +2 -3
- package/src/features/blog/hooks/useBlogPostTableStructure.tsx +4 -8
- package/src/features/email-automation/hooks/useEmailAutomationEnrollmentTableStructure.tsx +11 -5
- package/src/features/email-blast/components/containers/EmailBlastContainer.tsx +3 -3
- package/src/features/email-blast/hooks/useEmailBlastTableStructure.tsx +4 -4
- package/src/features/handbook/components/parts/HandbookIndexStatus.tsx +4 -3
- package/src/features/help/components/HelpArticleBody.tsx +4 -3
- package/src/features/notification/components/notifications/Notification.tsx +38 -7
- package/src/features/notification/contexts/NotificationContext.tsx +6 -3
- package/src/features/notification/hooks/useNotificationTableStructure.tsx +6 -5
- package/src/features/oauth/components/OAuthClientCard.tsx +8 -5
- package/src/features/oauth/components/OAuthClientDetail.tsx +3 -6
- package/src/features/tokenusage/lib/__tests__/formatters.spec.ts +19 -0
- package/src/features/tokenusage/lib/formatters.ts +11 -6
- package/src/features/waitlist/hooks/useWaitlistTableStructure.tsx +5 -5
- package/src/server/ServerSession.ts +3 -0
- package/src/server/__tests__/ServerSession.read.spec.ts +18 -1
- package/src/utils/__tests__/date-formatter.spec.ts +134 -10
- package/src/utils/date-formatter.ts +200 -44
- package/src/utils/index.ts +11 -1
- package/dist/BlockNoteEditor-MONT74RQ.js.map +0 -1
- package/dist/BlockNoteViewer-K2HBF3IP.js.map +0 -1
- package/dist/JsonApiRequest-KC6DOHKT.js +0 -26
- package/dist/chunk-7OIWOPM5.mjs.map +0 -1
- package/dist/chunk-BDWV4KYR.js.map +0 -1
- package/dist/chunk-HN7L6RRW.js.map +0 -1
- package/dist/chunk-N2BFT7KI.mjs.map +0 -1
- package/dist/chunk-OZADFYE7.mjs.map +0 -1
- package/dist/chunk-P7L6OFX5.js.map +0 -1
- package/dist/chunk-SO3YUCL6.js.map +0 -1
- package/dist/chunk-T6G2F2BK.mjs.map +0 -1
- package/dist/chunk-TNTCLVUR.js.map +0 -1
- package/dist/local-transport-MJPOKPTU.js +0 -15
- package/dist/write-through-7I3LA2WN.mjs +0 -15
- package/dist/write-through-HE2QSOVI.js +0 -15
- /package/dist/{JsonApiRequest-ADLBJ5RX.mjs.map → JsonApiRequest-WNPDS356.mjs.map} +0 -0
- /package/dist/{chunk-VNUT2D27.mjs.map → chunk-2PWYG2WJ.mjs.map} +0 -0
- /package/dist/{chunk-W4ML6D2X.mjs.map → chunk-3U7YJ73T.mjs.map} +0 -0
- /package/dist/{chunk-BE6UMM5X.mjs.map → chunk-47HNJQ7U.mjs.map} +0 -0
- /package/dist/{chunk-S7SPAC6X.mjs.map → chunk-73NKUBMP.mjs.map} +0 -0
- /package/dist/{chunk-YTDGYI62.mjs.map → chunk-DWPHHUMV.mjs.map} +0 -0
- /package/dist/{chunk-YMCL3JXZ.mjs.map → chunk-YPBIPE2B.mjs.map} +0 -0
- /package/dist/{local-transport-RVD4FZGA.mjs.map → date-locale/index.mjs.map} +0 -0
- /package/dist/{request-4AWGPIGH.mjs.map → local-transport-KWEUZ4GX.mjs.map} +0 -0
- /package/dist/{write-through-7I3LA2WN.mjs.map → request-6GAIWWTG.mjs.map} +0 -0
|
@@ -31,9 +31,12 @@ import {
|
|
|
31
31
|
seriesColor,
|
|
32
32
|
usePageUrlGenerator,
|
|
33
33
|
useUsageFormatters
|
|
34
|
-
} from "../../chunk-
|
|
34
|
+
} from "../../chunk-KVYYPKRO.mjs";
|
|
35
|
+
import {
|
|
36
|
+
useDateFormatter
|
|
37
|
+
} from "../../chunk-5T2AQMQ2.mjs";
|
|
35
38
|
import "../../chunk-VOXD3ZLY.mjs";
|
|
36
|
-
import "../../chunk-
|
|
39
|
+
import "../../chunk-JELEQV5T.mjs";
|
|
37
40
|
import "../../chunk-PW42LRSL.mjs";
|
|
38
41
|
import {
|
|
39
42
|
AbstractService,
|
|
@@ -45,19 +48,22 @@ import {
|
|
|
45
48
|
AnalyticsSummary,
|
|
46
49
|
AnalyticsTimeline,
|
|
47
50
|
analyticsModules,
|
|
48
|
-
cn
|
|
51
|
+
cn
|
|
52
|
+
} from "../../chunk-HJT7TXGG.mjs";
|
|
53
|
+
import {
|
|
49
54
|
formatLocalDate
|
|
50
|
-
} from "../../chunk-
|
|
55
|
+
} from "../../chunk-RW6XZGZG.mjs";
|
|
51
56
|
import "../../chunk-OY65RYD3.mjs";
|
|
52
57
|
import {
|
|
53
58
|
EndpointCreator,
|
|
54
59
|
Modules
|
|
55
|
-
} from "../../chunk-
|
|
56
|
-
import "../../chunk-
|
|
57
|
-
import "../../chunk-
|
|
60
|
+
} from "../../chunk-W7U6O3OE.mjs";
|
|
61
|
+
import "../../chunk-47HNJQ7U.mjs";
|
|
62
|
+
import "../../chunk-73NKUBMP.mjs";
|
|
58
63
|
import "../../chunk-4ZJIUTIV.mjs";
|
|
59
|
-
import "../../chunk-
|
|
64
|
+
import "../../chunk-YPBIPE2B.mjs";
|
|
60
65
|
import "../../chunk-AUXK7QSA.mjs";
|
|
66
|
+
import "../../chunk-743M4TIB.mjs";
|
|
61
67
|
import {
|
|
62
68
|
__name
|
|
63
69
|
} from "../../chunk-PAWJFY3S.mjs";
|
|
@@ -881,16 +887,14 @@ function AnalyticsDailyUniquesChart({ rows, metric, className }) {
|
|
|
881
887
|
__name(AnalyticsDailyUniquesChart, "AnalyticsDailyUniquesChart");
|
|
882
888
|
|
|
883
889
|
// src/features/analytics/components/AnalyticsSessionsTable.tsx
|
|
884
|
-
import {
|
|
885
|
-
import { useMemo as useMemo4 } from "react";
|
|
890
|
+
import { useTranslations as useTranslations6 } from "next-intl";
|
|
886
891
|
import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
887
892
|
var VISITOR_SUFFIX_LENGTH = 6;
|
|
888
893
|
function AnalyticsSessionsTable({ rows, sessionPageUrl, onLoadMore, hasMore }) {
|
|
889
894
|
const t = useTranslations6();
|
|
890
|
-
const
|
|
895
|
+
const dates = useDateFormatter();
|
|
891
896
|
const generateUrl = usePageUrlGenerator();
|
|
892
897
|
const { decimal } = useUsageFormatters();
|
|
893
|
-
const dateTime = useMemo4(() => new Intl.DateTimeFormat(locale, { dateStyle: "short", timeStyle: "short" }), [locale]);
|
|
894
898
|
if (rows.length === 0) {
|
|
895
899
|
return /* @__PURE__ */ jsx6("p", { className: "text-muted-foreground text-sm", children: t("analytics.admin.no_data") });
|
|
896
900
|
}
|
|
@@ -912,7 +916,7 @@ function AnalyticsSessionsTable({ rows, sessionPageUrl, onLoadMore, hasMore }) {
|
|
|
912
916
|
{
|
|
913
917
|
href: generateUrl({ page: sessionPageUrl, id: row.id }),
|
|
914
918
|
"data-testid": `analytics-session-link-${row.id}`,
|
|
915
|
-
children:
|
|
919
|
+
children: dates.format(row.startedAt, "dateTime")
|
|
916
920
|
}
|
|
917
921
|
) }),
|
|
918
922
|
/* @__PURE__ */ jsx6(TableCell, { className: "text-xs", children: row.user ? /* @__PURE__ */ jsxs5("span", { className: "flex flex-col", children: [
|
|
@@ -937,7 +941,7 @@ __name(AnalyticsSessionsTable, "AnalyticsSessionsTable");
|
|
|
937
941
|
// src/features/analytics/components/AnalyticsTimelineChart.tsx
|
|
938
942
|
import { useTranslations as useTranslations7 } from "next-intl";
|
|
939
943
|
import { useTheme as useTheme2 } from "next-themes";
|
|
940
|
-
import { useMemo as
|
|
944
|
+
import { useMemo as useMemo4 } from "react";
|
|
941
945
|
import { Bar, BarChart, CartesianGrid as CartesianGrid2, XAxis as XAxis2, YAxis as YAxis2 } from "recharts";
|
|
942
946
|
import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
943
947
|
var SERIES = ["visitors", "pageViews"];
|
|
@@ -964,7 +968,7 @@ function AnalyticsTimelineChart({ rows, className }) {
|
|
|
964
968
|
const { compact, bucketDate, decimal } = useUsageFormatters();
|
|
965
969
|
const { resolvedTheme } = useTheme2();
|
|
966
970
|
const mode = resolvedTheme === "dark" ? "dark" : "light";
|
|
967
|
-
const chartData =
|
|
971
|
+
const chartData = useMemo4(() => {
|
|
968
972
|
const byBucket = /* @__PURE__ */ new Map();
|
|
969
973
|
for (const row of rows) {
|
|
970
974
|
const key = bucketKey2(row.bucket);
|
|
@@ -978,7 +982,7 @@ function AnalyticsTimelineChart({ rows, className }) {
|
|
|
978
982
|
}
|
|
979
983
|
return [...byBucket.values()].sort((a, b) => a.bucket.localeCompare(b.bucket));
|
|
980
984
|
}, [rows]);
|
|
981
|
-
const chartConfig =
|
|
985
|
+
const chartConfig = useMemo4(
|
|
982
986
|
() => ({
|
|
983
987
|
visitors: { label: t("analytics.admin.series.visitors") },
|
|
984
988
|
pageViews: { label: t("analytics.admin.series.page_views") }
|
|
@@ -1108,14 +1112,15 @@ function AnalyticsAdminContainer() {
|
|
|
1108
1112
|
__name(AnalyticsAdminContainer, "AnalyticsAdminContainer");
|
|
1109
1113
|
|
|
1110
1114
|
// src/features/analytics/components/AnalyticsJourneyContainer.tsx
|
|
1111
|
-
import { useLocale
|
|
1112
|
-
import { useEffect as useEffect3,
|
|
1115
|
+
import { useLocale, useTranslations as useTranslations9 } from "next-intl";
|
|
1116
|
+
import { useEffect as useEffect3, useState as useState2 } from "react";
|
|
1113
1117
|
import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1114
1118
|
var ANALYTICS_ADMIN_PAGE_URL = "/administration/analytics";
|
|
1115
1119
|
var OTHER_SESSIONS_WINDOW_DAYS = 395;
|
|
1116
1120
|
function AnalyticsJourneyContainer({ sessionId, pageUrl = ANALYTICS_ADMIN_PAGE_URL }) {
|
|
1117
1121
|
const t = useTranslations9();
|
|
1118
|
-
const locale =
|
|
1122
|
+
const locale = useLocale();
|
|
1123
|
+
const dates = useDateFormatter();
|
|
1119
1124
|
const generateUrl = usePageUrlGenerator();
|
|
1120
1125
|
const [session, setSession] = useState2(void 0);
|
|
1121
1126
|
const [pageViews, setPageViews] = useState2([]);
|
|
@@ -1155,10 +1160,6 @@ function AnalyticsJourneyContainer({ sessionId, pageUrl = ANALYTICS_ADMIN_PAGE_U
|
|
|
1155
1160
|
cancelled = true;
|
|
1156
1161
|
};
|
|
1157
1162
|
}, [sessionId]);
|
|
1158
|
-
const dateTime = useMemo6(
|
|
1159
|
-
() => new Intl.DateTimeFormat(locale, { dateStyle: "short", timeStyle: "medium" }),
|
|
1160
|
-
[locale]
|
|
1161
|
-
);
|
|
1162
1163
|
const formatGap = /* @__PURE__ */ __name((milliseconds) => {
|
|
1163
1164
|
const seconds = Math.max(0, Math.round(milliseconds / 1e3));
|
|
1164
1165
|
if (seconds < 60) return unit(locale, "second", seconds);
|
|
@@ -1186,7 +1187,13 @@ function AnalyticsJourneyContainer({ sessionId, pageUrl = ANALYTICS_ADMIN_PAGE_U
|
|
|
1186
1187
|
session.consented ? /* @__PURE__ */ jsx9(Badge, { variant: "softGreen", children: t("analytics.admin.consented") }) : /* @__PURE__ */ jsx9(Badge, { variant: "softGray", children: t("analytics.admin.not_consented") })
|
|
1187
1188
|
] }),
|
|
1188
1189
|
/* @__PURE__ */ jsxs8("div", { className: "grid gap-3 sm:grid-cols-3", children: [
|
|
1189
|
-
/* @__PURE__ */ jsx9(
|
|
1190
|
+
/* @__PURE__ */ jsx9(
|
|
1191
|
+
DetailField,
|
|
1192
|
+
{
|
|
1193
|
+
label: t("analytics.admin.columns.started"),
|
|
1194
|
+
value: dates.format(session.startedAt, "dateTimeSeconds")
|
|
1195
|
+
}
|
|
1196
|
+
),
|
|
1190
1197
|
/* @__PURE__ */ jsx9(DetailField, { label: t("analytics.admin.columns.source"), value: source }),
|
|
1191
1198
|
/* @__PURE__ */ jsx9(DetailField, { label: t("analytics.admin.columns.landing"), value: session.landingRoute }),
|
|
1192
1199
|
/* @__PURE__ */ jsx9(DetailField, { label: t("analytics.admin.columns.device"), value: session.deviceType }),
|
|
@@ -1213,7 +1220,7 @@ function AnalyticsJourneyContainer({ sessionId, pageUrl = ANALYTICS_ADMIN_PAGE_U
|
|
|
1213
1220
|
/* @__PURE__ */ jsx9(TableBody, { children: pageViews.map((pageView, index) => {
|
|
1214
1221
|
const previous = index > 0 ? pageViews[index - 1] : void 0;
|
|
1215
1222
|
return /* @__PURE__ */ jsxs8(TableRow, { "data-testid": `analytics-pageview-row-${pageView.id}`, children: [
|
|
1216
|
-
/* @__PURE__ */ jsx9(TableCell, { className: "text-xs tabular-nums", children:
|
|
1223
|
+
/* @__PURE__ */ jsx9(TableCell, { className: "text-xs tabular-nums", children: dates.format(pageView.createdAt, "dateTimeSeconds") }),
|
|
1217
1224
|
/* @__PURE__ */ jsx9(TableCell, { className: "text-end text-xs tabular-nums", children: previous ? formatGap(pageView.createdAt.getTime() - previous.createdAt.getTime()) : "\u2014" }),
|
|
1218
1225
|
/* @__PURE__ */ jsx9(TableCell, { className: "text-xs", children: pageView.path })
|
|
1219
1226
|
] }, pageView.id);
|