@crvouga/mockingbird-service-fullscript 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-ZDHQHF3E.js → chunk-7JQ2IK4I.js} +2 -2
- package/dist/{chunk-OBQHBBFC.js → chunk-Q5BBSHKJ.js} +355 -22
- package/dist/chunk-Q5BBSHKJ.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-OBQHBBFC.js.map +0 -7
- /package/dist/{chunk-ZDHQHF3E.js.map → chunk-7JQ2IK4I.js.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
# Changelog — @crvouga/mockingbird-service-fullscript
|
|
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-Q5BBSHKJ.js";
|
|
4
4
|
|
|
5
5
|
// ../../adapters/node/dist/cli.js
|
|
6
6
|
import { readFile } from "node:fs/promises";
|
|
@@ -381,4 +381,4 @@ export {
|
|
|
381
381
|
createServer2 as createServer,
|
|
382
382
|
serveTarget
|
|
383
383
|
};
|
|
384
|
-
//# sourceMappingURL=chunk-
|
|
384
|
+
//# sourceMappingURL=chunk-7JQ2IK4I.js.map
|
|
@@ -1887,6 +1887,167 @@ function faultPresetList(value) {
|
|
|
1887
1887
|
})
|
|
1888
1888
|
};
|
|
1889
1889
|
}
|
|
1890
|
+
function mountSqlExplorer(root, api) {
|
|
1891
|
+
const cell = (value) => {
|
|
1892
|
+
if (value === null || value === void 0)
|
|
1893
|
+
return "";
|
|
1894
|
+
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
1895
|
+
return String(value);
|
|
1896
|
+
}
|
|
1897
|
+
return JSON.stringify(value) ?? "";
|
|
1898
|
+
};
|
|
1899
|
+
root.replaceChildren();
|
|
1900
|
+
const layout = document.createElement("div");
|
|
1901
|
+
layout.className = "sql-layout";
|
|
1902
|
+
const tables = document.createElement("div");
|
|
1903
|
+
tables.className = "sql-tables";
|
|
1904
|
+
const stack = document.createElement("div");
|
|
1905
|
+
stack.className = "stack";
|
|
1906
|
+
const banner = document.createElement("p");
|
|
1907
|
+
banner.className = "banner";
|
|
1908
|
+
const grid = document.createElement("div");
|
|
1909
|
+
const input = document.createElement("textarea");
|
|
1910
|
+
input.className = "sql-input";
|
|
1911
|
+
input.spellcheck = false;
|
|
1912
|
+
input.placeholder = "SELECT * FROM ...";
|
|
1913
|
+
const actions = document.createElement("div");
|
|
1914
|
+
actions.className = "row-actions";
|
|
1915
|
+
const run = document.createElement("button");
|
|
1916
|
+
run.type = "button";
|
|
1917
|
+
run.textContent = "Run";
|
|
1918
|
+
actions.append(run);
|
|
1919
|
+
const result = document.createElement("pre");
|
|
1920
|
+
stack.append(banner, grid, input, actions, result);
|
|
1921
|
+
layout.append(tables, stack);
|
|
1922
|
+
root.append(layout);
|
|
1923
|
+
const showError = (error) => {
|
|
1924
|
+
banner.textContent = error instanceof Error ? error.message : String(error);
|
|
1925
|
+
banner.classList.add("show");
|
|
1926
|
+
};
|
|
1927
|
+
const clearError = () => {
|
|
1928
|
+
banner.textContent = "";
|
|
1929
|
+
banner.classList.remove("show");
|
|
1930
|
+
};
|
|
1931
|
+
const renderGrid = (columns, rows) => {
|
|
1932
|
+
grid.replaceChildren();
|
|
1933
|
+
if (columns.length === 0) {
|
|
1934
|
+
const empty = document.createElement("p");
|
|
1935
|
+
empty.className = "empty";
|
|
1936
|
+
empty.textContent = "No rows.";
|
|
1937
|
+
grid.append(empty);
|
|
1938
|
+
return;
|
|
1939
|
+
}
|
|
1940
|
+
const table = document.createElement("table");
|
|
1941
|
+
const head = document.createElement("thead");
|
|
1942
|
+
const headRow = document.createElement("tr");
|
|
1943
|
+
for (const column of columns) {
|
|
1944
|
+
const th = document.createElement("th");
|
|
1945
|
+
th.textContent = column;
|
|
1946
|
+
headRow.append(th);
|
|
1947
|
+
}
|
|
1948
|
+
head.append(headRow);
|
|
1949
|
+
const body = document.createElement("tbody");
|
|
1950
|
+
for (const row of rows) {
|
|
1951
|
+
const tr = document.createElement("tr");
|
|
1952
|
+
for (const column of columns) {
|
|
1953
|
+
const td = document.createElement("td");
|
|
1954
|
+
td.dataset.label = column;
|
|
1955
|
+
td.textContent = cell(row[column]);
|
|
1956
|
+
tr.append(td);
|
|
1957
|
+
}
|
|
1958
|
+
body.append(tr);
|
|
1959
|
+
}
|
|
1960
|
+
table.append(head, body);
|
|
1961
|
+
grid.append(table);
|
|
1962
|
+
};
|
|
1963
|
+
const rowsOf = (value) => {
|
|
1964
|
+
if (!isRecord2(value) || !Array.isArray(value.rows))
|
|
1965
|
+
return [];
|
|
1966
|
+
return value.rows.flatMap((row) => isRecord2(row) ? [row] : []);
|
|
1967
|
+
};
|
|
1968
|
+
const columnsOf = (value, rows) => {
|
|
1969
|
+
if (isRecord2(value) && Array.isArray(value.columns)) {
|
|
1970
|
+
const named = value.columns.flatMap((column) => typeof column === "string" ? [column] : []);
|
|
1971
|
+
if (named.length > 0)
|
|
1972
|
+
return named;
|
|
1973
|
+
}
|
|
1974
|
+
const first = rows[0];
|
|
1975
|
+
return first === void 0 ? [] : Object.keys(first);
|
|
1976
|
+
};
|
|
1977
|
+
let selected = "";
|
|
1978
|
+
const loadPage = async (schema, name) => {
|
|
1979
|
+
selected = `${schema}.${name}`;
|
|
1980
|
+
const page2 = await api.get(`/sql/tables/${encodeURIComponent(schema)}/${encodeURIComponent(name)}?limit=50`);
|
|
1981
|
+
const rows = rowsOf(page2);
|
|
1982
|
+
renderGrid(columnsOf(page2, rows), rows);
|
|
1983
|
+
const total = isRecord2(page2) && typeof page2.total === "number" ? page2.total : rows.length;
|
|
1984
|
+
result.textContent = `${selected} \xB7 ${total} rows`;
|
|
1985
|
+
for (const button of tables.querySelectorAll("button")) {
|
|
1986
|
+
if (!(button instanceof HTMLButtonElement))
|
|
1987
|
+
continue;
|
|
1988
|
+
button.setAttribute("aria-current", button.dataset.schema === schema && button.dataset.table === name ? "true" : "false");
|
|
1989
|
+
}
|
|
1990
|
+
};
|
|
1991
|
+
const loadTables = async () => {
|
|
1992
|
+
const payload = await api.get("/sql/tables");
|
|
1993
|
+
const listed = isRecord2(payload) && Array.isArray(payload.tables) ? payload.tables : [];
|
|
1994
|
+
tables.replaceChildren();
|
|
1995
|
+
if (listed.length === 0) {
|
|
1996
|
+
const empty = document.createElement("p");
|
|
1997
|
+
empty.className = "empty";
|
|
1998
|
+
empty.textContent = "No tables.";
|
|
1999
|
+
tables.append(empty);
|
|
2000
|
+
return;
|
|
2001
|
+
}
|
|
2002
|
+
for (const item of listed) {
|
|
2003
|
+
if (!isRecord2(item) || typeof item.schema !== "string" || typeof item.name !== "string")
|
|
2004
|
+
continue;
|
|
2005
|
+
const button = document.createElement("button");
|
|
2006
|
+
button.type = "button";
|
|
2007
|
+
button.dataset.schema = item.schema;
|
|
2008
|
+
button.dataset.table = item.name;
|
|
2009
|
+
button.textContent = `${item.schema}.${item.name}`;
|
|
2010
|
+
tables.append(button);
|
|
2011
|
+
}
|
|
2012
|
+
};
|
|
2013
|
+
tables.addEventListener("click", (event) => {
|
|
2014
|
+
const target = event.target;
|
|
2015
|
+
if (!(target instanceof Element))
|
|
2016
|
+
return;
|
|
2017
|
+
const button = target.closest("button");
|
|
2018
|
+
if (!(button instanceof HTMLButtonElement))
|
|
2019
|
+
return;
|
|
2020
|
+
const schema = button.dataset.schema;
|
|
2021
|
+
const name = button.dataset.table;
|
|
2022
|
+
if (schema === void 0 || name === void 0)
|
|
2023
|
+
return;
|
|
2024
|
+
clearError();
|
|
2025
|
+
loadPage(schema, name).catch(showError);
|
|
2026
|
+
});
|
|
2027
|
+
run.addEventListener("click", () => {
|
|
2028
|
+
const sql = input.value.trim();
|
|
2029
|
+
if (sql === "") {
|
|
2030
|
+
showError(new Error("Enter a statement"));
|
|
2031
|
+
return;
|
|
2032
|
+
}
|
|
2033
|
+
clearError();
|
|
2034
|
+
api.send("POST", "/sql/query", { sql }).then((payload) => {
|
|
2035
|
+
const rows = rowsOf(payload);
|
|
2036
|
+
renderGrid(columnsOf(payload, rows), rows);
|
|
2037
|
+
const count = isRecord2(payload) && typeof payload.rowCount === "number" ? payload.rowCount : rows.length;
|
|
2038
|
+
const truncated = isRecord2(payload) && payload.truncated === true ? " (truncated)" : "";
|
|
2039
|
+
result.textContent = `${count} rows${truncated}`;
|
|
2040
|
+
}).catch(showError);
|
|
2041
|
+
});
|
|
2042
|
+
const namespace = document.getElementById("namespace");
|
|
2043
|
+
if (namespace) {
|
|
2044
|
+
namespace.addEventListener("change", () => {
|
|
2045
|
+
clearError();
|
|
2046
|
+
loadTables().catch(showError);
|
|
2047
|
+
});
|
|
2048
|
+
}
|
|
2049
|
+
loadTables().catch(showError);
|
|
2050
|
+
}
|
|
1890
2051
|
function bootAdmin(config) {
|
|
1891
2052
|
const fieldKinds = ["string", "number", "boolean", "null", "object", "array", "unknown"];
|
|
1892
2053
|
const sources = ["declared", "inferred", "mixed"];
|
|
@@ -2327,6 +2488,50 @@ function bootAdmin(config) {
|
|
|
2327
2488
|
if (render)
|
|
2328
2489
|
await render();
|
|
2329
2490
|
}
|
|
2491
|
+
const delay = (ms) => new Promise((resolve) => {
|
|
2492
|
+
window.setTimeout(resolve, ms);
|
|
2493
|
+
});
|
|
2494
|
+
const confirmAction = async (button, pending, done, work) => {
|
|
2495
|
+
if (button.dataset.pending === "1")
|
|
2496
|
+
return;
|
|
2497
|
+
const label = button.textContent ?? "";
|
|
2498
|
+
const width = button.offsetWidth;
|
|
2499
|
+
button.dataset.pending = "1";
|
|
2500
|
+
button.classList.add("pressed");
|
|
2501
|
+
button.setAttribute("aria-busy", "true");
|
|
2502
|
+
button.style.minWidth = `${width}px`;
|
|
2503
|
+
button.textContent = pending;
|
|
2504
|
+
try {
|
|
2505
|
+
await work();
|
|
2506
|
+
button.textContent = done;
|
|
2507
|
+
await delay(1e3);
|
|
2508
|
+
} catch (error) {
|
|
2509
|
+
showError(error);
|
|
2510
|
+
} finally {
|
|
2511
|
+
button.textContent = label;
|
|
2512
|
+
button.style.minWidth = "";
|
|
2513
|
+
button.classList.remove("pressed");
|
|
2514
|
+
button.removeAttribute("aria-busy");
|
|
2515
|
+
delete button.dataset.pending;
|
|
2516
|
+
}
|
|
2517
|
+
};
|
|
2518
|
+
document.addEventListener("click", (event) => {
|
|
2519
|
+
const target = event.target;
|
|
2520
|
+
if (!(target instanceof Element))
|
|
2521
|
+
return;
|
|
2522
|
+
const button = target.closest("button");
|
|
2523
|
+
if (!(button instanceof HTMLButtonElement) || button.dataset.pending === "1")
|
|
2524
|
+
return;
|
|
2525
|
+
button.classList.add("pressed");
|
|
2526
|
+
const token = String(Date.now());
|
|
2527
|
+
button.dataset.press = token;
|
|
2528
|
+
window.setTimeout(() => {
|
|
2529
|
+
if (button.dataset.press !== token || button.dataset.pending === "1")
|
|
2530
|
+
return;
|
|
2531
|
+
button.classList.remove("pressed");
|
|
2532
|
+
delete button.dataset.press;
|
|
2533
|
+
}, 450);
|
|
2534
|
+
});
|
|
2330
2535
|
el("namespace", HTMLSelectElement).addEventListener("change", () => {
|
|
2331
2536
|
state.namespace = el("namespace", HTMLSelectElement).value;
|
|
2332
2537
|
refresh().catch(showError);
|
|
@@ -2337,7 +2542,7 @@ function bootAdmin(config) {
|
|
|
2337
2542
|
refresh().catch(showError);
|
|
2338
2543
|
});
|
|
2339
2544
|
el("refresh", HTMLButtonElement).addEventListener("click", () => {
|
|
2340
|
-
refresh().catch(showError);
|
|
2545
|
+
confirmAction(el("refresh", HTMLButtonElement), "Refreshing...", "Updated", () => refresh()).catch(showError);
|
|
2341
2546
|
});
|
|
2342
2547
|
el("collections", HTMLElement).addEventListener("click", (event) => {
|
|
2343
2548
|
const target = event.target;
|
|
@@ -2460,10 +2665,10 @@ function bootAdmin(config) {
|
|
|
2460
2665
|
}).then(() => renderFaults()).catch(showError);
|
|
2461
2666
|
});
|
|
2462
2667
|
el("fault-clear", HTMLButtonElement).addEventListener("click", () => {
|
|
2463
|
-
api("DELETE", "/faults").then(() => renderFaults()).catch(showError);
|
|
2668
|
+
confirmAction(el("fault-clear", HTMLButtonElement), "Clearing...", "Cleared", () => api("DELETE", "/faults").then(() => renderFaults())).catch(showError);
|
|
2464
2669
|
});
|
|
2465
2670
|
el("journal-clear", HTMLButtonElement).addEventListener("click", () => {
|
|
2466
|
-
api("DELETE", "/requests").then(() => renderJournal()).catch(showError);
|
|
2671
|
+
confirmAction(el("journal-clear", HTMLButtonElement), "Clearing...", "Cleared", () => api("DELETE", "/requests").then(() => renderJournal())).catch(showError);
|
|
2467
2672
|
});
|
|
2468
2673
|
el("route-list", HTMLElement).addEventListener("click", (event) => {
|
|
2469
2674
|
const target = event.target;
|
|
@@ -2519,6 +2724,22 @@ function bootAdmin(config) {
|
|
|
2519
2724
|
panel.script = value.script;
|
|
2520
2725
|
return panel;
|
|
2521
2726
|
};
|
|
2727
|
+
const decodeExtension = (value) => {
|
|
2728
|
+
if (!isRecord2(value))
|
|
2729
|
+
return void 0;
|
|
2730
|
+
if (value.kind === "sql") {
|
|
2731
|
+
return {
|
|
2732
|
+
kind: "sql",
|
|
2733
|
+
id: typeof value.id === "string" && value.id !== "" ? value.id : "sql",
|
|
2734
|
+
title: typeof value.title === "string" && value.title !== "" ? value.title : "SQL",
|
|
2735
|
+
description: typeof value.description === "string" ? value.description : "Browse tables and run queries."
|
|
2736
|
+
};
|
|
2737
|
+
}
|
|
2738
|
+
if (value.kind !== "panel")
|
|
2739
|
+
return void 0;
|
|
2740
|
+
const panel = decodePanel(value);
|
|
2741
|
+
return panel === void 0 ? void 0 : { kind: "panel", ...panel };
|
|
2742
|
+
};
|
|
2522
2743
|
const mountPanels = (panels) => {
|
|
2523
2744
|
const nav = el("nav", HTMLElement);
|
|
2524
2745
|
const views = el("views", HTMLElement);
|
|
@@ -2572,15 +2793,57 @@ function bootAdmin(config) {
|
|
|
2572
2793
|
return decoded === void 0 ? [] : [decoded];
|
|
2573
2794
|
});
|
|
2574
2795
|
mountPanels(panels);
|
|
2796
|
+
const extensions = requireList(isRecord2(manifest) ? manifest.extensions : void 0, "Extensions").flatMap((extension) => {
|
|
2797
|
+
const decoded = decodeExtension(extension);
|
|
2798
|
+
return decoded === void 0 ? [] : [decoded];
|
|
2799
|
+
});
|
|
2800
|
+
const extensionPanels = extensions.flatMap((extension) => extension.kind === "panel" ? [extension] : []);
|
|
2801
|
+
mountPanels(extensionPanels);
|
|
2802
|
+
for (const extension of extensions) {
|
|
2803
|
+
if (extension.kind !== "sql")
|
|
2804
|
+
continue;
|
|
2805
|
+
const nav = el("nav", HTMLElement);
|
|
2806
|
+
const views = el("views", HTMLElement);
|
|
2807
|
+
const button = document.createElement("button");
|
|
2808
|
+
button.type = "button";
|
|
2809
|
+
button.dataset.view = extension.id;
|
|
2810
|
+
button.textContent = extension.title;
|
|
2811
|
+
nav.append(button);
|
|
2812
|
+
const section = document.createElement("section");
|
|
2813
|
+
section.className = "view";
|
|
2814
|
+
section.id = `view-${extension.id}`;
|
|
2815
|
+
section.hidden = true;
|
|
2816
|
+
const title = document.createElement("h2");
|
|
2817
|
+
title.textContent = extension.title;
|
|
2818
|
+
const lede = document.createElement("p");
|
|
2819
|
+
lede.className = "lede";
|
|
2820
|
+
lede.textContent = extension.description;
|
|
2821
|
+
const body = document.createElement("div");
|
|
2822
|
+
body.className = "panel-body";
|
|
2823
|
+
section.append(title, lede, body);
|
|
2824
|
+
views.append(section);
|
|
2825
|
+
mountSqlExplorer(body, panelApi);
|
|
2826
|
+
}
|
|
2575
2827
|
return refresh();
|
|
2576
2828
|
}).catch(showError);
|
|
2577
2829
|
}
|
|
2578
|
-
var clientPrelude = [
|
|
2830
|
+
var clientPrelude = [
|
|
2831
|
+
isRecord2,
|
|
2832
|
+
mountAdminBrand,
|
|
2833
|
+
startAdminBrand,
|
|
2834
|
+
faultPresetList,
|
|
2835
|
+
mountSqlExplorer,
|
|
2836
|
+
bootAdmin
|
|
2837
|
+
].map((fn) => fn.toString()).join("\n");
|
|
2579
2838
|
var adminClientSource = (config) => {
|
|
2580
2839
|
const payload = JSON.stringify(config).replace(/</g, "\\u003c");
|
|
2840
|
+
const entry = bootAdmin.name;
|
|
2841
|
+
if (!/^[A-Za-z_$][\w$]*$/.test(entry)) {
|
|
2842
|
+
throw new Error("admin client cannot call its boot function");
|
|
2843
|
+
}
|
|
2581
2844
|
return `<script>
|
|
2582
2845
|
${clientPrelude}
|
|
2583
|
-
|
|
2846
|
+
${entry}(${payload});
|
|
2584
2847
|
</script>`;
|
|
2585
2848
|
};
|
|
2586
2849
|
|
|
@@ -2621,19 +2884,33 @@ var STANDARD_ADMIN_ROUTES = [
|
|
|
2621
2884
|
"GET /ui/manifest"
|
|
2622
2885
|
];
|
|
2623
2886
|
var PANEL_ID = /^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$/;
|
|
2887
|
+
var RESERVED_VIEWS = /* @__PURE__ */ new Set(["overview", "state", "clock", "faults", "journal", "routes"]);
|
|
2888
|
+
var checkPanel = (panel, seen, label) => {
|
|
2889
|
+
if (!PANEL_ID.test(panel.id)) {
|
|
2890
|
+
throw new RangeError(`${label} id must match ${PANEL_ID}: ${JSON.stringify(panel.id)}`);
|
|
2891
|
+
}
|
|
2892
|
+
if (RESERVED_VIEWS.has(panel.id)) {
|
|
2893
|
+
throw new RangeError(`${label} id ${panel.id} is reserved by the admin shell`);
|
|
2894
|
+
}
|
|
2895
|
+
if (seen.has(panel.id))
|
|
2896
|
+
throw new RangeError(`duplicate admin view id ${panel.id}`);
|
|
2897
|
+
seen.add(panel.id);
|
|
2898
|
+
if (panel.title.trim() === "")
|
|
2899
|
+
throw new RangeError(`${label} ${panel.id} needs a title`);
|
|
2900
|
+
};
|
|
2624
2901
|
var assertAdminUi = (ui) => {
|
|
2625
|
-
if (!ui
|
|
2902
|
+
if (!ui)
|
|
2626
2903
|
return;
|
|
2627
2904
|
const seen = /* @__PURE__ */ new Set();
|
|
2628
|
-
for (const panel of ui.panels)
|
|
2629
|
-
|
|
2630
|
-
|
|
2905
|
+
for (const panel of ui.panels ?? [])
|
|
2906
|
+
checkPanel(panel, seen, "admin panel");
|
|
2907
|
+
for (const extension of ui.extensions ?? []) {
|
|
2908
|
+
if (extension.kind === "panel") {
|
|
2909
|
+
checkPanel(extension, seen, "admin extension");
|
|
2910
|
+
continue;
|
|
2631
2911
|
}
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
seen.add(panel.id);
|
|
2635
|
-
if (panel.title.trim() === "")
|
|
2636
|
-
throw new RangeError(`admin panel ${panel.id} needs a title`);
|
|
2912
|
+
const id = extension.id ?? "sql";
|
|
2913
|
+
checkPanel({ id, title: extension.title ?? "SQL" }, seen, "admin extension");
|
|
2637
2914
|
}
|
|
2638
2915
|
};
|
|
2639
2916
|
|
|
@@ -2794,9 +3071,24 @@ var renderAdminDocument = (service) => {
|
|
|
2794
3071
|
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
|
|
2795
3072
|
label.field { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--faint); }
|
|
2796
3073
|
label.field input, label.field select, .controls input[type="password"] {
|
|
2797
|
-
background: var(--bg-inset); border: 1px solid var(--line); border-radius: 8px;
|
|
2798
|
-
padding: 7px 8px; min-height: 36px;
|
|
2799
|
-
}
|
|
3074
|
+
background-color: var(--bg-inset); border: 1px solid var(--line); border-radius: 8px;
|
|
3075
|
+
padding: 7px 8px; min-height: 36px; line-height: 1.2;
|
|
3076
|
+
}
|
|
3077
|
+
/* A native menu ignores min-height, so Preset rendered about half as tall as
|
|
3078
|
+
the text fields in the same form. Paint it like those fields. */
|
|
3079
|
+
label.field select {
|
|
3080
|
+
-webkit-appearance: none; appearance: none;
|
|
3081
|
+
padding-right: 28px;
|
|
3082
|
+
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");
|
|
3083
|
+
background-repeat: no-repeat; background-position: right 10px center; background-size: 12px 12px;
|
|
3084
|
+
}
|
|
3085
|
+
.stack > .field > input,
|
|
3086
|
+
.stack > .field > select,
|
|
3087
|
+
.stack > .field > textarea,
|
|
3088
|
+
dialog .field > input,
|
|
3089
|
+
dialog .field > select,
|
|
3090
|
+
dialog .field > textarea { width: 100%; }
|
|
3091
|
+
.icon-btn, .btn, .btn-primary, .btn-quiet, .btn-danger, nav.side button { cursor: pointer; }
|
|
2800
3092
|
.icon-btn, .btn, .btn-primary, .btn-quiet, .btn-danger {
|
|
2801
3093
|
border-radius: 9px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line);
|
|
2802
3094
|
background: var(--bg-elev);
|
|
@@ -2804,6 +3096,14 @@ var renderAdminDocument = (service) => {
|
|
|
2804
3096
|
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
|
|
2805
3097
|
.btn-quiet { background: transparent; }
|
|
2806
3098
|
.btn-danger { color: var(--err); }
|
|
3099
|
+
/* Held after mouseup. Clearing an empty journal changes nothing on screen,
|
|
3100
|
+
so the press itself has to stay visible. */
|
|
3101
|
+
.icon-btn:active, .btn:active, .btn-quiet:active, .btn-danger:active, nav.side button:active,
|
|
3102
|
+
.icon-btn.pressed, .btn.pressed, .btn-quiet.pressed, .btn-danger.pressed, nav.side button.pressed {
|
|
3103
|
+
background: var(--bg-inset); border-color: var(--line-strong); color: var(--ink);
|
|
3104
|
+
}
|
|
3105
|
+
.btn-danger:active, .btn-danger.pressed { background: var(--err-soft); color: var(--err); }
|
|
3106
|
+
.btn-primary:active, .btn-primary.pressed { filter: brightness(0.88); color: var(--accent-ink); }
|
|
2807
3107
|
/* minmax(0, 1fr): a 1fr column will not shrink below its content, so a long
|
|
2808
3108
|
record or the full nav row would widen the page past the viewport. */
|
|
2809
3109
|
.layout {
|
|
@@ -2844,6 +3144,12 @@ var renderAdminDocument = (service) => {
|
|
|
2844
3144
|
border-radius: 999px; padding: 4px 8px;
|
|
2845
3145
|
}
|
|
2846
3146
|
.chip i { color: var(--faint); font-style: normal; }
|
|
3147
|
+
.sql-layout {
|
|
3148
|
+
display: grid; grid-template-columns: minmax(10rem, 16rem) minmax(0, 1fr); gap: 16px;
|
|
3149
|
+
}
|
|
3150
|
+
.sql-tables { display: flex; flex-direction: column; gap: 4px; max-height: 28rem; overflow: auto; }
|
|
3151
|
+
.sql-tables button { text-align: left; }
|
|
3152
|
+
.sql-input { font-family: var(--mono); min-height: 7rem; width: 100%; }
|
|
2847
3153
|
table { width: 100%; border-collapse: collapse; font-size: 14px; }
|
|
2848
3154
|
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
|
|
2849
3155
|
th { color: var(--faint); font-weight: 600; font-size: 12px; }
|
|
@@ -2892,14 +3198,22 @@ var renderAdminDocument = (service) => {
|
|
|
2892
3198
|
input, select, textarea { font-size: 16px; }
|
|
2893
3199
|
.brand, .vendor, .controls { width: 100%; }
|
|
2894
3200
|
label.field, label.field select, label.field input { flex: 1; min-width: 0; }
|
|
2895
|
-
|
|
3201
|
+
/* The layout fills the screen. A single-column grid stretches every auto
|
|
3202
|
+
row, so the tab bar grew with the leftover height and the buttons floated
|
|
3203
|
+
in the middle of it. The bar stays one row; the page below takes the rest. */
|
|
3204
|
+
.layout {
|
|
3205
|
+
grid-template-columns: minmax(0, 1fr);
|
|
3206
|
+
grid-template-rows: auto minmax(0, 1fr);
|
|
3207
|
+
align-content: start;
|
|
3208
|
+
}
|
|
2896
3209
|
nav.side {
|
|
3210
|
+
align-self: start; height: auto;
|
|
2897
3211
|
flex-direction: row; align-items: center; overflow-x: auto; min-width: 0;
|
|
2898
3212
|
border-right: 0; border-bottom: 1px solid var(--line);
|
|
2899
3213
|
padding: 8px;
|
|
2900
3214
|
}
|
|
2901
3215
|
nav.side button { white-space: nowrap; flex: none; }
|
|
2902
|
-
.split { grid-template-columns: minmax(0, 1fr); }
|
|
3216
|
+
.split, .sql-layout { grid-template-columns: minmax(0, 1fr); }
|
|
2903
3217
|
main { padding: 14px; }
|
|
2904
3218
|
table, thead, tbody, tr, th, td { display: block; }
|
|
2905
3219
|
thead { display: none; }
|
|
@@ -3070,6 +3384,24 @@ var json2 = (body) => new Response(JSON.stringify(body), {
|
|
|
3070
3384
|
status: 200,
|
|
3071
3385
|
headers: { "content-type": "application/json; charset=utf-8" }
|
|
3072
3386
|
});
|
|
3387
|
+
var describeExtension = (extension) => {
|
|
3388
|
+
if (extension.kind === "sql") {
|
|
3389
|
+
return {
|
|
3390
|
+
kind: "sql",
|
|
3391
|
+
id: extension.id ?? "sql",
|
|
3392
|
+
title: extension.title ?? "SQL",
|
|
3393
|
+
...extension.description !== void 0 ? { description: extension.description } : {}
|
|
3394
|
+
};
|
|
3395
|
+
}
|
|
3396
|
+
return {
|
|
3397
|
+
kind: "panel",
|
|
3398
|
+
id: extension.id,
|
|
3399
|
+
title: extension.title,
|
|
3400
|
+
...extension.description !== void 0 ? { description: extension.description } : {},
|
|
3401
|
+
html: extension.html,
|
|
3402
|
+
...extension.script !== void 0 ? { script: extension.script } : {}
|
|
3403
|
+
};
|
|
3404
|
+
};
|
|
3073
3405
|
var adminUiRoutes = (service, ui) => {
|
|
3074
3406
|
const shell = () => renderAdminDocument(service);
|
|
3075
3407
|
const document3 = () => ui?.render ? ui.render({ service, defaultHtml: shell }) : shell();
|
|
@@ -3084,7 +3416,8 @@ var adminUiRoutes = (service, ui) => {
|
|
|
3084
3416
|
...panel.description !== void 0 ? { description: panel.description } : {},
|
|
3085
3417
|
html: panel.html,
|
|
3086
3418
|
...panel.script !== void 0 ? { script: panel.script } : {}
|
|
3087
|
-
}))
|
|
3419
|
+
})),
|
|
3420
|
+
extensions: (ui?.extensions ?? []).map(describeExtension)
|
|
3088
3421
|
})
|
|
3089
3422
|
};
|
|
3090
3423
|
};
|
|
@@ -3761,7 +4094,7 @@ var stateAdminRoutes = (routes) => {
|
|
|
3761
4094
|
};
|
|
3762
4095
|
|
|
3763
4096
|
// ../core/dist/version.js
|
|
3764
|
-
var PACKAGE_VERSION = true ? "1.
|
|
4097
|
+
var PACKAGE_VERSION = true ? "1.7.0" : UNRELEASED_VERSION;
|
|
3765
4098
|
|
|
3766
4099
|
// ../core/dist/signing.js
|
|
3767
4100
|
var encoder = new TextEncoder();
|
|
@@ -5687,4 +6020,4 @@ export {
|
|
|
5687
6020
|
envelope,
|
|
5688
6021
|
FullscriptAPI
|
|
5689
6022
|
};
|
|
5690
|
-
//# sourceMappingURL=chunk-
|
|
6023
|
+
//# sourceMappingURL=chunk-Q5BBSHKJ.js.map
|