@liiift-studio/sanity-visitor-insights 0.19.0 → 0.20.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 CHANGED
@@ -1,6 +1,6 @@
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-BUZuS1c-.mjs';
3
+ import { R as ReportEnvelope, a as ReportName, b as RangeKey, M as MetricValue, A as AcquisitionData, c as MeasurementHealthData, D as DiagnosticReport, J as JourneyData, T as TypefaceInterestData } from './ranges-BUZuS1c-.mjs';
4
4
  export { C as CaptureBasis, d as CaptureEstimate, e as CaptureModel, f as CheckStatus, g as Coverage, h as CrossSourceDay, i as DailyPoint, j as DateRange, k as DiagnosticCheck, E as EmailCampaign, l as EventCutover, m as JourneyOutcome, n as JourneyStep, L as LandingPage, o as LicenceTierRow, P as PREEXISTING, p as REPORT_NAMES, q as ReportError, S as SiteAnalyticsConfig, r as SourceName, s as SourceRow, t as SourceStatus, u as TimelineEvent, v as TypefaceInterestRow, U as UnavailableReason, w as coverageForRange, x as estimated, y as isReportName, z as ok, B as partial, F as previousRange, G as resolveRange, H as unavailable, I as validateSiteConfig, K as valueOrNull } from './ranges-BUZuS1c-.mjs';
5
5
 
6
6
  /**
@@ -51,6 +51,7 @@ type ReportState<T> = {
51
51
  } | {
52
52
  status: 'ready';
53
53
  envelope: ReportEnvelope<T>;
54
+ stale?: boolean;
54
55
  } | {
55
56
  status: 'error';
56
57
  message: string;
@@ -67,13 +68,20 @@ interface UseReportOptions {
67
68
  apiBaseUrl: string;
68
69
  report: ReportName;
69
70
  range: RangeKey;
71
+ /**
72
+ * Whether to fetch at all. Defaults to true.
73
+ *
74
+ * Lets a panel declare a secondary report it only needs on one tab, without the other four
75
+ * paying a request for data they will not draw.
76
+ */
77
+ enabled?: boolean;
70
78
  }
71
79
  /**
72
80
  * Fetch a report, re-fetching when the range changes.
73
81
  *
74
82
  * @returns the current state plus a `reload` for manual refresh
75
83
  */
76
- declare function useReport<T>({ apiBaseUrl, report, range, custom }: UseReportOptions): {
84
+ declare function useReport<T>({ apiBaseUrl, report, range, custom, enabled }: UseReportOptions): {
77
85
  state: ReportState<T>;
78
86
  reload: () => void;
79
87
  };
@@ -415,10 +423,29 @@ declare function CrossSourceTimeline({ series, markers, currency }: CrossSourceT
415
423
  * Compares pageviews to pageviews. Sessions and orders sit alongside as context and are never
416
424
  * subtracted from a pageview count.
417
425
  */
418
- declare function MeasurementHealthPanel({ data, previous }: {
426
+ /**
427
+ * Overview — the five-minute read.
428
+ *
429
+ * Revenue, orders, the mailing list, the cross-source timeline and the campaign table all used to
430
+ * live on a tab called "Measurement health", whose own blurb announced it was about how much of
431
+ * reality each source sees. Four of the five questions a foundry owner opens this for were filed
432
+ * under plumbing, on tab four, behind a door labelled for the instrument. This is the same data,
433
+ * first, under a heading that says what it is.
434
+ */
435
+ declare function OverviewPanel({ data, previous }: {
419
436
  data: MeasurementHealthData;
420
437
  previous?: MeasurementHealthData;
421
438
  }): React.ReactElement;
439
+ /**
440
+ * Data health — the instrument, deliberately last.
441
+ *
442
+ * Everything here answers one question: can I trust the numbers on the other tabs. It was two
443
+ * separate tabs answering that question, which is one more than it deserves out of five.
444
+ */
445
+ declare function DataHealthPanel({ data, diagnostics }: {
446
+ data: MeasurementHealthData;
447
+ diagnostics?: DiagnosticReport;
448
+ }): React.ReactElement;
422
449
  /** Acquisition — where visitors came from, with design-industry referrers called out. */
423
450
  declare function AcquisitionPanel({ data, previous }: {
424
451
  data: AcquisitionData;
@@ -485,4 +512,4 @@ interface VisitorInsightsPluginOptions {
485
512
  */
486
513
  declare const visitorInsights: sanity.Plugin<VisitorInsightsPluginOptions>;
487
514
 
488
- export { AcquisitionData, AcquisitionPanel, ComparisonBar, CrossSourceTimeline, type CrossSourceTimelineProps, Delta, type DeltaProps, DiagnosticReport, DiagnosticsPanel, FunnelChart, JourneyData, JourneyPanel, MeasurementHealthData, MeasurementHealthPanel, MetricFigure, MetricValue, NoticeList, type ProportionBar, ProportionChart, type ProportionChartProps, RangeKey, ReportEnvelope, ReportName, type ReportState, type Series, type SeriesPoint, type SortColumn, SortableTable, type SortableTableProps, type TimelineMarker, TrendChart, TypefaceInterestData, TypefaceInterestPanel, type UseReportOptions, type VisitorInsightsPluginOptions, VisitorInsightsTool, type VisitorInsightsToolProps, visitorInsights as default, formatCount, formatMoney, formatPercent, useReport, visitorInsights };
515
+ export { AcquisitionData, AcquisitionPanel, ComparisonBar, CrossSourceTimeline, type CrossSourceTimelineProps, DataHealthPanel, Delta, type DeltaProps, DiagnosticReport, DiagnosticsPanel, FunnelChart, JourneyData, JourneyPanel, MeasurementHealthData, MetricFigure, MetricValue, NoticeList, OverviewPanel, type ProportionBar, ProportionChart, type ProportionChartProps, RangeKey, ReportEnvelope, ReportName, type ReportState, type Series, type SeriesPoint, type SortColumn, SortableTable, type SortableTableProps, type TimelineMarker, TrendChart, TypefaceInterestData, TypefaceInterestPanel, type UseReportOptions, type VisitorInsightsPluginOptions, VisitorInsightsTool, type VisitorInsightsToolProps, visitorInsights as default, formatCount, formatMoney, formatPercent, useReport, visitorInsights };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
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-BUZuS1c-.js';
3
+ import { R as ReportEnvelope, a as ReportName, b as RangeKey, M as MetricValue, A as AcquisitionData, c as MeasurementHealthData, D as DiagnosticReport, J as JourneyData, T as TypefaceInterestData } from './ranges-BUZuS1c-.js';
4
4
  export { C as CaptureBasis, d as CaptureEstimate, e as CaptureModel, f as CheckStatus, g as Coverage, h as CrossSourceDay, i as DailyPoint, j as DateRange, k as DiagnosticCheck, E as EmailCampaign, l as EventCutover, m as JourneyOutcome, n as JourneyStep, L as LandingPage, o as LicenceTierRow, P as PREEXISTING, p as REPORT_NAMES, q as ReportError, S as SiteAnalyticsConfig, r as SourceName, s as SourceRow, t as SourceStatus, u as TimelineEvent, v as TypefaceInterestRow, U as UnavailableReason, w as coverageForRange, x as estimated, y as isReportName, z as ok, B as partial, F as previousRange, G as resolveRange, H as unavailable, I as validateSiteConfig, K as valueOrNull } from './ranges-BUZuS1c-.js';
5
5
 
6
6
  /**
@@ -51,6 +51,7 @@ type ReportState<T> = {
51
51
  } | {
52
52
  status: 'ready';
53
53
  envelope: ReportEnvelope<T>;
54
+ stale?: boolean;
54
55
  } | {
55
56
  status: 'error';
56
57
  message: string;
@@ -67,13 +68,20 @@ interface UseReportOptions {
67
68
  apiBaseUrl: string;
68
69
  report: ReportName;
69
70
  range: RangeKey;
71
+ /**
72
+ * Whether to fetch at all. Defaults to true.
73
+ *
74
+ * Lets a panel declare a secondary report it only needs on one tab, without the other four
75
+ * paying a request for data they will not draw.
76
+ */
77
+ enabled?: boolean;
70
78
  }
71
79
  /**
72
80
  * Fetch a report, re-fetching when the range changes.
73
81
  *
74
82
  * @returns the current state plus a `reload` for manual refresh
75
83
  */
76
- declare function useReport<T>({ apiBaseUrl, report, range, custom }: UseReportOptions): {
84
+ declare function useReport<T>({ apiBaseUrl, report, range, custom, enabled }: UseReportOptions): {
77
85
  state: ReportState<T>;
78
86
  reload: () => void;
79
87
  };
@@ -415,10 +423,29 @@ declare function CrossSourceTimeline({ series, markers, currency }: CrossSourceT
415
423
  * Compares pageviews to pageviews. Sessions and orders sit alongside as context and are never
416
424
  * subtracted from a pageview count.
417
425
  */
418
- declare function MeasurementHealthPanel({ data, previous }: {
426
+ /**
427
+ * Overview — the five-minute read.
428
+ *
429
+ * Revenue, orders, the mailing list, the cross-source timeline and the campaign table all used to
430
+ * live on a tab called "Measurement health", whose own blurb announced it was about how much of
431
+ * reality each source sees. Four of the five questions a foundry owner opens this for were filed
432
+ * under plumbing, on tab four, behind a door labelled for the instrument. This is the same data,
433
+ * first, under a heading that says what it is.
434
+ */
435
+ declare function OverviewPanel({ data, previous }: {
419
436
  data: MeasurementHealthData;
420
437
  previous?: MeasurementHealthData;
421
438
  }): React.ReactElement;
439
+ /**
440
+ * Data health — the instrument, deliberately last.
441
+ *
442
+ * Everything here answers one question: can I trust the numbers on the other tabs. It was two
443
+ * separate tabs answering that question, which is one more than it deserves out of five.
444
+ */
445
+ declare function DataHealthPanel({ data, diagnostics }: {
446
+ data: MeasurementHealthData;
447
+ diagnostics?: DiagnosticReport;
448
+ }): React.ReactElement;
422
449
  /** Acquisition — where visitors came from, with design-industry referrers called out. */
423
450
  declare function AcquisitionPanel({ data, previous }: {
424
451
  data: AcquisitionData;
@@ -485,4 +512,4 @@ interface VisitorInsightsPluginOptions {
485
512
  */
486
513
  declare const visitorInsights: sanity.Plugin<VisitorInsightsPluginOptions>;
487
514
 
488
- export { AcquisitionData, AcquisitionPanel, ComparisonBar, CrossSourceTimeline, type CrossSourceTimelineProps, Delta, type DeltaProps, DiagnosticReport, DiagnosticsPanel, FunnelChart, JourneyData, JourneyPanel, MeasurementHealthData, MeasurementHealthPanel, MetricFigure, MetricValue, NoticeList, type ProportionBar, ProportionChart, type ProportionChartProps, RangeKey, ReportEnvelope, ReportName, type ReportState, type Series, type SeriesPoint, type SortColumn, SortableTable, type SortableTableProps, type TimelineMarker, TrendChart, TypefaceInterestData, TypefaceInterestPanel, type UseReportOptions, type VisitorInsightsPluginOptions, VisitorInsightsTool, type VisitorInsightsToolProps, visitorInsights as default, formatCount, formatMoney, formatPercent, useReport, visitorInsights };
515
+ export { AcquisitionData, AcquisitionPanel, ComparisonBar, CrossSourceTimeline, type CrossSourceTimelineProps, DataHealthPanel, Delta, type DeltaProps, DiagnosticReport, DiagnosticsPanel, FunnelChart, JourneyData, JourneyPanel, MeasurementHealthData, MetricFigure, MetricValue, NoticeList, OverviewPanel, type ProportionBar, ProportionChart, type ProportionChartProps, RangeKey, ReportEnvelope, ReportName, type ReportState, type Series, type SeriesPoint, type SortColumn, SortableTable, type SortableTableProps, type TimelineMarker, TrendChart, TypefaceInterestData, TypefaceInterestPanel, type UseReportOptions, type VisitorInsightsPluginOptions, VisitorInsightsTool, type VisitorInsightsToolProps, visitorInsights as default, formatCount, formatMoney, formatPercent, useReport, visitorInsights };