@10x-media/analytics 0.1.0-beta.0 → 0.1.0-beta.1
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/CHANGELOG.md +71 -0
- package/README.md +37 -357
- package/dist/adapters/ga4/ga4.d.ts +20 -0
- package/dist/adapters/ga4/ga4.js +177 -0
- package/dist/{fetchJson-DZb2_Puj.js → adapters/http/fetchJson.js} +2 -2
- package/dist/adapters/http/fetchJson.js.map +1 -0
- package/dist/adapters/plausible/plausible.d.ts +15 -0
- package/dist/adapters/plausible/plausible.js +143 -0
- package/dist/adapters/posthog/posthog.d.ts +23 -0
- package/dist/adapters/posthog/posthog.js +121 -0
- package/dist/adapters/posthog/posthog.js.map +1 -0
- package/dist/{series-zytbzPoc.js → adapters/series.js} +2 -2
- package/dist/adapters/series.js.map +1 -0
- package/dist/adapters/umami/umami.d.ts +18 -0
- package/dist/adapters/umami/umami.js +139 -0
- package/dist/binding/resolvePath.js +61 -0
- package/dist/binding/resolvePath.js.map +1 -0
- package/dist/binding/types.d.ts +53 -0
- package/dist/charts/BarList.d.ts +20 -0
- package/dist/charts/BarList.js +73 -0
- package/dist/charts/BarList.js.map +1 -0
- package/dist/charts/TrendChart.d.ts +25 -0
- package/dist/charts/TrendChart.js +186 -0
- package/dist/charts/TrendChart.js.map +1 -0
- package/dist/charts/bars.d.ts +9 -0
- package/dist/charts/bars.js +19 -0
- package/dist/charts/bars.js.map +1 -0
- package/dist/charts/bucket.js +79 -0
- package/dist/charts/bucket.js.map +1 -0
- package/dist/charts/spline.js +84 -0
- package/dist/charts/spline.js.map +1 -0
- package/dist/charts/styles.js +42 -0
- package/dist/charts/styles.js.map +1 -0
- package/dist/core/cacheKey.js +31 -0
- package/dist/core/cacheKey.js.map +1 -0
- package/dist/core/capabilities.d.ts +12 -0
- package/dist/core/capabilities.js +12 -0
- package/dist/core/capabilities.js.map +1 -0
- package/dist/{contract-CWZPKWuR.d.ts → core/contract.d.ts} +30 -4
- package/dist/core/contract.js +10 -0
- package/dist/core/contract.js.map +1 -0
- package/dist/core/granularity.js +17 -0
- package/dist/core/granularity.js.map +1 -0
- package/dist/core/options.d.ts +115 -0
- package/dist/core/options.js +107 -0
- package/dist/core/options.js.map +1 -0
- package/dist/core/registry.js +24 -0
- package/dist/core/registry.js.map +1 -0
- package/dist/core/scopedRead.js +57 -0
- package/dist/core/scopedRead.js.map +1 -0
- package/dist/exports/adapters/ga4.d.ts +2 -20
- package/dist/exports/adapters/ga4.js +1 -176
- package/dist/exports/adapters/native.d.ts +2 -22
- package/dist/exports/adapters/native.js +1 -848
- package/dist/exports/adapters/plausible.d.ts +2 -15
- package/dist/exports/adapters/plausible.js +1 -142
- package/dist/exports/adapters/posthog.d.ts +2 -17
- package/dist/exports/adapters/posthog.js +1 -118
- package/dist/exports/adapters/umami.d.ts +2 -18
- package/dist/exports/adapters/umami.js +1 -138
- package/dist/exports/client.d.ts +5 -77
- package/dist/exports/client.js +4 -386
- package/dist/exports/geo.d.ts +4 -19
- package/dist/exports/geo.js +3 -1
- package/dist/exports/i18n.d.ts +3 -63
- package/dist/exports/i18n.js +2 -2
- package/dist/exports/next.d.ts +2 -0
- package/dist/exports/next.js +2 -0
- package/dist/exports/rsc.d.ts +13 -120
- package/dist/exports/rsc.js +10 -597
- package/dist/exports/types.d.ts +6 -4
- package/dist/exports/types.js +2 -1
- package/dist/fields/AnalyticsStatField.d.ts +31 -0
- package/dist/fields/AnalyticsStatField.js +93 -0
- package/dist/fields/AnalyticsStatField.js.map +1 -0
- package/dist/fields/dateRange/field.js +55 -0
- package/dist/fields/dateRange/field.js.map +1 -0
- package/dist/fields/dateRange/styles.js +23 -0
- package/dist/fields/dateRange/styles.js.map +1 -0
- package/dist/fields/dateRange/types.d.ts +11 -0
- package/dist/fields/dateRange/ui.d.ts +9 -0
- package/dist/fields/dateRange/ui.js +373 -0
- package/dist/fields/dateRange/ui.js.map +1 -0
- package/dist/fields/factories.d.ts +52 -0
- package/dist/fields/factories.js +65 -0
- package/dist/fields/factories.js.map +1 -0
- package/dist/fields/format.d.ts +7 -0
- package/dist/fields/format.js +22 -0
- package/dist/fields/format.js.map +1 -0
- package/dist/fields/readForDocument.js +107 -0
- package/dist/fields/readForDocument.js.map +1 -0
- package/dist/index.d.ts +18 -3
- package/dist/index.js +55 -1025
- package/dist/index.js.map +1 -1
- package/dist/native/collections/events.js +101 -0
- package/dist/native/collections/events.js.map +1 -0
- package/dist/native/collections/rollups.js +115 -0
- package/dist/native/collections/rollups.js.map +1 -0
- package/dist/native/collections/seen.js +47 -0
- package/dist/native/collections/seen.js.map +1 -0
- package/dist/native/geo/composeGeoResolvers.d.ts +7 -0
- package/dist/native/geo/composeGeoResolvers.js +14 -0
- package/dist/native/geo/composeGeoResolvers.js.map +1 -0
- package/dist/{geoResolver-CasIa4T9.d.ts → native/geo/geoResolver.d.ts} +2 -2
- package/dist/native/geo/geoResolver.js +11 -0
- package/dist/native/geo/geoResolver.js.map +1 -0
- package/dist/native/geo/maxmindResolver.d.ts +16 -0
- package/dist/native/geo/maxmindResolver.js +55 -0
- package/dist/native/geo/maxmindResolver.js.map +1 -0
- package/dist/native/ingest/device.js +15 -0
- package/dist/native/ingest/device.js.map +1 -0
- package/dist/native/ingest/endpoint.js +27 -0
- package/dist/native/ingest/endpoint.js.map +1 -0
- package/dist/native/ingest/flushBatch.js +69 -0
- package/dist/native/ingest/flushBatch.js.map +1 -0
- package/dist/native/ingest/normalizeEvent.js +38 -0
- package/dist/native/ingest/normalizeEvent.js.map +1 -0
- package/dist/native/ingest/salt.js +14 -0
- package/dist/native/ingest/salt.js.map +1 -0
- package/dist/native/ingest/source.js +22 -0
- package/dist/native/ingest/source.js.map +1 -0
- package/dist/native/ingest/visitorHash.js +12 -0
- package/dist/native/ingest/visitorHash.js.map +1 -0
- package/dist/native/ingest/writeBuffer.js +55 -0
- package/dist/native/ingest/writeBuffer.js.map +1 -0
- package/dist/native/ingest/writeEvent.js +13 -0
- package/dist/native/ingest/writeEvent.js.map +1 -0
- package/dist/native/nativeAdapter.d.ts +22 -0
- package/dist/native/nativeAdapter.js +213 -0
- package/dist/native/nativeAdapter.js.map +1 -0
- package/dist/native/realtime/buildRealtime.js +53 -0
- package/dist/native/realtime/buildRealtime.js.map +1 -0
- package/dist/native/retention/pruneTask.js +29 -0
- package/dist/native/retention/pruneTask.js.map +1 -0
- package/dist/native/rollupAcc.js +50 -0
- package/dist/native/rollupAcc.js.map +1 -0
- package/dist/native/rollups/applyDistinctDeltas.js +9 -0
- package/dist/native/rollups/applyDistinctDeltas.js.map +1 -0
- package/dist/native/rollups/bumpRollup.js +52 -0
- package/dist/native/rollups/bumpRollup.js.map +1 -0
- package/dist/native/rollups/deltas.js +31 -0
- package/dist/native/rollups/deltas.js.map +1 -0
- package/dist/native/rollups/insertIfNew.js +19 -0
- package/dist/native/rollups/insertIfNew.js.map +1 -0
- package/dist/next/posthogProxyRewrites.d.ts +36 -0
- package/dist/next/posthogProxyRewrites.js +50 -0
- package/dist/next/posthogProxyRewrites.js.map +1 -0
- package/dist/plugin/realtimeEndpoint.js +36 -0
- package/dist/plugin/realtimeEndpoint.js.map +1 -0
- package/dist/plugin/registerTranslations.js +19 -0
- package/dist/plugin/registerTranslations.js.map +1 -0
- package/dist/plugin/runtime.js +20 -0
- package/dist/plugin/runtime.js.map +1 -0
- package/dist/plugin/warmTask.js +165 -0
- package/dist/plugin/warmTask.js.map +1 -0
- package/dist/providers/collection.js +159 -0
- package/dist/providers/collection.js.map +1 -0
- package/dist/providers/factory.js +62 -0
- package/dist/providers/factory.js.map +1 -0
- package/dist/providers/resolver.js +67 -0
- package/dist/providers/resolver.js.map +1 -0
- package/dist/providers/secrets.js +27 -0
- package/dist/providers/secrets.js.map +1 -0
- package/dist/surfacing/cacheStore.js +26 -0
- package/dist/surfacing/cacheStore.js.map +1 -0
- package/dist/surfacing/coalesce.js +15 -0
- package/dist/surfacing/coalesce.js.map +1 -0
- package/dist/surfacing/engine.js +63 -0
- package/dist/surfacing/engine.js.map +1 -0
- package/dist/surfacing/queue.js +44 -0
- package/dist/surfacing/queue.js.map +1 -0
- package/dist/sync/collection.js +65 -0
- package/dist/sync/collection.js.map +1 -0
- package/dist/sync/syncTask.js +123 -0
- package/dist/sync/syncTask.js.map +1 -0
- package/dist/testing/memoryAdapter.d.ts +1 -1
- package/dist/timeframe/presets.d.ts +6 -0
- package/dist/timeframe/presets.js +63 -0
- package/dist/timeframe/presets.js.map +1 -0
- package/dist/{translations-keiKtSjF.js → translations/en.js} +25 -23
- package/dist/translations/en.js.map +1 -0
- package/dist/translations/index.d.ts +14 -0
- package/dist/translations/index.js +26 -0
- package/dist/translations/index.js.map +1 -0
- package/dist/translations/keys.d.ts +78 -0
- package/dist/{keys-DEqL4LOT.js → translations/keys.js} +24 -3
- package/dist/translations/keys.js.map +1 -0
- package/dist/translations/metricKeys.js +30 -0
- package/dist/translations/metricKeys.js.map +1 -0
- package/dist/translations/server.js +13 -0
- package/dist/translations/server.js.map +1 -0
- package/dist/translations/useTranslation.js +12 -0
- package/dist/translations/useTranslation.js.map +1 -0
- package/dist/widgets/AnalyticsBreakdownWidget.d.ts +7 -0
- package/dist/widgets/AnalyticsBreakdownWidget.js +85 -0
- package/dist/widgets/AnalyticsBreakdownWidget.js.map +1 -0
- package/dist/widgets/AnalyticsMetricWidget.d.ts +7 -0
- package/dist/widgets/AnalyticsMetricWidget.js +81 -0
- package/dist/widgets/AnalyticsMetricWidget.js.map +1 -0
- package/dist/widgets/AnalyticsRealtimeWidget.d.ts +7 -0
- package/dist/widgets/AnalyticsRealtimeWidget.js +64 -0
- package/dist/widgets/AnalyticsRealtimeWidget.js.map +1 -0
- package/dist/widgets/AnalyticsTrendWidget.d.ts +7 -0
- package/dist/widgets/AnalyticsTrendWidget.js +91 -0
- package/dist/widgets/AnalyticsTrendWidget.js.map +1 -0
- package/dist/widgets/RealtimeCounter.d.ts +19 -0
- package/dist/widgets/RealtimeCounter.js +76 -0
- package/dist/widgets/RealtimeCounter.js.map +1 -0
- package/dist/widgets/breakdownTypes.js +29 -0
- package/dist/widgets/breakdownTypes.js.map +1 -0
- package/dist/widgets/cardChrome.js +22 -0
- package/dist/widgets/cardChrome.js.map +1 -0
- package/dist/widgets/customWidget.d.ts +20 -0
- package/dist/widgets/customWidget.js +30 -0
- package/dist/widgets/customWidget.js.map +1 -0
- package/dist/widgets/defaults.d.ts +12 -0
- package/dist/widgets/defaults.js +72 -0
- package/dist/widgets/defaults.js.map +1 -0
- package/dist/widgets/range.js +28 -0
- package/dist/widgets/range.js.map +1 -0
- package/dist/widgets/readForWidget.d.ts +27 -0
- package/dist/widgets/readForWidget.js +57 -0
- package/dist/widgets/readForWidget.js.map +1 -0
- package/dist/widgets/readForWidgetBreakdown.d.ts +38 -0
- package/dist/widgets/readForWidgetBreakdown.js +75 -0
- package/dist/widgets/readForWidgetBreakdown.js.map +1 -0
- package/dist/{readForWidgetRealtime-D1BD37ST.d.ts → widgets/readForWidgetRealtime.d.ts} +5 -3
- package/dist/widgets/readForWidgetRealtime.js +63 -0
- package/dist/widgets/readForWidgetRealtime.js.map +1 -0
- package/dist/widgets/readForWidgetSeries.d.ts +38 -0
- package/dist/widgets/readForWidgetSeries.js +97 -0
- package/dist/widgets/readForWidgetSeries.js.map +1 -0
- package/dist/widgets/realtimePoll.js +26 -0
- package/dist/widgets/realtimePoll.js.map +1 -0
- package/dist/widgets/registerWidgets.js +249 -0
- package/dist/widgets/registerWidgets.js.map +1 -0
- package/dist/widgets/types.js +13 -0
- package/dist/widgets/types.js.map +1 -0
- package/package.json +16 -2
- package/dist/RealtimeCounter-BJrjMPSa.js +0 -473
- package/dist/RealtimeCounter-BJrjMPSa.js.map +0 -1
- package/dist/dist-B6HruP5v.js +0 -4731
- package/dist/dist-B6HruP5v.js.map +0 -1
- package/dist/exports/adapters/native.js.map +0 -1
- package/dist/exports/adapters/posthog.js.map +0 -1
- package/dist/exports/client.js.map +0 -1
- package/dist/exports/rsc.js.map +0 -1
- package/dist/fetchJson-DZb2_Puj.js.map +0 -1
- package/dist/index-CZdCT0WJ.d.ts +0 -98
- package/dist/keys-DEqL4LOT.js.map +0 -1
- package/dist/lib-CE5x1zLQ.js +0 -1058
- package/dist/lib-CE5x1zLQ.js.map +0 -1
- package/dist/maxmindResolver-CXYXXdul.js +0 -99
- package/dist/maxmindResolver-CXYXXdul.js.map +0 -1
- package/dist/presets-CBfq_uJX.d.ts +0 -38
- package/dist/series-zytbzPoc.js.map +0 -1
- package/dist/server-Cuvhgz-S.js +0 -492
- package/dist/server-Cuvhgz-S.js.map +0 -1
- package/dist/translations-keiKtSjF.js.map +0 -1
- /package/dist/{exports/adapters → adapters/ga4}/ga4.js.map +0 -0
- /package/dist/{exports/adapters → adapters/plausible}/plausible.js.map +0 -0
- /package/dist/{exports/adapters → adapters/umami}/umami.js.map +0 -0
package/dist/exports/client.js
CHANGED
|
@@ -1,388 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { mergeFieldStyles } from "@payloadcms/ui/shared";
|
|
7
|
-
import ReactDatePicker from "react-datepicker";
|
|
8
|
-
//#region src/fields/dateRange/styles.tsx
|
|
9
|
-
const DATE_RANGE_CSS = `
|
|
10
|
-
@layer payload-default {
|
|
11
|
-
.date-range-picker .react-datepicker__input-container input { cursor: pointer; }
|
|
12
|
-
.date-range-calendar__header { position: relative; display: flex; align-items: center; justify-content: center; }
|
|
13
|
-
.date-range-calendar__header .react-datepicker__navigation { position: absolute; top: 50%; transform: translateY(-50%); }
|
|
14
|
-
.date-range-calendar__header .react-datepicker__navigation--previous { left: 0; }
|
|
15
|
-
.date-range-calendar__header .react-datepicker__navigation--next { right: 0; }
|
|
16
|
-
.date-range-calendar__month-label { padding: 10px 0; font-size: 0.8rem; height: 37px !important; display: flex; align-items: center; justify-content: center; font-family: var(--font-body) !important; color: var(--theme-elevation-1000); }
|
|
17
|
-
.date-range-calendar .react-datepicker__day--in-range { background-color: var(--theme-elevation-150); color: var(--theme-elevation-1000); border-radius: 0; }
|
|
18
|
-
.date-range-calendar .react-datepicker__day--in-selecting-range:not(.react-datepicker__day--range-start, .react-datepicker__day--range-end) { background-color: var(--theme-elevation-100); border-radius: 0; }
|
|
19
|
-
.date-range-calendar .react-datepicker__day--range-start, .date-range-calendar .react-datepicker__day--range-end, .date-range-calendar .react-datepicker__day--selecting-range-start { background-color: var(--theme-elevation-800) !important; color: var(--theme-elevation-0) !important; font-weight: bold; border-radius: 0 !important; }
|
|
20
|
-
}
|
|
21
|
-
`;
|
|
22
|
-
function DateRangeStyles() {
|
|
23
|
-
return /* @__PURE__ */ jsx("style", { dangerouslySetInnerHTML: { __html: DATE_RANGE_CSS } });
|
|
24
|
-
}
|
|
25
|
-
//#endregion
|
|
26
|
-
//#region src/fields/dateRange/ui.tsx
|
|
27
|
-
const baseClass = "date-time-field";
|
|
28
|
-
const pickerClass = "date-time-picker";
|
|
29
|
-
const YEARS = Array.from({ length: 201 }, (_, i) => 1900 + i);
|
|
30
|
-
const getMonthNames = (locale) => Array.from({ length: 12 }, (_, i) => new Intl.DateTimeFormat(locale, { month: "long" }).format(new Date(2e3, i)));
|
|
31
|
-
const APPEARANCE_CONFIG = {
|
|
32
|
-
default: { dateFormat: "MM/dd/yyyy" },
|
|
33
|
-
dayOnly: { dateFormat: "MMM dd" },
|
|
34
|
-
monthOnly: {
|
|
35
|
-
dateFormat: "MMMM yyyy",
|
|
36
|
-
showMonthYearPicker: true
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
/** Pin a picked date to noon UTC so the stored ISO date does not shift a day across timezones. */
|
|
40
|
-
const normalizeDate = (date) => {
|
|
41
|
-
if (!date) return null;
|
|
42
|
-
const normalized = new Date(date);
|
|
43
|
-
normalized.setUTCHours(12, 0, 0, 0);
|
|
44
|
-
return normalized;
|
|
45
|
-
};
|
|
46
|
-
const makeDefaultHeader = (months) => ({ monthDate, customHeaderCount, changeMonth, changeYear, decreaseMonth, increaseMonth, prevMonthButtonDisabled, nextMonthButtonDisabled }) => {
|
|
47
|
-
const month = monthDate.getMonth();
|
|
48
|
-
const year = monthDate.getFullYear();
|
|
49
|
-
if (customHeaderCount === 1) return /* @__PURE__ */ jsxs("div", {
|
|
50
|
-
className: "date-range-calendar__header",
|
|
51
|
-
children: [/* @__PURE__ */ jsxs("div", {
|
|
52
|
-
className: "react-datepicker__header__dropdown date-range-calendar__month-label",
|
|
53
|
-
children: [
|
|
54
|
-
months[month],
|
|
55
|
-
" ",
|
|
56
|
-
year
|
|
57
|
-
]
|
|
58
|
-
}), /* @__PURE__ */ jsx("button", {
|
|
59
|
-
"aria-label": "Next Month",
|
|
60
|
-
className: "react-datepicker__navigation react-datepicker__navigation--next",
|
|
61
|
-
disabled: nextMonthButtonDisabled,
|
|
62
|
-
onClick: increaseMonth,
|
|
63
|
-
type: "button",
|
|
64
|
-
children: /* @__PURE__ */ jsx("span", {
|
|
65
|
-
className: "react-datepicker__navigation-icon react-datepicker__navigation-icon--next",
|
|
66
|
-
children: "Next Month"
|
|
67
|
-
})
|
|
68
|
-
})]
|
|
69
|
-
});
|
|
70
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
71
|
-
className: "date-range-calendar__header",
|
|
72
|
-
children: [/* @__PURE__ */ jsx("button", {
|
|
73
|
-
"aria-label": "Previous Month",
|
|
74
|
-
className: "react-datepicker__navigation react-datepicker__navigation--previous",
|
|
75
|
-
disabled: prevMonthButtonDisabled,
|
|
76
|
-
onClick: decreaseMonth,
|
|
77
|
-
type: "button",
|
|
78
|
-
children: /* @__PURE__ */ jsx("span", {
|
|
79
|
-
className: "react-datepicker__navigation-icon react-datepicker__navigation-icon--previous",
|
|
80
|
-
children: "Previous Month"
|
|
81
|
-
})
|
|
82
|
-
}), /* @__PURE__ */ jsxs("div", {
|
|
83
|
-
className: "react-datepicker__header__dropdown react-datepicker__header__dropdown--select",
|
|
84
|
-
children: [/* @__PURE__ */ jsx("div", {
|
|
85
|
-
className: "react-datepicker__month-dropdown-container react-datepicker__month-dropdown-container--select",
|
|
86
|
-
children: /* @__PURE__ */ jsx("select", {
|
|
87
|
-
className: "react-datepicker__month-select",
|
|
88
|
-
onChange: (e) => changeMonth(Number(e.target.value)),
|
|
89
|
-
value: month,
|
|
90
|
-
children: months.map((name, index) => /* @__PURE__ */ jsx("option", {
|
|
91
|
-
value: index,
|
|
92
|
-
children: name
|
|
93
|
-
}, name))
|
|
94
|
-
})
|
|
95
|
-
}), /* @__PURE__ */ jsx("div", {
|
|
96
|
-
className: "react-datepicker__year-dropdown-container react-datepicker__year-dropdown-container--select",
|
|
97
|
-
children: /* @__PURE__ */ jsx("select", {
|
|
98
|
-
className: "react-datepicker__year-select",
|
|
99
|
-
onChange: (e) => changeYear(Number(e.target.value)),
|
|
100
|
-
value: year,
|
|
101
|
-
children: YEARS.map((y) => /* @__PURE__ */ jsx("option", {
|
|
102
|
-
value: y,
|
|
103
|
-
children: y
|
|
104
|
-
}, y))
|
|
105
|
-
})
|
|
106
|
-
})]
|
|
107
|
-
})]
|
|
108
|
-
});
|
|
109
|
-
};
|
|
110
|
-
const renderMonthOnlyHeader = ({ monthDate, customHeaderCount, changeYear, decreaseYear, increaseYear, prevYearButtonDisabled, nextYearButtonDisabled }) => {
|
|
111
|
-
const year = monthDate.getFullYear();
|
|
112
|
-
if (customHeaderCount === 1) return /* @__PURE__ */ jsxs("div", {
|
|
113
|
-
className: "date-range-calendar__header",
|
|
114
|
-
children: [/* @__PURE__ */ jsx("div", {
|
|
115
|
-
className: "react-datepicker__header__dropdown date-range-calendar__month-label",
|
|
116
|
-
children: year
|
|
117
|
-
}), /* @__PURE__ */ jsx("button", {
|
|
118
|
-
"aria-label": "Next Year",
|
|
119
|
-
className: "react-datepicker__navigation react-datepicker__navigation--next",
|
|
120
|
-
disabled: nextYearButtonDisabled,
|
|
121
|
-
onClick: increaseYear,
|
|
122
|
-
type: "button",
|
|
123
|
-
children: /* @__PURE__ */ jsx("span", {
|
|
124
|
-
className: "react-datepicker__navigation-icon react-datepicker__navigation-icon--next",
|
|
125
|
-
children: "Next Year"
|
|
126
|
-
})
|
|
127
|
-
})]
|
|
128
|
-
});
|
|
129
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
130
|
-
className: "date-range-calendar__header",
|
|
131
|
-
children: [/* @__PURE__ */ jsx("button", {
|
|
132
|
-
"aria-label": "Previous Year",
|
|
133
|
-
className: "react-datepicker__navigation react-datepicker__navigation--previous",
|
|
134
|
-
disabled: prevYearButtonDisabled,
|
|
135
|
-
onClick: decreaseYear,
|
|
136
|
-
type: "button",
|
|
137
|
-
children: /* @__PURE__ */ jsx("span", {
|
|
138
|
-
className: "react-datepicker__navigation-icon react-datepicker__navigation-icon--previous",
|
|
139
|
-
children: "Previous Year"
|
|
140
|
-
})
|
|
141
|
-
}), /* @__PURE__ */ jsx("div", {
|
|
142
|
-
className: "react-datepicker__header__dropdown react-datepicker__header__dropdown--select",
|
|
143
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
144
|
-
className: "react-datepicker__year-dropdown-container react-datepicker__year-dropdown-container--select",
|
|
145
|
-
children: /* @__PURE__ */ jsx("select", {
|
|
146
|
-
className: "react-datepicker__year-select",
|
|
147
|
-
onChange: (e) => changeYear(Number(e.target.value)),
|
|
148
|
-
value: year,
|
|
149
|
-
children: YEARS.map((y) => /* @__PURE__ */ jsx("option", {
|
|
150
|
-
value: y,
|
|
151
|
-
children: y
|
|
152
|
-
}, y))
|
|
153
|
-
})
|
|
154
|
-
})
|
|
155
|
-
})]
|
|
156
|
-
});
|
|
157
|
-
};
|
|
158
|
-
const formatByAppearance = (date, appearance, locale) => {
|
|
159
|
-
if (!date) return "";
|
|
160
|
-
switch (appearance) {
|
|
161
|
-
case "dayOnly": return date.toLocaleDateString(locale, {
|
|
162
|
-
month: "short",
|
|
163
|
-
day: "2-digit"
|
|
164
|
-
});
|
|
165
|
-
case "monthOnly": return date.toLocaleDateString(locale, {
|
|
166
|
-
month: "long",
|
|
167
|
-
year: "numeric"
|
|
168
|
-
});
|
|
169
|
-
default: return date.toLocaleDateString(locale, {
|
|
170
|
-
month: "2-digit",
|
|
171
|
-
day: "2-digit",
|
|
172
|
-
year: "numeric"
|
|
173
|
-
});
|
|
174
|
-
}
|
|
175
|
-
};
|
|
176
|
-
const RangeInput = forwardRef(({ appearance, endDate, locale, onClick, startDate }, ref) => {
|
|
177
|
-
return /* @__PURE__ */ jsx("input", {
|
|
178
|
-
onChange: () => {},
|
|
179
|
-
onClick,
|
|
180
|
-
placeholder: "Select date range...",
|
|
181
|
-
readOnly: true,
|
|
182
|
-
ref,
|
|
183
|
-
value: startDate || endDate ? `${formatByAppearance(startDate, appearance, locale)} → ${formatByAppearance(endDate, appearance, locale) || "..."}` : ""
|
|
184
|
-
});
|
|
185
|
-
});
|
|
186
|
-
RangeInput.displayName = "RangeInput";
|
|
187
|
-
const DateRangeFieldComponent = (props) => {
|
|
188
|
-
const { field: { admin: { className, description } = {}, label }, path, readOnly, pickerAppearance = "default", timezone = false } = props;
|
|
189
|
-
const { config } = useConfig();
|
|
190
|
-
const { i18n } = useTranslation();
|
|
191
|
-
const { dispatchFields, setModified } = useForm();
|
|
192
|
-
const locale = i18n.language;
|
|
193
|
-
const fromValue = useFormFields(([fields]) => fields[`${path}.from`]?.value);
|
|
194
|
-
const toValue = useFormFields(([fields]) => fields[`${path}.to`]?.value);
|
|
195
|
-
const tzValue = useFormFields(([fields]) => timezone ? fields[`${path}._tz`]?.value : null);
|
|
196
|
-
const startDate = fromValue ? new Date(fromValue) : null;
|
|
197
|
-
const endDate = toValue ? new Date(toValue) : null;
|
|
198
|
-
const hasValue = Boolean(startDate ?? endDate);
|
|
199
|
-
const [pickerKey, setPickerKey] = useState(0);
|
|
200
|
-
const onCalendarClose = useCallback(() => setPickerKey((k) => k + 1), []);
|
|
201
|
-
const onChange = useCallback((dates) => {
|
|
202
|
-
if (readOnly) return;
|
|
203
|
-
const [start, end] = dates;
|
|
204
|
-
dispatchFields({
|
|
205
|
-
type: "UPDATE",
|
|
206
|
-
path: `${path}.from`,
|
|
207
|
-
value: normalizeDate(start)?.toISOString() ?? null
|
|
208
|
-
});
|
|
209
|
-
dispatchFields({
|
|
210
|
-
type: "UPDATE",
|
|
211
|
-
path: `${path}.to`,
|
|
212
|
-
value: normalizeDate(end)?.toISOString() ?? null
|
|
213
|
-
});
|
|
214
|
-
setModified(true);
|
|
215
|
-
}, [
|
|
216
|
-
path,
|
|
217
|
-
readOnly,
|
|
218
|
-
dispatchFields,
|
|
219
|
-
setModified
|
|
220
|
-
]);
|
|
221
|
-
const onClear = useCallback(() => {
|
|
222
|
-
if (readOnly) return;
|
|
223
|
-
dispatchFields({
|
|
224
|
-
type: "UPDATE",
|
|
225
|
-
path: `${path}.from`,
|
|
226
|
-
value: null
|
|
227
|
-
});
|
|
228
|
-
dispatchFields({
|
|
229
|
-
type: "UPDATE",
|
|
230
|
-
path: `${path}.to`,
|
|
231
|
-
value: null
|
|
232
|
-
});
|
|
233
|
-
setModified(true);
|
|
234
|
-
}, [
|
|
235
|
-
path,
|
|
236
|
-
readOnly,
|
|
237
|
-
dispatchFields,
|
|
238
|
-
setModified
|
|
239
|
-
]);
|
|
240
|
-
const onTimezoneChange = useCallback((tz) => {
|
|
241
|
-
dispatchFields({
|
|
242
|
-
type: "UPDATE",
|
|
243
|
-
path: `${path}._tz`,
|
|
244
|
-
value: tz
|
|
245
|
-
});
|
|
246
|
-
setModified(true);
|
|
247
|
-
}, [
|
|
248
|
-
path,
|
|
249
|
-
dispatchFields,
|
|
250
|
-
setModified
|
|
251
|
-
]);
|
|
252
|
-
const appearanceConfig = APPEARANCE_CONFIG[pickerAppearance];
|
|
253
|
-
const customHeader = useMemo(() => {
|
|
254
|
-
if (pickerAppearance === "monthOnly") return renderMonthOnlyHeader;
|
|
255
|
-
return makeDefaultHeader(getMonthNames(locale));
|
|
256
|
-
}, [pickerAppearance, locale]);
|
|
257
|
-
const supportedTimezones = useMemo(() => config.admin.timezones?.supportedTimezones ?? [], [config.admin.timezones]);
|
|
258
|
-
const style = useMemo(() => mergeFieldStyles(props.field), [props.field]);
|
|
259
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
260
|
-
className: [
|
|
261
|
-
"field-type",
|
|
262
|
-
baseClass,
|
|
263
|
-
className,
|
|
264
|
-
readOnly && "read-only"
|
|
265
|
-
].filter(Boolean).join(" "),
|
|
266
|
-
style,
|
|
267
|
-
children: [
|
|
268
|
-
/* @__PURE__ */ jsx(DateRangeStyles, {}),
|
|
269
|
-
/* @__PURE__ */ jsx(FieldLabel, {
|
|
270
|
-
label,
|
|
271
|
-
path
|
|
272
|
-
}),
|
|
273
|
-
/* @__PURE__ */ jsxs("div", {
|
|
274
|
-
className: "field-type__wrap",
|
|
275
|
-
id: `field-${path.replace(/\./g, "__")}`,
|
|
276
|
-
children: [
|
|
277
|
-
/* @__PURE__ */ jsx(FieldError, { path }),
|
|
278
|
-
/* @__PURE__ */ jsxs("div", {
|
|
279
|
-
className: `${pickerClass} ${pickerClass}__appearance--${pickerAppearance} date-range-picker`,
|
|
280
|
-
children: [/* @__PURE__ */ jsxs("div", {
|
|
281
|
-
className: `${pickerClass}__icon-wrap`,
|
|
282
|
-
children: [hasValue && !readOnly && /* @__PURE__ */ jsx("button", {
|
|
283
|
-
className: `${pickerClass}__clear-button`,
|
|
284
|
-
onClick: onClear,
|
|
285
|
-
type: "button",
|
|
286
|
-
children: /* @__PURE__ */ jsxs("svg", {
|
|
287
|
-
"aria-hidden": "true",
|
|
288
|
-
className: "icon icon--x",
|
|
289
|
-
fill: "none",
|
|
290
|
-
stroke: "currentColor",
|
|
291
|
-
strokeWidth: "1.5",
|
|
292
|
-
viewBox: "0 0 25 25",
|
|
293
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
294
|
-
children: [/* @__PURE__ */ jsx("line", {
|
|
295
|
-
x1: "6",
|
|
296
|
-
x2: "19",
|
|
297
|
-
y1: "6",
|
|
298
|
-
y2: "19"
|
|
299
|
-
}), /* @__PURE__ */ jsx("line", {
|
|
300
|
-
x1: "19",
|
|
301
|
-
x2: "6",
|
|
302
|
-
y1: "6",
|
|
303
|
-
y2: "19"
|
|
304
|
-
})]
|
|
305
|
-
})
|
|
306
|
-
}), /* @__PURE__ */ jsxs("svg", {
|
|
307
|
-
"aria-hidden": "true",
|
|
308
|
-
className: "icon icon--calendar",
|
|
309
|
-
fill: "none",
|
|
310
|
-
stroke: "currentColor",
|
|
311
|
-
strokeWidth: "1.5",
|
|
312
|
-
viewBox: "0 0 25 25",
|
|
313
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
314
|
-
children: [
|
|
315
|
-
/* @__PURE__ */ jsx("rect", {
|
|
316
|
-
height: "18",
|
|
317
|
-
rx: "1",
|
|
318
|
-
width: "18",
|
|
319
|
-
x: "3.5",
|
|
320
|
-
y: "4.5"
|
|
321
|
-
}),
|
|
322
|
-
/* @__PURE__ */ jsx("line", {
|
|
323
|
-
x1: "16",
|
|
324
|
-
x2: "16",
|
|
325
|
-
y1: "3",
|
|
326
|
-
y2: "6"
|
|
327
|
-
}),
|
|
328
|
-
/* @__PURE__ */ jsx("line", {
|
|
329
|
-
x1: "9",
|
|
330
|
-
x2: "9",
|
|
331
|
-
y1: "3",
|
|
332
|
-
y2: "6"
|
|
333
|
-
}),
|
|
334
|
-
/* @__PURE__ */ jsx("line", {
|
|
335
|
-
x1: "3.5",
|
|
336
|
-
x2: "21.5",
|
|
337
|
-
y1: "9.5",
|
|
338
|
-
y2: "9.5"
|
|
339
|
-
})
|
|
340
|
-
]
|
|
341
|
-
})]
|
|
342
|
-
}), /* @__PURE__ */ jsx("div", {
|
|
343
|
-
className: `${pickerClass}__input-wrapper`,
|
|
344
|
-
children: /* @__PURE__ */ jsx(ReactDatePicker, {
|
|
345
|
-
calendarClassName: "date-range-calendar",
|
|
346
|
-
customInput: /* @__PURE__ */ jsx(RangeInput, {
|
|
347
|
-
appearance: pickerAppearance,
|
|
348
|
-
endDate,
|
|
349
|
-
locale,
|
|
350
|
-
startDate
|
|
351
|
-
}),
|
|
352
|
-
disabled: readOnly,
|
|
353
|
-
endDate: endDate ?? void 0,
|
|
354
|
-
monthsShown: 2,
|
|
355
|
-
onCalendarClose,
|
|
356
|
-
onChange,
|
|
357
|
-
openToDate: startDate ?? void 0,
|
|
358
|
-
popperPlacement: "bottom-start",
|
|
359
|
-
renderCustomHeader: customHeader,
|
|
360
|
-
selectsRange: true,
|
|
361
|
-
selected: startDate,
|
|
362
|
-
showPopperArrow: false,
|
|
363
|
-
startDate: startDate ?? void 0,
|
|
364
|
-
...appearanceConfig
|
|
365
|
-
}, pickerKey)
|
|
366
|
-
})]
|
|
367
|
-
}),
|
|
368
|
-
timezone && supportedTimezones.length > 0 && /* @__PURE__ */ jsx(TimezonePicker, {
|
|
369
|
-
id: `${path}-timezone-picker`,
|
|
370
|
-
onChange: onTimezoneChange,
|
|
371
|
-
options: supportedTimezones,
|
|
372
|
-
readOnly,
|
|
373
|
-
selectedTimezone: tzValue ?? void 0
|
|
374
|
-
}),
|
|
375
|
-
/* @__PURE__ */ jsx(FieldDescription, {
|
|
376
|
-
description,
|
|
377
|
-
path
|
|
378
|
-
})
|
|
379
|
-
]
|
|
380
|
-
})
|
|
381
|
-
]
|
|
382
|
-
});
|
|
383
|
-
};
|
|
384
|
-
const DateRangeField = withCondition(DateRangeFieldComponent);
|
|
385
|
-
//#endregion
|
|
2
|
+
import { BarList } from "../charts/BarList.js";
|
|
3
|
+
import { TrendChart } from "../charts/TrendChart.js";
|
|
4
|
+
import { DateRangeField } from "../fields/dateRange/ui.js";
|
|
5
|
+
import { RealtimeCounter } from "../widgets/RealtimeCounter.js";
|
|
386
6
|
export { BarList, DateRangeField, RealtimeCounter, TrendChart };
|
|
387
|
-
|
|
388
|
-
//# sourceMappingURL=client.js.map
|
package/dist/exports/geo.d.ts
CHANGED
|
@@ -1,19 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
//#endregion
|
|
6
|
-
//#region src/native/geo/maxmindResolver.d.ts
|
|
7
|
-
interface MaxmindOptions {
|
|
8
|
-
dbPath: string;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Optional MaxMind GeoLite2 resolver. The mmdb and the maxmind lib are loaded
|
|
12
|
-
* lazily on first use. Any failure (lib not installed, file missing/unreadable,
|
|
13
|
-
* lookup error) degrades to empty geo after a single warning, so a missing or
|
|
14
|
-
* unconfigured database never breaks ingestion.
|
|
15
|
-
*/
|
|
16
|
-
declare function maxmindResolver(options: MaxmindOptions): GeoResolver;
|
|
17
|
-
//#endregion
|
|
18
|
-
export { type Geo, type GeoResolver, type MaxmindOptions, composeGeoResolvers, maxmindResolver, noopResolver, platformHeaderResolver };
|
|
19
|
-
//# sourceMappingURL=geo.d.ts.map
|
|
1
|
+
import { Geo, GeoResolver, noopResolver, platformHeaderResolver } from "../native/geo/geoResolver.js";
|
|
2
|
+
import { composeGeoResolvers } from "../native/geo/composeGeoResolvers.js";
|
|
3
|
+
import { MaxmindOptions, maxmindResolver } from "../native/geo/maxmindResolver.js";
|
|
4
|
+
export { type Geo, type GeoResolver, type MaxmindOptions, composeGeoResolvers, maxmindResolver, noopResolver, platformHeaderResolver };
|
package/dist/exports/geo.js
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { composeGeoResolvers } from "../native/geo/composeGeoResolvers.js";
|
|
2
|
+
import { noopResolver, platformHeaderResolver } from "../native/geo/geoResolver.js";
|
|
3
|
+
import { maxmindResolver } from "../native/geo/maxmindResolver.js";
|
|
2
4
|
export { composeGeoResolvers, maxmindResolver, noopResolver, platformHeaderResolver };
|
package/dist/exports/i18n.d.ts
CHANGED
|
@@ -1,63 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* literals (enforced by requireI18nKeysTyped.grit). Every key here must have a
|
|
5
|
-
* value in every locale (`en.ts`), or it is a type error.
|
|
6
|
-
*/
|
|
7
|
-
declare const keys: {
|
|
8
|
-
readonly pluginName: "analytics:pluginName";
|
|
9
|
-
readonly tabAnalytics: "analytics:tabAnalytics";
|
|
10
|
-
readonly metricPageviews: "analytics:metricPageviews";
|
|
11
|
-
readonly metricVisitors: "analytics:metricVisitors";
|
|
12
|
-
readonly metricSessions: "analytics:metricSessions";
|
|
13
|
-
readonly metricEvents: "analytics:metricEvents";
|
|
14
|
-
readonly metricAvgDuration: "analytics:metricAvgDuration";
|
|
15
|
-
readonly metricBounceRate: "analytics:metricBounceRate";
|
|
16
|
-
readonly metricEntries: "analytics:metricEntries";
|
|
17
|
-
readonly metricExits: "analytics:metricExits";
|
|
18
|
-
readonly metricScrollDepth: "analytics:metricScrollDepth";
|
|
19
|
-
readonly metricConversions: "analytics:metricConversions";
|
|
20
|
-
readonly metricRevenue: "analytics:metricRevenue";
|
|
21
|
-
readonly stateNoData: "analytics:stateNoData";
|
|
22
|
-
readonly stateNotBound: "analytics:stateNotBound";
|
|
23
|
-
readonly stateNotConfigured: "analytics:stateNotConfigured";
|
|
24
|
-
readonly stateUnavailable: "analytics:stateUnavailable";
|
|
25
|
-
readonly timeframeToday: "analytics:timeframeToday";
|
|
26
|
-
readonly timeframeLast7Days: "analytics:timeframeLast7Days";
|
|
27
|
-
readonly timeframeLast30Days: "analytics:timeframeLast30Days";
|
|
28
|
-
readonly timeframeLast90Days: "analytics:timeframeLast90Days";
|
|
29
|
-
readonly timeframeThisMonth: "analytics:timeframeThisMonth";
|
|
30
|
-
readonly timeframeThisYear: "analytics:timeframeThisYear";
|
|
31
|
-
readonly timeframeLastYear: "analytics:timeframeLastYear";
|
|
32
|
-
readonly timeframeAllTime: "analytics:timeframeAllTime";
|
|
33
|
-
readonly widgetMetricLabel: "analytics:widgetMetricLabel";
|
|
34
|
-
readonly widgetTrendLabel: "analytics:widgetTrendLabel";
|
|
35
|
-
readonly widgetBreakdownPages: "analytics:widgetBreakdownPages";
|
|
36
|
-
readonly widgetBreakdownSources: "analytics:widgetBreakdownSources";
|
|
37
|
-
readonly widgetBreakdownDevices: "analytics:widgetBreakdownDevices";
|
|
38
|
-
readonly widgetBreakdownCountries: "analytics:widgetBreakdownCountries";
|
|
39
|
-
readonly widgetFieldLimit: "analytics:widgetFieldLimit";
|
|
40
|
-
readonly stateNoBreakdown: "analytics:stateNoBreakdown";
|
|
41
|
-
readonly stateClamped: "analytics:stateClamped";
|
|
42
|
-
readonly widgetFieldTitle: "analytics:widgetFieldTitle";
|
|
43
|
-
readonly widgetFieldMetric: "analytics:widgetFieldMetric";
|
|
44
|
-
readonly widgetFieldTimeframe: "analytics:widgetFieldTimeframe";
|
|
45
|
-
readonly widgetFieldDataSource: "analytics:widgetFieldDataSource";
|
|
46
|
-
readonly widgetFieldTitlePlaceholder: "analytics:widgetFieldTitlePlaceholder";
|
|
47
|
-
readonly widgetTimeframeCustom: "analytics:widgetTimeframeCustom";
|
|
48
|
-
readonly widgetFieldRange: "analytics:widgetFieldRange";
|
|
49
|
-
readonly widgetFieldWindow: "analytics:widgetFieldWindow";
|
|
50
|
-
readonly widgetRealtimeLabel: "analytics:widgetRealtimeLabel";
|
|
51
|
-
readonly widgetRealtimeCaption: "analytics:widgetRealtimeCaption";
|
|
52
|
-
readonly widgetRealtimePaused: "analytics:widgetRealtimePaused";
|
|
53
|
-
};
|
|
54
|
-
type TranslationKey = (typeof keys)[keyof typeof keys];
|
|
55
|
-
//#endregion
|
|
56
|
-
//#region src/translations/index.d.ts
|
|
57
|
-
/** Per-locale messages merged into `config.i18n.translations`. English only for now. */
|
|
58
|
-
declare const translations: {
|
|
59
|
-
en: Record<string, Record<string, string>>;
|
|
60
|
-
};
|
|
61
|
-
//#endregion
|
|
62
|
-
export { type TranslationKey as AnalyticsTranslationKeys, keys, translations };
|
|
63
|
-
//# sourceMappingURL=i18n.d.ts.map
|
|
1
|
+
import { TranslationKey, keys } from "../translations/keys.js";
|
|
2
|
+
import { TranslationsOption, translations } from "../translations/index.js";
|
|
3
|
+
export { type TranslationKey as AnalyticsTranslationKeys, type TranslationKey, type TranslationsOption, keys, translations };
|
package/dist/exports/i18n.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { keys } from "../translations/keys.js";
|
|
2
|
+
import { translations } from "../translations/index.js";
|
|
3
3
|
export { keys, translations };
|
package/dist/exports/rsc.d.ts
CHANGED
|
@@ -1,120 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
};
|
|
15
|
-
metrics: MetricKey[];
|
|
16
|
-
timeframe: TimeframePreset;
|
|
17
|
-
variant: 'stat' | 'row';
|
|
18
|
-
adapterId?: string;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Read-only server component for a per-document analytics stat (or row of stats).
|
|
22
|
-
* Resolves the document's bound path, reads through the surfacing engine, and renders
|
|
23
|
-
* static markup. Interactivity (timeframe picker, refresh) is intentionally deferred.
|
|
24
|
-
*/
|
|
25
|
-
declare const AnalyticsStatField: (props: AnalyticsStatFieldProps) => Promise<import("react/jsx-runtime").JSX.Element>;
|
|
26
|
-
//#endregion
|
|
27
|
-
//#region src/fields/format.d.ts
|
|
28
|
-
declare const formatMetricValue: (metric: MetricKey, value: number, locale: string) => string;
|
|
29
|
-
//#endregion
|
|
30
|
-
//#region src/widgets/AnalyticsBreakdownWidget.d.ts
|
|
31
|
-
declare function AnalyticsBreakdownWidget(props: WidgetServerProps): Promise<import("react/jsx-runtime").JSX.Element>;
|
|
32
|
-
//#endregion
|
|
33
|
-
//#region src/widgets/AnalyticsMetricWidget.d.ts
|
|
34
|
-
declare function AnalyticsMetricWidget(props: WidgetServerProps): Promise<import("react/jsx-runtime").JSX.Element>;
|
|
35
|
-
//#endregion
|
|
36
|
-
//#region src/widgets/AnalyticsRealtimeWidget.d.ts
|
|
37
|
-
declare function AnalyticsRealtimeWidget(props: WidgetServerProps): Promise<import("react/jsx-runtime").JSX.Element>;
|
|
38
|
-
//#endregion
|
|
39
|
-
//#region src/widgets/AnalyticsTrendWidget.d.ts
|
|
40
|
-
declare function AnalyticsTrendWidget(props: WidgetServerProps): Promise<import("react/jsx-runtime").JSX.Element>;
|
|
41
|
-
//#endregion
|
|
42
|
-
//#region src/widgets/readForWidget.d.ts
|
|
43
|
-
type WidgetReadStatus = 'ok' | 'not-configured' | 'unavailable';
|
|
44
|
-
interface WidgetReadResult {
|
|
45
|
-
status: WidgetReadStatus;
|
|
46
|
-
adapterId: string;
|
|
47
|
-
dateRange: DateRange;
|
|
48
|
-
metrics: Partial<Record<MetricKey, number>>;
|
|
49
|
-
clamped?: boolean;
|
|
50
|
-
}
|
|
51
|
-
interface ReadForWidgetArgs {
|
|
52
|
-
req: PayloadRequest;
|
|
53
|
-
metrics: MetricKey[];
|
|
54
|
-
timeframe: TimeframePreset;
|
|
55
|
-
adapterId?: string;
|
|
56
|
-
now: Date;
|
|
57
|
-
range?: DateRange;
|
|
58
|
-
}
|
|
59
|
-
declare const readForWidget: (args: ReadForWidgetArgs) => Promise<WidgetReadResult>;
|
|
60
|
-
//#endregion
|
|
61
|
-
//#region src/widgets/readForWidgetBreakdown.d.ts
|
|
62
|
-
interface BreakdownRow {
|
|
63
|
-
label: string;
|
|
64
|
-
value: number;
|
|
65
|
-
}
|
|
66
|
-
interface WidgetBreakdownResult {
|
|
67
|
-
status: WidgetReadStatus;
|
|
68
|
-
adapterId: string;
|
|
69
|
-
dateRange: DateRange;
|
|
70
|
-
rows: BreakdownRow[];
|
|
71
|
-
clamped?: boolean;
|
|
72
|
-
}
|
|
73
|
-
interface ReadForWidgetBreakdownArgs {
|
|
74
|
-
req: PayloadRequest;
|
|
75
|
-
metric: MetricKey;
|
|
76
|
-
dimension: DimensionKey;
|
|
77
|
-
timeframe: TimeframePreset;
|
|
78
|
-
limit: number;
|
|
79
|
-
adapterId?: string;
|
|
80
|
-
now: Date;
|
|
81
|
-
range?: DateRange;
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Site-wide ranked breakdown of one metric by one dimension, read through the engine.
|
|
85
|
-
* Mirrors `readForWidget` but gates on the dimension too and maps each result row to a
|
|
86
|
-
* `{ label, value }` pair the bar list renders. The adapter owns sorting and limiting.
|
|
87
|
-
*/
|
|
88
|
-
declare const readForWidgetBreakdown: (args: ReadForWidgetBreakdownArgs) => Promise<WidgetBreakdownResult>;
|
|
89
|
-
//#endregion
|
|
90
|
-
//#region src/widgets/readForWidgetSeries.d.ts
|
|
91
|
-
interface SeriesPoint {
|
|
92
|
-
date: string;
|
|
93
|
-
value: number;
|
|
94
|
-
}
|
|
95
|
-
interface WidgetSeriesResult {
|
|
96
|
-
status: WidgetReadStatus;
|
|
97
|
-
adapterId: string;
|
|
98
|
-
dateRange: DateRange;
|
|
99
|
-
points: SeriesPoint[];
|
|
100
|
-
total: number;
|
|
101
|
-
clamped?: boolean;
|
|
102
|
-
}
|
|
103
|
-
interface ReadForWidgetSeriesArgs {
|
|
104
|
-
req: PayloadRequest;
|
|
105
|
-
metric: MetricKey;
|
|
106
|
-
timeframe: TimeframePreset;
|
|
107
|
-
adapterId?: string;
|
|
108
|
-
now: Date;
|
|
109
|
-
range?: DateRange;
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* Site-wide time-series read for a trend widget: resolve the timeframe, pick the
|
|
113
|
-
* adapter, gate on the metric and day-granularity support, read through the engine,
|
|
114
|
-
* then return a zero-filled daily series plus the headline total. Mirrors
|
|
115
|
-
* `readForWidget` but yields points instead of a single value.
|
|
116
|
-
*/
|
|
117
|
-
declare const readForWidgetSeries: (args: ReadForWidgetSeriesArgs) => Promise<WidgetSeriesResult>;
|
|
118
|
-
//#endregion
|
|
119
|
-
export { AnalyticsBreakdownWidget, AnalyticsMetricWidget, AnalyticsRealtimeWidget, AnalyticsStatField, AnalyticsTrendWidget, type BreakdownRow, type CapabilityRequirement, type DateRange, type DimensionKey, type MetricKey, type ReadForWidgetArgs, type ReadForWidgetBreakdownArgs, type ReadForWidgetRealtimeArgs, type ReadForWidgetSeriesArgs, type RealtimePoint, type SeriesPoint, type WidgetBreakdownResult, type WidgetReadResult, type WidgetReadStatus, type WidgetRealtimeResult, type WidgetRealtimeStatus, type WidgetSeriesResult, formatMetricValue, readForWidget, readForWidgetBreakdown, readForWidgetRealtime, readForWidgetSeries };
|
|
120
|
-
//# sourceMappingURL=rsc.d.ts.map
|
|
1
|
+
import { DateRange, DimensionKey, MetricKey } from "../core/contract.js";
|
|
2
|
+
import { ReadForWidgetRealtimeArgs, RealtimePoint, WidgetRealtimeResult, WidgetRealtimeStatus, readForWidgetRealtime } from "../widgets/readForWidgetRealtime.js";
|
|
3
|
+
import { CapabilityRequirement } from "../core/capabilities.js";
|
|
4
|
+
import { AnalyticsStatField } from "../fields/AnalyticsStatField.js";
|
|
5
|
+
import { formatMetricValue } from "../fields/format.js";
|
|
6
|
+
import { AnalyticsBreakdownWidget } from "../widgets/AnalyticsBreakdownWidget.js";
|
|
7
|
+
import { AnalyticsMetricWidget } from "../widgets/AnalyticsMetricWidget.js";
|
|
8
|
+
import { AnalyticsRealtimeWidget } from "../widgets/AnalyticsRealtimeWidget.js";
|
|
9
|
+
import { AnalyticsTrendWidget } from "../widgets/AnalyticsTrendWidget.js";
|
|
10
|
+
import { ReadForWidgetArgs, WidgetReadResult, WidgetReadStatus, readForWidget } from "../widgets/readForWidget.js";
|
|
11
|
+
import { BreakdownRow, ReadForWidgetBreakdownArgs, WidgetBreakdownResult, readForWidgetBreakdown } from "../widgets/readForWidgetBreakdown.js";
|
|
12
|
+
import { ReadForWidgetSeriesArgs, SeriesPoint, WidgetSeriesResult, readForWidgetSeries } from "../widgets/readForWidgetSeries.js";
|
|
13
|
+
export { AnalyticsBreakdownWidget, AnalyticsMetricWidget, AnalyticsRealtimeWidget, AnalyticsStatField, AnalyticsTrendWidget, type BreakdownRow, type CapabilityRequirement, type DateRange, type DimensionKey, type MetricKey, type ReadForWidgetArgs, type ReadForWidgetBreakdownArgs, type ReadForWidgetRealtimeArgs, type ReadForWidgetSeriesArgs, type RealtimePoint, type SeriesPoint, type WidgetBreakdownResult, type WidgetReadResult, type WidgetReadStatus, type WidgetRealtimeResult, type WidgetRealtimeStatus, type WidgetSeriesResult, formatMetricValue, readForWidget, readForWidgetBreakdown, readForWidgetRealtime, readForWidgetSeries };
|