@crvouga/mockingbird-service-intercom 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.
- package/CHANGELOG.md +9 -1
- package/dist/{chunk-DBJFNV4N.js → chunk-6CA2VLGC.js} +2 -2
- package/dist/{chunk-O25E63FD.js → chunk-U46KHRXA.js} +89 -10
- package/dist/chunk-U46KHRXA.js.map +7 -0
- package/dist/cli.js +2 -2
- package/dist/index.js +1 -1
- package/dist/server.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-O25E63FD.js.map +0 -7
- /package/dist/{chunk-DBJFNV4N.js.map → chunk-6CA2VLGC.js.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
# Changelog — @crvouga/mockingbird-service-intercom
|
|
2
2
|
|
|
3
|
-
## 1.7.
|
|
3
|
+
## 1.7.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.7.0 (2026-09-29)
|
|
4
12
|
|
|
5
13
|
### Features
|
|
6
14
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createRuntime
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-U46KHRXA.js";
|
|
4
4
|
|
|
5
5
|
// ../../adapters/node/dist/cli.js
|
|
6
6
|
import { readFile } from "node:fs/promises";
|
|
@@ -377,4 +377,4 @@ export {
|
|
|
377
377
|
createServer2 as createServer,
|
|
378
378
|
serveTarget
|
|
379
379
|
};
|
|
380
|
-
//# sourceMappingURL=chunk-
|
|
380
|
+
//# sourceMappingURL=chunk-6CA2VLGC.js.map
|
|
@@ -2413,6 +2413,50 @@ function bootAdmin(config) {
|
|
|
2413
2413
|
if (render)
|
|
2414
2414
|
await render();
|
|
2415
2415
|
}
|
|
2416
|
+
const delay = (ms) => new Promise((resolve) => {
|
|
2417
|
+
window.setTimeout(resolve, ms);
|
|
2418
|
+
});
|
|
2419
|
+
const confirmAction = async (button, pending, done, work) => {
|
|
2420
|
+
if (button.dataset.pending === "1")
|
|
2421
|
+
return;
|
|
2422
|
+
const label = button.textContent ?? "";
|
|
2423
|
+
const width = button.offsetWidth;
|
|
2424
|
+
button.dataset.pending = "1";
|
|
2425
|
+
button.classList.add("pressed");
|
|
2426
|
+
button.setAttribute("aria-busy", "true");
|
|
2427
|
+
button.style.minWidth = `${width}px`;
|
|
2428
|
+
button.textContent = pending;
|
|
2429
|
+
try {
|
|
2430
|
+
await work();
|
|
2431
|
+
button.textContent = done;
|
|
2432
|
+
await delay(1e3);
|
|
2433
|
+
} catch (error) {
|
|
2434
|
+
showError(error);
|
|
2435
|
+
} finally {
|
|
2436
|
+
button.textContent = label;
|
|
2437
|
+
button.style.minWidth = "";
|
|
2438
|
+
button.classList.remove("pressed");
|
|
2439
|
+
button.removeAttribute("aria-busy");
|
|
2440
|
+
delete button.dataset.pending;
|
|
2441
|
+
}
|
|
2442
|
+
};
|
|
2443
|
+
document.addEventListener("click", (event) => {
|
|
2444
|
+
const target = event.target;
|
|
2445
|
+
if (!(target instanceof Element))
|
|
2446
|
+
return;
|
|
2447
|
+
const button = target.closest("button");
|
|
2448
|
+
if (!(button instanceof HTMLButtonElement) || button.dataset.pending === "1")
|
|
2449
|
+
return;
|
|
2450
|
+
button.classList.add("pressed");
|
|
2451
|
+
const token = String(Date.now());
|
|
2452
|
+
button.dataset.press = token;
|
|
2453
|
+
window.setTimeout(() => {
|
|
2454
|
+
if (button.dataset.press !== token || button.dataset.pending === "1")
|
|
2455
|
+
return;
|
|
2456
|
+
button.classList.remove("pressed");
|
|
2457
|
+
delete button.dataset.press;
|
|
2458
|
+
}, 450);
|
|
2459
|
+
});
|
|
2416
2460
|
el("namespace", HTMLSelectElement).addEventListener("change", () => {
|
|
2417
2461
|
state.namespace = el("namespace", HTMLSelectElement).value;
|
|
2418
2462
|
refresh().catch(showError);
|
|
@@ -2423,7 +2467,7 @@ function bootAdmin(config) {
|
|
|
2423
2467
|
refresh().catch(showError);
|
|
2424
2468
|
});
|
|
2425
2469
|
el("refresh", HTMLButtonElement).addEventListener("click", () => {
|
|
2426
|
-
refresh().catch(showError);
|
|
2470
|
+
confirmAction(el("refresh", HTMLButtonElement), "Refreshing...", "Updated", () => refresh()).catch(showError);
|
|
2427
2471
|
});
|
|
2428
2472
|
el("collections", HTMLElement).addEventListener("click", (event) => {
|
|
2429
2473
|
const target = event.target;
|
|
@@ -2546,10 +2590,10 @@ function bootAdmin(config) {
|
|
|
2546
2590
|
}).then(() => renderFaults()).catch(showError);
|
|
2547
2591
|
});
|
|
2548
2592
|
el("fault-clear", HTMLButtonElement).addEventListener("click", () => {
|
|
2549
|
-
api("DELETE", "/faults").then(() => renderFaults()).catch(showError);
|
|
2593
|
+
confirmAction(el("fault-clear", HTMLButtonElement), "Clearing...", "Cleared", () => api("DELETE", "/faults").then(() => renderFaults())).catch(showError);
|
|
2550
2594
|
});
|
|
2551
2595
|
el("journal-clear", HTMLButtonElement).addEventListener("click", () => {
|
|
2552
|
-
api("DELETE", "/requests").then(() => renderJournal()).catch(showError);
|
|
2596
|
+
confirmAction(el("journal-clear", HTMLButtonElement), "Clearing...", "Cleared", () => api("DELETE", "/requests").then(() => renderJournal())).catch(showError);
|
|
2553
2597
|
});
|
|
2554
2598
|
el("route-list", HTMLElement).addEventListener("click", (event) => {
|
|
2555
2599
|
const target = event.target;
|
|
@@ -2664,9 +2708,13 @@ function bootAdmin(config) {
|
|
|
2664
2708
|
var clientPrelude = [isRecord2, mountAdminBrand, startAdminBrand, faultPresetList, bootAdmin].map((fn) => fn.toString()).join("\n");
|
|
2665
2709
|
var adminClientSource = (config) => {
|
|
2666
2710
|
const payload = JSON.stringify(config).replace(/</g, "\\u003c");
|
|
2711
|
+
const entry = bootAdmin.name;
|
|
2712
|
+
if (!/^[A-Za-z_$][\w$]*$/.test(entry)) {
|
|
2713
|
+
throw new Error("admin client cannot call its boot function");
|
|
2714
|
+
}
|
|
2667
2715
|
return `<script>
|
|
2668
2716
|
${clientPrelude}
|
|
2669
|
-
|
|
2717
|
+
${entry}(${payload});
|
|
2670
2718
|
</script>`;
|
|
2671
2719
|
};
|
|
2672
2720
|
|
|
@@ -2880,9 +2928,24 @@ var renderAdminDocument = (service) => {
|
|
|
2880
2928
|
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
|
|
2881
2929
|
label.field { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--faint); }
|
|
2882
2930
|
label.field input, label.field select, .controls input[type="password"] {
|
|
2883
|
-
background: var(--bg-inset); border: 1px solid var(--line); border-radius: 8px;
|
|
2884
|
-
padding: 7px 8px; min-height: 36px;
|
|
2885
|
-
}
|
|
2931
|
+
background-color: var(--bg-inset); border: 1px solid var(--line); border-radius: 8px;
|
|
2932
|
+
padding: 7px 8px; min-height: 36px; line-height: 1.2;
|
|
2933
|
+
}
|
|
2934
|
+
/* A native menu ignores min-height, so Preset rendered about half as tall as
|
|
2935
|
+
the text fields in the same form. Paint it like those fields. */
|
|
2936
|
+
label.field select {
|
|
2937
|
+
-webkit-appearance: none; appearance: none;
|
|
2938
|
+
padding-right: 28px;
|
|
2939
|
+
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");
|
|
2940
|
+
background-repeat: no-repeat; background-position: right 10px center; background-size: 12px 12px;
|
|
2941
|
+
}
|
|
2942
|
+
.stack > .field > input,
|
|
2943
|
+
.stack > .field > select,
|
|
2944
|
+
.stack > .field > textarea,
|
|
2945
|
+
dialog .field > input,
|
|
2946
|
+
dialog .field > select,
|
|
2947
|
+
dialog .field > textarea { width: 100%; }
|
|
2948
|
+
.icon-btn, .btn, .btn-primary, .btn-quiet, .btn-danger, nav.side button { cursor: pointer; }
|
|
2886
2949
|
.icon-btn, .btn, .btn-primary, .btn-quiet, .btn-danger {
|
|
2887
2950
|
border-radius: 9px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line);
|
|
2888
2951
|
background: var(--bg-elev);
|
|
@@ -2890,6 +2953,14 @@ var renderAdminDocument = (service) => {
|
|
|
2890
2953
|
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
|
|
2891
2954
|
.btn-quiet { background: transparent; }
|
|
2892
2955
|
.btn-danger { color: var(--err); }
|
|
2956
|
+
/* Held after mouseup. Clearing an empty journal changes nothing on screen,
|
|
2957
|
+
so the press itself has to stay visible. */
|
|
2958
|
+
.icon-btn:active, .btn:active, .btn-quiet:active, .btn-danger:active, nav.side button:active,
|
|
2959
|
+
.icon-btn.pressed, .btn.pressed, .btn-quiet.pressed, .btn-danger.pressed, nav.side button.pressed {
|
|
2960
|
+
background: var(--bg-inset); border-color: var(--line-strong); color: var(--ink);
|
|
2961
|
+
}
|
|
2962
|
+
.btn-danger:active, .btn-danger.pressed { background: var(--err-soft); color: var(--err); }
|
|
2963
|
+
.btn-primary:active, .btn-primary.pressed { filter: brightness(0.88); color: var(--accent-ink); }
|
|
2893
2964
|
/* minmax(0, 1fr): a 1fr column will not shrink below its content, so a long
|
|
2894
2965
|
record or the full nav row would widen the page past the viewport. */
|
|
2895
2966
|
.layout {
|
|
@@ -2978,8 +3049,16 @@ var renderAdminDocument = (service) => {
|
|
|
2978
3049
|
input, select, textarea { font-size: 16px; }
|
|
2979
3050
|
.brand, .vendor, .controls { width: 100%; }
|
|
2980
3051
|
label.field, label.field select, label.field input { flex: 1; min-width: 0; }
|
|
2981
|
-
|
|
3052
|
+
/* The layout fills the screen. A single-column grid stretches every auto
|
|
3053
|
+
row, so the tab bar grew with the leftover height and the buttons floated
|
|
3054
|
+
in the middle of it. The bar stays one row; the page below takes the rest. */
|
|
3055
|
+
.layout {
|
|
3056
|
+
grid-template-columns: minmax(0, 1fr);
|
|
3057
|
+
grid-template-rows: auto minmax(0, 1fr);
|
|
3058
|
+
align-content: start;
|
|
3059
|
+
}
|
|
2982
3060
|
nav.side {
|
|
3061
|
+
align-self: start; height: auto;
|
|
2983
3062
|
flex-direction: row; align-items: center; overflow-x: auto; min-width: 0;
|
|
2984
3063
|
border-right: 0; border-bottom: 1px solid var(--line);
|
|
2985
3064
|
padding: 8px;
|
|
@@ -3847,7 +3926,7 @@ var stateAdminRoutes = (routes) => {
|
|
|
3847
3926
|
};
|
|
3848
3927
|
|
|
3849
3928
|
// ../core/dist/version.js
|
|
3850
|
-
var PACKAGE_VERSION = true ? "1.7.
|
|
3929
|
+
var PACKAGE_VERSION = true ? "1.7.1" : UNRELEASED_VERSION;
|
|
3851
3930
|
|
|
3852
3931
|
// ../core/dist/signing.js
|
|
3853
3932
|
var encoder = new TextEncoder();
|
|
@@ -6225,4 +6304,4 @@ export {
|
|
|
6225
6304
|
IntercomError,
|
|
6226
6305
|
IntercomAPI
|
|
6227
6306
|
};
|
|
6228
|
-
//# sourceMappingURL=chunk-
|
|
6307
|
+
//# sourceMappingURL=chunk-U46KHRXA.js.map
|