@crvouga/mockingbird-service-posthog 1.6.0 → 1.6.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-posthog
2
2
 
3
- ## 1.6.0 (2026-09-30)
3
+ ## 1.6.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.6.0 (2026-09-29)
4
12
 
5
13
  ### Features
6
14
 
@@ -2,7 +2,7 @@ import {
2
2
  ACME_FLAG_STATE,
3
3
  createRuntime,
4
4
  specsFromState
5
- } from "./chunk-2X5264I2.js";
5
+ } from "./chunk-F5TQPEXZ.js";
6
6
 
7
7
  // ../../adapters/node/dist/cli.js
8
8
  import { readFile } from "node:fs/promises";
@@ -357,4 +357,4 @@ export {
357
357
  createServer2 as createServer,
358
358
  serveTarget
359
359
  };
360
- //# sourceMappingURL=chunk-Q3FOVA2A.js.map
360
+ //# sourceMappingURL=chunk-3MHSTPMV.js.map
@@ -2122,6 +2122,50 @@ function bootAdmin(config) {
2122
2122
  if (render)
2123
2123
  await render();
2124
2124
  }
2125
+ const delay = (ms) => new Promise((resolve) => {
2126
+ window.setTimeout(resolve, ms);
2127
+ });
2128
+ const confirmAction = async (button, pending, done, work) => {
2129
+ if (button.dataset.pending === "1")
2130
+ return;
2131
+ const label = button.textContent ?? "";
2132
+ const width = button.offsetWidth;
2133
+ button.dataset.pending = "1";
2134
+ button.classList.add("pressed");
2135
+ button.setAttribute("aria-busy", "true");
2136
+ button.style.minWidth = `${width}px`;
2137
+ button.textContent = pending;
2138
+ try {
2139
+ await work();
2140
+ button.textContent = done;
2141
+ await delay(1e3);
2142
+ } catch (error2) {
2143
+ showError(error2);
2144
+ } finally {
2145
+ button.textContent = label;
2146
+ button.style.minWidth = "";
2147
+ button.classList.remove("pressed");
2148
+ button.removeAttribute("aria-busy");
2149
+ delete button.dataset.pending;
2150
+ }
2151
+ };
2152
+ document.addEventListener("click", (event) => {
2153
+ const target = event.target;
2154
+ if (!(target instanceof Element))
2155
+ return;
2156
+ const button = target.closest("button");
2157
+ if (!(button instanceof HTMLButtonElement) || button.dataset.pending === "1")
2158
+ return;
2159
+ button.classList.add("pressed");
2160
+ const token = String(Date.now());
2161
+ button.dataset.press = token;
2162
+ window.setTimeout(() => {
2163
+ if (button.dataset.press !== token || button.dataset.pending === "1")
2164
+ return;
2165
+ button.classList.remove("pressed");
2166
+ delete button.dataset.press;
2167
+ }, 450);
2168
+ });
2125
2169
  el("namespace", HTMLSelectElement).addEventListener("change", () => {
2126
2170
  state.namespace = el("namespace", HTMLSelectElement).value;
2127
2171
  refresh().catch(showError);
@@ -2132,7 +2176,7 @@ function bootAdmin(config) {
2132
2176
  refresh().catch(showError);
2133
2177
  });
2134
2178
  el("refresh", HTMLButtonElement).addEventListener("click", () => {
2135
- refresh().catch(showError);
2179
+ confirmAction(el("refresh", HTMLButtonElement), "Refreshing...", "Updated", () => refresh()).catch(showError);
2136
2180
  });
2137
2181
  el("collections", HTMLElement).addEventListener("click", (event) => {
2138
2182
  const target = event.target;
@@ -2255,10 +2299,10 @@ function bootAdmin(config) {
2255
2299
  }).then(() => renderFaults()).catch(showError);
2256
2300
  });
2257
2301
  el("fault-clear", HTMLButtonElement).addEventListener("click", () => {
2258
- api("DELETE", "/faults").then(() => renderFaults()).catch(showError);
2302
+ confirmAction(el("fault-clear", HTMLButtonElement), "Clearing...", "Cleared", () => api("DELETE", "/faults").then(() => renderFaults())).catch(showError);
2259
2303
  });
2260
2304
  el("journal-clear", HTMLButtonElement).addEventListener("click", () => {
2261
- api("DELETE", "/requests").then(() => renderJournal()).catch(showError);
2305
+ confirmAction(el("journal-clear", HTMLButtonElement), "Clearing...", "Cleared", () => api("DELETE", "/requests").then(() => renderJournal())).catch(showError);
2262
2306
  });
2263
2307
  el("route-list", HTMLElement).addEventListener("click", (event) => {
2264
2308
  const target = event.target;
@@ -2373,9 +2417,13 @@ function bootAdmin(config) {
2373
2417
  var clientPrelude = [isRecord2, mountAdminBrand, startAdminBrand, faultPresetList, bootAdmin].map((fn) => fn.toString()).join("\n");
2374
2418
  var adminClientSource = (config) => {
2375
2419
  const payload = JSON.stringify(config).replace(/</g, "\\u003c");
2420
+ const entry = bootAdmin.name;
2421
+ if (!/^[A-Za-z_$][\w$]*$/.test(entry)) {
2422
+ throw new Error("admin client cannot call its boot function");
2423
+ }
2376
2424
  return `<script>
2377
2425
  ${clientPrelude}
2378
- bootAdmin(${payload});
2426
+ ${entry}(${payload});
2379
2427
  </script>`;
2380
2428
  };
2381
2429
 
@@ -2589,9 +2637,24 @@ var renderAdminDocument = (service) => {
2589
2637
  .controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
2590
2638
  label.field { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--faint); }
2591
2639
  label.field input, label.field select, .controls input[type="password"] {
2592
- background: var(--bg-inset); border: 1px solid var(--line); border-radius: 8px;
2593
- padding: 7px 8px; min-height: 36px;
2594
- }
2640
+ background-color: var(--bg-inset); border: 1px solid var(--line); border-radius: 8px;
2641
+ padding: 7px 8px; min-height: 36px; line-height: 1.2;
2642
+ }
2643
+ /* A native menu ignores min-height, so Preset rendered about half as tall as
2644
+ the text fields in the same form. Paint it like those fields. */
2645
+ label.field select {
2646
+ -webkit-appearance: none; appearance: none;
2647
+ padding-right: 28px;
2648
+ 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");
2649
+ background-repeat: no-repeat; background-position: right 10px center; background-size: 12px 12px;
2650
+ }
2651
+ .stack > .field > input,
2652
+ .stack > .field > select,
2653
+ .stack > .field > textarea,
2654
+ dialog .field > input,
2655
+ dialog .field > select,
2656
+ dialog .field > textarea { width: 100%; }
2657
+ .icon-btn, .btn, .btn-primary, .btn-quiet, .btn-danger, nav.side button { cursor: pointer; }
2595
2658
  .icon-btn, .btn, .btn-primary, .btn-quiet, .btn-danger {
2596
2659
  border-radius: 9px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line);
2597
2660
  background: var(--bg-elev);
@@ -2599,6 +2662,14 @@ var renderAdminDocument = (service) => {
2599
2662
  .btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
2600
2663
  .btn-quiet { background: transparent; }
2601
2664
  .btn-danger { color: var(--err); }
2665
+ /* Held after mouseup. Clearing an empty journal changes nothing on screen,
2666
+ so the press itself has to stay visible. */
2667
+ .icon-btn:active, .btn:active, .btn-quiet:active, .btn-danger:active, nav.side button:active,
2668
+ .icon-btn.pressed, .btn.pressed, .btn-quiet.pressed, .btn-danger.pressed, nav.side button.pressed {
2669
+ background: var(--bg-inset); border-color: var(--line-strong); color: var(--ink);
2670
+ }
2671
+ .btn-danger:active, .btn-danger.pressed { background: var(--err-soft); color: var(--err); }
2672
+ .btn-primary:active, .btn-primary.pressed { filter: brightness(0.88); color: var(--accent-ink); }
2602
2673
  /* minmax(0, 1fr): a 1fr column will not shrink below its content, so a long
2603
2674
  record or the full nav row would widen the page past the viewport. */
2604
2675
  .layout {
@@ -2687,8 +2758,16 @@ var renderAdminDocument = (service) => {
2687
2758
  input, select, textarea { font-size: 16px; }
2688
2759
  .brand, .vendor, .controls { width: 100%; }
2689
2760
  label.field, label.field select, label.field input { flex: 1; min-width: 0; }
2690
- .layout { grid-template-columns: minmax(0, 1fr); }
2761
+ /* The layout fills the screen. A single-column grid stretches every auto
2762
+ row, so the tab bar grew with the leftover height and the buttons floated
2763
+ in the middle of it. The bar stays one row; the page below takes the rest. */
2764
+ .layout {
2765
+ grid-template-columns: minmax(0, 1fr);
2766
+ grid-template-rows: auto minmax(0, 1fr);
2767
+ align-content: start;
2768
+ }
2691
2769
  nav.side {
2770
+ align-self: start; height: auto;
2692
2771
  flex-direction: row; align-items: center; overflow-x: auto; min-width: 0;
2693
2772
  border-right: 0; border-bottom: 1px solid var(--line);
2694
2773
  padding: 8px;
@@ -3482,7 +3561,7 @@ var stateAdminRoutes = (routes) => {
3482
3561
  };
3483
3562
 
3484
3563
  // ../core/dist/version.js
3485
- var PACKAGE_VERSION = true ? "1.6.0" : UNRELEASED_VERSION;
3564
+ var PACKAGE_VERSION = true ? "1.6.1" : UNRELEASED_VERSION;
3486
3565
 
3487
3566
  // ../core/dist/signing.js
3488
3567
  var encoder = new TextEncoder();
@@ -5153,4 +5232,4 @@ export {
5153
5232
  scrubProperties,
5154
5233
  PostHogAPI
5155
5234
  };
5156
- //# sourceMappingURL=chunk-2X5264I2.js.map
5235
+ //# sourceMappingURL=chunk-F5TQPEXZ.js.map