@liiift-studio/sanity-visitor-insights 0.35.0 → 0.37.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.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -2
- package/dist/index.mjs.map +1 -1
- package/dist/server.js +65 -6
- package/dist/server.js.map +1 -1
- package/dist/server.mjs +65 -6
- package/dist/server.mjs.map +1 -1
- package/package.json +1 -1
- package/src/server/cache.ts +18 -2
- package/src/server/createHandler.ts +12 -0
- package/src/server/fetchWithTimeout.ts +66 -0
- package/src/server/ga4.ts +51 -4
- package/src/server/mailchimp.ts +2 -1
- package/src/server/orders.ts +15 -0
- package/src/server/reports/reports.test.ts +97 -0
- package/src/server/vercel.ts +2 -1
- package/src/studio/Figure.tsx +29 -1
- package/src/studio/panels.test.tsx +36 -1
package/dist/index.js
CHANGED
|
@@ -491,6 +491,7 @@ function ProportionChart({ bars, format, totalLabel }) {
|
|
|
491
491
|
] })
|
|
492
492
|
] });
|
|
493
493
|
}
|
|
494
|
+
var MIN_RATE_DENOMINATOR = 30;
|
|
494
495
|
function FunnelChart({ stages, measurement }) {
|
|
495
496
|
const [activeKey, setActiveKey] = (0, import_react2.useState)(null);
|
|
496
497
|
const refs = (0, import_react2.useRef)([]);
|
|
@@ -535,8 +536,8 @@ function FunnelChart({ stages, measurement }) {
|
|
|
535
536
|
] }),
|
|
536
537
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { "aria-hidden": "true", style: { ...barTrack, height: 10 }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: { ...barFill, width: `${width}%` } }) }),
|
|
537
538
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_sanity_ui_compat.Text, { size: 0, muted: true, children: [
|
|
538
|
-
index === 0 ? "entry step" : `${formatPercent(share, 1)} of ${stages[0]?.label.toLowerCase()}
|
|
539
|
-
index > 1 && stage.conversionFromPrevious !== null && previous ? ` \xB7 ${formatPercent(stage.conversionFromPrevious, 1)} of ${previous.label.toLowerCase()}` : ""
|
|
539
|
+
index === 0 ? "entry step" : entry >= MIN_RATE_DENOMINATOR ? `${formatPercent(share, 1)} of ${stages[0]?.label.toLowerCase()}` : "too few to give a rate",
|
|
540
|
+
index > 1 && stage.conversionFromPrevious !== null && previous && (previous.value ?? 0) >= MIN_RATE_DENOMINATOR ? ` \xB7 ${formatPercent(stage.conversionFromPrevious, 1)} of ${previous.label.toLowerCase()}` : ""
|
|
540
541
|
] })
|
|
541
542
|
]
|
|
542
543
|
}
|