@crvouga/mockingbird-service-customerio 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-customerio
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
 
@@ -2400,6 +2400,50 @@ function bootAdmin(config) {
2400
2400
  if (render)
2401
2401
  await render();
2402
2402
  }
2403
+ const delay = (ms) => new Promise((resolve) => {
2404
+ window.setTimeout(resolve, ms);
2405
+ });
2406
+ const confirmAction = async (button, pending, done, work) => {
2407
+ if (button.dataset.pending === "1")
2408
+ return;
2409
+ const label = button.textContent ?? "";
2410
+ const width = button.offsetWidth;
2411
+ button.dataset.pending = "1";
2412
+ button.classList.add("pressed");
2413
+ button.setAttribute("aria-busy", "true");
2414
+ button.style.minWidth = `${width}px`;
2415
+ button.textContent = pending;
2416
+ try {
2417
+ await work();
2418
+ button.textContent = done;
2419
+ await delay(1e3);
2420
+ } catch (error) {
2421
+ showError(error);
2422
+ } finally {
2423
+ button.textContent = label;
2424
+ button.style.minWidth = "";
2425
+ button.classList.remove("pressed");
2426
+ button.removeAttribute("aria-busy");
2427
+ delete button.dataset.pending;
2428
+ }
2429
+ };
2430
+ document.addEventListener("click", (event) => {
2431
+ const target = event.target;
2432
+ if (!(target instanceof Element))
2433
+ return;
2434
+ const button = target.closest("button");
2435
+ if (!(button instanceof HTMLButtonElement) || button.dataset.pending === "1")
2436
+ return;
2437
+ button.classList.add("pressed");
2438
+ const token = String(Date.now());
2439
+ button.dataset.press = token;
2440
+ window.setTimeout(() => {
2441
+ if (button.dataset.press !== token || button.dataset.pending === "1")
2442
+ return;
2443
+ button.classList.remove("pressed");
2444
+ delete button.dataset.press;
2445
+ }, 450);
2446
+ });
2403
2447
  el("namespace", HTMLSelectElement).addEventListener("change", () => {
2404
2448
  state.namespace = el("namespace", HTMLSelectElement).value;
2405
2449
  refresh().catch(showError);
@@ -2410,7 +2454,7 @@ function bootAdmin(config) {
2410
2454
  refresh().catch(showError);
2411
2455
  });
2412
2456
  el("refresh", HTMLButtonElement).addEventListener("click", () => {
2413
- refresh().catch(showError);
2457
+ confirmAction(el("refresh", HTMLButtonElement), "Refreshing...", "Updated", () => refresh()).catch(showError);
2414
2458
  });
2415
2459
  el("collections", HTMLElement).addEventListener("click", (event) => {
2416
2460
  const target = event.target;
@@ -2533,10 +2577,10 @@ function bootAdmin(config) {
2533
2577
  }).then(() => renderFaults()).catch(showError);
2534
2578
  });
2535
2579
  el("fault-clear", HTMLButtonElement).addEventListener("click", () => {
2536
- api("DELETE", "/faults").then(() => renderFaults()).catch(showError);
2580
+ confirmAction(el("fault-clear", HTMLButtonElement), "Clearing...", "Cleared", () => api("DELETE", "/faults").then(() => renderFaults())).catch(showError);
2537
2581
  });
2538
2582
  el("journal-clear", HTMLButtonElement).addEventListener("click", () => {
2539
- api("DELETE", "/requests").then(() => renderJournal()).catch(showError);
2583
+ confirmAction(el("journal-clear", HTMLButtonElement), "Clearing...", "Cleared", () => api("DELETE", "/requests").then(() => renderJournal())).catch(showError);
2540
2584
  });
2541
2585
  el("route-list", HTMLElement).addEventListener("click", (event) => {
2542
2586
  const target = event.target;
@@ -2651,9 +2695,13 @@ function bootAdmin(config) {
2651
2695
  var clientPrelude = [isRecord2, mountAdminBrand, startAdminBrand, faultPresetList, bootAdmin].map((fn) => fn.toString()).join("\n");
2652
2696
  var adminClientSource = (config) => {
2653
2697
  const payload = JSON.stringify(config).replace(/</g, "\\u003c");
2698
+ const entry = bootAdmin.name;
2699
+ if (!/^[A-Za-z_$][\w$]*$/.test(entry)) {
2700
+ throw new Error("admin client cannot call its boot function");
2701
+ }
2654
2702
  return `<script>
2655
2703
  ${clientPrelude}
2656
- bootAdmin(${payload});
2704
+ ${entry}(${payload});
2657
2705
  </script>`;
2658
2706
  };
2659
2707
 
@@ -2867,9 +2915,24 @@ var renderAdminDocument = (service) => {
2867
2915
  .controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
2868
2916
  label.field { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--faint); }
2869
2917
  label.field input, label.field select, .controls input[type="password"] {
2870
- background: var(--bg-inset); border: 1px solid var(--line); border-radius: 8px;
2871
- padding: 7px 8px; min-height: 36px;
2872
- }
2918
+ background-color: var(--bg-inset); border: 1px solid var(--line); border-radius: 8px;
2919
+ padding: 7px 8px; min-height: 36px; line-height: 1.2;
2920
+ }
2921
+ /* A native menu ignores min-height, so Preset rendered about half as tall as
2922
+ the text fields in the same form. Paint it like those fields. */
2923
+ label.field select {
2924
+ -webkit-appearance: none; appearance: none;
2925
+ padding-right: 28px;
2926
+ 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");
2927
+ background-repeat: no-repeat; background-position: right 10px center; background-size: 12px 12px;
2928
+ }
2929
+ .stack > .field > input,
2930
+ .stack > .field > select,
2931
+ .stack > .field > textarea,
2932
+ dialog .field > input,
2933
+ dialog .field > select,
2934
+ dialog .field > textarea { width: 100%; }
2935
+ .icon-btn, .btn, .btn-primary, .btn-quiet, .btn-danger, nav.side button { cursor: pointer; }
2873
2936
  .icon-btn, .btn, .btn-primary, .btn-quiet, .btn-danger {
2874
2937
  border-radius: 9px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line);
2875
2938
  background: var(--bg-elev);
@@ -2877,6 +2940,14 @@ var renderAdminDocument = (service) => {
2877
2940
  .btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
2878
2941
  .btn-quiet { background: transparent; }
2879
2942
  .btn-danger { color: var(--err); }
2943
+ /* Held after mouseup. Clearing an empty journal changes nothing on screen,
2944
+ so the press itself has to stay visible. */
2945
+ .icon-btn:active, .btn:active, .btn-quiet:active, .btn-danger:active, nav.side button:active,
2946
+ .icon-btn.pressed, .btn.pressed, .btn-quiet.pressed, .btn-danger.pressed, nav.side button.pressed {
2947
+ background: var(--bg-inset); border-color: var(--line-strong); color: var(--ink);
2948
+ }
2949
+ .btn-danger:active, .btn-danger.pressed { background: var(--err-soft); color: var(--err); }
2950
+ .btn-primary:active, .btn-primary.pressed { filter: brightness(0.88); color: var(--accent-ink); }
2880
2951
  /* minmax(0, 1fr): a 1fr column will not shrink below its content, so a long
2881
2952
  record or the full nav row would widen the page past the viewport. */
2882
2953
  .layout {
@@ -2965,8 +3036,16 @@ var renderAdminDocument = (service) => {
2965
3036
  input, select, textarea { font-size: 16px; }
2966
3037
  .brand, .vendor, .controls { width: 100%; }
2967
3038
  label.field, label.field select, label.field input { flex: 1; min-width: 0; }
2968
- .layout { grid-template-columns: minmax(0, 1fr); }
3039
+ /* The layout fills the screen. A single-column grid stretches every auto
3040
+ row, so the tab bar grew with the leftover height and the buttons floated
3041
+ in the middle of it. The bar stays one row; the page below takes the rest. */
3042
+ .layout {
3043
+ grid-template-columns: minmax(0, 1fr);
3044
+ grid-template-rows: auto minmax(0, 1fr);
3045
+ align-content: start;
3046
+ }
2969
3047
  nav.side {
3048
+ align-self: start; height: auto;
2970
3049
  flex-direction: row; align-items: center; overflow-x: auto; min-width: 0;
2971
3050
  border-right: 0; border-bottom: 1px solid var(--line);
2972
3051
  padding: 8px;
@@ -3834,7 +3913,7 @@ var stateAdminRoutes = (routes) => {
3834
3913
  };
3835
3914
 
3836
3915
  // ../core/dist/version.js
3837
- var PACKAGE_VERSION = true ? "1.6.0" : UNRELEASED_VERSION;
3916
+ var PACKAGE_VERSION = true ? "1.6.1" : UNRELEASED_VERSION;
3838
3917
 
3839
3918
  // ../core/dist/signing.js
3840
3919
  var encoder = new TextEncoder();
@@ -5868,4 +5947,4 @@ export {
5868
5947
  customerIoCredential,
5869
5948
  CustomerIoAPI
5870
5949
  };
5871
- //# sourceMappingURL=chunk-LKYGOY6Z.js.map
5950
+ //# sourceMappingURL=chunk-GACYXHSL.js.map