@liiift-studio/sanity-visitor-insights 0.71.0 → 0.73.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,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, c as MeasurementHealthData, D as DiagnosticReport, J as JourneyData, T as TypefaceInterestData } from './ranges-CMhL0Chn.mjs';
4
- export { C as CaptureBasis, d as CaptureEstimate, e as CaptureModel, f as CheckStatus, g as Coverage, h as CrossSourceDay, i as DateRange, j as DiagnosticCheck, E as EmailCampaign, k as EventCutover, l as JourneyOutcome, m as JourneySegment, 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-CMhL0Chn.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-DhfuNtgW.mjs';
4
+ export { C as CaptureBasis, d as CaptureEstimate, e as CaptureModel, f as CheckStatus, g as Coverage, h as CrossSourceDay, i as DateRange, j as DiagnosticCheck, E as EmailCampaign, k as EventCutover, l as JourneyOutcome, m as JourneySegment, 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-DhfuNtgW.mjs';
5
5
 
6
6
  /**
7
7
  * Data hook for the Studio panels.
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, c as MeasurementHealthData, D as DiagnosticReport, J as JourneyData, T as TypefaceInterestData } from './ranges-CMhL0Chn.js';
4
- export { C as CaptureBasis, d as CaptureEstimate, e as CaptureModel, f as CheckStatus, g as Coverage, h as CrossSourceDay, i as DateRange, j as DiagnosticCheck, E as EmailCampaign, k as EventCutover, l as JourneyOutcome, m as JourneySegment, 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-CMhL0Chn.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-DhfuNtgW.js';
4
+ export { C as CaptureBasis, d as CaptureEstimate, e as CaptureModel, f as CheckStatus, g as Coverage, h as CrossSourceDay, i as DateRange, j as DiagnosticCheck, E as EmailCampaign, k as EventCutover, l as JourneyOutcome, m as JourneySegment, 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-DhfuNtgW.js';
5
5
 
6
6
  /**
7
7
  * Data hook for the Studio panels.
package/dist/index.js CHANGED
@@ -2438,7 +2438,7 @@ function OverviewPanel({ data, previous, onBrush }) {
2438
2438
  ),
2439
2439
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Delta, { current: metricSortValue(data.revenue), previous: metricSortValue(previous?.revenue) })
2440
2440
  ] }),
2441
- rankLine(data.crossSource, (d) => d.revenue) && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_sanity_ui_compat3.Text, { size: 0, muted: true, children: rankLine(data.crossSource, (d) => d.revenue) })
2441
+ revenueCoversEveryOrder(data) && rankLine(data.crossSource, (d) => d.revenue) && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_sanity_ui_compat3.Text, { size: 0, muted: true, children: rankLine(data.crossSource, (d) => d.revenue) })
2442
2442
  ] }) }),
2443
2443
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_sanity_ui_compat3.Card, { padding: 3, radius: 2, tone: "transparent", border: true, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_sanity_ui_compat3.Stack, { space: 3, children: [
2444
2444
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_sanity_ui_compat3.Label, { size: 1, muted: true, children: "Orders" }),
@@ -3160,8 +3160,9 @@ function AcquisitionPanel({ data, previous }) {
3160
3160
  formatMoney(finiteOrNull(data.actualRevenue) ?? 0, data.currency ?? null),
3161
3161
  " from",
3162
3162
  " ",
3163
- finiteOrNull(data.actualOrders) === null ? "your orders" : `${formatCount(data.actualOrders)} orders`,
3164
- " in Sanity, split across the ",
3163
+ finiteOrNull(data.actualOrders) === null ? "your orders" : (data.ordersMissingTotal ?? 0) > 0 ? `the ${formatCount(data.actualOrders - data.ordersMissingTotal)} of ${formatCount(data.actualOrders)} orders that carry an amount` : `${formatCount(data.actualOrders)} orders`,
3164
+ " ",
3165
+ "in Sanity, split across the ",
3165
3166
  formatCount(data.trackedPurchases ?? 0),
3166
3167
  " purchase",
3167
3168
  data.trackedPurchases === 1 ? "" : "s",
@@ -3360,6 +3361,7 @@ function catalogueRate(rows) {
3360
3361
  let views = 0;
3361
3362
  let sales = 0;
3362
3363
  for (const row of rows) {
3364
+ if (row.viewed?.status !== "ok") continue;
3363
3365
  const viewed = metricSortValue(row.viewed);
3364
3366
  const bought = metricSortValue(row.bought);
3365
3367
  if (viewed === null || bought === null) continue;
@@ -3415,7 +3417,7 @@ function TypefaceInterestPanel({ data }) {
3415
3417
  /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_sanity_ui_compat3.Text, { size: 1, muted: true, children: [
3416
3418
  "Sort by any column. \u201CSells vs catalogue\u201D compares each family\u2019s sales-per-view against the catalogue as a whole \u2014 1.0\xD7 is average, and sorting up finds the families that are looked at and do not sell. It is a comparison between your families, not the share of visitors who buy: Google Analytics sees only a fraction of the views, which moves every family together and so cancels out here. With one or two sales a family will still swing a long way, so read it alongside the order counts beside it.",
3417
3419
  " ",
3418
- "Bought and Revenue come from your own orders and are exact \u2014 do not scale those up.",
3420
+ "Bought and Revenue come from your own orders, not from Google Analytics \u2014 do not scale those up.",
3419
3421
  " ",
3420
3422
  "A family needs a reasonable number of views before it gets a comparison at all; below that it says so rather than ranking one order against the catalogue."
3421
3423
  ] }),
@@ -3523,7 +3525,8 @@ function TypefaceInterestPanel({ data }) {
3523
3525
  if (index === null) {
3524
3526
  const views = metricSortValue(row.viewed);
3525
3527
  const tooQuiet = views !== null && views < MIN_FAMILY_VIEWS;
3526
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_sanity_ui_compat3.Text, { size: 1, muted: true, "aria-label": `${row.typeface} not comparable`, children: tooQuiet ? "too few views to compare" : "\u2014" });
3528
+ const partWindow = row.viewed?.status === "partial";
3529
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_sanity_ui_compat3.Text, { size: 1, muted: true, "aria-label": `${row.typeface} not comparable`, children: partWindow ? "view tracking started mid-period" : tooQuiet ? "too few views to compare" : "\u2014" });
3527
3530
  }
3528
3531
  if (index === 0) {
3529
3532
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_sanity_ui_compat3.Text, { size: 1, children: "No sales" });
@@ -3562,7 +3565,19 @@ function TypefaceInterestPanel({ data }) {
3562
3565
  }
3563
3566
  )
3564
3567
  ] }),
3565
- data.revenueIsApportioned && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_sanity_ui_compat3.Text, { size: 0, muted: true, children: "Revenue is apportioned: an order covering several families or licences is split evenly between them, because the order documents carry no per-line value." })
3568
+ data.revenueIsApportioned && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_sanity_ui_compat3.Text, { size: 0, muted: true, children: "An order covering several families is split evenly between them, because the order documents carry no per-line value." }),
3569
+ finiteOrNull(data.unattributedRevenue) !== null && data.unattributedRevenue > 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_sanity_ui_compat3.Text, { size: 0, muted: true, children: [
3570
+ formatMoney(data.unattributedRevenue, data.currency ?? null),
3571
+ " of this range\u2019s takings is not in the column above \u2014 those orders name no family in this catalogue."
3572
+ ] }),
3573
+ finiteOrNull(data.ordersMissingTotal) !== null && data.ordersMissingTotal > 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_sanity_ui_compat3.Text, { size: 0, muted: true, children: [
3574
+ formatCount(data.ordersMissingTotal),
3575
+ " order",
3576
+ data.ordersMissingTotal === 1 ? "" : "s",
3577
+ " in this range carry no amount, so the revenue column does not cover ",
3578
+ data.ordersMissingTotal === 1 ? "it" : "them",
3579
+ "."
3580
+ ] })
3566
3581
  ] });
3567
3582
  }
3568
3583
  var CHECK_TONE = {