@liiift-studio/sanity-visitor-insights 0.72.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 +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +18 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -5
- package/dist/index.mjs.map +1 -1
- package/dist/{ranges-CMhL0Chn.d.mts → ranges-DhfuNtgW.d.mts} +17 -0
- package/dist/{ranges-CMhL0Chn.d.ts → ranges-DhfuNtgW.d.ts} +17 -0
- package/dist/server.d.mts +2 -2
- package/dist/server.d.ts +2 -2
- package/dist/server.js +24 -3
- package/dist/server.js.map +1 -1
- package/dist/server.mjs +24 -3
- package/dist/server.mjs.map +1 -1
- package/package.json +1 -1
- package/src/reportData.ts +17 -0
- package/src/server/createHandler.ts +6 -1
- package/src/server/reports/acquisition.ts +2 -1
- package/src/server/reports/measurementHealth.ts +25 -2
- package/src/server/reports/reports.test.ts +114 -0
- package/src/server/reports/typefaceInterest.ts +24 -2
- package/src/studio/panels.test.tsx +100 -0
- package/src/studio/panels.tsx +43 -5
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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
|
-
"
|
|
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",
|
|
@@ -3416,7 +3417,7 @@ function TypefaceInterestPanel({ data }) {
|
|
|
3416
3417
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_sanity_ui_compat3.Text, { size: 1, muted: true, children: [
|
|
3417
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.",
|
|
3418
3419
|
" ",
|
|
3419
|
-
"Bought and Revenue come from your own orders
|
|
3420
|
+
"Bought and Revenue come from your own orders, not from Google Analytics \u2014 do not scale those up.",
|
|
3420
3421
|
" ",
|
|
3421
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."
|
|
3422
3423
|
] }),
|
|
@@ -3564,7 +3565,19 @@ function TypefaceInterestPanel({ data }) {
|
|
|
3564
3565
|
}
|
|
3565
3566
|
)
|
|
3566
3567
|
] }),
|
|
3567
|
-
data.revenueIsApportioned && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_sanity_ui_compat3.Text, { size: 0, muted: true, children: "
|
|
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
|
+
] })
|
|
3568
3581
|
] });
|
|
3569
3582
|
}
|
|
3570
3583
|
var CHECK_TONE = {
|