@aperture-browser/session-react 0.0.0-nightly.133.2b928e99e576 → 0.0.0-nightly.134.a2b44bc33726

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
@@ -28,6 +28,7 @@ import "@base-ui/react/separator";
28
28
  import { Menu } from "@base-ui/react/menu";
29
29
  import { Avatar } from "@base-ui/react/avatar";
30
30
  import { Popover } from "@base-ui/react/popover";
31
+ import * as UrlPath from "@aperture-browser/api-client/url-path";
31
32
  import { mergeProps } from "@base-ui/react/merge-props";
32
33
  import { useRender } from "@base-ui/react/use-render";
33
34
  //#region ../ui/src/utils.ts
@@ -2060,7 +2061,7 @@ function ParticipantAvatar({ participant, following }) {
2060
2061
  });
2061
2062
  }
2062
2063
  function gravatarURL(hash) {
2063
- return `https://www.gravatar.com/avatar/${encodeURIComponent(hash)}?d=identicon&s=64`;
2064
+ return UrlPath.make`https://www.gravatar.com/avatar/${hash}?d=identicon&s=64`;
2064
2065
  }
2065
2066
  function initials(name) {
2066
2067
  return name.split(/\s+/).slice(0, 2).map((part) => part[0]?.toUpperCase() ?? "").join("");
@@ -2265,7 +2266,7 @@ function normalizeUrl(value) {
2265
2266
  if (isLocalHost(trimmed)) return `http://${trimmed}`;
2266
2267
  if (/^[a-z][a-z0-9+.-]*:\/\//i.test(trimmed) || /^(about|chrome|devtools|data|file):/i.test(trimmed)) return trimmed;
2267
2268
  if (isLikelyHost(trimmed)) return `https://${trimmed}`;
2268
- return `https://www.google.com/search?q=${encodeURIComponent(trimmed)}`;
2269
+ return UrlPath.make`https://www.google.com/search?q=${trimmed}`;
2269
2270
  }
2270
2271
  function isLocalHost(value) {
2271
2272
  return /^localhost(?::\d+)?(?:[/?#].*)?$/i.test(value) || /^127(?:\.\d{1,3}){3}(?::\d+)?(?:[/?#].*)?$/.test(value) || /^[a-z0-9-]+:\d+(?:[/?#].*)?$/i.test(value);
@@ -2383,7 +2384,7 @@ function BrowserDevToolsPane({ cdpUrl, targetId }) {
2383
2384
  const cdp = new URL(cdpUrl);
2384
2385
  const cdpPath = cdp.pathname.replace(/\/$/, "");
2385
2386
  const frame = new URL(`${cdpPath}/devtools/devtools_app.html`, cdp.origin);
2386
- const socket = `${cdp.host}${cdpPath}/devtools/page/${encodeURIComponent(targetId)}`;
2387
+ const socket = UrlPath.make`${UrlPath.raw(cdp.host)}${UrlPath.raw(cdpPath)}/devtools/page/${targetId}`;
2387
2388
  frame.searchParams.set(cdp.protocol === "https:" ? "wss" : "ws", socket);
2388
2389
  return frame.toString();
2389
2390
  }, [cdpUrl, targetId]);
@@ -2637,7 +2638,7 @@ function Session({ access, features, leading, trailing, toolbarLeading, toolbarT
2637
2638
  function devToolsUrl(origin, cdpUrl, sessionToken) {
2638
2639
  const sourceUrl = new URL(cdpUrl, origin);
2639
2640
  const url = new URL(origin);
2640
- url.pathname = `${sourceUrl.pathname.replace(/\/$/, "")}/${encodeURIComponent(sessionToken)}`;
2641
+ url.pathname = UrlPath.make`${UrlPath.raw(sourceUrl.pathname.replace(/\/$/, ""))}/${sessionToken}`;
2641
2642
  return url.toString();
2642
2643
  }
2643
2644
  function SessionState({ icon, title, description }) {