@crvouga/mockingbird-service-mailosaur 1.6.0 → 1.7.0
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 +19 -1
- package/dist/{chunk-AZIUWKU3.js → chunk-QI7IPPVX.js} +355 -22
- package/dist/chunk-QI7IPPVX.js.map +7 -0
- package/dist/{chunk-PLSXNWOH.js → chunk-W3PE5FFQ.js} +2 -2
- package/dist/cli.js +2 -2
- package/dist/index.js +1 -1
- package/dist/server.js +2 -2
- package/package.json +2 -2
- package/dist/chunk-AZIUWKU3.js.map +0 -7
- /package/dist/{chunk-PLSXNWOH.js.map → chunk-W3PE5FFQ.js.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
# Changelog — @crvouga/mockingbird-service-mailosaur
|
|
2
2
|
|
|
3
|
-
## 1.
|
|
3
|
+
## 1.7.0 (2026-10-01)
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
- record SQL timelines and serve the admin explorer ([8ced17a](https://github.com/crvouga/mockingbird/commit/8ced17ac398e386ef4e9d7e01fc7744c34b95d07))
|
|
8
|
+
|
|
9
|
+
### Dependencies
|
|
10
|
+
|
|
11
|
+
- `@crvouga/mockingbird-service-sqlite`
|
|
12
|
+
|
|
13
|
+
## 1.6.1 (2026-09-30)
|
|
14
|
+
|
|
15
|
+
### Fixes and improvements
|
|
16
|
+
|
|
17
|
+
- keep admin buttons pressed until the action finishes ([0aabfcb](https://github.com/crvouga/mockingbird/commit/0aabfcb5f392aa51e193f9c3f817d5877d92bc6a))
|
|
18
|
+
- size admin select fields like the text inputs beside them ([0fb3ef2](https://github.com/crvouga/mockingbird/commit/0fb3ef2ddbf43376c93a2ae6d87c6c9bf890dafc))
|
|
19
|
+
- keep admin section tabs wired when boot is renamed ([4eda25e](https://github.com/crvouga/mockingbird/commit/4eda25eacd59da048d196f7cc8369d7a02b47bfc))
|
|
20
|
+
|
|
21
|
+
## 1.6.0 (2026-09-29)
|
|
4
22
|
|
|
5
23
|
### Features
|
|
6
24
|
|
|
@@ -1947,6 +1947,167 @@ function faultPresetList(value) {
|
|
|
1947
1947
|
})
|
|
1948
1948
|
};
|
|
1949
1949
|
}
|
|
1950
|
+
function mountSqlExplorer(root, api) {
|
|
1951
|
+
const cell = (value) => {
|
|
1952
|
+
if (value === null || value === void 0)
|
|
1953
|
+
return "";
|
|
1954
|
+
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
1955
|
+
return String(value);
|
|
1956
|
+
}
|
|
1957
|
+
return JSON.stringify(value) ?? "";
|
|
1958
|
+
};
|
|
1959
|
+
root.replaceChildren();
|
|
1960
|
+
const layout = document.createElement("div");
|
|
1961
|
+
layout.className = "sql-layout";
|
|
1962
|
+
const tables = document.createElement("div");
|
|
1963
|
+
tables.className = "sql-tables";
|
|
1964
|
+
const stack = document.createElement("div");
|
|
1965
|
+
stack.className = "stack";
|
|
1966
|
+
const banner = document.createElement("p");
|
|
1967
|
+
banner.className = "banner";
|
|
1968
|
+
const grid = document.createElement("div");
|
|
1969
|
+
const input = document.createElement("textarea");
|
|
1970
|
+
input.className = "sql-input";
|
|
1971
|
+
input.spellcheck = false;
|
|
1972
|
+
input.placeholder = "SELECT * FROM ...";
|
|
1973
|
+
const actions = document.createElement("div");
|
|
1974
|
+
actions.className = "row-actions";
|
|
1975
|
+
const run = document.createElement("button");
|
|
1976
|
+
run.type = "button";
|
|
1977
|
+
run.textContent = "Run";
|
|
1978
|
+
actions.append(run);
|
|
1979
|
+
const result = document.createElement("pre");
|
|
1980
|
+
stack.append(banner, grid, input, actions, result);
|
|
1981
|
+
layout.append(tables, stack);
|
|
1982
|
+
root.append(layout);
|
|
1983
|
+
const showError = (error) => {
|
|
1984
|
+
banner.textContent = error instanceof Error ? error.message : String(error);
|
|
1985
|
+
banner.classList.add("show");
|
|
1986
|
+
};
|
|
1987
|
+
const clearError = () => {
|
|
1988
|
+
banner.textContent = "";
|
|
1989
|
+
banner.classList.remove("show");
|
|
1990
|
+
};
|
|
1991
|
+
const renderGrid = (columns, rows) => {
|
|
1992
|
+
grid.replaceChildren();
|
|
1993
|
+
if (columns.length === 0) {
|
|
1994
|
+
const empty = document.createElement("p");
|
|
1995
|
+
empty.className = "empty";
|
|
1996
|
+
empty.textContent = "No rows.";
|
|
1997
|
+
grid.append(empty);
|
|
1998
|
+
return;
|
|
1999
|
+
}
|
|
2000
|
+
const table = document.createElement("table");
|
|
2001
|
+
const head = document.createElement("thead");
|
|
2002
|
+
const headRow = document.createElement("tr");
|
|
2003
|
+
for (const column of columns) {
|
|
2004
|
+
const th = document.createElement("th");
|
|
2005
|
+
th.textContent = column;
|
|
2006
|
+
headRow.append(th);
|
|
2007
|
+
}
|
|
2008
|
+
head.append(headRow);
|
|
2009
|
+
const body = document.createElement("tbody");
|
|
2010
|
+
for (const row of rows) {
|
|
2011
|
+
const tr = document.createElement("tr");
|
|
2012
|
+
for (const column of columns) {
|
|
2013
|
+
const td = document.createElement("td");
|
|
2014
|
+
td.dataset.label = column;
|
|
2015
|
+
td.textContent = cell(row[column]);
|
|
2016
|
+
tr.append(td);
|
|
2017
|
+
}
|
|
2018
|
+
body.append(tr);
|
|
2019
|
+
}
|
|
2020
|
+
table.append(head, body);
|
|
2021
|
+
grid.append(table);
|
|
2022
|
+
};
|
|
2023
|
+
const rowsOf = (value) => {
|
|
2024
|
+
if (!isRecord2(value) || !Array.isArray(value.rows))
|
|
2025
|
+
return [];
|
|
2026
|
+
return value.rows.flatMap((row) => isRecord2(row) ? [row] : []);
|
|
2027
|
+
};
|
|
2028
|
+
const columnsOf = (value, rows) => {
|
|
2029
|
+
if (isRecord2(value) && Array.isArray(value.columns)) {
|
|
2030
|
+
const named = value.columns.flatMap((column) => typeof column === "string" ? [column] : []);
|
|
2031
|
+
if (named.length > 0)
|
|
2032
|
+
return named;
|
|
2033
|
+
}
|
|
2034
|
+
const first = rows[0];
|
|
2035
|
+
return first === void 0 ? [] : Object.keys(first);
|
|
2036
|
+
};
|
|
2037
|
+
let selected = "";
|
|
2038
|
+
const loadPage = async (schema, name) => {
|
|
2039
|
+
selected = `${schema}.${name}`;
|
|
2040
|
+
const page = await api.get(`/sql/tables/${encodeURIComponent(schema)}/${encodeURIComponent(name)}?limit=50`);
|
|
2041
|
+
const rows = rowsOf(page);
|
|
2042
|
+
renderGrid(columnsOf(page, rows), rows);
|
|
2043
|
+
const total = isRecord2(page) && typeof page.total === "number" ? page.total : rows.length;
|
|
2044
|
+
result.textContent = `${selected} \xB7 ${total} rows`;
|
|
2045
|
+
for (const button of tables.querySelectorAll("button")) {
|
|
2046
|
+
if (!(button instanceof HTMLButtonElement))
|
|
2047
|
+
continue;
|
|
2048
|
+
button.setAttribute("aria-current", button.dataset.schema === schema && button.dataset.table === name ? "true" : "false");
|
|
2049
|
+
}
|
|
2050
|
+
};
|
|
2051
|
+
const loadTables = async () => {
|
|
2052
|
+
const payload = await api.get("/sql/tables");
|
|
2053
|
+
const listed = isRecord2(payload) && Array.isArray(payload.tables) ? payload.tables : [];
|
|
2054
|
+
tables.replaceChildren();
|
|
2055
|
+
if (listed.length === 0) {
|
|
2056
|
+
const empty = document.createElement("p");
|
|
2057
|
+
empty.className = "empty";
|
|
2058
|
+
empty.textContent = "No tables.";
|
|
2059
|
+
tables.append(empty);
|
|
2060
|
+
return;
|
|
2061
|
+
}
|
|
2062
|
+
for (const item of listed) {
|
|
2063
|
+
if (!isRecord2(item) || typeof item.schema !== "string" || typeof item.name !== "string")
|
|
2064
|
+
continue;
|
|
2065
|
+
const button = document.createElement("button");
|
|
2066
|
+
button.type = "button";
|
|
2067
|
+
button.dataset.schema = item.schema;
|
|
2068
|
+
button.dataset.table = item.name;
|
|
2069
|
+
button.textContent = `${item.schema}.${item.name}`;
|
|
2070
|
+
tables.append(button);
|
|
2071
|
+
}
|
|
2072
|
+
};
|
|
2073
|
+
tables.addEventListener("click", (event) => {
|
|
2074
|
+
const target = event.target;
|
|
2075
|
+
if (!(target instanceof Element))
|
|
2076
|
+
return;
|
|
2077
|
+
const button = target.closest("button");
|
|
2078
|
+
if (!(button instanceof HTMLButtonElement))
|
|
2079
|
+
return;
|
|
2080
|
+
const schema = button.dataset.schema;
|
|
2081
|
+
const name = button.dataset.table;
|
|
2082
|
+
if (schema === void 0 || name === void 0)
|
|
2083
|
+
return;
|
|
2084
|
+
clearError();
|
|
2085
|
+
loadPage(schema, name).catch(showError);
|
|
2086
|
+
});
|
|
2087
|
+
run.addEventListener("click", () => {
|
|
2088
|
+
const sql = input.value.trim();
|
|
2089
|
+
if (sql === "") {
|
|
2090
|
+
showError(new Error("Enter a statement"));
|
|
2091
|
+
return;
|
|
2092
|
+
}
|
|
2093
|
+
clearError();
|
|
2094
|
+
api.send("POST", "/sql/query", { sql }).then((payload) => {
|
|
2095
|
+
const rows = rowsOf(payload);
|
|
2096
|
+
renderGrid(columnsOf(payload, rows), rows);
|
|
2097
|
+
const count = isRecord2(payload) && typeof payload.rowCount === "number" ? payload.rowCount : rows.length;
|
|
2098
|
+
const truncated = isRecord2(payload) && payload.truncated === true ? " (truncated)" : "";
|
|
2099
|
+
result.textContent = `${count} rows${truncated}`;
|
|
2100
|
+
}).catch(showError);
|
|
2101
|
+
});
|
|
2102
|
+
const namespace = document.getElementById("namespace");
|
|
2103
|
+
if (namespace) {
|
|
2104
|
+
namespace.addEventListener("change", () => {
|
|
2105
|
+
clearError();
|
|
2106
|
+
loadTables().catch(showError);
|
|
2107
|
+
});
|
|
2108
|
+
}
|
|
2109
|
+
loadTables().catch(showError);
|
|
2110
|
+
}
|
|
1950
2111
|
function bootAdmin(config) {
|
|
1951
2112
|
const fieldKinds = ["string", "number", "boolean", "null", "object", "array", "unknown"];
|
|
1952
2113
|
const sources = ["declared", "inferred", "mixed"];
|
|
@@ -2387,6 +2548,50 @@ function bootAdmin(config) {
|
|
|
2387
2548
|
if (render)
|
|
2388
2549
|
await render();
|
|
2389
2550
|
}
|
|
2551
|
+
const delay = (ms) => new Promise((resolve) => {
|
|
2552
|
+
window.setTimeout(resolve, ms);
|
|
2553
|
+
});
|
|
2554
|
+
const confirmAction = async (button, pending, done, work) => {
|
|
2555
|
+
if (button.dataset.pending === "1")
|
|
2556
|
+
return;
|
|
2557
|
+
const label = button.textContent ?? "";
|
|
2558
|
+
const width = button.offsetWidth;
|
|
2559
|
+
button.dataset.pending = "1";
|
|
2560
|
+
button.classList.add("pressed");
|
|
2561
|
+
button.setAttribute("aria-busy", "true");
|
|
2562
|
+
button.style.minWidth = `${width}px`;
|
|
2563
|
+
button.textContent = pending;
|
|
2564
|
+
try {
|
|
2565
|
+
await work();
|
|
2566
|
+
button.textContent = done;
|
|
2567
|
+
await delay(1e3);
|
|
2568
|
+
} catch (error) {
|
|
2569
|
+
showError(error);
|
|
2570
|
+
} finally {
|
|
2571
|
+
button.textContent = label;
|
|
2572
|
+
button.style.minWidth = "";
|
|
2573
|
+
button.classList.remove("pressed");
|
|
2574
|
+
button.removeAttribute("aria-busy");
|
|
2575
|
+
delete button.dataset.pending;
|
|
2576
|
+
}
|
|
2577
|
+
};
|
|
2578
|
+
document.addEventListener("click", (event) => {
|
|
2579
|
+
const target = event.target;
|
|
2580
|
+
if (!(target instanceof Element))
|
|
2581
|
+
return;
|
|
2582
|
+
const button = target.closest("button");
|
|
2583
|
+
if (!(button instanceof HTMLButtonElement) || button.dataset.pending === "1")
|
|
2584
|
+
return;
|
|
2585
|
+
button.classList.add("pressed");
|
|
2586
|
+
const token = String(Date.now());
|
|
2587
|
+
button.dataset.press = token;
|
|
2588
|
+
window.setTimeout(() => {
|
|
2589
|
+
if (button.dataset.press !== token || button.dataset.pending === "1")
|
|
2590
|
+
return;
|
|
2591
|
+
button.classList.remove("pressed");
|
|
2592
|
+
delete button.dataset.press;
|
|
2593
|
+
}, 450);
|
|
2594
|
+
});
|
|
2390
2595
|
el("namespace", HTMLSelectElement).addEventListener("change", () => {
|
|
2391
2596
|
state.namespace = el("namespace", HTMLSelectElement).value;
|
|
2392
2597
|
refresh().catch(showError);
|
|
@@ -2397,7 +2602,7 @@ function bootAdmin(config) {
|
|
|
2397
2602
|
refresh().catch(showError);
|
|
2398
2603
|
});
|
|
2399
2604
|
el("refresh", HTMLButtonElement).addEventListener("click", () => {
|
|
2400
|
-
refresh().catch(showError);
|
|
2605
|
+
confirmAction(el("refresh", HTMLButtonElement), "Refreshing...", "Updated", () => refresh()).catch(showError);
|
|
2401
2606
|
});
|
|
2402
2607
|
el("collections", HTMLElement).addEventListener("click", (event) => {
|
|
2403
2608
|
const target = event.target;
|
|
@@ -2520,10 +2725,10 @@ function bootAdmin(config) {
|
|
|
2520
2725
|
}).then(() => renderFaults()).catch(showError);
|
|
2521
2726
|
});
|
|
2522
2727
|
el("fault-clear", HTMLButtonElement).addEventListener("click", () => {
|
|
2523
|
-
api("DELETE", "/faults").then(() => renderFaults()).catch(showError);
|
|
2728
|
+
confirmAction(el("fault-clear", HTMLButtonElement), "Clearing...", "Cleared", () => api("DELETE", "/faults").then(() => renderFaults())).catch(showError);
|
|
2524
2729
|
});
|
|
2525
2730
|
el("journal-clear", HTMLButtonElement).addEventListener("click", () => {
|
|
2526
|
-
api("DELETE", "/requests").then(() => renderJournal()).catch(showError);
|
|
2731
|
+
confirmAction(el("journal-clear", HTMLButtonElement), "Clearing...", "Cleared", () => api("DELETE", "/requests").then(() => renderJournal())).catch(showError);
|
|
2527
2732
|
});
|
|
2528
2733
|
el("route-list", HTMLElement).addEventListener("click", (event) => {
|
|
2529
2734
|
const target = event.target;
|
|
@@ -2579,6 +2784,22 @@ function bootAdmin(config) {
|
|
|
2579
2784
|
panel.script = value.script;
|
|
2580
2785
|
return panel;
|
|
2581
2786
|
};
|
|
2787
|
+
const decodeExtension = (value) => {
|
|
2788
|
+
if (!isRecord2(value))
|
|
2789
|
+
return void 0;
|
|
2790
|
+
if (value.kind === "sql") {
|
|
2791
|
+
return {
|
|
2792
|
+
kind: "sql",
|
|
2793
|
+
id: typeof value.id === "string" && value.id !== "" ? value.id : "sql",
|
|
2794
|
+
title: typeof value.title === "string" && value.title !== "" ? value.title : "SQL",
|
|
2795
|
+
description: typeof value.description === "string" ? value.description : "Browse tables and run queries."
|
|
2796
|
+
};
|
|
2797
|
+
}
|
|
2798
|
+
if (value.kind !== "panel")
|
|
2799
|
+
return void 0;
|
|
2800
|
+
const panel = decodePanel(value);
|
|
2801
|
+
return panel === void 0 ? void 0 : { kind: "panel", ...panel };
|
|
2802
|
+
};
|
|
2582
2803
|
const mountPanels = (panels) => {
|
|
2583
2804
|
const nav = el("nav", HTMLElement);
|
|
2584
2805
|
const views = el("views", HTMLElement);
|
|
@@ -2632,15 +2853,57 @@ function bootAdmin(config) {
|
|
|
2632
2853
|
return decoded === void 0 ? [] : [decoded];
|
|
2633
2854
|
});
|
|
2634
2855
|
mountPanels(panels);
|
|
2856
|
+
const extensions = requireList(isRecord2(manifest) ? manifest.extensions : void 0, "Extensions").flatMap((extension) => {
|
|
2857
|
+
const decoded = decodeExtension(extension);
|
|
2858
|
+
return decoded === void 0 ? [] : [decoded];
|
|
2859
|
+
});
|
|
2860
|
+
const extensionPanels = extensions.flatMap((extension) => extension.kind === "panel" ? [extension] : []);
|
|
2861
|
+
mountPanels(extensionPanels);
|
|
2862
|
+
for (const extension of extensions) {
|
|
2863
|
+
if (extension.kind !== "sql")
|
|
2864
|
+
continue;
|
|
2865
|
+
const nav = el("nav", HTMLElement);
|
|
2866
|
+
const views = el("views", HTMLElement);
|
|
2867
|
+
const button = document.createElement("button");
|
|
2868
|
+
button.type = "button";
|
|
2869
|
+
button.dataset.view = extension.id;
|
|
2870
|
+
button.textContent = extension.title;
|
|
2871
|
+
nav.append(button);
|
|
2872
|
+
const section = document.createElement("section");
|
|
2873
|
+
section.className = "view";
|
|
2874
|
+
section.id = `view-${extension.id}`;
|
|
2875
|
+
section.hidden = true;
|
|
2876
|
+
const title = document.createElement("h2");
|
|
2877
|
+
title.textContent = extension.title;
|
|
2878
|
+
const lede = document.createElement("p");
|
|
2879
|
+
lede.className = "lede";
|
|
2880
|
+
lede.textContent = extension.description;
|
|
2881
|
+
const body = document.createElement("div");
|
|
2882
|
+
body.className = "panel-body";
|
|
2883
|
+
section.append(title, lede, body);
|
|
2884
|
+
views.append(section);
|
|
2885
|
+
mountSqlExplorer(body, panelApi);
|
|
2886
|
+
}
|
|
2635
2887
|
return refresh();
|
|
2636
2888
|
}).catch(showError);
|
|
2637
2889
|
}
|
|
2638
|
-
var clientPrelude = [
|
|
2890
|
+
var clientPrelude = [
|
|
2891
|
+
isRecord2,
|
|
2892
|
+
mountAdminBrand,
|
|
2893
|
+
startAdminBrand,
|
|
2894
|
+
faultPresetList,
|
|
2895
|
+
mountSqlExplorer,
|
|
2896
|
+
bootAdmin
|
|
2897
|
+
].map((fn) => fn.toString()).join("\n");
|
|
2639
2898
|
var adminClientSource = (config) => {
|
|
2640
2899
|
const payload = JSON.stringify(config).replace(/</g, "\\u003c");
|
|
2900
|
+
const entry = bootAdmin.name;
|
|
2901
|
+
if (!/^[A-Za-z_$][\w$]*$/.test(entry)) {
|
|
2902
|
+
throw new Error("admin client cannot call its boot function");
|
|
2903
|
+
}
|
|
2641
2904
|
return `<script>
|
|
2642
2905
|
${clientPrelude}
|
|
2643
|
-
|
|
2906
|
+
${entry}(${payload});
|
|
2644
2907
|
</script>`;
|
|
2645
2908
|
};
|
|
2646
2909
|
|
|
@@ -2681,19 +2944,33 @@ var STANDARD_ADMIN_ROUTES = [
|
|
|
2681
2944
|
"GET /ui/manifest"
|
|
2682
2945
|
];
|
|
2683
2946
|
var PANEL_ID = /^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$/;
|
|
2947
|
+
var RESERVED_VIEWS = /* @__PURE__ */ new Set(["overview", "state", "clock", "faults", "journal", "routes"]);
|
|
2948
|
+
var checkPanel = (panel, seen, label) => {
|
|
2949
|
+
if (!PANEL_ID.test(panel.id)) {
|
|
2950
|
+
throw new RangeError(`${label} id must match ${PANEL_ID}: ${JSON.stringify(panel.id)}`);
|
|
2951
|
+
}
|
|
2952
|
+
if (RESERVED_VIEWS.has(panel.id)) {
|
|
2953
|
+
throw new RangeError(`${label} id ${panel.id} is reserved by the admin shell`);
|
|
2954
|
+
}
|
|
2955
|
+
if (seen.has(panel.id))
|
|
2956
|
+
throw new RangeError(`duplicate admin view id ${panel.id}`);
|
|
2957
|
+
seen.add(panel.id);
|
|
2958
|
+
if (panel.title.trim() === "")
|
|
2959
|
+
throw new RangeError(`${label} ${panel.id} needs a title`);
|
|
2960
|
+
};
|
|
2684
2961
|
var assertAdminUi = (ui) => {
|
|
2685
|
-
if (!ui
|
|
2962
|
+
if (!ui)
|
|
2686
2963
|
return;
|
|
2687
2964
|
const seen = /* @__PURE__ */ new Set();
|
|
2688
|
-
for (const panel of ui.panels)
|
|
2689
|
-
|
|
2690
|
-
|
|
2965
|
+
for (const panel of ui.panels ?? [])
|
|
2966
|
+
checkPanel(panel, seen, "admin panel");
|
|
2967
|
+
for (const extension of ui.extensions ?? []) {
|
|
2968
|
+
if (extension.kind === "panel") {
|
|
2969
|
+
checkPanel(extension, seen, "admin extension");
|
|
2970
|
+
continue;
|
|
2691
2971
|
}
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
seen.add(panel.id);
|
|
2695
|
-
if (panel.title.trim() === "")
|
|
2696
|
-
throw new RangeError(`admin panel ${panel.id} needs a title`);
|
|
2972
|
+
const id = extension.id ?? "sql";
|
|
2973
|
+
checkPanel({ id, title: extension.title ?? "SQL" }, seen, "admin extension");
|
|
2697
2974
|
}
|
|
2698
2975
|
};
|
|
2699
2976
|
|
|
@@ -2854,9 +3131,24 @@ var renderAdminDocument = (service) => {
|
|
|
2854
3131
|
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
|
|
2855
3132
|
label.field { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--faint); }
|
|
2856
3133
|
label.field input, label.field select, .controls input[type="password"] {
|
|
2857
|
-
background: var(--bg-inset); border: 1px solid var(--line); border-radius: 8px;
|
|
2858
|
-
padding: 7px 8px; min-height: 36px;
|
|
2859
|
-
}
|
|
3134
|
+
background-color: var(--bg-inset); border: 1px solid var(--line); border-radius: 8px;
|
|
3135
|
+
padding: 7px 8px; min-height: 36px; line-height: 1.2;
|
|
3136
|
+
}
|
|
3137
|
+
/* A native menu ignores min-height, so Preset rendered about half as tall as
|
|
3138
|
+
the text fields in the same form. Paint it like those fields. */
|
|
3139
|
+
label.field select {
|
|
3140
|
+
-webkit-appearance: none; appearance: none;
|
|
3141
|
+
padding-right: 28px;
|
|
3142
|
+
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");
|
|
3143
|
+
background-repeat: no-repeat; background-position: right 10px center; background-size: 12px 12px;
|
|
3144
|
+
}
|
|
3145
|
+
.stack > .field > input,
|
|
3146
|
+
.stack > .field > select,
|
|
3147
|
+
.stack > .field > textarea,
|
|
3148
|
+
dialog .field > input,
|
|
3149
|
+
dialog .field > select,
|
|
3150
|
+
dialog .field > textarea { width: 100%; }
|
|
3151
|
+
.icon-btn, .btn, .btn-primary, .btn-quiet, .btn-danger, nav.side button { cursor: pointer; }
|
|
2860
3152
|
.icon-btn, .btn, .btn-primary, .btn-quiet, .btn-danger {
|
|
2861
3153
|
border-radius: 9px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line);
|
|
2862
3154
|
background: var(--bg-elev);
|
|
@@ -2864,6 +3156,14 @@ var renderAdminDocument = (service) => {
|
|
|
2864
3156
|
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
|
|
2865
3157
|
.btn-quiet { background: transparent; }
|
|
2866
3158
|
.btn-danger { color: var(--err); }
|
|
3159
|
+
/* Held after mouseup. Clearing an empty journal changes nothing on screen,
|
|
3160
|
+
so the press itself has to stay visible. */
|
|
3161
|
+
.icon-btn:active, .btn:active, .btn-quiet:active, .btn-danger:active, nav.side button:active,
|
|
3162
|
+
.icon-btn.pressed, .btn.pressed, .btn-quiet.pressed, .btn-danger.pressed, nav.side button.pressed {
|
|
3163
|
+
background: var(--bg-inset); border-color: var(--line-strong); color: var(--ink);
|
|
3164
|
+
}
|
|
3165
|
+
.btn-danger:active, .btn-danger.pressed { background: var(--err-soft); color: var(--err); }
|
|
3166
|
+
.btn-primary:active, .btn-primary.pressed { filter: brightness(0.88); color: var(--accent-ink); }
|
|
2867
3167
|
/* minmax(0, 1fr): a 1fr column will not shrink below its content, so a long
|
|
2868
3168
|
record or the full nav row would widen the page past the viewport. */
|
|
2869
3169
|
.layout {
|
|
@@ -2904,6 +3204,12 @@ var renderAdminDocument = (service) => {
|
|
|
2904
3204
|
border-radius: 999px; padding: 4px 8px;
|
|
2905
3205
|
}
|
|
2906
3206
|
.chip i { color: var(--faint); font-style: normal; }
|
|
3207
|
+
.sql-layout {
|
|
3208
|
+
display: grid; grid-template-columns: minmax(10rem, 16rem) minmax(0, 1fr); gap: 16px;
|
|
3209
|
+
}
|
|
3210
|
+
.sql-tables { display: flex; flex-direction: column; gap: 4px; max-height: 28rem; overflow: auto; }
|
|
3211
|
+
.sql-tables button { text-align: left; }
|
|
3212
|
+
.sql-input { font-family: var(--mono); min-height: 7rem; width: 100%; }
|
|
2907
3213
|
table { width: 100%; border-collapse: collapse; font-size: 14px; }
|
|
2908
3214
|
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
|
|
2909
3215
|
th { color: var(--faint); font-weight: 600; font-size: 12px; }
|
|
@@ -2952,14 +3258,22 @@ var renderAdminDocument = (service) => {
|
|
|
2952
3258
|
input, select, textarea { font-size: 16px; }
|
|
2953
3259
|
.brand, .vendor, .controls { width: 100%; }
|
|
2954
3260
|
label.field, label.field select, label.field input { flex: 1; min-width: 0; }
|
|
2955
|
-
|
|
3261
|
+
/* The layout fills the screen. A single-column grid stretches every auto
|
|
3262
|
+
row, so the tab bar grew with the leftover height and the buttons floated
|
|
3263
|
+
in the middle of it. The bar stays one row; the page below takes the rest. */
|
|
3264
|
+
.layout {
|
|
3265
|
+
grid-template-columns: minmax(0, 1fr);
|
|
3266
|
+
grid-template-rows: auto minmax(0, 1fr);
|
|
3267
|
+
align-content: start;
|
|
3268
|
+
}
|
|
2956
3269
|
nav.side {
|
|
3270
|
+
align-self: start; height: auto;
|
|
2957
3271
|
flex-direction: row; align-items: center; overflow-x: auto; min-width: 0;
|
|
2958
3272
|
border-right: 0; border-bottom: 1px solid var(--line);
|
|
2959
3273
|
padding: 8px;
|
|
2960
3274
|
}
|
|
2961
3275
|
nav.side button { white-space: nowrap; flex: none; }
|
|
2962
|
-
.split { grid-template-columns: minmax(0, 1fr); }
|
|
3276
|
+
.split, .sql-layout { grid-template-columns: minmax(0, 1fr); }
|
|
2963
3277
|
main { padding: 14px; }
|
|
2964
3278
|
table, thead, tbody, tr, th, td { display: block; }
|
|
2965
3279
|
thead { display: none; }
|
|
@@ -3130,6 +3444,24 @@ var json3 = (body) => new Response(JSON.stringify(body), {
|
|
|
3130
3444
|
status: 200,
|
|
3131
3445
|
headers: { "content-type": "application/json; charset=utf-8" }
|
|
3132
3446
|
});
|
|
3447
|
+
var describeExtension = (extension) => {
|
|
3448
|
+
if (extension.kind === "sql") {
|
|
3449
|
+
return {
|
|
3450
|
+
kind: "sql",
|
|
3451
|
+
id: extension.id ?? "sql",
|
|
3452
|
+
title: extension.title ?? "SQL",
|
|
3453
|
+
...extension.description !== void 0 ? { description: extension.description } : {}
|
|
3454
|
+
};
|
|
3455
|
+
}
|
|
3456
|
+
return {
|
|
3457
|
+
kind: "panel",
|
|
3458
|
+
id: extension.id,
|
|
3459
|
+
title: extension.title,
|
|
3460
|
+
...extension.description !== void 0 ? { description: extension.description } : {},
|
|
3461
|
+
html: extension.html,
|
|
3462
|
+
...extension.script !== void 0 ? { script: extension.script } : {}
|
|
3463
|
+
};
|
|
3464
|
+
};
|
|
3133
3465
|
var adminUiRoutes = (service, ui) => {
|
|
3134
3466
|
const shell = () => renderAdminDocument(service);
|
|
3135
3467
|
const document3 = () => ui?.render ? ui.render({ service, defaultHtml: shell }) : shell();
|
|
@@ -3144,7 +3476,8 @@ var adminUiRoutes = (service, ui) => {
|
|
|
3144
3476
|
...panel.description !== void 0 ? { description: panel.description } : {},
|
|
3145
3477
|
html: panel.html,
|
|
3146
3478
|
...panel.script !== void 0 ? { script: panel.script } : {}
|
|
3147
|
-
}))
|
|
3479
|
+
})),
|
|
3480
|
+
extensions: (ui?.extensions ?? []).map(describeExtension)
|
|
3148
3481
|
})
|
|
3149
3482
|
};
|
|
3150
3483
|
};
|
|
@@ -3821,7 +4154,7 @@ var stateAdminRoutes = (routes) => {
|
|
|
3821
4154
|
};
|
|
3822
4155
|
|
|
3823
4156
|
// ../core/dist/version.js
|
|
3824
|
-
var PACKAGE_VERSION = true ? "1.
|
|
4157
|
+
var PACKAGE_VERSION = true ? "1.7.0" : UNRELEASED_VERSION;
|
|
3825
4158
|
|
|
3826
4159
|
// ../core/dist/signing.js
|
|
3827
4160
|
var encoder = new TextEncoder();
|
|
@@ -5145,4 +5478,4 @@ export {
|
|
|
5145
5478
|
matchesCriteria,
|
|
5146
5479
|
MailosaurAPI
|
|
5147
5480
|
};
|
|
5148
|
-
//# sourceMappingURL=chunk-
|
|
5481
|
+
//# sourceMappingURL=chunk-QI7IPPVX.js.map
|