@crvouga/mockingbird-service-formbricks 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-formbricks
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
 
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  DEFAULT_SETTINGS,
3
3
  createRuntime
4
- } from "./chunk-L4LQNY2V.js";
4
+ } from "./chunk-JAVNDNOU.js";
5
5
 
6
6
  // ../../adapters/node/dist/cli.js
7
7
  import { readFile } from "node:fs/promises";
@@ -368,4 +368,4 @@ export {
368
368
  createServer2 as createServer,
369
369
  serveTarget
370
370
  };
371
- //# sourceMappingURL=chunk-4PMPNQUG.js.map
371
+ //# sourceMappingURL=chunk-6PARZPBY.js.map
@@ -2107,6 +2107,50 @@ function bootAdmin(config) {
2107
2107
  if (render)
2108
2108
  await render();
2109
2109
  }
2110
+ const delay = (ms) => new Promise((resolve) => {
2111
+ window.setTimeout(resolve, ms);
2112
+ });
2113
+ const confirmAction = async (button, pending, done, work) => {
2114
+ if (button.dataset.pending === "1")
2115
+ return;
2116
+ const label = button.textContent ?? "";
2117
+ const width = button.offsetWidth;
2118
+ button.dataset.pending = "1";
2119
+ button.classList.add("pressed");
2120
+ button.setAttribute("aria-busy", "true");
2121
+ button.style.minWidth = `${width}px`;
2122
+ button.textContent = pending;
2123
+ try {
2124
+ await work();
2125
+ button.textContent = done;
2126
+ await delay(1e3);
2127
+ } catch (error2) {
2128
+ showError(error2);
2129
+ } finally {
2130
+ button.textContent = label;
2131
+ button.style.minWidth = "";
2132
+ button.classList.remove("pressed");
2133
+ button.removeAttribute("aria-busy");
2134
+ delete button.dataset.pending;
2135
+ }
2136
+ };
2137
+ document.addEventListener("click", (event) => {
2138
+ const target = event.target;
2139
+ if (!(target instanceof Element))
2140
+ return;
2141
+ const button = target.closest("button");
2142
+ if (!(button instanceof HTMLButtonElement) || button.dataset.pending === "1")
2143
+ return;
2144
+ button.classList.add("pressed");
2145
+ const token = String(Date.now());
2146
+ button.dataset.press = token;
2147
+ window.setTimeout(() => {
2148
+ if (button.dataset.press !== token || button.dataset.pending === "1")
2149
+ return;
2150
+ button.classList.remove("pressed");
2151
+ delete button.dataset.press;
2152
+ }, 450);
2153
+ });
2110
2154
  el("namespace", HTMLSelectElement).addEventListener("change", () => {
2111
2155
  state.namespace = el("namespace", HTMLSelectElement).value;
2112
2156
  refresh().catch(showError);
@@ -2117,7 +2161,7 @@ function bootAdmin(config) {
2117
2161
  refresh().catch(showError);
2118
2162
  });
2119
2163
  el("refresh", HTMLButtonElement).addEventListener("click", () => {
2120
- refresh().catch(showError);
2164
+ confirmAction(el("refresh", HTMLButtonElement), "Refreshing...", "Updated", () => refresh()).catch(showError);
2121
2165
  });
2122
2166
  el("collections", HTMLElement).addEventListener("click", (event) => {
2123
2167
  const target = event.target;
@@ -2240,10 +2284,10 @@ function bootAdmin(config) {
2240
2284
  }).then(() => renderFaults()).catch(showError);
2241
2285
  });
2242
2286
  el("fault-clear", HTMLButtonElement).addEventListener("click", () => {
2243
- api("DELETE", "/faults").then(() => renderFaults()).catch(showError);
2287
+ confirmAction(el("fault-clear", HTMLButtonElement), "Clearing...", "Cleared", () => api("DELETE", "/faults").then(() => renderFaults())).catch(showError);
2244
2288
  });
2245
2289
  el("journal-clear", HTMLButtonElement).addEventListener("click", () => {
2246
- api("DELETE", "/requests").then(() => renderJournal()).catch(showError);
2290
+ confirmAction(el("journal-clear", HTMLButtonElement), "Clearing...", "Cleared", () => api("DELETE", "/requests").then(() => renderJournal())).catch(showError);
2247
2291
  });
2248
2292
  el("route-list", HTMLElement).addEventListener("click", (event) => {
2249
2293
  const target = event.target;
@@ -2358,9 +2402,13 @@ function bootAdmin(config) {
2358
2402
  var clientPrelude = [isRecord2, mountAdminBrand, startAdminBrand, faultPresetList, bootAdmin].map((fn) => fn.toString()).join("\n");
2359
2403
  var adminClientSource = (config) => {
2360
2404
  const payload = JSON.stringify(config).replace(/</g, "\\u003c");
2405
+ const entry = bootAdmin.name;
2406
+ if (!/^[A-Za-z_$][\w$]*$/.test(entry)) {
2407
+ throw new Error("admin client cannot call its boot function");
2408
+ }
2361
2409
  return `<script>
2362
2410
  ${clientPrelude}
2363
- bootAdmin(${payload});
2411
+ ${entry}(${payload});
2364
2412
  </script>`;
2365
2413
  };
2366
2414
 
@@ -2574,9 +2622,24 @@ var renderAdminDocument = (service) => {
2574
2622
  .controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
2575
2623
  label.field { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--faint); }
2576
2624
  label.field input, label.field select, .controls input[type="password"] {
2577
- background: var(--bg-inset); border: 1px solid var(--line); border-radius: 8px;
2578
- padding: 7px 8px; min-height: 36px;
2579
- }
2625
+ background-color: var(--bg-inset); border: 1px solid var(--line); border-radius: 8px;
2626
+ padding: 7px 8px; min-height: 36px; line-height: 1.2;
2627
+ }
2628
+ /* A native menu ignores min-height, so Preset rendered about half as tall as
2629
+ the text fields in the same form. Paint it like those fields. */
2630
+ label.field select {
2631
+ -webkit-appearance: none; appearance: none;
2632
+ padding-right: 28px;
2633
+ 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");
2634
+ background-repeat: no-repeat; background-position: right 10px center; background-size: 12px 12px;
2635
+ }
2636
+ .stack > .field > input,
2637
+ .stack > .field > select,
2638
+ .stack > .field > textarea,
2639
+ dialog .field > input,
2640
+ dialog .field > select,
2641
+ dialog .field > textarea { width: 100%; }
2642
+ .icon-btn, .btn, .btn-primary, .btn-quiet, .btn-danger, nav.side button { cursor: pointer; }
2580
2643
  .icon-btn, .btn, .btn-primary, .btn-quiet, .btn-danger {
2581
2644
  border-radius: 9px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line);
2582
2645
  background: var(--bg-elev);
@@ -2584,6 +2647,14 @@ var renderAdminDocument = (service) => {
2584
2647
  .btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
2585
2648
  .btn-quiet { background: transparent; }
2586
2649
  .btn-danger { color: var(--err); }
2650
+ /* Held after mouseup. Clearing an empty journal changes nothing on screen,
2651
+ so the press itself has to stay visible. */
2652
+ .icon-btn:active, .btn:active, .btn-quiet:active, .btn-danger:active, nav.side button:active,
2653
+ .icon-btn.pressed, .btn.pressed, .btn-quiet.pressed, .btn-danger.pressed, nav.side button.pressed {
2654
+ background: var(--bg-inset); border-color: var(--line-strong); color: var(--ink);
2655
+ }
2656
+ .btn-danger:active, .btn-danger.pressed { background: var(--err-soft); color: var(--err); }
2657
+ .btn-primary:active, .btn-primary.pressed { filter: brightness(0.88); color: var(--accent-ink); }
2587
2658
  /* minmax(0, 1fr): a 1fr column will not shrink below its content, so a long
2588
2659
  record or the full nav row would widen the page past the viewport. */
2589
2660
  .layout {
@@ -2672,8 +2743,16 @@ var renderAdminDocument = (service) => {
2672
2743
  input, select, textarea { font-size: 16px; }
2673
2744
  .brand, .vendor, .controls { width: 100%; }
2674
2745
  label.field, label.field select, label.field input { flex: 1; min-width: 0; }
2675
- .layout { grid-template-columns: minmax(0, 1fr); }
2746
+ /* The layout fills the screen. A single-column grid stretches every auto
2747
+ row, so the tab bar grew with the leftover height and the buttons floated
2748
+ in the middle of it. The bar stays one row; the page below takes the rest. */
2749
+ .layout {
2750
+ grid-template-columns: minmax(0, 1fr);
2751
+ grid-template-rows: auto minmax(0, 1fr);
2752
+ align-content: start;
2753
+ }
2676
2754
  nav.side {
2755
+ align-self: start; height: auto;
2677
2756
  flex-direction: row; align-items: center; overflow-x: auto; min-width: 0;
2678
2757
  border-right: 0; border-bottom: 1px solid var(--line);
2679
2758
  padding: 8px;
@@ -3467,7 +3546,7 @@ var stateAdminRoutes = (routes) => {
3467
3546
  };
3468
3547
 
3469
3548
  // ../core/dist/version.js
3470
- var PACKAGE_VERSION = true ? "1.6.0" : UNRELEASED_VERSION;
3549
+ var PACKAGE_VERSION = true ? "1.6.1" : UNRELEASED_VERSION;
3471
3550
 
3472
3551
  // ../core/dist/signing.js
3473
3552
  var encoder = new TextEncoder();
@@ -6243,4 +6322,4 @@ export {
6243
6322
  formbricksError,
6244
6323
  FormbricksAPI
6245
6324
  };
6246
- //# sourceMappingURL=chunk-L4LQNY2V.js.map
6325
+ //# sourceMappingURL=chunk-JAVNDNOU.js.map