@burtson-labs/bandit-engine 2.0.142 → 2.0.144

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.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  chat_default
3
- } from "./chunk-EWAZFMA3.mjs";
3
+ } from "./chunk-TQFUNLAT.mjs";
4
4
  import {
5
5
  chat_provider_default
6
6
  } from "./chunk-PU74BI6Y.mjs";
@@ -10,7 +10,7 @@ import {
10
10
  useGatewayHealth,
11
11
  useGatewayMemory,
12
12
  useGatewayModels
13
- } from "./chunk-CH5MEX6Q.mjs";
13
+ } from "./chunk-ZZO2QCAD.mjs";
14
14
  import "./chunk-P5IJLX6I.mjs";
15
15
  import "./chunk-F7JXIW6T.mjs";
16
16
  import "./chunk-K2JGFKEB.mjs";
@@ -30269,6 +30269,13 @@ var init_chat2 = __esm({
30269
30269
  const [isMobile, setIsMobile] = (0, import_react63.useState)(false);
30270
30270
  const [drawerOpen, setDrawerOpen] = (0, import_react63.useState)(false);
30271
30271
  const [mobileConversationsOpen, setMobileConversationsOpen] = (0, import_react63.useState)(false);
30272
+ (0, import_react63.useEffect)(() => {
30273
+ if (typeof document === "undefined") return;
30274
+ const meta = document.querySelector('meta[name="theme-color"]');
30275
+ if (!meta) return;
30276
+ const surface = isMobile && mobileConversationsOpen ? banditTheme.palette.background.paper : banditTheme.palette.chat?.shell ?? "#121212";
30277
+ meta.setAttribute("content", surface);
30278
+ }, [isMobile, mobileConversationsOpen, banditTheme]);
30272
30279
  const { generateName } = useConversationNameGenerator();
30273
30280
  const { preferences } = usePreferencesStore();
30274
30281
  const { containerRef: chatContainerRef, targetRef: scrollTargetRef, scrollToBottom, getScrollState } = useAutoScroll({
@@ -37132,9 +37139,44 @@ var PreferencesTab = ({
37132
37139
  ] }),
37133
37140
  gatewayConfigured && gatewayHealthError && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_material20.Box, { sx: { display: "flex", flexDirection: "column", gap: 0.75, pl: { xs: 0, sm: 0.5 } }, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_material20.Typography, { variant: "caption", color: "error", children: gatewayHealthError.message }) })
37134
37141
  ] })
37135
- ] })
37142
+ ] }),
37143
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ViewportDiagnostics, {})
37136
37144
  ] }) });
37137
37145
  };
37146
+ var ViewportDiagnostics = () => {
37147
+ const [metrics, setMetrics] = (0, import_react27.useState)({});
37148
+ (0, import_react27.useEffect)(() => {
37149
+ const read = () => {
37150
+ const probe = document.createElement("div");
37151
+ 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;";
37152
+ document.body.appendChild(probe);
37153
+ const cs = getComputedStyle(probe);
37154
+ const standalone = window.matchMedia?.("(display-mode: standalone)").matches || window.navigator.standalone === true;
37155
+ setMetrics({
37156
+ mode: standalone ? "standalone" : "browser",
37157
+ "screen.height": `${window.screen.height}`,
37158
+ innerHeight: `${window.innerHeight}`,
37159
+ "docElement.clientHeight": `${document.documentElement.clientHeight}`,
37160
+ "visualViewport.height": `${Math.round(window.visualViewport?.height ?? -1)}`,
37161
+ "probe fixed t0/b0 height": `${Math.round(probe.getBoundingClientRect().height)}`,
37162
+ "safe-area-top": cs.paddingTop,
37163
+ "safe-area-bottom": cs.paddingBottom
37164
+ });
37165
+ probe.remove();
37166
+ };
37167
+ read();
37168
+ window.addEventListener("resize", read);
37169
+ return () => window.removeEventListener("resize", read);
37170
+ }, []);
37171
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_material20.Paper, { variant: "outlined", sx: { p: 2, borderRadius: 2, opacity: 0.85 }, children: [
37172
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_material20.Typography, { variant: "caption", sx: { fontWeight: 700, display: "block", mb: 0.5 }, children: "Viewport diagnostics" }),
37173
+ Object.entries(metrics).map(([k, v]) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_material20.Typography, { variant: "caption", sx: { display: "block", fontFamily: "monospace" }, children: [
37174
+ k,
37175
+ ": ",
37176
+ v
37177
+ ] }, k))
37178
+ ] });
37179
+ };
37138
37180
  var PreferencesTab_default = PreferencesTab;
37139
37181
 
37140
37182
  // src/management/components/BrandingTab.tsx