@burtson-labs/bandit-engine 2.0.142 → 2.0.143

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 CHANGED
@@ -38069,9 +38069,44 @@ var PreferencesTab = ({
38069
38069
  ] }),
38070
38070
  gatewayConfigured && gatewayHealthError && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.Box, { sx: { display: "flex", flexDirection: "column", gap: 0.75, pl: { xs: 0, sm: 0.5 } }, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.Typography, { variant: "caption", color: "error", children: gatewayHealthError.message }) })
38071
38071
  ] })
38072
- ] })
38072
+ ] }),
38073
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(ViewportDiagnostics, {})
38073
38074
  ] }) });
38074
38075
  };
38076
+ var ViewportDiagnostics = () => {
38077
+ const [metrics, setMetrics] = (0, import_react53.useState)({});
38078
+ (0, import_react53.useEffect)(() => {
38079
+ const read = () => {
38080
+ const probe = document.createElement("div");
38081
+ probe.style.cssText = "position:fixed;top:0;bottom:0;padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px);visibility:hidden;pointer-events:none;";
38082
+ document.body.appendChild(probe);
38083
+ const cs = getComputedStyle(probe);
38084
+ const standalone = window.matchMedia?.("(display-mode: standalone)").matches || window.navigator.standalone === true;
38085
+ setMetrics({
38086
+ mode: standalone ? "standalone" : "browser",
38087
+ "screen.height": `${window.screen.height}`,
38088
+ innerHeight: `${window.innerHeight}`,
38089
+ "docElement.clientHeight": `${document.documentElement.clientHeight}`,
38090
+ "visualViewport.height": `${Math.round(window.visualViewport?.height ?? -1)}`,
38091
+ "probe fixed t0/b0 height": `${Math.round(probe.getBoundingClientRect().height)}`,
38092
+ "safe-area-top": cs.paddingTop,
38093
+ "safe-area-bottom": cs.paddingBottom
38094
+ });
38095
+ probe.remove();
38096
+ };
38097
+ read();
38098
+ window.addEventListener("resize", read);
38099
+ return () => window.removeEventListener("resize", read);
38100
+ }, []);
38101
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_material44.Paper, { variant: "outlined", sx: { p: 2, borderRadius: 2, opacity: 0.85 }, children: [
38102
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.Typography, { variant: "caption", sx: { fontWeight: 700, display: "block", mb: 0.5 }, children: "Viewport diagnostics" }),
38103
+ Object.entries(metrics).map(([k, v]) => /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_material44.Typography, { variant: "caption", sx: { display: "block", fontFamily: "monospace" }, children: [
38104
+ k,
38105
+ ": ",
38106
+ v
38107
+ ] }, k))
38108
+ ] });
38109
+ };
38075
38110
  var PreferencesTab_default = PreferencesTab;
38076
38111
 
38077
38112
  // src/management/components/BrandingTab.tsx