@the-portland-company/shell 0.65.0 → 0.65.1

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.
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { broadcastLogout, watchLogout } from './chunk-LL6LSJAH.js';
3
- import { clearBetaBannerDismissal, standardPolitogyNav, isNavItemActive, NavAppShell, NavChromeProvider, FuelAction, NavDisplayAction, TopBarWidgetSlot, SpecOverlayAction, SupportAction, NotificationsAction, useChromeMe, useThemePreference, useNavChromeFetcher, useChromeOrgs } from './chunk-XK2LWTHJ.js';
3
+ import { clearBetaBannerDismissal, standardPolitogyNav, isNavItemActive, NavAppShell, NavChromeProvider, FuelAction, NavDisplayAction, TopBarWidgetSlot, SpecOverlayAction, SupportAction, NotificationsAction, useChromeMe, useThemePreference, useNavChromeFetcher, useChromeOrgs } from './chunk-NRKRUM5B.js';
4
4
  import './chunk-JHIFJZ73.js';
5
5
  import { NAV_DISPLAY_DEFAULT, resolveNavDisplay, isNavDisplayPreference, writeNavDisplayCookie, writeNavDisplayLocal, NAV_DISPLAY_STORAGE_KEY, readNavDisplayCookie } from './chunk-6UHJV2FH.js';
6
6
  import { resolveActiveOrg, isOrgId, writeActiveOrgCookie, ACTIVE_ORG_QUERY_PARAM, readActiveOrgCookie } from './chunk-W2HITMV5.js';
@@ -1275,11 +1275,14 @@ function useLocationHref() {
1275
1275
  return href;
1276
1276
  }
1277
1277
  function specOverlayFetchJson(path) {
1278
- return fetch(`${SPECS_ORIGIN}${path}`, { credentials: "include" }).then((res) => {
1278
+ return fetch(`${SPECS_ORIGIN}${path}`, { credentials: "include", signal: AbortSignal.timeout(1e4) }).then((res) => {
1279
1279
  if (!res.ok) throw new Error(`spec overlay ${path}: ${res.status}`);
1280
1280
  return res.json();
1281
1281
  });
1282
1282
  }
1283
+ function isAutomatedCaptureSession() {
1284
+ return typeof navigator !== "undefined" && navigator.webdriver === true;
1285
+ }
1283
1286
  function currentChromeTheme() {
1284
1287
  const root = document.documentElement;
1285
1288
  if (root.classList.contains("dark") || root.getAttribute("data-theme") === "dark") return "dark";
@@ -1331,7 +1334,8 @@ async function captureMyView(status, orgId, orgName) {
1331
1334
  method: "POST",
1332
1335
  credentials: "include",
1333
1336
  headers: { "X-Spec-Capture": "1" },
1334
- body: form
1337
+ body: form,
1338
+ signal: AbortSignal.timeout(1e4)
1335
1339
  });
1336
1340
  if (!res.ok) throw new Error(`capture ${res.status}: ${(await res.text()).slice(0, 160)}`);
1337
1341
  }
@@ -1364,8 +1368,9 @@ function SpecOverlayAction({ orgId, orgName } = {}) {
1364
1368
  const [frameKey, setFrameKey] = useState(0);
1365
1369
  const [copied, setCopied] = useState("idle");
1366
1370
  const href = useLocationHref();
1371
+ const automated = isAutomatedCaptureSession();
1367
1372
  useEffect(() => {
1368
- if (access) return;
1373
+ if (access || automated) return;
1369
1374
  let cancelled = false;
1370
1375
  specOverlayFetchJson("/api/overlay/access").then((data) => {
1371
1376
  if (cancelled) return;
@@ -1383,7 +1388,7 @@ function SpecOverlayAction({ orgId, orgName } = {}) {
1383
1388
  };
1384
1389
  }, [access]);
1385
1390
  useEffect(() => {
1386
- if (!access?.allowed || typeof window === "undefined") return;
1391
+ if (automated || !access?.allowed || typeof window === "undefined") return;
1387
1392
  const timer = window.setTimeout(() => {
1388
1393
  specOverlayFetchJson(specOverlayStatusPath()).then((data) => setStatus(data)).catch(() => setStatus(null));
1389
1394
  }, 300);
@@ -1414,13 +1419,13 @@ function SpecOverlayAction({ orgId, orgName } = {}) {
1414
1419
  }
1415
1420
  };
1416
1421
  useEffect(() => {
1417
- if (!open || !status || !status.matched) return;
1422
+ if (automated || !open || !status || !status.matched) return;
1418
1423
  void runCapture(status);
1419
1424
  return () => {
1420
1425
  captureRun.current++;
1421
1426
  };
1422
1427
  }, [open, status && status.matched ? status.target_id : null]);
1423
- if (!access?.allowed) return null;
1428
+ if (automated || !access?.allowed) return null;
1424
1429
  const badgeLabel = status && status.matched ? `${Math.round(status.mismatch_pct)}%` : status ? "\u2014" : void 0;
1425
1430
  const badgeTone = status && status.matched ? status.passed ? "default" : "danger" : "default";
1426
1431
  return /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -3432,5 +3437,5 @@ function NavAppShell({
3432
3437
  }
3433
3438
 
3434
3439
  export { BETA_BANNER_DISMISS_KEY, CAMPAIGN_FEATURE_AVAILABILITY, CORE_APP_ORIGIN, CORE_BILLING_PATH, FuelAction, NavAppShell, NavBetaBanner, NavChromeProvider, NavDisplayAction, NavSidebar, NavTabStrip, NavThemeControl, NavTopBar, NotificationsAction, SPECS_ORIGIN, SpecOverlayAction, SupportAction, TopBarCountBadge, TopBarPanelArrow, TopBarPopover, TopBarTooltip, TopBarWidgetSlot, clearBetaBannerDismissal, envChipClasses, isNavItemActive, resolveOrgLogoUrl, standardPolitogyNav, topBarIconButtonClass, useChromeMe, useChromeOrgs, useNavChromeFetcher, useThemePreference };
3435
- //# sourceMappingURL=chunk-XK2LWTHJ.js.map
3436
- //# sourceMappingURL=chunk-XK2LWTHJ.js.map
3440
+ //# sourceMappingURL=chunk-NRKRUM5B.js.map
3441
+ //# sourceMappingURL=chunk-NRKRUM5B.js.map