@liiift-studio/sanity-visitor-insights 0.9.0 → 0.11.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/index.d.mts +9 -4
- package/dist/index.d.ts +9 -4
- package/dist/index.js +602 -146
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +607 -151
- package/dist/index.mjs.map +1 -1
- package/dist/{ranges-B1YwjGGt.d.mts → ranges-YGStz1nR.d.mts} +51 -5
- package/dist/{ranges-B1YwjGGt.d.ts → ranges-YGStz1nR.d.ts} +51 -5
- package/dist/server.d.mts +20 -11
- package/dist/server.d.ts +20 -11
- package/dist/server.js +141 -5
- package/dist/server.js.map +1 -1
- package/dist/server.mjs +138 -5
- package/dist/server.mjs.map +1 -1
- package/dist/testing.d.mts +14 -1
- package/dist/testing.d.ts +14 -1
- package/dist/testing.js +12 -0
- package/dist/testing.js.map +1 -1
- package/dist/testing.mjs +12 -0
- package/dist/testing.mjs.map +1 -1
- package/dist/{vercel-BnuGVKWS.d.mts → vercel-C597eCC_.d.mts} +31 -1
- package/dist/{vercel-BnuGVKWS.d.ts → vercel-C597eCC_.d.ts} +31 -1
- package/package.json +3 -3
- package/src/core/core.test.ts +63 -1
- package/src/core/ranges.ts +64 -2
- package/src/reportData.ts +11 -2
- package/src/server/createHandler.ts +22 -3
- package/src/server/ga4.ts +139 -2
- package/src/server/reports/journey.ts +79 -8
- package/src/server/reports/reports.test.ts +212 -0
- package/src/studio/Figure.tsx +405 -22
- package/src/studio/VisitorInsightsTool.tsx +236 -52
- package/src/studio/panels.test.tsx +172 -13
- package/src/studio/panels.tsx +224 -103
- package/src/studio/useReport.ts +26 -4
- package/src/testing/fakes.ts +18 -1
- package/src/types.ts +8 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as sanity from 'sanity';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { R as ReportEnvelope, a as ReportName, b as RangeKey, M as MetricValue, A as AcquisitionData, D as DiagnosticReport, J as JourneyData, c as MeasurementHealthData, T as TypefaceInterestData } from './ranges-
|
|
4
|
-
export { C as Coverage, d as DateRange, E as EventCutover, P as PREEXISTING, e as REPORT_NAMES, f as ReportError, S as SiteAnalyticsConfig, g as SourceName, h as SourceStatus, U as UnavailableReason, i as coverageForRange, j as isReportName, o as ok, p as partial, k as previousRange, r as resolveRange, u as unavailable, v as validateSiteConfig, l as valueOrNull } from './ranges-
|
|
3
|
+
import { R as ReportEnvelope, a as ReportName, b as RangeKey, M as MetricValue, A as AcquisitionData, D as DiagnosticReport, J as JourneyData, c as MeasurementHealthData, T as TypefaceInterestData } from './ranges-YGStz1nR.mjs';
|
|
4
|
+
export { C as Coverage, d as DateRange, E as EventCutover, P as PREEXISTING, e as REPORT_NAMES, f as ReportError, S as SiteAnalyticsConfig, g as SourceName, h as SourceStatus, U as UnavailableReason, i as coverageForRange, j as isReportName, o as ok, p as partial, k as previousRange, r as resolveRange, u as unavailable, v as validateSiteConfig, l as valueOrNull } from './ranges-YGStz1nR.mjs';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* The Visitor Insights Studio tool.
|
|
@@ -57,6 +57,11 @@ type ReportState<T> = {
|
|
|
57
57
|
};
|
|
58
58
|
/** Options for useReport. */
|
|
59
59
|
interface UseReportOptions {
|
|
60
|
+
/** Explicit dates, required when `range` is 'custom' and ignored otherwise. */
|
|
61
|
+
custom?: {
|
|
62
|
+
start: string;
|
|
63
|
+
end: string;
|
|
64
|
+
};
|
|
60
65
|
/** Base URL of the site serving the reports, e.g. `https://dardenstudio.com`. */
|
|
61
66
|
apiBaseUrl: string;
|
|
62
67
|
report: ReportName;
|
|
@@ -67,7 +72,7 @@ interface UseReportOptions {
|
|
|
67
72
|
*
|
|
68
73
|
* @returns the current state plus a `reload` for manual refresh
|
|
69
74
|
*/
|
|
70
|
-
declare function useReport<T>({ apiBaseUrl, report, range }: UseReportOptions): {
|
|
75
|
+
declare function useReport<T>({ apiBaseUrl, report, range, custom }: UseReportOptions): {
|
|
71
76
|
state: ReportState<T>;
|
|
72
77
|
reload: () => void;
|
|
73
78
|
};
|
|
@@ -165,7 +170,7 @@ declare function MeasurementHealthPanel({ data }: {
|
|
|
165
170
|
declare function AcquisitionPanel({ data }: {
|
|
166
171
|
data: AcquisitionData;
|
|
167
172
|
}): React.ReactElement;
|
|
168
|
-
/** Journey —
|
|
173
|
+
/** Journey — a funnel, drawn as a tracked sequence or as independent totals, whichever the report used. */
|
|
169
174
|
declare function JourneyPanel({ data }: {
|
|
170
175
|
data: JourneyData;
|
|
171
176
|
}): React.ReactElement;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as sanity from 'sanity';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { R as ReportEnvelope, a as ReportName, b as RangeKey, M as MetricValue, A as AcquisitionData, D as DiagnosticReport, J as JourneyData, c as MeasurementHealthData, T as TypefaceInterestData } from './ranges-
|
|
4
|
-
export { C as Coverage, d as DateRange, E as EventCutover, P as PREEXISTING, e as REPORT_NAMES, f as ReportError, S as SiteAnalyticsConfig, g as SourceName, h as SourceStatus, U as UnavailableReason, i as coverageForRange, j as isReportName, o as ok, p as partial, k as previousRange, r as resolveRange, u as unavailable, v as validateSiteConfig, l as valueOrNull } from './ranges-
|
|
3
|
+
import { R as ReportEnvelope, a as ReportName, b as RangeKey, M as MetricValue, A as AcquisitionData, D as DiagnosticReport, J as JourneyData, c as MeasurementHealthData, T as TypefaceInterestData } from './ranges-YGStz1nR.js';
|
|
4
|
+
export { C as Coverage, d as DateRange, E as EventCutover, P as PREEXISTING, e as REPORT_NAMES, f as ReportError, S as SiteAnalyticsConfig, g as SourceName, h as SourceStatus, U as UnavailableReason, i as coverageForRange, j as isReportName, o as ok, p as partial, k as previousRange, r as resolveRange, u as unavailable, v as validateSiteConfig, l as valueOrNull } from './ranges-YGStz1nR.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* The Visitor Insights Studio tool.
|
|
@@ -57,6 +57,11 @@ type ReportState<T> = {
|
|
|
57
57
|
};
|
|
58
58
|
/** Options for useReport. */
|
|
59
59
|
interface UseReportOptions {
|
|
60
|
+
/** Explicit dates, required when `range` is 'custom' and ignored otherwise. */
|
|
61
|
+
custom?: {
|
|
62
|
+
start: string;
|
|
63
|
+
end: string;
|
|
64
|
+
};
|
|
60
65
|
/** Base URL of the site serving the reports, e.g. `https://dardenstudio.com`. */
|
|
61
66
|
apiBaseUrl: string;
|
|
62
67
|
report: ReportName;
|
|
@@ -67,7 +72,7 @@ interface UseReportOptions {
|
|
|
67
72
|
*
|
|
68
73
|
* @returns the current state plus a `reload` for manual refresh
|
|
69
74
|
*/
|
|
70
|
-
declare function useReport<T>({ apiBaseUrl, report, range }: UseReportOptions): {
|
|
75
|
+
declare function useReport<T>({ apiBaseUrl, report, range, custom }: UseReportOptions): {
|
|
71
76
|
state: ReportState<T>;
|
|
72
77
|
reload: () => void;
|
|
73
78
|
};
|
|
@@ -165,7 +170,7 @@ declare function MeasurementHealthPanel({ data }: {
|
|
|
165
170
|
declare function AcquisitionPanel({ data }: {
|
|
166
171
|
data: AcquisitionData;
|
|
167
172
|
}): React.ReactElement;
|
|
168
|
-
/** Journey —
|
|
173
|
+
/** Journey — a funnel, drawn as a tracked sequence or as independent totals, whichever the report used. */
|
|
169
174
|
declare function JourneyPanel({ data }: {
|
|
170
175
|
data: JourneyData;
|
|
171
176
|
}): React.ReactElement;
|