react-devbelt 0.4.0 → 0.5.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.
@@ -143,7 +143,7 @@ import {
143
143
  usePrimitive,
144
144
  valueMissingMessage,
145
145
  watchFormDisabled
146
- } from "./chunk-EYWS436C.js";
146
+ } from "./chunk-6FUPE5IB.js";
147
147
  import {
148
148
  useToolbar
149
149
  } from "./chunk-6TOYYHSR.js";
@@ -1215,16 +1215,21 @@ function installFetchLog() {
1215
1215
  let id = null;
1216
1216
  const startedAt = performance.now();
1217
1217
  try {
1218
- const request = new Request(input, init);
1218
+ const source = typeof Request !== "undefined" && input instanceof Request;
1219
+ const headers = new Headers(source ? input.headers : void 0);
1220
+ new Headers(init?.headers).forEach(
1221
+ (value, name) => headers.set(name, value)
1222
+ );
1223
+ const rawUrl = source ? input.url : input instanceof URL ? input.href : String(input);
1219
1224
  id = add({
1220
- method: request.method.toUpperCase(),
1221
- url: new URL(request.url, window.location.href).href,
1225
+ method: (init?.method ?? (source ? input.method : "GET")).toUpperCase(),
1226
+ url: new URL(rawUrl, window.location.href).href,
1222
1227
  status: null,
1223
1228
  startedAt: Date.now(),
1224
1229
  duration: null,
1225
1230
  pageUrl: window.location.href,
1226
1231
  viewport: describeViewport(),
1227
- requestHeaders: headersToRecord(request.headers),
1232
+ requestHeaders: headersToRecord(headers),
1228
1233
  // Only what the caller passed as `init.body` is read back; a Request
1229
1234
  // body is a stream and cannot be read without consuming it.
1230
1235
  requestBody: capInMemory(serializeBody(init?.body)),
@@ -6501,8 +6506,8 @@ function ViewportItem() {
6501
6506
  /* @__PURE__ */ jsxs13(
6502
6507
  TooltipTrigger,
6503
6508
  {
6504
- render: /* @__PURE__ */ jsx24(Toggle, { value: v.id }),
6505
- className: `${toolbarItemClass} px-3 data-pressed:text-fg-inverse data-pressed:hover:bg-transparent`,
6509
+ render: /* @__PURE__ */ jsx24(Toggle, { value: v.id, "aria-label": v.label }),
6510
+ className: `${toolbarItemClass} px-3 max-sm:px-1.5 data-pressed:text-fg-inverse data-pressed:[&_svg]:text-fg-inverse! data-pressed:hover:bg-transparent`,
6506
6511
  children: [
6507
6512
  v.id === activeId ? /* @__PURE__ */ jsx24(
6508
6513
  motion3.span,
@@ -6513,7 +6518,8 @@ function ViewportItem() {
6513
6518
  className: "pointer-events-none absolute inset-0 -z-10 rounded-full bg-inverse shadow-sm"
6514
6519
  }
6515
6520
  ) : null,
6516
- v.label
6521
+ /* @__PURE__ */ jsx24(ViewportGlyph, { id: v.id, className: "size-4 sm:hidden" }),
6522
+ /* @__PURE__ */ jsx24("span", { className: "max-sm:hidden", children: v.label })
6517
6523
  ]
6518
6524
  }
6519
6525
  ),
@@ -6601,6 +6607,10 @@ var VIEWPORT_ICONS = {
6601
6607
  pc: MonitorIcon,
6602
6608
  custom: RulerIcon
6603
6609
  };
6610
+ function ViewportGlyph({ id, className }) {
6611
+ const Icon = VIEWPORT_ICONS[id] ?? MonitorIcon;
6612
+ return /* @__PURE__ */ jsx24(Icon, { className, "aria-hidden": "true" });
6613
+ }
6604
6614
  function ViewportMenuSection() {
6605
6615
  const state3 = useViewportState();
6606
6616
  return /* @__PURE__ */ jsxs13(
@@ -8158,4 +8168,4 @@ export {
8158
8168
  storage,
8159
8169
  defaultPlugins
8160
8170
  };
8161
- //# sourceMappingURL=chunk-SYBN2CEO.js.map
8171
+ //# sourceMappingURL=chunk-AYUYZKKU.js.map