@tollbooth-dpyc/web 1.7.0 → 1.7.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.
@@ -14,8 +14,8 @@
14
14
  * Touch-first: every control is a real button at least 40px square, nothing
15
15
  * hides behind hover, and the page under the bar stays tappable.
16
16
  *
17
- * The panel keeps its own space: beside the fixed bar it renders an in-flow
18
- * spacer as tall as the bar is right now (collapsed or open, measured with a
17
+ * While open, the panel keeps its own space: beside the fixed bar it renders
18
+ * an in-flow spacer as tall as the log is right now (measured with a
19
19
  * ResizeObserver) plus the iOS safe-area inset, so the page's last line can
20
20
  * always scroll clear of it. Mount it LAST in the app shell so that spacer is
21
21
  * the last thing in the page's flow.
@@ -15,8 +15,8 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
15
15
  * Touch-first: every control is a real button at least 40px square, nothing
16
16
  * hides behind hover, and the page under the bar stays tappable.
17
17
  *
18
- * The panel keeps its own space: beside the fixed bar it renders an in-flow
19
- * spacer as tall as the bar is right now (collapsed or open, measured with a
18
+ * While open, the panel keeps its own space: beside the fixed bar it renders
19
+ * an in-flow spacer as tall as the log is right now (measured with a
20
20
  * ResizeObserver) plus the iOS safe-area inset, so the page's last line can
21
21
  * always scroll clear of it. Mount it LAST in the app shell so that spacer is
22
22
  * the last thing in the page's flow.
@@ -25,7 +25,7 @@ import { useEffect, useRef, useState } from "react";
25
25
  import { onProofExpired } from "../client.js";
26
26
  import { captureGlobalErrors, clearDebug, debugLogText, debugPush, debugSeverity, } from "../debugLog.js";
27
27
  import { readStored, writeStored } from "../storage.js";
28
- import { debugSpacerHeight, debugSpacerPx } from "./debugSpacer.js";
28
+ import { debugSpacerPx, debugSpacerRoom } from "./debugSpacer.js";
29
29
  import { useDebugLog } from "./useDebugLog.js";
30
30
  const OPEN_KEY = "debug-open";
31
31
  const TYPE_INK = {
@@ -100,7 +100,7 @@ export default function DebugPanel({ title = "Debug", defaultOpen = false, captu
100
100
  : notices > 0
101
101
  ? "bg-[var(--tb-notice-bg)] text-[var(--tb-notice-ink)] border-[var(--tb-notice-line)]"
102
102
  : "bg-[var(--tb-surface-2)] text-[var(--tb-ink)] border-[var(--tb-line)]";
103
- return (_jsxs(_Fragment, { children: [_jsx("div", { "aria-hidden": "true", "data-tb-debug-spacer": "", style: { height: debugSpacerHeight(barHeight), flexShrink: 0 } }), _jsxs("div", { ref: barRef, className: "pointer-events-none fixed inset-x-0 bottom-0 z-50 flex flex-col items-end", children: [_jsxs("div", { className: "pointer-events-auto flex flex-wrap justify-end gap-1 pr-3", children: [open && (_jsxs(_Fragment, { children: [_jsx("button", { type: "button", onClick: copy, className: plainTab, "aria-label": "Copy the whole log", children: copied === "ok" ? "Copied" : copied === "failed" ? "Copy failed" : "Copy" }), _jsx("button", { type: "button", onClick: clearDebug, className: plainTab, children: "Clear" })] })), _jsxs("button", { type: "button", onClick: toggle, "aria-expanded": open, className: `${tab} ${toggleTone}`, children: [open ? "Hide" : title, " (", log.length, failures > 0 ? ` · ${failures} err` : "", notices > 0 ? ` · ${notices} notice` : "", ")"] })] }), open && (_jsxs("div", { className: "pointer-events-auto max-h-[40vh] w-full overflow-y-auto border-t border-[var(--tb-line)] bg-[var(--tb-surface)] p-3 font-mono text-xs text-[var(--tb-ink)]", children: [children && _jsx("div", { className: "mb-2 border-b border-[var(--tb-line)] pb-2 font-sans", children: children }), log.length === 0 && _jsx("div", { className: "text-[var(--tb-muted)]", children: "No MCP activity yet." }), log.map((entry, i) => {
103
+ return (_jsxs(_Fragment, { children: [_jsx("div", { "aria-hidden": "true", "data-tb-debug-spacer": "", style: { height: debugSpacerRoom(open, barHeight), flexShrink: 0 } }), _jsxs("div", { ref: barRef, className: "pointer-events-none fixed inset-x-0 bottom-0 z-50 flex flex-col items-end", children: [_jsxs("div", { className: "pointer-events-auto flex flex-wrap justify-end gap-1 pr-3", children: [open && (_jsxs(_Fragment, { children: [_jsx("button", { type: "button", onClick: copy, className: plainTab, "aria-label": "Copy the whole log", children: copied === "ok" ? "Copied" : copied === "failed" ? "Copy failed" : "Copy" }), _jsx("button", { type: "button", onClick: clearDebug, className: plainTab, children: "Clear" })] })), _jsxs("button", { type: "button", onClick: toggle, "aria-expanded": open, className: `${tab} ${toggleTone}`, children: [open ? "Hide" : title, " (", log.length, failures > 0 ? ` · ${failures} err` : "", notices > 0 ? ` · ${notices} notice` : "", ")"] })] }), open && (_jsxs("div", { className: "pointer-events-auto max-h-[40vh] w-full overflow-y-auto border-t border-[var(--tb-line)] bg-[var(--tb-surface)] p-3 font-mono text-xs text-[var(--tb-ink)]", children: [children && _jsx("div", { className: "mb-2 border-b border-[var(--tb-line)] pb-2 font-sans", children: children }), log.length === 0 && _jsx("div", { className: "text-[var(--tb-muted)]", children: "No MCP activity yet." }), log.map((entry, i) => {
104
104
  const sev = debugSeverity(entry);
105
105
  const flag = sev === "ok" ? null : FLAGGED[sev];
106
106
  return (_jsxs("div", { className: `-mx-1 flex gap-2 rounded px-1 py-0.5 ${flag?.row ?? ""}`, children: [_jsx("span", { className: "shrink-0 text-[var(--tb-muted)]", children: entry.ts }), _jsxs("span", { className: `w-14 shrink-0 ${flag?.ink ?? TYPE_INK[entry.type]}`, children: [sev === "notice" ? "notice" : entry.type, sev === "failure" && entry.type !== "error" ? " !" : ""] }), _jsx("span", { className: `min-w-0 break-all ${flag?.ink ?? ""}`, children: entry.message })] }, log.length - i));
@@ -1,11 +1,13 @@
1
1
  /**
2
- * The room the DebugPanel keeps for itself.
2
+ * The room the DebugPanel keeps for itself — only while its log is open.
3
3
  *
4
- * The panel is fixed to the bottom of the viewport, so on its own it would sit
5
- * over whatever the page puts last — on a phone, a loading quote or a Save
6
- * button. Beside it the panel renders an in-flow spacer as tall as the panel is
7
- * right now (the collapsed tab, or the open log), plus the iOS home-indicator
8
- * inset, so the page can always scroll its last line clear of the bar.
4
+ * The panel is fixed to the bottom of the viewport. Collapsed, it is one small
5
+ * tab in the corner and overlays the page: an in-flow spacer for it stole a
6
+ * whole row from every screen (owner, 2026-09-27: "we want an overlay and not
7
+ * a row stealer"). Open, the log is tall and would hide whatever the page puts
8
+ * last — a Save button, a loading quote — so then, and only then, the panel
9
+ * renders an in-flow spacer as tall as it is, plus the iOS home-indicator
10
+ * inset, so the page can scroll its last line clear.
9
11
  */
10
12
  /** The collapsed tab: one `min-h-10` (2.5rem) button. Used until measured. */
11
13
  export declare const DEBUG_BAR_PX = 40;
@@ -13,3 +15,5 @@ export declare const DEBUG_BAR_PX = 40;
13
15
  export declare function debugSpacerPx(measured: number | null | undefined): number;
14
16
  /** The spacer's CSS height: the panel's height plus the safe-area inset. */
15
17
  export declare function debugSpacerHeight(measured: number | null | undefined): string;
18
+ /** What the spacer takes: nothing while the panel is collapsed, its height while open. */
19
+ export declare function debugSpacerRoom(open: boolean, measured: number | null | undefined): string;
@@ -1,11 +1,13 @@
1
1
  /**
2
- * The room the DebugPanel keeps for itself.
2
+ * The room the DebugPanel keeps for itself — only while its log is open.
3
3
  *
4
- * The panel is fixed to the bottom of the viewport, so on its own it would sit
5
- * over whatever the page puts last — on a phone, a loading quote or a Save
6
- * button. Beside it the panel renders an in-flow spacer as tall as the panel is
7
- * right now (the collapsed tab, or the open log), plus the iOS home-indicator
8
- * inset, so the page can always scroll its last line clear of the bar.
4
+ * The panel is fixed to the bottom of the viewport. Collapsed, it is one small
5
+ * tab in the corner and overlays the page: an in-flow spacer for it stole a
6
+ * whole row from every screen (owner, 2026-09-27: "we want an overlay and not
7
+ * a row stealer"). Open, the log is tall and would hide whatever the page puts
8
+ * last — a Save button, a loading quote — so then, and only then, the panel
9
+ * renders an in-flow spacer as tall as it is, plus the iOS home-indicator
10
+ * inset, so the page can scroll its last line clear.
9
11
  */
10
12
  /** The collapsed tab: one `min-h-10` (2.5rem) button. Used until measured. */
11
13
  export const DEBUG_BAR_PX = 40;
@@ -19,3 +21,7 @@ export function debugSpacerPx(measured) {
19
21
  export function debugSpacerHeight(measured) {
20
22
  return `calc(${debugSpacerPx(measured)}px + env(safe-area-inset-bottom, 0px))`;
21
23
  }
24
+ /** What the spacer takes: nothing while the panel is collapsed, its height while open. */
25
+ export function debugSpacerRoom(open, measured) {
26
+ return open ? debugSpacerHeight(measured) : "0px";
27
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tollbooth-dpyc/web",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "description": "Shared browser SDK for Tollbooth DPYC operator front ends: npub sign-in, proofs, MCP client, profile and wallet",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Lonnie VanZandt",