@crvouga/mockingbird-service-oauth 1.9.0 → 1.9.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.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,14 @@
1
1
  # Changelog — @crvouga/mockingbird-service-oauth
2
2
 
3
- ## 1.9.0 (2026-09-30)
3
+ ## 1.9.1 (2026-09-30)
4
+
5
+ ### Fixes and improvements
6
+
7
+ - keep admin buttons pressed until the action finishes ([0aabfcb](https://github.com/crvouga/mockingbird/commit/0aabfcb5f392aa51e193f9c3f817d5877d92bc6a))
8
+ - size admin select fields like the text inputs beside them ([0fb3ef2](https://github.com/crvouga/mockingbird/commit/0fb3ef2ddbf43376c93a2ae6d87c6c9bf890dafc))
9
+ - keep admin section tabs wired when boot is renamed ([4eda25e](https://github.com/crvouga/mockingbird/commit/4eda25eacd59da048d196f7cc8369d7a02b47bfc))
10
+
11
+ ## 1.9.0 (2026-09-29)
4
12
 
5
13
  ### Features
6
14
 
@@ -2,7 +2,7 @@ import {
2
2
  OAUTH_SCENARIOS,
3
3
  createMultiRuntime,
4
4
  createRuntime
5
- } from "./chunk-Y3AP4ZFX.js";
5
+ } from "./chunk-XQNANV2C.js";
6
6
 
7
7
  // src/server.ts
8
8
  import { readFile as readFile2 } from "node:fs/promises";
@@ -379,4 +379,4 @@ export {
379
379
  createMultiServer,
380
380
  serveTarget
381
381
  };
382
- //# sourceMappingURL=chunk-YV7MW5YZ.js.map
382
+ //# sourceMappingURL=chunk-FDLQK4NK.js.map
@@ -1887,6 +1887,50 @@ function bootAdmin(config) {
1887
1887
  if (render)
1888
1888
  await render();
1889
1889
  }
1890
+ const delay = (ms) => new Promise((resolve) => {
1891
+ window.setTimeout(resolve, ms);
1892
+ });
1893
+ const confirmAction = async (button, pending, done, work) => {
1894
+ if (button.dataset.pending === "1")
1895
+ return;
1896
+ const label = button.textContent ?? "";
1897
+ const width = button.offsetWidth;
1898
+ button.dataset.pending = "1";
1899
+ button.classList.add("pressed");
1900
+ button.setAttribute("aria-busy", "true");
1901
+ button.style.minWidth = `${width}px`;
1902
+ button.textContent = pending;
1903
+ try {
1904
+ await work();
1905
+ button.textContent = done;
1906
+ await delay(1e3);
1907
+ } catch (error) {
1908
+ showError(error);
1909
+ } finally {
1910
+ button.textContent = label;
1911
+ button.style.minWidth = "";
1912
+ button.classList.remove("pressed");
1913
+ button.removeAttribute("aria-busy");
1914
+ delete button.dataset.pending;
1915
+ }
1916
+ };
1917
+ document.addEventListener("click", (event) => {
1918
+ const target = event.target;
1919
+ if (!(target instanceof Element))
1920
+ return;
1921
+ const button = target.closest("button");
1922
+ if (!(button instanceof HTMLButtonElement) || button.dataset.pending === "1")
1923
+ return;
1924
+ button.classList.add("pressed");
1925
+ const token = String(Date.now());
1926
+ button.dataset.press = token;
1927
+ window.setTimeout(() => {
1928
+ if (button.dataset.press !== token || button.dataset.pending === "1")
1929
+ return;
1930
+ button.classList.remove("pressed");
1931
+ delete button.dataset.press;
1932
+ }, 450);
1933
+ });
1890
1934
  el("namespace", HTMLSelectElement).addEventListener("change", () => {
1891
1935
  state.namespace = el("namespace", HTMLSelectElement).value;
1892
1936
  refresh().catch(showError);
@@ -1897,7 +1941,7 @@ function bootAdmin(config) {
1897
1941
  refresh().catch(showError);
1898
1942
  });
1899
1943
  el("refresh", HTMLButtonElement).addEventListener("click", () => {
1900
- refresh().catch(showError);
1944
+ confirmAction(el("refresh", HTMLButtonElement), "Refreshing...", "Updated", () => refresh()).catch(showError);
1901
1945
  });
1902
1946
  el("collections", HTMLElement).addEventListener("click", (event) => {
1903
1947
  const target = event.target;
@@ -2020,10 +2064,10 @@ function bootAdmin(config) {
2020
2064
  }).then(() => renderFaults()).catch(showError);
2021
2065
  });
2022
2066
  el("fault-clear", HTMLButtonElement).addEventListener("click", () => {
2023
- api("DELETE", "/faults").then(() => renderFaults()).catch(showError);
2067
+ confirmAction(el("fault-clear", HTMLButtonElement), "Clearing...", "Cleared", () => api("DELETE", "/faults").then(() => renderFaults())).catch(showError);
2024
2068
  });
2025
2069
  el("journal-clear", HTMLButtonElement).addEventListener("click", () => {
2026
- api("DELETE", "/requests").then(() => renderJournal()).catch(showError);
2070
+ confirmAction(el("journal-clear", HTMLButtonElement), "Clearing...", "Cleared", () => api("DELETE", "/requests").then(() => renderJournal())).catch(showError);
2027
2071
  });
2028
2072
  el("route-list", HTMLElement).addEventListener("click", (event) => {
2029
2073
  const target = event.target;
@@ -2138,9 +2182,13 @@ function bootAdmin(config) {
2138
2182
  var clientPrelude = [isRecord2, mountAdminBrand, startAdminBrand, faultPresetList, bootAdmin].map((fn) => fn.toString()).join("\n");
2139
2183
  var adminClientSource = (config) => {
2140
2184
  const payload = JSON.stringify(config).replace(/</g, "\\u003c");
2185
+ const entry = bootAdmin.name;
2186
+ if (!/^[A-Za-z_$][\w$]*$/.test(entry)) {
2187
+ throw new Error("admin client cannot call its boot function");
2188
+ }
2141
2189
  return `<script>
2142
2190
  ${clientPrelude}
2143
- bootAdmin(${payload});
2191
+ ${entry}(${payload});
2144
2192
  </script>`;
2145
2193
  };
2146
2194
 
@@ -2354,9 +2402,24 @@ var renderAdminDocument = (service) => {
2354
2402
  .controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
2355
2403
  label.field { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--faint); }
2356
2404
  label.field input, label.field select, .controls input[type="password"] {
2357
- background: var(--bg-inset); border: 1px solid var(--line); border-radius: 8px;
2358
- padding: 7px 8px; min-height: 36px;
2359
- }
2405
+ background-color: var(--bg-inset); border: 1px solid var(--line); border-radius: 8px;
2406
+ padding: 7px 8px; min-height: 36px; line-height: 1.2;
2407
+ }
2408
+ /* A native menu ignores min-height, so Preset rendered about half as tall as
2409
+ the text fields in the same form. Paint it like those fields. */
2410
+ label.field select {
2411
+ -webkit-appearance: none; appearance: none;
2412
+ padding-right: 28px;
2413
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%2371717a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M2.5 4.5 6 8l3.5-3.5'/%3E%3C/svg%3E");
2414
+ background-repeat: no-repeat; background-position: right 10px center; background-size: 12px 12px;
2415
+ }
2416
+ .stack > .field > input,
2417
+ .stack > .field > select,
2418
+ .stack > .field > textarea,
2419
+ dialog .field > input,
2420
+ dialog .field > select,
2421
+ dialog .field > textarea { width: 100%; }
2422
+ .icon-btn, .btn, .btn-primary, .btn-quiet, .btn-danger, nav.side button { cursor: pointer; }
2360
2423
  .icon-btn, .btn, .btn-primary, .btn-quiet, .btn-danger {
2361
2424
  border-radius: 9px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line);
2362
2425
  background: var(--bg-elev);
@@ -2364,6 +2427,14 @@ var renderAdminDocument = (service) => {
2364
2427
  .btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
2365
2428
  .btn-quiet { background: transparent; }
2366
2429
  .btn-danger { color: var(--err); }
2430
+ /* Held after mouseup. Clearing an empty journal changes nothing on screen,
2431
+ so the press itself has to stay visible. */
2432
+ .icon-btn:active, .btn:active, .btn-quiet:active, .btn-danger:active, nav.side button:active,
2433
+ .icon-btn.pressed, .btn.pressed, .btn-quiet.pressed, .btn-danger.pressed, nav.side button.pressed {
2434
+ background: var(--bg-inset); border-color: var(--line-strong); color: var(--ink);
2435
+ }
2436
+ .btn-danger:active, .btn-danger.pressed { background: var(--err-soft); color: var(--err); }
2437
+ .btn-primary:active, .btn-primary.pressed { filter: brightness(0.88); color: var(--accent-ink); }
2367
2438
  /* minmax(0, 1fr): a 1fr column will not shrink below its content, so a long
2368
2439
  record or the full nav row would widen the page past the viewport. */
2369
2440
  .layout {
@@ -2452,8 +2523,16 @@ var renderAdminDocument = (service) => {
2452
2523
  input, select, textarea { font-size: 16px; }
2453
2524
  .brand, .vendor, .controls { width: 100%; }
2454
2525
  label.field, label.field select, label.field input { flex: 1; min-width: 0; }
2455
- .layout { grid-template-columns: minmax(0, 1fr); }
2526
+ /* The layout fills the screen. A single-column grid stretches every auto
2527
+ row, so the tab bar grew with the leftover height and the buttons floated
2528
+ in the middle of it. The bar stays one row; the page below takes the rest. */
2529
+ .layout {
2530
+ grid-template-columns: minmax(0, 1fr);
2531
+ grid-template-rows: auto minmax(0, 1fr);
2532
+ align-content: start;
2533
+ }
2456
2534
  nav.side {
2535
+ align-self: start; height: auto;
2457
2536
  flex-direction: row; align-items: center; overflow-x: auto; min-width: 0;
2458
2537
  border-right: 0; border-bottom: 1px solid var(--line);
2459
2538
  padding: 8px;
@@ -3551,7 +3630,7 @@ var stateAdminRoutes = (routes) => {
3551
3630
  };
3552
3631
 
3553
3632
  // ../core/dist/version.js
3554
- var PACKAGE_VERSION = true ? "1.9.0" : UNRELEASED_VERSION;
3633
+ var PACKAGE_VERSION = true ? "1.9.1" : UNRELEASED_VERSION;
3555
3634
 
3556
3635
  // ../core/dist/webhooks.js
3557
3636
  var json4 = (status, body) => new Response(JSON.stringify(body), { status, headers: { "content-type": "application/json" } });
@@ -6164,4 +6243,4 @@ export {
6164
6243
  createMultiRuntime,
6165
6244
  OAuthAPI
6166
6245
  };
6167
- //# sourceMappingURL=chunk-Y3AP4ZFX.js.map
6246
+ //# sourceMappingURL=chunk-XQNANV2C.js.map