@crvouga/mockingbird-service-bedrock 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-ADATNW7Q.js → chunk-SW6PBMOC.js} +2 -2
- package/dist/{chunk-KLUDFWGJ.js → chunk-VWANBYFI.js} +355 -22
- package/dist/chunk-VWANBYFI.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-KLUDFWGJ.js.map +0 -7
- /package/dist/{chunk-ADATNW7Q.js.map → chunk-SW6PBMOC.js.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
# Changelog — @crvouga/mockingbird-service-bedrock
|
|
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,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createRuntime,
|
|
3
3
|
parseScript
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-VWANBYFI.js";
|
|
5
5
|
|
|
6
6
|
// src/h2c.ts
|
|
7
7
|
import {
|
|
@@ -296,4 +296,4 @@ export {
|
|
|
296
296
|
createServer,
|
|
297
297
|
serveTarget
|
|
298
298
|
};
|
|
299
|
-
//# sourceMappingURL=chunk-
|
|
299
|
+
//# sourceMappingURL=chunk-SW6PBMOC.js.map
|
|
@@ -1866,6 +1866,167 @@ function faultPresetList(value) {
|
|
|
1866
1866
|
})
|
|
1867
1867
|
};
|
|
1868
1868
|
}
|
|
1869
|
+
function mountSqlExplorer(root, api) {
|
|
1870
|
+
const cell = (value) => {
|
|
1871
|
+
if (value === null || value === void 0)
|
|
1872
|
+
return "";
|
|
1873
|
+
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
1874
|
+
return String(value);
|
|
1875
|
+
}
|
|
1876
|
+
return JSON.stringify(value) ?? "";
|
|
1877
|
+
};
|
|
1878
|
+
root.replaceChildren();
|
|
1879
|
+
const layout = document.createElement("div");
|
|
1880
|
+
layout.className = "sql-layout";
|
|
1881
|
+
const tables = document.createElement("div");
|
|
1882
|
+
tables.className = "sql-tables";
|
|
1883
|
+
const stack = document.createElement("div");
|
|
1884
|
+
stack.className = "stack";
|
|
1885
|
+
const banner = document.createElement("p");
|
|
1886
|
+
banner.className = "banner";
|
|
1887
|
+
const grid = document.createElement("div");
|
|
1888
|
+
const input = document.createElement("textarea");
|
|
1889
|
+
input.className = "sql-input";
|
|
1890
|
+
input.spellcheck = false;
|
|
1891
|
+
input.placeholder = "SELECT * FROM ...";
|
|
1892
|
+
const actions = document.createElement("div");
|
|
1893
|
+
actions.className = "row-actions";
|
|
1894
|
+
const run = document.createElement("button");
|
|
1895
|
+
run.type = "button";
|
|
1896
|
+
run.textContent = "Run";
|
|
1897
|
+
actions.append(run);
|
|
1898
|
+
const result = document.createElement("pre");
|
|
1899
|
+
stack.append(banner, grid, input, actions, result);
|
|
1900
|
+
layout.append(tables, stack);
|
|
1901
|
+
root.append(layout);
|
|
1902
|
+
const showError = (error) => {
|
|
1903
|
+
banner.textContent = error instanceof Error ? error.message : String(error);
|
|
1904
|
+
banner.classList.add("show");
|
|
1905
|
+
};
|
|
1906
|
+
const clearError = () => {
|
|
1907
|
+
banner.textContent = "";
|
|
1908
|
+
banner.classList.remove("show");
|
|
1909
|
+
};
|
|
1910
|
+
const renderGrid = (columns, rows) => {
|
|
1911
|
+
grid.replaceChildren();
|
|
1912
|
+
if (columns.length === 0) {
|
|
1913
|
+
const empty = document.createElement("p");
|
|
1914
|
+
empty.className = "empty";
|
|
1915
|
+
empty.textContent = "No rows.";
|
|
1916
|
+
grid.append(empty);
|
|
1917
|
+
return;
|
|
1918
|
+
}
|
|
1919
|
+
const table = document.createElement("table");
|
|
1920
|
+
const head = document.createElement("thead");
|
|
1921
|
+
const headRow = document.createElement("tr");
|
|
1922
|
+
for (const column of columns) {
|
|
1923
|
+
const th = document.createElement("th");
|
|
1924
|
+
th.textContent = column;
|
|
1925
|
+
headRow.append(th);
|
|
1926
|
+
}
|
|
1927
|
+
head.append(headRow);
|
|
1928
|
+
const body = document.createElement("tbody");
|
|
1929
|
+
for (const row of rows) {
|
|
1930
|
+
const tr = document.createElement("tr");
|
|
1931
|
+
for (const column of columns) {
|
|
1932
|
+
const td = document.createElement("td");
|
|
1933
|
+
td.dataset.label = column;
|
|
1934
|
+
td.textContent = cell(row[column]);
|
|
1935
|
+
tr.append(td);
|
|
1936
|
+
}
|
|
1937
|
+
body.append(tr);
|
|
1938
|
+
}
|
|
1939
|
+
table.append(head, body);
|
|
1940
|
+
grid.append(table);
|
|
1941
|
+
};
|
|
1942
|
+
const rowsOf = (value) => {
|
|
1943
|
+
if (!isRecord2(value) || !Array.isArray(value.rows))
|
|
1944
|
+
return [];
|
|
1945
|
+
return value.rows.flatMap((row) => isRecord2(row) ? [row] : []);
|
|
1946
|
+
};
|
|
1947
|
+
const columnsOf = (value, rows) => {
|
|
1948
|
+
if (isRecord2(value) && Array.isArray(value.columns)) {
|
|
1949
|
+
const named = value.columns.flatMap((column) => typeof column === "string" ? [column] : []);
|
|
1950
|
+
if (named.length > 0)
|
|
1951
|
+
return named;
|
|
1952
|
+
}
|
|
1953
|
+
const first = rows[0];
|
|
1954
|
+
return first === void 0 ? [] : Object.keys(first);
|
|
1955
|
+
};
|
|
1956
|
+
let selected = "";
|
|
1957
|
+
const loadPage = async (schema, name) => {
|
|
1958
|
+
selected = `${schema}.${name}`;
|
|
1959
|
+
const page = await api.get(`/sql/tables/${encodeURIComponent(schema)}/${encodeURIComponent(name)}?limit=50`);
|
|
1960
|
+
const rows = rowsOf(page);
|
|
1961
|
+
renderGrid(columnsOf(page, rows), rows);
|
|
1962
|
+
const total = isRecord2(page) && typeof page.total === "number" ? page.total : rows.length;
|
|
1963
|
+
result.textContent = `${selected} \xB7 ${total} rows`;
|
|
1964
|
+
for (const button of tables.querySelectorAll("button")) {
|
|
1965
|
+
if (!(button instanceof HTMLButtonElement))
|
|
1966
|
+
continue;
|
|
1967
|
+
button.setAttribute("aria-current", button.dataset.schema === schema && button.dataset.table === name ? "true" : "false");
|
|
1968
|
+
}
|
|
1969
|
+
};
|
|
1970
|
+
const loadTables = async () => {
|
|
1971
|
+
const payload = await api.get("/sql/tables");
|
|
1972
|
+
const listed = isRecord2(payload) && Array.isArray(payload.tables) ? payload.tables : [];
|
|
1973
|
+
tables.replaceChildren();
|
|
1974
|
+
if (listed.length === 0) {
|
|
1975
|
+
const empty = document.createElement("p");
|
|
1976
|
+
empty.className = "empty";
|
|
1977
|
+
empty.textContent = "No tables.";
|
|
1978
|
+
tables.append(empty);
|
|
1979
|
+
return;
|
|
1980
|
+
}
|
|
1981
|
+
for (const item of listed) {
|
|
1982
|
+
if (!isRecord2(item) || typeof item.schema !== "string" || typeof item.name !== "string")
|
|
1983
|
+
continue;
|
|
1984
|
+
const button = document.createElement("button");
|
|
1985
|
+
button.type = "button";
|
|
1986
|
+
button.dataset.schema = item.schema;
|
|
1987
|
+
button.dataset.table = item.name;
|
|
1988
|
+
button.textContent = `${item.schema}.${item.name}`;
|
|
1989
|
+
tables.append(button);
|
|
1990
|
+
}
|
|
1991
|
+
};
|
|
1992
|
+
tables.addEventListener("click", (event) => {
|
|
1993
|
+
const target = event.target;
|
|
1994
|
+
if (!(target instanceof Element))
|
|
1995
|
+
return;
|
|
1996
|
+
const button = target.closest("button");
|
|
1997
|
+
if (!(button instanceof HTMLButtonElement))
|
|
1998
|
+
return;
|
|
1999
|
+
const schema = button.dataset.schema;
|
|
2000
|
+
const name = button.dataset.table;
|
|
2001
|
+
if (schema === void 0 || name === void 0)
|
|
2002
|
+
return;
|
|
2003
|
+
clearError();
|
|
2004
|
+
loadPage(schema, name).catch(showError);
|
|
2005
|
+
});
|
|
2006
|
+
run.addEventListener("click", () => {
|
|
2007
|
+
const sql = input.value.trim();
|
|
2008
|
+
if (sql === "") {
|
|
2009
|
+
showError(new Error("Enter a statement"));
|
|
2010
|
+
return;
|
|
2011
|
+
}
|
|
2012
|
+
clearError();
|
|
2013
|
+
api.send("POST", "/sql/query", { sql }).then((payload) => {
|
|
2014
|
+
const rows = rowsOf(payload);
|
|
2015
|
+
renderGrid(columnsOf(payload, rows), rows);
|
|
2016
|
+
const count = isRecord2(payload) && typeof payload.rowCount === "number" ? payload.rowCount : rows.length;
|
|
2017
|
+
const truncated = isRecord2(payload) && payload.truncated === true ? " (truncated)" : "";
|
|
2018
|
+
result.textContent = `${count} rows${truncated}`;
|
|
2019
|
+
}).catch(showError);
|
|
2020
|
+
});
|
|
2021
|
+
const namespace = document.getElementById("namespace");
|
|
2022
|
+
if (namespace) {
|
|
2023
|
+
namespace.addEventListener("change", () => {
|
|
2024
|
+
clearError();
|
|
2025
|
+
loadTables().catch(showError);
|
|
2026
|
+
});
|
|
2027
|
+
}
|
|
2028
|
+
loadTables().catch(showError);
|
|
2029
|
+
}
|
|
1869
2030
|
function bootAdmin(config) {
|
|
1870
2031
|
const fieldKinds = ["string", "number", "boolean", "null", "object", "array", "unknown"];
|
|
1871
2032
|
const sources = ["declared", "inferred", "mixed"];
|
|
@@ -2306,6 +2467,50 @@ function bootAdmin(config) {
|
|
|
2306
2467
|
if (render)
|
|
2307
2468
|
await render();
|
|
2308
2469
|
}
|
|
2470
|
+
const delay = (ms) => new Promise((resolve) => {
|
|
2471
|
+
window.setTimeout(resolve, ms);
|
|
2472
|
+
});
|
|
2473
|
+
const confirmAction = async (button, pending, done, work) => {
|
|
2474
|
+
if (button.dataset.pending === "1")
|
|
2475
|
+
return;
|
|
2476
|
+
const label = button.textContent ?? "";
|
|
2477
|
+
const width = button.offsetWidth;
|
|
2478
|
+
button.dataset.pending = "1";
|
|
2479
|
+
button.classList.add("pressed");
|
|
2480
|
+
button.setAttribute("aria-busy", "true");
|
|
2481
|
+
button.style.minWidth = `${width}px`;
|
|
2482
|
+
button.textContent = pending;
|
|
2483
|
+
try {
|
|
2484
|
+
await work();
|
|
2485
|
+
button.textContent = done;
|
|
2486
|
+
await delay(1e3);
|
|
2487
|
+
} catch (error) {
|
|
2488
|
+
showError(error);
|
|
2489
|
+
} finally {
|
|
2490
|
+
button.textContent = label;
|
|
2491
|
+
button.style.minWidth = "";
|
|
2492
|
+
button.classList.remove("pressed");
|
|
2493
|
+
button.removeAttribute("aria-busy");
|
|
2494
|
+
delete button.dataset.pending;
|
|
2495
|
+
}
|
|
2496
|
+
};
|
|
2497
|
+
document.addEventListener("click", (event) => {
|
|
2498
|
+
const target = event.target;
|
|
2499
|
+
if (!(target instanceof Element))
|
|
2500
|
+
return;
|
|
2501
|
+
const button = target.closest("button");
|
|
2502
|
+
if (!(button instanceof HTMLButtonElement) || button.dataset.pending === "1")
|
|
2503
|
+
return;
|
|
2504
|
+
button.classList.add("pressed");
|
|
2505
|
+
const token = String(Date.now());
|
|
2506
|
+
button.dataset.press = token;
|
|
2507
|
+
window.setTimeout(() => {
|
|
2508
|
+
if (button.dataset.press !== token || button.dataset.pending === "1")
|
|
2509
|
+
return;
|
|
2510
|
+
button.classList.remove("pressed");
|
|
2511
|
+
delete button.dataset.press;
|
|
2512
|
+
}, 450);
|
|
2513
|
+
});
|
|
2309
2514
|
el("namespace", HTMLSelectElement).addEventListener("change", () => {
|
|
2310
2515
|
state.namespace = el("namespace", HTMLSelectElement).value;
|
|
2311
2516
|
refresh().catch(showError);
|
|
@@ -2316,7 +2521,7 @@ function bootAdmin(config) {
|
|
|
2316
2521
|
refresh().catch(showError);
|
|
2317
2522
|
});
|
|
2318
2523
|
el("refresh", HTMLButtonElement).addEventListener("click", () => {
|
|
2319
|
-
refresh().catch(showError);
|
|
2524
|
+
confirmAction(el("refresh", HTMLButtonElement), "Refreshing...", "Updated", () => refresh()).catch(showError);
|
|
2320
2525
|
});
|
|
2321
2526
|
el("collections", HTMLElement).addEventListener("click", (event) => {
|
|
2322
2527
|
const target = event.target;
|
|
@@ -2439,10 +2644,10 @@ function bootAdmin(config) {
|
|
|
2439
2644
|
}).then(() => renderFaults()).catch(showError);
|
|
2440
2645
|
});
|
|
2441
2646
|
el("fault-clear", HTMLButtonElement).addEventListener("click", () => {
|
|
2442
|
-
api("DELETE", "/faults").then(() => renderFaults()).catch(showError);
|
|
2647
|
+
confirmAction(el("fault-clear", HTMLButtonElement), "Clearing...", "Cleared", () => api("DELETE", "/faults").then(() => renderFaults())).catch(showError);
|
|
2443
2648
|
});
|
|
2444
2649
|
el("journal-clear", HTMLButtonElement).addEventListener("click", () => {
|
|
2445
|
-
api("DELETE", "/requests").then(() => renderJournal()).catch(showError);
|
|
2650
|
+
confirmAction(el("journal-clear", HTMLButtonElement), "Clearing...", "Cleared", () => api("DELETE", "/requests").then(() => renderJournal())).catch(showError);
|
|
2446
2651
|
});
|
|
2447
2652
|
el("route-list", HTMLElement).addEventListener("click", (event) => {
|
|
2448
2653
|
const target = event.target;
|
|
@@ -2498,6 +2703,22 @@ function bootAdmin(config) {
|
|
|
2498
2703
|
panel.script = value.script;
|
|
2499
2704
|
return panel;
|
|
2500
2705
|
};
|
|
2706
|
+
const decodeExtension = (value) => {
|
|
2707
|
+
if (!isRecord2(value))
|
|
2708
|
+
return void 0;
|
|
2709
|
+
if (value.kind === "sql") {
|
|
2710
|
+
return {
|
|
2711
|
+
kind: "sql",
|
|
2712
|
+
id: typeof value.id === "string" && value.id !== "" ? value.id : "sql",
|
|
2713
|
+
title: typeof value.title === "string" && value.title !== "" ? value.title : "SQL",
|
|
2714
|
+
description: typeof value.description === "string" ? value.description : "Browse tables and run queries."
|
|
2715
|
+
};
|
|
2716
|
+
}
|
|
2717
|
+
if (value.kind !== "panel")
|
|
2718
|
+
return void 0;
|
|
2719
|
+
const panel = decodePanel(value);
|
|
2720
|
+
return panel === void 0 ? void 0 : { kind: "panel", ...panel };
|
|
2721
|
+
};
|
|
2501
2722
|
const mountPanels = (panels) => {
|
|
2502
2723
|
const nav = el("nav", HTMLElement);
|
|
2503
2724
|
const views = el("views", HTMLElement);
|
|
@@ -2551,15 +2772,57 @@ function bootAdmin(config) {
|
|
|
2551
2772
|
return decoded === void 0 ? [] : [decoded];
|
|
2552
2773
|
});
|
|
2553
2774
|
mountPanels(panels);
|
|
2775
|
+
const extensions = requireList(isRecord2(manifest) ? manifest.extensions : void 0, "Extensions").flatMap((extension) => {
|
|
2776
|
+
const decoded = decodeExtension(extension);
|
|
2777
|
+
return decoded === void 0 ? [] : [decoded];
|
|
2778
|
+
});
|
|
2779
|
+
const extensionPanels = extensions.flatMap((extension) => extension.kind === "panel" ? [extension] : []);
|
|
2780
|
+
mountPanels(extensionPanels);
|
|
2781
|
+
for (const extension of extensions) {
|
|
2782
|
+
if (extension.kind !== "sql")
|
|
2783
|
+
continue;
|
|
2784
|
+
const nav = el("nav", HTMLElement);
|
|
2785
|
+
const views = el("views", HTMLElement);
|
|
2786
|
+
const button = document.createElement("button");
|
|
2787
|
+
button.type = "button";
|
|
2788
|
+
button.dataset.view = extension.id;
|
|
2789
|
+
button.textContent = extension.title;
|
|
2790
|
+
nav.append(button);
|
|
2791
|
+
const section = document.createElement("section");
|
|
2792
|
+
section.className = "view";
|
|
2793
|
+
section.id = `view-${extension.id}`;
|
|
2794
|
+
section.hidden = true;
|
|
2795
|
+
const title = document.createElement("h2");
|
|
2796
|
+
title.textContent = extension.title;
|
|
2797
|
+
const lede = document.createElement("p");
|
|
2798
|
+
lede.className = "lede";
|
|
2799
|
+
lede.textContent = extension.description;
|
|
2800
|
+
const body = document.createElement("div");
|
|
2801
|
+
body.className = "panel-body";
|
|
2802
|
+
section.append(title, lede, body);
|
|
2803
|
+
views.append(section);
|
|
2804
|
+
mountSqlExplorer(body, panelApi);
|
|
2805
|
+
}
|
|
2554
2806
|
return refresh();
|
|
2555
2807
|
}).catch(showError);
|
|
2556
2808
|
}
|
|
2557
|
-
var clientPrelude = [
|
|
2809
|
+
var clientPrelude = [
|
|
2810
|
+
isRecord2,
|
|
2811
|
+
mountAdminBrand,
|
|
2812
|
+
startAdminBrand,
|
|
2813
|
+
faultPresetList,
|
|
2814
|
+
mountSqlExplorer,
|
|
2815
|
+
bootAdmin
|
|
2816
|
+
].map((fn) => fn.toString()).join("\n");
|
|
2558
2817
|
var adminClientSource = (config) => {
|
|
2559
2818
|
const payload = JSON.stringify(config).replace(/</g, "\\u003c");
|
|
2819
|
+
const entry = bootAdmin.name;
|
|
2820
|
+
if (!/^[A-Za-z_$][\w$]*$/.test(entry)) {
|
|
2821
|
+
throw new Error("admin client cannot call its boot function");
|
|
2822
|
+
}
|
|
2560
2823
|
return `<script>
|
|
2561
2824
|
${clientPrelude}
|
|
2562
|
-
|
|
2825
|
+
${entry}(${payload});
|
|
2563
2826
|
</script>`;
|
|
2564
2827
|
};
|
|
2565
2828
|
|
|
@@ -2600,19 +2863,33 @@ var STANDARD_ADMIN_ROUTES = [
|
|
|
2600
2863
|
"GET /ui/manifest"
|
|
2601
2864
|
];
|
|
2602
2865
|
var PANEL_ID = /^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$/;
|
|
2866
|
+
var RESERVED_VIEWS = /* @__PURE__ */ new Set(["overview", "state", "clock", "faults", "journal", "routes"]);
|
|
2867
|
+
var checkPanel = (panel, seen, label) => {
|
|
2868
|
+
if (!PANEL_ID.test(panel.id)) {
|
|
2869
|
+
throw new RangeError(`${label} id must match ${PANEL_ID}: ${JSON.stringify(panel.id)}`);
|
|
2870
|
+
}
|
|
2871
|
+
if (RESERVED_VIEWS.has(panel.id)) {
|
|
2872
|
+
throw new RangeError(`${label} id ${panel.id} is reserved by the admin shell`);
|
|
2873
|
+
}
|
|
2874
|
+
if (seen.has(panel.id))
|
|
2875
|
+
throw new RangeError(`duplicate admin view id ${panel.id}`);
|
|
2876
|
+
seen.add(panel.id);
|
|
2877
|
+
if (panel.title.trim() === "")
|
|
2878
|
+
throw new RangeError(`${label} ${panel.id} needs a title`);
|
|
2879
|
+
};
|
|
2603
2880
|
var assertAdminUi = (ui) => {
|
|
2604
|
-
if (!ui
|
|
2881
|
+
if (!ui)
|
|
2605
2882
|
return;
|
|
2606
2883
|
const seen = /* @__PURE__ */ new Set();
|
|
2607
|
-
for (const panel of ui.panels)
|
|
2608
|
-
|
|
2609
|
-
|
|
2884
|
+
for (const panel of ui.panels ?? [])
|
|
2885
|
+
checkPanel(panel, seen, "admin panel");
|
|
2886
|
+
for (const extension of ui.extensions ?? []) {
|
|
2887
|
+
if (extension.kind === "panel") {
|
|
2888
|
+
checkPanel(extension, seen, "admin extension");
|
|
2889
|
+
continue;
|
|
2610
2890
|
}
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
seen.add(panel.id);
|
|
2614
|
-
if (panel.title.trim() === "")
|
|
2615
|
-
throw new RangeError(`admin panel ${panel.id} needs a title`);
|
|
2891
|
+
const id = extension.id ?? "sql";
|
|
2892
|
+
checkPanel({ id, title: extension.title ?? "SQL" }, seen, "admin extension");
|
|
2616
2893
|
}
|
|
2617
2894
|
};
|
|
2618
2895
|
|
|
@@ -2773,9 +3050,24 @@ var renderAdminDocument = (service) => {
|
|
|
2773
3050
|
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
|
|
2774
3051
|
label.field { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--faint); }
|
|
2775
3052
|
label.field input, label.field select, .controls input[type="password"] {
|
|
2776
|
-
background: var(--bg-inset); border: 1px solid var(--line); border-radius: 8px;
|
|
2777
|
-
padding: 7px 8px; min-height: 36px;
|
|
2778
|
-
}
|
|
3053
|
+
background-color: var(--bg-inset); border: 1px solid var(--line); border-radius: 8px;
|
|
3054
|
+
padding: 7px 8px; min-height: 36px; line-height: 1.2;
|
|
3055
|
+
}
|
|
3056
|
+
/* A native menu ignores min-height, so Preset rendered about half as tall as
|
|
3057
|
+
the text fields in the same form. Paint it like those fields. */
|
|
3058
|
+
label.field select {
|
|
3059
|
+
-webkit-appearance: none; appearance: none;
|
|
3060
|
+
padding-right: 28px;
|
|
3061
|
+
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");
|
|
3062
|
+
background-repeat: no-repeat; background-position: right 10px center; background-size: 12px 12px;
|
|
3063
|
+
}
|
|
3064
|
+
.stack > .field > input,
|
|
3065
|
+
.stack > .field > select,
|
|
3066
|
+
.stack > .field > textarea,
|
|
3067
|
+
dialog .field > input,
|
|
3068
|
+
dialog .field > select,
|
|
3069
|
+
dialog .field > textarea { width: 100%; }
|
|
3070
|
+
.icon-btn, .btn, .btn-primary, .btn-quiet, .btn-danger, nav.side button { cursor: pointer; }
|
|
2779
3071
|
.icon-btn, .btn, .btn-primary, .btn-quiet, .btn-danger {
|
|
2780
3072
|
border-radius: 9px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line);
|
|
2781
3073
|
background: var(--bg-elev);
|
|
@@ -2783,6 +3075,14 @@ var renderAdminDocument = (service) => {
|
|
|
2783
3075
|
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
|
|
2784
3076
|
.btn-quiet { background: transparent; }
|
|
2785
3077
|
.btn-danger { color: var(--err); }
|
|
3078
|
+
/* Held after mouseup. Clearing an empty journal changes nothing on screen,
|
|
3079
|
+
so the press itself has to stay visible. */
|
|
3080
|
+
.icon-btn:active, .btn:active, .btn-quiet:active, .btn-danger:active, nav.side button:active,
|
|
3081
|
+
.icon-btn.pressed, .btn.pressed, .btn-quiet.pressed, .btn-danger.pressed, nav.side button.pressed {
|
|
3082
|
+
background: var(--bg-inset); border-color: var(--line-strong); color: var(--ink);
|
|
3083
|
+
}
|
|
3084
|
+
.btn-danger:active, .btn-danger.pressed { background: var(--err-soft); color: var(--err); }
|
|
3085
|
+
.btn-primary:active, .btn-primary.pressed { filter: brightness(0.88); color: var(--accent-ink); }
|
|
2786
3086
|
/* minmax(0, 1fr): a 1fr column will not shrink below its content, so a long
|
|
2787
3087
|
record or the full nav row would widen the page past the viewport. */
|
|
2788
3088
|
.layout {
|
|
@@ -2823,6 +3123,12 @@ var renderAdminDocument = (service) => {
|
|
|
2823
3123
|
border-radius: 999px; padding: 4px 8px;
|
|
2824
3124
|
}
|
|
2825
3125
|
.chip i { color: var(--faint); font-style: normal; }
|
|
3126
|
+
.sql-layout {
|
|
3127
|
+
display: grid; grid-template-columns: minmax(10rem, 16rem) minmax(0, 1fr); gap: 16px;
|
|
3128
|
+
}
|
|
3129
|
+
.sql-tables { display: flex; flex-direction: column; gap: 4px; max-height: 28rem; overflow: auto; }
|
|
3130
|
+
.sql-tables button { text-align: left; }
|
|
3131
|
+
.sql-input { font-family: var(--mono); min-height: 7rem; width: 100%; }
|
|
2826
3132
|
table { width: 100%; border-collapse: collapse; font-size: 14px; }
|
|
2827
3133
|
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
|
|
2828
3134
|
th { color: var(--faint); font-weight: 600; font-size: 12px; }
|
|
@@ -2871,14 +3177,22 @@ var renderAdminDocument = (service) => {
|
|
|
2871
3177
|
input, select, textarea { font-size: 16px; }
|
|
2872
3178
|
.brand, .vendor, .controls { width: 100%; }
|
|
2873
3179
|
label.field, label.field select, label.field input { flex: 1; min-width: 0; }
|
|
2874
|
-
|
|
3180
|
+
/* The layout fills the screen. A single-column grid stretches every auto
|
|
3181
|
+
row, so the tab bar grew with the leftover height and the buttons floated
|
|
3182
|
+
in the middle of it. The bar stays one row; the page below takes the rest. */
|
|
3183
|
+
.layout {
|
|
3184
|
+
grid-template-columns: minmax(0, 1fr);
|
|
3185
|
+
grid-template-rows: auto minmax(0, 1fr);
|
|
3186
|
+
align-content: start;
|
|
3187
|
+
}
|
|
2875
3188
|
nav.side {
|
|
3189
|
+
align-self: start; height: auto;
|
|
2876
3190
|
flex-direction: row; align-items: center; overflow-x: auto; min-width: 0;
|
|
2877
3191
|
border-right: 0; border-bottom: 1px solid var(--line);
|
|
2878
3192
|
padding: 8px;
|
|
2879
3193
|
}
|
|
2880
3194
|
nav.side button { white-space: nowrap; flex: none; }
|
|
2881
|
-
.split { grid-template-columns: minmax(0, 1fr); }
|
|
3195
|
+
.split, .sql-layout { grid-template-columns: minmax(0, 1fr); }
|
|
2882
3196
|
main { padding: 14px; }
|
|
2883
3197
|
table, thead, tbody, tr, th, td { display: block; }
|
|
2884
3198
|
thead { display: none; }
|
|
@@ -3049,6 +3363,24 @@ var json2 = (body) => new Response(JSON.stringify(body), {
|
|
|
3049
3363
|
status: 200,
|
|
3050
3364
|
headers: { "content-type": "application/json; charset=utf-8" }
|
|
3051
3365
|
});
|
|
3366
|
+
var describeExtension = (extension) => {
|
|
3367
|
+
if (extension.kind === "sql") {
|
|
3368
|
+
return {
|
|
3369
|
+
kind: "sql",
|
|
3370
|
+
id: extension.id ?? "sql",
|
|
3371
|
+
title: extension.title ?? "SQL",
|
|
3372
|
+
...extension.description !== void 0 ? { description: extension.description } : {}
|
|
3373
|
+
};
|
|
3374
|
+
}
|
|
3375
|
+
return {
|
|
3376
|
+
kind: "panel",
|
|
3377
|
+
id: extension.id,
|
|
3378
|
+
title: extension.title,
|
|
3379
|
+
...extension.description !== void 0 ? { description: extension.description } : {},
|
|
3380
|
+
html: extension.html,
|
|
3381
|
+
...extension.script !== void 0 ? { script: extension.script } : {}
|
|
3382
|
+
};
|
|
3383
|
+
};
|
|
3052
3384
|
var adminUiRoutes = (service, ui) => {
|
|
3053
3385
|
const shell = () => renderAdminDocument(service);
|
|
3054
3386
|
const document3 = () => ui?.render ? ui.render({ service, defaultHtml: shell }) : shell();
|
|
@@ -3063,7 +3395,8 @@ var adminUiRoutes = (service, ui) => {
|
|
|
3063
3395
|
...panel.description !== void 0 ? { description: panel.description } : {},
|
|
3064
3396
|
html: panel.html,
|
|
3065
3397
|
...panel.script !== void 0 ? { script: panel.script } : {}
|
|
3066
|
-
}))
|
|
3398
|
+
})),
|
|
3399
|
+
extensions: (ui?.extensions ?? []).map(describeExtension)
|
|
3067
3400
|
})
|
|
3068
3401
|
};
|
|
3069
3402
|
};
|
|
@@ -3740,7 +4073,7 @@ var stateAdminRoutes = (routes) => {
|
|
|
3740
4073
|
};
|
|
3741
4074
|
|
|
3742
4075
|
// ../core/dist/version.js
|
|
3743
|
-
var PACKAGE_VERSION = true ? "1.
|
|
4076
|
+
var PACKAGE_VERSION = true ? "1.7.0" : UNRELEASED_VERSION;
|
|
3744
4077
|
|
|
3745
4078
|
// ../core/dist/signing.js
|
|
3746
4079
|
var encoder = new TextEncoder();
|
|
@@ -6904,4 +7237,4 @@ export {
|
|
|
6904
7237
|
titanEmbedding,
|
|
6905
7238
|
BedrockAPI
|
|
6906
7239
|
};
|
|
6907
|
-
//# sourceMappingURL=chunk-
|
|
7240
|
+
//# sourceMappingURL=chunk-VWANBYFI.js.map
|