@crvouga/mockingbird-service-resend 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-LUMU355N.js → chunk-4XYXP3QY.js} +2 -2
- package/dist/{chunk-ZNHU32UM.js → chunk-6IUFS2K3.js} +355 -22
- package/dist/chunk-6IUFS2K3.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 +2 -2
- package/dist/chunk-ZNHU32UM.js.map +0 -7
- /package/dist/{chunk-LUMU355N.js.map → chunk-4XYXP3QY.js.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
# Changelog — @crvouga/mockingbird-service-resend
|
|
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
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createRuntime
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-6IUFS2K3.js";
|
|
4
4
|
|
|
5
5
|
// ../../adapters/node/dist/cli.js
|
|
6
6
|
import { readFile } from "node:fs/promises";
|
|
@@ -370,4 +370,4 @@ export {
|
|
|
370
370
|
createServer2 as createServer,
|
|
371
371
|
serveTarget
|
|
372
372
|
};
|
|
373
|
-
//# sourceMappingURL=chunk-
|
|
373
|
+
//# sourceMappingURL=chunk-4XYXP3QY.js.map
|
|
@@ -2002,6 +2002,167 @@ function faultPresetList(value) {
|
|
|
2002
2002
|
})
|
|
2003
2003
|
};
|
|
2004
2004
|
}
|
|
2005
|
+
function mountSqlExplorer(root, api) {
|
|
2006
|
+
const cell = (value) => {
|
|
2007
|
+
if (value === null || value === void 0)
|
|
2008
|
+
return "";
|
|
2009
|
+
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
2010
|
+
return String(value);
|
|
2011
|
+
}
|
|
2012
|
+
return JSON.stringify(value) ?? "";
|
|
2013
|
+
};
|
|
2014
|
+
root.replaceChildren();
|
|
2015
|
+
const layout = document.createElement("div");
|
|
2016
|
+
layout.className = "sql-layout";
|
|
2017
|
+
const tables = document.createElement("div");
|
|
2018
|
+
tables.className = "sql-tables";
|
|
2019
|
+
const stack = document.createElement("div");
|
|
2020
|
+
stack.className = "stack";
|
|
2021
|
+
const banner = document.createElement("p");
|
|
2022
|
+
banner.className = "banner";
|
|
2023
|
+
const grid = document.createElement("div");
|
|
2024
|
+
const input = document.createElement("textarea");
|
|
2025
|
+
input.className = "sql-input";
|
|
2026
|
+
input.spellcheck = false;
|
|
2027
|
+
input.placeholder = "SELECT * FROM ...";
|
|
2028
|
+
const actions = document.createElement("div");
|
|
2029
|
+
actions.className = "row-actions";
|
|
2030
|
+
const run = document.createElement("button");
|
|
2031
|
+
run.type = "button";
|
|
2032
|
+
run.textContent = "Run";
|
|
2033
|
+
actions.append(run);
|
|
2034
|
+
const result = document.createElement("pre");
|
|
2035
|
+
stack.append(banner, grid, input, actions, result);
|
|
2036
|
+
layout.append(tables, stack);
|
|
2037
|
+
root.append(layout);
|
|
2038
|
+
const showError = (error2) => {
|
|
2039
|
+
banner.textContent = error2 instanceof Error ? error2.message : String(error2);
|
|
2040
|
+
banner.classList.add("show");
|
|
2041
|
+
};
|
|
2042
|
+
const clearError = () => {
|
|
2043
|
+
banner.textContent = "";
|
|
2044
|
+
banner.classList.remove("show");
|
|
2045
|
+
};
|
|
2046
|
+
const renderGrid = (columns, rows) => {
|
|
2047
|
+
grid.replaceChildren();
|
|
2048
|
+
if (columns.length === 0) {
|
|
2049
|
+
const empty = document.createElement("p");
|
|
2050
|
+
empty.className = "empty";
|
|
2051
|
+
empty.textContent = "No rows.";
|
|
2052
|
+
grid.append(empty);
|
|
2053
|
+
return;
|
|
2054
|
+
}
|
|
2055
|
+
const table = document.createElement("table");
|
|
2056
|
+
const head = document.createElement("thead");
|
|
2057
|
+
const headRow = document.createElement("tr");
|
|
2058
|
+
for (const column of columns) {
|
|
2059
|
+
const th = document.createElement("th");
|
|
2060
|
+
th.textContent = column;
|
|
2061
|
+
headRow.append(th);
|
|
2062
|
+
}
|
|
2063
|
+
head.append(headRow);
|
|
2064
|
+
const body = document.createElement("tbody");
|
|
2065
|
+
for (const row of rows) {
|
|
2066
|
+
const tr = document.createElement("tr");
|
|
2067
|
+
for (const column of columns) {
|
|
2068
|
+
const td = document.createElement("td");
|
|
2069
|
+
td.dataset.label = column;
|
|
2070
|
+
td.textContent = cell(row[column]);
|
|
2071
|
+
tr.append(td);
|
|
2072
|
+
}
|
|
2073
|
+
body.append(tr);
|
|
2074
|
+
}
|
|
2075
|
+
table.append(head, body);
|
|
2076
|
+
grid.append(table);
|
|
2077
|
+
};
|
|
2078
|
+
const rowsOf = (value) => {
|
|
2079
|
+
if (!isRecord2(value) || !Array.isArray(value.rows))
|
|
2080
|
+
return [];
|
|
2081
|
+
return value.rows.flatMap((row) => isRecord2(row) ? [row] : []);
|
|
2082
|
+
};
|
|
2083
|
+
const columnsOf = (value, rows) => {
|
|
2084
|
+
if (isRecord2(value) && Array.isArray(value.columns)) {
|
|
2085
|
+
const named = value.columns.flatMap((column) => typeof column === "string" ? [column] : []);
|
|
2086
|
+
if (named.length > 0)
|
|
2087
|
+
return named;
|
|
2088
|
+
}
|
|
2089
|
+
const first = rows[0];
|
|
2090
|
+
return first === void 0 ? [] : Object.keys(first);
|
|
2091
|
+
};
|
|
2092
|
+
let selected = "";
|
|
2093
|
+
const loadPage = async (schema, name) => {
|
|
2094
|
+
selected = `${schema}.${name}`;
|
|
2095
|
+
const page = await api.get(`/sql/tables/${encodeURIComponent(schema)}/${encodeURIComponent(name)}?limit=50`);
|
|
2096
|
+
const rows = rowsOf(page);
|
|
2097
|
+
renderGrid(columnsOf(page, rows), rows);
|
|
2098
|
+
const total = isRecord2(page) && typeof page.total === "number" ? page.total : rows.length;
|
|
2099
|
+
result.textContent = `${selected} \xB7 ${total} rows`;
|
|
2100
|
+
for (const button of tables.querySelectorAll("button")) {
|
|
2101
|
+
if (!(button instanceof HTMLButtonElement))
|
|
2102
|
+
continue;
|
|
2103
|
+
button.setAttribute("aria-current", button.dataset.schema === schema && button.dataset.table === name ? "true" : "false");
|
|
2104
|
+
}
|
|
2105
|
+
};
|
|
2106
|
+
const loadTables = async () => {
|
|
2107
|
+
const payload = await api.get("/sql/tables");
|
|
2108
|
+
const listed = isRecord2(payload) && Array.isArray(payload.tables) ? payload.tables : [];
|
|
2109
|
+
tables.replaceChildren();
|
|
2110
|
+
if (listed.length === 0) {
|
|
2111
|
+
const empty = document.createElement("p");
|
|
2112
|
+
empty.className = "empty";
|
|
2113
|
+
empty.textContent = "No tables.";
|
|
2114
|
+
tables.append(empty);
|
|
2115
|
+
return;
|
|
2116
|
+
}
|
|
2117
|
+
for (const item of listed) {
|
|
2118
|
+
if (!isRecord2(item) || typeof item.schema !== "string" || typeof item.name !== "string")
|
|
2119
|
+
continue;
|
|
2120
|
+
const button = document.createElement("button");
|
|
2121
|
+
button.type = "button";
|
|
2122
|
+
button.dataset.schema = item.schema;
|
|
2123
|
+
button.dataset.table = item.name;
|
|
2124
|
+
button.textContent = `${item.schema}.${item.name}`;
|
|
2125
|
+
tables.append(button);
|
|
2126
|
+
}
|
|
2127
|
+
};
|
|
2128
|
+
tables.addEventListener("click", (event) => {
|
|
2129
|
+
const target = event.target;
|
|
2130
|
+
if (!(target instanceof Element))
|
|
2131
|
+
return;
|
|
2132
|
+
const button = target.closest("button");
|
|
2133
|
+
if (!(button instanceof HTMLButtonElement))
|
|
2134
|
+
return;
|
|
2135
|
+
const schema = button.dataset.schema;
|
|
2136
|
+
const name = button.dataset.table;
|
|
2137
|
+
if (schema === void 0 || name === void 0)
|
|
2138
|
+
return;
|
|
2139
|
+
clearError();
|
|
2140
|
+
loadPage(schema, name).catch(showError);
|
|
2141
|
+
});
|
|
2142
|
+
run.addEventListener("click", () => {
|
|
2143
|
+
const sql = input.value.trim();
|
|
2144
|
+
if (sql === "") {
|
|
2145
|
+
showError(new Error("Enter a statement"));
|
|
2146
|
+
return;
|
|
2147
|
+
}
|
|
2148
|
+
clearError();
|
|
2149
|
+
api.send("POST", "/sql/query", { sql }).then((payload) => {
|
|
2150
|
+
const rows = rowsOf(payload);
|
|
2151
|
+
renderGrid(columnsOf(payload, rows), rows);
|
|
2152
|
+
const count = isRecord2(payload) && typeof payload.rowCount === "number" ? payload.rowCount : rows.length;
|
|
2153
|
+
const truncated = isRecord2(payload) && payload.truncated === true ? " (truncated)" : "";
|
|
2154
|
+
result.textContent = `${count} rows${truncated}`;
|
|
2155
|
+
}).catch(showError);
|
|
2156
|
+
});
|
|
2157
|
+
const namespace = document.getElementById("namespace");
|
|
2158
|
+
if (namespace) {
|
|
2159
|
+
namespace.addEventListener("change", () => {
|
|
2160
|
+
clearError();
|
|
2161
|
+
loadTables().catch(showError);
|
|
2162
|
+
});
|
|
2163
|
+
}
|
|
2164
|
+
loadTables().catch(showError);
|
|
2165
|
+
}
|
|
2005
2166
|
function bootAdmin(config) {
|
|
2006
2167
|
const fieldKinds = ["string", "number", "boolean", "null", "object", "array", "unknown"];
|
|
2007
2168
|
const sources = ["declared", "inferred", "mixed"];
|
|
@@ -2442,6 +2603,50 @@ function bootAdmin(config) {
|
|
|
2442
2603
|
if (render)
|
|
2443
2604
|
await render();
|
|
2444
2605
|
}
|
|
2606
|
+
const delay = (ms) => new Promise((resolve) => {
|
|
2607
|
+
window.setTimeout(resolve, ms);
|
|
2608
|
+
});
|
|
2609
|
+
const confirmAction = async (button, pending, done, work) => {
|
|
2610
|
+
if (button.dataset.pending === "1")
|
|
2611
|
+
return;
|
|
2612
|
+
const label = button.textContent ?? "";
|
|
2613
|
+
const width = button.offsetWidth;
|
|
2614
|
+
button.dataset.pending = "1";
|
|
2615
|
+
button.classList.add("pressed");
|
|
2616
|
+
button.setAttribute("aria-busy", "true");
|
|
2617
|
+
button.style.minWidth = `${width}px`;
|
|
2618
|
+
button.textContent = pending;
|
|
2619
|
+
try {
|
|
2620
|
+
await work();
|
|
2621
|
+
button.textContent = done;
|
|
2622
|
+
await delay(1e3);
|
|
2623
|
+
} catch (error2) {
|
|
2624
|
+
showError(error2);
|
|
2625
|
+
} finally {
|
|
2626
|
+
button.textContent = label;
|
|
2627
|
+
button.style.minWidth = "";
|
|
2628
|
+
button.classList.remove("pressed");
|
|
2629
|
+
button.removeAttribute("aria-busy");
|
|
2630
|
+
delete button.dataset.pending;
|
|
2631
|
+
}
|
|
2632
|
+
};
|
|
2633
|
+
document.addEventListener("click", (event) => {
|
|
2634
|
+
const target = event.target;
|
|
2635
|
+
if (!(target instanceof Element))
|
|
2636
|
+
return;
|
|
2637
|
+
const button = target.closest("button");
|
|
2638
|
+
if (!(button instanceof HTMLButtonElement) || button.dataset.pending === "1")
|
|
2639
|
+
return;
|
|
2640
|
+
button.classList.add("pressed");
|
|
2641
|
+
const token = String(Date.now());
|
|
2642
|
+
button.dataset.press = token;
|
|
2643
|
+
window.setTimeout(() => {
|
|
2644
|
+
if (button.dataset.press !== token || button.dataset.pending === "1")
|
|
2645
|
+
return;
|
|
2646
|
+
button.classList.remove("pressed");
|
|
2647
|
+
delete button.dataset.press;
|
|
2648
|
+
}, 450);
|
|
2649
|
+
});
|
|
2445
2650
|
el("namespace", HTMLSelectElement).addEventListener("change", () => {
|
|
2446
2651
|
state.namespace = el("namespace", HTMLSelectElement).value;
|
|
2447
2652
|
refresh().catch(showError);
|
|
@@ -2452,7 +2657,7 @@ function bootAdmin(config) {
|
|
|
2452
2657
|
refresh().catch(showError);
|
|
2453
2658
|
});
|
|
2454
2659
|
el("refresh", HTMLButtonElement).addEventListener("click", () => {
|
|
2455
|
-
refresh().catch(showError);
|
|
2660
|
+
confirmAction(el("refresh", HTMLButtonElement), "Refreshing...", "Updated", () => refresh()).catch(showError);
|
|
2456
2661
|
});
|
|
2457
2662
|
el("collections", HTMLElement).addEventListener("click", (event) => {
|
|
2458
2663
|
const target = event.target;
|
|
@@ -2575,10 +2780,10 @@ function bootAdmin(config) {
|
|
|
2575
2780
|
}).then(() => renderFaults()).catch(showError);
|
|
2576
2781
|
});
|
|
2577
2782
|
el("fault-clear", HTMLButtonElement).addEventListener("click", () => {
|
|
2578
|
-
api("DELETE", "/faults").then(() => renderFaults()).catch(showError);
|
|
2783
|
+
confirmAction(el("fault-clear", HTMLButtonElement), "Clearing...", "Cleared", () => api("DELETE", "/faults").then(() => renderFaults())).catch(showError);
|
|
2579
2784
|
});
|
|
2580
2785
|
el("journal-clear", HTMLButtonElement).addEventListener("click", () => {
|
|
2581
|
-
api("DELETE", "/requests").then(() => renderJournal()).catch(showError);
|
|
2786
|
+
confirmAction(el("journal-clear", HTMLButtonElement), "Clearing...", "Cleared", () => api("DELETE", "/requests").then(() => renderJournal())).catch(showError);
|
|
2582
2787
|
});
|
|
2583
2788
|
el("route-list", HTMLElement).addEventListener("click", (event) => {
|
|
2584
2789
|
const target = event.target;
|
|
@@ -2634,6 +2839,22 @@ function bootAdmin(config) {
|
|
|
2634
2839
|
panel.script = value.script;
|
|
2635
2840
|
return panel;
|
|
2636
2841
|
};
|
|
2842
|
+
const decodeExtension = (value) => {
|
|
2843
|
+
if (!isRecord2(value))
|
|
2844
|
+
return void 0;
|
|
2845
|
+
if (value.kind === "sql") {
|
|
2846
|
+
return {
|
|
2847
|
+
kind: "sql",
|
|
2848
|
+
id: typeof value.id === "string" && value.id !== "" ? value.id : "sql",
|
|
2849
|
+
title: typeof value.title === "string" && value.title !== "" ? value.title : "SQL",
|
|
2850
|
+
description: typeof value.description === "string" ? value.description : "Browse tables and run queries."
|
|
2851
|
+
};
|
|
2852
|
+
}
|
|
2853
|
+
if (value.kind !== "panel")
|
|
2854
|
+
return void 0;
|
|
2855
|
+
const panel = decodePanel(value);
|
|
2856
|
+
return panel === void 0 ? void 0 : { kind: "panel", ...panel };
|
|
2857
|
+
};
|
|
2637
2858
|
const mountPanels = (panels) => {
|
|
2638
2859
|
const nav = el("nav", HTMLElement);
|
|
2639
2860
|
const views = el("views", HTMLElement);
|
|
@@ -2687,15 +2908,57 @@ function bootAdmin(config) {
|
|
|
2687
2908
|
return decoded === void 0 ? [] : [decoded];
|
|
2688
2909
|
});
|
|
2689
2910
|
mountPanels(panels);
|
|
2911
|
+
const extensions = requireList(isRecord2(manifest) ? manifest.extensions : void 0, "Extensions").flatMap((extension) => {
|
|
2912
|
+
const decoded = decodeExtension(extension);
|
|
2913
|
+
return decoded === void 0 ? [] : [decoded];
|
|
2914
|
+
});
|
|
2915
|
+
const extensionPanels = extensions.flatMap((extension) => extension.kind === "panel" ? [extension] : []);
|
|
2916
|
+
mountPanels(extensionPanels);
|
|
2917
|
+
for (const extension of extensions) {
|
|
2918
|
+
if (extension.kind !== "sql")
|
|
2919
|
+
continue;
|
|
2920
|
+
const nav = el("nav", HTMLElement);
|
|
2921
|
+
const views = el("views", HTMLElement);
|
|
2922
|
+
const button = document.createElement("button");
|
|
2923
|
+
button.type = "button";
|
|
2924
|
+
button.dataset.view = extension.id;
|
|
2925
|
+
button.textContent = extension.title;
|
|
2926
|
+
nav.append(button);
|
|
2927
|
+
const section = document.createElement("section");
|
|
2928
|
+
section.className = "view";
|
|
2929
|
+
section.id = `view-${extension.id}`;
|
|
2930
|
+
section.hidden = true;
|
|
2931
|
+
const title = document.createElement("h2");
|
|
2932
|
+
title.textContent = extension.title;
|
|
2933
|
+
const lede = document.createElement("p");
|
|
2934
|
+
lede.className = "lede";
|
|
2935
|
+
lede.textContent = extension.description;
|
|
2936
|
+
const body = document.createElement("div");
|
|
2937
|
+
body.className = "panel-body";
|
|
2938
|
+
section.append(title, lede, body);
|
|
2939
|
+
views.append(section);
|
|
2940
|
+
mountSqlExplorer(body, panelApi);
|
|
2941
|
+
}
|
|
2690
2942
|
return refresh();
|
|
2691
2943
|
}).catch(showError);
|
|
2692
2944
|
}
|
|
2693
|
-
var clientPrelude = [
|
|
2945
|
+
var clientPrelude = [
|
|
2946
|
+
isRecord2,
|
|
2947
|
+
mountAdminBrand,
|
|
2948
|
+
startAdminBrand,
|
|
2949
|
+
faultPresetList,
|
|
2950
|
+
mountSqlExplorer,
|
|
2951
|
+
bootAdmin
|
|
2952
|
+
].map((fn) => fn.toString()).join("\n");
|
|
2694
2953
|
var adminClientSource = (config) => {
|
|
2695
2954
|
const payload = JSON.stringify(config).replace(/</g, "\\u003c");
|
|
2955
|
+
const entry = bootAdmin.name;
|
|
2956
|
+
if (!/^[A-Za-z_$][\w$]*$/.test(entry)) {
|
|
2957
|
+
throw new Error("admin client cannot call its boot function");
|
|
2958
|
+
}
|
|
2696
2959
|
return `<script>
|
|
2697
2960
|
${clientPrelude}
|
|
2698
|
-
|
|
2961
|
+
${entry}(${payload});
|
|
2699
2962
|
</script>`;
|
|
2700
2963
|
};
|
|
2701
2964
|
|
|
@@ -2736,19 +2999,33 @@ var STANDARD_ADMIN_ROUTES = [
|
|
|
2736
2999
|
"GET /ui/manifest"
|
|
2737
3000
|
];
|
|
2738
3001
|
var PANEL_ID = /^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$/;
|
|
3002
|
+
var RESERVED_VIEWS = /* @__PURE__ */ new Set(["overview", "state", "clock", "faults", "journal", "routes"]);
|
|
3003
|
+
var checkPanel = (panel, seen, label) => {
|
|
3004
|
+
if (!PANEL_ID.test(panel.id)) {
|
|
3005
|
+
throw new RangeError(`${label} id must match ${PANEL_ID}: ${JSON.stringify(panel.id)}`);
|
|
3006
|
+
}
|
|
3007
|
+
if (RESERVED_VIEWS.has(panel.id)) {
|
|
3008
|
+
throw new RangeError(`${label} id ${panel.id} is reserved by the admin shell`);
|
|
3009
|
+
}
|
|
3010
|
+
if (seen.has(panel.id))
|
|
3011
|
+
throw new RangeError(`duplicate admin view id ${panel.id}`);
|
|
3012
|
+
seen.add(panel.id);
|
|
3013
|
+
if (panel.title.trim() === "")
|
|
3014
|
+
throw new RangeError(`${label} ${panel.id} needs a title`);
|
|
3015
|
+
};
|
|
2739
3016
|
var assertAdminUi = (ui) => {
|
|
2740
|
-
if (!ui
|
|
3017
|
+
if (!ui)
|
|
2741
3018
|
return;
|
|
2742
3019
|
const seen = /* @__PURE__ */ new Set();
|
|
2743
|
-
for (const panel of ui.panels)
|
|
2744
|
-
|
|
2745
|
-
|
|
3020
|
+
for (const panel of ui.panels ?? [])
|
|
3021
|
+
checkPanel(panel, seen, "admin panel");
|
|
3022
|
+
for (const extension of ui.extensions ?? []) {
|
|
3023
|
+
if (extension.kind === "panel") {
|
|
3024
|
+
checkPanel(extension, seen, "admin extension");
|
|
3025
|
+
continue;
|
|
2746
3026
|
}
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
seen.add(panel.id);
|
|
2750
|
-
if (panel.title.trim() === "")
|
|
2751
|
-
throw new RangeError(`admin panel ${panel.id} needs a title`);
|
|
3027
|
+
const id = extension.id ?? "sql";
|
|
3028
|
+
checkPanel({ id, title: extension.title ?? "SQL" }, seen, "admin extension");
|
|
2752
3029
|
}
|
|
2753
3030
|
};
|
|
2754
3031
|
|
|
@@ -2909,9 +3186,24 @@ var renderAdminDocument = (service) => {
|
|
|
2909
3186
|
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
|
|
2910
3187
|
label.field { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--faint); }
|
|
2911
3188
|
label.field input, label.field select, .controls input[type="password"] {
|
|
2912
|
-
background: var(--bg-inset); border: 1px solid var(--line); border-radius: 8px;
|
|
2913
|
-
padding: 7px 8px; min-height: 36px;
|
|
2914
|
-
}
|
|
3189
|
+
background-color: var(--bg-inset); border: 1px solid var(--line); border-radius: 8px;
|
|
3190
|
+
padding: 7px 8px; min-height: 36px; line-height: 1.2;
|
|
3191
|
+
}
|
|
3192
|
+
/* A native menu ignores min-height, so Preset rendered about half as tall as
|
|
3193
|
+
the text fields in the same form. Paint it like those fields. */
|
|
3194
|
+
label.field select {
|
|
3195
|
+
-webkit-appearance: none; appearance: none;
|
|
3196
|
+
padding-right: 28px;
|
|
3197
|
+
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");
|
|
3198
|
+
background-repeat: no-repeat; background-position: right 10px center; background-size: 12px 12px;
|
|
3199
|
+
}
|
|
3200
|
+
.stack > .field > input,
|
|
3201
|
+
.stack > .field > select,
|
|
3202
|
+
.stack > .field > textarea,
|
|
3203
|
+
dialog .field > input,
|
|
3204
|
+
dialog .field > select,
|
|
3205
|
+
dialog .field > textarea { width: 100%; }
|
|
3206
|
+
.icon-btn, .btn, .btn-primary, .btn-quiet, .btn-danger, nav.side button { cursor: pointer; }
|
|
2915
3207
|
.icon-btn, .btn, .btn-primary, .btn-quiet, .btn-danger {
|
|
2916
3208
|
border-radius: 9px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line);
|
|
2917
3209
|
background: var(--bg-elev);
|
|
@@ -2919,6 +3211,14 @@ var renderAdminDocument = (service) => {
|
|
|
2919
3211
|
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
|
|
2920
3212
|
.btn-quiet { background: transparent; }
|
|
2921
3213
|
.btn-danger { color: var(--err); }
|
|
3214
|
+
/* Held after mouseup. Clearing an empty journal changes nothing on screen,
|
|
3215
|
+
so the press itself has to stay visible. */
|
|
3216
|
+
.icon-btn:active, .btn:active, .btn-quiet:active, .btn-danger:active, nav.side button:active,
|
|
3217
|
+
.icon-btn.pressed, .btn.pressed, .btn-quiet.pressed, .btn-danger.pressed, nav.side button.pressed {
|
|
3218
|
+
background: var(--bg-inset); border-color: var(--line-strong); color: var(--ink);
|
|
3219
|
+
}
|
|
3220
|
+
.btn-danger:active, .btn-danger.pressed { background: var(--err-soft); color: var(--err); }
|
|
3221
|
+
.btn-primary:active, .btn-primary.pressed { filter: brightness(0.88); color: var(--accent-ink); }
|
|
2922
3222
|
/* minmax(0, 1fr): a 1fr column will not shrink below its content, so a long
|
|
2923
3223
|
record or the full nav row would widen the page past the viewport. */
|
|
2924
3224
|
.layout {
|
|
@@ -2959,6 +3259,12 @@ var renderAdminDocument = (service) => {
|
|
|
2959
3259
|
border-radius: 999px; padding: 4px 8px;
|
|
2960
3260
|
}
|
|
2961
3261
|
.chip i { color: var(--faint); font-style: normal; }
|
|
3262
|
+
.sql-layout {
|
|
3263
|
+
display: grid; grid-template-columns: minmax(10rem, 16rem) minmax(0, 1fr); gap: 16px;
|
|
3264
|
+
}
|
|
3265
|
+
.sql-tables { display: flex; flex-direction: column; gap: 4px; max-height: 28rem; overflow: auto; }
|
|
3266
|
+
.sql-tables button { text-align: left; }
|
|
3267
|
+
.sql-input { font-family: var(--mono); min-height: 7rem; width: 100%; }
|
|
2962
3268
|
table { width: 100%; border-collapse: collapse; font-size: 14px; }
|
|
2963
3269
|
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
|
|
2964
3270
|
th { color: var(--faint); font-weight: 600; font-size: 12px; }
|
|
@@ -3007,14 +3313,22 @@ var renderAdminDocument = (service) => {
|
|
|
3007
3313
|
input, select, textarea { font-size: 16px; }
|
|
3008
3314
|
.brand, .vendor, .controls { width: 100%; }
|
|
3009
3315
|
label.field, label.field select, label.field input { flex: 1; min-width: 0; }
|
|
3010
|
-
|
|
3316
|
+
/* The layout fills the screen. A single-column grid stretches every auto
|
|
3317
|
+
row, so the tab bar grew with the leftover height and the buttons floated
|
|
3318
|
+
in the middle of it. The bar stays one row; the page below takes the rest. */
|
|
3319
|
+
.layout {
|
|
3320
|
+
grid-template-columns: minmax(0, 1fr);
|
|
3321
|
+
grid-template-rows: auto minmax(0, 1fr);
|
|
3322
|
+
align-content: start;
|
|
3323
|
+
}
|
|
3011
3324
|
nav.side {
|
|
3325
|
+
align-self: start; height: auto;
|
|
3012
3326
|
flex-direction: row; align-items: center; overflow-x: auto; min-width: 0;
|
|
3013
3327
|
border-right: 0; border-bottom: 1px solid var(--line);
|
|
3014
3328
|
padding: 8px;
|
|
3015
3329
|
}
|
|
3016
3330
|
nav.side button { white-space: nowrap; flex: none; }
|
|
3017
|
-
.split { grid-template-columns: minmax(0, 1fr); }
|
|
3331
|
+
.split, .sql-layout { grid-template-columns: minmax(0, 1fr); }
|
|
3018
3332
|
main { padding: 14px; }
|
|
3019
3333
|
table, thead, tbody, tr, th, td { display: block; }
|
|
3020
3334
|
thead { display: none; }
|
|
@@ -3185,6 +3499,24 @@ var json3 = (body) => new Response(JSON.stringify(body), {
|
|
|
3185
3499
|
status: 200,
|
|
3186
3500
|
headers: { "content-type": "application/json; charset=utf-8" }
|
|
3187
3501
|
});
|
|
3502
|
+
var describeExtension = (extension) => {
|
|
3503
|
+
if (extension.kind === "sql") {
|
|
3504
|
+
return {
|
|
3505
|
+
kind: "sql",
|
|
3506
|
+
id: extension.id ?? "sql",
|
|
3507
|
+
title: extension.title ?? "SQL",
|
|
3508
|
+
...extension.description !== void 0 ? { description: extension.description } : {}
|
|
3509
|
+
};
|
|
3510
|
+
}
|
|
3511
|
+
return {
|
|
3512
|
+
kind: "panel",
|
|
3513
|
+
id: extension.id,
|
|
3514
|
+
title: extension.title,
|
|
3515
|
+
...extension.description !== void 0 ? { description: extension.description } : {},
|
|
3516
|
+
html: extension.html,
|
|
3517
|
+
...extension.script !== void 0 ? { script: extension.script } : {}
|
|
3518
|
+
};
|
|
3519
|
+
};
|
|
3188
3520
|
var adminUiRoutes = (service, ui) => {
|
|
3189
3521
|
const shell = () => renderAdminDocument(service);
|
|
3190
3522
|
const document3 = () => ui?.render ? ui.render({ service, defaultHtml: shell }) : shell();
|
|
@@ -3199,7 +3531,8 @@ var adminUiRoutes = (service, ui) => {
|
|
|
3199
3531
|
...panel.description !== void 0 ? { description: panel.description } : {},
|
|
3200
3532
|
html: panel.html,
|
|
3201
3533
|
...panel.script !== void 0 ? { script: panel.script } : {}
|
|
3202
|
-
}))
|
|
3534
|
+
})),
|
|
3535
|
+
extensions: (ui?.extensions ?? []).map(describeExtension)
|
|
3203
3536
|
})
|
|
3204
3537
|
};
|
|
3205
3538
|
};
|
|
@@ -3876,7 +4209,7 @@ var stateAdminRoutes = (routes) => {
|
|
|
3876
4209
|
};
|
|
3877
4210
|
|
|
3878
4211
|
// ../core/dist/version.js
|
|
3879
|
-
var PACKAGE_VERSION = true ? "1.
|
|
4212
|
+
var PACKAGE_VERSION = true ? "1.7.0" : UNRELEASED_VERSION;
|
|
3880
4213
|
|
|
3881
4214
|
// ../core/dist/signing.js
|
|
3882
4215
|
var encoder = new TextEncoder();
|
|
@@ -5592,4 +5925,4 @@ export {
|
|
|
5592
5925
|
bareAddress,
|
|
5593
5926
|
ResendAPI
|
|
5594
5927
|
};
|
|
5595
|
-
//# sourceMappingURL=chunk-
|
|
5928
|
+
//# sourceMappingURL=chunk-6IUFS2K3.js.map
|